Plugin Directory

Changeset 3372753


Ignore:
Timestamp:
10/04/2025 08:31:46 AM (6 months ago)
Author:
ashleysmith1
Message:

Update to version 5.1.39

Location:
maio-the-new-ai-geo-seo-tool/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • maio-the-new-ai-geo-seo-tool/trunk/css/maio_analytics.css

    r3330050 r3372753  
    9797    font-weight: 800;
    9898    margin-bottom: 5px;
     99}
     100
     101.stat-sublabel {
     102    color: #9ca3af;
     103    font-size: 0.75rem;
     104    font-weight: 500;
     105    margin-bottom: 2px;
    99106}
    100107
  • maio-the-new-ai-geo-seo-tool/trunk/maio-ai-scanner.php

    r3371936 r3372753  
    1212// Handle page loading based on tune parameter for AI Scanner categories
    1313add_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') {
    1519        if (
    1620            !isset($_GET['maio_tune_nonce']) ||
     
    2731            'maio-multimodal-context'
    2832        ];
    29         $tune = sanitize_text_field(wp_unslash($_GET['tune']));
     33        // $tune already sanitized above
    3034        if (in_array($tune, $allowed)) {
    3135            // Store the tune parameter for the main page function to handle
     
    3842function maio_ai_scanner_enqueue_scripts($hook) {
    3943    // 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') {
    4147        return;
    4248    }
     
    7278    // check_ajax_referer('maio_ai_scanner_nonce', 'nonce');
    7379   
    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'])) : '';
    7582   
    7683    if (empty($url)) {
     
    21632170        // Read existing sitemap
    21642171        $sitemap_content = file_get_contents($sitemap_path);
     2172       
     2173        if ($sitemap_content === false) {
     2174            return false;
     2175        }
    21652176       
    21662177        // Parse the XML to update lastmod dates
     
    48104821                <span class="scanning-text" style="display: none;">🔄 Scanning...</span>
    48114822            </button>
    4812             <button onclick="testImprovementPoints()" style="background: red; color: white; padding: 10px; margin-left: 10px;">Test Points</button>
    48134823        </div>
    48144824
     
    50085018    if ($qa_enabled && !is_admin() && (is_single() || is_page() || is_home() || is_front_page())) {
    50095019        // 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') ?: '';
    50125023       
    50135024        // Extract subject from site name or description
     
    56225633        'timestamp' => time(),
    56235634        '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'])) : ''
    56265638    ];
    56275639   
  • maio-the-new-ai-geo-seo-tool/trunk/maio-main.php

    r3371936 r3372753  
    44 * Plugin URI: https://maioai.com
    55 * 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.37
     6 * Version: 5.1.39
    77 * Requires at least: 5.0
    88 * Requires PHP: 7.2
     
    1616
    1717// Define plugin constants
    18 define('MAIO_VERSION', '5.1.37');
     18define('MAIO_VERSION', '5.1.39');
    1919define('MAIO_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2020define('MAIO_PLUGIN_URL', plugin_dir_url(__FILE__));
     
    263263function maio_admin_enqueue_scripts($hook) {
    264264    // 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) {
    266267        return;
    267268    }
    268269
    269270    // 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) {
    271274        return;
    272275    }
     
    375378
    376379    // 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
    379383        esc_html__('AI SEO Dashboard', 'maio-the-new-ai-geo-seo-tool'),
    380         '', // No menu title, so it won't show up
     384        esc_html__('AI SEO Dashboard', 'maio-the-new-ai-geo-seo-tool'),
    381385        'manage_options',
    382386        'maio-smart-dashboard',
     
    385389
    386390    // 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
    389394        esc_html__('AI-Friendly Content Guide', 'maio-the-new-ai-geo-seo-tool'),
    390         '', // No menu title, so it won't show up
     395        esc_html__('AI-Friendly Content Guide', 'maio-the-new-ai-geo-seo-tool'),
    391396        'manage_options',
    392397        'maio-ai-friendly-article',
     
    395400}
    396401add_action('admin_menu', 'maio_register_admin_menu');
     402
     403// Hide specific submenus from appearing in the admin menu
     404add_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});
    397409
    398410// Register settings
     
    15071519// Prevent canonical redirect for /ai-profile endpoint with page_id or post param
    15081520add_filter('redirect_canonical', function($redirect_url) {
     1521    // PHP 8.1+ compatibility: ensure REQUEST_URI is not null
    15091522    $request_uri = isset($_SERVER['REQUEST_URI']) ? sanitize_text_field(wp_unslash($_SERVER['REQUEST_URI'])) : '';
    15101523    // Nonce check for /ai-profile canonical redirect override
     
    15121525    if (
    15131526        (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)
    15161529    ) {
    15171530        return false;
     
    22372250add_action('init', function() {
    22382251    // 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'])) : '';
    22392254    if (
    22402255        (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)
    22422257    ) {
    22432258        return;
  • maio-the-new-ai-geo-seo-tool/trunk/maio_analytics.php

    r3368559 r3372753  
    8383    // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- Custom analytics table requires direct query
    8484    $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)",
    8686        'crawler'
    8787    ));
     
    8989    // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- Custom analytics table requires direct query
    9090    $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)",
    9292        'crawler'
    9393    ));
     
    9595    // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- Custom analytics table requires direct query
    9696    $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)",
    9898        'success',
    9999        'crawler'
     
    257257    // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- Custom analytics table requires direct query
    258258    $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)",
    260260        'user'
    261261    ));
     
    263263    // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- Custom analytics table requires direct query
    264264    $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)",
    266266        'user'
    267267    ));
     
    535535                            <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>
    536536                        </div>
     537                        <div class="stat-sublabel">Last 30 days</div>
    537538                        <div class="stat-label">Total Crawls</div>
    538539                    </div>
     
    541542                            <div class="stat-number" data-testid="stat-value-pages-indexed"><?php echo esc_html(maio_format_number($crawl_stats['pages_indexed'])); ?></div>
    542543                            <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>
    545547                        <div class="stat-label">Pages Indexed</div>
    546548                    </div>
     
    645647                            <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>
    646648                            <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>
    649652                        <div class="stat-label">Total Requests</div>
    650653                    </div>
     
    653656                            <div class="stat-number" data-testid="stat-value-pages-accessed"><?php echo esc_html(maio_format_number($user_stats['pages_accessed'])); ?></div>
    654657                            <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>
    657661                        <div class="stat-label">Pages Accessed</div>
    658662                    </div>
  • maio-the-new-ai-geo-seo-tool/trunk/readme.txt

    r3371936 r3372753  
    44Requires at least: 5.0
    55Tested up to: 6.8.2
    6 Stable tag: 5.1.37
     6Stable tag: 5.1.39
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3939== Changelog ==
    4040
     41= 5.1.39 =
     42* Fixed AI Scanner cache-busting
     43* Added null safety checks for WordPress core function returns
     44
    4145= 5.1.37 =
    42 * Added centralized automatic cache purging for 16+ popular WordPress caching plugins
     46* Added centralized automatic cache purging
    4347* Fixed robots.txt bot allowance bug
    4448* Fixed preg_match regex error in maio_detect_video_indicators
Note: See TracChangeset for help on using the changeset viewer.