bail_on_activation example

/** * Attached to activate_{ plugin_basename( __FILES__ ) } by register_activation_hook() * @static */
    public static function plugin_activation() {
        if ( version_compare( $GLOBALS['wp_version'], AKISMET__MINIMUM_WP_VERSION, '<' ) ) {
            load_plugin_textdomain( 'akismet' );
            
            $message = '<strong>'.sprintf(esc_html__( 'Akismet %s requires WordPress %s or higher.' , 'akismet'), AKISMET_VERSION, AKISMET__MINIMUM_WP_VERSION ).'</strong> '.sprintf(__('Please <a href="%1$s">upgrade WordPress</a> to a current version, or <a href="%2$s">downgrade to version 2.4 of the Akismet plugin</a>.', 'akismet'), 'https://codex.wordpress.org/Upgrading_WordPress', 'https://wordpress.org/extend/plugins/akismet/download/');

            Akismet::bail_on_activation( $message );
        } elseif ( ! empty( $_SERVER['SCRIPT_NAME'] ) && false !== strpos( $_SERVER['SCRIPT_NAME'], '/wp-admin/plugins.php' ) ) {
            add_option( 'Activated_Akismet', true );
        }
    }

    /** * Removes all connection options * @static */
    public static function plugin_deactivation( ) {
        self::deactivate_key( self::get_api_key() );
        
        
Home | Imprint | This part of the site doesn't use cookies.