@@ -755,22 +755,24 @@ public function manage_feedzy_import_columns( $column, $post_id ) {
755
755
* @access private
756
756
*/
757
757
private function get_last_run_details ( $ post_id ) {
758
- $ msg = '' ;
759
- $ last = get_post_meta ( $ post_id , 'last_run ' , true );
760
- $ status = array (
758
+ $ msg = '' ;
759
+ $ import_errors = get_post_meta ( $ post_id , 'import_errors ' , true );
760
+ $ status = array (
761
761
'total ' => '- ' ,
762
762
'items ' => '- ' ,
763
763
'duplicates ' => '- ' ,
764
764
'cumulative ' => '- ' ,
765
765
);
766
- if ( $ last ) {
767
- $ status = array (
766
+ $ import_info = false ;
767
+ if ( $ import_errors ) {
768
+ $ import_info = get_post_meta ( $ post_id , 'import_info ' , true );
769
+ $ status = array (
768
770
'total ' => 0 ,
769
771
'items ' => 0 ,
770
772
'duplicates ' => 0 ,
771
773
'cumulative ' => 0 ,
772
774
);
773
- $ status = $ this ->get_complete_import_status ( $ post_id );
775
+ $ status = $ this ->get_complete_import_status ( $ post_id );
774
776
}
775
777
776
778
// link to the posts listing for this job.
@@ -882,11 +884,11 @@ private function get_last_run_details( $post_id ) {
882
884
__ ( 'Items that were imported across all runs ' , 'feedzy-rss-feeds ' ),
883
885
$ status ['cumulative ' ],
884
886
// fifth cell
885
- empty ( $ last ) ? '' : ( ! empty ( $ errors ) ? 'feedzy-has-popup import-error ' : 'import-success ' ),
886
- empty ( $ last ) ? '-1 ' : ( ! empty ( $ errors ) ? 0 : 1 ),
887
+ empty ( $ import_info ) ? '' : ( ! empty ( $ errors ) ? 'feedzy-has-popup import-error ' : 'import-success ' ),
888
+ empty ( $ import_info ) ? '-1 ' : ( ! empty ( $ errors ) ? 0 : 1 ),
887
889
$ post_id ,
888
890
__ ( 'View the errors ' , 'feedzy-rss-feeds ' ),
889
- empty ( $ last ) ? '- ' : ( ! empty ( $ errors ) ? '<i class="dashicons dashicons-warning"></i> ' : '<i class="dashicons dashicons-yes-alt"></i> ' ),
891
+ empty ( $ import_info ) ? '- ' : ( ! empty ( $ errors ) ? '<i class="dashicons dashicons-warning"></i> ' : '<i class="dashicons dashicons-yes-alt"></i> ' ),
890
892
// second row
891
893
__ ( 'Found ' , 'feedzy-rss-feeds ' ),
892
894
__ ( 'Duplicates ' , 'feedzy-rss-feeds ' ),
@@ -2700,13 +2702,13 @@ private function purge_data() {
2700
2702
wp_delete_post ( $ post_id , true );
2701
2703
}
2702
2704
}
2705
+ delete_post_meta ( $ id , 'import_errors ' );
2706
+ delete_post_meta ( $ id , 'import_info ' );
2707
+ delete_post_meta ( $ id , 'imported_items ' );
2708
+ delete_post_meta ( $ id , 'imported_items_count ' );
2703
2709
}
2704
2710
2705
2711
delete_post_meta ( $ id , 'imported_items_hash ' );
2706
- delete_post_meta ( $ id , 'imported_items ' );
2707
- delete_post_meta ( $ id , 'imported_items_count ' );
2708
- delete_post_meta ( $ id , 'import_errors ' );
2709
- delete_post_meta ( $ id , 'import_info ' );
2710
2712
delete_post_meta ( $ id , 'last_run ' );
2711
2713
wp_die ();
2712
2714
}
0 commit comments