Plugin Directory

Changeset 3371936


Ignore:
Timestamp:
10/02/2025 05:28:28 PM (6 months ago)
Author:
ashleysmith1
Message:

Update to version 5.1.37

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

Legend:

Unmodified
Added
Removed
  • maio-the-new-ai-geo-seo-tool/trunk/maio-ai-scanner.php

    r3368559 r3371936  
    525525}
    526526
     527
    527528// Debug function to check what transcript indicators are found in HTML
    528529add_action('wp_ajax_maio_debug_transcript_html', 'maio_debug_transcript_html_handler');
     
    14981499add_action('wp_ajax_maio_remove_json_ld', 'maio_remove_json_ld_handler');
    14991500add_action('wp_ajax_nopriv_maio_remove_json_ld', 'maio_remove_json_ld_handler');
     1501
     1502// Add specific schema clearing actions
     1503add_action('wp_ajax_maio_clear_schema_product', 'maio_clear_schema_product_handler');
     1504add_action('wp_ajax_nopriv_maio_clear_schema_product', 'maio_clear_schema_product_handler');
     1505add_action('wp_ajax_maio_clear_schema_event', 'maio_clear_schema_event_handler');
     1506add_action('wp_ajax_nopriv_maio_clear_schema_event', 'maio_clear_schema_event_handler');
     1507add_action('wp_ajax_maio_clear_schema_breadcrumb', 'maio_clear_schema_breadcrumb_handler');
     1508add_action('wp_ajax_nopriv_maio_clear_schema_breadcrumb', 'maio_clear_schema_breadcrumb_handler');
     1509add_action('wp_ajax_maio_clear_schema_article', 'maio_clear_schema_article_handler');
     1510add_action('wp_ajax_nopriv_maio_clear_schema_article', 'maio_clear_schema_article_handler');
     1511
     1512// Add AI metadata clearing actions
     1513add_action('wp_ajax_maio_clear_key_topics', 'maio_clear_key_topics_handler');
     1514add_action('wp_ajax_nopriv_maio_clear_key_topics', 'maio_clear_key_topics_handler');
     1515add_action('wp_ajax_maio_clear_target_audience', 'maio_clear_target_audience_handler');
     1516add_action('wp_ajax_nopriv_maio_clear_target_audience', 'maio_clear_target_audience_handler');
     1517add_action('wp_ajax_maio_clear_content_type', 'maio_clear_content_type_handler');
     1518add_action('wp_ajax_nopriv_maio_clear_content_type', 'maio_clear_content_type_handler');
     1519add_action('wp_ajax_maio_clear_primary_entity', 'maio_clear_primary_entity_handler');
     1520add_action('wp_ajax_nopriv_maio_clear_primary_entity', 'maio_clear_primary_entity_handler');
     1521
     1522// Add social media clearing actions
     1523add_action('wp_ajax_maio_clear_brand_facebook', 'maio_clear_brand_facebook_handler');
     1524add_action('wp_ajax_nopriv_maio_clear_brand_facebook', 'maio_clear_brand_facebook_handler');
     1525add_action('wp_ajax_maio_clear_brand_instagram', 'maio_clear_brand_instagram_handler');
     1526add_action('wp_ajax_nopriv_maio_clear_brand_instagram', 'maio_clear_brand_instagram_handler');
     1527add_action('wp_ajax_maio_clear_brand_twitter', 'maio_clear_brand_twitter_handler');
     1528add_action('wp_ajax_nopriv_maio_clear_brand_twitter', 'maio_clear_brand_twitter_handler');
     1529add_action('wp_ajax_maio_clear_brand_tiktok', 'maio_clear_brand_tiktok_handler');
     1530add_action('wp_ajax_nopriv_maio_clear_brand_tiktok', 'maio_clear_brand_tiktok_handler');
     1531add_action('wp_ajax_maio_clear_brand_youtube', 'maio_clear_brand_youtube_handler');
     1532add_action('wp_ajax_nopriv_maio_clear_brand_youtube', 'maio_clear_brand_youtube_handler');
     1533add_action('wp_ajax_maio_clear_brand_linkedin', 'maio_clear_brand_linkedin_handler');
     1534add_action('wp_ajax_nopriv_maio_clear_brand_linkedin', 'maio_clear_brand_linkedin_handler');
    15001535function maio_remove_json_ld_handler() {
    15011536    if (!current_user_can('manage_options')) {
     
    17941829   
    17951830    if ($result) {
     1831        // Purge cache after any successful improvement
     1832        maio_purge_cache();
     1833       
    17961834        // Return specific success messages for Trust Markers
    17971835        $success_message = 'Improvement applied successfully';
     
    18571895    update_option('maio_improvement_points', $improvement_points);
    18581896   
     1897    // Purge cache after saving improvement points
     1898    maio_purge_cache();
    18591899   
    18601900    wp_send_json_success('Improvement points saved');
     
    20452085        }
    20462086       
    2047         // Add bot-specific entry if not already present
    2048         if ($bot_name && strpos($robots_content, "User-agent: $bot_name") === false) {
    2049             $robots_content .= "User-agent: $bot_name\n";
    2050             $robots_content .= "Allow: /\n\n";
     2087        // Handle bot-specific entry (add or update to allow)
     2088        if ($bot_name) {
     2089            // Check if bot entry already exists
     2090            $bot_pattern = "/User-agent:\s*$bot_name\s*\n(.*?)(?=\nUser-agent:|\nSitemap:|\Z)/s";
     2091           
     2092            if (preg_match($bot_pattern, $robots_content, $matches)) {
     2093                // Bot entry exists, replace it with Allow directive
     2094                $new_bot_entry = "User-agent: $bot_name\nAllow: /\n\n";
     2095                $robots_content = preg_replace($bot_pattern, $new_bot_entry, $robots_content);
     2096            } else {
     2097                // Bot entry doesn't exist, add it
     2098                $robots_content .= "User-agent: $bot_name\n";
     2099                $robots_content .= "Allow: /\n\n";
     2100            }
    20512101        }
    20522102       
     
    21022152function maio_update_sitemap_lastmod() {
    21032153    // Update sitemap with lastmod dates
    2104     return true;
     2154    try {
     2155        $sitemap_path = ABSPATH . 'sitemap.xml';
     2156       
     2157        // Check if sitemap exists
     2158        if (!file_exists($sitemap_path)) {
     2159            // If no sitemap exists, create one with lastmod dates
     2160            return maio_generate_sitemap_xml();
     2161        }
     2162       
     2163        // Read existing sitemap
     2164        $sitemap_content = file_get_contents($sitemap_path);
     2165       
     2166        // Parse the XML to update lastmod dates
     2167        $dom = new DOMDocument();
     2168        $dom->loadXML($sitemap_content);
     2169       
     2170        $urls = $dom->getElementsByTagName('url');
     2171        $updated = false;
     2172       
     2173        foreach ($urls as $url) {
     2174            $loc = $url->getElementsByTagName('loc')->item(0);
     2175            if ($loc) {
     2176                $page_url = $loc->textContent;
     2177               
     2178                // Try to get the actual last modified date from WordPress
     2179                $post_id = url_to_postid($page_url);
     2180                if ($post_id) {
     2181                    $post = get_post($post_id);
     2182                    if ($post) {
     2183                        $lastmod = date('Y-m-d\TH:i:s+00:00', strtotime($post->post_modified));
     2184                       
     2185                        // Update or add lastmod element
     2186                        $lastmod_elem = $url->getElementsByTagName('lastmod')->item(0);
     2187                        if ($lastmod_elem) {
     2188                            $lastmod_elem->textContent = $lastmod;
     2189                        } else {
     2190                            $lastmod_elem = $dom->createElement('lastmod', $lastmod);
     2191                            $url->appendChild($lastmod_elem);
     2192                        }
     2193                        $updated = true;
     2194                    }
     2195                } else {
     2196                    // For non-post URLs (like homepage), use current time
     2197                    $lastmod = date('Y-m-d\TH:i:s+00:00');
     2198                   
     2199                    $lastmod_elem = $url->getElementsByTagName('lastmod')->item(0);
     2200                    if ($lastmod_elem) {
     2201                        $lastmod_elem->textContent = $lastmod;
     2202                    } else {
     2203                        $lastmod_elem = $dom->createElement('lastmod', $lastmod);
     2204                        $url->appendChild($lastmod_elem);
     2205                    }
     2206                    $updated = true;
     2207                }
     2208            }
     2209        }
     2210       
     2211        if ($updated) {
     2212            // Save the updated sitemap
     2213            $dom->formatOutput = true;
     2214            $result = file_put_contents($sitemap_path, $dom->saveXML());
     2215            return $result !== false;
     2216        }
     2217       
     2218        return true; // No updates needed, but sitemap exists
     2219       
     2220    } catch (Exception $e) {
     2221        return false;
     2222    }
    21052223}
    21062224
     
    21082226    // Set up AI bot monitoring
    21092227    return true;
     2228}
     2229
     2230function maio_purge_cache() {
     2231    // Purge common WordPress caching plugins
     2232    try {
     2233        $purged_caches = [];
     2234       
     2235        // WP Rocket
     2236        if (function_exists('rocket_clean_domain')) {
     2237            rocket_clean_domain();
     2238            $purged_caches[] = 'WP Rocket';
     2239        }
     2240       
     2241        // W3 Total Cache
     2242        if (function_exists('w3tc_flush_all')) {
     2243            w3tc_flush_all();
     2244            $purged_caches[] = 'W3 Total Cache';
     2245        }
     2246       
     2247        // WP Super Cache
     2248        if (function_exists('wp_cache_clear_cache')) {
     2249            wp_cache_clear_cache();
     2250            $purged_caches[] = 'WP Super Cache';
     2251        }
     2252       
     2253        // LiteSpeed Cache
     2254        if (class_exists('LiteSpeed_Cache_API')) {
     2255            LiteSpeed_Cache_API::purge_all();
     2256            $purged_caches[] = 'LiteSpeed Cache';
     2257        }
     2258       
     2259        // WP Fastest Cache
     2260        if (class_exists('WpFastestCache')) {
     2261            $wpfc = new WpFastestCache();
     2262            $wpfc->deleteCache();
     2263            $purged_caches[] = 'WP Fastest Cache';
     2264        }
     2265       
     2266        // Cache Enabler
     2267        if (function_exists('ce_clear_cache')) {
     2268            ce_clear_cache();
     2269            $purged_caches[] = 'Cache Enabler';
     2270        }
     2271       
     2272        // WP Optimize
     2273        if (class_exists('WP_Optimize')) {
     2274            WP_Optimize()->get_page_cache()->purge();
     2275            $purged_caches[] = 'WP Optimize';
     2276        }
     2277       
     2278        // Autoptimize
     2279        if (class_exists('autoptimizeCache')) {
     2280            autoptimizeCache::clearall();
     2281            $purged_caches[] = 'Autoptimize';
     2282        }
     2283       
     2284        // WP-Optimize
     2285        if (function_exists('wpo_cache_flush')) {
     2286            wpo_cache_flush();
     2287            $purged_caches[] = 'WP-Optimize';
     2288        }
     2289       
     2290        // Hummingbird
     2291        if (class_exists('WP_Hummingbird_Core')) {
     2292            WP_Hummingbird_Core::flush_cache();
     2293            $purged_caches[] = 'Hummingbird';
     2294        }
     2295       
     2296        // Breeze
     2297        if (function_exists('breeze_clear_all_cache')) {
     2298            breeze_clear_all_cache();
     2299            $purged_caches[] = 'Breeze';
     2300        }
     2301       
     2302        // Swift Performance
     2303        if (class_exists('Swift_Performance_Cache')) {
     2304            Swift_Performance_Cache::clear_all_cache();
     2305            $purged_caches[] = 'Swift Performance';
     2306        }
     2307       
     2308        // WP Cloudflare Super Page Cache
     2309        if (function_exists('swcfpc_purge_cache')) {
     2310            swcfpc_purge_cache();
     2311            $purged_caches[] = 'WP Cloudflare Super Page Cache';
     2312        }
     2313       
     2314        // Cloudflare
     2315        if (function_exists('cloudflare_purge_cache')) {
     2316            cloudflare_purge_cache();
     2317            $purged_caches[] = 'Cloudflare';
     2318        }
     2319       
     2320        // Endurance Cache (WordPress plugin only - safe methods)
     2321        if (function_exists('endurance_purge_cache')) {
     2322            endurance_purge_cache();
     2323            $purged_caches[] = 'Endurance Cache (function)';
     2324        }
     2325       
     2326        // Endurance Cache alternative method
     2327        if (class_exists('Endurance_Page_Cache')) {
     2328            if (method_exists('Endurance_Page_Cache', 'purge_all')) {
     2329                $endurance_cache = new Endurance_Page_Cache();
     2330                if (method_exists($endurance_cache, 'purge_all')) {
     2331                    $endurance_cache->purge_all();
     2332                    $purged_caches[] = 'Endurance Cache (class method)';
     2333                }
     2334            }
     2335        }
     2336       
     2337        // Endurance Cache via option
     2338        if (function_exists('update_option')) {
     2339            $current_level = get_option('endurance_cache_level', 'not_set');
     2340            update_option('endurance_cache_level', 0); // Disable cache temporarily
     2341            sleep(1); // Wait a moment for cache to clear
     2342            update_option('endurance_cache_level', 1); // Re-enable cache
     2343            $purged_caches[] = 'Endurance Cache (option toggle)';
     2344        }
     2345       
     2346        // Additional Endurance Cache methods
     2347        if (function_exists('wp_cache_flush_group')) {
     2348            wp_cache_flush_group('endurance_cache');
     2349            $purged_caches[] = 'Endurance Cache (group flush)';
     2350        }
     2351       
     2352        // Try to clear any Endurance-specific cache files
     2353        if (function_exists('wp_cache_delete')) {
     2354            wp_cache_delete('endurance_cache_*', 'options');
     2355        }
     2356       
     2357       
     2358        // Generic WordPress cache flush
     2359        if (function_exists('wp_cache_flush')) {
     2360            wp_cache_flush();
     2361            $purged_caches[] = 'WordPress Cache';
     2362        }
     2363       
     2364        // Clear object cache
     2365        if (function_exists('wp_cache_delete')) {
     2366            wp_cache_delete('maio_faq_schema_enabled', 'options');
     2367            wp_cache_delete('maio_qa_blocks_enabled', 'options');
     2368            $purged_caches[] = 'Object Cache';
     2369        }
     2370       
     2371    } catch (Exception $e) {
     2372        // Silently fail - cache purging is not critical
     2373        error_log('MAIO Cache purge failed: ' . $e->getMessage());
     2374    }
    21102375}
    21112376
     
    26402905        ");
    26412906       
     2907        return true;
     2908    } catch (Exception $e) {
     2909        return false;
     2910    }
     2911}
     2912
     2913// Handler functions for specific schema clearing
     2914function maio_clear_schema_product_handler() {
     2915    if (!current_user_can('manage_options')) {
     2916        wp_send_json_error('Insufficient permissions');
     2917        return;
     2918    }
     2919   
     2920    $result = maio_clear_schema_product();
     2921   
     2922    if ($result) {
     2923        wp_send_json_success('Product Schema cleared');
     2924    } else {
     2925        wp_send_json_error('Failed to clear Product Schema');
     2926    }
     2927}
     2928
     2929function maio_clear_schema_event_handler() {
     2930    if (!current_user_can('manage_options')) {
     2931        wp_send_json_error('Insufficient permissions');
     2932        return;
     2933    }
     2934   
     2935    $result = maio_clear_schema_event();
     2936   
     2937    if ($result) {
     2938        wp_send_json_success('Event Schema cleared');
     2939    } else {
     2940        wp_send_json_error('Failed to clear Event Schema');
     2941    }
     2942}
     2943
     2944function maio_clear_schema_breadcrumb_handler() {
     2945    if (!current_user_can('manage_options')) {
     2946        wp_send_json_error('Insufficient permissions');
     2947        return;
     2948    }
     2949   
     2950    $result = maio_clear_schema_breadcrumb();
     2951   
     2952    if ($result) {
     2953        wp_send_json_success('Breadcrumb Schema cleared');
     2954    } else {
     2955        wp_send_json_error('Failed to clear Breadcrumb Schema');
     2956    }
     2957}
     2958
     2959function maio_clear_schema_article_handler() {
     2960    if (!current_user_can('manage_options')) {
     2961        wp_send_json_error('Insufficient permissions');
     2962        return;
     2963    }
     2964   
     2965    $result = maio_clear_schema_article();
     2966   
     2967    if ($result) {
     2968        wp_send_json_success('Article Schema cleared');
     2969    } else {
     2970        wp_send_json_error('Failed to clear Article Schema');
     2971    }
     2972}
     2973
     2974// Actual clearing functions
     2975function maio_clear_schema_product() {
     2976    try {
     2977        delete_option('maio_schema_product');
     2978        return true;
     2979    } catch (Exception $e) {
     2980        return false;
     2981    }
     2982}
     2983
     2984function maio_clear_schema_event() {
     2985    try {
     2986        delete_option('maio_schema_event');
     2987        return true;
     2988    } catch (Exception $e) {
     2989        return false;
     2990    }
     2991}
     2992
     2993function maio_clear_schema_breadcrumb() {
     2994    try {
     2995        delete_option('maio_schema_breadcrumb');
     2996        return true;
     2997    } catch (Exception $e) {
     2998        return false;
     2999    }
     3000}
     3001
     3002function maio_clear_schema_article() {
     3003    try {
     3004        delete_option('maio_schema_article');
     3005        return true;
     3006    } catch (Exception $e) {
     3007        return false;
     3008    }
     3009}
     3010
     3011// Handler functions for AI metadata clearing
     3012function maio_clear_key_topics_handler() {
     3013    if (!current_user_can('manage_options')) {
     3014        wp_send_json_error('Insufficient permissions');
     3015        return;
     3016    }
     3017   
     3018    $result = maio_clear_key_topics();
     3019   
     3020    if ($result) {
     3021        wp_send_json_success('Key Topics cleared');
     3022    } else {
     3023        wp_send_json_error('Failed to clear Key Topics');
     3024    }
     3025}
     3026
     3027function maio_clear_target_audience_handler() {
     3028    if (!current_user_can('manage_options')) {
     3029        wp_send_json_error('Insufficient permissions');
     3030        return;
     3031    }
     3032   
     3033    $result = maio_clear_target_audience();
     3034   
     3035    if ($result) {
     3036        wp_send_json_success('Target Audience cleared');
     3037    } else {
     3038        wp_send_json_error('Failed to clear Target Audience');
     3039    }
     3040}
     3041
     3042function maio_clear_content_type_handler() {
     3043    if (!current_user_can('manage_options')) {
     3044        wp_send_json_error('Insufficient permissions');
     3045        return;
     3046    }
     3047   
     3048    $result = maio_clear_content_type();
     3049   
     3050    if ($result) {
     3051        wp_send_json_success('Content Type cleared');
     3052    } else {
     3053        wp_send_json_error('Failed to clear Content Type');
     3054    }
     3055}
     3056
     3057function maio_clear_primary_entity_handler() {
     3058    if (!current_user_can('manage_options')) {
     3059        wp_send_json_error('Insufficient permissions');
     3060        return;
     3061    }
     3062   
     3063    $result = maio_clear_primary_entity();
     3064   
     3065    if ($result) {
     3066        wp_send_json_success('Primary Entity cleared');
     3067    } else {
     3068        wp_send_json_error('Failed to clear Primary Entity');
     3069    }
     3070}
     3071
     3072// Actual clearing functions for AI metadata
     3073function maio_clear_key_topics() {
     3074    try {
     3075        delete_option('maio_key_topics');
     3076        // Also clear post meta
     3077        global $wpdb;
     3078        $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE meta_key = '_maio_key_topics'");
     3079        return true;
     3080    } catch (Exception $e) {
     3081        return false;
     3082    }
     3083}
     3084
     3085function maio_clear_target_audience() {
     3086    try {
     3087        delete_option('maio_target_audience');
     3088        // Also clear post meta
     3089        global $wpdb;
     3090        $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE meta_key = '_maio_target_audience'");
     3091        return true;
     3092    } catch (Exception $e) {
     3093        return false;
     3094    }
     3095}
     3096
     3097function maio_clear_content_type() {
     3098    try {
     3099        delete_option('maio_content_type');
     3100        // Also clear post meta
     3101        global $wpdb;
     3102        $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE meta_key = '_maio_content_type'");
     3103        return true;
     3104    } catch (Exception $e) {
     3105        return false;
     3106    }
     3107}
     3108
     3109function maio_clear_primary_entity() {
     3110    try {
     3111        delete_option('maio_primary_entity');
     3112        // Also clear post meta
     3113        global $wpdb;
     3114        $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE meta_key = '_maio_primary_entity'");
     3115        return true;
     3116    } catch (Exception $e) {
     3117        return false;
     3118    }
     3119}
     3120
     3121// Handler functions for social media clearing
     3122function maio_clear_brand_facebook_handler() {
     3123    if (!current_user_can('manage_options')) {
     3124        wp_send_json_error('Insufficient permissions');
     3125        return;
     3126    }
     3127   
     3128    $result = maio_clear_brand_facebook();
     3129   
     3130    if ($result) {
     3131        wp_send_json_success('Brand Facebook cleared');
     3132    } else {
     3133        wp_send_json_error('Failed to clear Brand Facebook');
     3134    }
     3135}
     3136
     3137function maio_clear_brand_instagram_handler() {
     3138    if (!current_user_can('manage_options')) {
     3139        wp_send_json_error('Insufficient permissions');
     3140        return;
     3141    }
     3142   
     3143    $result = maio_clear_brand_instagram();
     3144   
     3145    if ($result) {
     3146        wp_send_json_success('Brand Instagram cleared');
     3147    } else {
     3148        wp_send_json_error('Failed to clear Brand Instagram');
     3149    }
     3150}
     3151
     3152function maio_clear_brand_twitter_handler() {
     3153    if (!current_user_can('manage_options')) {
     3154        wp_send_json_error('Insufficient permissions');
     3155        return;
     3156    }
     3157   
     3158    $result = maio_clear_brand_twitter();
     3159   
     3160    if ($result) {
     3161        wp_send_json_success('Brand Twitter cleared');
     3162    } else {
     3163        wp_send_json_error('Failed to clear Brand Twitter');
     3164    }
     3165}
     3166
     3167function maio_clear_brand_tiktok_handler() {
     3168    if (!current_user_can('manage_options')) {
     3169        wp_send_json_error('Insufficient permissions');
     3170        return;
     3171    }
     3172   
     3173    $result = maio_clear_brand_tiktok();
     3174   
     3175    if ($result) {
     3176        wp_send_json_success('Brand TikTok cleared');
     3177    } else {
     3178        wp_send_json_error('Failed to clear Brand TikTok');
     3179    }
     3180}
     3181
     3182function maio_clear_brand_youtube_handler() {
     3183    if (!current_user_can('manage_options')) {
     3184        wp_send_json_error('Insufficient permissions');
     3185        return;
     3186    }
     3187   
     3188    $result = maio_clear_brand_youtube();
     3189   
     3190    if ($result) {
     3191        wp_send_json_success('Brand YouTube cleared');
     3192    } else {
     3193        wp_send_json_error('Failed to clear Brand YouTube');
     3194    }
     3195}
     3196
     3197function maio_clear_brand_linkedin_handler() {
     3198    if (!current_user_can('manage_options')) {
     3199        wp_send_json_error('Insufficient permissions');
     3200        return;
     3201    }
     3202   
     3203    $result = maio_clear_brand_linkedin();
     3204   
     3205    if ($result) {
     3206        wp_send_json_success('Brand LinkedIn cleared');
     3207    } else {
     3208        wp_send_json_error('Failed to clear Brand LinkedIn');
     3209    }
     3210}
     3211
     3212// Actual clearing functions for social media
     3213function maio_clear_brand_facebook() {
     3214    try {
     3215        delete_option('maio_brand_facebook');
     3216        return true;
     3217    } catch (Exception $e) {
     3218        return false;
     3219    }
     3220}
     3221
     3222function maio_clear_brand_instagram() {
     3223    try {
     3224        delete_option('maio_brand_instagram');
     3225        return true;
     3226    } catch (Exception $e) {
     3227        return false;
     3228    }
     3229}
     3230
     3231function maio_clear_brand_twitter() {
     3232    try {
     3233        delete_option('maio_brand_twitter');
     3234        return true;
     3235    } catch (Exception $e) {
     3236        return false;
     3237    }
     3238}
     3239
     3240function maio_clear_brand_tiktok() {
     3241    try {
     3242        delete_option('maio_brand_tiktok');
     3243        return true;
     3244    } catch (Exception $e) {
     3245        return false;
     3246    }
     3247}
     3248
     3249function maio_clear_brand_youtube() {
     3250    try {
     3251        delete_option('maio_brand_youtube');
     3252        return true;
     3253    } catch (Exception $e) {
     3254        return false;
     3255    }
     3256}
     3257
     3258function maio_clear_brand_linkedin() {
     3259    try {
     3260        delete_option('maio_brand_linkedin');
    26423261        return true;
    26433262    } catch (Exception $e) {
  • maio-the-new-ai-geo-seo-tool/trunk/maio-main.php

    r3368559 r3371936  
    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.33
     6 * Version: 5.1.37
    77 * Requires at least: 5.0
    88 * Requires PHP: 7.2
     
    1616
    1717// Define plugin constants
    18 define('MAIO_VERSION', '5.1.33');
     18define('MAIO_VERSION', '5.1.37');
    1919define('MAIO_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2020define('MAIO_PLUGIN_URL', plugin_dir_url(__FILE__));
     
    999999    if ($time_based_schema_enabled === '1' || $time_based_schema_enabled === true) {
    10001000        $time_based_schema_output = false;
     1001        $post_id = get_the_ID();
    10011002       
    10021003        if ($post_id) {
     
    24072408    // Don't return early - allow global options to work even without post ID
    24082409   
    2409     echo "<!-- MAIO Semantic Signals wp_head function called -->\n";
     2410    echo "<!-- MAIO Semantic Signals function called -->\n";
    24102411   
    24112412    // OpenGraph Tags
     
    24142415        $og_content = get_post_meta($post_id, 'maio_opengraph_content', true);
    24152416       
    2416         echo "<!-- MAIO Debug: post_id=$post_id, og_enabled=$og_enabled -->\n";
    24172417       
    24182418        if ($og_enabled === '1' && !empty($og_content) && is_array($og_content)) {
     
    24722472        $og_enabled = get_option('maio_opengraph_enabled', false);
    24732473       
    2474         echo "<!-- MAIO Debug: no post_id, og_enabled=$og_enabled -->\n";
    24752474       
    24762475        if ($og_enabled) {
     
    26232622    }
    26242623   
    2625     if (isset($_GET['maio_debug'])) {
    2626         echo "<!-- MAIO Debug: publish_date_enabled=" . ($publish_date_enabled ? 'true' : 'false') . " -->\n";
    2627         echo "<!-- MAIO Debug: global_publish_date=" . get_option('maio_publish_date_global', 'NOT_SET') . " -->\n";
    2628         echo "<!-- MAIO Debug: post_id=" . ($post_id ? $post_id : 'null') . " -->\n";
    2629         if ($post_id) {
    2630             $post_publish_enabled = get_post_meta($post_id, 'maio_publish_date_enabled', true);
    2631             $publish_date = get_post_meta($post_id, 'maio_publish_date', true);
    2632             echo "<!-- MAIO Debug: post_publish_enabled=" . $post_publish_enabled . " -->\n";
    2633             echo "<!-- MAIO Debug: post_publish_date=" . $publish_date . " -->\n";
    2634         }
    2635        
    2636         // Debug all temporal grounding options
    2637         echo "<!-- MAIO Debug: maio_update_date_enabled=" . get_option('maio_update_date_enabled', 'NOT_SET') . " -->\n";
    2638         echo "<!-- MAIO Debug: maio_update_date_global=" . get_option('maio_update_date_global', 'NOT_SET') . " -->\n";
    2639         echo "<!-- MAIO Debug: maio_freshness_indicators_enabled=" . get_option('maio_freshness_indicators_enabled', 'NOT_SET') . " -->\n";
    2640         echo "<!-- MAIO Debug: maio_freshness_content_global=" . get_option('maio_freshness_content_global', 'NOT_SET') . " -->\n";
    2641         echo "<!-- MAIO Debug: maio_time_based_schema_enabled=" . get_option('maio_time_based_schema_enabled', 'NOT_SET') . " -->\n";
    2642     }
    26432624   
    26442625    // Temporal Grounding - Update Date
     
    26662647    }
    26672648   
    2668     if (isset($_GET['maio_debug'])) {
    2669         echo "<!-- MAIO Debug: update_date_enabled=" . ($update_date_enabled ? 'true' : 'false') . " -->\n";
    2670         echo "<!-- MAIO Debug: global_update_date=" . get_option('maio_update_date_global', 'NOT_SET') . " -->\n";
    2671         echo "<!-- MAIO Debug: post_id=" . ($post_id ? $post_id : 'null') . " -->\n";
    2672         if ($post_id) {
    2673             $post_update_enabled = get_post_meta($post_id, 'maio_update_date_enabled', true);
    2674             $update_date = get_post_meta($post_id, 'maio_update_date', true);
    2675             echo "<!-- MAIO Debug: post_update_enabled=" . $post_update_enabled . " -->\n";
    2676             echo "<!-- MAIO Debug: post_update_date=" . $update_date . " -->\n";
    2677         }
    2678     }
    26792649   
    26802650    // Temporal Grounding - Freshness Indicators
     
    26962666    }
    26972667   
    2698     if (isset($_GET['maio_debug'])) {
    2699         echo "<!-- MAIO Debug: freshness_enabled=" . ($freshness_enabled ? 'true' : 'false') . " -->\n";
    2700         echo "<!-- MAIO Debug: global_freshness=" . get_option('maio_freshness_content_global', 'NOT_SET') . " -->\n";
    2701     }
     2668    echo "<!-- MAIO Semantic Signals function completed -->\n";
     2669   
    27022670}, 1); // High priority
  • maio-the-new-ai-geo-seo-tool/trunk/readme.txt

    r3368559 r3371936  
    44Requires at least: 5.0
    55Tested up to: 6.8.2
    6 Stable tag: 5.1.33
     6Stable tag: 5.1.37
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3838
    3939== Changelog ==
     40
     41= 5.1.37 =
     42* Added centralized automatic cache purging for 16+ popular WordPress caching plugins
     43* Fixed robots.txt bot allowance bug
     44* Fixed preg_match regex error in maio_detect_video_indicators
    4045
    4146= 5.1.33 =
  • maio-the-new-ai-geo-seo-tool/trunk/scanner-pages/maio-crawl-intelligence.php

    r3368559 r3371936  
    280280                        if ($ai_bot_activity_detected): ?>
    281281                            <div class="status-success">✅ <?php echo esc_html($ai_bot_status['message']); ?></div>
    282                             <div class="form-item-note">AI bot activity detected - +5 points</div>
    283282                        <?php else: ?>
    284283                            <div class="status-error">❌ <?php echo esc_html($ai_bot_status['message']); ?></div>
  • maio-the-new-ai-geo-seo-tool/trunk/scanner-pages/maio-multimodal-context.php

    r3368559 r3371936  
    116116                            <div class="status-error">❌ Missing descriptive alt text</div>
    117117                            <div style="font-size: 12px; color: #666; margin-top: 5px;">
    118                                 Debug: Total images: <?php echo $total_images; ?>,
     118                                Total images: <?php echo $total_images; ?>,
    119119                                Descriptive: <?php echo $descriptive_images; ?>,
    120120                                Percentage: <?php echo round(($descriptive_images / $total_images) * 100); ?>%
Note: See TracChangeset for help on using the changeset viewer.