WP RSS Aggregator - Version 4.6.3

Version Description

(2014-11-3) = Enhanced: Re-added the "Add New" link in the plugin's menu. Enhanced: Improved error logging. Enhanced: Bulk actions in the Feed Sources page are now also included in the bottom dropdown menu. Fixed bug: Add-on updater was prone to conflicts. Now enclosed in an action. Fixed bug: The Full Text RSS Feeds add-on was not showing as active in the "Add-ons" page. Fixed bug: Broken links in the "Add-ons" page, to add-on pages on our site.

Download this release

Release Info

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

Code changes from version 4.6.2 to 4.6.3

changelog.txt CHANGED
@@ -1,3 +1,11 @@
 
 
 
 
 
 
 
 
1
  4.6.2 (2014-10-15)
2
  Enhanced: Improved plugin responsiveness.
3
  Enhanced: Updated some help text in tooltips with better explainations and added clarity.
1
+ 4.6.3 (2014-11-3)
2
+ Enhanced: Re-added the "Add New" link in the plugin's menu.
3
+ Enhanced: Improved error logging.
4
+ Enhanced: Bulk actions in the Feed Sources page are now also included in the bottom dropdown menu.
5
+ Fixed bug: Add-on updater was prone to conflicts. Now enclosed in an action.
6
+ Fixed bug: The Full Text RSS Feeds add-on was not showing as active in the "Add-ons" page.
7
+ Fixed bug: Broken links in the "Add-ons" page, to add-on pages on our site.
8
+
9
  4.6.2 (2014-10-15)
10
  Enhanced: Improved plugin responsiveness.
11
  Enhanced: Updated some help text in tooltips with better explainations and added clarity.
includes/admin-addons.php CHANGED
@@ -12,42 +12,42 @@
12
  $premium[] = array(
13
  'title' => __( "Excerpts & Thumbnails", WPRSS_TEXT_DOMAIN ),
14
  'description' => __( "Adds the ability to display thumbnails and excerpts. Perfect for adding some life and color to your feed item display. For more flexibility Feed to Post is a better option.", WPRSS_TEXT_DOMAIN ),
15
- 'thumbnail' => WPRSS_IMG .'add-ons/wprss.jpg',
16
  'active' => is_plugin_active( 'wp-rss-excerpts-thumbnails/wp-rss-excerpts-thumbnails.php' ),
17
- 'url' => 'http://www.wprssaggregator.com/extensions/excerpts-thumbnails/'
18
  );
19
  $premium[] = array(
20
  'title' => __( "Categories", WPRSS_TEXT_DOMAIN ),
21
  'description' => __( "Assign categories to your feed sources. Then display a particular category or multiple categories on a post or page via shortcodes.", WPRSS_TEXT_DOMAIN ),
22
- 'thumbnail' => WPRSS_IMG .'add-ons/wprss.jpg',
23
  'active' => is_plugin_active( 'wp-rss-categories/wp-rss-categories.php' ),
24
- 'url' => 'http://www.wprssaggregator.com/extensions/categories/'
25
  );
26
  $premium[] = array(
27
  'title' => __( "Keyword Filtering", WPRSS_TEXT_DOMAIN ),
28
  'description' => __( "Import feeds that contain specific keywords in either the title or their content. Control what gets imported to your blog. You can use keywords, keyphrases and categories.", WPRSS_TEXT_DOMAIN ),
29
- 'thumbnail' => WPRSS_IMG .'add-ons/wprss.jpg',
30
  'active' => is_plugin_active( 'wp-rss-keyword-filtering/wp-rss-keyword-filtering.php' ),
31
- 'url' => 'http://www.wprssaggregator.com/extensions/keyword-filtering/'
32
  );
33
  $premium[] = array(
34
  'title' => __( "Feed to Post", WPRSS_TEXT_DOMAIN ),
35
  'description' => __( "Allows you to import feed items into posts or any other custom post type that you have created. Takes WP RSS Aggregator to a whole new level of flexibility.", WPRSS_TEXT_DOMAIN ),
36
- 'thumbnail' => WPRSS_IMG .'add-ons/wprss.jpg',
37
  'active' => is_plugin_active( 'wp-rss-feed-to-post/wp-rss-feed-to-post.php' ),
38
- 'url' => 'http://www.wprssaggregator.com/extensions/feed-to-post/'
39
  );
40
  $premium[] = array(
41
  'title' => __( "Full Text RSS Feeds", WPRSS_TEXT_DOMAIN ),
42
  'description' => __( "This add-ons provides the connectivity to our Full Text Premium service, which gives you unlimited feed items returned per feed source.", WPRSS_TEXT_DOMAIN ),
43
- 'thumbnail' => WPRSS_IMG .'add-ons/wprss.jpg',
44
- 'active' => is_plugin_active( 'wp-rss-full-text-feeds/wp-rss-full-text.php' ),
45
  'url' => 'http://www.wprssaggregator.com/extension/full-text-rss-feeds/'
46
  );
47
  $premium[] = array(
48
  'title' => __( "WordAi", WPRSS_TEXT_DOMAIN ),
49
  'description' => __( "Allows you to spin the content for posts imported by Feed to Post using WordAi. Cleverly rewrite your posts without changing their meaning and maintaining human readability.", WPRSS_TEXT_DOMAIN ),
50
- 'thumbnail' => WPRSS_IMG .'add-ons/wprss.jpg',
51
  'active' => is_plugin_active( 'wp-rss-wordai/wp-rss-wordai.php' ),
52
  'url' => 'http://www.wprssaggregator.com/extension/wordai/'
53
  );
12
  $premium[] = array(
13
  'title' => __( "Excerpts & Thumbnails", WPRSS_TEXT_DOMAIN ),
14
  'description' => __( "Adds the ability to display thumbnails and excerpts. Perfect for adding some life and color to your feed item display. For more flexibility Feed to Post is a better option.", WPRSS_TEXT_DOMAIN ),
15
+ 'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
16
  'active' => is_plugin_active( 'wp-rss-excerpts-thumbnails/wp-rss-excerpts-thumbnails.php' ),
17
+ 'url' => 'http://www.wprssaggregator.com/extension/excerpts-thumbnails/'
18
  );
19
  $premium[] = array(
20
  'title' => __( "Categories", WPRSS_TEXT_DOMAIN ),
21
  'description' => __( "Assign categories to your feed sources. Then display a particular category or multiple categories on a post or page via shortcodes.", WPRSS_TEXT_DOMAIN ),
22
+ 'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
23
  'active' => is_plugin_active( 'wp-rss-categories/wp-rss-categories.php' ),
24
+ 'url' => 'http://www.wprssaggregator.com/extension/categories/'
25
  );
26
  $premium[] = array(
27
  'title' => __( "Keyword Filtering", WPRSS_TEXT_DOMAIN ),
28
  'description' => __( "Import feeds that contain specific keywords in either the title or their content. Control what gets imported to your blog. You can use keywords, keyphrases and categories.", WPRSS_TEXT_DOMAIN ),
29
+ 'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
30
  'active' => is_plugin_active( 'wp-rss-keyword-filtering/wp-rss-keyword-filtering.php' ),
31
+ 'url' => 'http://www.wprssaggregator.com/extension/keyword-filtering/'
32
  );
33
  $premium[] = array(
34
  'title' => __( "Feed to Post", WPRSS_TEXT_DOMAIN ),
35
  'description' => __( "Allows you to import feed items into posts or any other custom post type that you have created. Takes WP RSS Aggregator to a whole new level of flexibility.", WPRSS_TEXT_DOMAIN ),
36
+ 'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
37
  'active' => is_plugin_active( 'wp-rss-feed-to-post/wp-rss-feed-to-post.php' ),
38
+ 'url' => 'http://www.wprssaggregator.com/extension/feed-to-post/'
39
  );
40
  $premium[] = array(
41
  'title' => __( "Full Text RSS Feeds", WPRSS_TEXT_DOMAIN ),
42
  'description' => __( "This add-ons provides the connectivity to our Full Text Premium service, which gives you unlimited feed items returned per feed source.", WPRSS_TEXT_DOMAIN ),
43
+ 'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
44
+ 'active' => is_plugin_active( 'wp-rss-full-text/wp-rss-full-text.php' ),
45
  'url' => 'http://www.wprssaggregator.com/extension/full-text-rss-feeds/'
46
  );
47
  $premium[] = array(
48
  'title' => __( "WordAi", WPRSS_TEXT_DOMAIN ),
49
  'description' => __( "Allows you to spin the content for posts imported by Feed to Post using WordAi. Cleverly rewrite your posts without changing their meaning and maintaining human readability.", WPRSS_TEXT_DOMAIN ),
50
+ 'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
51
  'active' => is_plugin_active( 'wp-rss-wordai/wp-rss-wordai.php' ),
52
  'url' => 'http://www.wprssaggregator.com/extension/wordai/'
53
  );
includes/admin-display.php CHANGED
@@ -348,13 +348,13 @@
348
  admin_url( 'edit.php?post_type=wprss_feed_item&wprss_feed=' . $post->ID ),
349
  $post->ID
350
  );
351
- $view_items_text = apply_filters( 'wprss_view_feed_items_row_action_text', 'View items' );
352
  $actions['view-items'] = '<a href="' . $view_items_link . '">' . __( $view_items_text, WPRSS_TEXT_DOMAIN ) . '</a>';
353
 
354
- $fetch_items_row_action_text = apply_filters( 'wprss_fetch_items_row_action_text', 'Fetch items' );
355
  $actions[ 'fetch' ] = '<a href="javascript:;" class="wprss_ajax_action" pid="'. $post->ID .'" purl="'.home_url().'/wp-admin/admin-ajax.php">' . __( $fetch_items_row_action_text, WPRSS_TEXT_DOMAIN ) . '</a>';
356
 
357
- $purge_feeds_row_action_text = apply_filters( 'wprss_purge_feeds_row_action_text', 'Delete items' );
358
  $purge_feeds_row_action_title = apply_filters( 'wprss_purge_feeds_row_action_title', 'Delete feed items imported by this feed source' );
359
  $actions['purge-posts'] = "<a href='".admin_url("edit.php?post_type=wprss_feed&purge-feed-items=" . $post->ID . $page ) . "' title='" . __( $purge_feeds_row_action_title, WPRSS_TEXT_DOMAIN ) . "' >" . __( $purge_feeds_row_action_text, WPRSS_TEXT_DOMAIN ) . "</a>";
360
 
@@ -554,7 +554,7 @@
554
  admin_url( 'edit.php?post_type=wprss_feed_item&wprss_feed=' . get_the_ID() ),
555
  get_the_ID()
556
  );
557
- $view_items_text = apply_filters( 'wprss_view_feed_items_row_action_text', 'View items' );
558
 
559
  // Prepare the link target
560
  $link_target = 'wprss-view-items-' . get_the_ID();
348
  admin_url( 'edit.php?post_type=wprss_feed_item&wprss_feed=' . $post->ID ),
349
  $post->ID
350
  );
351
+ $view_items_text = apply_filters( 'wprss_view_feed_items_row_action_text', 'View Items' );
352
  $actions['view-items'] = '<a href="' . $view_items_link . '">' . __( $view_items_text, WPRSS_TEXT_DOMAIN ) . '</a>';
353
 
354
+ $fetch_items_row_action_text = apply_filters( 'wprss_fetch_items_row_action_text', 'Fetch Items' );
355
  $actions[ 'fetch' ] = '<a href="javascript:;" class="wprss_ajax_action" pid="'. $post->ID .'" purl="'.home_url().'/wp-admin/admin-ajax.php">' . __( $fetch_items_row_action_text, WPRSS_TEXT_DOMAIN ) . '</a>';
356
 
357
+ $purge_feeds_row_action_text = apply_filters( 'wprss_purge_feeds_row_action_text', 'Delete Items' );
358
  $purge_feeds_row_action_title = apply_filters( 'wprss_purge_feeds_row_action_title', 'Delete feed items imported by this feed source' );
359
  $actions['purge-posts'] = "<a href='".admin_url("edit.php?post_type=wprss_feed&purge-feed-items=" . $post->ID . $page ) . "' title='" . __( $purge_feeds_row_action_title, WPRSS_TEXT_DOMAIN ) . "' >" . __( $purge_feeds_row_action_text, WPRSS_TEXT_DOMAIN ) . "</a>";
360
 
554
  admin_url( 'edit.php?post_type=wprss_feed_item&wprss_feed=' . get_the_ID() ),
555
  get_the_ID()
556
  );
557
+ $view_items_text = apply_filters( 'wprss_view_feed_items_row_action_text', 'View Items' );
558
 
559
  // Prepare the link target
560
  $link_target = 'wprss-view-items-' . get_the_ID();
includes/admin-log.php CHANGED
@@ -157,6 +157,9 @@
157
  if ( $src === NULL ) {
158
  $callers = debug_backtrace();
159
  $src = $callers[1]['function'];
 
 
 
160
  }
161
  $log_level_label = wprss_log_get_level_label( $log_level );
162
  $date = date( 'd-m-Y H:i:s' );
@@ -250,7 +253,7 @@
250
  if( is_numeric( $_level ) && ($_level/2 >= 1) ) $options[ (int)$_level * -1 ] = $_label . ' and below';
251
  }
252
 
253
- krsort($options, SORT_NATURAL);
254
  ?>
255
  <select id="<?php echo $field['field_id'] ?>" name="wprss_settings_general[<?php echo $field['field_id'] ?>]">
256
  <?php
157
  if ( $src === NULL ) {
158
  $callers = debug_backtrace();
159
  $src = $callers[1]['function'];
160
+ if ( $src === 'wprss_log_obj' ) {
161
+ $src = $callers[2]['function'];
162
+ }
163
  }
164
  $log_level_label = wprss_log_get_level_label( $log_level );
165
  $date = date( 'd-m-Y H:i:s' );
253
  if( is_numeric( $_level ) && ($_level/2 >= 1) ) $options[ (int)$_level * -1 ] = $_label . ' and below';
254
  }
255
 
256
+ krsort($options, defined('SORT_NATURAL' ? SORT_NATURAL : SORT_STRING));
257
  ?>
258
  <select id="<?php echo $field['field_id'] ?>" name="wprss_settings_general[<?php echo $field['field_id'] ?>]">
259
  <?php
includes/admin.php CHANGED
@@ -34,8 +34,9 @@
34
  // Add the admin options pages as submenus to the Feed CPT
35
  function wprss_register_menu_pages() {
36
  global $submenu;
37
- unset( $submenu['edit.php?post_type=wprss_feed'][10] );
38
- //create submenu items
 
39
  add_submenu_page( 'edit.php?post_type=wprss_feed', __( 'Export & Import Settings', WPRSS_TEXT_DOMAIN ), __( 'Import & Export', WPRSS_TEXT_DOMAIN ), apply_filters( 'wprss_capability', 'manage_feed_settings' ), 'wprss-import-export-settings', 'wprss_import_export_settings_page_display' );
40
  add_submenu_page( 'edit.php?post_type=wprss_feed', __( 'WP RSS Aggregator Settings', WPRSS_TEXT_DOMAIN ), __( 'Settings', WPRSS_TEXT_DOMAIN ), apply_filters( 'wprss_capability', 'manage_feed_settings' ), 'wprss-aggregator-settings', 'wprss_settings_page_display' );
41
  add_submenu_page( 'edit.php?post_type=wprss_feed', __( 'Debugging', WPRSS_TEXT_DOMAIN ), __( 'Debugging', WPRSS_TEXT_DOMAIN ), apply_filters( 'wprss_capability', 'manage_feed_settings'), 'wprss-debugging', 'wprss_debugging_page_display' );
34
  // Add the admin options pages as submenus to the Feed CPT
35
  function wprss_register_menu_pages() {
36
  global $submenu;
37
+ // Uncomment line below to hide "Add New" link from menu
38
+ // unset( $submenu['edit.php?post_type=wprss_feed'][10] );
39
+ // create submenu items
40
  add_submenu_page( 'edit.php?post_type=wprss_feed', __( 'Export & Import Settings', WPRSS_TEXT_DOMAIN ), __( 'Import & Export', WPRSS_TEXT_DOMAIN ), apply_filters( 'wprss_capability', 'manage_feed_settings' ), 'wprss-import-export-settings', 'wprss_import_export_settings_page_display' );
41
  add_submenu_page( 'edit.php?post_type=wprss_feed', __( 'WP RSS Aggregator Settings', WPRSS_TEXT_DOMAIN ), __( 'Settings', WPRSS_TEXT_DOMAIN ), apply_filters( 'wprss_capability', 'manage_feed_settings' ), 'wprss-aggregator-settings', 'wprss_settings_page_display' );
42
  add_submenu_page( 'edit.php?post_type=wprss_feed', __( 'Debugging', WPRSS_TEXT_DOMAIN ), __( 'Debugging', WPRSS_TEXT_DOMAIN ), apply_filters( 'wprss_capability', 'manage_feed_settings'), 'wprss-debugging', 'wprss_debugging_page_display' );
includes/feed-processing.php CHANGED
@@ -575,6 +575,7 @@
575
  * Deletes N oldest feed items for the given source
576
  *
577
  * @since 4.2
 
578
  */
579
  function wprss_delete_oldest_feed_items( $n, $source ) {
580
  // If the source does not exist, do nothing
@@ -609,6 +610,7 @@
609
  * to keep the number of feed items below its limit.
610
  *
611
  * @since 4.2
 
612
  */
613
  function wprss_truncate_feed_items_for_source( $source ) {
614
  // Get the limit setting
575
  * Deletes N oldest feed items for the given source
576
  *
577
  * @since 4.2
578
+ * @deprecated
579
  */
580
  function wprss_delete_oldest_feed_items( $n, $source ) {
581
  // If the source does not exist, do nothing
610
  * to keep the number of feed items below its limit.
611
  *
612
  * @since 4.2
613
+ * @deprecated
614
  */
615
  function wprss_truncate_feed_items_for_source( $source ) {
616
  // Get the limit setting
includes/feed-states.php CHANGED
@@ -42,9 +42,9 @@
42
  */
43
  function wprss_bulk_change_state() {
44
  // If the id and state are in POST data
45
- if ( isset( $_GET['post_type'] ) && isset( $_GET['action'] ) && isset( $_GET['post'] ) ) {
46
  // Get the action and post ids from GET request
47
- $action = $_GET['action'];
48
  $post_ids = $_GET['post'];
49
 
50
  // check the action
42
  */
43
  function wprss_bulk_change_state() {
44
  // If the id and state are in POST data
45
+ if ( isset( $_GET['post_type'] ) && (isset( $_GET['action'] ) || isset( $_GET['action2'] )) && isset( $_GET['post'] ) ) {
46
  // Get the action and post ids from GET request
47
+ $action = isset($_GET['action']) && $_GET['action'] !== '-1' ? $_GET['action'] : $_GET['action2'];
48
  $post_ids = $_GET['post'];
49
 
50
  // check the action
includes/licensing.php CHANGED
@@ -314,33 +314,39 @@ function wprss_process_addon_license() {
314
  }
315
  }
316
 
 
 
 
 
 
 
 
 
 
317
 
318
- ///////////////////////////////////////\\
319
- //// SET UP UPDATERS \\
320
- //////////////////////////////////////////
321
- $addons = wprss_get_addons();
322
- // retrieve our license key from the DB
323
- $licenses = get_option( 'wprss_settings_license_keys' );
324
-
325
- // setup the updater
326
- if ( !class_exists( 'EDD_SL_Plugin_Updater' ) ) {
327
- // load our custom updater
328
- include ( WPRSS_INC . 'libraries/EDD_licensing/EDD_SL_Plugin_Updater.php' );
329
- }
330
 
331
- // Iterate the addons
332
- foreach( $addons as $id => $name ) {
333
- // Prepare the data
334
- $license = wprss_get_license_key( $id );
335
- $uid = strtoupper( $id );
336
- $name = constant("WPRSS_{$uid}_SL_ITEM_NAME");
337
- $version = constant("WPRSS_{$uid}_VERSION");
338
- $path = constant("WPRSS_{$uid}_PATH");
339
- // Set up an updater
340
- $edd_updater = new EDD_SL_Plugin_Updater( WPRSS_SL_STORE_URL, $path, array(
341
- 'version' => $version, // current version number
342
- 'license' => $license, // license key (used get_option above to retrieve from DB)
343
- 'item_name' => $name, // name of this plugin
344
- 'author' => 'Jean Galea' // author of this plugin
345
- ));
 
 
 
 
 
 
 
346
  }
314
  }
315
  }
316
 
317
+ add_action( 'init', 'wprss_setup_edd_updater' );
318
+ /**
319
+ * Sets up the EDD updater for all registered add-ons.
320
+ *
321
+ * @since 4.6.3
322
+ */
323
+ function wprss_setup_edd_updater() {
324
+ // Get all registered addons
325
+ $addons = wprss_get_addons();
326
 
327
+ // retrieve our license key from the DB
328
+ $licenses = get_option( 'wprss_settings_license_keys' );
 
 
 
 
 
 
 
 
 
 
329
 
330
+ // setup the updater
331
+ if ( !class_exists( 'EDD_SL_Plugin_Updater' ) ) {
332
+ // load our custom updater
333
+ include ( WPRSS_INC . 'libraries/EDD_licensing/EDD_SL_Plugin_Updater.php' );
334
+ }
335
+
336
+ // Iterate the addons
337
+ foreach( $addons as $id => $name ) {
338
+ // Prepare the data
339
+ $license = wprss_get_license_key( $id );
340
+ $uid = strtoupper( $id );
341
+ $name = constant("WPRSS_{$uid}_SL_ITEM_NAME");
342
+ $version = constant("WPRSS_{$uid}_VERSION");
343
+ $path = constant("WPRSS_{$uid}_PATH");
344
+ // Set up an updater
345
+ $edd_updater = new EDD_SL_Plugin_Updater( WPRSS_SL_STORE_URL, $path, array(
346
+ 'version' => $version, // current version number
347
+ 'license' => $license, // license key (used get_option above to retrieve from DB)
348
+ 'item_name' => $name, // name of this plugin
349
+ 'author' => 'Jean Galea' // author of this plugin
350
+ ));
351
+ }
352
  }
includes/misc-functions.php CHANGED
@@ -94,4 +94,208 @@ function wprss_media_sideload_image( $file, $post_id, $desc = null ) {
94
  catch( Exception $e ) {
95
  return "<img src='$file' alt='' />";
96
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  }
94
  catch( Exception $e ) {
95
  return "<img src='$file' alt='' />";
96
  }
97
+ }
98
+
99
+
100
+ /**
101
+ * Trims the given text by a fixed number of words, and preserving HTML.
102
+ *
103
+ * Collapses all white space, trims the text up to a certain number of words, and
104
+ * preserves all HTML markup. HTML tags do not count as words.
105
+ * Uses WordPress `wp_trim_words` internally.
106
+ * Uses mostly trivial regex. Works by removing, then re-adding tags.
107
+ * Just as well closes open tags by counting them.
108
+ *
109
+ * @param string $text The text to trim.
110
+ * @param string $max_words The maximum number of words.
111
+ * @param array $allowed_tags The allows tags. Regular array of tag names.
112
+ * @return string The trimmed text.
113
+ */
114
+ function wprss_trim_words( $text, $max_words, $allowed_tags = array() ) {
115
+ // See http://haacked.com/archive/2004/10/25/usingregularexpressionstomatchhtml.aspx/
116
+ $html_regex = <<<EOS
117
+ (</?(\w+)(?:(?:\s+\w+(?:\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)/?>)
118
+ EOS;
119
+ $html_regex_str = sprintf ('!%1$s!', $html_regex );
120
+ // Collapsing single-line white space
121
+ $text = preg_replace( '!\s+!', ' ', $text );
122
+
123
+ // Enum of tag types
124
+ $tag_type = array(
125
+ 'opening' => 1,
126
+ 'closing' => 2,
127
+ 'self-closing' => 0
128
+ );
129
+
130
+ /*
131
+ * Split text using tags as delimiters.
132
+ * The resulting array is a sequence of elements as follows:
133
+ * 0 - The complete tag that it was delimited by
134
+ * 1 - The name of that tag
135
+ * 2 - The text that follows it until the next tag
136
+ *
137
+ * Each element contains 2 indexes:
138
+ * 0 - The element content
139
+ * 1 - The position in the original string, at which it was found
140
+ *
141
+ * For instance:
142
+ * <span>hello</span> how do <em>you do</em>?
143
+ *
144
+ * Will result in an array (not actaul structure) containing:
145
+ * <span>, span, hello, </span>, span, how do, <em>, em, you do, </em>, em, ?
146
+ */
147
+ $text_array = preg_split(
148
+ $html_regex_str, // Match HTML Regex above
149
+ $text, // Split the text
150
+ -1, // No split limit
151
+ // FLAGS
152
+ PREG_SPLIT_DELIM_CAPTURE // Capture delimiters (html tags)
153
+ | PREG_SPLIT_OFFSET_CAPTURE // Record the string offset of each part
154
+ );
155
+ /*
156
+ * Get first element of the array (leading text with no HTML), and add it to a string.
157
+ * This string will contain the plain text (no HTML) only after the follow foreach loop.
158
+ */
159
+ $text_start = array_shift( $text_array );
160
+ $plain_text = $text_start[0];
161
+
162
+ /*
163
+ * Chunk the array in groups of 3. This will take each 3 consecutive elements
164
+ * and group them together.
165
+ */
166
+ $pieces = array_chunk( $text_array, 3 );
167
+
168
+
169
+ /*
170
+ * Iterate over each group and:
171
+ * 1. Generate plain text without HTML
172
+ * 2. Add apropriate tag type to each group
173
+ */
174
+ foreach ( $pieces as $_idx => $_piece ) {
175
+ // Get the data
176
+ $tag_piece = $_piece[0];
177
+ $text_piece = $_piece[2];
178
+ // Compile all plain text together
179
+ $plain_text .= $text_piece[0];
180
+ // Check the tag and assign the proper tag type
181
+ $tag = $tag_piece[0];
182
+ $pieces[ $_idx ][1][2] =
183
+ ( substr( $tag, 0, 2 ) === '</' )?
184
+ $tag_type['closing'] :
185
+ ( substr( $tag, strlen( $tag ) - 3, 2 ) == '/>' )?
186
+ $tag_type['self-closing'] :
187
+ $tag_type['opening'];
188
+ }
189
+
190
+ // Stock trimming of words
191
+ $plain_text = wp_trim_words_wprss( $plain_text, $max_words );
192
+
193
+ /*
194
+ * Put the tags back, using the offsets recorded
195
+ * This is where the sweet magic happens
196
+ */
197
+
198
+ // Cache to only check `in_array` once for each tag type
199
+ $allowed_tags_cache = array();
200
+ // For counting open tags
201
+ $tags_to_close = array();
202
+ // Since some tags will not be included...
203
+ $tag_position_offset = 0;
204
+ $text = $plain_text;
205
+
206
+ // Iterate the groups once more
207
+ foreach ( $pieces as $_idx => $_piece ) {
208
+ // Tag and tagname
209
+ $_tag_piece = $_piece[0];
210
+ $_tag_name_piece = $_piece[1];
211
+ // Name of the tag
212
+ $_tag_name = strtolower( $_tag_name_piece[0] );
213
+ // Tag type
214
+ $_tag_type = $_tag_name_piece[2];
215
+ // Text of the tag
216
+ $_tag = $_tag_piece[0];
217
+ // Position of the tag in the original string
218
+ $_tag_position = $_tag_piece[1];
219
+ $_actual_tag_position = $_tag_position - $tag_position_offset;
220
+
221
+ // Caching result
222
+ if ( !isset( $allowed_tags_cache[$_tag_name] ) )
223
+ $allowed_tags_cache[$_tag_name] = in_array( $_tag_name, $allowed_tags );
224
+
225
+ // Whether to stop (tag position is outside the trimmed text)
226
+ if( $_actual_tag_position >= strlen( $text ) ) break;
227
+
228
+ // Whether to skip tag
229
+ if ( !$allowed_tags_cache[$_tag_name] ) {
230
+ $tag_position_offset += strlen( $_tag ); // To correct for removed chars
231
+ continue;
232
+ }
233
+
234
+ // If the tag is an opening tag, record it in $tags_to_close
235
+ if( $_tag_type === $tag_type['opening'] )
236
+ array_push( $tags_to_close, $_tag_name );
237
+ // If it is a closing tag, remove it from $tags_to_close
238
+ elseif( $_tag_type === $tag_type['closing'] )
239
+ array_pop( $tags_to_close );
240
+
241
+ // Inserting tag back into place
242
+ $text = substr_replace( $text, $_tag, $_actual_tag_position, 0);
243
+ }
244
+
245
+ // Add the appropriate closing tags to all unclosed tags
246
+ foreach( $tags_to_close as $_tag_name ) {
247
+ $text .= sprintf('</%1$s>', $_tag_name);
248
+ }
249
+
250
+ return $text;
251
+ }
252
+
253
+
254
+ /**
255
+ * Clone of wp_trim_words, without using the PREG_SPLIT_NO_EMPTY flag for preg_split
256
+ *
257
+ * Trims text to a certain number of words.
258
+ * This function is localized. For languages that count 'words' by the individual
259
+ * character (such as East Asian languages), the $num_words argument will apply
260
+ * to the number of individual characters.
261
+ *
262
+ * @param string $text Text to trim.
263
+ * @param int $num_words Number of words. Default 55.
264
+ * @param string $more Optional. What to append if $text needs to be trimmed. Default '&hellip;'.
265
+ * @return string Trimmed text.
266
+ */
267
+ function wp_trim_words_wprss( $text, $num_words = 55, $more = null ) {
268
+ if ( null === $more ) {
269
+ $more = __( '&hellip;' );
270
+ }
271
+ $original_text = $text;
272
+ /* translators: If your word count is based on single characters (East Asian characters),
273
+ enter 'characters'. Otherwise, enter 'words'. Do not translate into your own language. */
274
+ if ( 'characters' == _x( 'words', 'word count: words or characters?' ) && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
275
+ $text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
276
+ preg_match_all( '/./u', $text, $words_array );
277
+ $words_array = array_slice( $words_array[0], 0, $num_words + 1 );
278
+ $sep = '';
279
+ } else {
280
+ $words_array = preg_split( "/[\n\r\t ]/", $text, $num_words + 1 );
281
+ $sep = ' ';
282
+ }
283
+ if ( count( $words_array ) > $num_words ) {
284
+ array_pop( $words_array );
285
+ $text = implode( $sep, $words_array );
286
+ $text = $text . $more;
287
+ } else {
288
+ $text = implode( $sep, $words_array );
289
+ }
290
+ /**
291
+ * Filter the text content after words have been trimmed.
292
+ *
293
+ * @since 3.3.0
294
+ *
295
+ * @param string $text The trimmed text.
296
+ * @param int $num_words The number of words to trim the text to. Default 5.
297
+ * @param string $more An optional string to append to the end of the trimmed text, e.g. &hellip;.
298
+ * @param string $original_text The text before it was trimmed.
299
+ */
300
+ return apply_filters( 'wp_trim_words', $text, $num_words, $more, $original_text );
301
  }
js/admin-custom-bulk-actions.js CHANGED
@@ -6,7 +6,7 @@
6
  (function($, wprss_admin_bulk){
7
 
8
  $(document).ready( function(){
9
- var bulk_actions_select = $( 'select[name="action"]' );
10
  var bulk_actions_trash = bulk_actions_select.find( "option[value='trash']" );
11
 
12
  $( '<option>' ).attr( 'value', 'activate' ).text( wprss_admin_bulk.activate ).insertBefore( bulk_actions_trash );
6
  (function($, wprss_admin_bulk){
7
 
8
  $(document).ready( function(){
9
+ var bulk_actions_select = $( 'select#bulk-action-selector-top, select#bulk-action-selector-bottom' );
10
  var bulk_actions_trash = bulk_actions_select.find( "option[value='trash']" );
11
 
12
  $( '<option>' ).attr( 'value', 'activate' ).text( wprss_admin_bulk.activate ).insertBefore( bulk_actions_trash );
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.6.2
9
  License: GPLv2 or later
10
  The no.1 RSS feed importer for WordPress. Premium add-ons available for more functionality.
11
 
@@ -167,6 +167,14 @@ The full documentation section can be found on the [WP RSS Aggregator website](w
167
 
168
  == Changelog ==
169
 
 
 
 
 
 
 
 
 
170
  = 4.6.2 (2014-10-15) =
171
  * Enhanced: Improved plugin responsiveness.
172
  * Enhanced: Updated some help text in tooltips with better explainations and added clarity.
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.6.3
9
  License: GPLv2 or later
10
  The no.1 RSS feed importer for WordPress. Premium add-ons available for more functionality.
11
 
167
 
168
  == Changelog ==
169
 
170
+ = 4.6.3 (2014-11-3) =
171
+ Enhanced: Re-added the "Add New" link in the plugin's menu.
172
+ Enhanced: Improved error logging.
173
+ Enhanced: Bulk actions in the Feed Sources page are now also included in the bottom dropdown menu.
174
+ Fixed bug: Add-on updater was prone to conflicts. Now enclosed in an action.
175
+ Fixed bug: The Full Text RSS Feeds add-on was not showing as active in the "Add-ons" page.
176
+ Fixed bug: Broken links in the "Add-ons" page, to add-on pages on our site.
177
+
178
  = 4.6.2 (2014-10-15) =
179
  * Enhanced: Improved plugin responsiveness.
180
  * Enhanced: Updated some help text in tooltips with better explainations and added clarity.
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.6.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.6.2
33
  * @since 1.0
34
  * @author Jean Galea <info@wprssaggregator.com>
35
  * @copyright Copyright (c) 2012-2014, Jean Galea
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.6.3
7
  Author: Jean Galea
8
  Author URI: http://www.wprssaggregator.com
9
  License: GPLv2
29
 
30
  /**
31
  * @package WPRSSAggregator
32
+ * @version 4.6.3
33
  * @since 1.0
34
  * @author Jean Galea <info@wprssaggregator.com>
35
  * @copyright Copyright (c) 2012-2014, Jean Galea