| @@ -657,9 +657,9 @@ | ||
| 657 | 657 | */ |
| 658 | 658 | private function get_option_last_updated($option_name) { |
| 659 | 659 | global $wpdb; |
| 660 | 660 | |
| 661 | - $result = $wpdb->get_var($wpdb->prepare( | |
| 661 | + $result = $wpdb->get_var($wpdb->prepare( // phpcs:ignore WordPress.DB.DirectDatabaseQuery -- admin debug tool — scratch diagnostics storage outside any WordPress API | |
| 662 | 662 | "SELECT option_value FROM {$wpdb->options} WHERE option_name = %s", |
| 663 | 663 | $option_name |
| 664 | 664 | )); |
| 665 | 665 | |
| @@ -665,9 +665,9 @@ | ||
| 665 | 665 | |
| 666 | 666 | if ($result) { |
| 667 | 667 | $data = maybe_unserialize($result); |
| 668 | 668 | if (isset($data['last_updated'])) { |
| 669 | - return date('Y-m-d H:i:s', $data['last_updated']); | |
| 669 | + return gmdate('Y-m-d H:i:s', $data['last_updated']); | |
| 670 | 670 | } |
| 671 | 671 | } |
| 672 | 672 | |
| 673 | 673 | return 'Unknown'; |
| @@ -978,9 +978,9 @@ | ||
| 978 | 978 | |
| 979 | 979 | wp_send_json_success($results); |
| 980 | 980 | |
| 981 | 981 | } catch (Exception $e) { |
| 982 | - error_log('MetaSync OTTO Debug: Exception in ajax_test_specific_url: ' . $e->getMessage()); | |
| 982 | + error_log('MetaSync OTTO Debug: Exception in ajax_test_specific_url: ' . $e->getMessage()); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- unreachable in production | |
| 983 | 983 | wp_send_json_error('Exception: ' . $e->getMessage()); |
| 984 | 984 | } |
| 985 | 985 | } |
| 986 | 986 | |
| @@ -1111,9 +1111,9 @@ | ||
| 1111 | 1111 | /** |
| 1112 | 1112 | * Test page type detection |
| 1113 | 1113 | */ |
| 1114 | 1114 | private function test_page_type_detection($url) { |
| 1115 | - $parsed_url = parse_url($url); | |
| 1115 | + $parsed_url = wp_parse_url($url); | |
| 1116 | 1116 | $path = $parsed_url['path'] ?? '/'; |
| 1117 | 1117 | |
| 1118 | 1118 | $detection = array( |
| 1119 | 1119 | 'url' => $url, |
| @@ -1224,9 +1224,9 @@ | ||
| 1224 | 1224 | 'nonce_verified' => true |
| 1225 | 1225 | )); |
| 1226 | 1226 | |
| 1227 | 1227 | } catch (Exception $e) { |
| 1228 | - error_log('MetaSync OTTO Debug: Exception in ajax_simple_test: ' . $e->getMessage()); | |
| 1228 | + error_log('MetaSync OTTO Debug: Exception in ajax_simple_test: ' . $e->getMessage()); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- unreachable in production | |
| 1229 | 1229 | wp_send_json_error('Exception: ' . $e->getMessage()); |
| 1230 | 1230 | } |
| 1231 | 1231 | } |
| 1232 | 1232 | |
| @@ -1258,9 +1258,9 @@ | ||
| 1258 | 1258 | |
| 1259 | 1259 | // Test 2: Check if we can access Action Scheduler tables |
| 1260 | 1260 | global $wpdb; |
| 1261 | 1261 | $table_name = $wpdb->prefix . 'actionscheduler_actions'; |
| 1262 | - $table_exists = $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name; | |
| 1262 | + $table_exists = $wpdb->get_var($wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name))) == $table_name; // phpcs:ignore WordPress.DB.DirectDatabaseQuery -- admin debug tool — scratch diagnostics storage outside any WordPress API | |
| 1263 | 1263 | |
| 1264 | 1264 | $results['tests']['table_access'] = array( |
| 1265 | 1265 | 'table_exists' => $table_exists, |
| 1266 | 1266 | 'table_name' => $table_name, |
| @@ -1268,9 +1268,9 @@ | ||
| 1268 | 1268 | ); |
| 1269 | 1269 | |
| 1270 | 1270 | // Test 3: Try to insert a test record |
| 1271 | 1271 | if ($table_exists) { |
| 1272 | - $insert_result = $wpdb->insert( | |
| 1272 | + $insert_result = $wpdb->insert( // phpcs:ignore WordPress.DB.DirectDatabaseQuery -- admin debug tool — scratch diagnostics storage outside any WordPress API | |
| 1273 | 1273 | $table_name, |
| 1274 | 1274 | array( |
| 1275 | 1275 | 'hook' => 'metasync_debug_test', |
| 1276 | 1276 | 'status' => 'pending', |
| @@ -1289,9 +1289,9 @@ | ||
| 1289 | 1289 | ); |
| 1290 | 1290 | |
| 1291 | 1291 | // Clean up test record |
| 1292 | 1292 | if ($insert_result !== false && $wpdb->insert_id) { |
| 1293 | - $wpdb->delete($table_name, array('ID' => $wpdb->insert_id)); | |
| 1293 | + $wpdb->delete($table_name, array('ID' => $wpdb->insert_id)); // phpcs:ignore WordPress.DB.DirectDatabaseQuery -- admin debug tool — scratch diagnostics storage outside any WordPress API | |
| 1294 | 1294 | } |
| 1295 | 1295 | } |
| 1296 | 1296 | |
| 1297 | 1297 | // Test 4: Check WordPress cron functionality |
| @@ -1303,9 +1303,9 @@ | ||
| 1303 | 1303 | |
| 1304 | 1304 | wp_send_json_success($results); |
| 1305 | 1305 | |
| 1306 | 1306 | } catch (Exception $e) { |
| 1307 | - error_log('MetaSync OTTO Debug: Exception in ajax_test_db_permissions: ' . $e->getMessage()); | |
| 1307 | + error_log('MetaSync OTTO Debug: Exception in ajax_test_db_permissions: ' . $e->getMessage()); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- unreachable in production | |
| 1308 | 1308 | wp_send_json_error('Exception: ' . $e->getMessage()); |
| 1309 | 1309 | } |
| 1310 | 1310 | } |
| 1311 | 1311 | } |