execute(); } catch ( \Throwable $e ) { atkp_cron_error_page( get_class( $e ) . ': ' . $e->getMessage(), null, $e ); } function atkp_cron_error_page( string $title, ?string $detail = null, ?\Throwable $exception = null ) { // This URL is publicly reachable: file paths, messages and stack traces are only shown on the // command line or with WP_DEBUG enabled. They always go to the PHP error log. $show_details = php_sapi_name() == 'cli' || ( defined( 'WP_DEBUG' ) && WP_DEBUG ); if ( $exception ) { error_log( 'affiliate-toolkit cron: ' . $title . ' in ' . $exception->getFile() . ':' . $exception->getLine() . "\n" . $exception->getTraceAsString() ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log } else { error_log( 'affiliate-toolkit cron: ' . $title . ( $detail ? ' - ' . $detail : '' ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log } if ( ! $show_details ) { if ( $exception ) { $title = 'An error occurred while running the cron job'; } $detail = 'The details have been written to the PHP error log. Enable WP_DEBUG to show them on this page.'; $exception = null; } if ( ! headers_sent() ) { header( 'Content-Type: text/html; charset=UTF-8', true, 500 ); } ?> affiliate-toolkit Cron Error

affiliate-toolkit — Cron Error

File
getFile(), ENT_QUOTES, 'UTF-8' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
Line
getLine(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
Code
getCode(), ENT_QUOTES, 'UTF-8' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
Stack TracegetTraceAsString() ); foreach ( $frames as $frame ) { $frame = htmlspecialchars( $frame ); // highlight file paths and line numbers $frame = preg_replace( '/(#\d+)/', '$1', $frame ); $frame = preg_replace( '/([^\s(]+\.php)/', '$1', $frame ); $frame = preg_replace( '/\((\d+)\)/', '($1)', $frame ); // Frame already escaped via htmlspecialchars; span tags are intentional. echo $frame . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } ?>
get_crontype(); $mode = ATKPTools::get_get_parameter( 'mode', 'string' ); $key = ATKPTools::get_get_parameter( 'key', 'string' ); $cron_key = ATKPTools::get_setting( ATKP_PLUGIN_PREFIX . '_cronkey' ); if ( php_sapi_name() == 'cli' ) echo 'cmd mode running'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped else if ( defined( 'WP_CLI' ) && WP_CLI ) { echo 'cli mode running'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } else { if ( $key == '' || trim( $cron_key ) != trim( $key ) ) { // die( int ) only sets the exit status, the HTTP status has to be sent explicitly if ( ! headers_sent() ) { http_response_code( 401 ); } echo 'key invalid'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped die( 401 ); } } switch ( $crontype ) { default: case 'wpcron': //wp cron? nothing todo... if ( ! headers_sent() ) { http_response_code( 404 ); } echo 'external cronjob deactivated'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped die( 404 ); case 'external': case 'externaloutput': $cronjob = new atkp_cronjob_new( $crontype == 'externaloutput' ); $cronjob->do_work( false, $mode ); break; } //exit the script exit; } } ?>