Changeset 3372753
- Timestamp:
- 10/04/2025 08:31:46 AM (6 months ago)
- Location:
- maio-the-new-ai-geo-seo-tool/trunk
- Files:
-
- 5 edited
-
css/maio_analytics.css (modified) (1 diff)
-
maio-ai-scanner.php (modified) (8 diffs)
-
maio-main.php (modified) (9 diffs)
-
maio_analytics.php (modified) (9 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
maio-the-new-ai-geo-seo-tool/trunk/css/maio_analytics.css
r3330050 r3372753 97 97 font-weight: 800; 98 98 margin-bottom: 5px; 99 } 100 101 .stat-sublabel { 102 color: #9ca3af; 103 font-size: 0.75rem; 104 font-weight: 500; 105 margin-bottom: 2px; 99 106 } 100 107 -
maio-the-new-ai-geo-seo-tool/trunk/maio-ai-scanner.php
r3371936 r3372753 12 12 // Handle page loading based on tune parameter for AI Scanner categories 13 13 add_action('admin_init', function() { 14 if (isset($_GET['tune']) && isset($_GET['page']) && $_GET['page'] === 'maio-ai-scanner') { 14 // PHP 8.1+ compatibility: sanitize $_GET parameters before comparison 15 $page = isset($_GET['page']) ? sanitize_text_field(wp_unslash($_GET['page'])) : ''; 16 $tune = isset($_GET['tune']) ? sanitize_text_field(wp_unslash($_GET['tune'])) : ''; 17 18 if ($tune && $page === 'maio-ai-scanner') { 15 19 if ( 16 20 !isset($_GET['maio_tune_nonce']) || … … 27 31 'maio-multimodal-context' 28 32 ]; 29 $tune = sanitize_text_field(wp_unslash($_GET['tune']));33 // $tune already sanitized above 30 34 if (in_array($tune, $allowed)) { 31 35 // Store the tune parameter for the main page function to handle … … 38 42 function maio_ai_scanner_enqueue_scripts($hook) { 39 43 // Check if we're on the AI Scanner page 40 if (!isset($_GET['page']) || $_GET['page'] !== 'maio-ai-scanner') { 44 // PHP 8.1+ compatibility: sanitize $_GET['page'] before comparison 45 $page = isset($_GET['page']) ? sanitize_text_field(wp_unslash($_GET['page'])) : ''; 46 if ($page !== 'maio-ai-scanner') { 41 47 return; 42 48 } … … 72 78 // check_ajax_referer('maio_ai_scanner_nonce', 'nonce'); 73 79 74 $url = sanitize_url($_POST['url']); 80 // PHP 8.1+ compatibility: use esc_url_raw instead of non-existent sanitize_url 81 $url = isset($_POST['url']) ? esc_url_raw(wp_unslash($_POST['url'])) : ''; 75 82 76 83 if (empty($url)) { … … 2163 2170 // Read existing sitemap 2164 2171 $sitemap_content = file_get_contents($sitemap_path); 2172 2173 if ($sitemap_content === false) { 2174 return false; 2175 } 2165 2176 2166 2177 // Parse the XML to update lastmod dates … … 4810 4821 <span class="scanning-text" style="display: none;">🔄 Scanning...</span> 4811 4822 </button> 4812 <button onclick="testImprovementPoints()" style="background: red; color: white; padding: 10px; margin-left: 10px;">Test Points</button>4813 4823 </div> 4814 4824 … … 5008 5018 if ($qa_enabled && !is_admin() && (is_single() || is_page() || is_home() || is_front_page())) { 5009 5019 // Get site information for dynamic content 5010 $site_name = get_bloginfo('name'); 5011 $site_description = get_bloginfo('description'); 5020 // PHP 8.1+ compatibility: ensure values are not null 5021 $site_name = get_bloginfo('name') ?: ''; 5022 $site_description = get_bloginfo('description') ?: ''; 5012 5023 5013 5024 // Extract subject from site name or description … … 5622 5633 'timestamp' => time(), 5623 5634 'page_type' => is_single() ? 'post' : (is_page() ? 'page' : 'other'), 5624 'page_url' => sanitize_url($_SERVER['REQUEST_URI'] ?? ''), 5625 'ip_address' => sanitize_text_field($_SERVER['REMOTE_ADDR'] ?? '') 5635 // PHP 8.1+ compatibility: use esc_url_raw instead of non-existent sanitize_url 5636 'page_url' => isset($_SERVER['REQUEST_URI']) ? esc_url_raw(wp_unslash($_SERVER['REQUEST_URI'])) : '', 5637 'ip_address' => isset($_SERVER['REMOTE_ADDR']) ? sanitize_text_field(wp_unslash($_SERVER['REMOTE_ADDR'])) : '' 5626 5638 ]; 5627 5639 -
maio-the-new-ai-geo-seo-tool/trunk/maio-main.php
r3371936 r3372753 4 4 * Plugin URI: https://maioai.com 5 5 * Description: This plugin helps optimize your Website for AI-powered discovery tools such as ChatGPT, Perplexity, Claude, Google Gemini, Google AI Overviews, Meta Llama and many more. It combines the best of traditional SEO and emerging AIO strategies to ensure your brand is accurately and favorably represented in AI-generated content. 6 * Version: 5.1.3 76 * Version: 5.1.39 7 7 * Requires at least: 5.0 8 8 * Requires PHP: 7.2 … … 16 16 17 17 // Define plugin constants 18 define('MAIO_VERSION', '5.1.3 7');18 define('MAIO_VERSION', '5.1.39'); 19 19 define('MAIO_PLUGIN_DIR', plugin_dir_path(__FILE__)); 20 20 define('MAIO_PLUGIN_URL', plugin_dir_url(__FILE__)); … … 263 263 function maio_admin_enqueue_scripts($hook) { 264 264 // Only load on MAIO admin pages 265 if (strpos($hook, 'maio') === false) { 265 // PHP 8.1+ compatibility: ensure $hook is not null 266 if (!$hook || strpos($hook, 'maio') === false) { 266 267 return; 267 268 } 268 269 269 270 // Check if we're on a MAIO page 270 if (!isset($_GET['page']) || strpos((string)sanitize_text_field(wp_unslash($_GET['page'])), 'maio') !== 0) { 271 // PHP 8.1+ compatibility: ensure page parameter exists and is not null 272 $page = isset($_GET['page']) ? sanitize_text_field(wp_unslash($_GET['page'])) : ''; 273 if (!$page || strpos($page, 'maio') !== 0) { 271 274 return; 272 275 } … … 375 378 376 379 // Register AI SEO dashboard as a hidden submenu (accessible by direct link, not shown in menu) 377 add_submenu_page( 378 null, // No parent menu, so it won't show up 380 // PHP 8.1+ compatibility: Use parent slug instead of null to avoid deprecation warnings 381 $dashboard_hook = add_submenu_page( 382 'maio-ai-scanner', // Use parent menu to avoid null 379 383 esc_html__('AI SEO Dashboard', 'maio-the-new-ai-geo-seo-tool'), 380 '', // No menu title, so it won't show up384 esc_html__('AI SEO Dashboard', 'maio-the-new-ai-geo-seo-tool'), 381 385 'manage_options', 382 386 'maio-smart-dashboard', … … 385 389 386 390 // Register the AI-Friendly Article page as a hidden admin page (accessible by direct link, not shown in menu) 387 add_submenu_page( 388 null, // No parent menu, so it won't show up 391 // PHP 8.1+ compatibility: Use parent slug instead of null to avoid deprecation warnings 392 $article_hook = add_submenu_page( 393 'maio-ai-scanner', // Use parent menu to avoid null 389 394 esc_html__('AI-Friendly Content Guide', 'maio-the-new-ai-geo-seo-tool'), 390 '', // No menu title, so it won't show up395 esc_html__('AI-Friendly Content Guide', 'maio-the-new-ai-geo-seo-tool'), 391 396 'manage_options', 392 397 'maio-ai-friendly-article', … … 395 400 } 396 401 add_action('admin_menu', 'maio_register_admin_menu'); 402 403 // Hide specific submenus from appearing in the admin menu 404 add_action('admin_head', function() { 405 // Remove the hidden pages from the submenu array to hide them from display 406 remove_submenu_page('maio-ai-scanner', 'maio-smart-dashboard'); 407 remove_submenu_page('maio-ai-scanner', 'maio-ai-friendly-article'); 408 }); 397 409 398 410 // Register settings … … 1507 1519 // Prevent canonical redirect for /ai-profile endpoint with page_id or post param 1508 1520 add_filter('redirect_canonical', function($redirect_url) { 1521 // PHP 8.1+ compatibility: ensure REQUEST_URI is not null 1509 1522 $request_uri = isset($_SERVER['REQUEST_URI']) ? sanitize_text_field(wp_unslash($_SERVER['REQUEST_URI'])) : ''; 1510 1523 // Nonce check for /ai-profile canonical redirect override … … 1512 1525 if ( 1513 1526 (isset($_GET['maio_ai_profile']) && sanitize_text_field(wp_unslash($_GET['maio_ai_profile'])) == '1' && $valid_nonce) || 1514 (isset($_GET['page_id']) && strpos((string)$request_uri, '/ai-profile') !== false && $valid_nonce) ||1515 (isset($_GET['post']) && strpos((string)$request_uri, '/ai-profile') !== false && $valid_nonce)1527 (isset($_GET['page_id']) && $request_uri && strpos($request_uri, '/ai-profile') !== false && $valid_nonce) || 1528 (isset($_GET['post']) && $request_uri && strpos($request_uri, '/ai-profile') !== false && $valid_nonce) 1516 1529 ) { 1517 1530 return false; … … 2237 2250 add_action('init', function() { 2238 2251 // Prevent double logging for admin-ajax requests 2252 // PHP 8.1+ compatibility: ensure REQUEST_URI is not null 2253 $request_uri = isset($_SERVER['REQUEST_URI']) ? sanitize_text_field(wp_unslash($_SERVER['REQUEST_URI'])) : ''; 2239 2254 if ( 2240 2255 (defined('DOING_AJAX') && DOING_AJAX) || 2241 ( isset($_SERVER['REQUEST_URI']) && strpos(sanitize_text_field(wp_unslash($_SERVER['REQUEST_URI'])), 'admin-ajax.php') !== false)2256 ($request_uri && strpos($request_uri, 'admin-ajax.php') !== false) 2242 2257 ) { 2243 2258 return; -
maio-the-new-ai-geo-seo-tool/trunk/maio_analytics.php
r3368559 r3372753 83 83 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- Custom analytics table requires direct query 84 84 $total_crawls = $wpdb->get_var($wpdb->prepare( 85 "SELECT COUNT(*) FROM {$wpdb->prefix}maio_analytics WHERE access_type = %s ",85 "SELECT COUNT(*) FROM {$wpdb->prefix}maio_analytics WHERE access_type = %s AND crawl_date >= DATE_SUB(NOW(), INTERVAL 30 DAY)", 86 86 'crawler' 87 87 )); … … 89 89 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- Custom analytics table requires direct query 90 90 $pages_indexed = $wpdb->get_var($wpdb->prepare( 91 "SELECT COUNT(DISTINCT page_url) FROM {$wpdb->prefix}maio_analytics WHERE access_type = %s ",91 "SELECT COUNT(DISTINCT page_url) FROM {$wpdb->prefix}maio_analytics WHERE access_type = %s AND crawl_date >= DATE_SUB(NOW(), INTERVAL 30 DAY)", 92 92 'crawler' 93 93 )); … … 95 95 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- Custom analytics table requires direct query 96 96 $success_count = $wpdb->get_var($wpdb->prepare( 97 "SELECT COUNT(*) FROM {$wpdb->prefix}maio_analytics WHERE status = %s AND access_type = %s ",97 "SELECT COUNT(*) FROM {$wpdb->prefix}maio_analytics WHERE status = %s AND access_type = %s AND crawl_date >= DATE_SUB(NOW(), INTERVAL 30 DAY)", 98 98 'success', 99 99 'crawler' … … 257 257 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- Custom analytics table requires direct query 258 258 $total_requests = $wpdb->get_var($wpdb->prepare( 259 "SELECT COUNT(*) FROM {$wpdb->prefix}maio_analytics WHERE access_type = %s ",259 "SELECT COUNT(*) FROM {$wpdb->prefix}maio_analytics WHERE access_type = %s AND crawl_date >= DATE_SUB(NOW(), INTERVAL 30 DAY)", 260 260 'user' 261 261 )); … … 263 263 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- Custom analytics table requires direct query 264 264 $pages_accessed = $wpdb->get_var($wpdb->prepare( 265 "SELECT COUNT(DISTINCT page_url) FROM {$wpdb->prefix}maio_analytics WHERE access_type = %s ",265 "SELECT COUNT(DISTINCT page_url) FROM {$wpdb->prefix}maio_analytics WHERE access_type = %s AND crawl_date >= DATE_SUB(NOW(), INTERVAL 30 DAY)", 266 266 'user' 267 267 )); … … 535 535 <span class="tooltip-text">Total number of times AI tools have visited your website in the last 30 days. This includes all types of AI crawlers (ChatGPT, Claude, etc.).</span> 536 536 </div> 537 <div class="stat-sublabel">Last 30 days</div> 537 538 <div class="stat-label">Total Crawls</div> 538 539 </div> … … 541 542 <div class="stat-number" data-testid="stat-value-pages-indexed"><?php echo esc_html(maio_format_number($crawl_stats['pages_indexed'])); ?></div> 542 543 <span class="info-icon">i</span> 543 <span class="tooltip-text">Number of unique pages on your website that have been discovered and indexed by AI tools. Higher numbers mean better AI visibility.</span> 544 </div> 544 <span class="tooltip-text">Number of unique pages on your website that have been discovered and indexed by AI tools in the last 30 days. Higher numbers mean better AI visibility.</span> 545 </div> 546 <div class="stat-sublabel">Last 30 days</div> 545 547 <div class="stat-label">Pages Indexed</div> 546 548 </div> … … 645 647 <div class="stat-number" style="color:#ff7139;" data-testid="stat-value-total-requests"><?php echo esc_html(maio_format_number($user_stats['total_requests'])); ?></div> 646 648 <span class="info-icon">i</span> 647 <span class="tooltip-text">Total number of times users have accessed your content through AI tools. This shows how often your content is being shared via AI.</span> 648 </div> 649 <span class="tooltip-text">Total number of times users have accessed your content through AI tools in the last 30 days. This shows how often your content is being shared via AI.</span> 650 </div> 651 <div class="stat-sublabel">Last 30 days</div> 649 652 <div class="stat-label">Total Requests</div> 650 653 </div> … … 653 656 <div class="stat-number" data-testid="stat-value-pages-accessed"><?php echo esc_html(maio_format_number($user_stats['pages_accessed'])); ?></div> 654 657 <span class="info-icon">i</span> 655 <span class="tooltip-text">Number of different pages that users have accessed through AI tools. Higher numbers indicate broader content reach.</span> 656 </div> 658 <span class="tooltip-text">Number of different pages that users have accessed through AI tools in the last 30 days. Higher numbers indicate broader content reach.</span> 659 </div> 660 <div class="stat-sublabel">Last 30 days</div> 657 661 <div class="stat-label">Pages Accessed</div> 658 662 </div> -
maio-the-new-ai-geo-seo-tool/trunk/readme.txt
r3371936 r3372753 4 4 Requires at least: 5.0 5 5 Tested up to: 6.8.2 6 Stable tag: 5.1.3 76 Stable tag: 5.1.39 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 39 39 == Changelog == 40 40 41 = 5.1.39 = 42 * Fixed AI Scanner cache-busting 43 * Added null safety checks for WordPress core function returns 44 41 45 = 5.1.37 = 42 * Added centralized automatic cache purging for 16+ popular WordPress caching plugins46 * Added centralized automatic cache purging 43 47 * Fixed robots.txt bot allowance bug 44 48 * Fixed preg_match regex error in maio_detect_video_indicators
Note: See TracChangeset
for help on using the changeset viewer.