Version Description
Download this release
Release Info
Developer | themeisle |
Plugin | FEEDZY RSS Feeds Lite |
Version | 4.1.0 |
Comparing to | |
See all releases |
Code changes from version 4.0.5 to 4.1.0
- CHANGELOG.md +8 -0
- css/feedzy-elementor-widget.css +56 -0
- css/feedzy-rss-feeds.css +31 -1
- css/form.css +47 -0
- css/settings.css +33 -0
- feedzy-rss-feed.php +1 -1
- form/form.php +14 -0
- includes/abstract/feedzy-rss-feeds-admin-abstract.php +105 -20
- includes/admin/feedzy-rss-feeds-admin.php +11 -4
- includes/admin/feedzy-rss-feeds-import.php +60 -27
- includes/elementor/controls/template-layout.php +13 -0
- includes/elementor/feedzy-rss-feeds-elementor.php +42 -0
- includes/feedzy-rss-feeds-feed-tweaks.php +5 -1
- includes/feedzy-rss-feeds.php +1 -1
- includes/gutenberg/build/block.css +1 -1
- includes/gutenberg/build/block.js +2 -2
- includes/layouts/settings.php +19 -2
- includes/views/amazon-product-advertising-view.php +61 -0
- includes/views/import-metabox-edit.php +17 -1
- includes/views/js/import-metabox-edit.js +6 -0
- js/feedzy-elementor-widget.js +17 -0
- js/feedzy-setting.js +1 -1
- readme.txt +12 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +7 -7
- vendor/composer/autoload_static.php +2 -2
- vendor/composer/installed.json +0 -4
- vendor/composer/installed.php +6 -6
CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
##### [Version 4.0.5](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v4.0.4...v4.0.5) (2022-10-26)
|
2 |
|
3 |
* Fix possible cache expiration filter change.
|
1 |
+
#### [Version 4.1.0](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v4.0.5...v4.1.0) (2022-12-06)
|
2 |
+
|
3 |
+
|
4 |
+
- Improve tag items selections on the import screen [#701](https://github.com/Codeinwp/feedzy-rss-feeds/issues/701)
|
5 |
+
- Allow adding all the Magic tags in one flow [#697](https://github.com/Codeinwp/feedzy-rss-feeds/issues/697)
|
6 |
+
- Improve image import support in PRO
|
7 |
+
- Improve full content import in various languages
|
8 |
+
|
9 |
##### [Version 4.0.5](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v4.0.4...v4.0.5) (2022-10-26)
|
10 |
|
11 |
* Fix possible cache expiration filter change.
|
css/feedzy-elementor-widget.css
CHANGED
@@ -125,3 +125,59 @@
|
|
125 |
.fz-light-mode .docs-btn span {
|
126 |
color: #757575;
|
127 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
.fz-light-mode .docs-btn span {
|
126 |
color: #757575;
|
127 |
}
|
128 |
+
|
129 |
+
.fz-upsell-notice.light-mode {
|
130 |
+
padding: 12px;
|
131 |
+
background: #F3FCFF;
|
132 |
+
border-left: 3px solid #4268CF;
|
133 |
+
font-style: italic;
|
134 |
+
color: #6D7882;
|
135 |
+
margin: 10px 15px;
|
136 |
+
position: relative;
|
137 |
+
}
|
138 |
+
.fz-upsell-notice.light-mode a {
|
139 |
+
color: #4268CF;
|
140 |
+
font-weight: 700;
|
141 |
+
}
|
142 |
+
.fz-upsell-notice.light-mode .remove-alert {
|
143 |
+
color: #6F7882;
|
144 |
+
font-weight: 400;
|
145 |
+
background: none;
|
146 |
+
border: none;
|
147 |
+
outline: none;
|
148 |
+
cursor: pointer;
|
149 |
+
position: absolute;
|
150 |
+
top: 4px;
|
151 |
+
right: 4px;
|
152 |
+
}
|
153 |
+
.fz-upsell-notice.light-mode .remove-alert:hover {
|
154 |
+
color: #6F7882;
|
155 |
+
}
|
156 |
+
|
157 |
+
.fz-upsell-notice.dark-mode {
|
158 |
+
padding: 12px;
|
159 |
+
background: #4C4F56;
|
160 |
+
border-left: 3px solid #71D7F7;
|
161 |
+
font-style: italic;
|
162 |
+
color: #E0E1E3;
|
163 |
+
margin: 10px 15px;
|
164 |
+
position: relative;
|
165 |
+
}
|
166 |
+
.fz-upsell-notice.dark-mode a {
|
167 |
+
color: #71D7F7;
|
168 |
+
font-weight: 700;
|
169 |
+
}
|
170 |
+
.fz-upsell-notice.dark-mode .remove-alert {
|
171 |
+
color: #E0E1E3;
|
172 |
+
font-weight: 400;
|
173 |
+
background: none;
|
174 |
+
border: none;
|
175 |
+
outline: none;
|
176 |
+
cursor: pointer;
|
177 |
+
position: absolute;
|
178 |
+
top: 4px;
|
179 |
+
right: 4px;
|
180 |
+
}
|
181 |
+
.fz-upsell-notice.dark-mode .remove-alert:hover {
|
182 |
+
color: #E0E1E3;
|
183 |
+
}
|
css/feedzy-rss-feeds.css
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* feedzy-rss-feeds.css
|
3 |
* Feedzy RSS Feed
|
4 |
* Copyright: (c) 2016 Themeisle, themeisle.com
|
5 |
-
* Version: 4.0
|
6 |
* Plugin Name: FEEDZY RSS Feeds
|
7 |
* Plugin URI: http://themeisle.com/plugins/feedzy-rss-feeds/
|
8 |
* Author: Themeisle
|
@@ -454,3 +454,33 @@ input:checked + .feedzy-track:before {
|
|
454 |
.components-select-control {
|
455 |
height:auto;
|
456 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
* feedzy-rss-feeds.css
|
3 |
* Feedzy RSS Feed
|
4 |
* Copyright: (c) 2016 Themeisle, themeisle.com
|
5 |
+
* Version: 4.1.0
|
6 |
* Plugin Name: FEEDZY RSS Feeds
|
7 |
* Plugin URI: http://themeisle.com/plugins/feedzy-rss-feeds/
|
8 |
* Author: Themeisle
|
454 |
.components-select-control {
|
455 |
height:auto;
|
456 |
}
|
457 |
+
/* Elementor page notice */
|
458 |
+
.fz-el-upsell-notice {
|
459 |
+
width: 100%;
|
460 |
+
padding: 15px 36px 15px 15px;
|
461 |
+
background: #CCE5FF;
|
462 |
+
font-size: 13px;
|
463 |
+
text-align: left;
|
464 |
+
color: #264494 !important;
|
465 |
+
font-weight: 400;
|
466 |
+
line-height: 15px;
|
467 |
+
font-style: italic;
|
468 |
+
position: relative;
|
469 |
+
}
|
470 |
+
.fz-el-upsell-notice a{
|
471 |
+
font-weight: 700;
|
472 |
+
color: #264494 !important;
|
473 |
+
}
|
474 |
+
.fz-el-upsell-notice .remove-alert:hover {
|
475 |
+
background: none;
|
476 |
+
}
|
477 |
+
.fz-el-upsell-notice .remove-alert {
|
478 |
+
position: absolute;
|
479 |
+
padding: 0;
|
480 |
+
right: 22px; /*13px;*/
|
481 |
+
top: 50%;
|
482 |
+
margin-top: -10px;
|
483 |
+
font-weight: 400;
|
484 |
+
background: none !important;
|
485 |
+
color: #264494 !important;
|
486 |
+
}
|
css/form.css
CHANGED
@@ -723,3 +723,50 @@ input[disabled],
|
|
723 |
select[disabled] {
|
724 |
cursor: not-allowed;
|
725 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
723 |
select[disabled] {
|
724 |
cursor: not-allowed;
|
725 |
}
|
726 |
+
|
727 |
+
.feedzy-popup-form .upgrade-alert{
|
728 |
+
padding:15px 22px;
|
729 |
+
background: #CCE5FF;
|
730 |
+
text-align: center;
|
731 |
+
font-weight: 400;
|
732 |
+
font-size: 13px;
|
733 |
+
line-height: 15px;
|
734 |
+
color: #264494;
|
735 |
+
position: relative;
|
736 |
+
margin-bottom: 24px;
|
737 |
+
text-align: left;
|
738 |
+
border-left: 4px solid #4268CF;
|
739 |
+
font-style: italic;
|
740 |
+
}
|
741 |
+
.feedzy-popup-form .upgrade-alert a{
|
742 |
+
font-weight: 700;
|
743 |
+
color: #264494;
|
744 |
+
}
|
745 |
+
.feedzy-popup-form .upgrade-alert .remove-alert{
|
746 |
+
position: absolute;
|
747 |
+
right: 18px;
|
748 |
+
top: 50%;
|
749 |
+
margin-top: -12px;
|
750 |
+
width: 24px;
|
751 |
+
height: 24px;
|
752 |
+
background: transparent;
|
753 |
+
border: 0;
|
754 |
+
color: #264494;
|
755 |
+
font-size: 24px;
|
756 |
+
line-height: 1;
|
757 |
+
cursor: pointer;
|
758 |
+
display: flex;
|
759 |
+
align-items: center;
|
760 |
+
justify-content: center;
|
761 |
+
-webkit-border-radius: 24px;
|
762 |
+
-moz-border-radius: 24px;
|
763 |
+
border-radius: 24px;
|
764 |
+
-webkit-transition: background 0.3s ease-in-out;
|
765 |
+
-moz-transition: background 0.3s ease-in-out;
|
766 |
+
-o-transition: background 0.3s ease-in-out;
|
767 |
+
transition: background 0.3s ease-in-out;
|
768 |
+
}
|
769 |
+
.feedzy-popup-form .upgrade-alert .remove-alert:hover{
|
770 |
+
background: #ffffff;
|
771 |
+
color: #4268CF;
|
772 |
+
}
|
css/settings.css
CHANGED
@@ -80,6 +80,7 @@
|
|
80 |
.pb-16{padding-bottom: 16px;}
|
81 |
.pb-30{padding-bottom: 30px;}
|
82 |
.pt-30{padding-top: 30px;}
|
|
|
83 |
.mb-30{margin-bottom: 30px;}
|
84 |
.mb-24{margin-bottom: 24px;}
|
85 |
.mx-320{
|
@@ -883,6 +884,7 @@ input.fz-switch-toggle[type=checkbox]:checked:before{
|
|
883 |
position: relative;
|
884 |
margin-left: 0;
|
885 |
margin-right: 16px;
|
|
|
886 |
}
|
887 |
.fz-form-wrap .tagify__tag>div{
|
888 |
padding: 7px 8px 6px 8px;
|
@@ -1426,4 +1428,35 @@ input.fz-switch-toggle[type=checkbox]:checked:before{
|
|
1426 |
.post-type-feedzy_categories #titlediv #title:focus,
|
1427 |
.post-type-feedzy_categories .widefat:focus{
|
1428 |
border-color: #4268CF;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1429 |
}
|
80 |
.pb-16{padding-bottom: 16px;}
|
81 |
.pb-30{padding-bottom: 30px;}
|
82 |
.pt-30{padding-top: 30px;}
|
83 |
+
.mb-20{margin-bottom: 20px;}
|
84 |
.mb-30{margin-bottom: 30px;}
|
85 |
.mb-24{margin-bottom: 24px;}
|
86 |
.mx-320{
|
884 |
position: relative;
|
885 |
margin-left: 0;
|
886 |
margin-right: 16px;
|
887 |
+
margin-bottom: 16px;
|
888 |
}
|
889 |
.fz-form-wrap .tagify__tag>div{
|
890 |
padding: 7px 8px 6px 8px;
|
1428 |
.post-type-feedzy_categories #titlediv #title:focus,
|
1429 |
.post-type-feedzy_categories .widefat:focus{
|
1430 |
border-color: #4268CF;
|
1431 |
+
}
|
1432 |
+
.fz-upsell-notice {
|
1433 |
+
padding: 8px 32px 8px 8px;
|
1434 |
+
background: #CCE5FF;
|
1435 |
+
font-size: 14px;
|
1436 |
+
text-align: left;
|
1437 |
+
color: #264494;
|
1438 |
+
font-weight: 400;
|
1439 |
+
line-height: 16px;
|
1440 |
+
position: relative;
|
1441 |
+
}
|
1442 |
+
.fz-upsell-notice a,
|
1443 |
+
.fz-upsell-notice .remove-alert {
|
1444 |
+
color: #264494;
|
1445 |
+
font-weight: 400;
|
1446 |
+
}
|
1447 |
+
.fz-upsell-notice .remove-alert:hover {
|
1448 |
+
background: none;
|
1449 |
+
color: #264494;
|
1450 |
+
}
|
1451 |
+
.fz-upsell-notice .remove-alert {
|
1452 |
+
position: absolute;
|
1453 |
+
top: 50%;
|
1454 |
+
right: 8px;
|
1455 |
+
margin-top: -12px;
|
1456 |
+
}
|
1457 |
+
.fz-setting-message {
|
1458 |
+
margin-top: 10px;
|
1459 |
+
}
|
1460 |
+
.fz-select-control {
|
1461 |
+
min-width: 100%;
|
1462 |
}
|
feedzy-rss-feed.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* Plugin Name: Feedzy RSS Feeds Lite
|
16 |
* Plugin URI: https://themeisle.com/plugins/feedzy-rss-feeds/
|
17 |
* 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.
|
18 |
-
* Version: 4.0
|
19 |
* Author: Themeisle
|
20 |
* Author URI: http://themeisle.com
|
21 |
* License: GPL-2.0+
|
15 |
* Plugin Name: Feedzy RSS Feeds Lite
|
16 |
* Plugin URI: https://themeisle.com/plugins/feedzy-rss-feeds/
|
17 |
* 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.
|
18 |
+
* Version: 4.1.0
|
19 |
* Author: Themeisle
|
20 |
* Author URI: http://themeisle.com
|
21 |
* License: GPL-2.0+
|
form/form.php
CHANGED
@@ -31,6 +31,20 @@ $html_parts = Feedzy_Rss_Feeds_Ui_Lang::get_form_elements();
|
|
31 |
foreach ( $html_parts as $item => $section ) {
|
32 |
$output .= '<div class="container feedzy_' . $item . '">';
|
33 |
$output .= '<h5>' . $section['title'] . '</h5>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
if ( isset( $section['description'] ) ) {
|
35 |
$output .= '<p>' . $section['description'] . '</p>';
|
36 |
}
|
31 |
foreach ( $html_parts as $item => $section ) {
|
32 |
$output .= '<div class="container feedzy_' . $item . '">';
|
33 |
$output .= '<h5>' . $section['title'] . '</h5>';
|
34 |
+
if ( ! feedzy_is_pro() && 'section_feed' === $item ) {
|
35 |
+
$upsell_url = add_query_arg(
|
36 |
+
array(
|
37 |
+
'utm_source' => 'wpadmin',
|
38 |
+
'utm_medium' => 'classiceditorshortcode',
|
39 |
+
'utm_campaign' => 'amazonproductadvertising',
|
40 |
+
'utm_content' => 'feedzy-rss-feeds',
|
41 |
+
),
|
42 |
+
FEEDZY_UPSELL_LINK
|
43 |
+
);
|
44 |
+
$output .= '<div class="upgrade-alert">';
|
45 |
+
$output .= wp_sprintf( __( '<strong>NEW! </strong>Enable Amazon Product Advertising feeds to generate affiliate revenue by <a href="%s" target="_blank">upgrading to Feedzy Pro.</a>', 'feedzy-rss-feeds' ), esc_url_raw( $upsell_url ) );
|
46 |
+
$output .= '</div>';
|
47 |
+
}
|
48 |
if ( isset( $section['description'] ) ) {
|
49 |
$output .= '<p>' . $section['description'] . '</p>';
|
50 |
}
|
includes/abstract/feedzy-rss-feeds-admin-abstract.php
CHANGED
@@ -42,7 +42,10 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
|
|
42 |
public function feedzy_define_default_image( $default_img ) {
|
43 |
$doing_import_job = false;
|
44 |
|
45 |
-
if ( wp_doing_ajax() && ! empty( $_POST['_action'] ) && 'run_now' === $_POST['_action'] ) {// phpcs:ignore WordPress.Security.NonceVerification
|
|
|
|
|
|
|
46 |
$doing_import_job = true;
|
47 |
}
|
48 |
if ( ! $doing_import_job && empty( $default_img ) ) {
|
@@ -701,7 +704,21 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
|
|
701 |
public function fetch_feed( $feed_url, $cache = '12_hours', $sc = '' ) {
|
702 |
// Load SimplePie if not already.
|
703 |
do_action( 'feedzy_pre_http_setup', $feed_url );
|
704 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
705 |
// Load SimplePie Instance.
|
706 |
$feed = $this->init_feed( $feed_url, $cache, $sc ); // Not used as log as #41304 is Opened.
|
707 |
|
@@ -714,7 +731,7 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
|
|
714 |
$feed_url = html_entity_decode( $feed_url );
|
715 |
}
|
716 |
|
717 |
-
$feed_url = $this->
|
718 |
|
719 |
$feed = $this->init_feed( $feed_url, $cache, $sc ); // Not used as log as #41304 is Opened.
|
720 |
|
@@ -907,11 +924,18 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
|
|
907 |
*
|
908 |
* @return array
|
909 |
*/
|
910 |
-
protected function
|
911 |
$valid_feed_url = array();
|
912 |
if ( is_array( $feed_url ) ) {
|
913 |
foreach ( $feed_url as $url ) {
|
914 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
915 |
$valid_feed_url[] = $url;
|
916 |
} else {
|
917 |
if ( $echo ) {
|
@@ -920,7 +944,14 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
|
|
920 |
}
|
921 |
}
|
922 |
} else {
|
923 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
924 |
$valid_feed_url[] = $feed_url;
|
925 |
} else {
|
926 |
if ( $echo ) {
|
@@ -940,25 +971,57 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
|
|
940 |
*
|
941 |
* @param string $url The URL to validate.
|
942 |
* @param string $cache The cache string (eg. 1_hour, 30_min etc.).
|
|
|
943 |
*
|
944 |
* @return bool
|
945 |
*/
|
946 |
-
protected function
|
947 |
global $post;
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
958 |
}
|
959 |
}
|
960 |
}
|
961 |
-
|
|
|
|
|
|
|
962 |
}
|
963 |
|
964 |
/**
|
@@ -1403,13 +1466,13 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
|
|
1403 |
|
1404 |
if ( $author_name ) {
|
1405 |
$domain = wp_parse_url( $new_link );
|
1406 |
-
$author_url = '//' . $domain['host'];
|
1407 |
$author_url = apply_filters( 'feedzy_author_url', $author_url, $author_name, $feed_url, $item );
|
1408 |
$content_meta_values['author'] = apply_filters( 'feedzy_meta_author', __( 'by', 'feedzy-rss-feeds' ) . ' <a href="' . $author_url . '" target="' . $sc['target'] . '" title="' . $domain['host'] . '" >' . $author_name . '</a> ', $author_name, $author_url, $feed_source, $feed_url, $item );
|
1409 |
}
|
1410 |
} elseif ( $is_multiple && $meta_args['source'] && ! empty( $feed_source ) ) {
|
1411 |
$domain = wp_parse_url( $new_link );
|
1412 |
-
$author_url = '//' . $domain['host'];
|
1413 |
$author_url = apply_filters( 'feedzy_author_url', $author_url, $feed_source, $feed_url, $item );
|
1414 |
$content_meta_values['author'] = apply_filters( 'feedzy_meta_author', __( 'by', 'feedzy-rss-feeds' ) . ' <a href="' . $author_url . '" target="' . $sc['target'] . '" title="' . $domain['host'] . '" >' . $feed_source . '</a> ', $feed_source, $author_url, $feed_source, $feed_url, $item );
|
1415 |
}
|
@@ -1851,4 +1914,26 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
|
|
1851 |
}
|
1852 |
return $is_valid;
|
1853 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1854 |
}
|
42 |
public function feedzy_define_default_image( $default_img ) {
|
43 |
$doing_import_job = false;
|
44 |
|
45 |
+
if ( wp_doing_ajax() && ! empty( $_POST['_action'] ) && 'run_now' === $_POST['_action'] ) { // phpcs:ignore WordPress.Security.NonceVerification
|
46 |
+
$doing_import_job = true;
|
47 |
+
}
|
48 |
+
if ( wp_doing_cron() ) {
|
49 |
$doing_import_job = true;
|
50 |
}
|
51 |
if ( ! $doing_import_job && empty( $default_img ) ) {
|
704 |
public function fetch_feed( $feed_url, $cache = '12_hours', $sc = '' ) {
|
705 |
// Load SimplePie if not already.
|
706 |
do_action( 'feedzy_pre_http_setup', $feed_url );
|
707 |
+
if ( function_exists( 'feedzy_amazon_get_locale_hosts' ) ) {
|
708 |
+
$amazon_hosts = feedzy_amazon_get_locale_hosts();
|
709 |
+
$url_host = 'webservices.' . wp_parse_url( $feed_url, PHP_URL_HOST );
|
710 |
+
if ( ! empty( $amazon_hosts ) && in_array( $url_host, $amazon_hosts, true ) ) {
|
711 |
+
$feed = $this->init_amazon_api(
|
712 |
+
$feed_url,
|
713 |
+
isset( $sc['refresh'] ) ? $sc['refresh'] : '12_hours',
|
714 |
+
array(
|
715 |
+
'number_of_item' => isset( $sc['max'] ) ? $sc['max'] : 5,
|
716 |
+
'no-cache' => false,
|
717 |
+
)
|
718 |
+
);
|
719 |
+
return $feed;
|
720 |
+
}
|
721 |
+
}
|
722 |
// Load SimplePie Instance.
|
723 |
$feed = $this->init_feed( $feed_url, $cache, $sc ); // Not used as log as #41304 is Opened.
|
724 |
|
731 |
$feed_url = html_entity_decode( $feed_url );
|
732 |
}
|
733 |
|
734 |
+
$feed_url = $this->get_valid_source_urls( $feed_url, $cache );
|
735 |
|
736 |
$feed = $this->init_feed( $feed_url, $cache, $sc ); // Not used as log as #41304 is Opened.
|
737 |
|
924 |
*
|
925 |
* @return array
|
926 |
*/
|
927 |
+
protected function get_valid_source_urls( $feed_url, $cache, $echo = true ) {
|
928 |
$valid_feed_url = array();
|
929 |
if ( is_array( $feed_url ) ) {
|
930 |
foreach ( $feed_url as $url ) {
|
931 |
+
$source_type = 'xml';
|
932 |
+
if ( function_exists( 'feedzy_amazon_get_locale_hosts' ) ) {
|
933 |
+
$amazon_hosts = feedzy_amazon_get_locale_hosts();
|
934 |
+
$url_host = 'webservices.' . wp_parse_url( $url, PHP_URL_HOST );
|
935 |
+
$is_amazon_url = ! empty( $amazon_hosts ) && in_array( $url_host, $amazon_hosts, true ) ? true : false;
|
936 |
+
$source_type = $is_amazon_url ? 'amazon' : $source_type;
|
937 |
+
}
|
938 |
+
if ( $this->check_valid_source( $url, $cache, $source_type ) ) {
|
939 |
$valid_feed_url[] = $url;
|
940 |
} else {
|
941 |
if ( $echo ) {
|
944 |
}
|
945 |
}
|
946 |
} else {
|
947 |
+
$source_type = 'xml';
|
948 |
+
if ( function_exists( 'feedzy_amazon_get_locale_hosts' ) ) {
|
949 |
+
$url_host = 'webservices.' . wp_parse_url( $feed_url, PHP_URL_HOST );
|
950 |
+
$amazon_hosts = feedzy_amazon_get_locale_hosts();
|
951 |
+
$is_amazon_url = ! empty( $amazon_hosts ) && in_array( $url_host, $amazon_hosts, true ) ? true : false;
|
952 |
+
$source_type = $is_amazon_url ? 'amazon' : $source_type;
|
953 |
+
}
|
954 |
+
if ( $this->check_valid_source( $feed_url, $cache, $source_type ) ) {
|
955 |
$valid_feed_url[] = $feed_url;
|
956 |
} else {
|
957 |
if ( $echo ) {
|
971 |
*
|
972 |
* @param string $url The URL to validate.
|
973 |
* @param string $cache The cache string (eg. 1_hour, 30_min etc.).
|
974 |
+
* @param string $source_type Source Type.
|
975 |
*
|
976 |
* @return bool
|
977 |
*/
|
978 |
+
protected function check_valid_source( $url, $cache, $source_type = 'xml' ) {
|
979 |
global $post;
|
980 |
+
|
981 |
+
// phpcs:disable WordPress.Security.NonceVerification
|
982 |
+
if ( null === $post && ! empty( $_POST['id'] ) ) {
|
983 |
+
$post_id = (int) $_POST['id'];
|
984 |
+
} else {
|
985 |
+
$post_id = $post->ID;
|
986 |
+
}
|
987 |
+
$is_valid = true;
|
988 |
+
if ( 'amazon' === $source_type ) {
|
989 |
+
$amazon_api_errors = array();
|
990 |
+
$amazon_products = $this->init_amazon_api(
|
991 |
+
$url,
|
992 |
+
$cache,
|
993 |
+
array(
|
994 |
+
'number_of_item' => 1,
|
995 |
+
'no-cache' => true,
|
996 |
+
)
|
997 |
+
);
|
998 |
+
if ( ! empty( $amazon_products->get_errors() ) ) {
|
999 |
+
$amazon_api_errors['source_type'] = __( '[Amazon Product Advertising API] ', 'feedzy-rss-feeds' );
|
1000 |
+
$amazon_api_errors['source'] = array( $url );
|
1001 |
+
$amazon_api_errors['errors'] = $amazon_products->get_errors();
|
1002 |
+
update_post_meta( $post_id, '__transient_feedzy_invalid_source_errors', $amazon_api_errors );
|
1003 |
+
$is_valid = false;
|
1004 |
+
}
|
1005 |
+
} else {
|
1006 |
+
$feed = $this->init_feed( $url, $cache, array() );
|
1007 |
+
if ( $feed->error() ) {
|
1008 |
+
$is_valid = false;
|
1009 |
+
}
|
1010 |
+
// phpcs:ignore WordPress.Security.NonceVerification
|
1011 |
+
if ( isset( $_POST['feedzy_meta_data']['import_link_author_admin'] ) && 'yes' === $_POST['feedzy_meta_data']['import_link_author_admin'] ) {
|
1012 |
+
if ( $feed->get_items() ) {
|
1013 |
+
$author = $feed->get_items()[0]->get_author();
|
1014 |
+
if ( empty( $author ) ) {
|
1015 |
+
update_post_meta( $post_id, '__transient_feedzy_invalid_dc_namespace', array( $url ) );
|
1016 |
+
$is_valid = false;
|
1017 |
+
}
|
1018 |
}
|
1019 |
}
|
1020 |
}
|
1021 |
+
// Update source type.
|
1022 |
+
update_post_meta( $post_id, '__feedzy_source_type', $source_type );
|
1023 |
+
|
1024 |
+
return $is_valid;
|
1025 |
}
|
1026 |
|
1027 |
/**
|
1466 |
|
1467 |
if ( $author_name ) {
|
1468 |
$domain = wp_parse_url( $new_link );
|
1469 |
+
$author_url = isset( $domain['host'] ) ? '//' . $domain['host'] : '';
|
1470 |
$author_url = apply_filters( 'feedzy_author_url', $author_url, $author_name, $feed_url, $item );
|
1471 |
$content_meta_values['author'] = apply_filters( 'feedzy_meta_author', __( 'by', 'feedzy-rss-feeds' ) . ' <a href="' . $author_url . '" target="' . $sc['target'] . '" title="' . $domain['host'] . '" >' . $author_name . '</a> ', $author_name, $author_url, $feed_source, $feed_url, $item );
|
1472 |
}
|
1473 |
} elseif ( $is_multiple && $meta_args['source'] && ! empty( $feed_source ) ) {
|
1474 |
$domain = wp_parse_url( $new_link );
|
1475 |
+
$author_url = isset( $domain['host'] ) ? '//' . $domain['host'] : '';
|
1476 |
$author_url = apply_filters( 'feedzy_author_url', $author_url, $feed_source, $feed_url, $item );
|
1477 |
$content_meta_values['author'] = apply_filters( 'feedzy_meta_author', __( 'by', 'feedzy-rss-feeds' ) . ' <a href="' . $author_url . '" target="' . $sc['target'] . '" title="' . $domain['host'] . '" >' . $feed_source . '</a> ', $feed_source, $author_url, $feed_source, $feed_url, $item );
|
1478 |
}
|
1914 |
}
|
1915 |
return $is_valid;
|
1916 |
}
|
1917 |
+
|
1918 |
+
/**
|
1919 |
+
* Init amazon API.
|
1920 |
+
*
|
1921 |
+
* @param string[] $urls Source URL.
|
1922 |
+
* @param string $cache Cache time.
|
1923 |
+
* @param array $additional Additional settings.
|
1924 |
+
*
|
1925 |
+
* @return mixed
|
1926 |
+
*/
|
1927 |
+
public function init_amazon_api( $urls, $cache, $additional = array() ) {
|
1928 |
+
$additional['refresh'] = $cache;
|
1929 |
+
$urls = is_array( $urls ) ? $urls : array( $urls );
|
1930 |
+
$amazon_product = new Feedzy_Rss_Feeds_Pro_Amazon_Product_Advertising();
|
1931 |
+
$settings = get_option( 'feedzy-rss-feeds-settings', array() );
|
1932 |
+
foreach ( $urls as $url ) {
|
1933 |
+
$url = str_replace( array( 'http://', 'https://' ), '', $url );
|
1934 |
+
$amazon_product->set_config_option( $url, $settings );
|
1935 |
+
$amazon_product->call_api( $amazon_product->get_api_option( 'access_key' ), $amazon_product->get_api_option( 'secret_key' ), $amazon_product->get_api_option( 'partner_tag' ), $additional );
|
1936 |
+
}
|
1937 |
+
return $amazon_product;
|
1938 |
+
}
|
1939 |
}
|
includes/admin/feedzy-rss-feeds-admin.php
CHANGED
@@ -739,9 +739,8 @@ class Feedzy_Rss_Feeds_Admin extends Feedzy_Rss_Feeds_Admin_Abstract {
|
|
739 |
if ( ! is_array( $urls ) ) {
|
740 |
$urls = array( $urls );
|
741 |
}
|
742 |
-
$valid = $this->
|
743 |
$invalid = array_diff( $urls, $valid );
|
744 |
-
|
745 |
if ( $add_pseudo_transient && ( empty( $valid ) || ! empty( $invalid ) ) ) {
|
746 |
// let's save the invalid urls in a pseudo-transient so that we can show it in the import edit screen.
|
747 |
switch ( $post_type ) {
|
@@ -749,8 +748,9 @@ class Feedzy_Rss_Feeds_Admin extends Feedzy_Rss_Feeds_Admin_Abstract {
|
|
749 |
update_post_meta( $post_id, '__transient_feedzy_category_feed', $invalid );
|
750 |
break;
|
751 |
case 'feedzy_imports':
|
752 |
-
$invalid_dc_namespace
|
753 |
-
|
|
|
754 |
update_post_meta( $post_id, '__transient_feedzy_invalid_source', $invalid );
|
755 |
}
|
756 |
break;
|
@@ -787,6 +787,7 @@ class Feedzy_Rss_Feeds_Admin extends Feedzy_Rss_Feeds_Admin_Abstract {
|
|
787 |
case 'feedzy_imports':
|
788 |
$invalid_source = get_post_meta( $post->ID, '__transient_feedzy_invalid_source', true );
|
789 |
$invalid_dc_namespace = get_post_meta( $post->ID, '__transient_feedzy_invalid_dc_namespace', true );
|
|
|
790 |
if ( $invalid_source ) {
|
791 |
$text = __( 'This source has invalid URLs. Please correct/remove the following', 'feedzy-rss-feeds' );
|
792 |
$invalid = $invalid_source;
|
@@ -795,6 +796,12 @@ class Feedzy_Rss_Feeds_Admin extends Feedzy_Rss_Feeds_Admin_Abstract {
|
|
795 |
$text = __( 'Please enter a valid feed URL to import the author', 'feedzy-rss-feeds' );
|
796 |
$invalid = $invalid_dc_namespace;
|
797 |
delete_post_meta( $post->ID, '__transient_feedzy_invalid_dc_namespace' );
|
|
|
|
|
|
|
|
|
|
|
|
|
798 |
}
|
799 |
break;
|
800 |
default:
|
739 |
if ( ! is_array( $urls ) ) {
|
740 |
$urls = array( $urls );
|
741 |
}
|
742 |
+
$valid = $this->get_valid_source_urls( $urls, '1_mins', false );
|
743 |
$invalid = array_diff( $urls, $valid );
|
|
|
744 |
if ( $add_pseudo_transient && ( empty( $valid ) || ! empty( $invalid ) ) ) {
|
745 |
// let's save the invalid urls in a pseudo-transient so that we can show it in the import edit screen.
|
746 |
switch ( $post_type ) {
|
748 |
update_post_meta( $post_id, '__transient_feedzy_category_feed', $invalid );
|
749 |
break;
|
750 |
case 'feedzy_imports':
|
751 |
+
$invalid_dc_namespace = get_post_meta( $post_id, '__transient_feedzy_invalid_dc_namespace', true );
|
752 |
+
$invalid_source_errors = get_post_meta( $post_id, '__transient_feedzy_invalid_source_errors', true );
|
753 |
+
if ( empty( $invalid_dc_namespace ) && empty( $invalid_source_errors ) ) {
|
754 |
update_post_meta( $post_id, '__transient_feedzy_invalid_source', $invalid );
|
755 |
}
|
756 |
break;
|
787 |
case 'feedzy_imports':
|
788 |
$invalid_source = get_post_meta( $post->ID, '__transient_feedzy_invalid_source', true );
|
789 |
$invalid_dc_namespace = get_post_meta( $post->ID, '__transient_feedzy_invalid_dc_namespace', true );
|
790 |
+
$invalid_source_errors = get_post_meta( $post->ID, '__transient_feedzy_invalid_source_errors', true );
|
791 |
if ( $invalid_source ) {
|
792 |
$text = __( 'This source has invalid URLs. Please correct/remove the following', 'feedzy-rss-feeds' );
|
793 |
$invalid = $invalid_source;
|
796 |
$text = __( 'Please enter a valid feed URL to import the author', 'feedzy-rss-feeds' );
|
797 |
$invalid = $invalid_dc_namespace;
|
798 |
delete_post_meta( $post->ID, '__transient_feedzy_invalid_dc_namespace' );
|
799 |
+
} elseif ( $invalid_source_errors ) {
|
800 |
+
$source_type = ! empty( $invalid_source_errors['source_type'] ) ? $invalid_source_errors['source_type'] : '';
|
801 |
+
$text = join( ', ', $invalid_source_errors['errors'] );
|
802 |
+
$text = $source_type . preg_replace( '/\.$/', '', $text );
|
803 |
+
$invalid = $invalid_source_errors['source'];
|
804 |
+
delete_post_meta( $post->ID, '__transient_feedzy_invalid_source_errors' );
|
805 |
}
|
806 |
break;
|
807 |
default:
|
includes/admin/feedzy-rss-feeds-import.php
CHANGED
@@ -198,7 +198,11 @@ class Feedzy_Rss_Feeds_Import {
|
|
198 |
$categories = $item->get_categories();
|
199 |
if ( $categories ) {
|
200 |
foreach ( $categories as $category ) {
|
201 |
-
|
|
|
|
|
|
|
|
|
202 |
}
|
203 |
}
|
204 |
|
@@ -524,9 +528,10 @@ class Feedzy_Rss_Feeds_Import {
|
|
524 |
if ( 'feedzy_imports' === $post->post_type ) {
|
525 |
// if invalid source has been found, redirect back to edit screen
|
526 |
// where errors can be shown
|
527 |
-
$invalid
|
528 |
-
$invalid_dc_namespace
|
529 |
-
|
|
|
530 |
return admin_url( 'edit.php?post_type=feedzy_imports' );
|
531 |
}
|
532 |
}
|
@@ -619,7 +624,17 @@ class Feedzy_Rss_Feeds_Import {
|
|
619 |
$src = get_post_meta( $post_id, 'source', true );
|
620 |
// if the source is a category, link it.
|
621 |
if ( strpos( $src, 'http' ) === false && strpos( $src, 'https' ) === false ) {
|
622 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
623 |
} else {
|
624 |
// else link it to the feed but shorten it if it is too long.
|
625 |
$too_long = 65;
|
@@ -1351,7 +1366,7 @@ class Feedzy_Rss_Feeds_Import {
|
|
1351 |
// Get translated item title.
|
1352 |
$translated_title = '';
|
1353 |
if ( $import_auto_translation && ( false !== strpos( $import_title, '[#translated_title]' ) || false !== strpos( $post_excerpt, '[#translated_title]' ) ) ) {
|
1354 |
-
$translated_title = apply_filters( 'feedzy_invoke_auto_translate_services', $item['item_title'], '[#translated_title]', $import_translation_lang, $job, $language_code );
|
1355 |
}
|
1356 |
|
1357 |
$post_title = str_replace(
|
@@ -1385,14 +1400,14 @@ class Feedzy_Rss_Feeds_Import {
|
|
1385 |
// Get translated item link text.
|
1386 |
$item_link_txt = __( 'Read More', 'feedzy-rss-feeds' );
|
1387 |
if ( $import_auto_translation && false !== strpos( $import_content, '[#item_url]' ) ) {
|
1388 |
-
$item_link_txt = apply_filters( 'feedzy_invoke_auto_translate_services', $item_link_txt, '[#item_url]', $import_translation_lang, $job, $language_code );
|
1389 |
}
|
1390 |
|
1391 |
$item_link = '<a href="' . $item['item_url'] . '" target="_blank" class="feedzy-rss-link-icon">' . $item_link_txt . '</a>';
|
1392 |
|
1393 |
// Rewriter item title from feedzy API.
|
1394 |
if ( $rewrite_service_endabled && false !== strpos( $post_title, '[#title_feedzy_rewrite]' ) ) {
|
1395 |
-
$title_feedzy_rewrite = apply_filters( 'feedzy_invoke_content_rewrite_services', $item['item_title'], '[#title_feedzy_rewrite]', $job );
|
1396 |
$post_title = str_replace( '[#title_feedzy_rewrite]', $title_feedzy_rewrite, $post_title );
|
1397 |
}
|
1398 |
|
@@ -1406,17 +1421,16 @@ class Feedzy_Rss_Feeds_Import {
|
|
1406 |
// Get translated item description.
|
1407 |
$translated_description = '';
|
1408 |
if ( $import_auto_translation && ( false !== strpos( $import_content, '[#translated_description]' ) || false !== strpos( $post_excerpt, '[#translated_description]' ) ) ) {
|
1409 |
-
$translated_description = apply_filters( 'feedzy_invoke_auto_translate_services', $item['item_full_description'], '[#translated_description]', $import_translation_lang, $job, $language_code );
|
1410 |
}
|
1411 |
|
1412 |
// Get translated item content.
|
1413 |
$translated_content = '';
|
1414 |
if ( $import_auto_translation && ( false !== strpos( $import_content, '[#translated_content]' ) || false !== strpos( $post_excerpt, '[#translated_content]' ) ) ) {
|
1415 |
$translated_content = ! empty( $item['item_content'] ) ? $item['item_content'] : $item['item_description'];
|
1416 |
-
$translated_content = apply_filters( 'feedzy_invoke_auto_translate_services', $translated_content, '[#translated_content]', $import_translation_lang, $job, $language_code );
|
1417 |
}
|
1418 |
|
1419 |
-
// exit;
|
1420 |
$post_content = str_replace(
|
1421 |
array(
|
1422 |
'[#item_description]',
|
@@ -1427,6 +1441,8 @@ class Feedzy_Rss_Feeds_Import {
|
|
1427 |
'[#item_source]',
|
1428 |
'[#translated_description]',
|
1429 |
'[#translated_content]',
|
|
|
|
|
1430 |
),
|
1431 |
array(
|
1432 |
$item['item_description'],
|
@@ -1437,6 +1453,8 @@ class Feedzy_Rss_Feeds_Import {
|
|
1437 |
$item['item_source'],
|
1438 |
$translated_description,
|
1439 |
$translated_content,
|
|
|
|
|
1440 |
),
|
1441 |
$import_content
|
1442 |
);
|
@@ -1475,19 +1493,19 @@ class Feedzy_Rss_Feeds_Import {
|
|
1475 |
|
1476 |
// Translate full-content.
|
1477 |
if ( $import_auto_translation && false !== strpos( $post_content, '[#translated_full_content]' ) ) {
|
1478 |
-
$translated_full_content = apply_filters( 'feedzy_invoke_auto_translate_services', $item['item_url'], '[#translated_full_content]', $import_translation_lang, $job, $language_code );
|
1479 |
$post_content = str_replace( '[#translated_full_content]', rtrim( $translated_full_content, '.' ), $post_content );
|
1480 |
}
|
1481 |
// Rewriter item content from feedzy API.
|
1482 |
if ( $rewrite_service_endabled && false !== strpos( $post_content, '[#content_feedzy_rewrite]' ) ) {
|
1483 |
$item_content = ! empty( $item['item_content'] ) ? $item['item_content'] : $item['item_description'];
|
1484 |
-
$content_feedzy_rewrite = apply_filters( 'feedzy_invoke_content_rewrite_services', $item_content, '[#content_feedzy_rewrite]', $job );
|
1485 |
$post_content = str_replace( '[#content_feedzy_rewrite]', $content_feedzy_rewrite, $post_content );
|
1486 |
}
|
1487 |
|
1488 |
// Rewriter item full content from feedzy API.
|
1489 |
if ( $rewrite_service_endabled && false !== strpos( $post_content, '[#full_content_feedzy_rewrite]' ) ) {
|
1490 |
-
$full_content_feedzy_rewrite = apply_filters( 'feedzy_invoke_content_rewrite_services', $item['item_url'], '[#full_content_feedzy_rewrite]', $job );
|
1491 |
$post_content = str_replace( '[#full_content_feedzy_rewrite]', $full_content_feedzy_rewrite, $post_content );
|
1492 |
}
|
1493 |
|
@@ -1686,7 +1704,7 @@ class Feedzy_Rss_Feeds_Import {
|
|
1686 |
}
|
1687 |
|
1688 |
// Fetch image from graby.
|
1689 |
-
if ( empty( $image_url ) && defined( 'FEEDZY_PRO_FETCH_ITEM_IMG_URL' ) ) {
|
1690 |
// if license does not exist, use the site url
|
1691 |
// this should obviously never happen unless on dev instances.
|
1692 |
$license = apply_filters( 'product_feedzy_license_key', sprintf( 'n/a - %s', get_site_url() ) );
|
@@ -1801,20 +1819,34 @@ class Feedzy_Rss_Feeds_Import {
|
|
1801 |
if ( ! method_exists( $admin, 'normalize_urls' ) ) {
|
1802 |
return array();
|
1803 |
}
|
1804 |
-
$feedURL
|
1805 |
-
|
1806 |
-
$feedURL = apply_filters( 'feedzy_import_feed_url', $feedURL, $import_content, $options );
|
1807 |
-
if ( is_wp_error( $feedURL ) ) {
|
1808 |
-
return $feedURL;
|
1809 |
-
}
|
1810 |
|
1811 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1812 |
|
1813 |
-
|
1814 |
-
|
1815 |
|
1816 |
-
|
1817 |
-
|
|
|
1818 |
}
|
1819 |
$sizes = array(
|
1820 |
'width' => $options['size'],
|
@@ -1822,7 +1854,6 @@ class Feedzy_Rss_Feeds_Import {
|
|
1822 |
);
|
1823 |
$sizes = apply_filters( 'feedzy_thumb_sizes', $sizes, $feedURL );
|
1824 |
$feed_items = apply_filters( 'feedzy_get_feed_array', array(), $options, $feed, $feedURL, $sizes );
|
1825 |
-
|
1826 |
if ( $raw_feed_also ) {
|
1827 |
return array(
|
1828 |
'items' => $feed_items,
|
@@ -2050,6 +2081,7 @@ class Feedzy_Rss_Feeds_Import {
|
|
2050 |
if ( ! feedzy_is_pro() ) {
|
2051 |
$tabs['wordai'] = sprintf( '%s <span class="pro-label">PRO</span>', __( 'WordAi', 'feedzy-rss-feeds' ) );
|
2052 |
$tabs['spinnerchief'] = sprintf( '%s <span class="pro-label">PRO</span>', __( 'SpinnerChief', 'feedzy-rss-feeds' ) );
|
|
|
2053 |
}
|
2054 |
|
2055 |
return $tabs;
|
@@ -2089,6 +2121,7 @@ class Feedzy_Rss_Feeds_Import {
|
|
2089 |
break;
|
2090 |
case 'wordai':
|
2091 |
case 'spinnerchief':
|
|
|
2092 |
if ( ! feedzy_is_pro() ) {
|
2093 |
$file = FEEDZY_ABSPATH . '/includes/views/' . $name . '-view.php';
|
2094 |
} else {
|
198 |
$categories = $item->get_categories();
|
199 |
if ( $categories ) {
|
200 |
foreach ( $categories as $category ) {
|
201 |
+
if ( is_string( $category ) ) {
|
202 |
+
$cats[] = $category;
|
203 |
+
} else {
|
204 |
+
$cats[] = $category->get_label();
|
205 |
+
}
|
206 |
}
|
207 |
}
|
208 |
|
528 |
if ( 'feedzy_imports' === $post->post_type ) {
|
529 |
// if invalid source has been found, redirect back to edit screen
|
530 |
// where errors can be shown
|
531 |
+
$invalid = get_post_meta( $post_id, '__transient_feedzy_invalid_source', true );
|
532 |
+
$invalid_dc_namespace = get_post_meta( $post_id, '__transient_feedzy_invalid_dc_namespace', true );
|
533 |
+
$invalid_source_errors = get_post_meta( $post_id, '__transient_feedzy_invalid_source_errors', true );
|
534 |
+
if ( empty( $invalid ) && empty( $invalid_dc_namespace ) && empty( $invalid_source_errors ) ) {
|
535 |
return admin_url( 'edit.php?post_type=feedzy_imports' );
|
536 |
}
|
537 |
}
|
624 |
$src = get_post_meta( $post_id, 'source', true );
|
625 |
// if the source is a category, link it.
|
626 |
if ( strpos( $src, 'http' ) === false && strpos( $src, 'https' ) === false ) {
|
627 |
+
if ( function_exists( 'feedzy_amazon_get_locale_hosts' ) ) {
|
628 |
+
$amazon_hosts = feedzy_amazon_get_locale_hosts();
|
629 |
+
$src_path = 'webservices.' . wp_parse_url( $src, PHP_URL_PATH );
|
630 |
+
if ( in_array( $src_path, $amazon_hosts, true ) ) {
|
631 |
+
$src = sprintf( '%s: %s%s%s', __( 'Amazon Product Advertising API', 'feedzy-rss-feeds' ), '<a>', $src, '</a>' );
|
632 |
+
} else {
|
633 |
+
$src = sprintf( '%s: %s%s%s', __( 'Feed Category', 'feedzy-rss-feeds' ), '<a href="' . admin_url( 'edit.php?post_type=feedzy_categories' ) . '" target="_blank">', $src, '</a>' );
|
634 |
+
}
|
635 |
+
} else {
|
636 |
+
$src = sprintf( '%s: %s%s%s', __( 'Feed Category', 'feedzy-rss-feeds' ), '<a href="' . admin_url( 'edit.php?post_type=feedzy_categories' ) . '" target="_blank">', $src, '</a>' );
|
637 |
+
}
|
638 |
} else {
|
639 |
// else link it to the feed but shorten it if it is too long.
|
640 |
$too_long = 65;
|
1366 |
// Get translated item title.
|
1367 |
$translated_title = '';
|
1368 |
if ( $import_auto_translation && ( false !== strpos( $import_title, '[#translated_title]' ) || false !== strpos( $post_excerpt, '[#translated_title]' ) ) ) {
|
1369 |
+
$translated_title = apply_filters( 'feedzy_invoke_auto_translate_services', $item['item_title'], '[#translated_title]', $import_translation_lang, $job, $language_code, $item );
|
1370 |
}
|
1371 |
|
1372 |
$post_title = str_replace(
|
1400 |
// Get translated item link text.
|
1401 |
$item_link_txt = __( 'Read More', 'feedzy-rss-feeds' );
|
1402 |
if ( $import_auto_translation && false !== strpos( $import_content, '[#item_url]' ) ) {
|
1403 |
+
$item_link_txt = apply_filters( 'feedzy_invoke_auto_translate_services', $item_link_txt, '[#item_url]', $import_translation_lang, $job, $language_code, $item );
|
1404 |
}
|
1405 |
|
1406 |
$item_link = '<a href="' . $item['item_url'] . '" target="_blank" class="feedzy-rss-link-icon">' . $item_link_txt . '</a>';
|
1407 |
|
1408 |
// Rewriter item title from feedzy API.
|
1409 |
if ( $rewrite_service_endabled && false !== strpos( $post_title, '[#title_feedzy_rewrite]' ) ) {
|
1410 |
+
$title_feedzy_rewrite = apply_filters( 'feedzy_invoke_content_rewrite_services', $item['item_title'], '[#title_feedzy_rewrite]', $job, $item );
|
1411 |
$post_title = str_replace( '[#title_feedzy_rewrite]', $title_feedzy_rewrite, $post_title );
|
1412 |
}
|
1413 |
|
1421 |
// Get translated item description.
|
1422 |
$translated_description = '';
|
1423 |
if ( $import_auto_translation && ( false !== strpos( $import_content, '[#translated_description]' ) || false !== strpos( $post_excerpt, '[#translated_description]' ) ) ) {
|
1424 |
+
$translated_description = apply_filters( 'feedzy_invoke_auto_translate_services', $item['item_full_description'], '[#translated_description]', $import_translation_lang, $job, $language_code, $item );
|
1425 |
}
|
1426 |
|
1427 |
// Get translated item content.
|
1428 |
$translated_content = '';
|
1429 |
if ( $import_auto_translation && ( false !== strpos( $import_content, '[#translated_content]' ) || false !== strpos( $post_excerpt, '[#translated_content]' ) ) ) {
|
1430 |
$translated_content = ! empty( $item['item_content'] ) ? $item['item_content'] : $item['item_description'];
|
1431 |
+
$translated_content = apply_filters( 'feedzy_invoke_auto_translate_services', $translated_content, '[#translated_content]', $import_translation_lang, $job, $language_code, $item );
|
1432 |
}
|
1433 |
|
|
|
1434 |
$post_content = str_replace(
|
1435 |
array(
|
1436 |
'[#item_description]',
|
1441 |
'[#item_source]',
|
1442 |
'[#translated_description]',
|
1443 |
'[#translated_content]',
|
1444 |
+
'[#item_price]',
|
1445 |
+
'[#item_author]',
|
1446 |
),
|
1447 |
array(
|
1448 |
$item['item_description'],
|
1453 |
$item['item_source'],
|
1454 |
$translated_description,
|
1455 |
$translated_content,
|
1456 |
+
! empty( $item['item_price'] ) ? $item['item_price'] : '',
|
1457 |
+
$author,
|
1458 |
),
|
1459 |
$import_content
|
1460 |
);
|
1493 |
|
1494 |
// Translate full-content.
|
1495 |
if ( $import_auto_translation && false !== strpos( $post_content, '[#translated_full_content]' ) ) {
|
1496 |
+
$translated_full_content = apply_filters( 'feedzy_invoke_auto_translate_services', $item['item_url'], '[#translated_full_content]', $import_translation_lang, $job, $language_code, $item );
|
1497 |
$post_content = str_replace( '[#translated_full_content]', rtrim( $translated_full_content, '.' ), $post_content );
|
1498 |
}
|
1499 |
// Rewriter item content from feedzy API.
|
1500 |
if ( $rewrite_service_endabled && false !== strpos( $post_content, '[#content_feedzy_rewrite]' ) ) {
|
1501 |
$item_content = ! empty( $item['item_content'] ) ? $item['item_content'] : $item['item_description'];
|
1502 |
+
$content_feedzy_rewrite = apply_filters( 'feedzy_invoke_content_rewrite_services', $item_content, '[#content_feedzy_rewrite]', $job, $item );
|
1503 |
$post_content = str_replace( '[#content_feedzy_rewrite]', $content_feedzy_rewrite, $post_content );
|
1504 |
}
|
1505 |
|
1506 |
// Rewriter item full content from feedzy API.
|
1507 |
if ( $rewrite_service_endabled && false !== strpos( $post_content, '[#full_content_feedzy_rewrite]' ) ) {
|
1508 |
+
$full_content_feedzy_rewrite = apply_filters( 'feedzy_invoke_content_rewrite_services', $item['item_url'], '[#full_content_feedzy_rewrite]', $job, $item );
|
1509 |
$post_content = str_replace( '[#full_content_feedzy_rewrite]', $full_content_feedzy_rewrite, $post_content );
|
1510 |
}
|
1511 |
|
1704 |
}
|
1705 |
|
1706 |
// Fetch image from graby.
|
1707 |
+
if ( empty( $image_url ) && ( wp_doing_cron() || defined( 'FEEDZY_PRO_FETCH_ITEM_IMG_URL' ) ) ) {
|
1708 |
// if license does not exist, use the site url
|
1709 |
// this should obviously never happen unless on dev instances.
|
1710 |
$license = apply_filters( 'product_feedzy_license_key', sprintf( 'n/a - %s', get_site_url() ) );
|
1819 |
if ( ! method_exists( $admin, 'normalize_urls' ) ) {
|
1820 |
return array();
|
1821 |
}
|
1822 |
+
$feedURL = $admin->normalize_urls( $options['feeds'] );
|
1823 |
+
$source_type = get_post_meta( $options['__jobID'], '__feedzy_source_type', true );
|
|
|
|
|
|
|
|
|
1824 |
|
1825 |
+
if ( 'amazon' === $source_type ) {
|
1826 |
+
$feed = $admin->init_amazon_api(
|
1827 |
+
$feedURL,
|
1828 |
+
isset( $options['refresh'] ) ? $options['refresh'] : '12_hours',
|
1829 |
+
array(
|
1830 |
+
'number_of_item' => $options['max'],
|
1831 |
+
'no-cache' => false,
|
1832 |
+
)
|
1833 |
+
);
|
1834 |
+
if ( ! empty( $feed->get_errors() ) ) {
|
1835 |
+
return array();
|
1836 |
+
}
|
1837 |
+
} else {
|
1838 |
+
$feedURL = apply_filters( 'feedzy_import_feed_url', $feedURL, $import_content, $options );
|
1839 |
+
if ( is_wp_error( $feedURL ) ) {
|
1840 |
+
return $feedURL;
|
1841 |
+
}
|
1842 |
+
$feed = $admin->fetch_feed( $feedURL, isset( $options['refresh'] ) ? $options['refresh'] : '12_hours', $options );
|
1843 |
|
1844 |
+
$feed->force_feed( true );
|
1845 |
+
$feed->enable_order_by_date( false );
|
1846 |
|
1847 |
+
if ( is_string( $feed ) ) {
|
1848 |
+
return array();
|
1849 |
+
}
|
1850 |
}
|
1851 |
$sizes = array(
|
1852 |
'width' => $options['size'],
|
1854 |
);
|
1855 |
$sizes = apply_filters( 'feedzy_thumb_sizes', $sizes, $feedURL );
|
1856 |
$feed_items = apply_filters( 'feedzy_get_feed_array', array(), $options, $feed, $feedURL, $sizes );
|
|
|
1857 |
if ( $raw_feed_also ) {
|
1858 |
return array(
|
1859 |
'items' => $feed_items,
|
2081 |
if ( ! feedzy_is_pro() ) {
|
2082 |
$tabs['wordai'] = sprintf( '%s <span class="pro-label">PRO</span>', __( 'WordAi', 'feedzy-rss-feeds' ) );
|
2083 |
$tabs['spinnerchief'] = sprintf( '%s <span class="pro-label">PRO</span>', __( 'SpinnerChief', 'feedzy-rss-feeds' ) );
|
2084 |
+
$tabs['amazon-product-advertising'] = sprintf( '%s <span class="pro-label">PRO</span>', __( 'Amazon Product Advertising', 'feedzy-rss-feeds' ) );
|
2085 |
}
|
2086 |
|
2087 |
return $tabs;
|
2121 |
break;
|
2122 |
case 'wordai':
|
2123 |
case 'spinnerchief':
|
2124 |
+
case 'amazon-product-advertising':
|
2125 |
if ( ! feedzy_is_pro() ) {
|
2126 |
$file = FEEDZY_ABSPATH . '/includes/views/' . $name . '-view.php';
|
2127 |
} else {
|
includes/elementor/controls/template-layout.php
CHANGED
@@ -45,12 +45,25 @@ class Control_Template_Layout extends Base_Data_Control {
|
|
45 |
</div>
|
46 |
</div>';
|
47 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
wp_localize_script(
|
49 |
'feedzy-elementor',
|
50 |
'FeedzyElementorEditor',
|
51 |
array(
|
52 |
'notice' => $notice_text,
|
53 |
'pro_title_text' => __( 'Unlock this feature with Feedzy Pro', 'feedzy-rss-feeds' ),
|
|
|
54 |
)
|
55 |
);
|
56 |
}
|
45 |
</div>
|
46 |
</div>';
|
47 |
}
|
48 |
+
$upsell_notice = '<div class="fz-upsell-notice">';
|
49 |
+
$upsell_url = add_query_arg(
|
50 |
+
array(
|
51 |
+
'utm_source' => 'wpadmin',
|
52 |
+
'utm_medium' => 'elementoreditor',
|
53 |
+
'utm_campaign' => 'amazonproductadvertising',
|
54 |
+
'utm_content' => 'feedzy-rss-feeds',
|
55 |
+
),
|
56 |
+
FEEDZY_UPSELL_LINK
|
57 |
+
);
|
58 |
+
$upsell_notice .= wp_kses_post( wp_sprintf( __( '<strong>NEW! </strong>Enable Amazon Product Advertising feeds to generate affiliate revenue by <a href="%s" target="_blank">upgrading to Feedzy Pro.</a><button type="button" class="remove-alert"><span class="dashicons dashicons-no-alt"></span></button>', 'feedzy-rss-feeds' ), esc_url_raw( $upsell_url ) ) );
|
59 |
+
$upsell_notice .= '<div>';
|
60 |
wp_localize_script(
|
61 |
'feedzy-elementor',
|
62 |
'FeedzyElementorEditor',
|
63 |
array(
|
64 |
'notice' => $notice_text,
|
65 |
'pro_title_text' => __( 'Unlock this feature with Feedzy Pro', 'feedzy-rss-feeds' ),
|
66 |
+
'upsell_notice' => ! feedzy_is_pro() ? $upsell_notice : '',
|
67 |
)
|
68 |
);
|
69 |
}
|
includes/elementor/feedzy-rss-feeds-elementor.php
CHANGED
@@ -43,6 +43,7 @@ class Feedzy_Rss_Feeds_Elementor {
|
|
43 |
\Elementor\Plugin::instance()->widgets_manager->register( new Feedzy_Register_Widget() );
|
44 |
|
45 |
add_action( 'elementor/editor/after_enqueue_styles', array( $this, 'feedzy_elementor_widgets_assets' ) );
|
|
|
46 |
}
|
47 |
}
|
48 |
|
@@ -58,4 +59,45 @@ class Feedzy_Rss_Feeds_Elementor {
|
|
58 |
$controls_manager->register( new \Elementor\Control_Date_Time_Local() );
|
59 |
$controls_manager->register( new \Elementor\Control_Template_Layout() );
|
60 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
43 |
\Elementor\Plugin::instance()->widgets_manager->register( new Feedzy_Register_Widget() );
|
44 |
|
45 |
add_action( 'elementor/editor/after_enqueue_styles', array( $this, 'feedzy_elementor_widgets_assets' ) );
|
46 |
+
add_action( 'elementor/widget/before_render_content', array( $this, 'feedzy_elementor_editor_upsell_notice' ) );
|
47 |
}
|
48 |
}
|
49 |
|
59 |
$controls_manager->register( new \Elementor\Control_Date_Time_Local() );
|
60 |
$controls_manager->register( new \Elementor\Control_Template_Layout() );
|
61 |
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Widget render before.
|
65 |
+
*
|
66 |
+
* @param object $widget Elementor widget object.
|
67 |
+
* @return void
|
68 |
+
*/
|
69 |
+
public function feedzy_elementor_editor_upsell_notice( $widget ) {
|
70 |
+
if ( 'feedzy-rss-feeds' === $widget->get_name() ) {
|
71 |
+
if ( ! feedzy_is_pro() && \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
|
72 |
+
$upsell_url = add_query_arg(
|
73 |
+
array(
|
74 |
+
'utm_source' => 'wpadmin',
|
75 |
+
'utm_medium' => 'elementoreditor',
|
76 |
+
'utm_campaign' => 'amazonproductadvertising',
|
77 |
+
'utm_content' => 'feedzy-rss-feeds',
|
78 |
+
),
|
79 |
+
FEEDZY_UPSELL_LINK
|
80 |
+
);
|
81 |
+
echo '<div class="fz-el-upsell-notice">';
|
82 |
+
echo wp_kses_post( wp_sprintf( __( '<strong>NEW! </strong>Enable Amazon Product Advertising feeds to generate affiliate revenue by <a href="%s" target="_blank" class="upsell_link">upgrading to Feedzy Pro.</a><button type="button" class="remove-alert"><span class="dashicons dashicons-no-alt"></span></button>', 'feedzy-rss-feeds' ), esc_url_raw( $upsell_url ) ) );
|
83 |
+
echo '<script>';
|
84 |
+
echo "jQuery( document ).ready( function() {
|
85 |
+
jQuery( document ).on( 'click', '.fz-el-upsell-notice .remove-alert', function() {
|
86 |
+
var upSellNotice = jQuery(this).parents( '.fz-el-upsell-notice' );
|
87 |
+
upSellNotice.fadeOut( 500,
|
88 |
+
function() {
|
89 |
+
upSellNotice.remove();
|
90 |
+
}
|
91 |
+
);
|
92 |
+
return false;
|
93 |
+
} );
|
94 |
+
jQuery( document ).on( 'click', '.fz-el-upsell-notice .upsell_link', function() {
|
95 |
+
window.open( jQuery(this).attr( 'href' ), '_blank' ).focus();
|
96 |
+
} );
|
97 |
+
} );";
|
98 |
+
echo '</script>';
|
99 |
+
echo '</div>';
|
100 |
+
}
|
101 |
+
}
|
102 |
+
}
|
103 |
}
|
includes/feedzy-rss-feeds-feed-tweaks.php
CHANGED
@@ -283,6 +283,7 @@ add_filter(
|
|
283 |
'span' => array(
|
284 |
'class' => array(),
|
285 |
'disabled' => array(),
|
|
|
286 |
),
|
287 |
'div' => array(
|
288 |
'class' => array(),
|
@@ -318,7 +319,10 @@ add_filter(
|
|
318 |
),
|
319 |
'br' => array(),
|
320 |
'em' => array(),
|
321 |
-
'strong' => array(
|
|
|
|
|
|
|
322 |
'iframe' => array(
|
323 |
'src' => array(),
|
324 |
'height' => array(),
|
283 |
'span' => array(
|
284 |
'class' => array(),
|
285 |
'disabled' => array(),
|
286 |
+
'style' => array(),
|
287 |
),
|
288 |
'div' => array(
|
289 |
'class' => array(),
|
319 |
),
|
320 |
'br' => array(),
|
321 |
'em' => array(),
|
322 |
+
'strong' => array(
|
323 |
+
'class' => array(),
|
324 |
+
'style' => array(),
|
325 |
+
),
|
326 |
'iframe' => array(
|
327 |
'src' => array(),
|
328 |
'height' => array(),
|
includes/feedzy-rss-feeds.php
CHANGED
@@ -104,7 +104,7 @@ class Feedzy_Rss_Feeds {
|
|
104 |
*/
|
105 |
public function init() {
|
106 |
self::$plugin_name = 'feedzy-rss-feeds';
|
107 |
-
self::$version = '4.0
|
108 |
self::$instance->load_dependencies();
|
109 |
self::$instance->set_locale();
|
110 |
self::$instance->define_admin_hooks();
|
104 |
*/
|
105 |
public function init() {
|
106 |
self::$plugin_name = 'feedzy-rss-feeds';
|
107 |
+
self::$version = '4.1.0';
|
108 |
self::$instance->load_dependencies();
|
109 |
self::$instance->set_locale();
|
110 |
self::$instance->define_admin_hooks();
|
includes/gutenberg/build/block.css
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
.wp-block-feedzy-rss-feeds-feedzy-block .feedzy-source-wrap{position:relative}.wp-block-feedzy-rss-feeds-feedzy-block .feedzy-source{margin-right:10px}.wp-block-feedzy-rss-feeds-feedzy-block .feedzy-source+.dashicons-arrow-down-alt2{position:absolute;right:12px;top:5px;z-index:5;color:#757575;cursor:pointer}.loadFeed{margin-bottom:10px}.feedzy-blocks-base-control{padding-bottom:10px}.feedzy-blocks-base-control label{padding-bottom:10px}.feedzy-blocks-base-control .feedzy_image_upload{display:block;margin-bottom:10px}.feedzy-select-cat{width:100%}.feedzy-select-cat select{width:auto}.feedzy-rss .rss_image span.fetched{display:inline-block;position:absolute;width:100%;height:100%;background-position:50%;background-size:cover}.feedzy-ui-autocomplete{max-height:200px;overflow-y:auto;overflow-x:hidden;padding-right:20px}.fz-section-header-panel.is-opened{padding:0}.fz-section-header-panel .header-tab{display:inline-block;width:calc( 100% / 3 );height:auto;padding:10px 20px;text-align:center;cursor:pointer}.fz-section-header-panel .header-tab.is-selected{border-bottom:2px solid #0085ba;background:#f3f4f5}.fz-section-header-panel .header-tab:hover:not(:disabled):not([aria-disabled=true]):not(.is-secondary):not(.is-primary):not(.is-tertiary):not(.is-link){background:#f3f4f5;box-shadow:none}.fz-section-header-panel .header-tab span{display:inline-block;font-size:12px}.fz-section-header-panel .header-tab span .dashicon{display:block;margin:0 auto;font-size:20px}.block-editor-block-inspector .components-base-control{margin:24px 0}.fz-locked{cursor:not-allowed}.fz-locked>div:not(.fz-upsell-notice){opacity:.4;pointer-events:none}.fz-locked>p{opacity:.4;pointer-events:none}.fz-locked>.fz-main-label{opacity:.4;pointer-events:none}.fz-pro-label{background:#4268cf;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:5px 10px;color:#fff;border-radius:2px;font-weight:700;font-size:9.152px;line-height:10px;flex:none;order:0;flex-grow:0;margin:0px 10px;text-transform:uppercase}.fz-upsell-notice{font-style:italic;font-weight:500;font-size:12px;line-height:18px;color:#1e1e1e}.feedzy-template .components-radio-image-control__container{display:flex;flex-wrap:wrap;margin:0 -10px}.feedzy-template .components-radio-image-control__container .components-radio-image-control__option{width:50%;padding:0 10px 20px}.feedzy-template .components-radio-image-control__container .components-radio-image-control__option label{height:74px;display:flex;align-items:center;justify-content:center;background:#f3f4f5;border:1px solid #e2e4e7;border-radius:4px}.feedzy-template .components-radio-image-control__container .components-radio-image-control__option label:hover{background:#fff}.feedzy-template .components-radio-image-control__container .components-radio-image-control__option span{display:block;text-align:center;padding-top:6px;color:#a8a8a8;font-weight:500;font-size:12px;line-height:18px}.feedzy-template.components-radio-image-control input:checked+label{border-color:#0071ae;box-shadow:0 0 0 1px #0071ae}.feedzy-template.components-radio-image-control input:checked+label img{border:0;box-shadow:none}
|
2 |
.components-radio-image-control__container{display:block}.components-radio-image-control__option{display:inline-block;padding:5px}.components-radio-image-control label{display:inline-block;position:relative}.components-radio-image-control label img{border:1px solid transparent;max-width:250px !important}.components-radio-image-control input{display:none}.components-radio-image-control input+label .image-clickable{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.components-radio-image-control input:checked+label img{border:1px solid #3498db;box-shadow:0 0 5px 2px rgba(0,0,0,.25)}
|
1 |
+
.wp-block-feedzy-rss-feeds-feedzy-block .feedzy-source-wrap{position:relative}.wp-block-feedzy-rss-feeds-feedzy-block .feedzy-source{margin-right:10px}.wp-block-feedzy-rss-feeds-feedzy-block .feedzy-source+.dashicons-arrow-down-alt2{position:absolute;right:12px;top:5px;z-index:5;color:#757575;cursor:pointer}.loadFeed{margin-bottom:10px}.feedzy-blocks-base-control{padding-bottom:10px}.feedzy-blocks-base-control label{padding-bottom:10px}.feedzy-blocks-base-control .feedzy_image_upload{display:block;margin-bottom:10px}.feedzy-select-cat{width:100%}.feedzy-select-cat select{width:auto}.feedzy-rss .rss_image span.fetched{display:inline-block;position:absolute;width:100%;height:100%;background-position:50%;background-size:cover}.feedzy-ui-autocomplete{max-height:200px;overflow-y:auto;overflow-x:hidden;padding-right:20px}.fz-section-header-panel.is-opened{padding:0}.fz-section-header-panel .header-tab{display:inline-block;width:calc( 100% / 3 );height:auto;padding:10px 20px;text-align:center;cursor:pointer}.fz-section-header-panel .header-tab.is-selected{border-bottom:2px solid #0085ba;background:#f3f4f5}.fz-section-header-panel .header-tab:hover:not(:disabled):not([aria-disabled=true]):not(.is-secondary):not(.is-primary):not(.is-tertiary):not(.is-link){background:#f3f4f5;box-shadow:none}.fz-section-header-panel .header-tab span{display:inline-block;font-size:12px}.fz-section-header-panel .header-tab span .dashicon{display:block;margin:0 auto;font-size:20px}.block-editor-block-inspector .components-base-control{margin:24px 0}.fz-locked{cursor:not-allowed}.fz-locked>div:not(.fz-upsell-notice){opacity:.4;pointer-events:none}.fz-locked>p{opacity:.4;pointer-events:none}.fz-locked>.fz-main-label{opacity:.4;pointer-events:none}.fz-pro-label{background:#4268cf;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:5px 10px;color:#fff;border-radius:2px;font-weight:700;font-size:9.152px;line-height:10px;flex:none;order:0;flex-grow:0;margin:0px 10px;text-transform:uppercase}.fz-upsell-notice{font-style:italic;font-weight:500;font-size:12px;line-height:18px;color:#1e1e1e}.feedzy-template .components-radio-image-control__container{display:flex;flex-wrap:wrap;margin:0 -10px}.feedzy-template .components-radio-image-control__container .components-radio-image-control__option{width:50%;padding:0 10px 20px}.feedzy-template .components-radio-image-control__container .components-radio-image-control__option label{height:74px;display:flex;align-items:center;justify-content:center;background:#f3f4f5;border:1px solid #e2e4e7;border-radius:4px}.feedzy-template .components-radio-image-control__container .components-radio-image-control__option label:hover{background:#fff}.feedzy-template .components-radio-image-control__container .components-radio-image-control__option span{display:block;text-align:center;padding-top:6px;color:#a8a8a8;font-weight:500;font-size:12px;line-height:18px}.feedzy-template.components-radio-image-control input:checked+label{border-color:#0071ae;box-shadow:0 0 0 1px #0071ae}.feedzy-template.components-radio-image-control input:checked+label img{border:0;box-shadow:none}.fz-upgrade-alert{background-color:#f7f7f7;border-left:4px solid #4268cf;padding:8px 12px;font-style:italic;font-size:13px;line-height:15px;color:#1e1e1e;position:relative}.fz-upgrade-alert a{color:#4268cf !important;font-weight:700}.fz-upgrade-alert span.dashicons-no-alt{position:absolute;right:4px;top:4px;color:#6f7882;cursor:pointer}.fz-source-upgrade-alert{width:100%;background-color:#cce5ff;border-left:4px solid #4268cf;padding:15px 5px;font-style:italic;font-size:13px;line-height:15px;color:#264494}.fz-source-upgrade-alert a{color:#264494 !important;font-weight:700}
|
2 |
.components-radio-image-control__container{display:block}.components-radio-image-control__option{display:inline-block;padding:5px}.components-radio-image-control label{display:inline-block;position:relative}.components-radio-image-control label img{border:1px solid transparent;max-width:250px !important}.components-radio-image-control input{display:none}.components-radio-image-control input+label .image-clickable{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.components-radio-image-control input:checked+label img{border:1px solid #3498db;box-shadow:0 0 5px 2px rgba(0,0,0,.25)}
|
includes/gutenberg/build/block.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
!function(e){var t={};function r(
|
2 |
/*!
|
3 |
Copyright (c) 2018 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
-
*/!function(){"use strict";var r={}.hasOwnProperty;function n(){for(var e=[],t=0;t<arguments.length;t++){var a=arguments[t];if(a){var o=typeof a;if("string"===o||"number"===o)e.push(a);else if(Array.isArray(a)){if(a.length){var s=n.apply(null,a);s&&e.push(s)}}else if("object"===o)if(a.toString===Object.prototype.toString)for(var i in a)r.call(a,i)&&a[i]&&e.push(i);else e.push(a.toString())}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):void 0===(a=function(){return n}.apply(t,[]))||(e.exports=a)}()},228:function(e,t,r){"use strict";r.r(t);var a={feeds:{type:"string"},max:{type:"number",default:5},offset:{type:"number",default:0},feed_title:{type:"boolean",default:!0},refresh:{type:"string",default:"12_hours"},sort:{type:"string",default:"default"},target:{type:"string",default:"_blank"},title:{type:"number"},meta:{type:"boolean",default:!0},lazy:{type:"boolean",default:!1},metafields:{type:"string",default:""},multiple_meta:{type:"string",default:""},summary:{type:"boolean",default:!0},summarylength:{type:"number"},keywords_title:{type:"string"},keywords_inc_on:{type:"string",default:"title"},keywords_ban:{type:"string"},keywords_exc_on:{type:"string",default:"title"},thumb:{type:"string",default:"auto"},default:{type:"object"},size:{type:"number",default:150},http:{type:"string"},referral_url:{type:"string"},columns:{type:"number",default:1},template:{type:"string",default:"default"},price:{type:"boolean",default:!0},route:{type:"string",default:"home"},feedData:{type:"object"},categories:{type:"object"},from_datetime:{type:"string"},to_datetime:{type:"string"},itemTitle:{type:"boolean",default:!0}},n=r(105),o=r.n(n),s=lodash.isEmpty,i=wp.components.BaseControl;var l=(0,wp.compose.withInstanceId)((function(e){var t=e.label,r=e.selected,a=e.help,n=e.instanceId,o=e.onChange,l=e.disabled,p=e.options,u=void 0===p?[]:p,c="inspector-radio-image-control-".concat(n),m=function(e){return o(e.target.value)};return!s(u)&&wp.element.createElement(i,{label:t,id:c,help:a,className:"components-radio-image-control feedzy-template"},wp.element.createElement("div",{className:"components-radio-image-control__container"},u.map((function(e,t){return wp.element.createElement("div",{key:"".concat(c,"-").concat(t),className:"components-radio-image-control__option"},wp.element.createElement("input",{id:"".concat(c,"-").concat(t),className:"components-radio-image-control__input",type:"radio",name:c,value:e.value,onChange:m,checked:e.value===r,"aria-describedby":a?"".concat(c,"__help"):void 0,disabled:l}),wp.element.createElement("label",{htmlFor:"".concat(c,"-").concat(t),title:e.label},wp.element.createElement("img",{src:e.src}),wp.element.createElement("span",{class:"image-clickable"})),wp.element.createElement("span",null,e.label))}))))})),p=r(20),u=r.n(p);function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,a=b(e);if(t){var n=b(this).constructor;r=Reflect.construct(a,arguments,n)}else r=a.apply(this,arguments);return y(this,r)}}function y(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var g=wp.i18n.__,w=wp.hooks.applyFilters,v=wp.blockEditor||wp.editor,E=v.InspectorControls,k=v.MediaUpload,z=wp.element,T=z.Component,C=z.Fragment,x=wp.components,N=x.BaseControl,O=x.ExternalLink,S=x.PanelBody,j=x.RangeControl,F=x.TextControl,R=x.Button,P=x.ToggleControl,A=x.SelectControl,L=x.ResponsiveWrapper,D=x.Dashicon,U=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(o,e);var t,r,a,n=h(o);function o(){var e;return m(this,o),(e=n.apply(this,arguments)).state={tab:"content"},e}return t=o,(r=[{key:"render",value:function(){var e=this,t="",r=w("feedzy_widget_refresh_feed",[{label:g("1 Hour"),value:"1_hours"},{label:g("2 Hours"),value:"3_hours"},{label:g("12 Hours"),value:"12_hours"},{label:g("1 Day"),value:"1_days"},{label:g("3 Days"),value:"3_days"},{label:g("15 Days"),value:"15_days"}]);return"https"===this.props.attributes.http&&(t+=g("Please verify that the images exist on HTTPS.")),wp.element.createElement(C,null,wp.element.createElement(E,{key:"inspector"},wp.element.createElement(S,{className:"fz-section-header-panel"},wp.element.createElement(R,{className:u()("header-tab",{"is-selected":"content"===this.state.tab}),onClick:function(){return e.setState({tab:"content"})}},wp.element.createElement("span",null,wp.element.createElement(D,{icon:"editor-table"}),g("Content"))),wp.element.createElement(R,{className:u()("header-tab",{"is-selected":"style"===this.state.tab}),onClick:function(){return e.setState({tab:"style"})}},wp.element.createElement("span",null,wp.element.createElement(D,{icon:"admin-customizer"}),g("Style"))),wp.element.createElement(R,{className:u()("header-tab",{"is-selected":"advanced"===this.state.tab}),onClick:function(){return e.setState({tab:"advanced"})}},wp.element.createElement("span",null,wp.element.createElement(D,{icon:"admin-generic"}),g("Advanced")))),"content"===this.state.tab&&wp.element.createElement(C,null,wp.element.createElement(S,{title:g("Feed Source"),initialOpen:!0},0!==this.props.attributes.status&&[wp.element.createElement(F,{label:g("Feed Source"),className:"feedzy-source",value:this.props.attributes.feeds,onChange:this.props.edit.onChangeFeed}),wp.element.createElement(R,{isLarge:!0,isPrimary:!0,type:"submit",onClick:this.props.edit.loadFeed,className:"loadFeed"},g("Load Feed"))],"fetched"===this.props.state.route&&[wp.element.createElement(j,{label:g("Number of Items"),value:Number(this.props.attributes.max)||5,onChange:this.props.edit.onChangeMax,min:1,max:this.props.attributes.feedData.items.length||10,beforeIcon:"sort",className:"feedzy-max"}),wp.element.createElement(A,{label:g("Sorting Order"),value:this.props.attributes.sort,options:[{label:g("Default"),value:"default"},{label:g("Date Descending"),value:"date_desc"},{label:g("Date Ascending"),value:"date_asc"},{label:g("Title Descending"),value:"title_desc"},{label:g("Title Ascending"),value:"title_asc"}],onChange:this.props.edit.onSort,className:"feedzy-sort"}),wp.element.createElement(A,{label:g("Feed Caching Time"),value:this.props.attributes.refresh,options:r,onChange:this.props.edit.onRefresh,className:"feedzy-refresh"})]),wp.element.createElement(S,{title:g("Item Options"),initialOpen:!1,className:"feedzy-item-options"},wp.element.createElement(A,{label:g("Open Links In"),value:this.props.attributes.target,options:[{label:g("New Tab"),value:"_blank"},{label:g("Same Tab"),value:"_self"}],onChange:this.props.edit.onTarget}),wp.element.createElement(P,{label:g("Display item Title"),checked:!!this.props.attributes.itemTitle,onChange:this.props.edit.onToggleItemTitle,className:"feedzy-summary"}),this.props.attributes.itemTitle&&wp.element.createElement(F,{label:g("Title Character Limit"),help:g("Leave empty to show full title. A value of 0 will remove the title."),type:"number",value:this.props.attributes.title,onChange:this.props.edit.onTitle,className:"feedzy-title-length"}),wp.element.createElement(P,{label:g("Display post description?"),checked:!!this.props.attributes.summary,onChange:this.props.edit.onToggleSummary,className:"feedzy-summary"}),this.props.attributes.summary&&wp.element.createElement(F,{label:g("Description Character Limit"),help:g("Leave empty to show full description."),type:"number",value:this.props.attributes.summarylength,onChange:this.props.edit.onSummaryLength,className:"feedzy-summary-length",min:0})),wp.element.createElement(S,{title:[g("Filter items"),!feedzyjs.isPro&&wp.element.createElement("span",{className:"fz-pro-label"},"Pro")],initialOpen:!1,className:feedzyjs.isPro?"feedzy-item-filter":"feedzy-item-filter fz-locked"},!feedzyjs.isPro&&wp.element.createElement("div",{className:"fz-upsell-notice"},g("Unlock this feature and more advanced options with")," ",wp.element.createElement(O,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=keywordsfilter&utm_content=feedzy-rss-feeds"},g("Feedzy Pro"))),wp.element.createElement(F,{label:g("Only display if selected field contains:"),help:g("Use comma(,) and plus(+) keyword"),value:this.props.attributes.keywords_title,onChange:this.props.edit.onKeywordsTitle,className:"feedzy-include"}),wp.element.createElement(A,{label:g("Select a field if you want to inc keyword."),value:this.props.attributes.keywords_inc_on,options:[{label:g("Title"),value:"title"},{label:g("Author"),value:"author"},{label:g("Description"),value:"description"}],onChange:this.props.edit.onKeywordsIncludeOn}),wp.element.createElement(F,{label:g("Exclude if selected field contains:"),help:g("Use comma(,) and plus(+) keyword"),value:this.props.attributes.keywords_ban,onChange:this.props.edit.onKeywordsBan,className:"feedzy-ban"}),wp.element.createElement(A,{label:g("Select a field if you want to exc keyword."),value:this.props.attributes.keywords_exc_on,options:[{label:g("Title"),value:"title"},{label:g("Author"),value:"author"},{label:g("Description"),value:"description"}],onChange:this.props.edit.onKeywordsExcludeOn}),wp.element.createElement("p",{className:"fz-main-label"},g("Filter feed item by date range.")),wp.element.createElement(F,{type:"datetime-local",label:g("From:"),value:this.props.attributes.from_datetime,onChange:this.props.edit.onFromDateTime}),wp.element.createElement(F,{type:"datetime-local",label:g("To:"),value:this.props.attributes.to_datetime,onChange:this.props.edit.onToDateTime}))),"fetched"===this.props.state.route&&"style"===this.state.tab&&[wp.element.createElement(C,null,wp.element.createElement(S,{title:g("Item Image Options"),initialOpen:!1,className:"feedzy-image-options"},wp.element.createElement(A,{label:g("Display first image if available?"),value:this.props.attributes.thumb,options:[{label:g("Yes (without a fallback image)"),value:"auto"},{label:g("Yes (with a fallback image)"),value:"yes"},{label:g("No"),value:"no"}],onChange:this.props.edit.onThumb,className:"feedzy-thumb"}),"no"!==this.props.attributes.thumb&&["auto"!==this.props.attributes.thumb&&wp.element.createElement("div",{className:"feedzy-blocks-base-control"},wp.element.createElement("label",{className:"blocks-base-control__label",for:"inspector-media-upload"},g("Fallback image if no image is found.")),wp.element.createElement(k,{type:"image",id:"inspector-media-upload",value:this.props.attributes.default,onSelect:this.props.edit.onDefault,render:function(t){var r=t.open;return[void 0!==e.props.attributes.default&&[wp.element.createElement(L,{naturalWidth:e.props.attributes.default.width,naturalHeight:e.props.attributes.default.height},wp.element.createElement("img",{src:e.props.attributes.default.url,alt:g("Featured image")})),wp.element.createElement(R,{isLarge:!0,isSecondary:!0,onClick:function(){return e.props.setAttributes({default:void 0})},style:{marginTop:"10px"}},g("Remove Image"))],wp.element.createElement(R,{isLarge:!0,isPrimary:!0,onClick:r,style:{marginTop:"10px"},className:void 0===e.props.attributes.default&&"feedzy_image_upload"},g("Upload Image"))]}})),wp.element.createElement(F,{label:g("Thumbnails dimension."),type:"number",value:this.props.attributes.size,onChange:this.props.edit.onSize}),wp.element.createElement(A,{label:g("How should we treat HTTP images?"),value:this.props.attributes.http,options:[{label:g("Show with HTTP link"),value:"auto"},{label:g("Force HTTPS"),value:"https"},{label:g("Ignore and show the default image instead"),value:"default"}],onChange:this.props.edit.onHTTP,className:"feedzy-http",help:t})]),wp.element.createElement(S,{title:[g("Feed Layout"),!feedzyjs.isPro&&wp.element.createElement("span",{className:"fz-pro-label"},"Pro")],initialOpen:!1,className:feedzyjs.isPro?"feedzy-layout":"feedzy-layout fz-locked"},!feedzyjs.isPro&&wp.element.createElement("div",{className:"fz-upsell-notice"},g("Unlock this feature and more advanced options with")," ",wp.element.createElement(O,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=layouts&utm_content=feedzy-rss-feeds"},g("Feedzy Pro"))),wp.element.createElement(j,{label:g("Columns"),help:g("How many columns we should use to display the feed items?"),value:this.props.attributes.columns||1,onChange:this.props.edit.onColumns,min:1,max:6,beforeIcon:"sort",allowReset:!0}),wp.element.createElement(l,{label:g("Template"),selected:this.props.attributes.template,options:[{label:g("Default"),src:feedzyjs.imagepath+"feedzy-default-template.png",value:"default"},{label:g("Round"),src:feedzyjs.imagepath+"feedzy-style1-template.png",value:"style1"},{label:g("Cards"),src:feedzyjs.imagepath+"feedzy-style2-template.png",value:"style2"}],onChange:this.props.edit.onTemplate})))],"fetched"===this.props.state.route&&"advanced"===this.state.tab&&[wp.element.createElement(C,null,wp.element.createElement(S,{title:g("Feed Items Custom Options"),className:"feedzy-advanced-options",initialOpen:!1},wp.element.createElement(N,null,wp.element.createElement(F,{label:feedzyjs.isPro?g("Should we display additional meta fields out of author, date, time or categories? (comma-separated list, in order of display)."):g("Should we display additional meta fields out of author, date or time? (comma-separated list, in order of display)."),help:g('Leave empty to display all and "no" to display nothing.'),placeholder:feedzyjs.isPro?g("(eg: author, date, time, tz=local, categories)"):g("(eg: author, date, time, tz=local)"),value:this.props.attributes.metafields,onChange:this.props.edit.onChangeMeta,className:"feedzy-meta"}),wp.element.createElement(F,{label:g("When using multiple sources, should we display additional meta fields? - source (comma-separated list)."),placeholder:g("(eg: source)"),value:this.props.attributes.multiple_meta,onChange:this.props.edit.onChangeMultipleMeta,className:"feedzy-multiple-meta"}),wp.element.createElement(O,{href:"https://docs.themeisle.com/article/1089-how-to-display-author-date-or-time-from-the-feed"},g("You can find more info about available meta field values here."))),wp.element.createElement(P,{label:g("Display price if available?"),help:this.props.attributes.price&&"default"===this.props.attributes.template?g("Choose a different template for this to work."):null,checked:!!this.props.attributes.price,onChange:this.props.edit.onTogglePrice,className:feedzyjs.isPro?"feedzy-pro-price":"feedzy-pro-price fz-locked"}),null!==this.props.attributes.feedData.channel&&wp.element.createElement(P,{label:g("Display feed title?"),checked:!!this.props.attributes.feed_title,onChange:this.props.edit.onToggleFeedTitle,className:"feedzy-title"}),wp.element.createElement(j,{label:g("Ignore first N items"),value:Number(this.props.attributes.offset)||0,onChange:this.props.edit.onChangeOffset,min:0,max:this.props.attributes.feedData.items.length,beforeIcon:"sort",className:"feedzy-offset"}),wp.element.createElement(P,{label:g("Lazy load feed?"),checked:!!this.props.attributes.lazy,onChange:this.props.edit.onToggleLazy,className:"feedzy-lazy",help:g("Only on the front end.")})),wp.element.createElement(S,{title:[g("Referral URL"),!feedzyjs.isPro&&wp.element.createElement("span",{className:"fz-pro-label"},"Pro")],initialOpen:!1,className:feedzyjs.isPro?"feedzy-pro-options":"feedzy-pro-options fz-locked"},!feedzyjs.isPro&&wp.element.createElement("div",{className:"fz-upsell-notice"},g("Unlock this feature and more advanced options with")," ",wp.element.createElement(O,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=refferal&utm_content=feedzy-rss-feeds"},g("Feedzy Pro"))),wp.element.createElement(F,{label:g("Referral URL parameters."),help:g('Without ("?")'),placeholder:_("(eg. promo_code=feedzy_is_awesome)"),value:this.props.attributes.referral_url,onChange:this.props.edit.onReferralURL})))]))}}])&&d(t.prototype,r),a&&d(t,a),o}(T),I=function(e){var t=document.createElement("div");return t.innerHTML=e,void 0!==t.innerText?t.innerText:t.textContent},M=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t="",r=[];return""!==e&&e.replace(/[^a-zA-Z]/g,"").length<=500&&(e.split(",").forEach((function(e){""!==(e=e.trim())&&(e=e.split("+").map((function(e){return"(?=.*"+(e=e.trim())+")"})),r.push(e.join("")))})),t="^"+(t=r.join("|"))+".*$",t=new RegExp(t,"i")),t};function K(e){return(K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function B(){return(B=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}function H(e,t,r,a,n,o,s){try{var i=e[o](s),l=i.value}catch(e){return void r(e)}i.done?t(l):Promise.resolve(l).then(a,n)}function $(e){return function(){var t=this,r=arguments;return new Promise((function(a,n){var o=e.apply(t,r);function s(e){H(o,a,n,s,i,"next",e)}function i(e){H(o,a,n,s,i,"throw",e)}s(void 0)}))}}function Y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function q(e,t){return(q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,a=Z(e);if(t){var n=Z(this).constructor;r=Reflect.construct(a,arguments,n)}else r=a.apply(this,arguments);return X(this,r)}}function X(e,t){return!t||"object"!==K(t)&&"function"!=typeof t?Q(e):t}function Q(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Z(e){return(Z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var G=wp.i18n.__,J=wp,ee=(J.apiFetch,J.apiRequest),te=wp.element,re=te.Component,ae=(te.Fragment,wp.components),ne=ae.ExternalLink,oe=ae.Placeholder,se=ae.TextControl,ie=ae.Button,le=ae.Spinner,pe=(wp.date.date,function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&q(e,t)}(l,e);var t,r,a,n,s,i=W(l);function l(){var e;return Y(this,l),(e=i.apply(this,arguments)).loadFeed=e.loadFeed.bind(Q(e)),e.loadCategories=e.loadCategories.bind(Q(e)),e.metaExists=e.metaExists.bind(Q(e)),e.multipleMetaExists=e.multipleMetaExists.bind(Q(e)),e.getImageURL=e.getImageURL.bind(Q(e)),e.getValidateURL=e.getValidateURL.bind(Q(e)),e.onChangeFeed=e.onChangeFeed.bind(Q(e)),e.onChangeMax=e.onChangeMax.bind(Q(e)),e.onChangeOffset=e.onChangeOffset.bind(Q(e)),e.onToggleFeedTitle=e.onToggleFeedTitle.bind(Q(e)),e.onRefresh=e.onRefresh.bind(Q(e)),e.onSort=e.onSort.bind(Q(e)),e.onTarget=e.onTarget.bind(Q(e)),e.onTitle=e.onTitle.bind(Q(e)),e.onChangeMeta=e.onChangeMeta.bind(Q(e)),e.onChangeMultipleMeta=e.onChangeMultipleMeta.bind(Q(e)),e.onToggleSummary=e.onToggleSummary.bind(Q(e)),e.onToggleLazy=e.onToggleLazy.bind(Q(e)),e.onSummaryLength=e.onSummaryLength.bind(Q(e)),e.onKeywordsTitle=e.onKeywordsTitle.bind(Q(e)),e.onKeywordsBan=e.onKeywordsBan.bind(Q(e)),e.onThumb=e.onThumb.bind(Q(e)),e.onDefault=e.onDefault.bind(Q(e)),e.onSize=e.onSize.bind(Q(e)),e.onHTTP=e.onHTTP.bind(Q(e)),e.onReferralURL=e.onReferralURL.bind(Q(e)),e.onColumns=e.onColumns.bind(Q(e)),e.onTemplate=e.onTemplate.bind(Q(e)),e.onTogglePrice=e.onTogglePrice.bind(Q(e)),e.onKeywordsIncludeOn=e.onKeywordsIncludeOn.bind(Q(e)),e.onKeywordsExcludeOn=e.onKeywordsExcludeOn.bind(Q(e)),e.onFromDateTime=e.onFromDateTime.bind(Q(e)),e.onToDateTime=e.onToDateTime.bind(Q(e)),e.feedzyCategoriesList=e.feedzyCategoriesList.bind(Q(e)),e.onToggleItemTitle=e.onToggleItemTitle.bind(Q(e)),e.handleKeyUp=e.handleKeyUp.bind(Q(e)),e.state={route:e.props.attributes.route,loading:!1,error:!1},e}return t=l,(r=[{key:"componentDidMount",value:(s=$(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.loadFeed(),void 0===this.props.attributes.categories&&(this.props.attributes.meta||this.props.setAttributes({meta:!0,metafields:"no"}),setTimeout((function(){t.loadCategories()})));case 2:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"componentDidUpdate",value:(n=$(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"reload"===this.state.route&&this.loadFeed();case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"loadFeed",value:function(){var e=this,t=this.props.attributes.feeds;if(void 0!==t){if(function(e,t){if(void 0===t)return!1;for(var r=!1,a=0;a<t.length;a++)if(t[a]===e){r=!0;break}return r}(t,this.props.attributes.categories)){var r=t;t=o.a.stringify({category:r},{arrayFormat:"bracket"})}else t=t.replace(/\s/g,"").split(",").filter((function(e){return""!==e})),t=o.a.stringify({url:t},{arrayFormat:"bracket"});this.setState({route:"home",loading:!0}),ee({path:"/feedzy/v1/feed?".concat(t),method:"POST",data:this.props.attributes}).then((function(t){return e.unmounting?t:t.error?(e.setState({route:"home",loading:!1,error:!0}),t):(e.props.setAttributes({feedData:t}),e.setState({route:"fetched",loading:!1}),t)})).fail((function(t){return e.setState({route:"home",loading:!1,error:!0}),t}))}}},{key:"loadCategories",value:function(){var e=this;ee({path:"/wp/v2/feedzy_categories?per_page=100"}).then((function(t){if(e.unmounting)return t;var r=0,a=[];t.forEach((function(e){a[r]=e.slug,r+=1}));var n=e;n.props.setAttributes({categories:a}),jQuery(".feedzy-source input").autocomplete({classes:{"ui-autocomplete":"feedzy-ui-autocomplete"},source:a,minLength:0,select:function(e,t){n.props.setAttributes({feeds:t.item.label})}})})).fail((function(e){return e}))}},{key:"metaExists",value:function(e){return 0<=this.props.attributes.metafields.replace(/\s/g,"").split(",").indexOf(e)||""===this.props.attributes.metafields}},{key:"multipleMetaExists",value:function(e){return 0<=this.props.attributes.multiple_meta.replace(/\s/g,"").split(",").indexOf(e)||""===this.props.attributes.multiple_meta}},{key:"getImageURL",value:function(e,t){var r=e.thumbnail?e.thumbnail:this.props.attributes.default?this.props.attributes.default.url:feedzyjs.imagepath+"feedzy.svg";switch(this.props.attributes.http){case"default":-1===r.indexOf("https")&&0===r.indexOf("http")&&(r=this.props.attributes.default?this.props.attributes.default.url:feedzyjs.imagepath+"feedzy.svg");break;case"https":r=r.replace(/http:/g,"https:")}return t&&(r="url("+r+")"),r}},{key:"onChangeFeed",value:function(e){this.props.setAttributes({feeds:e})}},{key:"onChangeMax",value:function(e){this.props.setAttributes({max:e?Number(e):5})}},{key:"onChangeOffset",value:function(e){this.props.setAttributes({offset:Number(e)})}},{key:"onToggleFeedTitle",value:function(e){this.props.setAttributes({feed_title:!this.props.attributes.feed_title})}},{key:"onRefresh",value:function(e){this.props.setAttributes({refresh:e})}},{key:"onSort",value:function(e){this.props.setAttributes({sort:e})}},{key:"onTarget",value:function(e){this.props.setAttributes({target:e})}},{key:"onTitle",value:function(e){""!==e&&(e=Number(e))<0&&(e=0),this.props.setAttributes({title:e})}},{key:"onChangeMeta",value:function(e){this.props.setAttributes({metafields:e})}},{key:"onChangeMultipleMeta",value:function(e){this.props.setAttributes({multiple_meta:e})}},{key:"onToggleSummary",value:function(e){this.props.setAttributes({summary:!this.props.attributes.summary})}},{key:"onToggleLazy",value:function(e){this.props.setAttributes({lazy:!this.props.attributes.lazy})}},{key:"onSummaryLength",value:function(e){this.props.setAttributes({summarylength:Number(e)})}},{key:"onKeywordsTitle",value:function(e){this.props.setAttributes({keywords_title:e})}},{key:"onKeywordsBan",value:function(e){this.props.setAttributes({keywords_ban:e})}},{key:"onThumb",value:function(e){this.props.setAttributes({thumb:e})}},{key:"onDefault",value:function(e){this.props.setAttributes({default:e}),this.setState({route:"reload"})}},{key:"onSize",value:function(e){this.props.setAttributes({size:e?Number(e):150})}},{key:"onHTTP",value:function(e){this.props.setAttributes({http:e}),this.setState({route:"reload"})}},{key:"onReferralURL",value:function(e){this.props.setAttributes({referral_url:e})}},{key:"onColumns",value:function(e){this.props.setAttributes({columns:e})}},{key:"onTemplate",value:function(e){this.props.setAttributes({template:e})}},{key:"onTogglePrice",value:function(e){this.props.setAttributes({price:!this.props.attributes.price})}},{key:"onKeywordsIncludeOn",value:function(e){this.props.setAttributes({keywords_inc_on:e})}},{key:"onKeywordsExcludeOn",value:function(e){this.props.setAttributes({keywords_exc_on:e})}},{key:"onFromDateTime",value:function(e){this.props.setAttributes({from_datetime:e})}},{key:"onToDateTime",value:function(e){this.props.setAttributes({to_datetime:e})}},{key:"feedzyCategoriesList",value:function(e){jQuery(".feedzy-source input").autocomplete("search","")}},{key:"getValidateURL",value:function(){var e="https://validator.w3.org/feed/";return this.props.attributes.feeds&&(e+="check.cgi?url="+this.props.attributes.feeds),e}},{key:"onToggleItemTitle",value:function(e){this.props.setAttributes({itemTitle:!this.props.attributes.itemTitle})}},{key:"handleKeyUp",value:function(e){13===e.keyCode&&this.loadFeed()}},{key:"render",value:function(){var e,t,r,a,n,o,s,i,l,p,u=this;return["fetched"===this.state.route&&wp.element.createElement(U,B({edit:this,state:this.state},this.props)),"home"===this.state.route&&wp.element.createElement("div",{className:this.props.className},wp.element.createElement(oe,{key:"placeholder",icon:"rss",label:G("Feedzy RSS Feeds")},this.state.loading?wp.element.createElement("div",{key:"loading",className:"wp-block-embed is-loading"},wp.element.createElement(le,null),wp.element.createElement("p",null,G("Fetching..."))):[wp.element.createElement("div",{className:"feedzy-source-wrap"},wp.element.createElement(se,{type:"url",className:"feedzy-source",placeholder:G("Enter URL or category of your feed here..."),onChange:this.onChangeFeed,onKeyUp:this.handleKeyUp,value:this.props.attributes.feeds}),wp.element.createElement("span",{className:"dashicons dashicons-arrow-down-alt2",onClick:this.feedzyCategoriesList})),wp.element.createElement(ie,{isLarge:!0,isPrimary:!0,type:"submit",onClick:this.loadFeed},G("Load Feed")),wp.element.createElement(ne,{href:this.getValidateURL(),title:G("Validate Feed ")},G("Validate ")),this.state.error&&wp.element.createElement("div",null,G("Feed URL is invalid. Invalid feeds will NOT display items.")),wp.element.createElement("p",null,G("Enter the full URL of the feed source you wish to display here, or the name of a category you've created. Also you can add multiple URLs just separate them with a comma. You can manage your categories feed from")," ",wp.element.createElement("a",{href:"edit.php?post_type=feedzy_categories",title:G("feedzy categories "),target:"_blank"},G("here ")))])),!("fetched"!==this.state.route||void 0===this.props.attributes.feedData)&&wp.element.createElement("div",{className:"feedzy-rss"},this.props.attributes.feed_title&&null!==this.props.attributes.feedData.channel&&wp.element.createElement("div",{className:"rss_header"},wp.element.createElement("h2",null,wp.element.createElement("a",{className:"rss_title"},I(this.props.attributes.feedData.channel.title)),wp.element.createElement("span",{className:"rss_description"}," "+I(this.props.attributes.feedData.channel.description)))),wp.element.createElement("ul",{className:"feedzy-".concat(this.props.attributes.template)},(e=this.props.attributes.feedData.items,t=this.props.attributes.sort,r=M(this.props.attributes.keywords_title),a=M(this.props.attributes.keywords_ban),n=this.props.attributes.max,o=this.props.attributes.offset,s=this.props.attributes.keywords_inc_on,i=this.props.attributes.keywords_exc_on,l=this.props.attributes.from_datetime,p=this.props.attributes.to_datetime,s="author"===s?"creator":s,i="author"===i?"creator":i,l=""!==l&&void 0!==l&&moment(l).format("X"),p=""!==p&&void 0!==p&&moment(p).format("X"),e=Array.from(e).sort((function(e,r){var a,n;return"date_desc"===t||"date_asc"===t?(a=e.pubDate,n=r.pubDate):"title_desc"!==t&&"title_asc"!==t||(a=e.title.toUpperCase(),n=r.title.toUpperCase()),a<n?"date_desc"===t||"title_desc"===t?1:-1:a>n?"date_desc"===t||"title_desc"===t?-1:1:0})).filter((function(e){return!r||r.test(e[s])})).filter((function(e){return!a||!a.test(e[i])})).filter((function(e){var t=e.date+" "+e.time;return t=moment(new Date(t)).format("X"),!l||!p||l<=t&&t<=p})).slice(o,n+o)).map((function(e,t){var r=(e.date||"")+" "+(e.time||"")+" UTC +0000",a=I(e.date)||"",n=I(e.time)||"",o=I(e.categories)||"";if(u.metaExists("tz=local")){var s=new Date(r);s=s.toUTCString(),a=moment.utc(s).format("MMMM D, YYYY"),n=moment.utc(s).format("h:mm A")}var i=e.creator&&u.metaExists("author")?e.creator:"";""!==u.props.attributes.multiple_meta&&"no"!==u.props.attributes.multiple_meta&&((u.multipleMetaExists("source")||u.multipleMetaExists("yes"))&&""!==i&&""!==e.source?i=i+" ("+e.source+")":(u.multipleMetaExists("source")||u.multipleMetaExists("yes"))&&""!==e.source&&(i=e.source)),""===e.thumbnail&&"auto"===u.props.attributes.thumb&&(e.thumbnail=e.default_img);var l=new Object;return l.author=G("by")+" "+i,l.date=G("on")+" "+I(a),l.time=G("at")+" "+I(n),l.categories=G("in")+" "+I(o),wp.element.createElement("li",{key:t,style:{padding:"15px 0 25px"},className:"rss_item feedzy-rss-col-".concat(u.props.attributes.columns)},(e.thumbnail&&"auto"===u.props.attributes.thumb||"yes"===u.props.attributes.thumb)&&wp.element.createElement("div",{className:"rss_image",style:{width:u.props.attributes.size+"px",height:u.props.attributes.size+"px"}},wp.element.createElement("a",{title:I(e.title),style:{width:u.props.attributes.size+"px",height:u.props.attributes.size+"px"}},wp.element.createElement("span",{className:"fetched",style:{width:u.props.attributes.size+"px",height:u.props.attributes.size+"px",backgroundImage:u.getImageURL(e,!0)},title:I(e.title)}))),wp.element.createElement("div",{className:"rss_content_wrap"},u.props.attributes.itemTitle&&0!==u.props.attributes.title?wp.element.createElement("span",{className:"title"},wp.element.createElement("a",null,u.props.attributes.title&&I(e.title).length>u.props.attributes.title?I(e.title).substring(0,u.props.attributes.title)+"...":I(e.title))):"",wp.element.createElement("div",{className:"rss_content"},"no"!==u.props.attributes.metafields&&wp.element.createElement("small",{className:"meta"},function(e,t){var r="";""===t&&(t="author, date, time");for(var a=t.replace(/\s/g,"").split(","),n=0;n<a.length;n++)void 0!==e[a[n]]&&(r=r+" "+e[a[n]]);return r}(l,u.props.attributes.metafields)),u.props.attributes.summary&&wp.element.createElement("p",{className:"description"},u.props.attributes.summarylength&&I(e.description).length>u.props.attributes.summarylength?I(e.description).substring(0,u.props.attributes.summarylength)+" [...]":I(e.description)),feedzyjs.isPro&&e.media&&e.media.src&&wp.element.createElement("audio",{controls:!0,controlsList:"nodownload"},wp.element.createElement("source",{src:e.media.src,type:e.media.type}),G("Your browser does not support the audio element. But you can check this for the original link: "),wp.element.createElement("a",{href:e.media.src},e.media.src)),feedzyjs.isPro&&u.props.attributes.price&&e.price&&"default"!==u.props.attributes.template&&wp.element.createElement("div",{className:"price-wrap"},wp.element.createElement("a",null,wp.element.createElement("button",{className:"price"},e.price))))))}))))]}}])&&V(t.prototype,r),a&&V(t,a),l}(re)),ue=wp.i18n.__,ce=wp.blocks.registerBlockType;t.default=ce("feedzy-rss-feeds/feedzy-block",{title:ue("Feedzy RSS Feeds"),category:"common",icon:"rss",keywords:[ue("Feedzy RSS Feeds"),ue("RSS"),ue("Feeds")],supports:{html:!1},attributes:a,edit:pe,save:function(){return null}})}});
|
1 |
+
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=228)}({105:function(e,t,r){"use strict";const n=r(180),a=r(181),o=r(182),s=r(183);function i(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function p(e,t){return t.decode?a(e):e}function u(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function c(e){const t=(e=u(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function m(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function d(e,t){i((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const a="string"==typeof r&&r.includes(e.arrayFormatSeparator),o="string"==typeof r&&!a&&p(r,e).includes(e.arrayFormatSeparator);r=o?p(r,e):r;const s=a||o?r.split(e.arrayFormatSeparator).map(t=>p(t,e)):null===r?r:p(r,e);n[t]=s};case"bracket-separator":return(t,r,n)=>{const a=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!a)return void(n[t]=r?p(r,e):r);const o=null===r?[]:r.split(e.arrayFormatSeparator).map(t=>p(t,e));void 0!==n[t]?n[t]=[].concat(n[t],o):n[t]=o};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const a of e.split("&")){if(""===a)continue;let[e,s]=o(t.decode?a.replace(/\+/g," "):a,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:p(s,t),r(p(e,t),s,n)}for(const e of Object.keys(n)){const r=n[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=m(r[e],t);else n[e]=m(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=c,t.parse=d,t.stringify=(e,t)=>{if(!e)return"";i((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const a=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[",a,"]"].join("")]:[...r,[l(t,e),"[",l(a,e),"]=",l(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[]"].join("")]:[...r,[l(t,e),"[]=",l(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,a)=>void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?n:(a=null===a?"":a,0===n.length?[[l(r,e),t,l(a,e)].join("")]:[[n,l(a,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,l(t,e)]:[...r,[l(t,e),"=",l(n,e)].join("")]}}(t),a={};for(const t of Object.keys(e))r(t)||(a[t]=e[t]);const o=Object.keys(a);return!1!==t.sort&&o.sort(t.sort),o.map(r=>{const a=e[r];return void 0===a?"":null===a?l(r,t):Array.isArray(a)?0===a.length&&"bracket-separator"===t.arrayFormat?l(r,t)+"[]":a.reduce(n(r),[]).join("&"):l(r,t)+"="+l(a,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=o(e,"#");return Object.assign({url:r.split("?")[0]||"",query:d(c(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:p(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0},r);const n=u(e.url).split("?")[0]||"",a=t.extract(e.url),o=t.parse(a,{sort:!1}),s=Object.assign(o,e.query);let i=t.stringify(s,r);i&&(i="?"+i);let p=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(p="#"+l(e.fragmentIdentifier,r)),`${n}${i}${p}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0},n);const{url:a,query:o,fragmentIdentifier:i}=t.parseUrl(e,n);return t.stringifyUrl({url:a,query:s(o,r),fragmentIdentifier:i},n)},t.exclude=(e,r,n)=>{const a=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,a,n)}},180:function(e,t,r){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())},181:function(e,t,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),a=new RegExp("(%[a-f0-9]{2})+","gi");function o(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],o(r),o(n))}function s(e){try{return decodeURIComponent(e)}catch(a){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=o(t,r).join("")).match(n);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=a.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=s(r[0]);n!==r[0]&&(t[r[0]]=n)}r=a.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),i=0;i<o.length;i++){var l=o[i];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}},182:function(e,t,r){"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},183:function(e,t,r){"use strict";e.exports=function(e,t){for(var r={},n=Object.keys(e),a=Array.isArray(t),o=0;o<n.length;o++){var s=n[o],i=e[s];(a?-1!==t.indexOf(s):t(s,i,e))&&(r[s]=i)}return r}},20:function(e,t,r){var n;
|
2 |
/*!
|
3 |
Copyright (c) 2018 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
+
*/!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)){if(n.length){var s=a.apply(null,n);s&&e.push(s)}}else if("object"===o)if(n.toString===Object.prototype.toString)for(var i in n)r.call(n,i)&&n[i]&&e.push(i);else e.push(n.toString())}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},228:function(e,t,r){"use strict";r.r(t);var n={feeds:{type:"string"},max:{type:"number",default:5},offset:{type:"number",default:0},feed_title:{type:"boolean",default:!0},refresh:{type:"string",default:"12_hours"},sort:{type:"string",default:"default"},target:{type:"string",default:"_blank"},title:{type:"number"},meta:{type:"boolean",default:!0},lazy:{type:"boolean",default:!1},metafields:{type:"string",default:""},multiple_meta:{type:"string",default:""},summary:{type:"boolean",default:!0},summarylength:{type:"number"},keywords_title:{type:"string"},keywords_inc_on:{type:"string",default:"title"},keywords_ban:{type:"string"},keywords_exc_on:{type:"string",default:"title"},thumb:{type:"string",default:"auto"},default:{type:"object"},size:{type:"number",default:150},http:{type:"string"},referral_url:{type:"string"},columns:{type:"number",default:1},template:{type:"string",default:"default"},price:{type:"boolean",default:!0},route:{type:"string",default:"home"},feedData:{type:"object"},categories:{type:"object"},from_datetime:{type:"string"},to_datetime:{type:"string"},itemTitle:{type:"boolean",default:!0}},a=r(105),o=r.n(a),s=lodash.isEmpty,i=wp.components.BaseControl;var l=(0,wp.compose.withInstanceId)((function(e){var t=e.label,r=e.selected,n=e.help,a=e.instanceId,o=e.onChange,l=e.disabled,p=e.options,u=void 0===p?[]:p,c="inspector-radio-image-control-".concat(a),m=function(e){return o(e.target.value)};return!s(u)&&wp.element.createElement(i,{label:t,id:c,help:n,className:"components-radio-image-control feedzy-template"},wp.element.createElement("div",{className:"components-radio-image-control__container"},u.map((function(e,t){return wp.element.createElement("div",{key:"".concat(c,"-").concat(t),className:"components-radio-image-control__option"},wp.element.createElement("input",{id:"".concat(c,"-").concat(t),className:"components-radio-image-control__input",type:"radio",name:c,value:e.value,onChange:m,checked:e.value===r,"aria-describedby":n?"".concat(c,"__help"):void 0,disabled:l}),wp.element.createElement("label",{htmlFor:"".concat(c,"-").concat(t),title:e.label},wp.element.createElement("img",{src:e.src}),wp.element.createElement("span",{class:"image-clickable"})),wp.element.createElement("span",null,e.label))}))))})),p=r(20),u=r.n(p);function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var a=b(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return y(this,r)}}function y(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var g=wp.i18n.__,w=wp.hooks.applyFilters,v=wp.blockEditor||wp.editor,E=v.InspectorControls,k=v.MediaUpload,z=wp.element,T=z.Component,C=z.Fragment,x=wp.components,N=x.BaseControl,O=x.ExternalLink,j=x.PanelBody,S=x.RangeControl,F=x.TextControl,P=x.Button,R=x.ToggleControl,A=x.SelectControl,L=x.ResponsiveWrapper,D=x.Dashicon,U=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(o,e);var t,r,n,a=h(o);function o(){var e;return m(this,o),(e=a.apply(this,arguments)).state={tab:"content"},e}return t=o,(r=[{key:"render",value:function(){var e=this,t="",r=w("feedzy_widget_refresh_feed",[{label:g("1 Hour"),value:"1_hours"},{label:g("2 Hours"),value:"3_hours"},{label:g("12 Hours"),value:"12_hours"},{label:g("1 Day"),value:"1_days"},{label:g("3 Days"),value:"3_days"},{label:g("15 Days"),value:"15_days"}]);return"https"===this.props.attributes.http&&(t+=g("Please verify that the images exist on HTTPS.")),wp.element.createElement(C,null,wp.element.createElement(E,{key:"inspector"},wp.element.createElement(j,{className:"fz-section-header-panel"},wp.element.createElement(P,{className:u()("header-tab",{"is-selected":"content"===this.state.tab}),onClick:function(){return e.setState({tab:"content"})}},wp.element.createElement("span",null,wp.element.createElement(D,{icon:"editor-table"}),g("Content"))),wp.element.createElement(P,{className:u()("header-tab",{"is-selected":"style"===this.state.tab}),onClick:function(){return e.setState({tab:"style"})}},wp.element.createElement("span",null,wp.element.createElement(D,{icon:"admin-customizer"}),g("Style"))),wp.element.createElement(P,{className:u()("header-tab",{"is-selected":"advanced"===this.state.tab}),onClick:function(){return e.setState({tab:"advanced"})}},wp.element.createElement("span",null,wp.element.createElement(D,{icon:"admin-generic"}),g("Advanced")))),"content"===this.state.tab&&wp.element.createElement(C,null,wp.element.createElement(j,{title:g("Feed Source"),initialOpen:!0},0!==this.props.attributes.status&&!feedzyjs.isPro&&[wp.element.createElement("div",{className:"fz-upgrade-alert"},wp.element.createElement("strong",null,g("NEW!")," "),g("Enable Amazon Product Advertising feeds to generate affiliate revenue by "),wp.element.createElement(O,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=amazonproductadvertising&utm_content=feedzy-rss-feeds"},g("upgrading to Feedzy Pro.")),wp.element.createElement(D,{icon:"no-alt",onClick:function(e){e.target.parentNode.style.display="none"}}))],0!==this.props.attributes.status&&[wp.element.createElement(F,{label:g("Feed Source"),className:"feedzy-source",value:this.props.attributes.feeds,onChange:this.props.edit.onChangeFeed}),wp.element.createElement(P,{isLarge:!0,isPrimary:!0,type:"submit",onClick:this.props.edit.loadFeed,className:"loadFeed"},g("Load Feed"))],"fetched"===this.props.state.route&&[wp.element.createElement(S,{label:g("Number of Items"),value:Number(this.props.attributes.max)||5,onChange:this.props.edit.onChangeMax,min:1,max:this.props.attributes.feedData.items.length||10,beforeIcon:"sort",className:"feedzy-max"}),wp.element.createElement(A,{label:g("Sorting Order"),value:this.props.attributes.sort,options:[{label:g("Default"),value:"default"},{label:g("Date Descending"),value:"date_desc"},{label:g("Date Ascending"),value:"date_asc"},{label:g("Title Descending"),value:"title_desc"},{label:g("Title Ascending"),value:"title_asc"}],onChange:this.props.edit.onSort,className:"feedzy-sort"}),wp.element.createElement(A,{label:g("Feed Caching Time"),value:this.props.attributes.refresh,options:r,onChange:this.props.edit.onRefresh,className:"feedzy-refresh"})]),wp.element.createElement(j,{title:g("Item Options"),initialOpen:!1,className:"feedzy-item-options"},wp.element.createElement(A,{label:g("Open Links In"),value:this.props.attributes.target,options:[{label:g("New Tab"),value:"_blank"},{label:g("Same Tab"),value:"_self"}],onChange:this.props.edit.onTarget}),wp.element.createElement(R,{label:g("Display item Title"),checked:!!this.props.attributes.itemTitle,onChange:this.props.edit.onToggleItemTitle,className:"feedzy-summary"}),this.props.attributes.itemTitle&&wp.element.createElement(F,{label:g("Title Character Limit"),help:g("Leave empty to show full title. A value of 0 will remove the title."),type:"number",value:this.props.attributes.title,onChange:this.props.edit.onTitle,className:"feedzy-title-length"}),wp.element.createElement(R,{label:g("Display post description?"),checked:!!this.props.attributes.summary,onChange:this.props.edit.onToggleSummary,className:"feedzy-summary"}),this.props.attributes.summary&&wp.element.createElement(F,{label:g("Description Character Limit"),help:g("Leave empty to show full description."),type:"number",value:this.props.attributes.summarylength,onChange:this.props.edit.onSummaryLength,className:"feedzy-summary-length",min:0})),wp.element.createElement(j,{title:[g("Filter items"),!feedzyjs.isPro&&wp.element.createElement("span",{className:"fz-pro-label"},"Pro")],initialOpen:!1,className:feedzyjs.isPro?"feedzy-item-filter":"feedzy-item-filter fz-locked"},!feedzyjs.isPro&&wp.element.createElement("div",{className:"fz-upsell-notice"},g("Unlock this feature and more advanced options with")," ",wp.element.createElement(O,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=keywordsfilter&utm_content=feedzy-rss-feeds"},g("Feedzy Pro"))),wp.element.createElement(F,{label:g("Only display if selected field contains:"),help:g("Use comma(,) and plus(+) keyword"),value:this.props.attributes.keywords_title,onChange:this.props.edit.onKeywordsTitle,className:"feedzy-include"}),wp.element.createElement(A,{label:g("Select a field if you want to inc keyword."),value:this.props.attributes.keywords_inc_on,options:[{label:g("Title"),value:"title"},{label:g("Author"),value:"author"},{label:g("Description"),value:"description"}],onChange:this.props.edit.onKeywordsIncludeOn}),wp.element.createElement(F,{label:g("Exclude if selected field contains:"),help:g("Use comma(,) and plus(+) keyword"),value:this.props.attributes.keywords_ban,onChange:this.props.edit.onKeywordsBan,className:"feedzy-ban"}),wp.element.createElement(A,{label:g("Select a field if you want to exc keyword."),value:this.props.attributes.keywords_exc_on,options:[{label:g("Title"),value:"title"},{label:g("Author"),value:"author"},{label:g("Description"),value:"description"}],onChange:this.props.edit.onKeywordsExcludeOn}),wp.element.createElement("p",{className:"fz-main-label"},g("Filter feed item by date range.")),wp.element.createElement(F,{type:"datetime-local",label:g("From:"),value:this.props.attributes.from_datetime,onChange:this.props.edit.onFromDateTime}),wp.element.createElement(F,{type:"datetime-local",label:g("To:"),value:this.props.attributes.to_datetime,onChange:this.props.edit.onToDateTime}))),"fetched"===this.props.state.route&&"style"===this.state.tab&&[wp.element.createElement(C,null,wp.element.createElement(j,{title:g("Item Image Options"),initialOpen:!1,className:"feedzy-image-options"},wp.element.createElement(A,{label:g("Display first image if available?"),value:this.props.attributes.thumb,options:[{label:g("Yes (without a fallback image)"),value:"auto"},{label:g("Yes (with a fallback image)"),value:"yes"},{label:g("No"),value:"no"}],onChange:this.props.edit.onThumb,className:"feedzy-thumb"}),"no"!==this.props.attributes.thumb&&["auto"!==this.props.attributes.thumb&&wp.element.createElement("div",{className:"feedzy-blocks-base-control"},wp.element.createElement("label",{className:"blocks-base-control__label",for:"inspector-media-upload"},g("Fallback image if no image is found.")),wp.element.createElement(k,{type:"image",id:"inspector-media-upload",value:this.props.attributes.default,onSelect:this.props.edit.onDefault,render:function(t){var r=t.open;return[void 0!==e.props.attributes.default&&[wp.element.createElement(L,{naturalWidth:e.props.attributes.default.width,naturalHeight:e.props.attributes.default.height},wp.element.createElement("img",{src:e.props.attributes.default.url,alt:g("Featured image")})),wp.element.createElement(P,{isLarge:!0,isSecondary:!0,onClick:function(){return e.props.setAttributes({default:void 0})},style:{marginTop:"10px"}},g("Remove Image"))],wp.element.createElement(P,{isLarge:!0,isPrimary:!0,onClick:r,style:{marginTop:"10px"},className:void 0===e.props.attributes.default&&"feedzy_image_upload"},g("Upload Image"))]}})),wp.element.createElement(F,{label:g("Thumbnails dimension."),type:"number",value:this.props.attributes.size,onChange:this.props.edit.onSize}),wp.element.createElement(A,{label:g("How should we treat HTTP images?"),value:this.props.attributes.http,options:[{label:g("Show with HTTP link"),value:"auto"},{label:g("Force HTTPS"),value:"https"},{label:g("Ignore and show the default image instead"),value:"default"}],onChange:this.props.edit.onHTTP,className:"feedzy-http",help:t})]),wp.element.createElement(j,{title:[g("Feed Layout"),!feedzyjs.isPro&&wp.element.createElement("span",{className:"fz-pro-label"},"Pro")],initialOpen:!1,className:feedzyjs.isPro?"feedzy-layout":"feedzy-layout fz-locked"},!feedzyjs.isPro&&wp.element.createElement("div",{className:"fz-upsell-notice"},g("Unlock this feature and more advanced options with")," ",wp.element.createElement(O,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=layouts&utm_content=feedzy-rss-feeds"},g("Feedzy Pro"))),wp.element.createElement(S,{label:g("Columns"),help:g("How many columns we should use to display the feed items?"),value:this.props.attributes.columns||1,onChange:this.props.edit.onColumns,min:1,max:6,beforeIcon:"sort",allowReset:!0}),wp.element.createElement(l,{label:g("Template"),selected:this.props.attributes.template,options:[{label:g("Default"),src:feedzyjs.imagepath+"feedzy-default-template.png",value:"default"},{label:g("Round"),src:feedzyjs.imagepath+"feedzy-style1-template.png",value:"style1"},{label:g("Cards"),src:feedzyjs.imagepath+"feedzy-style2-template.png",value:"style2"}],onChange:this.props.edit.onTemplate})))],"fetched"===this.props.state.route&&"advanced"===this.state.tab&&[wp.element.createElement(C,null,wp.element.createElement(j,{title:g("Feed Items Custom Options"),className:"feedzy-advanced-options",initialOpen:!1},wp.element.createElement(N,null,wp.element.createElement(F,{label:feedzyjs.isPro?g("Should we display additional meta fields out of author, date, time or categories? (comma-separated list, in order of display)."):g("Should we display additional meta fields out of author, date or time? (comma-separated list, in order of display)."),help:g('Leave empty to display all and "no" to display nothing.'),placeholder:feedzyjs.isPro?g("(eg: author, date, time, tz=local, categories)"):g("(eg: author, date, time, tz=local)"),value:this.props.attributes.metafields,onChange:this.props.edit.onChangeMeta,className:"feedzy-meta"}),wp.element.createElement(F,{label:g("When using multiple sources, should we display additional meta fields? - source (comma-separated list)."),placeholder:g("(eg: source)"),value:this.props.attributes.multiple_meta,onChange:this.props.edit.onChangeMultipleMeta,className:"feedzy-multiple-meta"}),wp.element.createElement(O,{href:"https://docs.themeisle.com/article/1089-how-to-display-author-date-or-time-from-the-feed"},g("You can find more info about available meta field values here."))),wp.element.createElement(R,{label:g("Display price if available?"),help:this.props.attributes.price&&"default"===this.props.attributes.template?g("Choose a different template for this to work."):null,checked:!!this.props.attributes.price,onChange:this.props.edit.onTogglePrice,className:feedzyjs.isPro?"feedzy-pro-price":"feedzy-pro-price fz-locked"}),null!==this.props.attributes.feedData.channel&&wp.element.createElement(R,{label:g("Display feed title?"),checked:!!this.props.attributes.feed_title,onChange:this.props.edit.onToggleFeedTitle,className:"feedzy-title"}),wp.element.createElement(S,{label:g("Ignore first N items"),value:Number(this.props.attributes.offset)||0,onChange:this.props.edit.onChangeOffset,min:0,max:this.props.attributes.feedData.items.length,beforeIcon:"sort",className:"feedzy-offset"}),wp.element.createElement(R,{label:g("Lazy load feed?"),checked:!!this.props.attributes.lazy,onChange:this.props.edit.onToggleLazy,className:"feedzy-lazy",help:g("Only on the front end.")})),wp.element.createElement(j,{title:[g("Referral URL"),!feedzyjs.isPro&&wp.element.createElement("span",{className:"fz-pro-label"},"Pro")],initialOpen:!1,className:feedzyjs.isPro?"feedzy-pro-options":"feedzy-pro-options fz-locked"},!feedzyjs.isPro&&wp.element.createElement("div",{className:"fz-upsell-notice"},g("Unlock this feature and more advanced options with")," ",wp.element.createElement(O,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=refferal&utm_content=feedzy-rss-feeds"},g("Feedzy Pro"))),wp.element.createElement(F,{label:g("Referral URL parameters."),help:g('Without ("?")'),placeholder:_("(eg. promo_code=feedzy_is_awesome)"),value:this.props.attributes.referral_url,onChange:this.props.edit.onReferralURL})))]))}}])&&d(t.prototype,r),n&&d(t,n),o}(T),I=function(e){var t=document.createElement("div");return t.innerHTML=e,void 0!==t.innerText?t.innerText:t.textContent},M=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t="",r=[];return""!==e&&e.replace(/[^a-zA-Z]/g,"").length<=500&&(e.split(",").forEach((function(e){""!==(e=e.trim())&&(e=e.split("+").map((function(e){return"(?=.*"+(e=e.trim())+")"})),r.push(e.join("")))})),t="^"+(t=r.join("|"))+".*$",t=new RegExp(t,"i")),t};function K(e){return(K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function B(){return(B=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function H(e,t,r,n,a,o,s){try{var i=e[o](s),l=i.value}catch(e){return void r(e)}i.done?t(l):Promise.resolve(l).then(n,a)}function $(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function s(e){H(o,n,a,s,i,"next",e)}function i(e){H(o,n,a,s,i,"throw",e)}s(void 0)}))}}function Y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function W(e,t){return(W=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Z(e);if(t){var a=Z(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return X(this,r)}}function X(e,t){return!t||"object"!==K(t)&&"function"!=typeof t?Q(e):t}function Q(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Z(e){return(Z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var G=wp.i18n.__,J=wp,ee=(J.apiFetch,J.apiRequest),te=wp.element,re=te.Component,ne=(te.Fragment,wp.components),ae=ne.ExternalLink,oe=ne.Placeholder,se=ne.TextControl,ie=ne.Button,le=ne.Spinner,pe=(wp.date.date,function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&W(e,t)}(l,e);var t,r,n,a,s,i=q(l);function l(){var e;return Y(this,l),(e=i.apply(this,arguments)).loadFeed=e.loadFeed.bind(Q(e)),e.loadCategories=e.loadCategories.bind(Q(e)),e.metaExists=e.metaExists.bind(Q(e)),e.multipleMetaExists=e.multipleMetaExists.bind(Q(e)),e.getImageURL=e.getImageURL.bind(Q(e)),e.getValidateURL=e.getValidateURL.bind(Q(e)),e.onChangeFeed=e.onChangeFeed.bind(Q(e)),e.onChangeMax=e.onChangeMax.bind(Q(e)),e.onChangeOffset=e.onChangeOffset.bind(Q(e)),e.onToggleFeedTitle=e.onToggleFeedTitle.bind(Q(e)),e.onRefresh=e.onRefresh.bind(Q(e)),e.onSort=e.onSort.bind(Q(e)),e.onTarget=e.onTarget.bind(Q(e)),e.onTitle=e.onTitle.bind(Q(e)),e.onChangeMeta=e.onChangeMeta.bind(Q(e)),e.onChangeMultipleMeta=e.onChangeMultipleMeta.bind(Q(e)),e.onToggleSummary=e.onToggleSummary.bind(Q(e)),e.onToggleLazy=e.onToggleLazy.bind(Q(e)),e.onSummaryLength=e.onSummaryLength.bind(Q(e)),e.onKeywordsTitle=e.onKeywordsTitle.bind(Q(e)),e.onKeywordsBan=e.onKeywordsBan.bind(Q(e)),e.onThumb=e.onThumb.bind(Q(e)),e.onDefault=e.onDefault.bind(Q(e)),e.onSize=e.onSize.bind(Q(e)),e.onHTTP=e.onHTTP.bind(Q(e)),e.onReferralURL=e.onReferralURL.bind(Q(e)),e.onColumns=e.onColumns.bind(Q(e)),e.onTemplate=e.onTemplate.bind(Q(e)),e.onTogglePrice=e.onTogglePrice.bind(Q(e)),e.onKeywordsIncludeOn=e.onKeywordsIncludeOn.bind(Q(e)),e.onKeywordsExcludeOn=e.onKeywordsExcludeOn.bind(Q(e)),e.onFromDateTime=e.onFromDateTime.bind(Q(e)),e.onToDateTime=e.onToDateTime.bind(Q(e)),e.feedzyCategoriesList=e.feedzyCategoriesList.bind(Q(e)),e.onToggleItemTitle=e.onToggleItemTitle.bind(Q(e)),e.handleKeyUp=e.handleKeyUp.bind(Q(e)),e.state={route:e.props.attributes.route,loading:!1,error:!1},e}return t=l,(r=[{key:"componentDidMount",value:(s=$(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.loadFeed(),void 0===this.props.attributes.categories&&(this.props.attributes.meta||this.props.setAttributes({meta:!0,metafields:"no"}),setTimeout((function(){t.loadCategories()})));case 2:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"componentDidUpdate",value:(a=$(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"reload"===this.state.route&&this.loadFeed();case 1:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"loadFeed",value:function(){var e=this,t=this.props.attributes.feeds;if(void 0!==t){if(function(e,t){if(void 0===t)return!1;for(var r=!1,n=0;n<t.length;n++)if(t[n]===e){r=!0;break}return r}(t,this.props.attributes.categories)){var r=t;t=o.a.stringify({category:r},{arrayFormat:"bracket"})}else t=t.replace(/\s/g,"").split(",").filter((function(e){return""!==e})),t=o.a.stringify({url:t},{arrayFormat:"bracket"});this.setState({route:"home",loading:!0}),ee({path:"/feedzy/v1/feed?".concat(t),method:"POST",data:this.props.attributes}).then((function(t){return e.unmounting?t:t.error?(e.setState({route:"home",loading:!1,error:!0}),t):(e.props.setAttributes({feedData:t}),e.setState({route:"fetched",loading:!1}),t)})).fail((function(t){return e.setState({route:"home",loading:!1,error:!0}),t}))}}},{key:"loadCategories",value:function(){var e=this;ee({path:"/wp/v2/feedzy_categories?per_page=100"}).then((function(t){if(e.unmounting)return t;var r=0,n=[];t.forEach((function(e){n[r]=e.slug,r+=1}));var a=e;a.props.setAttributes({categories:n}),jQuery(".feedzy-source input").autocomplete({classes:{"ui-autocomplete":"feedzy-ui-autocomplete"},source:n,minLength:0,select:function(e,t){a.props.setAttributes({feeds:t.item.label})}})})).fail((function(e){return e}))}},{key:"metaExists",value:function(e){return 0<=this.props.attributes.metafields.replace(/\s/g,"").split(",").indexOf(e)||""===this.props.attributes.metafields}},{key:"multipleMetaExists",value:function(e){return 0<=this.props.attributes.multiple_meta.replace(/\s/g,"").split(",").indexOf(e)||""===this.props.attributes.multiple_meta}},{key:"getImageURL",value:function(e,t){var r=e.thumbnail?e.thumbnail:this.props.attributes.default?this.props.attributes.default.url:feedzyjs.imagepath+"feedzy.svg";switch(this.props.attributes.http){case"default":-1===r.indexOf("https")&&0===r.indexOf("http")&&(r=this.props.attributes.default?this.props.attributes.default.url:feedzyjs.imagepath+"feedzy.svg");break;case"https":r=r.replace(/http:/g,"https:")}return t&&(r="url("+r+")"),r}},{key:"onChangeFeed",value:function(e){this.props.setAttributes({feeds:e})}},{key:"onChangeMax",value:function(e){this.props.setAttributes({max:e?Number(e):5})}},{key:"onChangeOffset",value:function(e){this.props.setAttributes({offset:Number(e)})}},{key:"onToggleFeedTitle",value:function(e){this.props.setAttributes({feed_title:!this.props.attributes.feed_title})}},{key:"onRefresh",value:function(e){this.props.setAttributes({refresh:e})}},{key:"onSort",value:function(e){this.props.setAttributes({sort:e})}},{key:"onTarget",value:function(e){this.props.setAttributes({target:e})}},{key:"onTitle",value:function(e){""!==e&&(e=Number(e))<0&&(e=0),this.props.setAttributes({title:e})}},{key:"onChangeMeta",value:function(e){this.props.setAttributes({metafields:e})}},{key:"onChangeMultipleMeta",value:function(e){this.props.setAttributes({multiple_meta:e})}},{key:"onToggleSummary",value:function(e){this.props.setAttributes({summary:!this.props.attributes.summary})}},{key:"onToggleLazy",value:function(e){this.props.setAttributes({lazy:!this.props.attributes.lazy})}},{key:"onSummaryLength",value:function(e){this.props.setAttributes({summarylength:Number(e)})}},{key:"onKeywordsTitle",value:function(e){this.props.setAttributes({keywords_title:e})}},{key:"onKeywordsBan",value:function(e){this.props.setAttributes({keywords_ban:e})}},{key:"onThumb",value:function(e){this.props.setAttributes({thumb:e})}},{key:"onDefault",value:function(e){this.props.setAttributes({default:e}),this.setState({route:"reload"})}},{key:"onSize",value:function(e){this.props.setAttributes({size:e?Number(e):150})}},{key:"onHTTP",value:function(e){this.props.setAttributes({http:e}),this.setState({route:"reload"})}},{key:"onReferralURL",value:function(e){this.props.setAttributes({referral_url:e})}},{key:"onColumns",value:function(e){this.props.setAttributes({columns:e})}},{key:"onTemplate",value:function(e){this.props.setAttributes({template:e})}},{key:"onTogglePrice",value:function(e){this.props.setAttributes({price:!this.props.attributes.price})}},{key:"onKeywordsIncludeOn",value:function(e){this.props.setAttributes({keywords_inc_on:e})}},{key:"onKeywordsExcludeOn",value:function(e){this.props.setAttributes({keywords_exc_on:e})}},{key:"onFromDateTime",value:function(e){this.props.setAttributes({from_datetime:e})}},{key:"onToDateTime",value:function(e){this.props.setAttributes({to_datetime:e})}},{key:"feedzyCategoriesList",value:function(e){jQuery(".feedzy-source input").autocomplete("search","")}},{key:"getValidateURL",value:function(){var e="https://validator.w3.org/feed/";return this.props.attributes.feeds&&(e+="check.cgi?url="+this.props.attributes.feeds),e}},{key:"onToggleItemTitle",value:function(e){this.props.setAttributes({itemTitle:!this.props.attributes.itemTitle})}},{key:"handleKeyUp",value:function(e){13===e.keyCode&&this.loadFeed()}},{key:"render",value:function(){var e,t,r,n,a,o,s,i,l,p,u=this;return["fetched"===this.state.route&&wp.element.createElement(U,B({edit:this,state:this.state},this.props)),"home"===this.state.route&&wp.element.createElement("div",{className:this.props.className},wp.element.createElement(oe,{key:"placeholder",icon:"rss",label:G("Feedzy RSS Feeds")},this.state.loading?wp.element.createElement("div",{key:"loading",className:"wp-block-embed is-loading"},wp.element.createElement(le,null),wp.element.createElement("p",null,G("Fetching..."))):[wp.element.createElement("div",{className:"feedzy-source-wrap"},wp.element.createElement(se,{type:"url",className:"feedzy-source",placeholder:G("Enter URL or category of your feed here..."),onChange:this.onChangeFeed,onKeyUp:this.handleKeyUp,value:this.props.attributes.feeds}),wp.element.createElement("span",{className:"dashicons dashicons-arrow-down-alt2",onClick:this.feedzyCategoriesList})),wp.element.createElement(ie,{isLarge:!0,isPrimary:!0,type:"submit",onClick:this.loadFeed},G("Load Feed")),wp.element.createElement(ae,{href:this.getValidateURL(),title:G("Validate Feed ")},G("Validate ")),!feedzyjs.isPro&&wp.element.createElement("div",{className:"fz-source-upgrade-alert"},wp.element.createElement("strong",null,G("NEW!")," "),G("Enable Amazon Product Advertising feeds to generate affiliate revenue by "),wp.element.createElement(ae,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=keywordsfilter&utm_content=feedzy-rss-feeds"},G("upgrading to Feedzy Pro."))),this.state.error&&wp.element.createElement("div",null,G("Feed URL is invalid. Invalid feeds will NOT display items.")),wp.element.createElement("p",null,G("Enter the full URL of the feed source you wish to display here, or the name of a category you've created. Also you can add multiple URLs just separate them with a comma. You can manage your categories feed from")," ",wp.element.createElement("a",{href:"edit.php?post_type=feedzy_categories",title:G("feedzy categories "),target:"_blank"},G("here ")))])),!("fetched"!==this.state.route||void 0===this.props.attributes.feedData)&&wp.element.createElement("div",{className:"feedzy-rss"},this.props.attributes.feed_title&&null!==this.props.attributes.feedData.channel&&wp.element.createElement("div",{className:"rss_header"},wp.element.createElement("h2",null,wp.element.createElement("a",{className:"rss_title"},I(this.props.attributes.feedData.channel.title)),wp.element.createElement("span",{className:"rss_description"}," "+I(this.props.attributes.feedData.channel.description)))),wp.element.createElement("ul",{className:"feedzy-".concat(this.props.attributes.template)},(e=this.props.attributes.feedData.items,t=this.props.attributes.sort,r=M(this.props.attributes.keywords_title),n=M(this.props.attributes.keywords_ban),a=this.props.attributes.max,o=this.props.attributes.offset,s=this.props.attributes.keywords_inc_on,i=this.props.attributes.keywords_exc_on,l=this.props.attributes.from_datetime,p=this.props.attributes.to_datetime,s="author"===s?"creator":s,i="author"===i?"creator":i,l=""!==l&&void 0!==l&&moment(l).format("X"),p=""!==p&&void 0!==p&&moment(p).format("X"),e=Array.from(e).sort((function(e,r){var n,a;return"date_desc"===t||"date_asc"===t?(n=e.pubDate,a=r.pubDate):"title_desc"!==t&&"title_asc"!==t||(n=e.title.toUpperCase(),a=r.title.toUpperCase()),n<a?"date_desc"===t||"title_desc"===t?1:-1:n>a?"date_desc"===t||"title_desc"===t?-1:1:0})).filter((function(e){return!r||r.test(e[s])})).filter((function(e){return!n||!n.test(e[i])})).filter((function(e){var t=e.date+" "+e.time;return t=moment(new Date(t)).format("X"),!l||!p||l<=t&&t<=p})).slice(o,a+o)).map((function(e,t){var r=(e.date||"")+" "+(e.time||"")+" UTC +0000",n=I(e.date)||"",a=I(e.time)||"",o=I(e.categories)||"";if(u.metaExists("tz=local")){var s=new Date(r);s=s.toUTCString(),n=moment.utc(s).format("MMMM D, YYYY"),a=moment.utc(s).format("h:mm A")}var i=e.creator&&u.metaExists("author")?e.creator:"";""!==u.props.attributes.multiple_meta&&"no"!==u.props.attributes.multiple_meta&&((u.multipleMetaExists("source")||u.multipleMetaExists("yes"))&&""!==i&&""!==e.source?i=i+" ("+e.source+")":(u.multipleMetaExists("source")||u.multipleMetaExists("yes"))&&""!==e.source&&(i=e.source)),""===e.thumbnail&&"auto"===u.props.attributes.thumb&&(e.thumbnail=e.default_img);var l=new Object;return l.author=G("by")+" "+i,l.date=G("on")+" "+I(n),l.time=G("at")+" "+I(a),l.categories=G("in")+" "+I(o),wp.element.createElement("li",{key:t,style:{padding:"15px 0 25px"},className:"rss_item feedzy-rss-col-".concat(u.props.attributes.columns)},(e.thumbnail&&"auto"===u.props.attributes.thumb||"yes"===u.props.attributes.thumb)&&wp.element.createElement("div",{className:"rss_image",style:{width:u.props.attributes.size+"px",height:u.props.attributes.size+"px"}},wp.element.createElement("a",{title:I(e.title),style:{width:u.props.attributes.size+"px",height:u.props.attributes.size+"px"}},wp.element.createElement("span",{className:"fetched",style:{width:u.props.attributes.size+"px",height:u.props.attributes.size+"px",backgroundImage:u.getImageURL(e,!0)},title:I(e.title)}))),wp.element.createElement("div",{className:"rss_content_wrap"},u.props.attributes.itemTitle&&0!==u.props.attributes.title?wp.element.createElement("span",{className:"title"},wp.element.createElement("a",null,u.props.attributes.title&&I(e.title).length>u.props.attributes.title?I(e.title).substring(0,u.props.attributes.title)+"...":I(e.title))):"",wp.element.createElement("div",{className:"rss_content"},"no"!==u.props.attributes.metafields&&wp.element.createElement("small",{className:"meta"},function(e,t){var r="";""===t&&(t="author, date, time");for(var n=t.replace(/\s/g,"").split(","),a=0;a<n.length;a++)void 0!==e[n[a]]&&(r=r+" "+e[n[a]]);return r}(l,u.props.attributes.metafields)),u.props.attributes.summary&&wp.element.createElement("p",{className:"description"},u.props.attributes.summarylength&&I(e.description).length>u.props.attributes.summarylength?I(e.description).substring(0,u.props.attributes.summarylength)+" [...]":I(e.description)),feedzyjs.isPro&&e.media&&e.media.src&&wp.element.createElement("audio",{controls:!0,controlsList:"nodownload"},wp.element.createElement("source",{src:e.media.src,type:e.media.type}),G("Your browser does not support the audio element. But you can check this for the original link: "),wp.element.createElement("a",{href:e.media.src},e.media.src)),feedzyjs.isPro&&u.props.attributes.price&&e.price&&"default"!==u.props.attributes.template&&wp.element.createElement("div",{className:"price-wrap"},wp.element.createElement("a",null,wp.element.createElement("button",{className:"price"},e.price))))))}))))]}}])&&V(t.prototype,r),n&&V(t,n),l}(re)),ue=wp.i18n.__,ce=wp.blocks.registerBlockType;t.default=ce("feedzy-rss-feeds/feedzy-block",{title:ue("Feedzy RSS Feeds"),category:"common",icon:"rss",keywords:[ue("Feedzy RSS Feeds"),ue("RSS"),ue("Feeds")],supports:{html:!1},attributes:n,edit:pe,save:function(){return null}})}});
|
includes/layouts/settings.php
CHANGED
@@ -30,7 +30,24 @@
|
|
30 |
<div class="feedzy-accordion-item">
|
31 |
<div class="feedzy-accordion-item__title">
|
32 |
<div class="feedzy-accordion-item__button">
|
33 |
-
<div class="feedzy-accordion__step-title h2"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
</div>
|
35 |
</div>
|
36 |
<div class="feedzy-accordion-item__content">
|
@@ -185,7 +202,7 @@
|
|
185 |
<?php
|
186 |
wp_nonce_field( $active_tab, 'nonce' );
|
187 |
if ( $show_button ) {
|
188 |
-
$disable_button = ! feedzy_is_pro() && in_array( $active_tab, array( 'spinnerchief', 'wordai' ), true ) ? ' disabled' : '';
|
189 |
?>
|
190 |
<div class="mb-24">
|
191 |
<button type="submit" class="btn btn-primary<?php echo esc_attr( $disable_button ); ?>" id="feedzy-settings-submit" name="feedzy-settings-submit"><?php esc_html_e( 'Save Settings', 'feedzy-rss-feeds' ); ?></button>
|
30 |
<div class="feedzy-accordion-item">
|
31 |
<div class="feedzy-accordion-item__title">
|
32 |
<div class="feedzy-accordion-item__button">
|
33 |
+
<div class="feedzy-accordion__step-title h2">
|
34 |
+
<?php
|
35 |
+
switch ( $active_tab ) {
|
36 |
+
case 'misc':
|
37 |
+
esc_html_e( 'Miscellaneous', 'feedzy-rss-feeds' );
|
38 |
+
break;
|
39 |
+
case 'spinnerchief':
|
40 |
+
esc_html_e( 'SpinnerChief', 'feedzy-rss-feeds' );
|
41 |
+
break;
|
42 |
+
case 'wordai':
|
43 |
+
esc_html_e( 'WordAI', 'feedzy-rss-feeds' );
|
44 |
+
break;
|
45 |
+
default:
|
46 |
+
echo esc_html( ucwords( str_replace( array( '-', '_' ), ' ', $active_tab ) ) );
|
47 |
+
break;
|
48 |
+
}
|
49 |
+
?>
|
50 |
+
</div>
|
51 |
</div>
|
52 |
</div>
|
53 |
<div class="feedzy-accordion-item__content">
|
202 |
<?php
|
203 |
wp_nonce_field( $active_tab, 'nonce' );
|
204 |
if ( $show_button ) {
|
205 |
+
$disable_button = ! feedzy_is_pro() && in_array( $active_tab, array( 'spinnerchief', 'wordai', 'amazon-product-advertising' ), true ) ? ' disabled' : '';
|
206 |
?>
|
207 |
<div class="mb-24">
|
208 |
<button type="submit" class="btn btn-primary<?php echo esc_attr( $disable_button ); ?>" id="feedzy-settings-submit" name="feedzy-settings-submit"><?php esc_html_e( 'Save Settings', 'feedzy-rss-feeds' ); ?></button>
|
includes/views/amazon-product-advertising-view.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="fz-form-wrap">
|
2 |
+
<div class="form-block">
|
3 |
+
<div class="upgrade-alert mb-24">
|
4 |
+
<?php
|
5 |
+
echo wp_kses_post( wp_sprintf( __( 'You\'re using Feedzy Lite. Unlock more powerful features, by <a href="%s" target="_blank">upgrading to Feedzy Pro</a>', 'feedzy-rss-feeds' ), FEEDZY_UPSELL_LINK ) );
|
6 |
+
?>
|
7 |
+
</div>
|
8 |
+
<div class="locked-form-block">
|
9 |
+
<div class="fz-form-group mb-20">
|
10 |
+
<?php
|
11 |
+
// translators: %1$s to available amazon domain.
|
12 |
+
echo wp_kses_post( __( 'Please use this URL structure <strong>amazon.[extension]?keyword=Laptop</strong> or <strong>amazon.com?asin=ASIN_1|ASIN_2</strong> while getting Amazon product information. <br> Here are the available Amazon domains: <strong>com, au, br, ca, fr, de, in, it, jp, mx, nl, pl, sg, sa, es, se, tr, ae, uk</strong>', 'feedzy-rss-feeds' ) );
|
13 |
+
?>
|
14 |
+
</div>
|
15 |
+
<div class="fz-form-row">
|
16 |
+
<div class="fz-form-col-6">
|
17 |
+
<div class="fz-form-group">
|
18 |
+
<label class="form-label"><?php esc_html_e( 'Access Key:', 'feedzy-rss-feeds' ); ?></label>
|
19 |
+
<input type="password" class="form-control" placeholder="<?php echo esc_attr( __( 'Access Key', 'feedzy-rss-feeds' ) ); ?>"/>
|
20 |
+
</div>
|
21 |
+
</div>
|
22 |
+
<div class="fz-form-col-6">
|
23 |
+
<div class="fz-form-group">
|
24 |
+
<label class="form-label"><?php esc_html_e( 'Secret key:', 'feedzy-rss-feeds' ); ?></label>
|
25 |
+
<input type="password" class="form-control" placeholder="<?php echo esc_attr( __( 'Secret key', 'feedzy-rss-feeds' ) ); ?>"/>
|
26 |
+
</div>
|
27 |
+
</div>
|
28 |
+
</div>
|
29 |
+
<div class="fz-form-row">
|
30 |
+
<div class="fz-form-col-6">
|
31 |
+
<div class="fz-form-group">
|
32 |
+
<label class="form-label"><?php esc_html_e( 'Host:', 'feedzy-rss-feeds' ); ?></label>
|
33 |
+
<select class="form-control fz-select-control">
|
34 |
+
<option>webservices.amazon.com</option>
|
35 |
+
</select>
|
36 |
+
</div>
|
37 |
+
</div>
|
38 |
+
<div class="fz-form-col-6">
|
39 |
+
<div class="fz-form-group">
|
40 |
+
<label class="form-label"><?php esc_html_e( 'Region:', 'feedzy-rss-feeds' ); ?></label>
|
41 |
+
<select class="form-control fz-select-control">
|
42 |
+
<option>us-east-1</option>
|
43 |
+
</select>
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
<div class="fz-form-group">
|
48 |
+
<label class="form-label"><?php esc_html_e( 'Partner Tag (store/tracking id):', 'feedzy-rss-feeds' ); ?></label>
|
49 |
+
<div class="fz-input-group">
|
50 |
+
<div class="fz-input-group-left">
|
51 |
+
<input type="text" class="form-control" name="amazon_partner_tag" placeholder="<?php echo esc_attr( __( 'Partner Tag (store/tracking id)', 'feedzy-rss-feeds' ) ); ?>"/>
|
52 |
+
<div class="help-text"><?php esc_html_e( 'API Status: Invalid | Last check: Never', 'feedzy-rss-feeds' ); ?></div>
|
53 |
+
</div>
|
54 |
+
<div class="fz-input-group-right">
|
55 |
+
<button type="button" class="btn btn-outline-primary disabled" ><?php echo esc_html_x( 'Validate connection', 'Check and save action button', 'feedzy-rss-feeds' ); ?></button>
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
</div>
|
includes/views/import-metabox-edit.php
CHANGED
@@ -26,6 +26,22 @@ global $post;
|
|
26 |
<div class="feedzy-accordion-item__content border-top">
|
27 |
<div class="fz-form-wrap">
|
28 |
<div class="form-block">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
<label class="form-label"><?php esc_html_e( 'RSS Feed sources ', 'feedzy-rss-feeds' ); ?></label>
|
30 |
<?php echo wp_kses_post( $invalid_source_msg ); ?>
|
31 |
<input type="hidden" name="post_title" value="<?php echo $post ? esc_attr( $post->post_title ) : ''; ?>">
|
@@ -859,7 +875,7 @@ global $post;
|
|
859 |
'sr' => __( 'Serbian', 'feedzy-rss-feeds' ),
|
860 |
'ss' => __( 'Swati', 'feedzy-rss-feeds' ),
|
861 |
'su' => __( 'Sundanese', 'feedzy-rss-feeds' ),
|
862 |
-
'
|
863 |
'sw' => __( 'Swahili', 'feedzy-rss-feeds' ),
|
864 |
'ta' => __( 'Tamil', 'feedzy-rss-feeds' ),
|
865 |
'th' => __( 'Thai', 'feedzy-rss-feeds' ),
|
26 |
<div class="feedzy-accordion-item__content border-top">
|
27 |
<div class="fz-form-wrap">
|
28 |
<div class="form-block">
|
29 |
+
<?php if ( ! feedzy_is_pro() ) : ?>
|
30 |
+
<div class="fz-upsell-notice upgrade-alert mb-24">
|
31 |
+
<?php
|
32 |
+
$upsell_url = add_query_arg(
|
33 |
+
array(
|
34 |
+
'utm_source' => 'wpadmin',
|
35 |
+
'utm_medium' => 'importfeed',
|
36 |
+
'utm_campaign' => 'amazonproductadvertising',
|
37 |
+
'utm_content' => 'feedzy-rss-feeds',
|
38 |
+
),
|
39 |
+
FEEDZY_UPSELL_LINK
|
40 |
+
);
|
41 |
+
echo wp_kses_post( wp_sprintf( __( '<strong>NEW! </strong>Enable Amazon Product Advertising feeds to generate affiliate revenue by <a href="%s" target="_blank">upgrading to Feedzy Pro.</a><button type="button" class="remove-alert"><span class="dashicons dashicons-no-alt"></span></button>', 'feedzy-rss-feeds' ), esc_url_raw( $upsell_url ) ) );
|
42 |
+
?>
|
43 |
+
</div>
|
44 |
+
<?php endif; ?>
|
45 |
<label class="form-label"><?php esc_html_e( 'RSS Feed sources ', 'feedzy-rss-feeds' ); ?></label>
|
46 |
<?php echo wp_kses_post( $invalid_source_msg ); ?>
|
47 |
<input type="hidden" name="post_title" value="<?php echo $post ? esc_attr( $post->post_title ) : ''; ?>">
|
875 |
'sr' => __( 'Serbian', 'feedzy-rss-feeds' ),
|
876 |
'ss' => __( 'Swati', 'feedzy-rss-feeds' ),
|
877 |
'su' => __( 'Sundanese', 'feedzy-rss-feeds' ),
|
878 |
+
'swe' => __( 'Swedish', 'feedzy-rss-feeds' ),
|
879 |
'sw' => __( 'Swahili', 'feedzy-rss-feeds' ),
|
880 |
'ta' => __( 'Tamil', 'feedzy-rss-feeds' ),
|
881 |
'th' => __( 'Thai', 'feedzy-rss-feeds' ),
|
includes/views/js/import-metabox-edit.js
CHANGED
@@ -69,6 +69,12 @@
|
|
69 |
$('[name="feedzy_meta_data[' + field_name + ']"]').data('tagify').addTags(
|
70 |
"[#" + field_tag + "]"
|
71 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
} else {
|
73 |
$('[name="feedzy_meta_data[' + field_name + ']"]').data('tagify').addTags(
|
74 |
"[#" + field_tag + "]"
|
69 |
$('[name="feedzy_meta_data[' + field_name + ']"]').data('tagify').addTags(
|
70 |
"[#" + field_tag + "]"
|
71 |
);
|
72 |
+
} else if( field_name === "import_post_content" ) {
|
73 |
+
$('[name="feedzy_meta_data[' + field_name + ']"]').focus();
|
74 |
+
$('[name="feedzy_meta_data[' + field_name + ']"]').data('tagify').addTags(
|
75 |
+
"[#" + field_tag + "]"
|
76 |
+
);
|
77 |
+
return false;
|
78 |
} else {
|
79 |
$('[name="feedzy_meta_data[' + field_name + ']"]').data('tagify').addTags(
|
80 |
"[#" + field_tag + "]"
|
js/feedzy-elementor-widget.js
CHANGED
@@ -55,6 +55,23 @@ window.addEventListener( 'elementor/init', function() {
|
|
55 |
}
|
56 |
}
|
57 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
} );
|
59 |
|
60 |
var proTitleText = function() {
|
55 |
}
|
56 |
}
|
57 |
}
|
58 |
+
|
59 |
+
if( '' !== FeedzyElementorEditor.upsell_notice ) {
|
60 |
+
if ( 'dark' === themeMode || userPrefersDark ) {
|
61 |
+
jQuery( FeedzyElementorEditor.upsell_notice ).addClass( 'dark-mode' ).removeClass( 'light-mode' ).insertAfter( '.elementor-panel-navigation' );
|
62 |
+
} else {
|
63 |
+
jQuery( FeedzyElementorEditor.upsell_notice ).addClass( 'light-mode' ).removeClass( 'dark-mode' ).insertAfter( '.elementor-panel-navigation' );
|
64 |
+
}
|
65 |
+
|
66 |
+
jQuery( document ).on( 'click', '.remove-alert', function() {
|
67 |
+
var upSellNotice = jQuery(this).parents( '.fz-upsell-notice' );
|
68 |
+
upSellNotice.fadeOut( 500,
|
69 |
+
function() {
|
70 |
+
upSellNotice.remove();
|
71 |
+
}
|
72 |
+
);
|
73 |
+
} );
|
74 |
+
}
|
75 |
} );
|
76 |
|
77 |
var proTitleText = function() {
|
js/feedzy-setting.js
CHANGED
@@ -51,7 +51,7 @@ jQuery( function( $ ) {
|
|
51 |
$( ':input' ).change(function () {
|
52 |
unsaved = true;
|
53 |
});
|
54 |
-
$( '#feedzy-settings-submit, #check_wordai_api, #check_spinnerchief_api' ).on( 'click', function() {
|
55 |
unsaved = false;
|
56 |
} );
|
57 |
window.addEventListener( 'beforeunload', function( e ) {
|
51 |
$( ':input' ).change(function () {
|
52 |
unsaved = true;
|
53 |
});
|
54 |
+
$( '#feedzy-settings-submit, #check_wordai_api, #check_spinnerchief_api, #check_aws_api' ).on( 'click', function() {
|
55 |
unsaved = false;
|
56 |
} );
|
57 |
window.addEventListener( 'beforeunload', function( e ) {
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: themeisle,codeinwp,hardeepasrani,rozroz
|
|
3 |
Tags: rss aggregator, news aggregator, autoblogging, feed to post, rss import
|
4 |
Requires at least: 3.7
|
5 |
Requires PHP: 5.6
|
6 |
-
Tested up to: 6.
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -464,6 +464,17 @@ You have to check first if your feed is valid. Please test it here: https://vali
|
|
464 |
|
465 |
== Changelog ==
|
466 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
467 |
##### [Version 4.0.5](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v4.0.4...v4.0.5) (2022-10-26)
|
468 |
|
469 |
* Fix possible cache expiration filter change.
|
3 |
Tags: rss aggregator, news aggregator, autoblogging, feed to post, rss import
|
4 |
Requires at least: 3.7
|
5 |
Requires PHP: 5.6
|
6 |
+
Tested up to: 6.1
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
464 |
|
465 |
== Changelog ==
|
466 |
|
467 |
+
#### [Version 4.1.0](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v4.0.5...v4.1.0) (2022-12-06)
|
468 |
+
|
469 |
+
|
470 |
+
- Improve tag items selections on the import screen [#701](https://github.com/Codeinwp/feedzy-rss-feeds/issues/701)
|
471 |
+
- Allow adding all the Magic tags in one flow [#697](https://github.com/Codeinwp/feedzy-rss-feeds/issues/697)
|
472 |
+
- Improve image import support in PRO
|
473 |
+
- Improve full content import in various languages
|
474 |
+
|
475 |
+
|
476 |
+
|
477 |
+
|
478 |
##### [Version 4.0.5](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v4.0.4...v4.0.5) (2022-10-26)
|
479 |
|
480 |
* Fix possible cache expiration filter change.
|
vendor/autoload.php
CHANGED
@@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
|
22 |
|
23 |
require_once __DIR__ . '/composer/autoload_real.php';
|
24 |
|
25 |
-
return
|
22 |
|
23 |
require_once __DIR__ . '/composer/autoload_real.php';
|
24 |
|
25 |
+
return ComposerAutoloaderInitecb78e4f76feb0cf72fecee19aadf413::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,18 +22,18 @@ class ComposerAutoloaderInit2edfb23f01c21303ceeb8e5a71f5a4b4
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
require __DIR__ . '/autoload_static.php';
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
|
32 |
$loader->register(true);
|
33 |
|
34 |
-
$includeFiles = \Composer\Autoload\
|
35 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
36 |
-
|
37 |
}
|
38 |
|
39 |
return $loader;
|
@@ -45,7 +45,7 @@ class ComposerAutoloaderInit2edfb23f01c21303ceeb8e5a71f5a4b4
|
|
45 |
* @param string $file
|
46 |
* @return void
|
47 |
*/
|
48 |
-
function
|
49 |
{
|
50 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
51 |
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInitecb78e4f76feb0cf72fecee19aadf413
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInitecb78e4f76feb0cf72fecee19aadf413', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitecb78e4f76feb0cf72fecee19aadf413', 'loadClassLoader'));
|
28 |
|
29 |
require __DIR__ . '/autoload_static.php';
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInitecb78e4f76feb0cf72fecee19aadf413::getInitializer($loader));
|
31 |
|
32 |
$loader->register(true);
|
33 |
|
34 |
+
$includeFiles = \Composer\Autoload\ComposerStaticInitecb78e4f76feb0cf72fecee19aadf413::$files;
|
35 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
36 |
+
composerRequireecb78e4f76feb0cf72fecee19aadf413($fileIdentifier, $file);
|
37 |
}
|
38 |
|
39 |
return $loader;
|
45 |
* @param string $file
|
46 |
* @return void
|
47 |
*/
|
48 |
+
function composerRequireecb78e4f76feb0cf72fecee19aadf413($fileIdentifier, $file)
|
49 |
{
|
50 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
51 |
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'3df8ee254224091c21b9aebb792d2f8b' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
|
@@ -17,7 +17,7 @@ class ComposerStaticInit2edfb23f01c21303ceeb8e5a71f5a4b4
|
|
17 |
public static function getInitializer(ClassLoader $loader)
|
18 |
{
|
19 |
return \Closure::bind(function () use ($loader) {
|
20 |
-
$loader->classMap =
|
21 |
|
22 |
}, null, ClassLoader::class);
|
23 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInitecb78e4f76feb0cf72fecee19aadf413
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'3df8ee254224091c21b9aebb792d2f8b' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
|
17 |
public static function getInitializer(ClassLoader $loader)
|
18 |
{
|
19 |
return \Closure::bind(function () use ($loader) {
|
20 |
+
$loader->classMap = ComposerStaticInitecb78e4f76feb0cf72fecee19aadf413::$classMap;
|
21 |
|
22 |
}, null, ClassLoader::class);
|
23 |
}
|
vendor/composer/installed.json
CHANGED
@@ -37,10 +37,6 @@
|
|
37 |
"keywords": [
|
38 |
"wordpress"
|
39 |
],
|
40 |
-
"support": {
|
41 |
-
"issues": "https://github.com/Codeinwp/themeisle-sdk/issues",
|
42 |
-
"source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.2.30"
|
43 |
-
},
|
44 |
"install-path": "../codeinwp/themeisle-sdk"
|
45 |
}
|
46 |
],
|
37 |
"keywords": [
|
38 |
"wordpress"
|
39 |
],
|
|
|
|
|
|
|
|
|
40 |
"install-path": "../codeinwp/themeisle-sdk"
|
41 |
}
|
42 |
],
|
vendor/composer/installed.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php return array(
|
2 |
'root' => array(
|
3 |
'name' => 'codeinwp/feedzy-rss-feeds',
|
4 |
-
'pretty_version' => 'v4.0
|
5 |
-
'version' => '4.0.
|
6 |
-
'reference' => '
|
7 |
'type' => 'wordpress-plugin',
|
8 |
'install_path' => __DIR__ . '/../../',
|
9 |
'aliases' => array(),
|
@@ -11,9 +11,9 @@
|
|
11 |
),
|
12 |
'versions' => array(
|
13 |
'codeinwp/feedzy-rss-feeds' => array(
|
14 |
-
'pretty_version' => 'v4.0
|
15 |
-
'version' => '4.0.
|
16 |
-
'reference' => '
|
17 |
'type' => 'wordpress-plugin',
|
18 |
'install_path' => __DIR__ . '/../../',
|
19 |
'aliases' => array(),
|
1 |
<?php return array(
|
2 |
'root' => array(
|
3 |
'name' => 'codeinwp/feedzy-rss-feeds',
|
4 |
+
'pretty_version' => 'v4.1.0',
|
5 |
+
'version' => '4.1.0.0',
|
6 |
+
'reference' => '5de3dab17712f728a3e053c0ba54ac3d5401c736',
|
7 |
'type' => 'wordpress-plugin',
|
8 |
'install_path' => __DIR__ . '/../../',
|
9 |
'aliases' => array(),
|
11 |
),
|
12 |
'versions' => array(
|
13 |
'codeinwp/feedzy-rss-feeds' => array(
|
14 |
+
'pretty_version' => 'v4.1.0',
|
15 |
+
'version' => '4.1.0.0',
|
16 |
+
'reference' => '5de3dab17712f728a3e053c0ba54ac3d5401c736',
|
17 |
'type' => 'wordpress-plugin',
|
18 |
'install_path' => __DIR__ . '/../../',
|
19 |
'aliases' => array(),
|