GP: WPCLI-Update for paid versions, when is this going to happen?

  • So a year has passed that we spent using manual labor for each and every update, and still there is no way to programmatically/automatically update our paid versions as easy as we can update all wp.org hosted plugins and also the vast majority of other paid plugins too.

    Out of curiousity I just tried it today with the 2.5.4 update being available, and it failed.

    Actually today is the anniversary day of the post at
    https://generate.support/topic/manual-update-of-gp-premium/ and one year later even the clumsy workaround I described there does not work any more. It involved manually copying the download URL from the Download page and handing that URL over to wp-cli. Obviously some session-based security was added so that copying the url and using it on a different device does not work any more.

    So: it was possible to add even tighter security to secure the downloads. Congratulations for that!
    But then it should also be possible to make life easier for admins at the same time and allow some sort of programmatic update, preferably with WPCLI. To me, the priority would have been the latter.

    Is this still somewhere on the road map? Given that we were considering using GP on one or two more sites, the efficient handling of updates becomes even more important… so please, please put this on your priority list …
    Thanks,
    Ulrich

  • Hi there,

    Is your license key activated on your sites?

  • Hi ,

    yes, of course … it is licensed correctly, and in the running live site, we are able to click the update link in the WordPress Admin backend. But I am talking about programatically/automated Updates. And, this is crucial, we are not doing updates in the running live site by clicking or by enabling auto-updates.

    This is not an unusual pattern for environmants deployed via CI/CD tools. There, Updates are not performed by clicking around in the live site. The live sites are deployed from Git repos and update routines are performed headless. The updated code is then deployed to staging sites first, and then to the live site. This is a one-way process, from CI to stage to live, and never will code from the live site be fetched back into the repo.

    We are using quite a lot paid plugins with different licensing/update/download schemes, and for 99% of them we can automate the update process. In most cases it even works with WPCLIs simple wp plugin update … command. So I think there should be a way to do it for the plugins of the generate* family, too. And maybe there is – but if so I never found it.

    Regards Ulrich

  • Hi there,

    Just got an update from Tom – we’ll be prioritizing this feature in the next GPP update, expected in the v2.6 release.

  • I am very glad to hear that, great news!!

    Since the reason for opening this ticket was to find out whether the update automation feature meanwhile does exist or not, I will now close this ticket and look forward to 2.6 🙂

    Thank you and best regards
    Ulrich

  • You’re welcome! 🙂

  • Hi again,
    with 2.6 in RC now, and after another year has passed, and after manual fiddling with every update, are we going to see WPCLI-Updates for the paid version in 2.6?
    I don’t see it in the Changelog, and if is NOT included, I would ask to at least (re-)allow downlads of Updates using the URL token aquired from the login section so we can do “wp plugin install “https://(download-url)” –force using the download URL.
    Regards
    Ulrich

  • Hi Ulrich,

    If you only need to update the plugins via WP-CLI, and the plugins are already installed with an activated license key, you can use the following commands:

    
    wp plugin update gp-premium
    wp plugin update generateblocks-pro
    

    WP-CLI support for installing the plugins is not currently available. However, updating installed plugins via WP-CLI is supported using the commands above.

  • Hi @Alvind – I see progress …

    Currently, we were at 2.6.0 on our production site. In the admin GUI the 2.6.1 is visible/announced.
    At the same time, on the command line, there is no Update visible, and your recommendation to issue the wp plugin update command did not help.

    wp plugin list --all |grep generate
    generateblocks-pro      active  none    2.6.0           off
    
    kde-wordpress:/var/www/html# wp plugin update generateblocks-pro
    Success: Plugin already updated.

    Only after removing all transients and running
    wp cron event run wp_update_themes wp_update_plugins wp_version_check

    the update was performed on the command line. Is this expected behaviour? At least it is possible now to do command line updates. That is a relief eventually.
    Regards
    Ulrich

  • I’m not entirely certain, but it could be due to a stale update transient.

    The WordPress admin dashboard and WP-CLI both read from the update_plugins site transient, but they may trigger the version check at different times.

    The dashboard can force a fresh update check on certain pages, while wp plugin update may still be reading an older cached transient.

  • Sorry, but I have to return to this issue once again.
    While manually forcing Update checks worked for 260>261, now again I am faced with cli updates NOT working.

    www-data@kde-wordpress:~/html$ wp plugin list --all | grep generate && wp transient delete --all && wp cron event run wp_update_themes wp_update_plugins wp_version_check && wp plugin update generateblocks-pro
    generateblocks  active  none    2.4.0           off
    generateblocks-pro      active  none    2.6.1           off
    regenerate-thumbnails-advanced  active  none    2.5.0           off
    Success: 14 transients deleted from the database.
    Executed the cron event 'wp_version_check' in 2.323s.
    Executed the cron event 'wp_version_check' in 0.004s.
    Executed the cron event 'wp_update_plugins' in 0.006s.
    Executed the cron event 'wp_update_themes' in 0.004s.
    Success: Executed a total of 4 cron events.
    Success: Plugin already updated.
    www-data@kde-wordpress:~/html$ wp plugin list --all | grep generate
    generateblocks  active  none    2.4.0           off
    generateblocks-pro      active  none    2.6.1           off
    

    As you see, I cleared transient and executed the update hooks, but the 2.7.0 update visible in the admin gui is not visible nor available on the command line.

  • Hi Ulrich,

    Since clearing transients and forcing the cron events isn’t surfacing the update, this most likely isn’t a stale transient in the options table. The prime suspect is a persistent object cache holding the update_plugins data, which wp transient delete --all doesn’t clear (it only touches transients stored in the database, not the object cache).

    Could you run these so we can confirm where the update data is actually living:

    wp plugin list --update=available
    wp cache flush
    wp plugin list --update=available

    If wp cache flush makes the 2.7.0 update appear, we’ve found it — a persistent object cache drop-in is holding the stale update data. In that case, add wp cache flush to your update routine before the update step.

    Also useful to know:

    wp eval 'var_export( is_object( $GLOBALS["wp_object_cache"] ) && ! ( $GLOBALS["wp_object_cache"] instanceof WP_Object_Cache ) );'
    ls -la wp-content/object-cache.php

    That tells us whether a persistent object cache drop-in is in play (Redis, Memcached, etc.).

    One more thing worth checking — confirm both CLI and the dashboard are hitting the same site and same WP install path, and that the update check isn’t being short-circuited by a pre_set_site_transient_update_plugins filter from another plugin or a must-use plugin.

    Send those over and we’ll pin down the cause.

  • Hi George,

    thanks for checking. This problem has a long track record. First of all, we are running a dockerized WP for multiple sites, and in our environment we never do Updates on the live sites, and we need to automate them so no GUI updates at all. Instead, we do automation scripts on a 1:1 clone which considers itself to “be” the live site ( i.e. code, DB, and docker environment are identical to the live site).

    In this 1:1 clone, we can perform scripted updates with wpcli to all paid plugins other than GP/GB and one or two more. Over time, our scripted update was modified to perform more and more housekeeping tasks before trying to update ( like transient deletion, cache flush, cron hooks for plugin checks etc etc – see above).
    Nevertheless, some stubborn plugins will not update via CLI, GB being one of them. And since we use it on several sites, this is causing a lot of management overhead.

    The output that I pasted in my previous post from today was copied from one of the clones that I described.

    Now to rule out the clone being the problem, I did the same on the live site. Even though I know we have no object cache in place, I also did a cache flush, and ran all the housekeeping hacks that sometimes lead to the updated being performed. However, as you will see, it does not work currently. This is the output of all the commands from wpcli on the live site:

    root@-business:/var/www/html# wp plugin list --update=available
    +---------------------------------+--------+-----------+-----------+----------------+-------------+
    | name                            | status | update    | version   | update_version | auto_update |
    +---------------------------------+--------+-----------+-----------+----------------+-------------+
    | generateblocks                  | active | available | 2.3.0     | 2.4.0          | off         |
    +---------------------------------+--------+-----------+-----------+----------------+-------------+
    root@-business:/var/www/html# wp cache flush
    Success: The cache was flushed.
    root@-business:/var/www/html# wp plugin list --update=available
    +---------------------------------+--------+-----------+-----------+----------------+-------------+
    | name                            | status | update    | version   | update_version | auto_update |
    +---------------------------------+--------+-----------+-----------+----------------+-------------+
    | generateblocks                  | active | available | 2.3.0     | 2.4.0          | off         |
    +---------------------------------+--------+-----------+-----------+----------------+-------------+
    
    root@-business:/var/www/html# wp plugin list --all | grep generate && wp transient delete --all && wp cron event run wp_update_themes wp_update_plugins wp_version_check && wp plugin list --update=available
    generateblocks  active  available       2.3.0   2.4.0   off
    generateblocks-pro      active  none    2.6.1           off
    generatecloud   active  none    1.1.0           off
    Success: 6 transients deleted from the database.
    Executed the cron event 'wp_version_check' in 1.787s.
    Executed the cron event 'wp_version_check' in 0.005s.
    Executed the cron event 'wp_update_plugins' in 0.006s.
    Executed the cron event 'wp_update_themes' in 0.005s.
    Success: Executed a total of 4 cron events.
    +---------------------------------+--------+-----------+-----------+----------------+-------------+
    | name                            | status | update    | version   | update_version | auto_update |
    +---------------------------------+--------+-----------+-----------+----------------+-------------+
    | generateblocks                  | active | available | 2.3.0     | 2.4.0          | off         |
    +---------------------------------+--------+-----------+-----------+----------------+-------------+
    
    root@-business:/var/www/html# wp eval 'var_export( is_object( $GLOBALS["wp_object_cache"] ) && ! ( $GLOBALS["wp_object_cache"] instanceof WP_Object_Cache ) );'
    false
    #ls -la wp-content/object-cache.php
    cannot access 'wp-content/object-cache.php': No such file or directory
    
    root@-business:/var/www/html# wp plugin update generateblocks-pro
    Success: Plugin already updated.
    root@-business:/var/www/html# wp plugin list --all | grep generateblocks
    generateblocks  active  available       2.3.0   2.4.0   off
    generateblocks-pro      active  none    2.6.1           off
    

    So as you see, whatever I do on the command line will not bring up the update.
    At the same time, when looking at the admin GUI (on this very same live site), the update is visible.

    Oh, and by the way – I almost forgot: we also have one site hosted elsewhere where we do not use docker but a “classic” installation. The same problem is happening there, too. No GB updates possible via wpcli, only via WebGui.

  • Can you try running the commands with an administrator user specified?

    
    wp plugin list --update=available --user=<administrator-username>
    wp plugin update generateblocks-pro --user=<administrator-username>
    

    No sure about other plugins but GB Pro only initializes its licensed updater when the request has administrator permissions or runs through WordPress cron.

    WP-CLI normally runs without a WP user context, so the updater may not load. As a result, WP-CLI can incorrectly report that the plugin is already up to date.

  • Hi,
    I was away on holiday so no feedback until now.

    Forcing an admin user via –user=… works, so thanks for suggesting it.

    However this is not more than a hack. For 99.9 % of all plugins, it is not necessary to use this kind of workaround , and it does not really help for automation since the IDs of admin users are not predictable. Of course we could add even more code to identify an admin user first, but this would mean another additional hack to run a hack.

    I strongly prefer to have this working like (almost) all other plugins do it, i.e. discovery and installation of updates via cli without requiring hacks.

    Regards
    Ulrich

  • Thanks for the feedback. I’ll bring this up with the dev team to see how we can improve this.

Viewing 16 posts - 1 through 16 (of 18 total)
  • You must be logged in to reply to this topic.