@@ -732,7 +732,11 @@ public function manage_feedzy_import_columns( $column, $post_id ) {
732
732
$ src = sprintf ( '%s: %s%s%s ' , __ ( 'Feed Group ' , 'feedzy-rss-feeds ' ), '<a href=" ' . admin_url ( 'edit.php?post_type=feedzy_categories ' ) . '" target="_blank"> ' , $ src , '</a> ' );
733
733
}
734
734
} else {
735
- $ src = sprintf ( '%s: %s%s%s ' , __ ( 'Feed Group ' , 'feedzy-rss-feeds ' ), '<a href=" ' . admin_url ( 'edit.php?post_type=feedzy_categories ' ) . '" target="_blank"> ' , $ src , '</a> ' );
735
+ if ( empty ( $ src ) ) {
736
+ $ src = __ ( 'No Source Configured ' , 'feedzy-rss-feeds ' );
737
+ } else {
738
+ $ src = sprintf ( '%s: %s%s%s ' , __ ( 'Feed Group ' , 'feedzy-rss-feeds ' ), '<a href=" ' . admin_url ( 'edit.php?post_type=feedzy_categories ' ) . '" target="_blank"> ' , $ src , '</a> ' );
739
+ }
736
740
}
737
741
} else {
738
742
// else link it to the feed but shorten it if it is too long.
@@ -791,28 +795,7 @@ public function manage_feedzy_import_columns( $column, $post_id ) {
791
795
$ next = Feedzy_Rss_Feeds_Util_Scheduler::is_scheduled ( 'feedzy_cron ' );
792
796
}
793
797
if ( $ next ) {
794
- $ now = new DateTime ();
795
- $ then = new DateTime ();
796
- $ then = $ then ->setTimestamp ( $ next );
797
- $ in = $ now ->diff ( $ then );
798
-
799
- $ time_string = array ();
800
- // Add days if they exist.
801
- if ( $ in ->d > 0 ) {
802
- // translators: %1$s days.
803
- $ time_string [] = sprintf ( __ ( '%1$d days ' , 'feedzy-rss-feeds ' ), $ in ->d );
804
- }
805
- // Add hours if they exist.
806
- if ( $ in ->h > 0 ) {
807
- // translators: %1$s hours.
808
- $ time_string [] = sprintf ( __ ( '%1$d hours ' , 'feedzy-rss-feeds ' ), $ in ->h );
809
- }
810
- // Add minutes if they exist.
811
- if ( $ in ->i > 0 ) {
812
- // translators: %1$s minutes.
813
- $ time_string [] = sprintf ( __ ( '%1$d minutes ' , 'feedzy-rss-feeds ' ), $ in ->i );
814
- }
815
- echo wp_kses_post ( join ( ' ' , $ time_string ) );
798
+ echo wp_kses_post ( human_time_diff ( $ next , time () ) );
816
799
}
817
800
break ;
818
801
default :
@@ -882,7 +865,7 @@ private function get_last_run_details( $post_id ) {
882
865
883
866
// popup for items found.
884
867
if ( is_array ( $ status ['items ' ] ) ) {
885
- $ msg .= '<div class="feedzy-items-found- ' . $ post_id . ' feedzy-dialog" title=" ' . __ ( 'Items found ' , 'feedzy-rss-feeds ' ) . '"><ol> ' ;
868
+ $ msg .= '<div class="feedzy-items-found- ' . $ post_id . ' feedzy-dialog" title=" ' . __ ( 'Items found ' , 'feedzy-rss-feeds ' ) . '"><ol> ' ;
886
869
foreach ( $ status ['items ' ] as $ url => $ title ) {
887
870
$ msg .= sprintf ( '<li><p><a href="%s" target="_blank">%s</a></p></li> ' , esc_url ( $ url ), esc_html ( $ title ) );
888
871
}
@@ -2373,7 +2356,7 @@ private function try_save_featured_image( $img_source_url, $post_id, $post_title
2373
2356
*/
2374
2357
public function add_cron () {
2375
2358
$ time = ! empty ( $ this ->free_settings ['general ' ]['fz_cron_execution ' ] ) ? $ this ->get_cron_execution ( $ this ->free_settings ['general ' ]['fz_cron_execution ' ] ) : time ();
2376
- $ schedule = ! empty ( $ this ->free_settings ['general ' ]['fz_cron_schedule ' ] ) ? $ this ->free_settings ['general ' ]['fz_cron_schedule ' ] : 'hourly ' ;
2359
+ $ schedule = ! empty ( $ this ->free_settings ['general ' ]['fz_cron_schedule ' ] ) ? $ this ->free_settings ['general ' ]['fz_cron_schedule ' ] : ( feedzy_is_legacyv5 () ? 'hourly ' : ' daily ' ) ;
2377
2360
if ( ( isset ( $ _POST ['nonce ' ] ) && isset ( $ _POST ['tab ' ] ) ) && ( wp_verify_nonce ( filter_input ( INPUT_POST , 'nonce ' , FILTER_UNSAFE_RAW ), filter_input ( INPUT_POST , 'tab ' , FILTER_UNSAFE_RAW ) ) ) ) {
2378
2361
if ( ! empty ( $ _POST ['fz_cron_execution ' ] ) && ! empty ( $ _POST ['fz_cron_schedule ' ] ) && ! empty ( $ _POST ['fz_execution_offset ' ] ) ) {
2379
2362
$ execution = sanitize_text_field ( wp_unslash ( $ _POST ['fz_cron_execution ' ] ) );
0 commit comments