WordPress / wordpress-playground

Run WordPress in the browser via WebAssembly PHP
https://w.org/playground/
GNU General Public License v2.0
1.65k stars 261 forks source link

Playground breaks if PHP creates any output during the activatePlugin step #1979

Open bgrgicak opened 3 weeks ago

bgrgicak commented 3 weeks ago

The WordPress activate_plugin function will return an error if anything was outputted to the screen during activation.

This will show an error to the user, but it won't break the site, also the plugin will be activated.

If this happens during Playground boot, we will throw an error and the boot process will break. This happens because we throw all errors during the activatePlugin step.

Recreate issue in Playground using this link.

Potential solution

Because this is only an issue in Blueprints I suggest we catch this unexpected_output error code and return a warning to the logger instead of throwing an error.

This will allow the user to use Playground even if there is an unexpected_output error during boot.