playground-tools icon indicating copy to clipboard operation
playground-tools copied to clipboard

wp-now plugin updates don't work

Open bgrgicak opened this issue 1 year ago • 4 comments

Plugin updates in wp-now fail with a Update failed: Could not remove the old plugin. error. After reloading the plugin doesn't show up anymore and it's deleted from the filesystem.

Plugin updates in wp-now should work like in any other WordPress environment.

This issue is the root cause of https://github.com/WordPress/playground-tools/issues/160 and https://github.com/WordPress/playground-tools/issues/134

There was some previous research done here: https://github.com/WordPress/playground-tools/issues/134#issuecomment-1973182771

bgrgicak avatar Mar 05 '24 19:03 bgrgicak

@bgrgicak is the root cause of this issue known now?

adamziel avatar Mar 13 '24 09:03 adamziel

No, I did more research but couldn't find the issue. @sejas could there be something specific to how wp-now works that would prevent plugin updates?

bgrgicak avatar Mar 13 '24 09:03 bgrgicak

@bgrgicak , I think it's not related to wp-now or the way we mount the folders. I tried in WordPress mode which is the most "plain" way to run the Playground and I got the same error.

Here are my observations during the test:

  1. When clicking update, the plugin folder is deleted from the computer filesystem.
  2. WordPress returns an error Update failed: Could not remove the old plugin..
  3. After refreshing the browser WordPress throws errors about not being able to load the plugin files.
Warning: include_once(/var/www/html/wp-content/plugins/classic-editor/classic-editor.php): Failed to open stream: No such file or directory in /var/www/html/wp-settings.php on line 473

Warning: include_once(): Failed opening '/var/www/html/wp-content/plugins/classic-editor/classic-editor.php' for inclusion (include_path='.:') in /var/www/html/wp-settings.php on line 473

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-settings.php:473) in /var/www/html/wp-admin/includes/misc.php on line 1431

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-settings.php:473) in /var/www/html/wp-includes/functions.php on line 7049

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-settings.php:473) in /var/www/html/wp-admin/admin-header.php on line 9
  1. When restarting wp-now the plugin is successfully deactivated, I don't see the header errors and I'm able to install it again.

My guess is that the folder remains present in VFS, probably an empty folder. I didn't validate it though.

sejas avatar Mar 13 '24 10:03 sejas

I've verified the plugin still exists at the /var/www/html/wp-content/plugins... path after updating, even though it's removed in the local plugin directory.

I have been experimenting with a custom plugin that attempts to manually sync the VFS and local file deletions, but haven't been able to figure out something that works as of yet. I'd be grateful for any other ideas or tips, as I'm feeling somewhat blocked on a solution.

SiobhyB avatar May 14 '24 13:05 SiobhyB