WP RSS Aggregator - Version 4.2.1

Version Description

(2014-07-17) = * Enhanced: Feed Sources page is now more responsive.

Download this release

Release Info

Developer jeangalea
Plugin Icon 128x128 WP RSS Aggregator
Version 4.2.1
Comparing to
See all releases

Code changes from version 4.2 to 4.2.1

changelog.txt CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  4.2 (2014-07-17)
2
  New Feature: Can now view each feed source's imported feed items separate from other feed sources' feed items.
3
  Enhanced: Major visual update to the Feed Sources page with new live updates.
1
+ 4.2.1 (2014-07-17)
2
+ Enhanced: Feed Sources page is now more responsive.
3
+
4
  4.2 (2014-07-17)
5
  New Feature: Can now view each feed source's imported feed items separate from other feed sources' feed items.
6
  Enhanced: Major visual update to the Feed Sources page with new live updates.
includes/admin-display.php CHANGED
@@ -354,7 +354,7 @@
354
  wp_schedule_single_event( time(), 'wprss_delete_feed_items_from_source_hook', array( $source_id ) );
355
  // Set a transient
356
  set_transient( 'wprss_delete_posts_by_source_notif', 'true', 30 );
357
- update_post_meta( $source_id, 'wprss_feed_is_deleting_items', 'true' );
358
  // Refresh the page without the GET parameter
359
  header( 'Location: ' . admin_url( 'edit.php?post_type=wprss_feed' ) );
360
  exit();
354
  wp_schedule_single_event( time(), 'wprss_delete_feed_items_from_source_hook', array( $source_id ) );
355
  // Set a transient
356
  set_transient( 'wprss_delete_posts_by_source_notif', 'true', 30 );
357
+ update_post_meta( $source_id, 'wprss_feed_is_deleting_items', time() );
358
  // Refresh the page without the GET parameter
359
  header( 'Location: ' . admin_url( 'edit.php?post_type=wprss_feed' ) );
360
  exit();
includes/admin-heartbeat.php CHANGED
@@ -1,14 +1,16 @@
1
  <?php
2
 
3
- add_action( 'heartbeat_received', 'wprss_heartbeat_received', 10, 2 );
4
  /**
5
  *
6
  */
7
- function wprss_heartbeat_received( $response, $data ) {
8
- if ( empty($data['wprss_heartbeat']) ) return $response;
 
 
9
 
10
  // Get the wprss heartbeat data and extract the data
11
- $wprss_heartbeat = $data['wprss_heartbeat'];
12
  extract( $wprss_heartbeat );
13
 
14
  // Perform the action specified by the heartbeat data
@@ -26,7 +28,7 @@ function wprss_heartbeat_received( $response, $data ) {
26
 
27
  // Check if the feed source is updating
28
  $seconds_for_next_update = wprss_get_next_feed_source_update( $feed_id ) - time();
29
- $feed_source_data['updating'] = ( $seconds_for_next_update < 15 && $seconds_for_next_update > 0 ) || wprss_is_feed_source_deleting( $feed_id );
30
 
31
  // Add the number of imported items
32
  $items = wprss_get_feed_items_for_source( $feed_id );
@@ -66,5 +68,5 @@ function wprss_heartbeat_received( $response, $data ) {
66
  break;
67
  }
68
  // Return the response
69
- return $response;
70
  }
1
  <?php
2
 
3
+ add_action( 'wp_ajax_wprss_feed_source_table_ajax', 'wprss_feed_source_updates');
4
  /**
5
  *
6
  */
7
+ function wprss_feed_source_updates() {
8
+ $response = array();
9
+
10
+ if ( empty($_POST['wprss_heartbeat']) ) return $response;
11
 
12
  // Get the wprss heartbeat data and extract the data
13
+ $wprss_heartbeat = $_POST['wprss_heartbeat'];
14
  extract( $wprss_heartbeat );
15
 
16
  // Perform the action specified by the heartbeat data
28
 
29
  // Check if the feed source is updating
30
  $seconds_for_next_update = wprss_get_next_feed_source_update( $feed_id ) - time();
31
+ $feed_source_data['updating'] = ( $seconds_for_next_update < 2 && $seconds_for_next_update > 0 ) || wprss_is_feed_source_updating( $feed_id ) || wprss_is_feed_source_deleting( $feed_id );
32
 
33
  // Add the number of imported items
34
  $items = wprss_get_feed_items_for_source( $feed_id );
68
  break;
69
  }
70
  // Return the response
71
+ die( json_encode($response) );
72
  }
includes/admin-welcome.php CHANGED
@@ -106,7 +106,12 @@
106
 
107
  <hr/>
108
 
109
- <h3>Changelog for v<?php echo WPRSS_VERSION; ?></h3>
 
 
 
 
 
110
  <ul>
111
  <li><strong>New Feature:</strong> Can now view each feed source's imported feed items separate from other feed sources' feed items.</li>
112
  <li><strong>Enhanced:</strong> Major visual update to the Feed Sources page with new live updates.</li>
106
 
107
  <hr/>
108
 
109
+ <h3>Changelog for v<?php echo WPRSS_VERSION; ?></h3>
110
+ <ul>
111
+ <li><strong>Enhanced:</strong> Feed Sources page is now more responsive.</li>
112
+ </ul>
113
+
114
+ <h3>Changelog for v4.2</h3>
115
  <ul>
116
  <li><strong>New Feature:</strong> Can now view each feed source's imported feed items separate from other feed sources' feed items.</li>
117
  <li><strong>Enhanced:</strong> Major visual update to the Feed Sources page with new live updates.</li>
includes/feed-importing.php CHANGED
@@ -26,6 +26,8 @@
26
  if ( wprss_feed_source_force_next_fetch( $feed_ID ) ) {
27
  delete_post_meta( $feed_ID, 'wprss_force_next_fetch' );
28
  }
 
 
29
 
30
  // Get the feed source URL from post meta, and filter it
31
  $feed_url = get_post_meta( $feed_ID, 'wprss_url', true );
@@ -97,6 +99,8 @@
97
  } else {
98
  wprss_log("The feed URL is not valid! Please recheck.");
99
  }
 
 
100
  }
101
 
102
 
26
  if ( wprss_feed_source_force_next_fetch( $feed_ID ) ) {
27
  delete_post_meta( $feed_ID, 'wprss_force_next_fetch' );
28
  }
29
+
30
+ update_post_meta( $feed_ID, 'wprss_feed_is_updating', time() );
31
 
32
  // Get the feed source URL from post meta, and filter it
33
  $feed_url = get_post_meta( $feed_ID, 'wprss_url', true );
99
  } else {
100
  wprss_log("The feed URL is not valid! Please recheck.");
101
  }
102
+
103
+ delete_post_meta( $feed_ID, 'wprss_feed_is_updating' );
104
  }
105
 
106
 
includes/feed-processing.php CHANGED
@@ -328,6 +328,31 @@
328
  }
329
 
330
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
 
332
  /**
333
  * Returns whether or not the feed source is deleting its feeed items.
@@ -342,9 +367,11 @@
342
  if ( $is_deleting_meta === '' ) {
343
  return FALSE;
344
  }
 
 
345
 
346
  $items = wprss_get_feed_items_for_source( $id );
347
- if ( $items->post_count == 0 ) {
348
  delete_post_meta( $id, 'wprss_feed_is_deleting_items' );
349
  return FALSE;
350
  }
328
  }
329
 
330
 
331
+ /**
332
+ * Returns whether or not the feed source is updating.
333
+ *
334
+ * @param (string|int) The id of the feed source
335
+ * @return (bool) TRUE if the feed source is currently updating, FALSE otherwise.
336
+ *
337
+ */
338
+ function wprss_is_feed_source_updating( $id ) {
339
+ $is_updating_meta = get_post_meta( $id, 'wprss_feed_is_updating', TRUE );
340
+
341
+ if ( $is_updating_meta === '' ) {
342
+ return FALSE;
343
+ }
344
+
345
+ $diff = time() - $is_updating_meta;
346
+
347
+ if ( $diff > 300 ) {
348
+ delete_post_meta( $id, 'wprss_feed_is_updating' );
349
+ return FALSE;
350
+ }
351
+
352
+ return TRUE;
353
+ }
354
+
355
+
356
 
357
  /**
358
  * Returns whether or not the feed source is deleting its feeed items.
367
  if ( $is_deleting_meta === '' ) {
368
  return FALSE;
369
  }
370
+
371
+ $diff = time() - $is_updating_meta;
372
 
373
  $items = wprss_get_feed_items_for_source( $id );
374
+ if ( $items->post_count == 0 || $diff > 300 ) {
375
  delete_post_meta( $id, 'wprss_feed_is_deleting_items' );
376
  return FALSE;
377
  }
js/heartbeat.js CHANGED
@@ -16,12 +16,12 @@
16
  /**
17
  * Attach the heartbeat data
18
  */
19
- var checkFeedSourcesUpdatingStatus = function(e, data) {
20
  var ids = getFeedSourceIDS();
21
  // If no feed sources found, do nothing. Performance boost
22
  if ( ids.length === 0 ) return;
23
- // Send the data
24
- data['wprss_heartbeat'] = {
25
  action: 'feed_sources',
26
  params: ids
27
  };
@@ -32,7 +32,7 @@
32
  /**
33
  * Updates the feed source table using the heartbeat data.
34
  */
35
- var updateFeedSourceTable = function(e, data) {
36
  if ( !data['wprss_feed_sources_data'] ) return;
37
 
38
  // Get the feed sources data
@@ -97,14 +97,26 @@
97
 
98
  };
99
 
100
-
101
-
102
- // Hook into the heartbeat-send
103
- $(document).on('heartbeat-send', checkFeedSourcesUpdatingStatus);
104
-
105
- // Listen for heartbeat events
106
- $(document).on('heartbeat-tick', updateFeedSourceTable);
107
-
108
-
 
 
 
 
 
 
 
 
 
 
 
 
109
 
110
  })(jQuery);
16
  /**
17
  * Attach the heartbeat data
18
  */
19
+ var checkFeedSourcesUpdatingStatus = function() {
20
  var ids = getFeedSourceIDS();
21
  // If no feed sources found, do nothing. Performance boost
22
  if ( ids.length === 0 ) return;
23
+ // Return the data
24
+ return {
25
  action: 'feed_sources',
26
  params: ids
27
  };
32
  /**
33
  * Updates the feed source table using the heartbeat data.
34
  */
35
+ var updateFeedSourceTable = function(data) {
36
  if ( !data['wprss_feed_sources_data'] ) return;
37
 
38
  // Get the feed sources data
97
 
98
  };
99
 
100
+ var wprssFeedSourceTableAjax = function(){
101
+ var data = checkFeedSourcesUpdatingStatus();
102
+ $.ajax({
103
+ url: ajaxurl,
104
+ type: "POST",
105
+ data: {
106
+ action: 'wprss_feed_source_table_ajax',
107
+ wprss_heartbeat: data
108
+ },
109
+ success: function(data, status, jqXHR){
110
+ updateFeedSourceTable(data);
111
+ },
112
+ dataType: 'json'
113
+ });
114
+ };
115
+
116
+
117
+ $(document).ready( function(){
118
+ setInterval(wprssFeedSourceTableAjax, 1000);
119
+ });
120
+
121
 
122
  })(jQuery);
readme.txt CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.wprssaggregator.com
5
  Tags: rss, feeds, aggregation, rss to post, autoblog aggregator, rss import, feed aggregator, rss aggregator, multiple rss feeds, multi rss feeds, rss multi importer, feed import, feed import, multiple feed import, feed aggregation, rss feader, feed reader, feed to post, multiple feeds, multi feed importer, multi feed import, multi import, autoblogging, autoblogger
6
  Requires at least: 3.3
7
  Tested up to: 3.9.1
8
- Stable tag: 4.2
9
  License: GPLv2 or later
10
  Imports and aggregates multiple RSS Feeds using SimplePie. Outputs feeds sorted by date (latest first).
11
 
@@ -163,6 +163,9 @@ The full documentation section can be found on the [WP RSS Aggregator website](w
163
 
164
  == Changelog ==
165
 
 
 
 
166
  = 4.2 (2014-07-17) =
167
  * New Feature: Can now view each feed source's imported feed items separate from other feed sources' feed items.
168
  * Enhanced: Major visual update to the Feed Sources page with new live updates.
5
  Tags: rss, feeds, aggregation, rss to post, autoblog aggregator, rss import, feed aggregator, rss aggregator, multiple rss feeds, multi rss feeds, rss multi importer, feed import, feed import, multiple feed import, feed aggregation, rss feader, feed reader, feed to post, multiple feeds, multi feed importer, multi feed import, multi import, autoblogging, autoblogger
6
  Requires at least: 3.3
7
  Tested up to: 3.9.1
8
+ Stable tag: 4.2.1
9
  License: GPLv2 or later
10
  Imports and aggregates multiple RSS Feeds using SimplePie. Outputs feeds sorted by date (latest first).
11
 
163
 
164
  == Changelog ==
165
 
166
+ = 4.2.1 (2014-07-17) =
167
+ * Enhanced: Feed Sources page is now more responsive.
168
+
169
  = 4.2 (2014-07-17) =
170
  * New Feature: Can now view each feed source's imported feed items separate from other feed sources' feed items.
171
  * Enhanced: Major visual update to the Feed Sources page with new live updates.
wp-rss-aggregator.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP RSS Aggregator
4
  Plugin URI: http://www.wprssaggregator.com
5
  Description: Imports and aggregates multiple RSS Feeds using SimplePie
6
- Version: 4.2
7
  Author: Jean Galea
8
  Author URI: http://www.wprssaggregator.com
9
  License: GPLv2
@@ -29,7 +29,7 @@
29
 
30
  /**
31
  * @package WPRSSAggregator
32
- * @version 4.2
33
  * @since 1.0
34
  * @author Jean Galea <info@jeangalea.com>
35
  * @copyright Copyright (c) 2012-2014, Jean Galea
@@ -43,7 +43,7 @@
43
 
44
  // Set the version number of the plugin.
45
  if( !defined( 'WPRSS_VERSION' ) )
46
- define( 'WPRSS_VERSION', '4.2', true );
47
 
48
  // Set the database version number of the plugin.
49
  if( !defined( 'WPRSS_DB_VERSION' ) )
3
  Plugin Name: WP RSS Aggregator
4
  Plugin URI: http://www.wprssaggregator.com
5
  Description: Imports and aggregates multiple RSS Feeds using SimplePie
6
+ Version: 4.2.1
7
  Author: Jean Galea
8
  Author URI: http://www.wprssaggregator.com
9
  License: GPLv2
29
 
30
  /**
31
  * @package WPRSSAggregator
32
+ * @version 4.2.1
33
  * @since 1.0
34
  * @author Jean Galea <info@jeangalea.com>
35
  * @copyright Copyright (c) 2012-2014, Jean Galea
43
 
44
  // Set the version number of the plugin.
45
  if( !defined( 'WPRSS_VERSION' ) )
46
+ define( 'WPRSS_VERSION', '4.2.1', true );
47
 
48
  // Set the database version number of the plugin.
49
  if( !defined( 'WPRSS_DB_VERSION' ) )