WP RSS Aggregator - Version 4.5.3

Version Description

(2014-09-15) = * New Featured: Added filter to allow adding RSS feeds to the head of your site's pages for CPTs. * Enhanced: Columns in the feed sources table are now sortable. * Enhanced: Removed the ID column in the feed sources table. The ID has been moved as a row action. * Enhanced: Improved various interface elements. * Enhanced: Better responsiveness for smaller screen. * Fixed bug: The importing spinning icon would get stuck and spin for a very long time. * Fixed bug: Removed an old description meta field. * Fixed bug: Plugin was not removing all scheduled cron jobs when deactivated.

Download this release

Release Info

Developer Mekku
Plugin Icon 128x128 WP RSS Aggregator
Version 4.5.3
Comparing to
See all releases

Code changes from version 4.5.2 to 4.5.3

changelog.txt CHANGED
@@ -1,3 +1,13 @@
 
 
 
 
 
 
 
 
 
 
1
  4.5.2 (2014-09-09)
2
  Enhanced: Optimized plugin for WordPress 4.0.
3
  Enhanced: Improved template and added filters for add-on hooking.
1
+ 4.5.3 (2014-09-15)
2
+ New Featured: Added filter to allow adding RSS feeds to the head of your site's pages for CPTs.
3
+ Enhanced: Columns in the feed sources table are now sortable.
4
+ Enhanced: Removed the ID column in the feed sources table. The ID has been moved as a row action.
5
+ Enhanced: Improved various interface elements.
6
+ Enhanced: Better responsiveness for smaller screen.
7
+ Fixed bug: The importing spinning icon would get stuck and spin for a very long time.
8
+ Fixed bug: Removed an old description meta field.
9
+ Fixed bug: Plugin was not removing all scheduled cron jobs when deactivated.
10
+
11
  4.5.2 (2014-09-09)
12
  Enhanced: Optimized plugin for WordPress 4.0.
13
  Enhanced: Improved template and added filters for add-on hooking.
css/admin-styles.css CHANGED
@@ -21,6 +21,21 @@
21
  width: 400px;
22
  }
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  #icon-wprss-aggregator {
25
  background: transparent url( '../images/icon-adminpage32.png' ) no-repeat !important;
26
  }
@@ -30,7 +45,48 @@ body.post-type-wprss_feed #titlediv div.inside { display: none !important; }
30
  #misc-publishing-actions,
31
  #minor-publishing-actions { display: none; }
32
 
33
- #custom_meta_box .form-table th { width: 100px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  body.post-type-wprss_feed_item .add-new-h2,
36
  body.post-type-wprss_feed_item .tablenav select[name="m"],
@@ -194,7 +250,14 @@ input#thumbnails-width {
194
 
195
  /* Number Roller for Feed Source Limit */
196
  .wprss-number-roller {
197
- width: 120px;
 
 
 
 
 
 
 
198
  }
199
 
200
  /* Welcome Screen */
@@ -310,24 +373,48 @@ body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#errors {
310
  body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#id {
311
  width: 50px !important;
312
  }
 
 
 
 
313
  /* NEXT UPDATE */
314
  body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#updates {
315
- width: 200px !important;
316
  }
317
  body.post-type-wprss_feed.edit-php table.wp-list-table.posts td.column-updates p {
318
  margin-bottom: 0 !important;
319
  }
320
  /* STATE */
321
  body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#state {
322
- width: 80px !important;
323
  }
324
  /* FEED COUNT */
325
  body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#feed-count {
326
- width: 120px !important;
327
  }
328
  /* CATEGORIES */
329
  body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#category {
330
- width: 120px !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
  }
332
 
333
 
21
  width: 400px;
22
  }
23
 
24
+ .wprss-text-input {
25
+ display: block;
26
+ width: 400px;
27
+ max-width: 100%;
28
+ }
29
+
30
+ label.description {
31
+ font-size: 13px;
32
+ font-style: italic;
33
+ }
34
+
35
+ span.wprss-row-id {
36
+ color: #8f8f8f;
37
+ }
38
+
39
  #icon-wprss-aggregator {
40
  background: transparent url( '../images/icon-adminpage32.png' ) no-repeat !important;
41
  }
45
  #misc-publishing-actions,
46
  #minor-publishing-actions { display: none; }
47
 
48
+
49
+
50
+ /* FORM TABLES */
51
+ .wprss-form-table th {
52
+ width: 120px;
53
+ max-width: 120px;
54
+ }
55
+ .wprss-form-table td label {
56
+ line-height: 15px;
57
+ }
58
+ @media screen and (max-width: 1025px) {
59
+ .wprss-form-table th {
60
+ display: block;
61
+ padding: 0;
62
+ }
63
+ .wprss-form-table td {
64
+ display: block;
65
+ padding-left: 0;
66
+ padding-right: 0;
67
+ }
68
+
69
+ .wprss-form-table td input[type="text"],
70
+ .wprss-form-table td input[type="url"],
71
+ .wprss-form-table td select {
72
+ display: block;
73
+ width: 100%;
74
+ }
75
+
76
+ .wprss-form-table td span.description {
77
+ display: inline;
78
+ }
79
+
80
+ .wprss-form-table td input[type="checkbox"] + label {
81
+ display: inline !important;
82
+ }
83
+
84
+ .wprss-form-table td input {
85
+ line-height: normal;
86
+ }
87
+ }
88
+
89
+
90
 
91
  body.post-type-wprss_feed_item .add-new-h2,
92
  body.post-type-wprss_feed_item .tablenav select[name="m"],
250
 
251
  /* Number Roller for Feed Source Limit */
252
  .wprss-number-roller {
253
+ width: 80px;
254
+ margin-right: 5px;
255
+ vertical-align: middle;
256
+ }
257
+ @media screen and (max-width: 782px) {
258
+ .wprss-number-roller {
259
+ width: 100px;
260
+ }
261
  }
262
 
263
  /* Welcome Screen */
373
  body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#id {
374
  width: 50px !important;
375
  }
376
+ /* NAME */
377
+ body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#title {
378
+ width: 65% !important;
379
+ }
380
  /* NEXT UPDATE */
381
  body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#updates {
382
+ width: 220px !important;
383
  }
384
  body.post-type-wprss_feed.edit-php table.wp-list-table.posts td.column-updates p {
385
  margin-bottom: 0 !important;
386
  }
387
  /* STATE */
388
  body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#state {
389
+ width: 90px !important;
390
  }
391
  /* FEED COUNT */
392
  body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#feed-count {
393
+ width: 140px !important;
394
  }
395
  /* CATEGORIES */
396
  body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#category {
397
+ width: 130px !important;
398
+ }
399
+
400
+
401
+ /** FEED SOURCES TABLE RESPONSIVENESS */
402
+ @media screen and (max-width: 1020px) {
403
+ body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#updates,
404
+ body.post-type-wprss_feed.edit-php table.wp-list-table.posts tfoot th.column-updates,
405
+ body.post-type-wprss_feed.edit-php table.wp-list-table.posts tbody td.column-updates {
406
+ display: none;
407
+ }
408
+ }
409
+ @media screen and (max-width: 660px) {
410
+ body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#id,
411
+ body.post-type-wprss_feed.edit-php table.wp-list-table.posts tfoot th.column-id,
412
+ body.post-type-wprss_feed.edit-php table.wp-list-table.posts tbody td.column-id,
413
+ body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#state,
414
+ body.post-type-wprss_feed.edit-php table.wp-list-table.posts tfoot th.column-state,
415
+ body.post-type-wprss_feed.edit-php table.wp-list-table.posts tbody td.column-state {
416
+ display: none;
417
+ }
418
  }
419
 
420
 
includes/admin-display.php CHANGED
@@ -6,7 +6,7 @@
6
  */
7
 
8
 
9
- add_filter( 'manage_wprss_feed_posts_columns', 'wprss_set_feed_custom_columns');
10
  /**
11
  * Set up the custom columns for the wprss_feed list
12
  *
@@ -18,9 +18,6 @@
18
  'cb' => '<input type="checkbox" />',
19
  'errors' => '',
20
  'title' => __( 'Name', 'wprss' ),
21
- 'id' => __( 'ID', 'wprss' ),
22
- // 'url' => __( 'URL', 'wprss' ),
23
- // 'description' => __( 'Description', 'wprss' )
24
  );
25
 
26
  $columns = apply_filters( 'wprss_set_feed_custom_columns', $columns );
@@ -48,21 +45,9 @@
48
  case 'errors':
49
  $errors = get_post_meta( $post_id, 'wprss_error_last_import', true );
50
  $showClass = ( $errors === 'true' )? 'wprss-show' : '';
51
-
52
  $msg = "This feed source experienced an error during the last feed fetch or validation check. Re-check the feed source URL or check the Error Log in the Debugging page for more details.";
53
  echo "<i title=\"$msg\" class=\"fa fa-warning fa-fw wprss-feed-error-symbol $showClass\"></i>";
54
  break;
55
- case 'url':
56
- $url = get_post_meta( $post_id, 'wprss_url', true);
57
- echo '<a href="' . esc_url($url) . '">' . esc_url($url) . '</a>';
58
- break;
59
- case 'description':
60
- $description = get_post_meta( $post_id, 'wprss_description', true);
61
- echo esc_html( $description );
62
- break;
63
- case 'id':
64
- echo esc_html( $post_id );
65
- break;
66
  case 'state':
67
  $active = wprss_is_feed_source_active( $post_id );
68
  $text = ( $active )? 'Active' : 'Paused';
@@ -97,18 +82,21 @@
97
  if ( $update_interval === wprss_get_default_feed_source_update_interval() || $update_interval === '' ) {
98
  $next_update = wp_next_scheduled( 'wprss_fetch_all_feeds_hook', array() );
99
  }
 
 
 
 
 
 
 
 
 
100
  ?>
101
 
102
  <p>
103
  Next update:
104
  <code class="next-update">
105
- <?php if ( ! wprss_is_feed_source_active( $post_id ) ): ?>
106
- Paused
107
- <?php elseif ( $next_update === FALSE ) : ?>
108
- None
109
- <?php else: ?>
110
- <?php echo human_time_diff( $next_update, time() ); ?>
111
- <?php endif; ?>
112
  </code>
113
  </p>
114
 
@@ -134,11 +122,15 @@
134
  echo "<i class=\"fa fa-fw fa-refresh fa-spin wprss-updating-feed-icon $showClass\" title=\"Updating feed source\"></i>";
135
  echo '</p>';
136
 
 
 
 
137
  break;
138
  }
139
  }
140
 
141
 
 
142
  /**
143
  * Make the custom columns sortable for wprss_feed post type
144
  *
@@ -147,7 +139,10 @@
147
  function wprss_feed_sortable_columns() {
148
  $sortable_columns = array(
149
  // meta column id => sortby value used in query
150
- 'title' => 'title',
 
 
 
151
  );
152
  return apply_filters( 'wprss_feed_sortable_columns', $sortable_columns );
153
  }
@@ -160,26 +155,48 @@
160
  * @since 2.2
161
  */
162
  function wprss_feed_source_order( $query ) {
163
- if ( ! is_admin() ) {
 
 
164
  return;
165
  }
166
-
167
- $post_type = $query->get('post_type');
168
-
169
- if ( $post_type == 'wprss_feed' ) {
170
- /* Post Column: e.g. title */
171
- if ( $query->get( 'orderby' ) == '' ) {
172
- $query->set( 'orderby', 'title' );
173
- }
174
- /* Post Order: ASC / DESC */
175
- if( $query->get( 'order' ) == '' ){
176
- $query->set( 'order', 'ASC' );
177
- }
178
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  }
180
 
181
 
182
- add_filter( 'manage_wprss_feed_item_posts_columns', 'wprss_set_feed_item_custom_columns');
183
  /**
184
  * Set up the custom columns for the wprss_feed source list
185
  *
@@ -305,6 +322,10 @@
305
  */
306
  function wprss_remove_row_actions( $actions, $post )
307
  {
 
 
 
 
308
  $page = isset( $_GET['paged'] )? '&paged=' . $_GET['paged'] : '';
309
  if ( get_post_type($post) === 'wprss_feed_item' ) {
310
  unset( $actions[ 'edit' ] );
6
  */
7
 
8
 
9
+ add_filter( 'manage_wprss_feed_posts_columns', 'wprss_set_feed_custom_columns', 20, 1 );
10
  /**
11
  * Set up the custom columns for the wprss_feed list
12
  *
18
  'cb' => '<input type="checkbox" />',
19
  'errors' => '',
20
  'title' => __( 'Name', 'wprss' ),
 
 
 
21
  );
22
 
23
  $columns = apply_filters( 'wprss_set_feed_custom_columns', $columns );
45
  case 'errors':
46
  $errors = get_post_meta( $post_id, 'wprss_error_last_import', true );
47
  $showClass = ( $errors === 'true' )? 'wprss-show' : '';
 
48
  $msg = "This feed source experienced an error during the last feed fetch or validation check. Re-check the feed source URL or check the Error Log in the Debugging page for more details.";
49
  echo "<i title=\"$msg\" class=\"fa fa-warning fa-fw wprss-feed-error-symbol $showClass\"></i>";
50
  break;
 
 
 
 
 
 
 
 
 
 
 
51
  case 'state':
52
  $active = wprss_is_feed_source_active( $post_id );
53
  $text = ( $active )? 'Active' : 'Paused';
82
  if ( $update_interval === wprss_get_default_feed_source_update_interval() || $update_interval === '' ) {
83
  $next_update = wp_next_scheduled( 'wprss_fetch_all_feeds_hook', array() );
84
  }
85
+
86
+ // Update the meta field
87
+ if ( wprss_is_feed_source_active( $post_id ) ) {
88
+ $next_update_text = $next_update === FALSE ? 'None': human_time_diff( $next_update, time() );
89
+ } else {
90
+ $next_update_text = 'Paused';
91
+ }
92
+ update_post_meta( $post_id, 'wprss_next_update', $next_update_text );
93
+
94
  ?>
95
 
96
  <p>
97
  Next update:
98
  <code class="next-update">
99
+ <?php echo $next_update_text; ?>
 
 
 
 
 
 
100
  </code>
101
  </p>
102
 
122
  echo "<i class=\"fa fa-fw fa-refresh fa-spin wprss-updating-feed-icon $showClass\" title=\"Updating feed source\"></i>";
123
  echo '</p>';
124
 
125
+ // Set meta field for items imported
126
+ update_post_meta( $post_id, 'wprss_items_imported', $items->post_count );
127
+
128
  break;
129
  }
130
  }
131
 
132
 
133
+ add_filter( "manage_edit-wprss_feed_sortable_columns", "wprss_feed_sortable_columns" );
134
  /**
135
  * Make the custom columns sortable for wprss_feed post type
136
  *
139
  function wprss_feed_sortable_columns() {
140
  $sortable_columns = array(
141
  // meta column id => sortby value used in query
142
+ 'title' => 'title',
143
+ 'updates' => 'updates',
144
+ 'state' => 'state',
145
+ 'feed-count' => 'feed-count'
146
  );
147
  return apply_filters( 'wprss_feed_sortable_columns', $sortable_columns );
148
  }
155
  * @since 2.2
156
  */
157
  function wprss_feed_source_order( $query ) {
158
+ // Check if the query is being processed in WP Admin, is the main query, and is targetted
159
+ // for the wprss_feed CPT. If not, stop
160
+ if ( !is_admin() || !$query->is_main_query() || $query->get('post_type') !== 'wprss_feed' ) {
161
  return;
162
  }
163
+ // Check if the orderby query variable is set
164
+ if ( !( $orderby = $query->get( 'orderby' ) ) ) return;
165
+
166
+ // We will be sorting using the meta value (unless sorting by title)
167
+ $query->set('orderby', 'meta_value' );
168
+ // Get the current order
169
+ $order = strtoupper( $query->get( 'order' ) );
170
+ // Check if it is valid
171
+ $got_order = $order === 'ASC' || $order === 'DESC';
172
+
173
+ // Check what we are sorting by
174
+ switch ( $orderby ) {
175
+ case 'title':
176
+ $query->set( 'orderby', 'title' );
177
+ break;
178
+ case 'state':
179
+ $query->set('meta_key', 'wprss_state');
180
+ break;
181
+ case 'updates':
182
+ $query->set('meta_key', 'wprss_next_update');
183
+ $query->set('orderby', 'meta_value' );
184
+ if ( !$got_order ) $query->set( 'order', 'ASC' );
185
+ break;
186
+ case 'feed-count':
187
+ $query->set('meta_key', 'wprss_items_imported');
188
+ $query->set('orderby', 'meta_value_num' );
189
+ if ( !$got_order ) $query->set( 'order', 'DESC' );
190
+ break;
191
+ }
192
+
193
+ if ( !$got_order ){
194
+ $query->set( 'order', 'ASC' );
195
+ }
196
  }
197
 
198
 
199
+ add_filter( 'manage_wprss_feed_item_posts_columns', 'wprss_set_feed_item_custom_columns', 20, 1 );
200
  /**
201
  * Set up the custom columns for the wprss_feed source list
202
  *
322
  */
323
  function wprss_remove_row_actions( $actions, $post )
324
  {
325
+ $actions = array_reverse( $actions );
326
+ $actions['id'] = "<span class='wprss-row-id'>ID: $post->ID</span>";
327
+ $actions = array_reverse( $actions );
328
+
329
  $page = isset( $_GET['paged'] )? '&paged=' . $_GET['paged'] : '';
330
  if ( get_post_type($post) === 'wprss_feed_item' ) {
331
  unset( $actions[ 'edit' ] );
includes/admin-heartbeat.php CHANGED
@@ -33,6 +33,8 @@ function wprss_feed_source_updates() {
33
  // Add the number of imported items
34
  $items = wprss_get_feed_items_for_source( $feed_id );
35
  $feed_source_data['items'] = $items->post_count;
 
 
36
 
37
  // Add the next update time
38
  $next_update = wprss_get_next_feed_source_update( $feed_id );
@@ -51,6 +53,8 @@ function wprss_feed_source_updates() {
51
  else {
52
  $feed_source_data['next-update'] = human_time_diff( $next_update, time() );
53
  }
 
 
54
 
55
  // Add the last update information
56
  $last_update = get_post_meta( $feed_id, 'wprss_last_update', TRUE );
33
  // Add the number of imported items
34
  $items = wprss_get_feed_items_for_source( $feed_id );
35
  $feed_source_data['items'] = $items->post_count;
36
+ // Update the meta field
37
+ update_post_meta( $feed_id, 'wprss_items_imported', $items->post_count );
38
 
39
  // Add the next update time
40
  $next_update = wprss_get_next_feed_source_update( $feed_id );
53
  else {
54
  $feed_source_data['next-update'] = human_time_diff( $next_update, time() );
55
  }
56
+ // Update the meta field
57
+ update_post_meta( $feed_id, 'wprss_next_update', $feed_source_data['next-update'] );
58
 
59
  // Add the last update information
60
  $last_update = get_post_meta( $feed_id, 'wprss_last_update', TRUE );
includes/admin-metaboxes.php CHANGED
@@ -97,7 +97,7 @@
97
  // Field Array
98
  $wprss_meta_fields[ 'url' ] = array(
99
  'label' => __( 'URL', 'wprss' ),
100
- 'desc' => __( 'Enter feed URL (including http://)', 'wprss' ),
101
  'id' => $prefix .'url',
102
  'type' => 'url',
103
  'after' => 'wprss_validate_feed_link',
@@ -114,14 +114,14 @@
114
 
115
  $wprss_meta_fields[ 'limit' ] = array(
116
  'label' => __( 'Limit', 'wprss' ),
117
- 'desc' => __( 'Enter a feed item import/display limit. Leave blank to use the default setting.', 'wprss' ),
118
  'id' => $prefix . 'limit',
119
  'type' => 'number'
120
  );
121
 
122
  $wprss_meta_fields[ 'enclosure' ] = array(
123
  'label' => __( 'Link to enclosure', 'wprss' ),
124
- 'desc' => __( 'Check this box to link the feed item title to the enclosure link in the feed.', 'wprss' ),
125
  'id' => $prefix . 'enclosure',
126
  'type' => 'checkbox'
127
  );
@@ -169,21 +169,21 @@
169
  // text/url
170
  case 'url':
171
  case 'text':
172
- echo '<input type="'.$field['type'].'" name="'.$field['id'].'" id="'.$field['id'].'" value="'. esc_attr( $meta ) .'" placeholder="'.__($field['placeholder'], 'wprss').'" size="55" />
173
- <br><span class="description">'.$field['desc'].'</span>';
174
  break;
175
 
176
  // textarea
177
  case 'textarea':
178
  echo '<textarea name="'.$field['id'].'" id="'.$field['id'].'" cols="60" rows="4">'. esc_attr( $meta ) .'</textarea>
179
- <br><span class="description">'.$field['desc'].'</span>';
180
  break;
181
 
182
  // checkbox
183
  case 'checkbox':
184
  echo '<input type="hidden" name="'.$field['id'].'" value="false" />';
185
  echo '<input type="checkbox" name="'.$field['id'].'" id="'.$field['id'].'" value="true" ', checked( $meta, 'true' ), ' />
186
- <label for="'.$field['id'].'">'.$field['desc'].'</label>';
187
  break;
188
 
189
  // select
@@ -192,13 +192,13 @@
192
  foreach ($field['options'] as $option) {
193
  echo '<option', $meta == $option['value'] ? ' selected="selected"' : '', ' value="'.$option['value'].'">'.$option['label'].'</option>';
194
  }
195
- echo '</select><br><span class="description">'.$field['desc'].'</span>';
196
  break;
197
 
198
  // number
199
  case 'number':
200
  echo '<input class="wprss-number-roller" type="number" placeholder="Default" min="0" name="'.$field['id'].'" id="'.$field['id'].'" value="'.esc_attr( $meta ).'" />
201
- <label for="'.$field['id'].'"><span class="description">'.$field['desc'].'</span></label>';
202
 
203
  break;
204
 
@@ -226,7 +226,7 @@
226
  // When the DOM is ready
227
  $(document).ready( function(){
228
  // Move the link immediately after the url text field, and add the click event handler
229
- $('#validate-feed-link').insertAfter('#wprss_url').click(function(e){
230
  // Get the url and proceed only if the url is not empty
231
  var url = $('#wprss_url').val();
232
  if ( url.trim().length > 0 ) {
@@ -240,7 +240,8 @@
240
  e.preventDefault();
241
  e.stopPropagation();
242
  return false;
243
- });
 
244
  });
245
  })(jQuery);
246
  </script>
97
  // Field Array
98
  $wprss_meta_fields[ 'url' ] = array(
99
  'label' => __( 'URL', 'wprss' ),
100
+ 'desc' => __( 'Enter the RSS feed URL (including http://)', 'wprss' ),
101
  'id' => $prefix .'url',
102
  'type' => 'url',
103
  'after' => 'wprss_validate_feed_link',
114
 
115
  $wprss_meta_fields[ 'limit' ] = array(
116
  'label' => __( 'Limit', 'wprss' ),
117
+ 'desc' => __( 'Enter the maximum number of items to import.', 'wprss' ),
118
  'id' => $prefix . 'limit',
119
  'type' => 'number'
120
  );
121
 
122
  $wprss_meta_fields[ 'enclosure' ] = array(
123
  'label' => __( 'Link to enclosure', 'wprss' ),
124
+ 'desc' => __( 'Check this box to make the feed items link to their enclosure in the feed.', 'wprss' ),
125
  'id' => $prefix . 'enclosure',
126
  'type' => 'checkbox'
127
  );
169
  // text/url
170
  case 'url':
171
  case 'text':
172
+ echo '<input type="'.$field['type'].'" name="'.$field['id'].'" id="'.$field['id'].'" value="'. esc_attr( $meta ) .'" placeholder="'.__($field['placeholder'], 'wprss').'" class="wprss-text-input"/>
173
+ <label for="'.$field['id'].'" class="description">'.$field['desc'].'</label>';
174
  break;
175
 
176
  // textarea
177
  case 'textarea':
178
  echo '<textarea name="'.$field['id'].'" id="'.$field['id'].'" cols="60" rows="4">'. esc_attr( $meta ) .'</textarea>
179
+ <br/><label for="'.$field['id'].'" class="description">'.$field['desc'].'</label>';
180
  break;
181
 
182
  // checkbox
183
  case 'checkbox':
184
  echo '<input type="hidden" name="'.$field['id'].'" value="false" />';
185
  echo '<input type="checkbox" name="'.$field['id'].'" id="'.$field['id'].'" value="true" ', checked( $meta, 'true' ), ' />
186
+ <label for="'.$field['id'].'" class="description">'.$field['desc'].'</label>';
187
  break;
188
 
189
  // select
192
  foreach ($field['options'] as $option) {
193
  echo '<option', $meta == $option['value'] ? ' selected="selected"' : '', ' value="'.$option['value'].'">'.$option['label'].'</option>';
194
  }
195
+ echo '</select><br/><label for="'.$field['id'].'" class="description">'.$field['desc'].'</label>';
196
  break;
197
 
198
  // number
199
  case 'number':
200
  echo '<input class="wprss-number-roller" type="number" placeholder="Default" min="0" name="'.$field['id'].'" id="'.$field['id'].'" value="'.esc_attr( $meta ).'" />
201
+ <label for="'.$field['id'].'" class="description">'.$field['desc'].'</label>';
202
 
203
  break;
204
 
226
  // When the DOM is ready
227
  $(document).ready( function(){
228
  // Move the link immediately after the url text field, and add the click event handler
229
+ $('#validate-feed-link').click(function(e){
230
  // Get the url and proceed only if the url is not empty
231
  var url = $('#wprss_url').val();
232
  if ( url.trim().length > 0 ) {
240
  e.preventDefault();
241
  e.stopPropagation();
242
  return false;
243
+ })
244
+ .appendTo('td label[for="wprss_url"].description');
245
  });
246
  })(jQuery);
247
  </script>
includes/admin.php CHANGED
@@ -89,7 +89,7 @@
89
  * @return void
90
  */
91
  function wprss_change_title_text() {
92
- return __( 'Enter feed name here (e.g. WP Mayor)', 'wprss' );
93
  }
94
 
95
 
89
  * @return void
90
  */
91
  function wprss_change_title_text() {
92
+ return __( 'Name this feed (e.g. WP Mayor)', 'wprss' );
93
  }
94
 
95
 
includes/cpt-feeds.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_action( 'wp_head', 'wprss_cpt_feeds' );
4
+ /**
5
+ * Adds Link tags to the head of the page, for CPTs' feeds.
6
+ */
7
+ function wprss_cpt_feeds() {
8
+ // Get all post types
9
+ $post_types = get_post_types(array(
10
+ 'public' => true,
11
+ '_builtin' => false
12
+ ));
13
+
14
+ // If current page is archive page for a particular post type
15
+ if ( is_post_type_archive() ) {
16
+ // Remove post type from the post types list
17
+ unset( $post_types[ get_post_type() ] );
18
+ }
19
+
20
+ // Filter which post types to use
21
+ // False: none
22
+ // True: all
23
+ // Array: particular post types
24
+ // String: Single post type
25
+ $post_type_feeds = apply_filters( 'wprss_cpt_feeds', FALSE );
26
+ switch( gettype( $post_type_feeds ) ) {
27
+ // If it's a boolean ...
28
+ case 'boolean':
29
+ // If it is FALSE, exit function. Do nothing. Simply.
30
+ if ( $post_type_feeds === FALSE ) return;
31
+ // Otherwise, if TRUE, no further action is needed.
32
+ break;
33
+ // If it's a string ...
34
+ case 'string':
35
+ // If the post type does not exist, stop
36
+ if ( !isset( $post_types[ $post_type_feeds ] ) ) return;
37
+ // Otherwise, only use this post type
38
+ $single = $post_types[ $post_type_feeds ];
39
+ $post_types = array( $single => $single );
40
+ break;
41
+ // If it's an array ...
42
+ case 'array':
43
+ $post_types = array_intersect($post_types, $post_type_feeds);
44
+ break;
45
+ // If any other type, stop.
46
+ default: return;
47
+ }
48
+
49
+ // Get only the values of the post types
50
+ $post_types = array_values( $post_types );
51
+
52
+ // Get the site name and RSS feed URL, parsed as an array
53
+ $siteName = get_bloginfo("name");
54
+ $feedURL = parse_url( get_bloginfo( 'rss2_url' ) );
55
+
56
+ // Foreach post type
57
+ foreach ( $post_types as $i => $post_type ) {
58
+ // Get its RSS feed URL
59
+ $feed = get_post_type_archive_feed_link( $post_type );
60
+
61
+ // If it doesnt have one, use the interal WP feed URL using the post_type query arg
62
+ if ( $feed === '' || !is_string( $feed ) ) {
63
+ // Start with the feed URL of the site
64
+ $feed = $feedURL;
65
+ // If there are no query args, set to an emprty string
66
+ if ( !isset( $feed['query'] ) )
67
+ $feed['query'] = '';
68
+ // If the query is not empty, we need to add an ampersand
69
+ if ( strlen( $feed['query'] ) > 0 )
70
+ $feed['query'] .= '&';
71
+ // Add the post_type query arg
72
+ $feed['query'] .= "post_type=$post_type";
73
+ // Unparse the URL array into a string
74
+ $feed = unparse_url( $feed );
75
+ }
76
+
77
+ // Get the Post Type Pretty Name
78
+ $obj = get_post_type_object( $post_type );
79
+ $name = $obj->labels->name;
80
+
81
+ // Print the <link> tag
82
+ $feedname = sprintf( __( '%1$s &raquo; %2$s Feed', 'wprss' ), $siteName, $name );
83
+ printf( __( '<link rel="%1$s" type="%2$s" title="%3$s" href="%4$s" />'."\n", 'wprss' ),"alternate","application/rss+xml", $feedname, $feed );
84
+ }
85
+ }
86
+
87
+
88
+ if ( !function_exists('unparse_url') ) {
89
+ function unparse_url( $parsed_url ) {
90
+ $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
91
+ $host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
92
+ $port = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
93
+ $user = isset($parsed_url['user']) ? $parsed_url['user'] : '';
94
+ $pass = isset($parsed_url['pass']) ? ':' . $parsed_url['pass'] : '';
95
+ $pass = ($user || $pass) ? "$pass@" : '';
96
+ $path = isset($parsed_url['path']) ? $parsed_url['path'] : '';
97
+ $query = isset($parsed_url['query']) ? '?' . $parsed_url['query'] : '';
98
+ $fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : '';
99
+ return "$scheme$user$pass$host$port$path$query$fragment";
100
+ }
101
+ }
includes/feed-importing.php CHANGED
@@ -358,7 +358,8 @@
358
  * @since 3.0
359
  */
360
  function wprss_items_insert_post( $items, $feed_ID ) {
361
-
 
362
  // Gather the permalinks of existing feed item's related to this feed source
363
  $existing_permalinks = get_existing_permalinks( $feed_ID );
364
 
@@ -391,6 +392,9 @@
391
  // Apply filters that determine if the feed item should be inserted into the DB or not.
392
  $item = apply_filters( 'wprss_insert_post_item_conditionals', $item, $feed_ID, $permalink );
393
 
 
 
 
394
  // If the item is not NULL, continue to inserting the feed item post into the DB
395
  if ( $item !== NULL && !is_bool($item) ) {
396
 
@@ -442,7 +446,7 @@
442
  }
443
  // If the item is TRUE, then a hook function in the filter inserted the item.
444
  // increment the inserted counter
445
- elseif ( is_bool($item) && $item === TRUE ) {
446
  $items_inserted++;
447
  }
448
  }
@@ -462,7 +466,6 @@
462
  function wprss_items_insert_post_meta( $inserted_ID, $item, $feed_ID, $permalink, $enclosure_url ) {
463
  update_post_meta( $inserted_ID, 'wprss_item_permalink', $permalink );
464
  update_post_meta( $inserted_ID, 'wprss_item_enclosure', $enclosure_url );
465
- update_post_meta( $inserted_ID, 'wprss_item_description', $item->get_description() );
466
  update_post_meta( $inserted_ID, 'wprss_item_date', $item->get_date( 'U' ) ); // Save as Unix timestamp format
467
 
468
  $author = $item->get_author();
358
  * @since 3.0
359
  */
360
  function wprss_items_insert_post( $items, $feed_ID ) {
361
+ update_post_meta( $feed_ID, 'wprss_feed_is_updating', time() );
362
+
363
  // Gather the permalinks of existing feed item's related to this feed source
364
  $existing_permalinks = get_existing_permalinks( $feed_ID );
365
 
392
  // Apply filters that determine if the feed item should be inserted into the DB or not.
393
  $item = apply_filters( 'wprss_insert_post_item_conditionals', $item, $feed_ID, $permalink );
394
 
395
+ // Check if the imported count should still be updated, even if the item is NULL
396
+ $still_update_count = apply_filters( 'wprss_still_update_import_count', FALSE );
397
+
398
  // If the item is not NULL, continue to inserting the feed item post into the DB
399
  if ( $item !== NULL && !is_bool($item) ) {
400
 
446
  }
447
  // If the item is TRUE, then a hook function in the filter inserted the item.
448
  // increment the inserted counter
449
+ elseif ( ( is_bool($item) && $item === TRUE ) || $still_update_count === TRUE ) {
450
  $items_inserted++;
451
  }
452
  }
466
  function wprss_items_insert_post_meta( $inserted_ID, $item, $feed_ID, $permalink, $enclosure_url ) {
467
  update_post_meta( $inserted_ID, 'wprss_item_permalink', $permalink );
468
  update_post_meta( $inserted_ID, 'wprss_item_enclosure', $enclosure_url );
 
469
  update_post_meta( $inserted_ID, 'wprss_item_date', $item->get_date( 'U' ) ); // Save as Unix timestamp format
470
 
471
  $author = $item->get_author();
includes/feed-processing.php CHANGED
@@ -339,7 +339,7 @@
339
 
340
  $diff = time() - $is_updating_meta;
341
 
342
- if ( $diff > 300 ) {
343
  delete_post_meta( $id, 'wprss_feed_is_updating' );
344
  return FALSE;
345
  }
339
 
340
  $diff = time() - $is_updating_meta;
341
 
342
+ if ( $diff > 30 ) {
343
  delete_post_meta( $id, 'wprss_feed_is_updating' );
344
  return FALSE;
345
  }
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: 4.0
8
- Stable tag: 4.5.2
9
  License: GPLv2 or later
10
  The no.1 RSS feed importer for WordPress. Premium add-ons available for more functionality.
11
 
@@ -165,6 +165,16 @@ The full documentation section can be found on the [WP RSS Aggregator website](w
165
 
166
  == Changelog ==
167
 
 
 
 
 
 
 
 
 
 
 
168
  = 4.5.2 (2014-09-09) =
169
  * Enhanced: Optimized plugin for WordPress 4.0.
170
  * Enhanced: Improved template and added filters for add-on hooking.
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: 4.0
8
+ Stable tag: 4.5.3
9
  License: GPLv2 or later
10
  The no.1 RSS feed importer for WordPress. Premium add-ons available for more functionality.
11
 
165
 
166
  == Changelog ==
167
 
168
+ = 4.5.3 (2014-09-15) =
169
+ * New Featured: Added filter to allow adding RSS feeds to the head of your site's pages for CPTs.
170
+ * Enhanced: Columns in the feed sources table are now sortable.
171
+ * Enhanced: Removed the ID column in the feed sources table. The ID has been moved as a row action.
172
+ * Enhanced: Improved various interface elements.
173
+ * Enhanced: Better responsiveness for smaller screen.
174
+ * Fixed bug: The importing spinning icon would get stuck and spin for a very long time.
175
+ * Fixed bug: Removed an old description meta field.
176
+ * Fixed bug: Plugin was not removing all scheduled cron jobs when deactivated.
177
+
178
  = 4.5.2 (2014-09-09) =
179
  * Enhanced: Optimized plugin for WordPress 4.0.
180
  * Enhanced: Improved template and added filters for add-on hooking.
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.5.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.5.2
33
  * @since 1.0
34
  * @author Jean Galea <info@wprssaggregator.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.5.2', true );
47
 
48
  // Set the database version number of the plugin.
49
  if( !defined( 'WPRSS_DB_VERSION' ) )
@@ -128,6 +128,9 @@
128
  /* Load the custom feed file */
129
  require_once ( WPRSS_INC . 'custom-feed.php' );
130
 
 
 
 
131
  /* Load the cron job scheduling functions. */
132
  require_once ( WPRSS_INC . 'cron-jobs.php' );
133
 
@@ -402,10 +405,21 @@
402
  * @since 1.0
403
  */
404
  function wprss_deactivate() {
405
- // On deactivation remove the cron job
406
- if ( wp_next_scheduled( 'wprss_fetch_all_feeds_hook' ) ) {
407
- wp_clear_scheduled_hook( 'wprss_fetch_all_feeds_hook' );
 
 
 
 
 
 
 
 
 
 
408
  }
 
409
  flush_rewrite_rules();
410
  }
411
 
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.5.3
7
  Author: Jean Galea
8
  Author URI: http://www.wprssaggregator.com
9
  License: GPLv2
29
 
30
  /**
31
  * @package WPRSSAggregator
32
+ * @version 4.5.3
33
  * @since 1.0
34
  * @author Jean Galea <info@wprssaggregator.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.5.3', true );
47
 
48
  // Set the database version number of the plugin.
49
  if( !defined( 'WPRSS_DB_VERSION' ) )
128
  /* Load the custom feed file */
129
  require_once ( WPRSS_INC . 'custom-feed.php' );
130
 
131
+ /* Load the custom post type feeds file */
132
+ require_once ( WPRSS_INC . 'cpt-feeds.php' );
133
+
134
  /* Load the cron job scheduling functions. */
135
  require_once ( WPRSS_INC . 'cron-jobs.php' );
136
 
405
  * @since 1.0
406
  */
407
  function wprss_deactivate() {
408
+ // On deactivation remove the cron job
409
+ wp_clear_scheduled_hook( 'wprss_fetch_all_feeds_hook' );
410
+ wp_clear_scheduled_hook( 'wprss_truncate_posts_hook' );
411
+ // Uschedule cron jobs for all feed sources
412
+ $feed_sources = wprss_get_all_feed_sources();
413
+ if( $feed_sources->have_posts() ) {
414
+ // For each feed source
415
+ while ( $feed_sources->have_posts() ) {
416
+ // Stop its cron job
417
+ $feed_sources->the_post();
418
+ wprss_feed_source_update_stop_schedule( get_the_ID() );
419
+ }
420
+ wp_reset_postdata();
421
  }
422
+ // Flush the rewrite rules
423
  flush_rewrite_rules();
424
  }
425