• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Akismet_Admin::display_start_page() –

You appear to be a bot. Output may be restricted

Description

Usage

Akismet_Admin::display_start_page();

Parameters

Returns

void

Source

File name: akismet/class.akismet-admin.php
Lines:

1 to 49 of 49
  public static function display_start_page() {
    if ( isset( $_GET['action'] ) ) {
      if ( $_GET['action'] == 'delete-key' ) {
        if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], self::NONCE ) )
          delete_option( 'wordpress_api_key' );
      }
    }

    if ( $api_key = Akismet::get_api_key() && ( empty( self::$notices['status'] ) || 'existing-key-invalid' != self::$notices['status'] ) ) {
      self::display_configuration_page();
      return;
    }
    
    //the user can choose to auto connect their API key by clicking a button on the akismet done page
    //if jetpack, get verified api key by using connected wpcom user id
    //if no jetpack, get verified api key by using an akismet token	
    
    $akismet_user = false;
    
    if ( isset( $_GET['token'] ) && preg_match('/^(\d+)-[0-9a-f]{20}$/', $_GET['token'] ) )
      $akismet_user = self::verify_wpcom_key( '', '', array( 'token' => $_GET['token'] ) );
    elseif ( $jetpack_user = self::get_jetpack_user() )
      $akismet_user = self::verify_wpcom_key( $jetpack_user['api_key'], $jetpack_user['user_id'] );
      
    if ( isset( $_GET['action'] ) ) {
      if ( $_GET['action'] == 'save-key' ) {
        if ( is_object( $akismet_user ) ) {
          self::save_key( $akismet_user->api_key );
          self::display_configuration_page();
          return;
        }
      }
    }

    Akismet::view( 'start', compact( 'akismet_user' ) );

    /*
		// To see all variants when testing.
		$akismet_user->status = 'no-sub';
		Akismet::view( 'start', compact( 'akismet_user' ) );
		$akismet_user->status = 'cancelled';
		Akismet::view( 'start', compact( 'akismet_user' ) );
		$akismet_user->status = 'suspended';
		Akismet::view( 'start', compact( 'akismet_user' ) );
		$akismet_user->status = 'other';
		Akismet::view( 'start', compact( 'akismet_user' ) );
		$akismet_user = false;
		*/
  }
 

 View on GitHub View on Trac

Published: 19th December 2019 | Last updated: 19th December 2019

Primary Sidebar

Information

Function name: Akismet_Admin::display_start_page
Class ref: Akismet_Admin
Plugin ref: Akismet
Version: 5.0.1
Sourcefile: class.akismet-admin.php
File ref: class.akismet-admin.php
Deprecated?: No
API Letters: A,D,P,S

Footer

WordPress a2z
WordPress a2z
WordPress Dynamic API Reference
WordPress 6.1.1. PHP: 8.0.28
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wp-a2z.org
© Copyright WordPress a2z 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites