self::SLUG, 'crawling' => '1' ), admin_url( 'admin.php' ) ) ); exit; } ADNVAA_Scanner::run( ADNVAA_FREE_PAGE_LIMIT ); wp_safe_redirect( add_query_arg( array( 'page' => self::SLUG, 'scanned' => '1' ), admin_url( 'admin.php' ) ) ); exit; } /** * Crawl one time-boxed slice of the queue, then return to the progress * screen. Called repeatedly until the crawl reports itself done. */ public static function handle_crawl_batch() { if ( ! current_user_can( ADNVAA_CAP ) ) { wp_die( esc_html__( 'You do not have permission to run a scan.', 'adinav-accessibility-audit-eaa' ) ); } check_admin_referer( 'adnvaa_crawl_batch' ); if ( ! adnvaa_is_pro() ) { wp_die( esc_html__( 'A full-site crawl requires an active licence.', 'adinav-accessibility-audit-eaa' ), '', array( 'response' => 403 ) ); } $step = ADNVAA_Pro_Scanner::run_batches_for(); $state = empty( $step['done'] ) ? 'crawling' : 'scanned'; wp_safe_redirect( add_query_arg( array( 'page' => self::SLUG, $state => '1', ), admin_url( 'admin.php' ) ) ); exit; } /** * Abandon a crawl in progress. * * Needed because a crawl can outlive the customer's patience — a shop with * two thousand URLs on a slow host is a long wait, and a progress screen * with no way out is a trap. Results already written are kept: they are a * real partial audit, and the metadata records how far it got. */ public static function handle_crawl_cancel() { if ( ! current_user_can( ADNVAA_CAP ) ) { wp_die( esc_html__( 'You do not have permission to run a scan.', 'adinav-accessibility-audit-eaa' ) ); } check_admin_referer( 'adnvaa_crawl_cancel' ); if ( adnvaa_is_pro() ) { ADNVAA_Pro_Scanner::abandon(); } wp_safe_redirect( add_query_arg( array( 'page' => self::SLUG, 'cancelled' => '1' ), admin_url( 'admin.php' ) ) ); exit; } public static function handle_settings() { if ( ! current_user_can( ADNVAA_CAP ) ) { wp_die( esc_html__( 'You do not have permission to change these settings.', 'adinav-accessibility-audit-eaa' ) ); } check_admin_referer( 'adnvaa_save_settings' ); $existing = ADNVAA_Store::settings(); update_option( ADNVAA_Store::OPT_SETTINGS, array( 'entity_name' => isset( $_POST['entity_name'] ) ? sanitize_text_field( wp_unslash( $_POST['entity_name'] ) ) : '', 'contact_email' => isset( $_POST['contact_email'] ) ? sanitize_email( wp_unslash( $_POST['contact_email'] ) ) : '', // Falls back to the stored value rather than to empty, because the // field is only rendered for licensed sites. Reading it as absent // on a free install would wipe the alert address a customer set // while licensed, and they would discover it by not being told // about a regression. 'alert_email' => isset( $_POST['alert_email'] ) ? sanitize_email( wp_unslash( $_POST['alert_email'] ) ) : $existing['alert_email'], ) ); wp_safe_redirect( add_query_arg( array( 'page' => self::SLUG . '-statement', 'saved' => '1' ), admin_url( 'admin.php' ) ) ); exit; } // ------------------------------------------------------------- screens -- public static function render_dashboard() { // A crawl in progress owns the screen. Showing the previous scan's // results underneath a running crawl would be showing numbers that are // being overwritten as they are read. if ( adnvaa_is_pro() && ADNVAA_Pro_Scanner::queue_state() ) { self::render_crawl_progress(); return; } $meta = ADNVAA_Store::get_scan_meta(); $counts = ADNVAA_Store::counts_by_severity(); $by_rule = ADNVAA_Store::counts_by_rule(); $rules = ADNVAA_Rules::definitions(); $total = array_sum( $counts ); ?>
—
| () |