Skip to content

Commit 704d1df

Browse files
authored
release: fixes
- Fix Feedzy RSS feed cache not working on the widgets. - Remove legacy elementor widget for new users - Fix external image support on import for some websites - Enter key on feed fields should load the feed automatically
2 parents ffa468a + 93010b7 commit 704d1df

14 files changed

+101
-31
lines changed

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/feedzy-elementor-widget.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
.fz-light-mode.fz-pro-notice p{
9696
color: #6D7882;
9797
}
98-
.docs-btn a{
98+
.docs-btn a.fz-upgrade-link{
9999
display: inline-block;
100100
background: #4268CF;
101101
padding: 6px 12px;
@@ -106,8 +106,8 @@
106106
text-transform: uppercase;
107107
color: #FFFFFF;
108108
}
109-
.docs-btn a:hover,
110-
.docs-btn a:focus{
109+
.docs-btn a.fz-upgrade-link:hover,
110+
.docs-btn a.fz-upgrade-link:focus{
111111
color: #FFFFFF;
112112
}
113113
.docs-btn span{
@@ -119,6 +119,9 @@
119119
color: #757575;
120120
padding-top: 8px;
121121
}
122+
.docs-btn span a {
123+
color: #757575;
124+
}
122125
.fz-light-mode .docs-btn span {
123126
color: #757575;
124127
}

includes/abstract/feedzy-rss-feeds-admin-abstract.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ private function init_feed( $feed_url, $cache, $sc, $allow_https = FEEDZY_ALLOW_
777777
if ( false === apply_filters( 'feedzy_disable_db_cache', false, $feed_url ) ) {
778778
SimplePie_Cache::register( 'wp_transient', 'WP_Feed_Cache_Transient' );
779779
$feed->set_cache_location( 'wp_transient' );
780+
$feed->set_cache_duration( $cache_time );
780781
add_filter(
781782
'wp_feed_cache_transient_lifetime',
782783
function( $time ) use ( $cache_time ) {
@@ -1472,6 +1473,8 @@ private function get_feed_item_filter( $sc, $sizes, $item, $feed_url, $index, $i
14721473
$item_content = esc_html__( 'Post Content', 'feedzy-rss-feeds' );
14731474
}
14741475
$item_array = array(
1476+
'feed_url' => $item->get_feed()->subscribe_url(),
1477+
'item_unique_hash' => wp_hash( $item->get_permalink() ),
14751478
'item_img_class' => 'rss_image',
14761479
'item_img_style' => 'width:' . $sizes['width'] . 'px; height:' . $sizes['height'] . 'px;',
14771480
'item_url' => $new_link,

includes/admin/feedzy-rss-feeds-admin.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,4 +851,37 @@ public function ajax() {
851851
public function feedzy_remove_elementor_feature( $manager_object, $experimental_data ) {
852852
$manager_object->remove_feature( 'e_hidden_wordpress_widgets' );
853853
}
854+
855+
/**
856+
* Remove legacy widget.
857+
*
858+
* @param array $list Black list widgets.
859+
* @return array
860+
*/
861+
public function feedzy_remove_elementor_widgets( $list ) {
862+
global $post;
863+
864+
if ( ! defined( 'ELEMENTOR_PATH' ) || ! class_exists( '\Elementor\Plugin', false ) ) {
865+
return $list;
866+
}
867+
868+
if ( ! method_exists( \Elementor\Plugin::$instance->documents, 'get' ) ) {
869+
return $list;
870+
}
871+
872+
$black_list = array( 'feedzy_wp_widget' );
873+
$data = \Elementor\Plugin::$instance->documents->get( $post->ID )->get_elements_data();
874+
875+
if ( ! empty( $data ) ) {
876+
\Elementor\Plugin::$instance->db->iterate_data(
877+
$data,
878+
function ( $element ) use ( &$black_list ) {
879+
if ( ! empty( $element['widgetType'] ) && 'wp-widget-feedzy_wp_widget' === $element['widgetType'] ) {
880+
$black_list = array();
881+
}
882+
}
883+
);
884+
}
885+
return array_merge( $list, $black_list );
886+
}
854887
}

includes/admin/feedzy-rss-feeds-import.php

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,16 @@ private function run_job( $job, $max ) {
13001300

13011301
$duplicates = $items_found = array();
13021302
$found_duplicates = array();
1303-
foreach ( $result as $item ) {
1303+
foreach ( $result as $key => $item ) {
1304+
$item_obj = $item;
1305+
// find item index key when import full content.
1306+
if ( ! empty( $xml_results ) ) {
1307+
$item_unique_hash = array_column( $xml_results['items'], 'item_unique_hash' );
1308+
$real_index_key = array_search( $item['item_unique_hash'], $item_unique_hash, true );
1309+
if ( isset( $xml_results['items'][ $real_index_key ] ) ) {
1310+
$item_obj = $xml_results['items'][ $real_index_key ];
1311+
}
1312+
}
13041313
$item_hash = $use_new_hash ? $item['item_id'] : hash( 'sha256', $item['item_url'] . '_' . $item['item_date'] );
13051314
$is_duplicate = $use_new_hash ? in_array( $item_hash, $imported_items_new, true ) : in_array( $item_hash, $imported_items_old, true );
13061315
$items_found[ $item['item_url'] ] = $item['item_title'];
@@ -1367,8 +1376,8 @@ private function run_job( $job, $max ) {
13671376
$import_title
13681377
);
13691378

1370-
if ( $this->feedzy_is_business() || $this->feedzy_is_personal() ) {
1371-
$post_title = apply_filters( 'feedzy_parse_custom_tags', $post_title, ! empty( $xml_results ) ? $xml_results['feed'] : $results['feed'], $item['item_index'] );
1379+
if ( $this->feedzy_is_business() ) {
1380+
$post_title = apply_filters( 'feedzy_parse_custom_tags', $post_title, $item_obj );
13721381
}
13731382

13741383
$post_title = apply_filters( 'feedzy_invoke_services', $post_title, 'title', $item['item_title'], $job );
@@ -1458,8 +1467,8 @@ private function run_job( $job, $max ) {
14581467
$post_content = apply_filters( 'feedzy_invoke_services', $post_content, 'full_content', $full_content, $job );
14591468
}
14601469

1461-
if ( $this->feedzy_is_business() || $this->feedzy_is_personal() ) {
1462-
$post_content = apply_filters( 'feedzy_parse_custom_tags', $post_content, ! empty( $xml_results ) ? $xml_results['feed'] : $results['feed'], $item['item_index'] );
1470+
if ( $this->feedzy_is_business() ) {
1471+
$post_content = apply_filters( 'feedzy_parse_custom_tags', $post_content, $item_obj );
14631472
}
14641473

14651474
$post_content = apply_filters( 'feedzy_invoke_services', $post_content, 'content', $item['item_description'], $job );
@@ -1525,8 +1534,8 @@ private function run_job( $job, $max ) {
15251534
$post_excerpt
15261535
);
15271536

1528-
if ( $this->feedzy_is_business() || $this->feedzy_is_personal() ) {
1529-
$item_post_excerpt = apply_filters( 'feedzy_parse_custom_tags', $item_post_excerpt, ! empty( $xml_results ) ? $xml_results['feed'] : $results['feed'], $item['item_index'] );
1537+
if ( $this->feedzy_is_business() ) {
1538+
$item_post_excerpt = apply_filters( 'feedzy_parse_custom_tags', $item_post_excerpt, $item_obj );
15301539
}
15311540

15321541
$new_post = apply_filters(
@@ -1571,8 +1580,9 @@ private function run_job( $job, $max ) {
15711580
} elseif ( strpos( $import_featured_img, '[#item_custom' ) !== false ) {
15721581
// custom image tag
15731582
if ( $this->feedzy_is_business() || $this->feedzy_is_personal() ) {
1574-
$value = apply_filters( 'feedzy_parse_custom_tags', $import_featured_img, $results['feed'], $index );
1583+
$value = apply_filters( 'feedzy_parse_custom_tags', $import_featured_img, $item_obj );
15751584
}
1585+
15761586
if ( ! empty( $value ) && strpos( $value, '[#item_custom' ) === false ) {
15771587
$image_url = $value;
15781588
} else {
@@ -1647,7 +1657,7 @@ private function run_job( $job, $max ) {
16471657
}
16481658
}
16491659

1650-
do_action( 'feedzy_import_extra', $job, ! empty( $xml_results ) ? $xml_results : $results, $new_post_id, $index, $item['item_index'], $import_errors, $import_info );
1660+
do_action( 'feedzy_import_extra', $job, $item_obj, $new_post_id, $import_errors, $import_info );
16511661

16521662
if ( ! empty( $import_featured_img ) && 'attachment' !== $import_post_type ) {
16531663
$image_url = '';
@@ -1664,7 +1674,7 @@ private function run_job( $job, $max ) {
16641674
} elseif ( strpos( $import_featured_img, '[#item_custom' ) !== false ) {
16651675
// custom image tag
16661676
if ( $this->feedzy_is_business() || $this->feedzy_is_personal() ) {
1667-
$value = apply_filters( 'feedzy_parse_custom_tags', $import_featured_img, ! empty( $xml_results ) ? $xml_results['feed'] : $results['feed'], $index );
1677+
$value = apply_filters( 'feedzy_parse_custom_tags', $import_featured_img, $item_obj );
16681678
}
16691679
if ( ! empty( $value ) && strpos( $value, '[#item_custom' ) === false ) {
16701680
$image_url = $value;

includes/elementor/controls/template-layout.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public function enqueue() {
4040
<h3>' . esc_html__( 'Discover Feedzy Pro', 'feedzy-rss-feeds' ) . '</h3>
4141
<p>' . esc_html__( 'With Feedzy Pro you get more features, like Custom Templates, Magic Tags, Keywords filters and much more.', 'feedzy-rss-feeds' ) . '</p>
4242
<div class="docs-btn">
43-
<a href="' . esc_url( 'https://docs.themeisle.com/article/1119-feedzy-rss-feeds-documentation' ) . '" target="_blank">' . esc_html__( 'Learn more', 'feedzy-rss-feeds' ) . '</a>
44-
<span>' . esc_html__( 'Open Feedzy docs', 'feedzy-rss-feeds' ) . '</span>
43+
<a href="' . FEEDZY_UPSELL_LINK . '" target="_blank" class="fz-upgrade-link">' . esc_html__( 'Learn more', 'feedzy-rss-feeds' ) . '</a>
44+
<span><a href="' . esc_url( 'https://docs.themeisle.com/article/1119-feedzy-rss-feeds-documentation' ) . '" target="_blank">' . esc_html__( 'Open Feedzy docs', 'feedzy-rss-feeds' ) . '</a></span>
4545
</div>
4646
</div>';
4747
}

includes/feedzy-rss-feeds-feed-tweaks.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ function display_external_post_image( $html, $post_id, $post_thumbnail_id, $size
7878
$alt = get_the_title( $post_id );
7979
$attr['alt'] = $alt;
8080
$attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, '', '' );
81+
if ( isset( $attr['style'] ) ) {
82+
unset( $attr['style'] );
83+
}
8184
$attr = array_map( 'esc_attr', $attr );
8285
$html = sprintf( '<img src="%s"', esc_url( $url ) );
8386
foreach ( $attr as $name => $value ) {

includes/feedzy-rss-feeds.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ private function define_admin_hooks() {
277277
self::$instance->loader->add_action( 'admin_notices', $plugin_import, 'feedzy_import_clone_success_notice' );
278278
// Remove elementor feature.
279279
self::$instance->loader->add_action( 'elementor/experiments/feature-registered', self::$instance->admin, 'feedzy_remove_elementor_feature', 10, 2 );
280-
280+
// Remove widget.
281+
self::$instance->loader->add_filter( 'elementor/widgets/black_list', self::$instance->admin, 'feedzy_remove_elementor_widgets' );
281282
// Register elementor widget.
282283
$plugin_elementor_widget = new Feedzy_Rss_Feeds_Elementor();
283284
$this->loader->add_action( 'elementor/widgets/register', $plugin_elementor_widget, 'feedzy_elementor_widgets_registered' );

includes/gutenberg/build/block.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/gutenberg/build/block.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)