Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

Changing site ownership doesn't change the admin email address in WordPress (atomic only) #57464

Open arinoch opened 3 years ago

arinoch commented 3 years ago

Quick summary

When the owner of an atomic site changes, usually at a user's request, the admin email stored in the database is unchanged from the original owner.

Steps to reproduce

1: Create a dummy account. If an Automattic employee, you can use a + address. 2: Give yourself enough credits to purchase the business plan for a site. 3: Use any of the known methods to make that site atomic. 4: In the site RC, change the owner from the current account to any other account, including your own primary account. 5: In CLI, type: option get admin_email

What you expected to happen

The admin email should be updated to the new owner, as we would for posts and pages if the option is selected to do so.

What actually happened

The admin email remains that of the original owner.

Context

Discovered when investigating an issue regarding emails sent by a third-party plugin. The plugin was pulling the email address to send to from the admin email in the database, as most WordPress plugins that send out email do. Found in 4413109-zd-woothemes, tested and verified by me.

Operating System

No response

Browser

No response

Simple, Atomic or both?

Atomic

Theme-specific issue?

No response

Other notes

No response

Reproducibility

Consistent

Severity

No response

Available workarounds?

Yes, easy to implement

Workaround details

Users can still change this setting in wp-admin/options-general.php. However, since by default Calypso will redirect them away from there and to .com's version of settings > general, they will contact an HE to make that change--or, at least, to ask why their emails are being wrongly redirected.

masperber commented 1 year ago

I'm not 100% sure if this is a bug. The site administration email is an option that can be set independently. There could be some cases where a user intentionally sets the site administration email to an email that is not the site owner's or even an administrator user's. If we programatically change the site administration email, then we could in some cases overwrite an intentionally set site administration email.

Perhaps it would be possible to programatically update the site administration email if it is equal to the outgoing owner's email, and leave it if it has been set to a custom email address.

github-actions[bot] commented 1 year ago

Support References

This comment is automatically generated. Please do not edit it.