Skip to content

Fix PHP 8+ TypeError when service_data is a non-array value in localize_dashboard_app#1057

Open
Copilot wants to merge 3 commits intodevelopmentfrom
copilot/fix-php-8-compatibility-error
Open

Fix PHP 8+ TypeError when service_data is a non-array value in localize_dashboard_app#1057
Copilot wants to merge 3 commits intodevelopmentfrom
copilot/fix-php-8-compatibility-error

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 23, 2026

  • Investigate failing E2E tests from CI logs
  • Identify root cause: all failures are Firefox page-load timeouts (30s too tight for external test server)
  • Increase test timeout in playwright.config.ts from 30s to 60s
  • Add explicit navigationTimeout: 45000 for better handling of slow page loads
  • Address code review feedback: change service_data fallback from '' to [] for type consistency
  • Run validation

…rray (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>
Copilot AI changed the title [WIP] Fix fatal error on accessing service_data offset in admin.php Fix PHP 8+ TypeError when service_data is a non-array value in localize_dashboard_app Apr 23, 2026
Copilot AI requested a review from kushh23 April 23, 2026 06:51
@kushh23 kushh23 removed their request for review April 23, 2026 08:11
@kushh23 kushh23 marked this pull request as ready for review April 23, 2026 08:11
@pirate-bot
Copy link
Copy Markdown
Collaborator

pirate-bot commented Apr 23, 2026

Plugin build for b18eff5 is ready 🛎️!

@kushh23 kushh23 changed the base branch from master to development April 23, 2026 08:20
@kushh23 kushh23 requested a review from abaicus April 24, 2026 06:27
… 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>
Copilot AI requested a review from kushh23 April 24, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fatal error: Cannot access offset of type string on string in admin.php (PHP 8+ compatibility)

3 participants