WordPress / plugin-check

A repository for the new Plugin Check plugin from the WordPress Performance and Plugins Team.
https://wordpress.org/plugins/plugin-check/
GNU General Public License v2.0
262 stars 54 forks source link

New user E-mail sent out on accessibility or/and performance test #424

Closed ipajen closed 9 months ago

ipajen commented 9 months ago

Bug Report

Description

When checking accessibility or/and performance test a email is sent out with admin credentials for new site. (System failed to delivery e-mail)

https://wordpress.slack.com/archives/C1LBM36LC/p1707869533873209

Environment

Steps to Reproduce

  1. Install and activate PPC version 1.0.0
  2. Tick accessibility or/and performance test and run check on any plugin
  3. 🐞 Bug occurs.

Expected Results

  1. ✅ Disable the e-mail sending. Or does a new user need to be created for the test?

Actual Results

  1. ❌ System Mail Delivery e-mail sent out on every check - Mail delivery failed: returning message to sender demo@plugincheck.test Unrouteable address

With a new user (administrator) and password for “ New WordPress Site”

dd32 commented 9 months ago

Code in question:

https://github.com/WordPress/plugin-check/blob/17a85acefcd157a92d1a798850638d01660c7194/includes/Checker/Runtime_Environment_Setup.php#L51-L56

and the core function that is responsible: https://github.com/WordPress/wordpress-develop/blob/8ec4d9dfc7e2043485d83d4af9e505ec1cc21470/src/wp-admin/includes/upgrade.php#L535-L616

Filtering that filter and returning a falsey value would work.. but filtering wp_mail() as a whole is probably a better route.