diff --git a/lib/Cleantalk/ApbctWP/RemoteCalls.php b/lib/Cleantalk/ApbctWP/RemoteCalls.php index 7f2b85ce..658b6cd5 100644 --- a/lib/Cleantalk/ApbctWP/RemoteCalls.php +++ b/lib/Cleantalk/ApbctWP/RemoteCalls.php @@ -297,13 +297,14 @@ public static function action__debug() // phpcs:ignore PSR1.Methods.CamelCapsMet { global $apbct, $wpdb; + $out = array(); + if (Get::get('run_send_feedback') === '1') { $out['send_feedback'] = array('result' => ct_send_feedback() ? 'true' : 'false'); } $sfw_table_name = !empty($apbct->data['sfw_common_table_name']) ? $apbct->data['sfw_common_table_name'] : APBCT_TBL_FIREWALL_DATA; - $out = array(); $out['sfw_data_base_size'] = $wpdb->get_var('SELECT COUNT(*) FROM ' . $sfw_table_name); $out['stats'] = $apbct->stats; $out['settings'] = self::getSettings($apbct->settings); diff --git a/lib/Cleantalk/ApbctWP/RestController.php b/lib/Cleantalk/ApbctWP/RestController.php index ba141504..11a4c33d 100644 --- a/lib/Cleantalk/ApbctWP/RestController.php +++ b/lib/Cleantalk/ApbctWP/RestController.php @@ -135,7 +135,7 @@ public function register_routes() // phpcs:ignore PSR1.Methods.CamelCapsMethodNa 'methods' => 'POST', 'callback' => array(\Cleantalk\ApbctWP\Antispam\ForceProtection::getInstance(), 'checkBot'), 'permission_callback' => function (WP_REST_Request $request) { - return wp_verify_nonce($request->get_header('x_wp_nonce'), 'wp_rest'); + return wp_verify_nonce(TT::toString($request->get_header('x_wp_nonce')), 'wp_rest'); }, 'args' => array( 'event_javascript_data' => array(