register(); ( new Features\SafeFixes() )->register(); ( new Editor\Assistant() )->register(); // The browser pass loads pages in a hidden frame; keep the admin bar out of them. add_filter( 'show_admin_bar', static function ( $show ) { if ( isset( $_GET['a11ymate_scan'] ) && current_user_can( Settings::capability() ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended return false; } return $show; } ); if ( is_admin() ) { ( new Admin\Admin() )->register(); } if ( defined( 'WP_CLI' ) && WP_CLI ) { \WP_CLI::add_command( 'a11ymate', Cli\Command::class ); } } /** * Activation. * * @return void */ public static function activate() { Schema::install(); if ( false === get_option( Settings::OPTION, false ) ) { add_option( Settings::OPTION, Settings::defaults(), '', false ); } set_transient( 'a11ymate_activated', 1, 60 ); } /** * Deactivation: stop scheduled work, keep data. * * @return void */ public static function deactivate() { } }