{"id":1878,"date":"2024-12-26T12:49:46","date_gmt":"2024-12-26T11:49:46","guid":{"rendered":"https:\/\/wpmastertoolkit.com\/module\/nettoyage-automatique-de-actionscheduler_actions\/"},"modified":"2025-01-08T18:11:00","modified_gmt":"2025-01-08T17:11:00","slug":"nettoyage-automatique-de-actionscheduler_actions","status":"publish","type":"module","link":"https:\/\/wpmastertoolkit.com\/en\/module\/automatic-cleaning-of-actionscheduler_actions\/","title":{"rendered":"Automatic cleaning of actionscheduler_actions"},"content":{"rendered":"<h1 class=\"wp-block-heading\">Optimize your WordPress site by automatically cleaning the actionscheduler_actions table<\/h1>\n\n\n\n<p>In WordPress environments using WooCommerce, the table <strong><code data-no-auto-translation=\"\">actionscheduler_actions<\/code><\/strong> can quickly become a source of significant overload. This table, managed by the Action Scheduler plugin, is used to keep track of scheduled tasks (cron jobs) related to various processes, such as sending e-mails, updating inventory, or background processing for WooCommerce. However, it has one major problem: it accumulates unnecessary entries (\"completed\", \"failed\" or \"cancelled\" statuses) over time. The result? A cluttered database that considerably slows down overall site performance.<\/p>\n\n\n\n<p>To solve this problem, we have developed the <strong>Auto Clean actionscheduler_actions<\/strong> in <strong>WPMasterToolKit<\/strong>. This module automates the cleaning of this critical table, optimizing your site's performance without manual effort.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why is the actionscheduler_actions table a problem with WooCommerce?<\/h2>\n\n\n\n<p>WooCommerce relies heavily on Action Scheduler to execute tasks in the background. For example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Automatic e-mail notifications.<\/li>\n\n\n\n<li>Recurring calculations, such as sales reports or tax updates.<\/li>\n\n\n\n<li>Synchronize products with marketplaces or third-party services.<\/li>\n<\/ul>\n\n\n\n<p>Over time, all these completed and failed actions accumulate in the <strong><code data-no-auto-translation=\"\">actionscheduler_actions<\/code><\/strong>WooCommerce doesn't delete them automatically. This accumulation can reach tens of thousands, or even millions of lines in some cases. This results in :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Slower SQL queries<\/strong> A table that is too large slows down searches and insertions.<\/li>\n\n\n\n<li><strong>Heavier backups<\/strong> : If you back up your database regularly, it will be much larger.<\/li>\n\n\n\n<li><strong>A direct impact on overall performance<\/strong> of your site, especially for high-traffic sites.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Which plugin can Auto Clean actionscheduler_actions replace?<\/h2>\n\n\n\n<p>The module <strong>Auto Clean actionscheduler_actions<\/strong> can replace external solutions such as :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>WP-Optimize<\/strong> (in its database cleaning function).<\/li>\n\n\n\n<li><strong>Plugins dedicated to Action Scheduler<\/strong>which often require complex or manual configuration to manage obsolete tasks.<\/li>\n<\/ul>\n\n\n\n<p>With <strong>WPMasterToolKit<\/strong>this task becomes fully automated and integrated.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How the Auto Clean module works actionscheduler_actions<\/h2>\n\n\n\n<p>Our module automatically deletes unnecessary entries (actions with \"completed\", \"failed\" or \"cancelled\" status) from the <strong>actionscheduler_actions<\/strong> at user-defined intervals. Here are the main points to be aware of:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Automatic scheduling<\/strong> Thanks to an integrated cron system, you can define the cleaning frequency and period via the module interface.<\/li>\n\n\n\n<li><strong>Targeted cleaning<\/strong> Only completed, cancelled or failed actions are deleted. Actions in progress are not affected.<\/li>\n\n\n\n<li><strong>Easy customization<\/strong> You can choose from several periods (minute, hour, day, week, month) and set the frequency to suit your needs.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Custom hooks used by the module<\/h3>\n\n\n\n<p>The module uses custom WordPress hooks to maximize its flexibility:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code data-no-auto-translation=\"\">cron_schedules<\/code><\/strong> This filter lets you add a custom cron frequency based on your settings (for example, a custom frequency for deleting actions every day or week).<\/li>\n\n\n\n<li><strong><code data-no-auto-translation=\"\">wpmastertoolkit_settings_auto_clean_actionscheduler_actions_cron_hook<\/code><\/strong> This action is called when the cron is executed and triggers the SQL query to clean up the table.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">How do I use the Auto Clean actionscheduler_actions module?<\/h2>\n\n\n\n<p>This module is extremely easy to use:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Activate the <strong>Auto Clean actionscheduler_actions<\/strong> from the <strong>WPMasterToolKit<\/strong>.<\/li>\n\n\n\n<li>Go to the module settings (via the sub-menu added to \"WP MasterToolKit Settings\").<\/li>\n\n\n\n<li>Set your preferences :\n<ul class=\"wp-block-list\">\n<li><strong>Period<\/strong> Choose a period such as a day, a week or a month.<\/li>\n\n\n\n<li><strong>Frequency<\/strong> Indicate how often you want to run cleaning during this period (e.g. once a day or 3 times a week).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Save your settings, and the module takes care of the rest.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img alt=\"Automated cleaning interface WordPress actions.\" fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"280\" src=\"https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-7-1024x280.png\" class=\"wp-image-2717\" srcset=\"https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-7-1024x280.png 1024w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-7-300x82.png 300w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-7-768x210.png 768w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-7-1536x420.png 1536w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-7.png 1913w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Cleaning then starts automatically according to the settings you have defined.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Our technical choices to optimize this module<\/h2>\n\n\n\n<p>When designing this module, we took care to use best practices to ensure maximum performance:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Optimized SQL queries<\/strong> We use a prepared query to remove unnecessary entries directly, thus reducing the number of cycles required.<\/li>\n\n\n\n<li><strong>Cron WordPress native<\/strong> : The module relies on WordPress' scheduled task system, which avoids overloading your server with unnecessary processes.<\/li>\n\n\n\n<li><strong>Managing default settings<\/strong> If the user does not configure the module, reasonable default values (daily cleaning) are automatically applied.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The module <strong>Auto Clean actionscheduler_actions<\/strong> is an essential solution for any WordPress site using WooCommerce or other plugins leveraging Action Scheduler. By keeping the <strong><code data-no-auto-translation=\"\">actionscheduler_actions<\/code><\/strong> clean and lightweight, you improve your database's performance and reduce the risk of long-term bottlenecks.<\/p>\n\n\n\n<p>Thanks to its integration into <strong>WPMasterToolKit<\/strong>This module is lightweight, efficient and easy to configure, making it an ideal alternative to many third-party plugins. If you want to keep your site performing at its best, it's time to automate this essential task with <strong>WPMasterToolKit<\/strong>.<\/p>","protected":false},"excerpt":{"rendered":"<p>WPMasterToolKit's Auto Clean actionscheduler_actions module is designed to optimize WordPress database management by automatically cleaning the actionscheduler_actions table. By deleting completed, failed and canceled actions, it helps to lighten the database, improve loading times and enhance the user experience. This module can replace specific tools dedicated to this task, freeing up space in your plugin directory. Users can customize cleaning parameters via a simple interface, ensuring maintenance without regular manual intervention, while minimizing the impact on site performance.<\/p>","protected":false},"featured_media":0,"parent":0,"template":"","meta":{"_acf_changed":true,"_seopress_robots_primary_cat":"","_seopress_titles_title":"Boostez Site WordPress: Nettoyage Auto WooCommerce","_seopress_titles_desc":"Am\u00e9liorez les performances de WooCommerce en nettoyant la table actionscheduler_actions avec le module Auto Clean de WPMasterToolKit. Simple et efficace!","_seopress_robots_index":"","_surecart_dashboard_logo_width":"180px","_surecart_dashboard_show_logo":true,"_surecart_dashboard_navigation_orders":true,"_surecart_dashboard_navigation_invoices":true,"_surecart_dashboard_navigation_subscriptions":true,"_surecart_dashboard_navigation_downloads":true,"_surecart_dashboard_navigation_billing":true,"_surecart_dashboard_navigation_account":true},"class_list":["post-1878","module","type-module","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/module\/1878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/module"}],"about":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/types\/module"}],"wp:attachment":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/media?parent=1878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}