0.01, 'blocking' => false, 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Core filter. 'body' => array( 'action' => 'aarye_async', 'token' => self::token(), ), ) ); } ); } /** * Background request: run the jobs. */ public static function run() { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Server-to-server request checked with a secret token, not a user form. $token = isset( $_POST['token'] ) ? sanitize_text_field( wp_unslash( $_POST['token'] ) ) : ''; if ( ! hash_equals( self::token(), $token ) ) { wp_die( '', '', array( 'response' => 403 ) ); } ignore_user_abort( true ); self::jobs(); exit; } /** * Run every job. */ public static function jobs() { /** * Background jobs (Google Sheets and extensions). */ do_action( 'aarye_async_run' ); } }