Issue with “hustle_general_data_protection_cleanup”
-
Hi,
I am having an issue with a cron event from the Hustle plugin.
This event is:
hustle_general_data_protection_cleanupI don’t know exactly what this task, which runs every hour via wp-cron.php, is for, but it is causing a problem on my server.
When this task is launched, my server’s CPU usage rises to 75% for approximately 3 minutes and 25 seconds.What is it for? Can I disable it?
Is there a bug with this task?
Thank you very much in advance for your help.Best regards
-
Hi @joy0114 ,
I hope you’re doing well, and I’m sorry to see that you’re facing this issue.
There is no current issue reported with this, but that comes from Hustle > Settings > Viewer’s Privacy > Tracking Data Privacy
This event basically cleans entries when older than what is specified there. Could you please try to edit it? If it’s on Forever, set it to 30 days or just change the days there.
Also, could you confirm if you have entries older than what was specified there?
I hope to hear back from you soon.
Best Regards,
Williams ValerioHi,
Thanks for your reply.
Yes, the setting is “forever”.
You mean I can’t keep all my statistics ? However, there is not much data:
Total Conversions 59Best regards
-
This reply was modified 8 months, 1 week ago by
joy0114. Reason: typo error
Hi @joy0114 ,
I hope you’re doing well, and thanks for replying.
I see, 59 conversions shouldn’t be a lot, but there could be an issue with Hustle when trying to check the table.
Would it be possible for you to run this cron job manually using a plugin like WP Crontrol and confirm if the slow issue happens when you try it this way? https://ww.wp.xz.cn/plugins/wp-crontrol/
It is possibly timing out at some point due to the server security measurements. Would it be possible for you to include your Hosting Support and confirm with them when trying to run the cron job manually or when this is triggered?
They could check logs to confirm if there is an action blocked or if there is an error appearing.
I hope to hear back from you soon.
Best Regards,
Williams ValerioHi Williams,
Yes, I use WP Crontrol.
I used this tool to change the execution time of this hook, and I realized that it was indeed this hook that was causing the problem…
Since then, I have paused it.
I just restarted it manually and once again I have 4 minutes of CPU at 75%.What I don’t quite understand:
If we set it to “Forever,” why is this hook being executed since we do NOT want to delete the statistics?I don’t have many subscribers to my newsletter, so for now, I prefer to keep everything: my database isn’t very big.
I think this problem started after the last Hustle update. Before that, I didn’t have this CPU usage issue with this hook. And the “Forever” setting has always been configured this way.
My hoster has noticed this CPU spike. My hoster sees that there is a long task (wp-cron), but nothing unusual, no errors.
And when I run “top -d 1” in a shell (on my server) and then “c” to see the commands in detail, I can see a PHP process corresponding to wp-cron.php (which calls this hook).
You didn’t notice this issue on your side ?
My settings in viewer’s privacy:
IP Tracking: disable
IP Retention: custom >>> 0 day(s)
Submissions Retention: forever
Account Erasure Requests: Retain submission
Tracking Data Retention: foreverThanks for your help
Best regardsHi @joy0114,
To check the issue in more detail, I set up Hustle Viewer’s Privacy on a test website from my side, following the configuration you mentioned in your response. However, I was not able to replicate the issue you described.
The mentioned cron is designed to run at regular intervals, but the removal of Tracking Data happens only according to the configuration that has been set. The process for this is handled through the PHP script.
To investigate the issue further, can you please perform a complete conflict test? This will help us ensure no other plugin or theme is conflicting and causing the issue.
I hope the following guide comes in handy: https://wpmudev.com/docs/getting-started/getting-support/#conflict-test
If this is a live website with traffic, please create a staging website and perform the test without disrupting the live traffic. A staging website is a copy of your live website in a new directory on the same server using a separate database.
Please update us here with the results so that we can help you further.
Best Regards,
Nebu JohnOk, thanks for your reply, I will try this during this weekend.
But, right now, what I can say is that this problem occurs with Hustle 7.8.8, but does not occur with 7.8.7.
With Hustle 7.8.7, this hook runs in 1 second (as seen with top -d 1), and in 4 minutes with 7.8.8.
Of course, everything else was identical during the test.Best regards
Hi @joy0114
I checked Hustle and we set it to run hourly by default”
public function __construct( $cron_cleanup_interval = 'hourly' ) { $this->cron_cleanup_interval = $cron_cleanup_interval; $this->init(); }You can also filter it as you said you don’t run the data cleanup so for example
<?php add_filter('hustle_general_data_cleanup_interval', function() { return 'weekly'; });But as Nithin said, we couldn’t replicate the problem so it could be a conflict between latest version and any plugin.
Best Regards
Patrick FreitasHi Patrick
Yes, I known it’s hourly.
And for me, it does not make sense to delay it to “weekly”.
Yes, the problem will occur less often, but since I don’t want to clean up the data (for now), I just need to disable this hook.If I find the time, I’ll need to list all the lines of code that were modified or added three weeks ago, with 7.8.8.
To be perfectly honest, I don’t have time to activate each plugin one by one and test the execution time of this hook.
I understand that this would be the most reliable solution for determining a possible conflict, but I can’t do it at the moment.
If you don’t see this issue on your end, too bad, I’ll continue with this hook deactivation.Thank you anyway for your attention to this issue
Best regards
Hi Patrick,
I solved the problem (without disabling this hook), by drawing inspiration from your /inc/hustle-init.php file from version 7.8.7.
With a hustle-init.php like this (at least the relevant part) :
// Admin. if ( is_admin() ) { if ( is_multisite() ) { // Add multisite class. new Hustle_Multisite(); } new Hustle_Module_Admin(); new Hustle_Dashboard_Admin(); new Hustle_Popup_Admin(); new Hustle_Slidein_Admin(); new Hustle_Embedded_Admin(); new Hustle_SShare_Admin(); // Global Integrations page. new Hustle_Providers_Admin(); new Hustle_Entries_Admin(); new Hustle_Settings_Page(); $hide_docs = apply_filters( 'wpmudev_branding_hide_doc_link', false ); if ( ! $hide_docs ) { new Hustle_Tutorials_Page(); } new Hustle_General_Data_Protection(); } // if ( is_admin() || wp_doing_cron() ) { // new Hustle_General_Data_Protection(); // } if ( Opt_In_Utils::is_free() ) { new Hustle_Cross_Sell(); } // Front.It works fine, just like “before.”
I think it’s the wp_doing_cron() function that’s causing me problems. I run wp-cron.php via a Cpanel cron.
I don’t known.Best regards
Hello @joy0114
Glad that you were able to fix this issue.
The issue might be related to your custom cron jobs running with cPanel, since we couldn’t replicate it on our end.
Best Regards
AminHello,
The cron task running on my server is very simple: run wp-cron.php every x minutes.
The internal WordPress cron is of course disabled, and it has been working very well like this for years.
This is also the method recommended by many people.The important thing is that the cause has been found. Now it’s solved.
Best regards
Hi @joy0114
Thank you for the update,
I don’t recommend editing the plugin file as the update would replace the custom code, if you would like to deeper investigate it please email us on [email protected]
Subject: ATTN: WPMU DEV support – wp.org
Please send:
– Link back to this thread for reference (https://ww.wp.xz.cn/support/topic/issue-with-hustle_general_data_protection_cleanup/)To ensure we don’t miss your email, please let us know here once you’ve submitted the form and make sure you use “ATTN: WPMU DEV support – wp.org” as the email subject.
Best Regards
Patrick Freitas -
This reply was modified 8 months, 1 week ago by
The topic ‘Issue with “hustle_general_data_protection_cleanup”’ is closed to new replies.