• Resolved Chris Lloyd

    (@chrisl27)


    Hi camu,

    I’ve noticed that when checking whether indexes are activated, analytics looks for stats_resource_idx instead of {$GLOBALS[‘wpdb’]->prefix}stats_resource_idx, giving an incorrect result since indexes started being prefixed for multisite.

    diff follows:

    diff --git a/wp-content/plugins/wp-slimstat/admin/config/maintenance.php b/wp-content/plugins/wp-slimstat/admin/config/maintenance.php
    index cb03b2e..23f951f 100644
    --- a/wp-content/plugins/wp-slimstat/admin/config/maintenance.php
    +++ b/wp-content/plugins/wp-slimstat/admin/config/maintenance.php
    @@ -112,7 +112,7 @@ if (!empty($_REQUEST['action'])){
     }
    
     // Retrieve some information about the tables used by Slimstat
    -$check_index = wp_slimstat::$wpdb->get_results("SHOW INDEX FROM {$GLOBALS['wpdb']->prefix}slim_stats WHERE Key_name = 'stats_resource_idx'");
    +$check_index = wp_slimstat::$wpdb->get_results("SHOW INDEX FROM {$GLOBALS['wpdb']->prefix}slim_stats WHERE Key_name = '{$GLOBALS['wpdb']->prefix}stats_resource_idx'");^M
     $details_wp_slim_tables = array_merge(
            wp_slimstat::$wpdb->get_results("SHOW TABLE STATUS LIKE '{$GLOBALS['wpdb']->prefix}slim_stats'", ARRAY_A),
            wp_slimstat::$wpdb->get_results("SHOW TABLE STATUS LIKE '{$GLOBALS['wpdb']->prefix}slim_events'", ARRAY_A),

    Cheers,

    – Chris

    https://www.ads-software.com/plugins/wp-slimstat/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Old check method for indexes gives wrong result’ is closed to new replies.