wp-calypso icon indicating copy to clipboard operation
wp-calypso copied to clipboard

Marketplace: Paid plugins are not running sync actions

Open lupus2k opened this issue 3 years ago • 9 comments

When you install a paid plugin, it does not run sync actions on Jetpack but it runs on free plugins. P2 post: pb5gDS-1L1-p2 Possible solutions: pb5gDS-1L1-p2#comment-2685

Steps to reproduce

In calypso, it can only be reproduced with the Sensei Pro banner.

  1. Install Sensei LMS plugin.
  2. On load /plugins, you will see a banner at the top of the plugins page (screenshot)
  3. Install Sensei Pro plugin.
  4. You should not see the banner but it shows when sync fails.

lupus2k avatar Apr 29 '22 15:04 lupus2k

Hey @cpapazoglou. I tried your suggestion but the wp activate command runs perfectly but still does not sync and there is no CLI command to sync just whatever I want. One solution is to run wp jetpack sync start and sync the jetpack site after a plugin is installed/uninstalled

lupus2k avatar May 03 '22 15:05 lupus2k

@lupus2k is there WIP diff where can explore the initial suggestion? I feel that wp jetpack sync start might not be so performant especially in big sites. @fgiannar does wp jetpack sync start run incrementally?

cpapazoglou avatar May 04 '22 13:05 cpapazoglou

@cpapazoglou I'm not sure what your suggestion was :) Running wp jetpack sync start, aka performing a Full Sync, is indeed very expensive and we'd still miss any events triggered in WPCOM by syncing the individual jetpack_plugin_installed and deleted_plugin actions (eg Activity Log).

is there WIP diff where can explore the initial suggestion?

💯

fgiannar avatar May 04 '22 14:05 fgiannar

@cpapazoglou No WIP diff yet, I tested your suggestion but nothing changes because both actions are running without problem (plugin activation / plugin installation), the problem es none of these actions calls for a sync.

My solution is to make a third action to call for a sync but there is no action to sync only the selected plugin.

I enter on parental leave, I copy my team to take a look into this @Automattic/explorers

lupus2k avatar May 05 '22 03:05 lupus2k

The marketplace_post_transfer_manage_software runs a WP CLI command (via SSH) to activate the plugin. In this command we skip all already installed plugins from loading (except the required) so that there is no conflict while activating the plugin. The idea here is avoiding to skip Jetpack, so that the sync code is loaded and runs when the plugin is activated as suggested here pb5gDS-1L1-p2#comment-2686.

Let's try that in a WIP diff to see if it's working or not.

cpapazoglou avatar May 09 '22 11:05 cpapazoglou

From planning: Add another post-transfer manage_software async job. Timebox investigation: half a day, or remove from sprint.

allilevine avatar May 09 '22 22:05 allilevine

From backlog grooming: alternatively, we could use a workaround hack using front-end plugin data. See p1658813074856179/1658765131.121169-slack-C03FE3T479R

allilevine avatar Jul 26 '22 20:07 allilevine

From same thread: Wondering if these planned changes have an impact on this as it will mess with the way plugins get installed / activated and the timing of it. pdh6GB-1FC-p2

lsl avatar Jul 27 '22 00:07 lsl

Might be able to avoid the workaround but need more time to investigate.

Linking the debug issue https://github.com/Automattic/wp-calypso/issues/23565#issuecomment-1198952641

And the 20% time p2 pb5gDS-1Vj-p2 about D85060-code and D85066-code

lsl avatar Aug 02 '22 22:08 lsl