Version Description
- Improve image fetching (again...)
- Fix an issue on files encoding (UTF8)
- Minor PHP improvements on the main shortcode's function
Download this release
Release Info
| Developer | briKou |
| Plugin | |
| Version | 2.4.3 |
| Comparing to | |
| See all releases | |
Code changes from version 2.4.2 to 2.4.3
- feedzy-rss-feed.php +2 -2
- feedzy-rss-feeds-functions.php +94 -5
- feedzy-rss-feeds-shortcode.php +2 -75
- feedzy-rss-feeds-ui-lang.php +1 -1
- feedzy-rss-feeds-ui.php +1 -1
- feedzy-rss-feeds-widget.php +1 -1
- readme.txt +6 -1
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.4.
|
| 9 |
* Text Domain: feedzy_rss_translate
|
| 10 |
* Domain Path: /langs
|
| 11 |
*/
|
|
@@ -15,7 +15,7 @@
|
|
| 15 |
* SECURITY : Exit if accessed directly
|
| 16 |
***************************************************************/
|
| 17 |
if ( !defined( 'ABSPATH' ) ) {
|
| 18 |
-
die( 'Direct
|
| 19 |
}
|
| 20 |
|
| 21 |
|
| 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.4.3
|
| 9 |
* Text Domain: feedzy_rss_translate
|
| 10 |
* Domain Path: /langs
|
| 11 |
*/
|
| 15 |
* SECURITY : Exit if accessed directly
|
| 16 |
***************************************************************/
|
| 17 |
if ( !defined( 'ABSPATH' ) ) {
|
| 18 |
+
die( 'Direct access not allowed!' );
|
| 19 |
}
|
| 20 |
|
| 21 |
|
feedzy-rss-feeds-functions.php
CHANGED
|
@@ -1,4 +1,12 @@
|
|
| 1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
/***************************************************************
|
| 3 |
* Enqueue feedzy CSS
|
| 4 |
***************************************************************/
|
|
@@ -28,7 +36,85 @@ function feedzy_classes_item(){
|
|
| 28 |
|
| 29 |
|
| 30 |
/***************************************************************
|
| 31 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
***************************************************************/
|
| 33 |
function feedzy_returnImage( $string ) {
|
| 34 |
$img = html_entity_decode($string, ENT_QUOTES, 'UTF-8');
|
|
@@ -66,18 +152,21 @@ function feedzy_image_encode( $string ) {
|
|
| 66 |
}
|
| 67 |
|
| 68 |
//Encode image name only en keep extra parameters
|
| 69 |
-
$query = '';
|
| 70 |
$url_tab = parse_url( $string );
|
| 71 |
if( isset( $url_tab['query'] ) ){
|
| 72 |
$query = '?' . $url_tab['query'];
|
| 73 |
}
|
| 74 |
$path_parts = pathinfo( $string );
|
| 75 |
$path = $path_parts['dirname'];
|
| 76 |
-
$file = $path_parts['filename']
|
| 77 |
-
$
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
//Return a well encoded image url
|
| 80 |
-
return $path . '/' . rawurlencode( $file ) . $query;
|
| 81 |
}
|
| 82 |
|
| 83 |
/***************************************************************
|
| 1 |
<?php
|
| 2 |
+
/***************************************************************
|
| 3 |
+
* SECURITY : Exit if accessed directly
|
| 4 |
+
***************************************************************/
|
| 5 |
+
if ( !defined( 'ABSPATH' ) ) {
|
| 6 |
+
die( 'Direct access not allowed!' );
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
|
| 10 |
/***************************************************************
|
| 11 |
* Enqueue feedzy CSS
|
| 12 |
***************************************************************/
|
| 36 |
|
| 37 |
|
| 38 |
/***************************************************************
|
| 39 |
+
* Retrive image from the item object
|
| 40 |
+
***************************************************************/
|
| 41 |
+
function feedzy_retrieve_image( $item ) {
|
| 42 |
+
$thethumbnail = "";
|
| 43 |
+
if ( $enclosures = $item->get_enclosures() ) {
|
| 44 |
+
|
| 45 |
+
foreach( (array) $enclosures as $enclosure ){
|
| 46 |
+
|
| 47 |
+
//item thumb
|
| 48 |
+
if ( $thumbnail = $enclosure->get_thumbnail() ) {
|
| 49 |
+
$thethumbnail = $thumbnail;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
//media:thumbnail
|
| 53 |
+
if ( isset( $enclosure->thumbnails ) ) {
|
| 54 |
+
|
| 55 |
+
foreach ( (array) $enclosure->thumbnails as $thumbnail ) {
|
| 56 |
+
$thethumbnail = $thumbnail;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
//enclosure
|
| 62 |
+
if ( $thumbnail = $enclosure->embed() ) {
|
| 63 |
+
|
| 64 |
+
$pattern = '/https?:\/\/.*\.(?:jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/iU';
|
| 65 |
+
|
| 66 |
+
if ( preg_match( $pattern, $thumbnail, $matches ) ) {
|
| 67 |
+
$thethumbnail = $matches[0];
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
//media:content
|
| 73 |
+
foreach ( (array) $enclosure->get_link() as $thumbnail ) {
|
| 74 |
+
|
| 75 |
+
$pattern = '/https?:\/\/.*\.(?:jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/iU';
|
| 76 |
+
$imgsrc = $thumbnail;
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
if ( preg_match( $pattern, $imgsrc, $matches ) ) {
|
| 80 |
+
$thethumbnail = $matches[0];
|
| 81 |
+
break;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
//break loop if thumbnail found
|
| 87 |
+
if ( ! empty( $thethumbnail ) ) {
|
| 88 |
+
break;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
//content image
|
| 97 |
+
if ( empty( $thethumbnail ) ) {
|
| 98 |
+
|
| 99 |
+
$feedDescription = $item->get_content();
|
| 100 |
+
$image = feedzy_returnImage( $feedDescription );
|
| 101 |
+
$thethumbnail = feedzy_scrapeImage( $image );
|
| 102 |
+
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
//description image
|
| 106 |
+
if ( empty( $thethumbnail ) ) {
|
| 107 |
+
|
| 108 |
+
$feedDescription = $item->get_description();
|
| 109 |
+
$image = feedzy_returnImage( $feedDescription );
|
| 110 |
+
$thethumbnail = feedzy_scrapeImage( $image );
|
| 111 |
+
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
return $thethumbnail;
|
| 115 |
+
}
|
| 116 |
+
/***************************************************************
|
| 117 |
+
* Get an image from a string
|
| 118 |
***************************************************************/
|
| 119 |
function feedzy_returnImage( $string ) {
|
| 120 |
$img = html_entity_decode($string, ENT_QUOTES, 'UTF-8');
|
| 152 |
}
|
| 153 |
|
| 154 |
//Encode image name only en keep extra parameters
|
| 155 |
+
$query = $extention = '';
|
| 156 |
$url_tab = parse_url( $string );
|
| 157 |
if( isset( $url_tab['query'] ) ){
|
| 158 |
$query = '?' . $url_tab['query'];
|
| 159 |
}
|
| 160 |
$path_parts = pathinfo( $string );
|
| 161 |
$path = $path_parts['dirname'];
|
| 162 |
+
$file = rawurldecode( $path_parts['filename'] );
|
| 163 |
+
$extention = pathinfo( $url_tab['path'], PATHINFO_EXTENSION );
|
| 164 |
+
if( !empty( $extention ) ){
|
| 165 |
+
$extention = '.' . $extention;
|
| 166 |
+
}
|
| 167 |
|
| 168 |
//Return a well encoded image url
|
| 169 |
+
return $path . '/' . rawurlencode( $file ) . $extention . $query;
|
| 170 |
}
|
| 171 |
|
| 172 |
/***************************************************************
|
feedzy-rss-feeds-shortcode.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
* SECURITY : Exit if accessed directly
|
| 4 |
***************************************************************/
|
| 5 |
if ( !defined( 'ABSPATH' ) ) {
|
| 6 |
-
die( 'Direct
|
| 7 |
}
|
| 8 |
|
| 9 |
|
|
@@ -124,80 +124,7 @@ function feedzy_rss( $atts, $content = '' ) {
|
|
| 124 |
|
| 125 |
//Fetch image thumbnail
|
| 126 |
if ( $thumb == 'yes' || $thumb == 'auto' ) {
|
| 127 |
-
$thethumbnail =
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
if ( $enclosures = $item->get_enclosures() ) {
|
| 131 |
-
|
| 132 |
-
foreach( (array) $enclosures as $enclosure ){
|
| 133 |
-
|
| 134 |
-
//item thumb
|
| 135 |
-
if ( $thumbnail = $enclosure->get_thumbnail() ) {
|
| 136 |
-
$thethumbnail = $thumbnail;
|
| 137 |
-
}
|
| 138 |
-
|
| 139 |
-
//media:thumbnail
|
| 140 |
-
if ( isset( $enclosure->thumbnails ) ) {
|
| 141 |
-
|
| 142 |
-
foreach ( (array) $enclosure->thumbnails as $thumbnail ) {
|
| 143 |
-
$thethumbnail = $thumbnail;
|
| 144 |
-
}
|
| 145 |
-
|
| 146 |
-
}
|
| 147 |
-
|
| 148 |
-
//enclosure
|
| 149 |
-
if ( $thumbnail = $enclosure->embed() ) {
|
| 150 |
-
|
| 151 |
-
$pattern = '/https?:\/\/.*\.(?:jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/iU';
|
| 152 |
-
|
| 153 |
-
if ( preg_match( $pattern, $thumbnail, $matches ) ) {
|
| 154 |
-
$thethumbnail = $matches[0];
|
| 155 |
-
}
|
| 156 |
-
|
| 157 |
-
}
|
| 158 |
-
|
| 159 |
-
//media:content
|
| 160 |
-
foreach ( (array) $enclosure->get_link() as $thumbnail ) {
|
| 161 |
-
|
| 162 |
-
$pattern = '/https?:\/\/.*\.(?:jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/iU';
|
| 163 |
-
$imgsrc = $thumbnail;
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
if ( preg_match( $pattern, $imgsrc, $matches ) ) {
|
| 167 |
-
$thethumbnail = $matches[0];
|
| 168 |
-
break;
|
| 169 |
-
}
|
| 170 |
-
|
| 171 |
-
}
|
| 172 |
-
|
| 173 |
-
//break loop if thumbnail found
|
| 174 |
-
if ( ! empty( $thethumbnail ) ) {
|
| 175 |
-
break;
|
| 176 |
-
}
|
| 177 |
-
|
| 178 |
-
}
|
| 179 |
-
|
| 180 |
-
}
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
//content image
|
| 184 |
-
if ( empty( $thethumbnail ) ) {
|
| 185 |
-
|
| 186 |
-
$feedDescription = $item->get_content();
|
| 187 |
-
$image = feedzy_returnImage( $feedDescription );
|
| 188 |
-
$thethumbnail = feedzy_scrapeImage( $image );
|
| 189 |
-
|
| 190 |
-
}
|
| 191 |
-
|
| 192 |
-
//description image
|
| 193 |
-
if ( empty( $thethumbnail ) ) {
|
| 194 |
-
|
| 195 |
-
$feedDescription = $item->get_description();
|
| 196 |
-
$image = feedzy_returnImage( $feedDescription );
|
| 197 |
-
$thethumbnail = feedzy_scrapeImage( $image );
|
| 198 |
-
|
| 199 |
-
}
|
| 200 |
-
|
| 201 |
}
|
| 202 |
|
| 203 |
//Padding ratio based on image size
|
| 3 |
* SECURITY : Exit if accessed directly
|
| 4 |
***************************************************************/
|
| 5 |
if ( !defined( 'ABSPATH' ) ) {
|
| 6 |
+
die( 'Direct access not allowed!' );
|
| 7 |
}
|
| 8 |
|
| 9 |
|
| 124 |
|
| 125 |
//Fetch image thumbnail
|
| 126 |
if ( $thumb == 'yes' || $thumb == 'auto' ) {
|
| 127 |
+
$thethumbnail = feedzy_retrieve_image( $item );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
}
|
| 129 |
|
| 130 |
//Padding ratio based on image size
|
feedzy-rss-feeds-ui-lang.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
* SECURITY : Exit if accessed directly
|
| 4 |
***************************************************************/
|
| 5 |
if ( !defined( 'ABSPATH' ) ) {
|
| 6 |
-
die( 'Direct
|
| 7 |
}
|
| 8 |
|
| 9 |
|
| 3 |
* SECURITY : Exit if accessed directly
|
| 4 |
***************************************************************/
|
| 5 |
if ( !defined( 'ABSPATH' ) ) {
|
| 6 |
+
die( 'Direct access not allowed!' );
|
| 7 |
}
|
| 8 |
|
| 9 |
|
feedzy-rss-feeds-ui.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
* SECURITY : Exit if accessed directly
|
| 4 |
***************************************************************/
|
| 5 |
if ( !defined( 'ABSPATH' ) ) {
|
| 6 |
-
die( 'Direct
|
| 7 |
}
|
| 8 |
|
| 9 |
|
| 3 |
* SECURITY : Exit if accessed directly
|
| 4 |
***************************************************************/
|
| 5 |
if ( !defined( 'ABSPATH' ) ) {
|
| 6 |
+
die( 'Direct access not allowed!' );
|
| 7 |
}
|
| 8 |
|
| 9 |
|
feedzy-rss-feeds-widget.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
* SECURITY : Exit if accessed directly
|
| 4 |
***************************************************************/
|
| 5 |
if ( !defined( 'ABSPATH' ) ) {
|
| 6 |
-
die( 'Direct
|
| 7 |
}
|
| 8 |
|
| 9 |
|
| 3 |
* SECURITY : Exit if accessed directly
|
| 4 |
***************************************************************/
|
| 5 |
if ( !defined( 'ABSPATH' ) ) {
|
| 6 |
+
die( 'Direct access not allowed!' );
|
| 7 |
}
|
| 8 |
|
| 9 |
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
| 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.1
|
| 7 |
-
Stable tag: 2.4.
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
|
@@ -105,6 +105,11 @@ Yes it is.
|
|
| 105 |
|
| 106 |
== Changelog ==
|
| 107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
= 2.4.2 =
|
| 109 |
* Minor fix on already encoded images names
|
| 110 |
|
| 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.1
|
| 7 |
+
Stable tag: 2.4.3
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
| 105 |
|
| 106 |
== Changelog ==
|
| 107 |
|
| 108 |
+
= 2.4.3 =
|
| 109 |
+
* Improve image fetching (again...)
|
| 110 |
+
* Fix an issue on files encoding (UTF8)
|
| 111 |
+
* Minor PHP improvements on the main shortcode's function
|
| 112 |
+
|
| 113 |
= 2.4.2 =
|
| 114 |
* Minor fix on already encoded images names
|
| 115 |
|
