From dc41a284113a129cdd3c012bd323a804a231bb8a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Apr 2026 06:38:47 +0000 Subject: [PATCH 1/3] Initial plan From c5b852ef80397de8241c72b24e861012a96da73b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Apr 2026 06:50:47 +0000 Subject: [PATCH 2/3] Fix TypeError in localize_dashboard_app when service_data is not an array (PHP 8+) Add is_array() guard after retrieving service_data to normalize non-array values to empty string, preventing fatal "Cannot access offset of type string on string" error on PHP 8+. Agent-Logs-Url: https://github.com/Codeinwp/optimole-wp/sessions/787a8a46-2d70-41ae-9538-6ab319b47136 Co-authored-by: kushh23 <110405452+kushh23@users.noreply.github.com> --- inc/admin.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inc/admin.php b/inc/admin.php index b413faae..a1599b4d 100755 --- a/inc/admin.php +++ b/inc/admin.php @@ -1415,6 +1415,9 @@ private function localize_dashboard_app() { } $api_key = $this->settings->get( 'api_key' ); $service_data = $this->settings->get( 'service_data' ); + if ( ! is_array( $service_data ) ) { + $service_data = ''; + } $user = get_userdata( get_current_user_id() ); $user_status = 'inactive'; $auto_connect = get_option( Optml_Settings::OPTML_USER_EMAIL, 'no' ); From b18eff598e127c06e02ab42b4fe2a23e5993c322 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Apr 2026 06:36:49 +0000 Subject: [PATCH 3/3] Fix E2E test timeouts: increase Playwright timeout to 60s and add 45s navigation timeout All E2E failures were Firefox page-load timeouts against the external test server with the previous 30s limit. Also improve service_data fallback to use empty array instead of empty string for type consistency. Agent-Logs-Url: https://github.com/Codeinwp/optimole-wp/sessions/1ae8a7b0-0ced-417f-91c5-681d77eb0704 Co-authored-by: kushh23 <110405452+kushh23@users.noreply.github.com> --- inc/admin.php | 2 +- playwright.config.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/admin.php b/inc/admin.php index a1599b4d..d1b37e76 100755 --- a/inc/admin.php +++ b/inc/admin.php @@ -1416,7 +1416,7 @@ private function localize_dashboard_app() { $api_key = $this->settings->get( 'api_key' ); $service_data = $this->settings->get( 'service_data' ); if ( ! is_array( $service_data ) ) { - $service_data = ''; + $service_data = []; } $user = get_userdata( get_current_user_id() ); $user_status = 'inactive'; diff --git a/playwright.config.ts b/playwright.config.ts index c559c076..f82cb686 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -2,12 +2,13 @@ import { defineConfig } from '@playwright/test'; export default defineConfig({ testDir: './tests/e2e', - timeout: 30000, + timeout: 60000, workers: process.env.CI ? 2 : 5, retries: process.env.CI ? 2 : 0, use: { baseURL: 'http://testing.optimole.com', // Replace with your local WordPress URL trace: 'on-first-retry', + navigationTimeout: 45000, }, projects: [ {