admin_url( 'admin-ajax.php' ),
'nonce' => wp_create_nonce( 'siftra_progress' ),
'scanId' => (int) $queue['scan_id'],
'reload' => admin_url( 'admin.php?page=siftra' ),
)
);
}
/**
* Page controller.
*
* @return void
*/
public static function render() {
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( esc_html__( 'You are not allowed to view this page.', 'siftra' ) );
}
$tab = isset( $_GET['tab'] ) ? sanitize_key( wp_unslash( $_GET['tab'] ) ) : 'scan';
if ( ! in_array( $tab, array( 'scan', 'statement' ), true ) ) {
$tab = 'scan';
}
$base = admin_url( 'admin.php?page=siftra' );
?>
0 ? (int) floor( ( $done / $total ) * 100 ) : 0;
?>
$meta ) {
if ( empty( $counts[ $key ] ) ) {
continue;
}
$total = (int) $counts[ $key ]['total'];
$severity = 'notice';
if ( (int) $counts[ $key ]['error'] > 0 ) {
$severity = 'error';
} elseif ( (int) $counts[ $key ]['warning'] > 0 ) {
$severity = 'warning';
}
$rows = Siftra_DB::issues_by_rule( $scan_id, $key, 50 );
?>
>
WCAG
count( $rows ) ) : ?>
isset( $_POST['org'] ) ? sanitize_text_field( wp_unslash( $_POST['org'] ) ) : '',
'site' => isset( $_POST['site'] ) ? esc_url_raw( wp_unslash( $_POST['site'] ) ) : '',
'email' => isset( $_POST['email'] ) ? sanitize_email( wp_unslash( $_POST['email'] ) ) : '',
'phone' => isset( $_POST['phone'] ) ? sanitize_text_field( wp_unslash( $_POST['phone'] ) ) : '',
'standard' => isset( $_POST['standard'] ) ? sanitize_text_field( wp_unslash( $_POST['standard'] ) ) : 'WCAG 2.1 level AA',
'conformance' => isset( $_POST['conformance'] ) ? sanitize_text_field( wp_unslash( $_POST['conformance'] ) ) : 'partially conformant',
'date' => isset( $_POST['date'] ) ? sanitize_text_field( wp_unslash( $_POST['date'] ) ) : '',
'response_days' => isset( $_POST['response_days'] ) ? absint( $_POST['response_days'] ) : 5,
'known_issues' => $issues,
'manual' => isset( $_POST['manual'] ) ? sanitize_text_field( wp_unslash( $_POST['manual'] ) ) : '',
'pages_checked' => $read,
'pages_attempted' => $attempted,
)
);
$email_on_file = isset( $_POST['email'] ) ? sanitize_email( wp_unslash( $_POST['email'] ) ) : $email_on_file;
}
$email_usable = Siftra_Statement::is_usable_email( $email_on_file );
?>
' . esc_html( '' === $email_on_file ? __( '(empty)', 'siftra' ) : $email_on_file ) . ''
);
?>
300 ) {
$max = (int) get_option( 'siftra_max_pages', 50 );
}
Siftra_Crawler::start( $max );
wp_safe_redirect( admin_url( 'admin.php?page=siftra' ) );
exit;
}
/**
* Stop the running scan.
*
* @return void
*/
public static function handle_abort() {
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( esc_html__( 'You are not allowed to do that.', 'siftra' ) );
}
check_admin_referer( 'siftra_abort' );
Siftra_Crawler::abort();
wp_safe_redirect( admin_url( 'admin.php?page=siftra' ) );
exit;
}
/**
* Save the limits.
*
* @return void
*/
public static function handle_settings() {
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( esc_html__( 'You are not allowed to do that.', 'siftra' ) );
}
check_admin_referer( 'siftra_settings' );
$max = isset( $_POST['max_pages'] ) ? absint( $_POST['max_pages'] ) : 50;
$batch = isset( $_POST['batch_size'] ) ? absint( $_POST['batch_size'] ) : 5;
if ( $max < 1 || $max > 300 ) {
$max = 50;
}
if ( $batch < 1 || $batch > 20 ) {
$batch = 5;
}
update_option( 'siftra_max_pages', $max );
update_option( 'siftra_batch_size', $batch );
wp_safe_redirect( admin_url( 'admin.php?page=siftra' ) );
exit;
}
}