Skip to content

Commit

Permalink
Merge pull request #92 from Codeinwp/development
Browse files Browse the repository at this point in the history
Fix compatibility with SiteOrigin Page Builder.
Adds full content import from feed.
Fix issue with img scraped from articles.
  • Loading branch information
selul authored Jan 5, 2018
2 parents 107ac0d + f64b135 commit 0f32bf2
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ matrix:
script: ./bin/wraith.sh
- php: '5.3'
dist: precise
allow_failures:
- env: TEST_SUITE=Wraith_Visual_Regression_Testing WRAITH_FAIL=5
branches:
except:
- "/^*-v[0-9]/"
Expand Down
2 changes: 1 addition & 1 deletion css/feedzy-rss-feeds.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* feedzy-rss-feeds.css
* Feedzy RSS Feed
* Copyright: (c) 2016 Themeisle, themeisle.com
* Version: 3.2.6
* Version: 3.2.7
* Plugin Name: FEEDZY RSS Feeds
* Plugin URI: http://themeisle.com/plugins/feedzy-rss-feeds/
* Author: Themeisle
Expand Down
2 changes: 1 addition & 1 deletion feedzy-rss-feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Plugin Name: Feedzy RSS Feeds Lite
* Plugin URI: https://themeisle.com/plugins/feedzy-rss-feeds-lite/
* Description: A small and lightweight RSS aggregator plugin. Fast and very easy to use, it allows you to aggregate multiple RSS feeds into your WordPress site through fully customizable shortcodes & widgets.
* Version: 3.2.6
* Version: 3.2.7
* Author: Themeisle
* Author URI: http://themeisle.com
* License: GPL-2.0+
Expand Down
31 changes: 15 additions & 16 deletions includes/abstract/feedzy-rss-feeds-admin-abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ private function get_feed_item_filter( $sc, $sizes, $item, $feedURL ) {
'item_date' => $item->get_date( 'U' ),
'item_author' => $item->get_author(),
'item_description' => $contentSummary,
'item_content' => apply_filters( 'feedzy_content', $item->get_content( false ) ),
);
$itemArray = apply_filters( 'feedzy_item_filter', $itemArray, $item );

Expand Down Expand Up @@ -837,28 +838,28 @@ public function feedzy_retrieve_image( $item ) {
public function feedzy_return_image( $string ) {
$img = html_entity_decode( $string, ENT_QUOTES, 'UTF-8' );
$pattern = '/<img[^>]+\>/i';
preg_match( $pattern, $img, $matches );
preg_match_all( $pattern, $img, $matches );

$image = null;
if ( isset( $matches[0] ) ) {
$blacklistCount = 0;
foreach ( $matches as $matche ) {
$link = $this->feedzy_scrape_image( $matche );
$blacklist = array();
$blacklist = apply_filters( 'feedzy_feed_blacklist_images', $this->feedzy_blacklist_images( $blacklist ) );
foreach ( $matches[0] as $match ) {
$link = $this->feedzy_scrape_image( $match );
$blacklist = $this->feedzy_blacklist_images();
$is_blacklist = false;
foreach ( $blacklist as $string ) {
if ( strpos( (string) $link, $string ) !== false ) {
$blacklistCount ++;
$is_blacklist = true;
break;
}
}
if ( $blacklistCount == 0 ) {
if ( ! $is_blacklist ) {
$image = $link;
break;
}
}
if ( $blacklistCount == 0 ) {
return $link;
}
}

return '';
return $image;
}

/**
Expand Down Expand Up @@ -889,11 +890,9 @@ public function feedzy_scrape_image( $string, $link = '' ) {
* @since 3.0.0
* @access public
*
* @param array $blacklist An array with blacklisted resources.
*
* @return array
*/
public function feedzy_blacklist_images( $blacklist ) {
public function feedzy_blacklist_images() {
$blacklist = array(
'frownie.png',
'icon_arrow.gif',
Expand Down Expand Up @@ -923,7 +922,7 @@ public function feedzy_blacklist_images( $blacklist ) {
'simple-smile.png',
);

return $blacklist;
return apply_filters( 'feedzy_feed_blacklist_images', $blacklist );
}

/**
Expand Down
5 changes: 5 additions & 0 deletions includes/admin/feedzy-wp-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ public function registerWidget() {
* @return mixed
*/
public function form( $instance ) {
$screen = get_current_screen();
// to prevent conflicts with plugins such as siteorigin page builder that call this function from outside of the 'widgets' screen.
if ( 'widgets' !== $screen->id ) {
return;
}
$instance = wp_parse_args( $instance, $this->get_widget_defaults() );
$widget_form = '<p>
<label for="' . $this->get_field_id( 'title' ) . '">' . __( 'Widget Title', 'feedzy-rss-feeds' ) . '</label>
Expand Down
2 changes: 1 addition & 1 deletion includes/feedzy-rss-feeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static function instance() {
*/
public function init() {
self::$plugin_name = 'feedzy-rss-feeds';
self::$version = '3.2.6';
self::$version = '3.2.7';
self::$instance->load_dependencies();
self::$instance->set_locale();
self::$instance->define_admin_hooks();
Expand Down
12 changes: 6 additions & 6 deletions languages/feedzy-rss-feeds.pot
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Copyright (C) 2017 Themeisle
# Copyright (C) 2018 Themeisle
# This file is distributed under the GPL-2.0+.
msgid ""
msgstr ""
"Project-Id-Version: Feedzy RSS Feeds Lite 3.2.5\n"
"Project-Id-Version: Feedzy RSS Feeds Lite 3.2.6\n"
"Report-Msgid-Bugs-To: https://github.com/Codeinwp/feedzy-rss-feeds/issues\n"
"POT-Creation-Date: 2017-11-03 11:31:06+00:00\n"
"POT-Creation-Date: 2018-01-05 12:16:57+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
"Last-Translator: Themeisle Translate Team <[email protected]>\n"
"Language-Team: Themeisle Translate <[email protected]>\n"
"X-Generator: grunt-wp-i18n 0.5.4\n"
Expand Down Expand Up @@ -391,11 +391,11 @@ msgstr ""
msgid "Style 2"
msgstr ""

#: includes/admin/feedzy-wp-widget.php:83
#: includes/admin/feedzy-wp-widget.php:88
msgid "Widget Title"
msgstr ""

#: includes/admin/feedzy-wp-widget.php:87
#: includes/admin/feedzy-wp-widget.php:92
msgid "Intro text"
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "feedzy-rss-feeds",
"version": "3.2.6",
"version": "3.2.7",
"description": "Feedzy RSS Feeds - lite version",
"repository": {
"type": "git",
Expand Down

0 comments on commit 0f32bf2

Please sign in to comment.