Extensions uninstalled when update Unyson using Jetpack/WordPress.com plugin manager
I installed Jetpack and Unyson on some of my sites, and manage the plugins using Jetpack/WordPress.com plugin manager. When I update Unyson using Jetpack/WordPress.com plugin manager all Unyson extensions on all of my sites uninstalled automatically, so I must reinstall again. How to resolve this problem?
Thanks
At the moment I can't test/reproduce it because I get this error

I wrote to Jetpack support and when it will be fixed I will inspect the problem.
Thank you for reporting.
I was able to connect. Inspecting...
Something like that also happened to me when first time activate Jetpack manage.
Hey there! I work on the Jetpack team, and might be able to shed some light on this.
Jetpack is buggy
I've replied to you via email about this, so we should be all set there!
When I update Unyson using Jetpack/WordPress.com plugin manager all Unyson extensions on all of my sites uninstalled automatically, so I must reinstall again.
I'm not super familiar with Unyson, so correct me if I'm wrong, but after a quick look at it, it seems extensions get installed in a subdirectory of the original unyson plugin.
When a new version of that original plugin is available in the WordPress.org plugin repository, you have 2 main options:
- Update via the Updates menu in your site's dashboard. Behind the scenes, WordPress downloads a copy of the new plugin version to
/wp-content/upgrade/, extracts the plugin, deletes the old one from/wp-content/plugins/unyson, and copies up the new one. - Update via a site manager like Calypso. If you use a self-hosted installation of WordPress, you can use Calypso via Jetpack and its Manage module. Behind the scenes, Calypso follows the same process as WordPress Core, like I outlined above.
It consequently seems logical that when updating the Unyson plugin, you lose all the files that were added to the plugin directory after the initial installation.
That said, things seem to be a bit different with Unyson. :) I tested option 1, and the extensions aren't actually lost on update. Is that something you actually handle in the Core plugin itself?
If so, it's most likely that the process you trigger on plugin updates handled by Core doesn't trigger when the update is handled via a remote tool like Calypso.
Could you tell me more about your update process? We could see if we can add support for that process to Calypso in the future.
Thanks!
After digging through this repo, it seems that the problem could be similar to the one that was reported in #1105 a few months back.
@jeherve Thank you for your time inspecting this and details answer
I tested option 1, and the extensions aren't actually lost on update. Is that something you actually handle in the Core plugin itself?
We attach to these 2 actions which runs before and after plugin update https://github.com/ThemeFuse/Unyson/blob/v2.5.5/unyson.php#L130-L131
Before plugin update we move extensions outside the plugin in a tmp folder, then after plugin update move them back https://github.com/ThemeFuse/Unyson/blob/master/framework/core/components/extensions/manager/class--fw-extensions-manager.php#L32-L33
You can recommend better "before/after plugin update actions"
We attach to these 2 actions which runs before and after plugin update https://github.com/ThemeFuse/Unyson/blob/v2.5.5/unyson.php#L130-L131
Neat, I didn't know about these 2 filters 👍
You can recommend better "before/after plugin update actions"
The 2 filters seem appropriate here. Let's see if we can start taking them into account in Calypso, or at least come up with a way to support this situation better. I created an issue there to track this, and pinged you both there: https://github.com/Automattic/wp-calypso/issues/5807