Any code snippets to set a day range to auto clear old history?
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page pleaseIf you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
Quote from wisenet on September 7, 2021, 22:57Hi
Any code snippets to set a day range to auto clear old history for all users? e.g. delete history older than 30 days.
Million thanks
Hi
Any code snippets to set a day range to auto clear old history for all users? e.g. delete history older than 30 days.
Million thanks
Quote from Pablo Borysenco on September 8, 2021, 16:45Hello
It is possible with MySQL and using external cron. You can use next code for your cron action:
global $wpdb; $time = time()-30*24*60*60; $wpdb->query("DELETE FROM woobe_history_bulk WHERE mod_date<{$time}"); $wpdb->query("DELETE FROM wp_woobe_history_bulk WHERE finished<{$time}");
Hello
It is possible with MySQL and using external cron. You can use next code for your cron action:
global $wpdb;
$time = time()-30*24*60*60;
$wpdb->query("DELETE FROM woobe_history_bulk WHERE mod_date<{$time}");
$wpdb->query("DELETE FROM wp_woobe_history_bulk WHERE finished<{$time}");
Quote from wisenet on September 9, 2021, 19:45Hi,
I have add below code in function.php and set the timer to 1 minute to test by using WP Control cron job BUT seems failed and nothing happen and no history clear.
add_action( 'test_new_cron', 'delete_old_woobe_hisroty_func' );
function delete_old_woobe_hisroty_func() {
global $wpdb;
$time = time()-60;
$wpdb->query("DELETE FROM woobe_history_bulk WHERE mod_date<{$time}");
$wpdb->query("DELETE FROM wp_woobe_history_bulk WHERE finished<{$time}");
}https://wordpress.org/plugins/wp-crontrol/
Would you please help to guide me how to setup the cron job for auto clear history over specific time?
Million thanks
Hi,
I have add below code in function.php and set the timer to 1 minute to test by using WP Control cron job BUT seems failed and nothing happen and no history clear.
add_action( 'test_new_cron', 'delete_old_woobe_hisroty_func' );
 function delete_old_woobe_hisroty_func() {
 global $wpdb;
 $time = time()-60;
 $wpdb->query("DELETE FROM woobe_history_bulk WHERE mod_date<{$time}");
 $wpdb->query("DELETE FROM wp_woobe_history_bulk WHERE finished<{$time}");
 }
https://wordpress.org/plugins/wp-crontrol/
Would you please help to guide me how to setup the cron job for auto clear history over specific time?
Million thanks
Quote from admin on September 10, 2021, 14:56Hello
You can use external cron:
- in functions.php add next code
if(isset($_GET['delete_old_woobe_hisroty_func'])){ delete_old_woobe_hisroty_func(); exit; }- in you hosting panel, to crons add https://YOUR_SITE.com/?delete_old_woobe_hisroty_func=1
Hello
You can use external cron:
- in functions.php add next codeif(isset($_GET['delete_old_woobe_hisroty_func'])){ delete_old_woobe_hisroty_func(); exit; }
 
- in functions.php add next code
- in you hosting panel, to crons add https://YOUR_SITE.com/?delete_old_woobe_hisroty_func=1
Quote from wisenet on September 16, 2021, 20:29Hi,
I have added below code in function.php to test delete history over 1 day
function delete_old_woobe_hisroty_func() {
global $wpdb;
$time = time()-1*24*60*60;
$wpdb->query("DELETE FROM woobe_history_bulk WHERE mod_date<{$time}");
$wpdb->query("DELETE FROM wp_woobe_history_bulk WHERE finished<{$time}");
}if(isset($_GET['delete_old_woobe_hisroty_func'])){
delete_old_woobe_hisroty_func();
exit;
}and then I tried to visit https://mydomain.com/?delete_old_woobe_hisroty_func=1 in browser manually, however, still not work, no record deleted.
Please help
and hope you will consider to add feature that can set auto clear old history over specific time/days.
Many thanks
Hi,
I have added below code in function.php to test delete history over 1 day
function delete_old_woobe_hisroty_func() {
 global $wpdb;
 $time = time()-1*24*60*60;
 $wpdb->query("DELETE FROM woobe_history_bulk WHERE mod_date<{$time}");
 $wpdb->query("DELETE FROM wp_woobe_history_bulk WHERE finished<{$time}");
 }
if(isset($_GET['delete_old_woobe_hisroty_func'])){
 delete_old_woobe_hisroty_func();
 exit;
 }
and then I tried to visit https://mydomain.com/?delete_old_woobe_hisroty_func=1 in browser manually, however, still not work, no record deleted.
Please help
and hope you will consider to add feature that can set auto clear old history over specific time/days.
Many thanks
Quote from Pablo Borysenco on September 17, 2021, 11:16Hello
What plugin version number are you using?
Hello
What plugin version number are you using?
Quote from wisenet on September 17, 2021, 11:46Code Snippets Version 2.14.1 https://wordpress.org/plugins/code-snippets/ and WP Crontrol Version 1.10.0 https://wordpress.org/plugins/wp-crontrol/ WordPress 5.8 WooCommerce 5.6.0 Million thanks
Code Snippets Version 2.14.1 https://wordpress.org/plugins/code-snippets/ and WP Crontrol Version 1.10.0 https://wordpress.org/plugins/wp-crontrol/ WordPress 5.8 WooCommerce 5.6.0 Million thanks
Quote from Pablo Borysenco on September 17, 2021, 12:51Sory! I mean version of BEAR/WOOBE plugin
Sory! I mean version of BEAR/WOOBE plugin
Quote from wisenet on September 17, 2021, 15:19BEAR - Bulk Editor and Products Manager Version 2.0.8.1
Thanks :)
BEAR - Bulk Editor and Products Manager Version 2.0.8.1
Thanks :)
Quote from Pablo Borysenco on September 20, 2021, 10:09Hello
Ok! Please paste your license key here - https://share.pluginus.net/image/i20210618130558.png -> https://share.pluginus.net/image/i20210618130614.png and wp-admin+FTP access - https://share.pluginus.net/image/i20210618130637.png I will check this snippet
Hello
Ok! Please paste your license key here - https://share.pluginus.net/image/i20210618130558.png -> https://share.pluginus.net/image/i20210618130614.png and wp-admin+FTP access - https://share.pluginus.net/image/i20210618130637.png I will check this snippet
