Skip to content

Fixed admin email retrieval - #3117

Open
girishpanchal30 wants to merge 1 commit into
developmentfrom
bugfix/3102
Open

girishpanchal30 wants to merge 1 commit into
developmentfrom
bugfix/3102

Conversation

@girishpanchal30

Copy link
Copy Markdown
Contributor

Closes #3102

Summary

Updates the admin email addresses used for form notifications and alerts, ensuring that emails are consistently sent from and to the current site's admin email (get_option( 'admin_email' )) rather than the network admin email (get_site_option( 'admin_email' )). This change improves compatibility with WordPress multisite setups, where site and network admin emails may differ. The tests have been expanded to verify this behavior, including new coverage for edge cases.


Checklist before the final review

  • Included E2E or unit tests for the changes in this PR.
  • Visual elements are not affected by independent changes.
  • It is at least compatible with the minimum WordPress version.
  • It loads additional script in frontend only if it is required.
  • Does not impact the Core Web Vitals.
  • In case of deprecation, old blocks are safely migrated.
  • It is usable in Widgets and FSE.
  • Copy/Paste is working if the attributes are modified.
  • PR is following the best practices

@pirate-bot

Copy link
Copy Markdown
Contributor

Bundle Size Diff

Package Old Size New Size Diff
Animations 178.33 KB 178.33 KB 0 B (0.00%)
Blocks 1.65 MB 1.65 MB 0 B (0.00%)
CSS 7.83 KB 7.83 KB 0 B (0.00%)
Dashboard 172.49 KB 172.49 KB 0 B (0.00%)
Onboarding 68.14 KB 68.14 KB 0 B (0.00%)
Export Import 4.73 KB 4.73 KB 0 B (0.00%)
Pro 439.85 KB 439.85 KB 0 B (0.00%)

@girishpanchal30
girishpanchal30 requested a balanced review from Copilot October 14, 2026 12:23
@pirate-bot

Copy link
Copy Markdown
Contributor

Plugin build for 99ddcdb is ready 🛎️!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The targeted multisite behavior is implemented consistently and covered by focused tests.

0 open findings

What changed in this PR

Uses each site’s admin email for form notifications in multisite installations.

Changes:

  • Replaces network admin email lookups with current-site lookups.
  • Adds coverage for notifications, alerts, test emails, and autoresponders.
File Description
inc/​server/​class-form-server.php Uses site admin email for recipients and senders.
inc/​integrations/​class-form-email.php Displays the site admin email in email content.
plugins/​otter-pro/​inc/​plugins/​class-form-pro-features.php Uses site admin as the autoresponder sender.
tests/​test-form-server.php Tests site versus network admin behavior.
tests/​test-form-pro-delivery.php Tests Pro autoresponder and alert behavior.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

Form emails now use the current site's admin email on every path, and the new tests prove the change.

Validation details
  • Files reviewed: 5/5 changed files.
  • A source search found no remaining get_site_option( 'admin_email' ) read outside tests.
  • Sandbox: WordPress 7.1.3, PHP 8.3, PHPUnit 9.6.5. The 5 new tests pass on HEAD.
  • The same 5 tests fail on the base code. Each one gets network-admin@example.org instead of site-admin@example.org.
  • Single sites keep the same behavior, because get_site_option falls back to get_option there.
Untested areas
  • The multisite PHPUnit suite did not run. The tests use filters to give the site and the network different emails.

🤖 Automated review · run code-review-agent_6acf758fd245a0.10162683.


🤖 Review agent — review posted ✅ on 99ddcdb4 · approved · 0 findings · 5 min

Run code-review-agent_6acf758fd245a0.10162683 · trail

@pirate-bot

Copy link
Copy Markdown
Contributor

E2E Tests

Playwright Test Status: See serial and parallel matrix jobs

Performance Results serverResponse: {"q25":410.37,"q50":447.64,"q75":452.52,"cnt":10}, firstPaint: {"q25":1584.93,"q50":1642.24,"q75":2123.3,"cnt":10}, domContentLoaded: {"q25":4282.61,"q50":4300.43,"q75":4328.36,"cnt":10}, loaded: {"q25":4286.36,"q50":4304.23,"q75":4332.57,"cnt":10}, firstContentfulPaint: {"q25":2797.98,"q50":3221.4,"q75":3252.28,"cnt":10}, firstBlock: {"q25":19966.59,"q50":20155.9,"q75":20237.92,"cnt":10}, type: {"q25":34.93,"q50":39.56,"q75":44.74,"cnt":10}, typeWithoutInspector: {"q25":32.47,"q50":36,"q75":40.57,"cnt":10}, typeWithTopToolbar: {"q25":41.97,"q50":48.23,"q75":59.1,"cnt":10}, typeContainer: {"q25":18.73,"q50":20.14,"q75":21.55,"cnt":10}, focus: {"q25":155.99,"q50":166.23,"q75":169.04,"cnt":10}, inserterOpen: {"q25":53.41,"q50":54.53,"q75":57.92,"cnt":10}, inserterSearch: {"q25":33.66,"q50":36.16,"q75":37.07,"cnt":10}, inserterHover: {"q25":5.58,"q50":5.93,"q75":6.12,"cnt":20}, loadPatterns: {"q25":2167.79,"q50":2184.39,"q75":2219.19,"cnt":10}, listViewOpen: {"q25":260.32,"q50":265.96,"q75":275.03,"cnt":10}

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.

3 participants