\WP_CLI::warning(__('Entries are purged automatically, so this cannot be relied upon as a record of past event execution.','automattic-cron-control'));
}
// Not much to do
if(0===$events['total_items']){
\WP_CLI::success(__('No events to display','automattic-cron-control'));
\WP_CLI::line(sprintf(_n('Displaying one entry','Displaying all %s entries',$total_events_to_display,'automattic-cron-control'),number_format_i18n($total_events_to_display)));
}else{
\WP_CLI::line(sprintf(__('Displaying %s of %s entries, page %s of %s','automattic-cron-control'),number_format_i18n($total_events_to_display),number_format_i18n($events['total_items']),number_format_i18n($events['page']),number_format_i18n($events['total_pages'])));
$items=$wpdb->get_results($wpdb->prepare("SELECT SQL_CALC_FOUND_ROWS ID, post_content_filtered, post_date_gmt, post_modified_gmt FROM {$wpdb->posts} WHERE post_type = %s AND post_status = %s ORDER BY post_date ASC LIMIT %d,%d",\Automattic\WP\Cron_Control\Cron_Options_CPT::POST_TYPE,$post_status,$offset,$limit));
@@ -62,7 +62,7 @@ class One_Time_Fixers extends \WP_CLI_Command {
...
@@ -62,7 +62,7 @@ class One_Time_Fixers extends \WP_CLI_Command {
do{
do{
\WP_CLI::line("\n\n".sprintf(__('Processing page %s of %s','automattic-cron-control'),number_format_i18n($page),number_format_i18n($pages))."\n");
\WP_CLI::line("\n\n".sprintf(__('Processing page %s of %s','automattic-cron-control'),number_format_i18n($page),number_format_i18n($pages))."\n");
$items=$wpdb->get_results($wpdb->prepare("SELECT ID, post_title FROM {$wpdb->posts} WHERE post_type = %s LIMIT %d",'a8c_cron_ctrl_event',$page_size));
$items=$wpdb->get_results($wpdb->prepare("SELECT ID, post_title FROM {$wpdb->posts} WHERE post_type = %s LIMIT %d,%d",'a8c_cron_ctrl_event',absint(($page-1)*$page_size),$page_size));
// Nothing more to do
// Nothing more to do
if(!is_array($items)||empty($items)){
if(!is_array($items)||empty($items)){
...
@@ -72,10 +72,6 @@ class One_Time_Fixers extends \WP_CLI_Command {
...
@@ -72,10 +72,6 @@ class One_Time_Fixers extends \WP_CLI_Command {
\WP_CLI::line(sprintf(__('Found %s items in this batch'),number_format_i18n(count($items))));
\WP_CLI::line(sprintf(__('Found %s items in this batch'),number_format_i18n(count($items))));
if($dry_run&&$page>1){
\WP_CLI::warning(sprintf(__('During dry runs, the query will return the same results each time. Since events are deleted during a live run, the command will advance through the %s item(s) found.','automattic-cron-control'),number_format_i18n($count)));