RSS Post Importer - Version 2.1.8

Version Description

Download this release

Release Info

Developer koralyne
Plugin Icon 128x128 RSS Post Importer
Version 2.1.8
Comparing to
See all releases

Code changes from version 2.1.7 to 2.1.8

app/assets/css/style.css CHANGED
@@ -286,3 +286,9 @@ div.category_container ul.children {
286
 
287
 
288
  }
 
 
 
 
 
 
286
 
287
 
288
  }
289
+ .rss_show_a {
290
+ display:inline;
291
+ }
292
+ .rss_hide_a {
293
+ display:none;
294
+ }
app/assets/js/main.js CHANGED
@@ -16,6 +16,34 @@ $('document').ready(function(){
16
  update_ids();
17
  return false;
18
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  if ( $("#rss_pi-feed-table").length ) {
21
 
@@ -227,7 +255,6 @@ function update_ids() {
227
  jQuery('#ids').val(ids);
228
 
229
  }
230
-
231
  var feeds = {
232
  ids: feeds || [],
233
  count: feeds && feeds.length ? feeds.length : 0,
16
  update_ids();
17
  return false;
18
  });
19
+
20
+ // status-buttons
21
+ $('body').on('click', 'a.status-row', function () {
22
+ var action = $(this).attr('data-action');
23
+ var target = $(this).attr('data-target');
24
+ if(action=="pause")
25
+ {
26
+ $(this).attr('data-action','Enable_Feed');
27
+ $(this).html('Enable Feed');
28
+ }else
29
+ {
30
+ $(this).attr('data-action','pause');
31
+ $(this).html('Pause');
32
+ }
33
+
34
+ var sts_ids = [];
35
+ $('a.status-row').each(function(){
36
+ if($(this).attr('data-action') =="Enable_Feed"){
37
+ sts_ids.push($(this).attr('data-target'));
38
+ }
39
+ })
40
+
41
+ var sts_value = sts_ids.join();
42
+ $("#sts_id").val(sts_value);
43
+
44
+
45
+ return false;
46
+ });
47
 
48
  if ( $("#rss_pi-feed-table").length ) {
49
 
255
  jQuery('#ids').val(ids);
256
 
257
  }
 
258
  var feeds = {
259
  ids: feeds || [],
260
  count: feeds && feeds.length ? feeds.length : 0,
app/classes/admin/class-rss-pi-admin-processor.php CHANGED
@@ -266,7 +266,13 @@ class rssPIAdminProcessor {
266
  private function process_feeds($ids) {
267
 
268
 
269
-
 
 
 
 
 
 
270
  $feeds = array();
271
 
272
  foreach ($ids as $id) {
@@ -283,6 +289,12 @@ class rssPIAdminProcessor {
283
  }
284
 
285
  }
 
 
 
 
 
 
286
  array_push($feeds, array(
287
  'id' => $id,
288
  'url' => $_POST[$id . '-url'],
@@ -295,7 +307,8 @@ class rssPIAdminProcessor {
295
  'keywords' => array_map('trim',$keywords),
296
  'strip_html' => (isset($_POST[$id . '-strip_html'])) ? $_POST[$id . '-strip_html'] : '',
297
  'nofollow_outbound' => (isset($_POST[$id . '-nofollow_outbound'])) ? $_POST[$id . '-nofollow_outbound'] : '',
298
- 'automatic_import_categories' => (isset($_POST[$id . '-automatic_import_categories'])) ? $_POST[$id . '-automatic_import_categories'] : '', 'automatic_import_author' => (isset($_POST[$id . '-automatic_import_author'])) ? $_POST[$id . '-automatic_import_author'] : ''
 
299
  ));
300
  }
301
  }
266
  private function process_feeds($ids) {
267
 
268
 
269
+ echo $sts_id = $_POST['sts_id'];
270
+
271
+ $status_id = array();
272
+ if(!empty($sts_id))
273
+ {
274
+ $status_id = explode(',',$sts_id);
275
+ }
276
  $feeds = array();
277
 
278
  foreach ($ids as $id) {
289
  }
290
 
291
  }
292
+ if(in_array($id,$status_id))
293
+ $feed_status="pause";
294
+ else
295
+ $feed_status="active";
296
+
297
+
298
  array_push($feeds, array(
299
  'id' => $id,
300
  'url' => $_POST[$id . '-url'],
307
  'keywords' => array_map('trim',$keywords),
308
  'strip_html' => (isset($_POST[$id . '-strip_html'])) ? $_POST[$id . '-strip_html'] : '',
309
  'nofollow_outbound' => (isset($_POST[$id . '-nofollow_outbound'])) ? $_POST[$id . '-nofollow_outbound'] : '',
310
+ 'automatic_import_categories' => (isset($_POST[$id . '-automatic_import_categories'])) ? $_POST[$id . '-automatic_import_categories'] : '', 'automatic_import_author' => (isset($_POST[$id . '-automatic_import_author'])) ? $_POST[$id . '-automatic_import_author'] : '',
311
+ 'feed_status' => $feed_status
312
  ));
313
  }
314
  }
app/classes/admin/class-rss-pi-opml.php CHANGED
@@ -120,7 +120,8 @@ if (!class_exists("Rss_pi_opml")) {
120
  'strip_html' => 'false',
121
  'nofollow_outbound' => 'false',
122
  'automatic_import_categories' => 'false',
123
- 'automatic_import_author' => 'false'
 
124
  ));
125
 
126
  } else {
120
  'strip_html' => 'false',
121
  'nofollow_outbound' => 'false',
122
  'automatic_import_categories' => 'false',
123
+ 'automatic_import_author' => 'false',
124
+ 'feed_status' => 'active'
125
  ));
126
 
127
  } else {
app/classes/admin/class-rss-pi-stats.php CHANGED
@@ -36,8 +36,20 @@ if (!class_exists("Rss_pi_stats")) {
36
  $start_time = strtotime($_POST["rss_from_date"]);
37
  $end_time = strtotime($_POST["rss_till_date"]);
38
  } else {
39
- $start_time = get_the_time("U", $oldest_post);
40
- $end_time = get_the_time("U", $newest_post);
 
 
 
 
 
 
 
 
 
 
 
 
41
  }
42
 
43
  if ( isset($_POST["rss_filter_stats"]) && $start_time <= 0 || $end_time <= 0 ) {
36
  $start_time = strtotime($_POST["rss_from_date"]);
37
  $end_time = strtotime($_POST["rss_till_date"]);
38
  } else {
39
+
40
+
41
+ $date_today = date("Y-m-d");// current date
42
+ $date_today_unix = strtotime($date_today);
43
+ $date_seven_days_unix = strtotime(date("Y-m-d", strtotime($date_today)) . " -7 day");
44
+
45
+ // for last seven days stats
46
+ $start_time = $date_seven_days_unix;
47
+ $end_time = $date_today_unix;
48
+
49
+ /*Old Code working according to first post*/
50
+ //$start_time = get_the_time("U", $oldest_post);
51
+ //$end_time = get_the_time("U", $newest_post);
52
+
53
  }
54
 
55
  if ( isset($_POST["rss_filter_stats"]) && $start_time <= 0 || $end_time <= 0 ) {
app/classes/import/class-rss-pi-engine.php CHANGED
@@ -141,6 +141,7 @@ class rssPIEngine {
141
  'nofollow_outbound' => $f['nofollow_outbound'],
142
  'automatic_import_categories' => $f['automatic_import_categories'],
143
  'automatic_import_author' => $f['automatic_import_author'],
 
144
  'save_to_db' => true
145
  );
146
  return $this->_import($f['url'], $args);
@@ -171,7 +172,12 @@ class rssPIEngine {
171
  'nofollow_outbound' => true,
172
  'automatic_import_categories' => true,
173
  'automatic_import_author' => true,
 
174
  );
 
 
 
 
175
 
176
  $args = wp_parse_args($args, $defaults);
177
 
@@ -365,8 +371,11 @@ class rssPIEngine {
365
 
366
  // Featured Image setter
367
  $thumbnail = new rssPIFeaturedImage();
 
 
368
 
369
  foreach ( $items as $item ) {
 
370
  if ( ! $this->post_exists($item) ) {
371
 
372
  /* Code to convert tags id array to tag name array * */
@@ -509,6 +518,7 @@ class rssPIEngine {
509
  array_push($saved_posts, $post);
510
  }
511
  }
 
512
 
513
  return $saved_posts;
514
  }
141
  'nofollow_outbound' => $f['nofollow_outbound'],
142
  'automatic_import_categories' => $f['automatic_import_categories'],
143
  'automatic_import_author' => $f['automatic_import_author'],
144
+ 'feed_status' => $f['feed_status'],
145
  'save_to_db' => true
146
  );
147
  return $this->_import($f['url'], $args);
172
  'nofollow_outbound' => true,
173
  'automatic_import_categories' => true,
174
  'automatic_import_author' => true,
175
+ 'feed_status' => 'active'
176
  );
177
+
178
+ if($args['feed_status']=='pause'){
179
+ return;
180
+ }
181
 
182
  $args = wp_parse_args($args, $defaults);
183
 
371
 
372
  // Featured Image setter
373
  $thumbnail = new rssPIFeaturedImage();
374
+ // If Item is active then Import
375
+ if($args['feed_status']=="active"){
376
 
377
  foreach ( $items as $item ) {
378
+
379
  if ( ! $this->post_exists($item) ) {
380
 
381
  /* Code to convert tags id array to tag name array * */
518
  array_push($saved_posts, $post);
519
  }
520
  }
521
+ }
522
 
523
  return $saved_posts;
524
  }
app/templates/feed-table-row.php CHANGED
@@ -53,6 +53,7 @@ if (is_array($f['category_id'])) {
53
  $category = get_the_category_by_ID(intval($f['category_id']));
54
  }
55
  }
 
56
  ?>
57
 
58
  <tr id="display_<?php echo ($f['id']); ?>" class="data-row<?php echo $show; ?>" data-fields="name,url,max_posts">
@@ -61,6 +62,13 @@ if (is_array($f['category_id'])) {
61
  <div class="row-options">
62
  <a href="#" class="toggle-edit" data-target="<?php echo ($f['id']); ?>"><?php _e('Edit', 'rss_pi'); ?></a> |
63
  <a href="#" class="delete-row" data-target="<?php echo ($f['id']); ?>"><?php _e('Delete', 'rss_pi'); ?></a>
 
 
 
 
 
 
 
64
  </div>
65
  </td>
66
  <td class="rss_pi-feed_url"><span class="field-url"><?php echo esc_url(stripslashes($f['url'])); ?></span></td>
53
  $category = get_the_category_by_ID(intval($f['category_id']));
54
  }
55
  }
56
+
57
  ?>
58
 
59
  <tr id="display_<?php echo ($f['id']); ?>" class="data-row<?php echo $show; ?>" data-fields="name,url,max_posts">
62
  <div class="row-options">
63
  <a href="#" class="toggle-edit" data-target="<?php echo ($f['id']); ?>"><?php _e('Edit', 'rss_pi'); ?></a> |
64
  <a href="#" class="delete-row" data-target="<?php echo ($f['id']); ?>"><?php _e('Delete', 'rss_pi'); ?></a>
65
+ <?php
66
+ if($f['feed_status']=="active"){ ?>
67
+ | <a href="#" class="status-row" data-action="pause" data-target="<?php echo ($f['id']); ?>"><?php _e('Pause', 'rss_pi'); ?></a>
68
+ <?php }elseif($f['feed_status']=="pause"){ ?>
69
+ | <a href="#" class="status-row" data-action="Enable_Feed" data-target="<?php echo ($f['id']); ?>"><?php _e('Enable Feed', 'rss_pi'); ?></a>
70
+ <?php } ?>
71
+
72
  </div>
73
  </td>
74
  <td class="rss_pi-feed_url"><span class="field-url"><?php echo esc_url(stripslashes($f['url'])); ?></span></td>
app/templates/feed-table.php CHANGED
@@ -35,6 +35,7 @@
35
  <?php _e('Add new feed', "rss_pi"); ?>
36
  </a>
37
  <input type="hidden" name="ids" id="ids" value="<?php echo(join($saved_ids, ',')); ?>" />
 
38
  </td>
39
  </tr>
40
  <?php
35
  <?php _e('Add new feed', "rss_pi"); ?>
36
  </a>
37
  <input type="hidden" name="ids" id="ids" value="<?php echo(join($saved_ids, ',')); ?>" />
38
+ <input type="hidden" id="sts_id" name="sts_id" value="" />
39
  </td>
40
  </tr>
41
  <?php
index.php CHANGED
@@ -5,7 +5,7 @@
5
  Plugin URI: https://wordpress.org/plugins/rss-post-importer/
6
  Description: This plugin lets you set up an import posts from one or several rss-feeds and save them as posts on your site, simple and flexible.
7
  Author: feedsapi
8
- Version: 2.1.7
9
  Author URI: https://www.feedsapi.org/
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -27,7 +27,7 @@ if (!defined('RSS_PI_BASENAME')) {
27
  }
28
 
29
  if (!defined('RSS_PI_VERSION')) {
30
- define('RSS_PI_VERSION', '2.1.7');
31
  }
32
 
33
  if (!defined('RSS_PI_LOG_PATH')) {
5
  Plugin URI: https://wordpress.org/plugins/rss-post-importer/
6
  Description: This plugin lets you set up an import posts from one or several rss-feeds and save them as posts on your site, simple and flexible.
7
  Author: feedsapi
8
+ Version: 2.1.8
9
  Author URI: https://www.feedsapi.org/
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
27
  }
28
 
29
  if (!defined('RSS_PI_VERSION')) {
30
+ define('RSS_PI_VERSION', '2.1.8');
31
  }
32
 
33
  if (!defined('RSS_PI_LOG_PATH')) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.feedsapi.org/
4
  Tags: rss, feeds, import, feed, autoblog, feed aggregation, rss-feed, aggregation, atom, feed, rss, syndication, FeedWordPress, autoblog aggregator, Autoblogger, autoblogging, feed import, rss multi importer, feed reader, feed to post, multi feed import, multi feed importer, multi import, multi rss feeds, multiple feed import, multiple feeds, multiple rss feeds, rss, rss aggregator, rss feader, RSS import, rss to post, content curation, RSS Retriever, RSS fetch feed, WP RSS Aggregator, AutoPost, RSS Feed to Post, RSSImport, yahoo pipes, WP Pipes, Import XML feed , FeedSyndicate, RSSpost, RSS in Page
5
  Requires at least: 3.5
6
  Tested up to: 4.2.4
7
- Stable tag: 2.1.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -124,8 +124,13 @@ Learn more (and get detailed instructions) in our [contribute guide](http://jetp
124
 
125
  == Change Log ==
126
 
 
 
 
 
 
127
  = Version 2.1.7 =
128
- * upport for Automatic Authors Importing
129
  * Support for Automatic Categories importing
130
  * Bug fixes
131
 
4
  Tags: rss, feeds, import, feed, autoblog, feed aggregation, rss-feed, aggregation, atom, feed, rss, syndication, FeedWordPress, autoblog aggregator, Autoblogger, autoblogging, feed import, rss multi importer, feed reader, feed to post, multi feed import, multi feed importer, multi import, multi rss feeds, multiple feed import, multiple feeds, multiple rss feeds, rss, rss aggregator, rss feader, RSS import, rss to post, content curation, RSS Retriever, RSS fetch feed, WP RSS Aggregator, AutoPost, RSS Feed to Post, RSSImport, yahoo pipes, WP Pipes, Import XML feed , FeedSyndicate, RSSpost, RSS in Page
5
  Requires at least: 3.5
6
  Tested up to: 4.2.4
7
+ Stable tag: 2.1.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
124
 
125
  == Change Log ==
126
 
127
+ = Version 2.1.8 =
128
+ * New: Pause / Play feed processing and content import from a a specific feed.
129
+ * BUG Fix: Charting time-out for big content DB has been fixed.
130
+ * Various small bugs fixes.
131
+
132
  = Version 2.1.7 =
133
+ * Support for Automatic Authors Importing
134
  * Support for Automatic Categories importing
135
  * Bug fixes
136