FEEDZY RSS Feeds Lite - Version 2.6.1

Version Description

  • Replace jQuery live() function by on() function to prevent JS error (fix the issue with Visual composer)
  • Improve image's fetching on itunes feeds
  • New feature: default WP smilies are now blacklisted from image fetching
  • New hook: feedzy_feed_blacklist_images
  • Tested on WP 4.3 with success!
Download this release

Release Info

Developer briKou
Plugin Icon 128x128 FEEDZY RSS Feeds Lite
Version 2.6.1
Comparing to
See all releases

Code changes from version 2.6 to 2.6.1

css/feedzy-rss-feeds.css CHANGED
@@ -44,26 +44,4 @@
44
  i.mce-i-feedzy-icon {
45
  background-image: url('../img/feedzy.png');
46
  background-image: none, url('../img/feedzy.svg'), url('../img/feedzy.png');
47
- }
48
- .mce-feedzy-media {
49
- padding-right: 25px;
50
- -webkit-box-sizing: border-box;
51
- -moz-box-sizing: border-box;
52
- box-sizing: border-box;
53
- height: 32px;
54
- }
55
- .mce-feedzy-media-button {
56
- cursor: pointer;
57
- width: 28px;
58
- height: 28px;
59
- display: block;
60
- -webkit-font-smoothing: antialiased;
61
- float: right;
62
- background-color: #F7F7F7;
63
- border: 1px solid #DDD;
64
- font-size: 30px;
65
- color: #777;
66
- position: relative;
67
- line-height: 28px;
68
- text-align: center;
69
  }
44
  i.mce-i-feedzy-icon {
45
  background-image: url('../img/feedzy.png');
46
  background-image: none, url('../img/feedzy.svg'), url('../img/feedzy.png');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
feedzy-rss-feed.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: FEEDZY RSS Feeds is a small and lightweight plugin. Fast and easy to use, it aggregates RSS feeds into your WordPress site through simple shortcodes.
6
  * Author: Brice CAPOBIANCO
7
  * Author URI: http://b-website.com/
8
- * Version: 2.6
9
  * Text Domain: feedzy_rss_translate
10
  * Domain Path: /langs
11
  */
5
  * Description: FEEDZY RSS Feeds is a small and lightweight plugin. Fast and easy to use, it aggregates RSS feeds into your WordPress site through simple shortcodes.
6
  * Author: Brice CAPOBIANCO
7
  * Author URI: http://b-website.com/
8
+ * Version: 2.6.1
9
  * Text Domain: feedzy_rss_translate
10
  * Domain Path: /langs
11
  */
feedzy-rss-feeds-functions.php CHANGED
@@ -11,7 +11,7 @@ if ( !defined( 'ABSPATH' ) ) {
11
  * Enqueue feedzy CSS
12
  ***************************************************************/
13
  function feedzy_register_custom_style() {
14
- wp_register_style( 'feedzy-style', plugins_url( 'css/feedzy-rss-feeds.css', __FILE__ ), NULL, NULL );
15
  }
16
  function feedzy_print_custom_style() {
17
  global $feedzyStyle;
@@ -53,6 +53,7 @@ add_filter( 'feedzy_item_attributes', 'feedzy_classes_item' );
53
  ***************************************************************/
54
  function feedzy_retrieve_image( $item ) {
55
  $thethumbnail = "";
 
56
  if ( $enclosures = $item->get_enclosures() ) {
57
 
58
  foreach( (array) $enclosures as $enclosure ){
@@ -97,7 +98,7 @@ function feedzy_retrieve_image( $item ) {
97
  }
98
 
99
  }
100
-
101
  //break loop if thumbnail found
102
  if ( ! empty( $thethumbnail ) ) {
103
  break;
@@ -107,13 +108,19 @@ function feedzy_retrieve_image( $item ) {
107
 
108
  }
109
 
110
-
 
 
 
 
 
 
 
111
  //content image
112
  if ( empty( $thethumbnail ) ) {
113
 
114
  $feedDescription = $item->get_content();
115
- $image = feedzy_returnImage( $feedDescription );
116
- $thethumbnail = feedzy_scrapeImage( $image );
117
 
118
  }
119
 
@@ -121,13 +128,18 @@ function feedzy_retrieve_image( $item ) {
121
  if ( empty( $thethumbnail ) ) {
122
 
123
  $feedDescription = $item->get_description();
124
- $image = feedzy_returnImage( $feedDescription );
125
- $thethumbnail = feedzy_scrapeImage( $image );
126
 
127
  }
128
 
129
  return $thethumbnail;
130
  }
 
 
 
 
 
 
131
  /***************************************************************
132
  * Get an image from a string
133
  ***************************************************************/
@@ -136,7 +148,19 @@ function feedzy_returnImage( $string ) {
136
  $pattern = "/<img[^>]+\>/i";
137
  preg_match( $pattern, $img, $matches );
138
  if( isset( $matches[0] ) ){
139
- return $matches[0];
 
 
 
 
 
 
 
 
 
 
 
 
140
  }
141
  return;
142
  }
@@ -152,6 +176,40 @@ function feedzy_scrapeImage( $string ) {
152
  return $link;
153
  }
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  /***************************************************************
156
  * Image name encode + get image url if in url param
157
  ***************************************************************/
11
  * Enqueue feedzy CSS
12
  ***************************************************************/
13
  function feedzy_register_custom_style() {
14
+ wp_register_style( 'feedzy-style', plugins_url( 'css/feedzy-rss-feeds.css', __FILE__ ), array(), '2.6.1' );
15
  }
16
  function feedzy_print_custom_style() {
17
  global $feedzyStyle;
53
  ***************************************************************/
54
  function feedzy_retrieve_image( $item ) {
55
  $thethumbnail = "";
56
+ //var_dump($item);
57
  if ( $enclosures = $item->get_enclosures() ) {
58
 
59
  foreach( (array) $enclosures as $enclosure ){
98
  }
99
 
100
  }
101
+
102
  //break loop if thumbnail found
103
  if ( ! empty( $thethumbnail ) ) {
104
  break;
108
 
109
  }
110
 
111
+ //xmlns:itunes podcast
112
+ if ( empty( $thethumbnail ) ) {
113
+ $data = $item->get_item_tags('http://www.itunes.com/dtds/podcast-1.0.dtd', 'image');
114
+ if ( isset( $data['0']['attribs']['']['href'] ) && !empty( $data['0']['attribs']['']['href'] ) ){
115
+ $thethumbnail = $data['0']['attribs']['']['href'];
116
+ }
117
+ }
118
+
119
  //content image
120
  if ( empty( $thethumbnail ) ) {
121
 
122
  $feedDescription = $item->get_content();
123
+ $thethumbnail = feedzy_returnImage( $feedDescription );
 
124
 
125
  }
126
 
128
  if ( empty( $thethumbnail ) ) {
129
 
130
  $feedDescription = $item->get_description();
131
+ $thethumbnail = feedzy_returnImage( $feedDescription );
 
132
 
133
  }
134
 
135
  return $thethumbnail;
136
  }
137
+
138
+ function get_app_image()
139
+ {
140
+ $data = $this->get_item_tags(SIMPLE_NAMESPACE_IM, 'image');
141
+ return $data['0']['data'];
142
+ }
143
  /***************************************************************
144
  * Get an image from a string
145
  ***************************************************************/
148
  $pattern = "/<img[^>]+\>/i";
149
  preg_match( $pattern, $img, $matches );
150
  if( isset( $matches[0] ) ){
151
+ $blacklistCount = 0;
152
+ foreach( $matches as $matche){
153
+ $link = feedzy_scrapeImage( $matche );
154
+ $blacklist = array();
155
+ $blacklist = apply_filters( 'feedzy_feed_blacklist_images', feedzy_blacklist_images( $blacklist ) );
156
+ foreach( $blacklist as $string ) {
157
+ if ( strpos( $link, $string ) !== false) {
158
+ $blacklistCount++;
159
+ }
160
+ }
161
+ if( $blacklistCount == 0) break;
162
+ }
163
+ if( $blacklistCount == 0) return $link;
164
  }
165
  return;
166
  }
176
  return $link;
177
  }
178
 
179
+
180
+ function feedzy_blacklist_images( $blacklist ) {
181
+ $blacklist = array(
182
+ 'frownie.png',
183
+ 'icon_arrow.gif',
184
+ 'icon_biggrin.gif',
185
+ 'icon_confused.gif',
186
+ 'icon_cool.gif',
187
+ 'icon_cry.gif',
188
+ 'icon_eek.gif',
189
+ 'icon_evil.gif',
190
+ 'icon_exclaim.gif',
191
+ 'icon_idea.gif',
192
+ 'icon_lol.gif',
193
+ 'icon_mad.gif',
194
+ 'icon_mrgreen.gif',
195
+ 'icon_neutral.gif',
196
+ 'icon_question.gif',
197
+ 'icon_razz.gif',
198
+ 'icon_redface.gif',
199
+ 'icon_rolleyes.gif',
200
+ 'icon_sad.gif',
201
+ 'icon_smile.gif',
202
+ 'icon_surprised.gif',
203
+ 'icon_twisted.gif',
204
+ 'icon_wink.gif',
205
+ 'mrgreen.png',
206
+ 'rolleyes.png',
207
+ 'simple-smile.png',
208
+ );
209
+ return $blacklist;
210
+ }
211
+
212
+
213
  /***************************************************************
214
  * Image name encode + get image url if in url param
215
  ***************************************************************/
feedzy-rss-feeds-shortcode.php CHANGED
@@ -219,7 +219,9 @@ function feedzy_rss( $atts, $content = '' ) {
219
  }
220
 
221
  if ( $metaArgs[ 'date' ] ) {
222
- $contentMeta .= __( 'on', 'feedzy_rss_translate') . ' ' . date_i18n( $metaArgs[ 'date_format' ], $item->get_date( 'U' ) ) . ' ' . __( 'at', 'feedzy_rss_translate' ) . ' ' . date_i18n( $metaArgs[ 'time_format' ], $item->get_date( 'U' ) );
 
 
223
  }
224
 
225
  $contentMeta .= '</small>';
219
  }
220
 
221
  if ( $metaArgs[ 'date' ] ) {
222
+ $contentMeta .= __( 'on', 'feedzy_rss_translate') . ' ' . date_i18n( $metaArgs[ 'date_format' ], $item->get_date( 'U' ) );
223
+ $contentMeta .= ' ';
224
+ $contentMeta .= __( 'at', 'feedzy_rss_translate' ) . ' ' . date_i18n( $metaArgs[ 'time_format' ], $item->get_date( 'U' ) );
225
  }
226
 
227
  $contentMeta .= '</small>';
feedzy-rss-feeds-ui.php CHANGED
@@ -21,8 +21,8 @@ function feedzy_add_mce_button() {
21
  add_filter( 'mce_buttons', 'feedzy_register_mce_button' );
22
 
23
  // Load stylesheet for tinyMCE button only
24
- wp_enqueue_style( 'feedzy-rss-feeds', plugin_dir_url( __FILE__ ) . 'css/feedzy-rss-feeds.css', array(), NULL, NULL );
25
- wp_enqueue_script( 'feedzy-rss-feeds-ui-scripts', plugin_dir_url( __FILE__ ) . 'js/feedzy-rss-feeds-ui-scripts.js', array( 'jquery' ), NULL );
26
  }
27
 
28
  }
21
  add_filter( 'mce_buttons', 'feedzy_register_mce_button' );
22
 
23
  // Load stylesheet for tinyMCE button only
24
+ wp_enqueue_style( 'feedzy-rss-feeds', plugin_dir_url( __FILE__ ) . 'css/feedzy-rss-feeds.css', array(), '2.6.1' );
25
+ wp_enqueue_script( 'feedzy-rss-feeds-ui-scripts', plugin_dir_url( __FILE__ ) . 'js/feedzy-rss-feeds-ui-scripts.js', array( 'jquery' ), '2.6.1' );
26
  }
27
 
28
  }
js/feedzy-rss-feeds-ui-scripts.js CHANGED
@@ -6,13 +6,18 @@
6
  jQuery(document).ready(function($) {
7
 
8
  function feedzyMediaLibrary(){
9
- $('i.mce-i-feedzy-icon').live('click', function(){
10
  setTimeout(function() {
11
- $('.mce-feedzy-media').after( "<span class='mce-feedzy-media-button'>+</span>" );
 
 
 
 
 
12
  }, 100);
13
  });
14
-
15
- $('.mce-feedzy-media-button').live('click', function(){
16
  var $this = $(this);
17
  var wireframe;
18
  if (wireframe) {
6
  jQuery(document).ready(function($) {
7
 
8
  function feedzyMediaLibrary(){
9
+ $(document).on('click', 'i.mce-i-feedzy-icon', function(){
10
  setTimeout(function() {
11
+ $('.mce-feedzy-media').after(
12
+ "<span class='mce-feedzy-media-button'>+</span>" +
13
+ "<style>.mce-feedzy-media { padding-right: 25px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; height: 30px !important; }" +
14
+ ".mce-feedzy-media-button { cursor: pointer; width: 28px; height: 28px; display: block; -webkit-font-smoothing: antialiased; float: right; background-color: #F7F7F7; border: 1px solid #DDD; font-size: 30px; color: #777; position: relative; line-height: 28px; text-align: center;" +
15
+ " }</style>"
16
+ );
17
  }, 100);
18
  });
19
+
20
+ $(document).on('click', '.mce-feedzy-media-button', function(){
21
  var $this = $(this);
22
  var wireframe;
23
  if (wireframe) {
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: briKou
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7Z6YVM63739Y8
4
  Tags: RSS, SimplePie, shortcode, feed, thumbnail, image, rss feeds, aggregator, tinyMCE, WYSIWYG, MCE, UI, flux, plugin, WordPress, widget, importer, XML, ATOM, API, parser
5
  Requires at least: 3.7
6
- Tested up to: 4.3
7
- Stable tag: 2.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -71,6 +71,7 @@ By activating this plugin, your cover picture will be inserted into your RSS fee
71
  * feedzy_summary_output
72
  * feedzy_global_output
73
  * feedzy_thumb_sizes
 
74
 
75
 
76
  [FULL DOCUMENTATION AND EXAMPLES](http://b-website.com/feedzy-rss-feeds-wordpress-plugin-using-simplepie "Documentation & examples")
@@ -106,6 +107,12 @@ Yes it is.
106
 
107
 
108
  == Changelog ==
 
 
 
 
 
 
109
 
110
  = 2.6 =
111
  * Fix a conflict with PageBuilder where Feedzy button does not show up in the visual editor
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7Z6YVM63739Y8
4
  Tags: RSS, SimplePie, shortcode, feed, thumbnail, image, rss feeds, aggregator, tinyMCE, WYSIWYG, MCE, UI, flux, plugin, WordPress, widget, importer, XML, ATOM, API, parser
5
  Requires at least: 3.7
6
+ Tested up to: 4.3.1
7
+ Stable tag: 2.6.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
71
  * feedzy_summary_output
72
  * feedzy_global_output
73
  * feedzy_thumb_sizes
74
+ * feedzy_feed_blacklist_images
75
 
76
 
77
  [FULL DOCUMENTATION AND EXAMPLES](http://b-website.com/feedzy-rss-feeds-wordpress-plugin-using-simplepie "Documentation & examples")
107
 
108
 
109
  == Changelog ==
110
+ = 2.6.1 =
111
+ * Replace jQuery live() function by on() function to prevent JS error (fix the issue with Visual composer)
112
+ * Improve image's fetching on itunes feeds
113
+ * New feature: default WP smilies are now blacklisted from image fetching
114
+ * New hook: feedzy_feed_blacklist_images
115
+ * Tested on WP 4.3 with success!
116
 
117
  = 2.6 =
118
  * Fix a conflict with PageBuilder where Feedzy button does not show up in the visual editor