Commit af4501d0 authored by Erick Hitter's avatar Erick Hitter

PHPCS fixes

parent 61dc3f45
......@@ -91,7 +91,9 @@ class Main extends Singleton {
if ( false !== stripos( $_SERVER['REQUEST_URI'], '/wp-cron.php' ) || false !== stripos( $_SERVER['SCRIPT_NAME'], '/wp-cron.php' ) ) {
status_header( 403 );
/* translators: 1: Plugin name */
wp_send_json_error( new \WP_Error( 'forbidden', sprintf( __( 'Normal cron execution is blocked when the %s plugin is active.', 'automattic-cron-control' ), 'Cron Control' ) ), array( 'status' => 400 ) );
wp_send_json_error( new \WP_Error( 'forbidden', sprintf( __( 'Normal cron execution is blocked when the %s plugin is active.', 'automattic-cron-control' ), 'Cron Control' ) ), array(
'status' => 400,
) );
}
}
......@@ -117,10 +119,12 @@ class Main extends Singleton {
public function admin_notice() {
?>
<div class="notice notice-error">
<p><?php
<p>
<?php
/* translators: 1: Plugin name, 2: Constant name */
printf( __( '<strong>%1$s</strong>: To use this plugin, define the constant %2$s.', 'automattic-cron-control' ), 'Cron Control', '<code>WP_CRON_CONTROL_SECRET</code>' );
?></p>
?>
</p>
</div>
<?php
}
......
......@@ -53,7 +53,7 @@ const TIME_FORMAT = \Automattic\WP\Cron_Control\TIME_FORMAT;
function stop_the_insanity() {
global $wpdb, $wp_object_cache;
$wpdb->queries = array(); // or define WP_IMPORTING
$wpdb->queries = array();
if ( ! is_object( $wp_object_cache ) ) {
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment