Beispiel #1
0
function wp_statistics_editor_meta_box($post)
{
    // If the widget isn't visible, don't output the stats as they take too much memory and CPU to compute for no reason.
    if (($is_visible = wp_statistics_is_wp_widget_visible('wp_statistics_editor_meta_box', $post->post_type)) !== true) {
        echo $is_visible;
        return;
    }
    // If the post isn't published yet, don't output the stats as they take too much memory and CPU to compute for no reason.
    if ($post->post_status != 'publish' && $post->post_status != 'private') {
        _e('This post is not yet published.', 'wp_statistics');
        return;
    }
    include_once dirname(__FILE__) . '/includes/log/widgets/page.php';
    wp_statistics_load_widget_css_and_scripts();
    wp_statistics_generate_page_postbox_content(null, $post->ID, 20, __('Hits in the last 20 days', 'wp_statistics'));
}
Beispiel #2
0
function wp_statistics_top_visitors_widget()
{
    global $WP_Statistics;
    // If the widget isn't visible, don't output the stats as they take too much memory and CPU to compute for no reason.
    if (($is_visible = wp_statistics_is_wp_widget_visible('wp-statistics-top-visitors-widget', 'dashboard')) !== true) {
        echo $is_visible;
        return;
    }
    // Load the css we use for the statistics pages.
    wp_statistics_load_widget_css_and_scripts();
    // Include the summary widget, we're just going to use the content for the the users online and visit/visitor totals.
    $ISOCountryCode = $WP_Statistics->get_country_codes();
    include_once dirname(__FILE__) . "/includes/log/widgets/top.visitors.php";
    wp_statistics_generate_top_visitors_postbox_content($ISOCountryCode, 'today', 10, true);
}