Support » Plugin: WooCommerce Admin » over 170 000 scheduled action created

  • Resolved jimmysurprenant

    (@jimmysurprenant)


    I installed this plugin and let it run for some time. I realised the website was running slower than usual after some time and that the CPU was maxed out.

    Then I took a look into the Scheduled actions and see that there were more than 170 000 completed scheduled actions. Plugin version was 0.12.0

Viewing 15 replies - 1 through 15 (of 16 total)
  • Même problème que toi avec version 0.13.2
    Ma database est saturée ! Des centaines de milliers d’actions planifiées

    Plugin Author Timmy Crawford

    (@timmydcrawford)

    Hello @jimmysurprenant – the plugin utilizes ActionScheduler to perform the import of historical data. It sounds like your store had a large number of orders and customers to import. If the jobs are showing as completed, then your server load should return to normal.

    If you are still experiencing issues, please let me know.

    I have a similar problem on a client’s website. There are now 19,589 entries in the wp_posts table with the post_title “wc-admin_import_order”. We only noticed because his WooCommerce order numbers jumped from 4,000ish 20,000ish in a few days.

    I’ve removed the plugin but the posts table is still full of these junk rows. Do you have any advice on how they can be removed? Would the plugin have left anything else behind?

    Plugin Author Timmy Crawford

    (@timmydcrawford)

    @bncpeter

    > Do you have any advice on how they can be removed? Would the plugin have left anything else behind?

    All pending jobs and data used to generate reports in this plugin are removed upon deactivation.

    FYI other parts of WooCommerce core ( and extensions ) use ActionScheduler to enqueue background jobs – webhook processing is one of these things. So depending on store’s usage of Webhooks you could encounter a similar behavior there.

    ActionScheduler 3.0 is going to move away from using a custom post type to a dedicated database table to track jobs. When that is ready, there will no longer be any entries in wp_posts for job processing. We will be certain to highlight that change when it is ready in the release notes on the dev blog.

    @timmydcrawford Thanks for your quick response.

    Having deactivated and removed the plugin, I still see all of the wc-admin_import_order rows in the posts table. I note that their post status is “trash”, though. Is there an extra step needed to purge these?

    Hopefully the ActionScheduler 3.0 change that you mentioned will alleviate the unexpected and dramatic increase in order numbers for anyone else using this plugin in the future. My client was rather upset about that.

    I’ve never understood why WooCommerce didn’t maintain its own, independent sequence of order numbers, actually.

    Bonjour,

    Après avoir installé/activé puis désactivé et supprimer la dernière version du plugin je pensais que c’était fini. Toutes les actions programmées était terminées depuis 4h57 (france) hier. Et puis de nouveau aujourd’hui ma base de données est saturée, je n’ai plus accès à l’admin de mon site. Seulement à ma base de données via PHPMyadmin.

    Seulement je ne suis pas développeur, seulement une demoiselle qui gère sa petite boutique en ligne toute seule.

    Je ne sais pas comment me débarrasser de ce problème. Avez-vous une solution ?

    @bncpeter

    You could delete all of those posts using this WP-CLI command.

    wp post delete $(wp post list --post_type='wc-admin_import_order' --post_status=trash --format=ids --force)

    @bncpeter

    My mistake the correct WP-CLI command to delete those scheduled actions with a post title of wc-admin_import_order would be this.

    wp post delete $(wp post list --post_type='scheduled-action' --post_title='wc_admin_import_order' --format=ids) --force

    will there be a future release that automatically removes these additional posts? i have a very active store that i work on (one of the many stores in my portfolio), but this one store has 32,986 “scheduled-action” posts. seems that there must be a point where this info isn’t required to store any longer, no?

    also, i saw that there was a function to disable the scheduled-action hook…

    To debug synced lookup information in the database, you can bypass the action scheduler and immediately sync order and customer information by using the woocommerce_disable_order_scheduling hook.
    
    add_filter( 'woocommerce_disable_order_scheduling', '__return_true' );

    …which sounds as though it’ll then run all of the actions in real-time, once submitted for execution. is there any downside to using this function vs using the scheduled-actions? since it says “debug”, i cannot imagine that this is an actual solution, although it almost sounds like one?

    Plugin Author Ron Rennick

    (@wpmuguru)

    will there be a future release that automatically removes these additional posts?

    Action Scheduler will be updated to use custom tables instead of storing as a custom post type.

    seems that there must be a point where this info isn’t required to store any longer, no?

    Completed & cancelled actions are purged after 30 days.

    …which sounds as though it’ll then run all of the actions in real-time, once submitted for execution.

    The woocommerce_disable_order_scheduling will only affect new WooCommerce Admin order actions. It has no effect on existing actions or those outside WC Admin.

    is there any downside to using this function vs using the scheduled-actions?

    The filter was originally added for development so developers could bypass the scheduled action cron delay. Given your order activity, the filter would help you trim the number of scheduled actions being created.

    • This reply was modified 5 months, 1 week ago by Ron Rennick.
    Plugin Support Thomas Shellberg

    (@shellbeezy)

    Automattic Happiness Engineer

    We haven’t heard back from anyone in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    I tried the second version Luke’s WP-CLI command to delete these posts, but got this response:

    -bash: /usr/local/bin/wp: Argument list too long

    Modifying it as follows did the trick:

    wp post delete --prompt --force << deleteme
    $(wp post list --post_type='scheduled-action' --post_title='wc_admin_import_order' --format=ids)
    deleteme

    After disabled, the plugin does not delete all those data which created or even after deleting the plugin not delete the table as well.

    What are my options? I have a client store which has 2000+ products and 50000+ orders data.

    Now the site is very slow, which was not in case even plugin activating. Please help.

    Check out this info on WC-CLI (WC specific towards the bottom)

    I’ve automated all of my tasks across all of my WC multi-site installs using the WP-CLI method.

    https://robotninja.com/blog/wp-cli-woocommerce-development/

    I’m pretty sure that as long as you’ve clicked on the “import orders history” from Analytics > Settings, it should crush through everything really quick.

    • This reply was modified 3 months, 3 weeks ago by splaquet.

    @millionleaves

    Glad that the WP-CLI command was of some use.

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