Metro_Sitemap::ajax_get_sitemap_counts PHP Method

ajax_get_sitemap_counts() public static method

public static ajax_get_sitemap_counts ( )
    public static function ajax_get_sitemap_counts()
    {
        check_admin_referer('msm-sitemap-action');
        if (!current_user_can('manage_options')) {
            wp_die(__('You do not have sufficient permissions to access this page.', 'metro-sitemaps'));
        }
        $n = 10;
        if (isset($_REQUEST['num_days'])) {
            $n = intval($_REQUEST['num_days']);
        }
        $data = array('total_indexed_urls' => number_format(Metro_Sitemap::get_total_indexed_url_count()), 'total_sitemaps' => number_format(Metro_Sitemap::count_sitemaps()), 'sitemap_indexed_urls' => self::get_recent_sitemap_url_counts($n));
        wp_send_json($data);
    }