From 065b7310b50582d60a4e1606327fb047fd2dbeef Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Sat, 22 Feb 2025 22:59:23 +0000
Subject: [PATCH] Set the admin_menu action

---
 ai-simplesitestats.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ai-simplesitestats.php b/ai-simplesitestats.php
index 70b26b8..b705d37 100644
--- a/ai-simplesitestats.php
+++ b/ai-simplesitestats.php
@@ -3,7 +3,7 @@
  * Plugin Name: ai-simplesitestats
  * Plugin URI: https://git.autistici.org/noblogs/ai-simplesitestats-plugin
  * Description: Show simple site statistics
- * Version: 0.0.3
+ * Version: 0.0.8
  * Author: Autistici/Inventati
  * Author URI: https://www.autistici.org/
  * License: MIT
@@ -117,7 +117,7 @@ class AiSSS {
         global $blog_id;
         self::$blog_id = $blog_id;
 
-        $this->addStatsPage();
+        add_action('admin_menu', array($this, 'addStatsPage'));
     }
 
     public function addStatsPage() {
@@ -125,7 +125,7 @@ class AiSSS {
         $statsPageId = add_dashboard_page(
             __('Statistics', 'ai-simplesitestats'),
             'Stats',
-            '',                 // cap
+            'read',                // cap
             'ai-sss_stats',
             array($statsPage, 'show'));
         add_action('admin_print_scripts-' . $statsPageId,
-- 
GitLab