get_stats example

public static function display_configuration_page() {
        $api_key      = Akismet::get_api_key();
        $akismet_user = self::get_akismet_user( $api_key );
        
        if ( ! $akismet_user ) {
            // This could happen if the user's key became invalid after it was previously valid and successfully set up.             self::$notices['status'] = 'existing-key-invalid';
            self::display_start_page();
            return;
        }

        $stat_totals  = self::get_stats( $api_key );

        // If unset, create the new strictness option using the old discard option to determine its default.         // If the old option wasn't set, default to discarding the blatant spam.         if ( get_option( 'akismet_strictness' ) === false ) {
            add_option( 'akismet_strictness', ( get_option( 'akismet_discard_month' ) === 'false' ? '0' : '1' ) );
        }
        
        // Sync the local "Total spam blocked" count with the authoritative count from the server.         if ( isset( $stat_totals['all']$stat_totals['all']->spam ) ) {
            update_option( 'akismet_spam_count', $stat_totals['all']->spam );
        }

        
Home | Imprint | This part of the site doesn't use cookies.