Exemplo n.º 1
0
            $GLOBALS['wpdb']->query("DELETE FROM {$GLOBALS['wpdb']->prefix}usermeta WHERE meta_key LIKE '%slim%'");
            wp_slimstat_admin::show_alert_message(__('Your reports were successfully restored to their default arrangement.', 'wp-slimstat'), 'updated below-h2');
            break;
        case 'activate-indexes':
            wp_slimstat::$wpdb->query("ALTER TABLE {$GLOBALS['wpdb']->prefix}slim_stats ADD INDEX stats_resource_idx(resource(20))");
            wp_slimstat::$wpdb->query("ALTER TABLE {$GLOBALS['wpdb']->prefix}slim_stats ADD INDEX stats_browser_idx(browser_id)");
            wp_slimstat::$wpdb->query("ALTER TABLE {$GLOBALS['wpdb']->base_prefix}slim_browsers ADD INDEX browser_all_idx(browser,version,platform,css_version,type)");
            wp_slimstat::$wpdb->query("ALTER TABLE {$GLOBALS['wpdb']->base_prefix}slim_screenres ADD INDEX screenres_all_idx(resolution,colordepth,antialias)");
            wp_slimstat_admin::show_alert_message(__('Congrats! Slimstat is now optimized for <a href="http://www.youtube.com/watch?v=ygE01sOhzz0" target="_blank">ludicrous speed</a>.', 'wp-slimstat'), 'updated below-h2');
            break;
        case 'deactivate-indexes':
            wp_slimstat::$wpdb->query("ALTER TABLE {$GLOBALS['wpdb']->prefix}slim_stats DROP INDEX stats_resource_idx");
            wp_slimstat::$wpdb->query("ALTER TABLE {$GLOBALS['wpdb']->prefix}slim_stats DROP INDEX stats_browser_idx");
            wp_slimstat::$wpdb->query("ALTER TABLE {$GLOBALS['wpdb']->base_prefix}slim_browsers DROP INDEX browser_all_idx");
            wp_slimstat::$wpdb->query("ALTER TABLE {$GLOBALS['wpdb']->base_prefix}slim_screenres DROP INDEX screenres_all_idx");
            wp_slimstat_admin::show_alert_message(__('Indexing has been successfully disabled. Enjoy the extra database space you just gained!', 'wp-slimstat'), 'updated below-h2');
            break;
        case 'import-settings':
            $new_options = @unserialize(stripslashes($_POST['import-slimstat-settings']));
            $new_options = array_intersect_key($new_options, wp_slimstat::$options);
            if (!empty($new_options)) {
                foreach ($new_options as $a_option_name => $a_option_value) {
                    wp_slimstat::$options[$a_option_name] = $a_option_value;
                }
            }
            break;
        default:
    }
}
// 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'");
Exemplo n.º 2
0
        ?>
		<input type="hidden" name="fs[<?php 
        echo $a_key;
        ?>
]" class="slimstat-post-filter" value="equals <?php 
        echo htmlspecialchars($a_value);
        ?>
"/>
		<?php 
    }
}
?>
	</form>
	<?php 
if (!file_exists(wp_slimstat::$maxmind_path) && wp_slimstat::$options['no_maxmind_warning'] != 'yes') {
    wp_slimstat_admin::show_alert_message(sprintf(__("Install MaxMind's <a href='%s'>GeoLite DB</a> to determine your visitors' country of origin.", 'wp-slimstat'), self::$config_url . '6') . '<a id="slimstat-hide-geolite-notice" class="slimstat-font-cancel slimstat-float-right" title="Hide this notice" href="#"></a>', 'wp-ui-notification below-h2');
}
$filters_html = wp_slimstat_reports::get_filters_html(wp_slimstat_db::$filters_normalized['columns']);
if (!empty($filters_html)) {
    echo "<div id='slimstat-current-filters'>{$filters_html}</div>";
}
?>

	<div class="meta-box-sortables">
		<form method="get" action=""><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="<?php 
echo wp_create_nonce('meta-box-order');
?>
" /></form><?php 
foreach (wp_slimstat_reports::$reports_info as $a_report_id => $a_report_info) {
    if (empty($a_report_info['screens']) || !in_array($_GET['page'], $a_report_info['screens'])) {
        continue;
Exemplo n.º 3
0
            }
            wp_slimstat::$wpdb->query("ALTER TABLE {$GLOBALS['wpdb']->prefix}slim_stats ENGINE = InnoDB");
            wp_slimstat::$wpdb->query("ALTER TABLE {$GLOBALS['wpdb']->prefix}slim_events ENGINE = InnoDB");
            wp_slimstat_admin::show_alert_message(__('Your Slimstat tables have been successfully converted to InnoDB.', 'wp-slimstat'), 'wp-ui-highlight below-h2');
            break;
        case 'truncate-archive':
            wp_slimstat::$wpdb->query("DELETE tsa FROM {$GLOBALS['wpdb']->prefix}slim_stats_archive tsa");
            wp_slimstat::$wpdb->query("OPTIMIZE TABLE {$GLOBALS['wpdb']->prefix}slim_stats_archive");
            wp_slimstat_admin::show_alert_message(__('All the archived records were successfully deleted.', 'wp-slimstat'), 'wp-ui-highlight below-h2');
            break;
        case 'truncate-table':
            wp_slimstat::$wpdb->query("DELETE te FROM {$GLOBALS['wpdb']->prefix}slim_events te");
            wp_slimstat::$wpdb->query("OPTIMIZE TABLE {$GLOBALS['wpdb']->prefix}slim_events");
            wp_slimstat::$wpdb->query("DELETE t1 FROM {$GLOBALS['wpdb']->prefix}slim_stats t1");
            wp_slimstat::$wpdb->query("OPTIMIZE TABLE {$GLOBALS['wpdb']->prefix}slim_stats");
            wp_slimstat_admin::show_alert_message(__('All the records were successfully deleted.', 'wp-slimstat'), 'wp-ui-highlight below-h2');
            break;
        default:
            break;
    }
}
// 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'");
$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), wp_slimstat::$wpdb->get_results("SHOW TABLE STATUS LIKE '{$GLOBALS['wpdb']->prefix}slim_stats_archive'", ARRAY_A));
$have_innodb = wp_slimstat::$wpdb->get_results("SHOW VARIABLES LIKE 'have_innodb'", ARRAY_A);
$suffixes = array('bytes', 'KB', 'MB', 'GB', 'TB');
?>

<table class="form-table widefat">
<tbody>
	<tr>