FEEDZY RSS Feeds Lite - Version 3.8.0

Version Description

Download this release

Release Info

Developer themeisle
Plugin Icon 128x128 FEEDZY RSS Feeds Lite
Version 3.8.0
Comparing to
See all releases

Code changes from version 3.7.5 to 3.8.0

CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
1
  ##### [Version 3.7.5](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v3.7.4...v3.7.5) (2021-09-06)
2
 
3
  #### Fixes
1
+ #### [Version 3.8.0](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v3.7.5...v3.8.0) (2021-10-19)
2
+
3
+ #### Features:
4
+ - Adds compatibility with pro features for [Elementor Template Builder](https://docs.themeisle.com/article/1396-elementor-compatibility-in-feedzy) and Dynamic Tags support.
5
+ - Adds compatibility for pro [Enhanced keyword](https://docs.themeisle.com/article/1154-how-to-use-feed-to-post-feature-in-feedzy#filters) filtering support.
6
+
7
+ #### Fixes
8
+ - Fix category dropdown in Gutenberg Block
9
+ - Magic tags that are unavailable with the free version listed in one line.
10
+ - Fix typo in the import setup
11
+
12
  ##### [Version 3.7.5](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v3.7.4...v3.7.5) (2021-09-06)
13
 
14
  #### Fixes
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: 3.7.5
6
  * Plugin Name: FEEDZY RSS Feeds
7
  * Plugin URI: http://themeisle.com/plugins/feedzy-rss-feeds/
8
  * Author: Themeisle
2
  * feedzy-rss-feeds.css
3
  * Feedzy RSS Feed
4
  * Copyright: (c) 2016 Themeisle, themeisle.com
5
+ * Version: 3.8.0
6
  * Plugin Name: FEEDZY RSS Feeds
7
  * Plugin URI: http://themeisle.com/plugins/feedzy-rss-feeds/
8
  * Author: Themeisle
css/metabox-settings.css CHANGED
@@ -2023,3 +2023,7 @@ input.feedzy-toggle-round:checked + label:after {
2023
  .fz-feature-features button.fz-btn.fz-btn-submit.fz-btn-activate.active:focus {
2024
  background-color: #62c370;
2025
  }
 
 
 
 
2023
  .fz-feature-features button.fz-btn.fz-btn-submit.fz-btn-activate.active:focus {
2024
  background-color: #62c370;
2025
  }
2026
+
2027
+ .fz-settings #feedzy_delete_days {
2028
+ width: 50%;
2029
+ }
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-lite/
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: 3.7.5
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-lite/
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: 3.8.0
19
  * Author: Themeisle
20
  * Author URI: http://themeisle.com
21
  * License: GPL-2.0+
includes/abstract/feedzy-rss-feeds-admin-abstract.php CHANGED
@@ -293,12 +293,17 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
293
  return true;
294
  }
295
 
 
 
 
296
  if ( isset( $sc['keywords_inc'] ) && ! empty( $sc['keywords_inc'] ) ) {
297
  $keywords = $sc['keywords_inc'];
298
  if ( ! empty( $keywords ) ) {
299
  $continue = false;
300
- foreach ( $keywords as $keyword ) {
301
- if ( strpos( $item->get_title(), $keyword ) !== false || strpos( $item->get_description(), $keyword ) !== false ) {
 
 
302
  $continue = true;
303
  }
304
  }
@@ -307,8 +312,10 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
307
  $keywords = $sc['keywords_title'];
308
  if ( ! empty( $keywords ) ) {
309
  $continue = false;
310
- foreach ( $keywords as $keyword ) {
311
- if ( strpos( $item->get_title(), $keyword ) !== false ) {
 
 
312
  $continue = true;
313
  }
314
  }
@@ -318,18 +325,28 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
318
  if ( isset( $sc['keywords_exc'] ) && ! empty( $sc['keywords_exc'] ) ) {
319
  $keywords = $sc['keywords_exc'];
320
  if ( ! empty( $keywords ) ) {
321
- foreach ( $keywords as $keyword ) {
322
- if ( strpos( $item->get_title(), $keyword ) !== false || strpos( $item->get_description(), $keyword ) !== false ) {
323
- return false;
 
 
 
 
 
324
  }
325
  }
326
  }
327
  } elseif ( isset( $sc['keywords_ban'] ) && ! empty( $sc['keywords_ban'] ) ) {
328
  $keywords = $sc['keywords_ban'];
329
  if ( ! empty( $keywords ) ) {
330
- foreach ( $keywords as $keyword ) {
331
- if ( strpos( $item->get_title(), $keyword ) !== false ) {
332
- return false;
 
 
 
 
 
333
  }
334
  }
335
  }
@@ -533,60 +550,68 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
533
  $sc = shortcode_atts(
534
  array(
535
  // comma separated feeds url.
536
- 'feeds' => '',
537
  // number of feeds items (0 for unlimited).
538
- 'max' => '5',
539
  // display feed title yes/no.
540
- 'feed_title' => 'yes',
541
  // _blank, _self
542
- 'target' => '_blank',
543
  // empty or no for nofollow.
544
- 'follow' => '',
545
  // strip title after X char. X can be 0 too, which will remove the title.
546
- 'title' => '',
547
  // yes (author, date, time), no (NEITHER), author, date, time, categories
548
  // tz=local (for date/time in blog time)
549
  // tz=gmt (for date/time in UTC time, this is the default)
550
  // tz=no (for date/time in the feed, without conversion).
551
- 'meta' => 'yes',
552
  // yes (all), no (NEITHER)
553
  // source: show feed title.
554
- 'multiple_meta' => 'no',
555
  // strip title.
556
- 'summary' => 'yes',
557
  // strip summary after X char.
558
- 'summarylength' => '',
559
  // yes, no, auto.
560
- 'thumb' => 'auto',
561
  // default thumb URL if no image found (only if thumb is set to yes or auto).
562
- 'default' => '',
563
  // thumbs pixel size.
564
- 'size' => '',
565
- // only display item if title contains specific keywords (comma-separated list/case sensitive).
566
- 'keywords_title' => '',
567
- // only display item if title OR content contains specific keywords (comma-separated list/case sensitive).
568
- 'keywords_inc' => '',
 
 
 
 
569
  // cache refresh.
570
- 'refresh' => '12_hours',
571
  // sorting.
572
- 'sort' => '',
573
  // https = force https
574
  // default = fall back to default image
575
  // auto = continue as it is.
576
- 'http' => 'auto',
577
  // message to show when feed is empty.
578
- 'error_empty' => 'Feed has no items.',
579
  // to disable amp support, use 'no'. This is currently not available as part of the shortcode tinymce form.
580
- 'amp' => 'yes',
581
  // paginate.
582
- 'offset' => 0,
583
  // class name of this block.
584
- 'className' => '',
585
  // lazy loading of feeds?
586
- 'lazy' => 'no',
587
  // these are only for internal purposes.
588
- '_dryrun_' => 'no',
589
- '_dry_run_tags_' => '',
 
 
 
 
590
  ),
591
  $atts,
592
  'feedzy_default'
@@ -950,29 +975,25 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
950
  if ( is_array( $sc['keywords_title'] ) ) {
951
  $sc['keywords_title'] = implode( ',', $sc['keywords_title'] );
952
  }
953
- $sc['keywords_title'] = rtrim( $sc['keywords_title'], ',' );
954
- $sc['keywords_title'] = array_map( 'trim', explode( ',', $sc['keywords_title'] ) );
955
  }
956
  if ( ! empty( $sc['keywords_inc'] ) ) {
957
  if ( is_array( $sc['keywords_inc'] ) ) {
958
  $sc['keywords_inc'] = implode( ',', $sc['keywords_inc'] );
959
  }
960
- $sc['keywords_inc'] = rtrim( $sc['keywords_inc'], ',' );
961
- $sc['keywords_inc'] = array_map( 'trim', explode( ',', $sc['keywords_inc'] ) );
962
  }
963
  if ( ! empty( $sc['keywords_ban'] ) ) {
964
  if ( is_array( $sc['keywords_ban'] ) ) {
965
  $sc['keywords_ban'] = implode( ',', $sc['keywords_ban'] );
966
  }
967
- $sc['keywords_ban'] = rtrim( $sc['keywords_ban'], ',' );
968
- $sc['keywords_ban'] = array_map( 'trim', explode( ',', $sc['keywords_ban'] ) );
969
  }
970
  if ( ! empty( $sc['keywords_exc'] ) ) {
971
  if ( is_array( $sc['keywords_exc'] ) ) {
972
  $sc['keywords_exc'] = implode( ',', $sc['keywords_exc'] );
973
  }
974
- $sc['keywords_exc'] = rtrim( $sc['keywords_exc'], ',' );
975
- $sc['keywords_exc'] = array_map( 'trim', explode( ',', $sc['keywords_exc'] ) );
976
  }
977
  if ( empty( $sc['summarylength'] ) || ! is_numeric( $sc['summarylength'] ) ) {
978
  $sc['summarylength'] = '';
@@ -1730,4 +1751,47 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
1730
 
1731
  return false;
1732
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1733
  }
293
  return true;
294
  }
295
 
296
+ $inc_on = ! empty( $sc['keywords_inc_on'] ) ? $sc['keywords_inc_on'] : '';
297
+ $exc_on = ! empty( $sc['keywords_exc_on'] ) ? $sc['keywords_exc_on'] : '';
298
+
299
  if ( isset( $sc['keywords_inc'] ) && ! empty( $sc['keywords_inc'] ) ) {
300
  $keywords = $sc['keywords_inc'];
301
  if ( ! empty( $keywords ) ) {
302
  $continue = false;
303
+ if ( ! empty( $inc_on ) ) {
304
+ $continue = $this->feedzy_feed_item_keywords_by( $inc_on, $keywords, $item );
305
+ } else {
306
+ if ( preg_match( "/^$keywords.*$/i", $item->get_title() ) || preg_match( "/^$keywords.*$/i", $item->get_description() ) ) {
307
  $continue = true;
308
  }
309
  }
312
  $keywords = $sc['keywords_title'];
313
  if ( ! empty( $keywords ) ) {
314
  $continue = false;
315
+ if ( ! empty( $inc_on ) ) {
316
+ $continue = $this->feedzy_feed_item_keywords_by( $inc_on, $keywords, $item );
317
+ } else {
318
+ if ( preg_match( "/^$keywords.*$/i", $item->get_title() ) ) {
319
  $continue = true;
320
  }
321
  }
325
  if ( isset( $sc['keywords_exc'] ) && ! empty( $sc['keywords_exc'] ) ) {
326
  $keywords = $sc['keywords_exc'];
327
  if ( ! empty( $keywords ) ) {
328
+ if ( ! empty( $exc_on ) ) {
329
+ $exc_item = $this->feedzy_feed_item_keywords_by( $exc_on, $keywords, $item );
330
+ if ( $exc_item ) {
331
+ $continue = false;
332
+ }
333
+ } else {
334
+ if ( ! preg_match( "/^$keywords.*$/i", $item->get_title() ) || ! preg_match( "/^$keywords.*$/i", $item->get_description() ) ) {
335
+ $continue = false;
336
  }
337
  }
338
  }
339
  } elseif ( isset( $sc['keywords_ban'] ) && ! empty( $sc['keywords_ban'] ) ) {
340
  $keywords = $sc['keywords_ban'];
341
  if ( ! empty( $keywords ) ) {
342
+ if ( ! empty( $exc_on ) ) {
343
+ $keywords_ban = $this->feedzy_feed_item_keywords_by( $exc_on, $keywords, $item );
344
+ if ( $keywords_ban ) {
345
+ $continue = false;
346
+ }
347
+ } else {
348
+ if ( preg_match( "/^$keywords.*$/i", $item->get_title() ) ) {
349
+ $continue = false;
350
  }
351
  }
352
  }
550
  $sc = shortcode_atts(
551
  array(
552
  // comma separated feeds url.
553
+ 'feeds' => '',
554
  // number of feeds items (0 for unlimited).
555
+ 'max' => '5',
556
  // display feed title yes/no.
557
+ 'feed_title' => 'yes',
558
  // _blank, _self
559
+ 'target' => '_blank',
560
  // empty or no for nofollow.
561
+ 'follow' => '',
562
  // strip title after X char. X can be 0 too, which will remove the title.
563
+ 'title' => '',
564
  // yes (author, date, time), no (NEITHER), author, date, time, categories
565
  // tz=local (for date/time in blog time)
566
  // tz=gmt (for date/time in UTC time, this is the default)
567
  // tz=no (for date/time in the feed, without conversion).
568
+ 'meta' => 'yes',
569
  // yes (all), no (NEITHER)
570
  // source: show feed title.
571
+ 'multiple_meta' => 'no',
572
  // strip title.
573
+ 'summary' => 'yes',
574
  // strip summary after X char.
575
+ 'summarylength' => '',
576
  // yes, no, auto.
577
+ 'thumb' => 'auto',
578
  // default thumb URL if no image found (only if thumb is set to yes or auto).
579
+ 'default' => '',
580
  // thumbs pixel size.
581
+ 'size' => '',
582
+ // only display item if title contains specific keywords (Use comma(,) and plus(+) keyword).
583
+ 'keywords_title' => '',
584
+ // only display item if title OR content contains specific keywords (Use comma(,) and plus(+) keyword).
585
+ 'keywords_inc' => '',
586
+ // Keyword filter include in specific field( title, description, author ).
587
+ 'keywords_inc_on' => '',
588
+ // Keyword filter exclude in specific field( title, description, author ).
589
+ 'keywords_exc_on' => '',
590
  // cache refresh.
591
+ 'refresh' => '12_hours',
592
  // sorting.
593
+ 'sort' => '',
594
  // https = force https
595
  // default = fall back to default image
596
  // auto = continue as it is.
597
+ 'http' => 'auto',
598
  // message to show when feed is empty.
599
+ 'error_empty' => 'Feed has no items.',
600
  // to disable amp support, use 'no'. This is currently not available as part of the shortcode tinymce form.
601
+ 'amp' => 'yes',
602
  // paginate.
603
+ 'offset' => 0,
604
  // class name of this block.
605
+ 'className' => '',
606
  // lazy loading of feeds?
607
+ 'lazy' => 'no',
608
  // these are only for internal purposes.
609
+ '_dryrun_' => 'no',
610
+ '_dry_run_tags_' => '',
611
+ // From datetime.
612
+ 'from_datetime' => '',
613
+ // To datetime.
614
+ 'to_datetime' => '',
615
  ),
616
  $atts,
617
  'feedzy_default'
975
  if ( is_array( $sc['keywords_title'] ) ) {
976
  $sc['keywords_title'] = implode( ',', $sc['keywords_title'] );
977
  }
978
+ $sc['keywords_title'] = feedzy_filter_custom_pattern( $sc['keywords_title'] );
 
979
  }
980
  if ( ! empty( $sc['keywords_inc'] ) ) {
981
  if ( is_array( $sc['keywords_inc'] ) ) {
982
  $sc['keywords_inc'] = implode( ',', $sc['keywords_inc'] );
983
  }
984
+ $sc['keywords_inc'] = feedzy_filter_custom_pattern( $sc['keywords_inc'] );
 
985
  }
986
  if ( ! empty( $sc['keywords_ban'] ) ) {
987
  if ( is_array( $sc['keywords_ban'] ) ) {
988
  $sc['keywords_ban'] = implode( ',', $sc['keywords_ban'] );
989
  }
990
+ $sc['keywords_ban'] = feedzy_filter_custom_pattern( $sc['keywords_ban'] );
 
991
  }
992
  if ( ! empty( $sc['keywords_exc'] ) ) {
993
  if ( is_array( $sc['keywords_exc'] ) ) {
994
  $sc['keywords_exc'] = implode( ',', $sc['keywords_exc'] );
995
  }
996
+ $sc['keywords_exc'] = feedzy_filter_custom_pattern( $sc['keywords_exc'] );
 
997
  }
998
  if ( empty( $sc['summarylength'] ) || ! is_numeric( $sc['summarylength'] ) ) {
999
  $sc['summarylength'] = '';
1751
 
1752
  return false;
1753
  }
1754
+
1755
+ /**
1756
+ * Keyword filter in multiple fields.
1757
+ *
1758
+ * @param string $filter_by Filter by.
1759
+ * @param string $keywords Keywords.
1760
+ * @param object $item The feed item.
1761
+ *
1762
+ * @return bool
1763
+ */
1764
+ public function feedzy_feed_item_keywords_by( $filter_by = '', $keywords = '', $item ) {
1765
+ if ( empty( $filter_by ) ) {
1766
+ return false;
1767
+ }
1768
+
1769
+ if ( 'title' === $filter_by ) {
1770
+ $item_title = wp_strip_all_tags( $item->get_title(), true );
1771
+ if ( ! empty( $item_title ) && preg_match( "/^$keywords.*$/i", $item_title ) ) {
1772
+ return true;
1773
+ }
1774
+ } elseif ( 'description' === $filter_by ) {
1775
+ $description = wp_strip_all_tags( $item->get_description(), true );
1776
+ if ( ! empty( $description ) && preg_match( "/^$keywords.*$/i", $description ) ) {
1777
+ return true;
1778
+ }
1779
+ } elseif ( 'author' === $filter_by ) {
1780
+ $author = $item->get_author();
1781
+ $author_name = '';
1782
+ if ( $author ) {
1783
+ $author_name = $author->get_name();
1784
+ }
1785
+ if ( ! empty( $author_name ) && preg_match( "/^$keywords.*$/i", $author_name ) ) {
1786
+ return true;
1787
+ }
1788
+ } elseif ( 'fullcontent' === $filter_by ) {
1789
+ $content = $item->get_item_tags( SIMPLEPIE_NAMESPACE_ATOM_10, 'full-content' );
1790
+ $content = wp_strip_all_tags( $content[0]['data'], true );
1791
+ if ( ! empty( $content ) && preg_match( "/^$keywords.*$/i", $content ) ) {
1792
+ return true;
1793
+ }
1794
+ }
1795
+ return false;
1796
+ }
1797
  }
includes/admin/feedzy-rss-feeds-admin.php CHANGED
@@ -516,6 +516,7 @@ class Feedzy_Rss_Feeds_Admin extends Feedzy_Rss_Feeds_Admin_Abstract {
516
  switch ( $post_tab ) {
517
  case 'general':
518
  $settings['general']['rss-feeds'] = isset( $_POST['rss-feeds'] ) ? (int) filter_input( INPUT_POST, 'rss-feeds', FILTER_SANITIZE_NUMBER_INT ) : '';
 
519
  $settings['general']['default-thumbnail-id'] = isset( $_POST['default-thumbnail-id'] ) ? (int) filter_input( INPUT_POST, 'default-thumbnail-id', FILTER_SANITIZE_NUMBER_INT ) : 0;
520
  break;
521
  case 'headers':
516
  switch ( $post_tab ) {
517
  case 'general':
518
  $settings['general']['rss-feeds'] = isset( $_POST['rss-feeds'] ) ? (int) filter_input( INPUT_POST, 'rss-feeds', FILTER_SANITIZE_NUMBER_INT ) : '';
519
+ $settings['general']['feedzy-delete-days'] = isset( $_POST['feedzy-delete-days'] ) ? (int) filter_input( INPUT_POST, 'feedzy-delete-days', FILTER_SANITIZE_NUMBER_INT ) : '';
520
  $settings['general']['default-thumbnail-id'] = isset( $_POST['default-thumbnail-id'] ) ? (int) filter_input( INPUT_POST, 'default-thumbnail-id', FILTER_SANITIZE_NUMBER_INT ) : 0;
521
  break;
522
  case 'headers':
includes/admin/feedzy-rss-feeds-import.php CHANGED
@@ -281,6 +281,10 @@ class Feedzy_Rss_Feeds_Import {
281
  $post_types = get_post_types( '', 'names' );
282
  $post_types = array_diff( $post_types, array( 'feedzy_imports', 'feedzy_categories' ) );
283
  $published_status = array( 'publish', 'draft' );
 
 
 
 
284
  $import_post_type = get_post_meta( $post->ID, 'import_post_type', true );
285
  $import_post_term = get_post_meta( $post->ID, 'import_post_term', true );
286
  if ( metadata_exists( $import_post_type, $post->ID, 'import_post_status' ) ) {
@@ -292,6 +296,8 @@ class Feedzy_Rss_Feeds_Import {
292
  $source = get_post_meta( $post->ID, 'source', true );
293
  $inc_key = get_post_meta( $post->ID, 'inc_key', true );
294
  $exc_key = get_post_meta( $post->ID, 'exc_key', true );
 
 
295
  $import_title = get_post_meta( $post->ID, 'import_post_title', true );
296
  $import_date = get_post_meta( $post->ID, 'import_post_date', true );
297
  $import_content = get_post_meta( $post->ID, 'import_post_content', true );
@@ -301,6 +307,8 @@ class Feedzy_Rss_Feeds_Import {
301
  $import_remove_duplicates = get_post_meta( $post->ID, 'import_remove_duplicates', true );
302
  $import_remove_duplicates = 'yes' === $import_remove_duplicates || 'post-new.php' === $pagenow ? 'checked' : '';
303
  $import_selected_language = get_post_meta( $post->ID, 'language', true );
 
 
304
  // default values so that post is not created empty.
305
  if ( empty( $import_title ) ) {
306
  $import_title = '[#item_title]';
@@ -331,7 +339,7 @@ class Feedzy_Rss_Feeds_Import {
331
  }
332
  $import_feed_delete_days = intval( get_post_meta( $post->ID, 'import_feed_delete_days', true ) );
333
  if ( empty( $import_feed_delete_days ) ) {
334
- $import_feed_delete_days = 0;
335
  }
336
  $post_status = $post->post_status;
337
  $nonce = wp_create_nonce( FEEDZY_BASEFILE );
@@ -441,7 +449,7 @@ class Feedzy_Rss_Feeds_Import {
441
  $source_is_valid = empty( $invalid_urls );
442
  }
443
  if ( 'import_post_content' === $key ) {
444
- add_filter( 'wp_kses_allowed_html', array( $this, 'allow_iframe_tag_item_content' ), 10, 2 );
445
  $value = feedzy_custom_tag_escape( $value );
446
  } else {
447
  $value = wp_kses( $value, wp_kses_allowed_html( 'post' ) );
@@ -1112,6 +1120,8 @@ class Feedzy_Rss_Feeds_Import {
1112
  $source = get_post_meta( $job->ID, 'source', true );
1113
  $inc_key = get_post_meta( $job->ID, 'inc_key', true );
1114
  $exc_key = get_post_meta( $job->ID, 'exc_key', true );
 
 
1115
  $import_title = get_post_meta( $job->ID, 'import_post_title', true );
1116
  $import_date = get_post_meta( $job->ID, 'import_post_date', true );
1117
  $import_content = get_post_meta( $job->ID, 'import_post_content', true );
@@ -1122,6 +1132,8 @@ class Feedzy_Rss_Feeds_Import {
1122
  $import_item_img_url = get_post_meta( $job->ID, 'import_use_external_image', true );
1123
  $import_remove_duplicates = get_post_meta( $job->ID, 'import_remove_duplicates', true );
1124
  $import_selected_language = get_post_meta( $job->ID, 'language', true );
 
 
1125
  $max = $import_feed_limit;
1126
  // Used as a new line character in import content.
1127
  $import_content = str_replace( PHP_EOL, "\r\n", $import_content );
@@ -1175,10 +1187,14 @@ class Feedzy_Rss_Feeds_Import {
1175
  'keywords_inc' => $inc_key, // this is not keywords_title
1176
  'keywords_ban' => $exc_key, // to support old pro that does not support keywords_exc
1177
  'keywords_exc' => $exc_key, // this is not keywords_ban
 
 
1178
  'columns' => 1,
1179
  'offset' => 0,
1180
  'multiple_meta' => 'no',
1181
  'refresh' => '55_mins',
 
 
1182
  ),
1183
  $job
1184
  );
@@ -1208,7 +1224,7 @@ class Feedzy_Rss_Feeds_Import {
1208
  $results = $this->get_job_feed( $options, $import_content, true );
1209
 
1210
  $xml_results = '';
1211
- if ( '[#item_full_content]' === $import_content ) {
1212
  $xml_results = $this->get_job_feed( $options, '[#item_content]', true );
1213
  }
1214
 
@@ -2119,7 +2135,7 @@ class Feedzy_Rss_Feeds_Import {
2119
  *
2120
  * @return array
2121
  */
2122
- public function allow_iframe_tag_item_content( $tags, $context ) {
2123
  if ( ! isset( $tags['iframe'] ) ) {
2124
  $tags['iframe'] = array(
2125
  'src' => true,
@@ -2130,6 +2146,9 @@ class Feedzy_Rss_Feeds_Import {
2130
  'data-*' => true,
2131
  );
2132
  }
 
 
 
2133
  return $tags;
2134
  }
2135
 
281
  $post_types = get_post_types( '', 'names' );
282
  $post_types = array_diff( $post_types, array( 'feedzy_imports', 'feedzy_categories' ) );
283
  $published_status = array( 'publish', 'draft' );
284
+ $keyword_filter_fields = array( __( 'Title', 'feedzy-rss-feeds' ) );
285
+ if ( feedzy_is_pro() ) {
286
+ $keyword_filter_fields = array_merge( $keyword_filter_fields, array( __( 'Description', 'feedzy-rss-feeds' ), __( 'Author', 'feedzy-rss-feeds' ), __( 'Full Content', 'feedzy-rss-feeds' ) ) );
287
+ }
288
  $import_post_type = get_post_meta( $post->ID, 'import_post_type', true );
289
  $import_post_term = get_post_meta( $post->ID, 'import_post_term', true );
290
  if ( metadata_exists( $import_post_type, $post->ID, 'import_post_status' ) ) {
296
  $source = get_post_meta( $post->ID, 'source', true );
297
  $inc_key = get_post_meta( $post->ID, 'inc_key', true );
298
  $exc_key = get_post_meta( $post->ID, 'exc_key', true );
299
+ $inc_on = get_post_meta( $post->ID, 'inc_on', true );
300
+ $exc_on = get_post_meta( $post->ID, 'exc_on', true );
301
  $import_title = get_post_meta( $post->ID, 'import_post_title', true );
302
  $import_date = get_post_meta( $post->ID, 'import_post_date', true );
303
  $import_content = get_post_meta( $post->ID, 'import_post_content', true );
307
  $import_remove_duplicates = get_post_meta( $post->ID, 'import_remove_duplicates', true );
308
  $import_remove_duplicates = 'yes' === $import_remove_duplicates || 'post-new.php' === $pagenow ? 'checked' : '';
309
  $import_selected_language = get_post_meta( $post->ID, 'language', true );
310
+ $from_datetime = get_post_meta( $post->ID, 'from_datetime', true );
311
+ $to_datetime = get_post_meta( $post->ID, 'to_datetime', true );
312
  // default values so that post is not created empty.
313
  if ( empty( $import_title ) ) {
314
  $import_title = '[#item_title]';
339
  }
340
  $import_feed_delete_days = intval( get_post_meta( $post->ID, 'import_feed_delete_days', true ) );
341
  if ( empty( $import_feed_delete_days ) ) {
342
+ $import_feed_delete_days = ! empty( $this->free_settings['general']['feedzy-delete-days'] ) ? (int) $this->free_settings['general']['feedzy-delete-days'] : 0;
343
  }
344
  $post_status = $post->post_status;
345
  $nonce = wp_create_nonce( FEEDZY_BASEFILE );
449
  $source_is_valid = empty( $invalid_urls );
450
  }
451
  if ( 'import_post_content' === $key ) {
452
+ add_filter( 'wp_kses_allowed_html', array( $this, 'feedzy_wp_kses_allowed_html' ), 10, 2 );
453
  $value = feedzy_custom_tag_escape( $value );
454
  } else {
455
  $value = wp_kses( $value, wp_kses_allowed_html( 'post' ) );
1120
  $source = get_post_meta( $job->ID, 'source', true );
1121
  $inc_key = get_post_meta( $job->ID, 'inc_key', true );
1122
  $exc_key = get_post_meta( $job->ID, 'exc_key', true );
1123
+ $inc_on = get_post_meta( $job->ID, 'inc_on', true );
1124
+ $exc_on = get_post_meta( $job->ID, 'exc_on', true );
1125
  $import_title = get_post_meta( $job->ID, 'import_post_title', true );
1126
  $import_date = get_post_meta( $job->ID, 'import_post_date', true );
1127
  $import_content = get_post_meta( $job->ID, 'import_post_content', true );
1132
  $import_item_img_url = get_post_meta( $job->ID, 'import_use_external_image', true );
1133
  $import_remove_duplicates = get_post_meta( $job->ID, 'import_remove_duplicates', true );
1134
  $import_selected_language = get_post_meta( $job->ID, 'language', true );
1135
+ $from_datetime = get_post_meta( $job->ID, 'from_datetime', true );
1136
+ $to_datetime = get_post_meta( $job->ID, 'to_datetime', true );
1137
  $max = $import_feed_limit;
1138
  // Used as a new line character in import content.
1139
  $import_content = str_replace( PHP_EOL, "\r\n", $import_content );
1187
  'keywords_inc' => $inc_key, // this is not keywords_title
1188
  'keywords_ban' => $exc_key, // to support old pro that does not support keywords_exc
1189
  'keywords_exc' => $exc_key, // this is not keywords_ban
1190
+ 'keywords_inc_on' => $inc_on,
1191
+ 'keywords_exc_on' => $exc_on,
1192
  'columns' => 1,
1193
  'offset' => 0,
1194
  'multiple_meta' => 'no',
1195
  'refresh' => '55_mins',
1196
+ 'from_datetime' => $from_datetime,
1197
+ 'to_datetime' => $to_datetime,
1198
  ),
1199
  $job
1200
  );
1224
  $results = $this->get_job_feed( $options, $import_content, true );
1225
 
1226
  $xml_results = '';
1227
+ if ( false !== strpos( $import_content, '[#item_full_content]' ) ) {
1228
  $xml_results = $this->get_job_feed( $options, '[#item_content]', true );
1229
  }
1230
 
2135
  *
2136
  * @return array
2137
  */
2138
+ public function feedzy_wp_kses_allowed_html( $tags, $context ) {
2139
  if ( ! isset( $tags['iframe'] ) ) {
2140
  $tags['iframe'] = array(
2141
  'src' => true,
2146
  'data-*' => true,
2147
  );
2148
  }
2149
+ if ( isset( $tags['span'] ) ) {
2150
+ $tags['span']['disabled'] = true;
2151
+ }
2152
  return $tags;
2153
  }
2154
 
includes/admin/feedzy-rss-feeds-ui-lang.php CHANGED
@@ -303,19 +303,59 @@ class Feedzy_Rss_Feeds_Ui_Lang {
303
  'value' => '',
304
  ),
305
  'keywords_title' => array(
306
- 'label' => __( 'Only display item if title contains specific keyword(s) (comma-separated list/case sensitive).', 'feedzy-rss-feeds' ),
307
- 'placeholder' => __( '(eg: news, sports etc.)', 'feedzy-rss-feeds' ),
308
  'type' => 'text',
309
  'value' => '',
310
  'disabled' => feedzy_is_new(),
311
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  'keywords_ban' => array(
313
- 'label' => __( 'Exclude items if title contains specific keyword(s) (comma-separated list/case sensitive). ', 'feedzy-rss-feeds' ),
314
- 'placeholder' => __( '(eg: politics, gossip etc.)', 'feedzy-rss-feeds' ),
315
  'type' => 'text',
316
  'value' => '',
317
  'disabled' => true,
318
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  ),
320
  ),
321
  'section_image' => array(
303
  'value' => '',
304
  ),
305
  'keywords_title' => array(
306
+ 'label' => __( 'Only display item if selected field contains specific keyword(s) (Use comma(,) and plus(+) keyword).', 'feedzy-rss-feeds' ),
307
+ 'placeholder' => __( '(eg: news, stock + market etc.)', 'feedzy-rss-feeds' ),
308
  'type' => 'text',
309
  'value' => '',
310
  'disabled' => feedzy_is_new(),
311
  ),
312
+ 'keywords_inc_on' => array(
313
+ 'label' => __( 'Select a specific item if you want to include a keyword filter.', 'feedzy-rss-feeds' ),
314
+ 'type' => 'select',
315
+ 'value' => '',
316
+ 'disabled' => feedzy_is_new(),
317
+ 'opts' => array(
318
+ 'title' => array(
319
+ 'label' => __( 'Title', 'feedzy-rss-feeds' ),
320
+ 'value' => 'title',
321
+ ),
322
+ 'author' => array(
323
+ 'label' => __( 'Author', 'feedzy-rss-feeds' ),
324
+ 'value' => 'author',
325
+ ),
326
+ 'description' => array(
327
+ 'label' => __( 'Description', 'feedzy-rss-feeds' ),
328
+ 'value' => 'description',
329
+ ),
330
+ ),
331
+ ),
332
  'keywords_ban' => array(
333
+ 'label' => __( 'Exclude items if selected field contains specific keyword(s) (Use comma(,) and plus(+) keyword). ', 'feedzy-rss-feeds' ),
334
+ 'placeholder' => __( '(eg: politics, gossip + stock etc.)', 'feedzy-rss-feeds' ),
335
  'type' => 'text',
336
  'value' => '',
337
  'disabled' => true,
338
  ),
339
+ 'keywords_exc_on' => array(
340
+ 'label' => __( 'Select a specific item if you want to exclude a keyword filter.', 'feedzy-rss-feeds' ),
341
+ 'type' => 'select',
342
+ 'value' => '',
343
+ 'disabled' => feedzy_is_new(),
344
+ 'opts' => array(
345
+ 'title' => array(
346
+ 'label' => __( 'Title', 'feedzy-rss-feeds' ),
347
+ 'value' => 'title',
348
+ ),
349
+ 'author' => array(
350
+ 'label' => __( 'Author', 'feedzy-rss-feeds' ),
351
+ 'value' => 'author',
352
+ ),
353
+ 'description' => array(
354
+ 'label' => __( 'Description', 'feedzy-rss-feeds' ),
355
+ 'value' => 'description',
356
+ ),
357
+ ),
358
+ ),
359
  ),
360
  ),
361
  'section_image' => array(
includes/admin/feedzy-wp-widget.php CHANGED
@@ -115,6 +115,9 @@ class feedzy_wp_widget extends WP_Widget {
115
  if ( 'number' === $element['type'] ) {
116
  $widget_form .= '<input class="widefat" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" type="number" value="' . esc_attr( $instance[ $id ] ) . '" />';
117
  }
 
 
 
118
  if ( 'select' === $element['type'] || 'radio' === $element['type'] ) {
119
  $widget_form .= '<select class="widefat" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" >';
120
  foreach ( $element['opts'] as $select_option ) {
@@ -253,6 +256,10 @@ class feedzy_wp_widget extends WP_Widget {
253
  'lazy' => isset( $instance['lazy'] ) ? self::bool_to_enum( $instance['lazy'] ) : false,
254
  'offset' => isset( $instance['offset'] ) ? $instance['offset'] : '',
255
  'multiple_meta' => isset( $instance['multiple_meta'] ) ? $instance['multiple_meta'] : '',
 
 
 
 
256
  );
257
  $feedzy_widget_shortcode_attributes = apply_filters( 'feedzy_widget_shortcode_attributes_filter', $feedzy_widget_shortcode_attributes, $args, $instance );
258
 
115
  if ( 'number' === $element['type'] ) {
116
  $widget_form .= '<input class="widefat" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" type="number" value="' . esc_attr( $instance[ $id ] ) . '" />';
117
  }
118
+ if ( 'datetime-local' === $element['type'] ) {
119
+ $widget_form .= '<input class="widefat" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" type="datetime-local" value="' . esc_attr( $instance[ $id ] ) . '" />';
120
+ }
121
  if ( 'select' === $element['type'] || 'radio' === $element['type'] ) {
122
  $widget_form .= '<select class="widefat" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" >';
123
  foreach ( $element['opts'] as $select_option ) {
256
  'lazy' => isset( $instance['lazy'] ) ? self::bool_to_enum( $instance['lazy'] ) : false,
257
  'offset' => isset( $instance['offset'] ) ? $instance['offset'] : '',
258
  'multiple_meta' => isset( $instance['multiple_meta'] ) ? $instance['multiple_meta'] : '',
259
+ 'keywords_inc_on' => isset( $instance['keywords_inc_on'] ) ? $instance['keywords_inc_on'] : '',
260
+ 'keywords_exc_on' => isset( $instance['keywords_exc_on'] ) ? $instance['keywords_exc_on'] : '',
261
+ 'from_datetime' => isset( $instance['from_datetime'] ) ? $instance['from_datetime'] : '',
262
+ 'to_datetime' => isset( $instance['to_datetime'] ) ? $instance['to_datetime'] : '',
263
  );
264
  $feedzy_widget_shortcode_attributes = apply_filters( 'feedzy_widget_shortcode_attributes_filter', $feedzy_widget_shortcode_attributes, $args, $instance );
265
 
includes/feedzy-rss-feeds-feed-tweaks.php CHANGED
@@ -191,6 +191,37 @@ function feedzy_custom_tag_escape( $content = '' ) {
191
  return $content;
192
  }
193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  add_filter(
195
  'feedzy_wp_kses_allowed_html',
196
  function( $allowed_html = array() ) {
@@ -238,6 +269,7 @@ add_filter(
238
  ),
239
  'span' => array(
240
  'class' => array(),
 
241
  ),
242
  'div' => array(
243
  'class' => array(),
191
  return $content;
192
  }
193
 
194
+ /**
195
+ * Create pattern for feedzy keyword filter.
196
+ *
197
+ * @param string $keyword Keyword.
198
+ * @return string
199
+ */
200
+ function feedzy_filter_custom_pattern( $keyword = '' ) {
201
+ $pattern = '';
202
+ $regex = array();
203
+ if ( ! empty( $keyword ) && strlen( preg_replace( '/[^a-zA-Z]/', '', $keyword ) ) <= 500 ) {
204
+ $keywords = explode( ',', $keyword );
205
+ $keywords = array_filter( $keywords );
206
+ $keywords = array_map( 'trim', $keywords );
207
+ if ( ! empty( $keywords ) ) {
208
+ foreach ( $keywords as $keyword ) {
209
+ $keyword = explode( '+', $keyword );
210
+ $keyword = array_map(
211
+ function( $k ) {
212
+ $k = trim( $k );
213
+ return "(?=.*$k)";
214
+ },
215
+ $keyword
216
+ );
217
+ $regex[] = implode( '', $keyword );
218
+ }
219
+ $pattern .= implode( '|', $regex );
220
+ }
221
+ }
222
+ return $pattern;
223
+ }
224
+
225
  add_filter(
226
  'feedzy_wp_kses_allowed_html',
227
  function( $allowed_html = array() ) {
269
  ),
270
  'span' => array(
271
  'class' => array(),
272
+ 'disabled' => array(),
273
  ),
274
  'div' => array(
275
  'class' => 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 = '3.7.5';
108
  self::$instance->load_dependencies();
109
  self::$instance->set_locale();
110
  self::$instance->define_admin_hooks();
@@ -260,7 +260,7 @@ class Feedzy_Rss_Feeds {
260
  self::$instance->loader->add_filter( 'feedzy_retrieve_categories', $plugin_import, 'retrieve_categories', 10, 2 );
261
  self::$instance->loader->add_filter( 'feedzy_is_license_of_type', $plugin_import, 'feedzy_is_license_of_type', 10, 2 );
262
  self::$instance->loader->add_filter( 'post_row_actions', $plugin_import, 'add_import_actions', 10, 2 );
263
- self::$instance->loader->add_filter( 'wp_kses_allowed_html', $plugin_import, 'allow_iframe_tag_item_content', 10, 2 );
264
  }
265
 
266
  if ( ! defined( 'TI_UNIT_TESTING' ) ) {
104
  */
105
  public function init() {
106
  self::$plugin_name = 'feedzy-rss-feeds';
107
+ self::$version = '3.8.0';
108
  self::$instance->load_dependencies();
109
  self::$instance->set_locale();
110
  self::$instance->define_admin_hooks();
260
  self::$instance->loader->add_filter( 'feedzy_retrieve_categories', $plugin_import, 'retrieve_categories', 10, 2 );
261
  self::$instance->loader->add_filter( 'feedzy_is_license_of_type', $plugin_import, 'feedzy_is_license_of_type', 10, 2 );
262
  self::$instance->loader->add_filter( 'post_row_actions', $plugin_import, 'add_import_actions', 10, 2 );
263
+ self::$instance->loader->add_filter( 'wp_kses_allowed_html', $plugin_import, 'feedzy_wp_kses_allowed_html', 10, 2 );
264
  }
265
 
266
  if ( ! defined( 'TI_UNIT_TESTING' ) ) {
includes/gutenberg/build/block.css CHANGED
@@ -1,2 +1,2 @@
1
- .wp-block-feedzy-rss-feeds-feedzy-block .feedzy-source{margin-right:10px}.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}
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,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}
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 +1 @@
1
- (()=>{"use strict";var e={20:e=>{var t="%[a-f0-9]{2}",r=new RegExp(t,"gi"),a=new RegExp("("+t+")+","gi");function n(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),a=e.slice(t);return Array.prototype.concat.call([],n(r),n(a))}function s(e){try{return decodeURIComponent(e)}catch(s){for(var t=e.match(r),a=1;a<t.length;a++)t=(e=n(t,a).join("")).match(r);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)}}},806:e=>{e.exports=function(e,t){for(var r={},a=Object.keys(e),n=Array.isArray(t),s=0;s<a.length;s++){var o=a[s],i=e[o];(n?-1!==t.indexOf(o):t(o,i,e))&&(r[o]=i)}return r}},563:(e,t,r)=>{const a=r(610),n=r(20),s=r(500),o=r(806);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?a(e):encodeURIComponent(e):e}function p(e,t){return t.decode?n(e):e}function u(e){return Array.isArray(e)?e.sort():"object"==typeof e?u(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function c(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function m(e){const t=(e=c(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function d(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 f(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,a)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===a[e]&&(a[e]={}),a[e][t[1]]=r):a[e]=r};case"bracket":return(e,r,a)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==a[e]?a[e]=[].concat(a[e],r):a[e]=[r]:a[e]=r};case"comma":case"separator":return(t,r,a)=>{const n="string"==typeof r&&r.includes(e.arrayFormatSeparator),s="string"==typeof r&&!n&&p(r,e).includes(e.arrayFormatSeparator);r=s?p(r,e):r;const o=n||s?r.split(e.arrayFormatSeparator).map((t=>p(t,e))):null===r?r:p(r,e);a[t]=o};case"bracket-separator":return(t,r,a)=>{const n=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!n)return void(a[t]=r?p(r,e):r);const s=null===r?[]:r.split(e.arrayFormatSeparator).map((t=>p(t,e)));void 0!==a[t]?a[t]=[].concat(a[t],s):a[t]=s};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),a=Object.create(null);if("string"!=typeof e)return a;if(!(e=e.trim().replace(/^[?#&]/,"")))return a;for(const n of e.split("&")){if(""===n)continue;let[e,o]=s(t.decode?n.replace(/\+/g," "):n,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?o:p(o,t),r(p(e,t),o,a)}for(const e of Object.keys(a)){const r=a[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=d(r[e],t);else a[e]=d(r,t)}return!1===t.sort?a:(!0===t.sort?Object.keys(a).sort():Object.keys(a).sort(t.sort)).reduce(((e,t)=>{const r=a[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=u(r):e[t]=r,e}),Object.create(null))}t.extract=m,t.parse=f,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],a=function(e){switch(e.arrayFormat){case"index":return t=>(r,a)=>{const n=r.length;return void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?r:null===a?[...r,[l(t,e),"[",n,"]"].join("")]:[...r,[l(t,e),"[",l(n,e),"]=",l(a,e)].join("")]};case"bracket":return t=>(r,a)=>void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?r:null===a?[...r,[l(t,e),"[]"].join("")]:[...r,[l(t,e),"[]=",l(a,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(a,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?a:(n=null===n?"":n,0===a.length?[[l(r,e),t,l(n,e)].join("")]:[[a,l(n,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,a)=>void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?r:null===a?[...r,l(t,e)]:[...r,[l(t,e),"=",l(a,e)].join("")]}}(t),n={};for(const t of Object.keys(e))r(t)||(n[t]=e[t]);const s=Object.keys(n);return!1!==t.sort&&s.sort(t.sort),s.map((r=>{const n=e[r];return void 0===n?"":null===n?l(r,t):Array.isArray(n)?0===n.length&&"bracket-separator"===t.arrayFormat?l(r,t)+"[]":n.reduce(a(r),[]).join("&"):l(r,t)+"="+l(n,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,a]=s(e,"#");return Object.assign({url:r.split("?")[0]||"",query:f(m(e),t)},t&&t.parseFragmentIdentifier&&a?{fragmentIdentifier:p(a,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0},r);const a=c(e.url).split("?")[0]||"",n=t.extract(e.url),s=t.parse(n,{sort:!1}),o=Object.assign(s,e.query);let i=t.stringify(o,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)}`),`${a}${i}${p}`},t.pick=(e,r,a)=>{a=Object.assign({parseFragmentIdentifier:!0},a);const{url:n,query:s,fragmentIdentifier:i}=t.parseUrl(e,a);return t.stringifyUrl({url:n,query:o(s,r),fragmentIdentifier:i},a)},t.exclude=(e,r,a)=>{const n=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,n,a)}},500:e=>{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)]}},610:e=>{e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))}},t={};function r(a){var n=t[a];if(void 0!==n)return n.exports;var s=t[a]={exports:{}};return e[a](s,s.exports,r),s.exports}(()=>{var e=r(563),t=lodash.isEmpty,a=wp.components.BaseControl;const n=(0,wp.compose.withInstanceId)((function(e){var r=e.label,n=e.selected,s=e.help,o=e.instanceId,i=e.onChange,l=e.disabled,p=e.options,u=void 0===p?[]:p,c="inspector-radio-image-control-".concat(o),m=function(e){return i(e.target.value)};return!t(u)&&wp.element.createElement(a,{label:r,id:c,help:s,className:"components-radio-image-control"},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===n,"aria-describedby":s?"".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"})))}))))}));function s(e){return(s="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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t){return!t||"object"!==s(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 u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var c=wp.i18n.__,m=wp.blockEditor||wp.editor,d=m.InspectorControls,f=m.MediaUpload,h=wp.element,y=h.Component,b=(h.Fragment,wp.components),g=b.BaseControl,v=b.ExternalLink,w=b.PanelBody,E=b.RangeControl,k=b.TextControl,C=b.Button,T=b.ToggleControl,x=b.SelectControl,z=b.ResponsiveWrapper;const N=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&&l(e,t)}(h,e);var t,r,a,s,m=(a=h,s=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}}(),function(){var e,t=u(a);if(s){var r=u(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return p(this,e)});function h(){return o(this,h),m.apply(this,arguments)}return t=h,(r=[{key:"render",value:function(){var e=this,t="";return"https"===this.props.attributes.http&&(t+=c("Please verify that the images exist on HTTPS.")),wp.element.createElement(d,{key:"inspector"},0!==this.props.attributes.status&&wp.element.createElement(w,null,wp.element.createElement(k,{label:c("Feed Source"),className:"feedzy-source",value:this.props.attributes.feeds,onChange:this.props.edit.onChangeFeed}),wp.element.createElement(C,{isLarge:!0,isPrimary:!0,type:"submit",onClick:this.props.edit.loadFeed,className:"loadFeed"},c("Load Feed"))),"fetched"===this.props.state.route&&[wp.element.createElement(w,{title:c("Feed Settings"),initialOpen:!0,className:"feedzy-options"},wp.element.createElement(E,{label:c("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(E,{label:c("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"}),null!==this.props.attributes.feedData.channel&&wp.element.createElement(T,{label:c("Display feed title?"),checked:!!this.props.attributes.feed_title,onChange:this.props.edit.onToggleFeedTitle,className:"feedzy-title"}),wp.element.createElement(T,{label:c("Lazy load feed?"),checked:!!this.props.attributes.lazy,onChange:this.props.edit.onToggleLazy,className:"feedzy-lazy",help:c("Only on the front end.")}),wp.element.createElement(x,{label:c("Feed Caching Time"),value:this.props.attributes.refresh,options:[{label:c("1 Hour"),value:"1_hours"},{label:c("2 Hours"),value:"3_hours"},{label:c("12 Hours"),value:"12_hours"},{label:c("1 Day"),value:"1_days"},{label:c("3 Days"),value:"3_days"},{label:c("15 Days"),value:"15_days"}],onChange:this.props.edit.onRefresh,className:"feedzy-refresh"}),wp.element.createElement(x,{label:c("Sorting Order"),value:this.props.attributes.sort,options:[{label:c("Default"),value:"default"},{label:c("Date Descending"),value:"date_desc"},{label:c("Date Ascending"),value:"date_asc"},{label:c("Title Descending"),value:"title_desc"},{label:c("Title Ascending"),value:"title_asc"}],onChange:this.props.edit.onSort,className:"feedzy-sort"})),wp.element.createElement(w,{title:c("Item Options"),initialOpen:!1,className:"feedzy-item-options"},wp.element.createElement(x,{label:c("Open Links In"),value:this.props.attributes.target,options:[{label:c("New Tab"),value:"_blank"},{label:c("Same Tab"),value:"_self"}],onChange:this.props.edit.onTarget}),wp.element.createElement(k,{label:c("Title Character Limit"),help:c("Leave empty to show full title."),type:"number",value:this.props.attributes.title,onChange:this.props.edit.onTitle,className:"feedzy-title-length",min:0}),wp.element.createElement(g,null,wp.element.createElement(k,{label:feedzyjs.isPro?c("Should we display additional meta fields out of author, date, time or categories? (comma-separated list, in order of display)."):c("Should we display additional meta fields out of author, date or time? (comma-separated list, in order of display)."),help:c('Leave empty to display all and "no" to display nothing.'),placeholder:feedzyjs.isPro?c("(eg: author, date, time, tz=local, categories)"):c("(eg: author, date, time, tz=local)"),value:this.props.attributes.metafields,onChange:this.props.edit.onChangeMeta,className:"feedzy-meta"}),wp.element.createElement(k,{label:c("When using multiple sources, should we display additional meta fields? - source (comma-separated list)."),placeholder:c("(eg: source)"),value:this.props.attributes.multiple_meta,onChange:this.props.edit.onChangeMultipleMeta,className:"feedzy-multiple-meta"}),wp.element.createElement(v,{href:"https://docs.themeisle.com/article/1089-how-to-display-author-date-or-time-from-the-feed"},c("You can find more info about available meta field values here."))),wp.element.createElement(T,{label:c("Display post description?"),checked:!!this.props.attributes.summary,onChange:this.props.edit.onToggleSummary,className:"feedzy-summary"}),this.props.attributes.summary&&wp.element.createElement(k,{label:c("Description Character Limit"),help:c("Leave empty to show full description."),type:"number",value:this.props.attributes.summarylength,onChange:this.props.edit.onSummaryLength,className:"feedzy-summary-length",min:0}),feedzyjs.isPro&&[wp.element.createElement(k,{label:c("Only display if title contains:"),help:c("Comma-separated list/case sensitive."),value:this.props.attributes.keywords_title,onChange:this.props.edit.onKeywordsTitle,className:"feedzy-include"}),wp.element.createElement(k,{label:c("Exclude if title contains:"),help:c("Comma-separated list/case sensitive."),value:this.props.attributes.keywords_ban,onChange:this.props.edit.onKeywordsBan,className:"feedzy-ban"})]),wp.element.createElement(w,{title:c("Item Image Options"),initialOpen:!1,className:"feedzy-image-options"},wp.element.createElement(x,{label:c("Display first image if available?"),value:this.props.attributes.thumb,options:[{label:c("Yes (without a fallback image)"),value:"auto"},{label:c("Yes (with a fallback image)"),value:"yes"},{label:c("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"},c("Fallback image if no image is found.")),wp.element.createElement(f,{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(z,{naturalWidth:e.props.attributes.default.width,naturalHeight:e.props.attributes.default.height},wp.element.createElement("img",{src:e.props.attributes.default.url,alt:c("Featured image")})),wp.element.createElement(C,{isLarge:!0,isSecondary:!0,onClick:function(){return e.props.setAttributes({default:void 0})},style:{marginTop:"10px"}},c("Remove Image"))],wp.element.createElement(C,{isLarge:!0,isPrimary:!0,onClick:r,style:{marginTop:"10px"},className:void 0===e.props.attributes.default&&"feedzy_image_upload"},c("Upload Image"))]}})),wp.element.createElement(k,{label:c("Thumbnails dimension."),type:"number",value:this.props.attributes.size,onChange:this.props.edit.onSize}),wp.element.createElement(x,{label:c("How should we treat HTTP images?"),value:this.props.attributes.http,options:[{label:c("Show with HTTP link"),value:"auto"},{label:c("Force HTTPS"),value:"https"},{label:c("Ignore and show the default image instead"),value:"default"}],onChange:this.props.edit.onHTTP,className:"feedzy-http",help:t})]),feedzyjs.isPro&&wp.element.createElement(w,{title:c("Pro Features"),initialOpen:!1,className:"feedzy-pro-options"},wp.element.createElement(T,{label:c("Display price if available?"),help:this.props.attributes.price&&"default"===this.props.attributes.template?c("Choose a different template for this to work."):null,checked:!!this.props.attributes.price,onChange:this.props.edit.onTogglePrice,className:"feedzy-pro-price"}),wp.element.createElement(k,{label:c("Referral URL parameters."),help:c('Without ("?")'),placeholder:_("(eg. promo_code=feedzy_is_awesome)"),value:this.props.attributes.referral_url,onChange:this.props.edit.onReferralURL}),wp.element.createElement(E,{label:c("Columns"),help:c("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(n,{label:c("Feed Template"),selected:this.props.attributes.template,options:[{label:c("Default"),src:feedzyjs.imagepath+"feedzy-default-template.jpg",value:"default"},{label:c("Style 1"),src:feedzyjs.imagepath+"feedzy-style1-template.jpg",value:"style1"},{label:c("Style 2"),src:feedzyjs.imagepath+"feedzy-style2-template.jpg",value:"style2"}],onChange:this.props.edit.onTemplate,className:"feedzy-pro-template"}))])}}])&&i(t.prototype,r),h}(y);var S=function(e){var t=document.createElement("div");return t.innerHTML=e,void 0!==t.innerText?t.innerText:t.textContent};function O(e){return(O="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 F(){return(F=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 j(e,t,r,a,n,s,o){try{var i=e[s](o),l=i.value}catch(e){return void r(e)}i.done?t(l):Promise.resolve(l).then(a,n)}function R(e){return function(){var t=this,r=arguments;return new Promise((function(a,n){var s=e.apply(t,r);function o(e){j(s,a,n,o,i,"next",e)}function i(e){j(s,a,n,o,i,"throw",e)}o(void 0)}))}}function A(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L(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 P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e,t){return!t||"object"!==O(t)&&"function"!=typeof t?D(e):t}function D(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function U(e){return(U=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var M=wp.i18n.__,B=wp,H=(B.apiFetch,B.apiRequest),$=wp.element,K=$.Component,Y=($.Fragment,wp.components),V=Y.ExternalLink,q=Y.Placeholder,W=Y.TextControl,Q=Y.Button,G=Y.Spinner;wp.date.date;const J=function(t){!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&&P(e,t)}(p,t);var r,a,n,s,o,i,l=(o=p,i=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}}(),function(){var e,t=U(o);if(i){var r=U(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return I(this,e)});function p(){var e;return A(this,p),(e=l.apply(this,arguments)).loadFeed=e.loadFeed.bind(D(e)),e.loadCategories=e.loadCategories.bind(D(e)),e.metaExists=e.metaExists.bind(D(e)),e.multipleMetaExists=e.multipleMetaExists.bind(D(e)),e.getImageURL=e.getImageURL.bind(D(e)),e.getValidateURL=e.getValidateURL.bind(D(e)),e.onChangeFeed=e.onChangeFeed.bind(D(e)),e.onChangeMax=e.onChangeMax.bind(D(e)),e.onChangeOffset=e.onChangeOffset.bind(D(e)),e.onToggleFeedTitle=e.onToggleFeedTitle.bind(D(e)),e.onRefresh=e.onRefresh.bind(D(e)),e.onSort=e.onSort.bind(D(e)),e.onTarget=e.onTarget.bind(D(e)),e.onTitle=e.onTitle.bind(D(e)),e.onChangeMeta=e.onChangeMeta.bind(D(e)),e.onChangeMultipleMeta=e.onChangeMultipleMeta.bind(D(e)),e.onToggleSummary=e.onToggleSummary.bind(D(e)),e.onToggleLazy=e.onToggleLazy.bind(D(e)),e.onSummaryLength=e.onSummaryLength.bind(D(e)),e.onKeywordsTitle=e.onKeywordsTitle.bind(D(e)),e.onKeywordsBan=e.onKeywordsBan.bind(D(e)),e.onThumb=e.onThumb.bind(D(e)),e.onDefault=e.onDefault.bind(D(e)),e.onSize=e.onSize.bind(D(e)),e.onHTTP=e.onHTTP.bind(D(e)),e.onReferralURL=e.onReferralURL.bind(D(e)),e.onColumns=e.onColumns.bind(D(e)),e.onTemplate=e.onTemplate.bind(D(e)),e.onTogglePrice=e.onTogglePrice.bind(D(e)),e.state={route:e.props.attributes.route,loading:!1,error:!1},e}return r=p,(a=[{key:"componentDidMount",value:(s=R(regeneratorRuntime.mark((function e(){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"}),this.loadCategories());case 2:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"componentDidUpdate",value:(n=R(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 t=this,r=this.props.attributes.feeds;if(void 0!==r){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}(r,this.props.attributes.categories)){var a=r;r=e.stringify({category:a},{arrayFormat:"bracket"})}else r=r.replace(/\s/g,"").split(",").filter((function(e){return""!==e})),r=e.stringify({url:r},{arrayFormat:"bracket"});this.setState({route:"home",loading:!0}),H({path:"/feedzy/v1/feed?".concat(r),method:"POST",data:this.props.attributes}).then((function(e){return t.unmounting?e:e.error?(t.setState({route:"home",loading:!1,error:!0}),e):(t.props.setAttributes({feedData:e}),t.setState({route:"fetched",loading:!1}),e)})).fail((function(e){return t.setState({route:"home",loading:!1,error:!0}),e}))}}},{key:"loadCategories",value:function(){var e=this;H({path:"/wp/v2/feedzy_categories"}).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({source:a,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){this.props.setAttributes({title:Number(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:"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:"render",value:function(){var e,t,r,a,n,s,o=this;return["fetched"===this.state.route&&wp.element.createElement(N,F({edit:this,state:this.state},this.props)),"home"===this.state.route&&wp.element.createElement("div",{className:this.props.className},wp.element.createElement(q,{key:"placeholder",icon:"rss",label:M("Feedzy RSS Feeds")},this.state.loading?wp.element.createElement("div",{key:"loading",className:"wp-block-embed is-loading"},wp.element.createElement(G,null),wp.element.createElement("p",null,M("Fetching..."))):[wp.element.createElement(W,{type:"url",className:"feedzy-source",placeholder:M("Enter URL or category of your feed here..."),onChange:this.onChangeFeed,value:this.props.attributes.feeds}),wp.element.createElement(Q,{isLarge:!0,isPrimary:!0,type:"submit",onClick:this.loadFeed},M("Load Feed")),wp.element.createElement(V,{href:this.getValidateURL(),title:M("Validate Feed ")},M("Validate ")),this.state.error&&wp.element.createElement("div",null,M("Feed URL is invalid. Invalid feeds will NOT display items."))])),!("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"},S(this.props.attributes.feedData.channel.title)),wp.element.createElement("span",{className:"rss_description"}," "+S(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=this.props.attributes.keywords_title,a=this.props.attributes.keywords_ban,n=this.props.attributes.max,s=this.props.attributes.offset,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.split(",").filter((function(e){return""!==e.replace(/\s/g,"")})).some((function(t){return e.title.includes(t.trim())}))})).filter((function(e){return!a||a.split(",").filter((function(e){return""!==e.replace(/\s/g,"")})).every((function(t){return!1===e.title.includes(t.trim())}))})).slice(s,n+s)).map((function(e,t){var r=(e.date||"")+" "+(e.time||"")+" UTC +0000",a=S(e.date)||"",n=S(e.time)||"",s=S(e.categories)||"";if(o.metaExists("tz=local")){var i=new Date(r);i=i.toUTCString(),a=moment.utc(i).format("MMMM D, YYYY"),n=moment.utc(i).format("h:mm A")}var l=e.creator&&o.metaExists("author")?e.creator:"";""!==o.props.attributes.multiple_meta&&"no"!==o.props.attributes.multiple_meta&&((o.multipleMetaExists("source")||o.multipleMetaExists("yes"))&&""!==l&&""!==e.source?l=l+" ("+e.source+")":(o.multipleMetaExists("source")||o.multipleMetaExists("yes"))&&""!==e.source&&(l=e.source)),""===e.thumbnail&&"auto"===o.props.attributes.thumb&&(e.thumbnail=e.default_img);var p=new Object;return p.author=M("by")+" "+l,p.date=M("on")+" "+S(a),p.time=M("at")+" "+S(n),p.categories=M("in")+" "+S(s),wp.element.createElement("li",{key:t,style:{padding:"15px 0 25px"},className:"rss_item feedzy-rss-col-".concat(o.props.attributes.columns)},(e.thumbnail&&"auto"===o.props.attributes.thumb||"yes"===o.props.attributes.thumb)&&wp.element.createElement("div",{className:"rss_image",style:{width:o.props.attributes.size+"px",height:o.props.attributes.size+"px"}},wp.element.createElement("a",{title:S(e.title),style:{width:o.props.attributes.size+"px",height:o.props.attributes.size+"px"}},wp.element.createElement("span",{className:"fetched",style:{width:o.props.attributes.size+"px",height:o.props.attributes.size+"px",backgroundImage:o.getImageURL(e,!0)},title:S(e.title)}))),wp.element.createElement("div",{className:"rss_content_wrap"},wp.element.createElement("span",{className:"title"},wp.element.createElement("a",null,o.props.attributes.title&&S(e.title).length>o.props.attributes.title?S(e.title).substring(0,o.props.attributes.title)+"...":S(e.title))),wp.element.createElement("div",{className:"rss_content"},"no"!==o.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}(p,o.props.attributes.metafields)),o.props.attributes.summary&&wp.element.createElement("p",{className:"description"},o.props.attributes.summarylength&&S(e.description).length>o.props.attributes.summarylength?S(e.description).substring(0,o.props.attributes.summarylength)+" [...]":S(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}),M("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&&o.props.attributes.price&&e.price&&"default"!==o.props.attributes.template&&wp.element.createElement("div",{className:"price-wrap"},wp.element.createElement("a",null,wp.element.createElement("button",{className:"price"},e.price))))))}))))]}}])&&L(r.prototype,a),p}(K);var X=wp.i18n.__;(0,wp.blocks.registerBlockType)("feedzy-rss-feeds/feedzy-block",{title:X("Feedzy RSS Feeds"),category:"common",icon:"rss",keywords:[X("Feedzy RSS Feeds"),X("RSS"),X("Feeds")],supports:{html:!1},attributes:{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_ban:{type:"string"},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"}},edit:J,save:function(){return null}})})()})();
1
+ (()=>{"use strict";var e={20:e=>{var t="%[a-f0-9]{2}",r=new RegExp(t,"gi"),a=new RegExp("("+t+")+","gi");function n(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),a=e.slice(t);return Array.prototype.concat.call([],n(r),n(a))}function o(e){try{return decodeURIComponent(e)}catch(o){for(var t=e.match(r),a=1;a<t.length;a++)t=(e=n(t,a).join("")).match(r);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=o(r[0]);n!==r[0]&&(t[r[0]]=n)}r=a.exec(e)}t["%C2"]="�";for(var s=Object.keys(t),i=0;i<s.length;i++){var l=s[i];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}},806:e=>{e.exports=function(e,t){for(var r={},a=Object.keys(e),n=Array.isArray(t),o=0;o<a.length;o++){var s=a[o],i=e[s];(n?-1!==t.indexOf(s):t(s,i,e))&&(r[s]=i)}return r}},563:(e,t,r)=>{const a=r(610),n=r(20),o=r(500),s=r(806);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?a(e):encodeURIComponent(e):e}function p(e,t){return t.decode?n(e):e}function u(e){return Array.isArray(e)?e.sort():"object"==typeof e?u(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function c(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function m(e){const t=(e=c(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function d(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 f(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,a)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===a[e]&&(a[e]={}),a[e][t[1]]=r):a[e]=r};case"bracket":return(e,r,a)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==a[e]?a[e]=[].concat(a[e],r):a[e]=[r]:a[e]=r};case"comma":case"separator":return(t,r,a)=>{const n="string"==typeof r&&r.includes(e.arrayFormatSeparator),o="string"==typeof r&&!n&&p(r,e).includes(e.arrayFormatSeparator);r=o?p(r,e):r;const s=n||o?r.split(e.arrayFormatSeparator).map((t=>p(t,e))):null===r?r:p(r,e);a[t]=s};case"bracket-separator":return(t,r,a)=>{const n=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!n)return void(a[t]=r?p(r,e):r);const o=null===r?[]:r.split(e.arrayFormatSeparator).map((t=>p(t,e)));void 0!==a[t]?a[t]=[].concat(a[t],o):a[t]=o};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),a=Object.create(null);if("string"!=typeof e)return a;if(!(e=e.trim().replace(/^[?#&]/,"")))return a;for(const n of e.split("&")){if(""===n)continue;let[e,s]=o(t.decode?n.replace(/\+/g," "):n,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:p(s,t),r(p(e,t),s,a)}for(const e of Object.keys(a)){const r=a[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=d(r[e],t);else a[e]=d(r,t)}return!1===t.sort?a:(!0===t.sort?Object.keys(a).sort():Object.keys(a).sort(t.sort)).reduce(((e,t)=>{const r=a[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=u(r):e[t]=r,e}),Object.create(null))}t.extract=m,t.parse=f,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],a=function(e){switch(e.arrayFormat){case"index":return t=>(r,a)=>{const n=r.length;return void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?r:null===a?[...r,[l(t,e),"[",n,"]"].join("")]:[...r,[l(t,e),"[",l(n,e),"]=",l(a,e)].join("")]};case"bracket":return t=>(r,a)=>void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?r:null===a?[...r,[l(t,e),"[]"].join("")]:[...r,[l(t,e),"[]=",l(a,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(a,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?a:(n=null===n?"":n,0===a.length?[[l(r,e),t,l(n,e)].join("")]:[[a,l(n,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,a)=>void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?r:null===a?[...r,l(t,e)]:[...r,[l(t,e),"=",l(a,e)].join("")]}}(t),n={};for(const t of Object.keys(e))r(t)||(n[t]=e[t]);const o=Object.keys(n);return!1!==t.sort&&o.sort(t.sort),o.map((r=>{const n=e[r];return void 0===n?"":null===n?l(r,t):Array.isArray(n)?0===n.length&&"bracket-separator"===t.arrayFormat?l(r,t)+"[]":n.reduce(a(r),[]).join("&"):l(r,t)+"="+l(n,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,a]=o(e,"#");return Object.assign({url:r.split("?")[0]||"",query:f(m(e),t)},t&&t.parseFragmentIdentifier&&a?{fragmentIdentifier:p(a,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0},r);const a=c(e.url).split("?")[0]||"",n=t.extract(e.url),o=t.parse(n,{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)}`),`${a}${i}${p}`},t.pick=(e,r,a)=>{a=Object.assign({parseFragmentIdentifier:!0},a);const{url:n,query:o,fragmentIdentifier:i}=t.parseUrl(e,a);return t.stringifyUrl({url:n,query:s(o,r),fragmentIdentifier:i},a)},t.exclude=(e,r,a)=>{const n=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,n,a)}},500:e=>{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)]}},610:e=>{e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))}},t={};function r(a){var n=t[a];if(void 0!==n)return n.exports;var o=t[a]={exports:{}};return e[a](o,o.exports,r),o.exports}(()=>{var e=r(563),t=lodash.isEmpty,a=wp.components.BaseControl;const n=(0,wp.compose.withInstanceId)((function(e){var r=e.label,n=e.selected,o=e.help,s=e.instanceId,i=e.onChange,l=e.disabled,p=e.options,u=void 0===p?[]:p,c="inspector-radio-image-control-".concat(s),m=function(e){return i(e.target.value)};return!t(u)&&wp.element.createElement(a,{label:r,id:c,help:o,className:"components-radio-image-control"},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===n,"aria-describedby":o?"".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"})))}))))}));function o(e){return(o="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 s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t){return!t||"object"!==o(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 u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var c=wp.i18n.__,m=wp.blockEditor||wp.editor,d=m.InspectorControls,f=m.MediaUpload,h=wp.element,y=h.Component,b=(h.Fragment,wp.components),g=b.BaseControl,v=b.ExternalLink,w=b.PanelBody,E=b.RangeControl,k=b.TextControl,C=b.Button,T=b.ToggleControl,x=b.SelectControl,z=b.ResponsiveWrapper;const N=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&&l(e,t)}(h,e);var t,r,a,o,m=(a=h,o=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}}(),function(){var e,t=u(a);if(o){var r=u(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return p(this,e)});function h(){return s(this,h),m.apply(this,arguments)}return t=h,(r=[{key:"render",value:function(){var e=this,t="";return"https"===this.props.attributes.http&&(t+=c("Please verify that the images exist on HTTPS.")),wp.element.createElement(d,{key:"inspector"},0!==this.props.attributes.status&&wp.element.createElement(w,null,wp.element.createElement(k,{label:c("Feed Source"),className:"feedzy-source",value:this.props.attributes.feeds,onChange:this.props.edit.onChangeFeed}),wp.element.createElement(C,{isLarge:!0,isPrimary:!0,type:"submit",onClick:this.props.edit.loadFeed,className:"loadFeed"},c("Load Feed"))),"fetched"===this.props.state.route&&[wp.element.createElement(w,{title:c("Feed Settings"),initialOpen:!0,className:"feedzy-options"},wp.element.createElement(E,{label:c("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(E,{label:c("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"}),null!==this.props.attributes.feedData.channel&&wp.element.createElement(T,{label:c("Display feed title?"),checked:!!this.props.attributes.feed_title,onChange:this.props.edit.onToggleFeedTitle,className:"feedzy-title"}),wp.element.createElement(T,{label:c("Lazy load feed?"),checked:!!this.props.attributes.lazy,onChange:this.props.edit.onToggleLazy,className:"feedzy-lazy",help:c("Only on the front end.")}),wp.element.createElement(x,{label:c("Feed Caching Time"),value:this.props.attributes.refresh,options:[{label:c("1 Hour"),value:"1_hours"},{label:c("2 Hours"),value:"3_hours"},{label:c("12 Hours"),value:"12_hours"},{label:c("1 Day"),value:"1_days"},{label:c("3 Days"),value:"3_days"},{label:c("15 Days"),value:"15_days"}],onChange:this.props.edit.onRefresh,className:"feedzy-refresh"}),wp.element.createElement(x,{label:c("Sorting Order"),value:this.props.attributes.sort,options:[{label:c("Default"),value:"default"},{label:c("Date Descending"),value:"date_desc"},{label:c("Date Ascending"),value:"date_asc"},{label:c("Title Descending"),value:"title_desc"},{label:c("Title Ascending"),value:"title_asc"}],onChange:this.props.edit.onSort,className:"feedzy-sort"})),wp.element.createElement(w,{title:c("Item Options"),initialOpen:!1,className:"feedzy-item-options"},wp.element.createElement(x,{label:c("Open Links In"),value:this.props.attributes.target,options:[{label:c("New Tab"),value:"_blank"},{label:c("Same Tab"),value:"_self"}],onChange:this.props.edit.onTarget}),wp.element.createElement(k,{label:c("Title Character Limit"),help:c("Leave empty to show full title."),type:"number",value:this.props.attributes.title,onChange:this.props.edit.onTitle,className:"feedzy-title-length",min:0}),wp.element.createElement(g,null,wp.element.createElement(k,{label:feedzyjs.isPro?c("Should we display additional meta fields out of author, date, time or categories? (comma-separated list, in order of display)."):c("Should we display additional meta fields out of author, date or time? (comma-separated list, in order of display)."),help:c('Leave empty to display all and "no" to display nothing.'),placeholder:feedzyjs.isPro?c("(eg: author, date, time, tz=local, categories)"):c("(eg: author, date, time, tz=local)"),value:this.props.attributes.metafields,onChange:this.props.edit.onChangeMeta,className:"feedzy-meta"}),wp.element.createElement(k,{label:c("When using multiple sources, should we display additional meta fields? - source (comma-separated list)."),placeholder:c("(eg: source)"),value:this.props.attributes.multiple_meta,onChange:this.props.edit.onChangeMultipleMeta,className:"feedzy-multiple-meta"}),wp.element.createElement(v,{href:"https://docs.themeisle.com/article/1089-how-to-display-author-date-or-time-from-the-feed"},c("You can find more info about available meta field values here."))),wp.element.createElement(T,{label:c("Display post description?"),checked:!!this.props.attributes.summary,onChange:this.props.edit.onToggleSummary,className:"feedzy-summary"}),this.props.attributes.summary&&wp.element.createElement(k,{label:c("Description Character Limit"),help:c("Leave empty to show full description."),type:"number",value:this.props.attributes.summarylength,onChange:this.props.edit.onSummaryLength,className:"feedzy-summary-length",min:0}),feedzyjs.isPro&&[wp.element.createElement(k,{label:c("Only display if selected field contains:"),help:c("Use comma(,) and plus(+) keyword"),value:this.props.attributes.keywords_title,onChange:this.props.edit.onKeywordsTitle,className:"feedzy-include"}),wp.element.createElement(x,{label:c("Select a field if you want to inc keyword."),value:this.props.attributes.keywords_inc_on,options:[{label:c("Title"),value:"title"},{label:c("Author"),value:"author"},{label:c("Description"),value:"description"}],onChange:this.props.edit.onKeywordsIncludeOn}),wp.element.createElement(k,{label:c("Exclude if selected field contains:"),help:c("Use comma(,) and plus(+) keyword"),value:this.props.attributes.keywords_ban,onChange:this.props.edit.onKeywordsBan,className:"feedzy-ban"}),wp.element.createElement(x,{label:c("Select a field if you want to exc keyword."),value:this.props.attributes.keywords_exc_on,options:[{label:c("Title"),value:"title"},{label:c("Author"),value:"author"},{label:c("Description"),value:"description"}],onChange:this.props.edit.onKeywordsExcludeOn}),wp.element.createElement("p",null,c("Filter feed item by date range.")),wp.element.createElement(k,{type:"datetime-local",label:c("From:"),value:this.props.attributes.from_datetime,onChange:this.props.edit.onFromDateTime}),wp.element.createElement(k,{type:"datetime-local",label:c("To:"),value:this.props.attributes.to_datetime,onChange:this.props.edit.onToDateTime})]),wp.element.createElement(w,{title:c("Item Image Options"),initialOpen:!1,className:"feedzy-image-options"},wp.element.createElement(x,{label:c("Display first image if available?"),value:this.props.attributes.thumb,options:[{label:c("Yes (without a fallback image)"),value:"auto"},{label:c("Yes (with a fallback image)"),value:"yes"},{label:c("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"},c("Fallback image if no image is found.")),wp.element.createElement(f,{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(z,{naturalWidth:e.props.attributes.default.width,naturalHeight:e.props.attributes.default.height},wp.element.createElement("img",{src:e.props.attributes.default.url,alt:c("Featured image")})),wp.element.createElement(C,{isLarge:!0,isSecondary:!0,onClick:function(){return e.props.setAttributes({default:void 0})},style:{marginTop:"10px"}},c("Remove Image"))],wp.element.createElement(C,{isLarge:!0,isPrimary:!0,onClick:r,style:{marginTop:"10px"},className:void 0===e.props.attributes.default&&"feedzy_image_upload"},c("Upload Image"))]}})),wp.element.createElement(k,{label:c("Thumbnails dimension."),type:"number",value:this.props.attributes.size,onChange:this.props.edit.onSize}),wp.element.createElement(x,{label:c("How should we treat HTTP images?"),value:this.props.attributes.http,options:[{label:c("Show with HTTP link"),value:"auto"},{label:c("Force HTTPS"),value:"https"},{label:c("Ignore and show the default image instead"),value:"default"}],onChange:this.props.edit.onHTTP,className:"feedzy-http",help:t})]),feedzyjs.isPro&&wp.element.createElement(w,{title:c("Pro Features"),initialOpen:!1,className:"feedzy-pro-options"},wp.element.createElement(T,{label:c("Display price if available?"),help:this.props.attributes.price&&"default"===this.props.attributes.template?c("Choose a different template for this to work."):null,checked:!!this.props.attributes.price,onChange:this.props.edit.onTogglePrice,className:"feedzy-pro-price"}),wp.element.createElement(k,{label:c("Referral URL parameters."),help:c('Without ("?")'),placeholder:_("(eg. promo_code=feedzy_is_awesome)"),value:this.props.attributes.referral_url,onChange:this.props.edit.onReferralURL}),wp.element.createElement(E,{label:c("Columns"),help:c("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(n,{label:c("Feed Template"),selected:this.props.attributes.template,options:[{label:c("Default"),src:feedzyjs.imagepath+"feedzy-default-template.jpg",value:"default"},{label:c("Style 1"),src:feedzyjs.imagepath+"feedzy-style1-template.jpg",value:"style1"},{label:c("Style 2"),src:feedzyjs.imagepath+"feedzy-style2-template.jpg",value:"style2"}],onChange:this.props.edit.onTemplate,className:"feedzy-pro-template"}))])}}])&&i(t.prototype,r),h}(y);var O=function(e){var t=document.createElement("div");return t.innerHTML=e,void 0!==t.innerText?t.innerText:t.textContent},S=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 F(e){return(F="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 j(){return(j=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 R(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 A(e){return function(){var t=this,r=arguments;return new Promise((function(a,n){var o=e.apply(t,r);function s(e){R(o,a,n,s,i,"next",e)}function i(e){R(o,a,n,s,i,"throw",e)}s(void 0)}))}}function L(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 P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e,t){return!t||"object"!==F(t)&&"function"!=typeof t?U(e):t}function U(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function M(e){return(M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var B=wp.i18n.__,K=wp,H=(K.apiFetch,K.apiRequest),$=wp.element,Y=$.Component,V=($.Fragment,wp.components),q=V.ExternalLink,W=V.Placeholder,X=V.TextControl,Q=V.Button,Z=V.Spinner;wp.date.date;const G=function(t){!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&&P(e,t)}(p,t);var r,a,n,o,s,i,l=(s=p,i=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}}(),function(){var e,t=M(s);if(i){var r=M(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return I(this,e)});function p(){var e;return L(this,p),(e=l.apply(this,arguments)).loadFeed=e.loadFeed.bind(U(e)),e.loadCategories=e.loadCategories.bind(U(e)),e.metaExists=e.metaExists.bind(U(e)),e.multipleMetaExists=e.multipleMetaExists.bind(U(e)),e.getImageURL=e.getImageURL.bind(U(e)),e.getValidateURL=e.getValidateURL.bind(U(e)),e.onChangeFeed=e.onChangeFeed.bind(U(e)),e.onChangeMax=e.onChangeMax.bind(U(e)),e.onChangeOffset=e.onChangeOffset.bind(U(e)),e.onToggleFeedTitle=e.onToggleFeedTitle.bind(U(e)),e.onRefresh=e.onRefresh.bind(U(e)),e.onSort=e.onSort.bind(U(e)),e.onTarget=e.onTarget.bind(U(e)),e.onTitle=e.onTitle.bind(U(e)),e.onChangeMeta=e.onChangeMeta.bind(U(e)),e.onChangeMultipleMeta=e.onChangeMultipleMeta.bind(U(e)),e.onToggleSummary=e.onToggleSummary.bind(U(e)),e.onToggleLazy=e.onToggleLazy.bind(U(e)),e.onSummaryLength=e.onSummaryLength.bind(U(e)),e.onKeywordsTitle=e.onKeywordsTitle.bind(U(e)),e.onKeywordsBan=e.onKeywordsBan.bind(U(e)),e.onThumb=e.onThumb.bind(U(e)),e.onDefault=e.onDefault.bind(U(e)),e.onSize=e.onSize.bind(U(e)),e.onHTTP=e.onHTTP.bind(U(e)),e.onReferralURL=e.onReferralURL.bind(U(e)),e.onColumns=e.onColumns.bind(U(e)),e.onTemplate=e.onTemplate.bind(U(e)),e.onTogglePrice=e.onTogglePrice.bind(U(e)),e.onKeywordsIncludeOn=e.onKeywordsIncludeOn.bind(U(e)),e.onKeywordsExcludeOn=e.onKeywordsExcludeOn.bind(U(e)),e.onFromDateTime=e.onFromDateTime.bind(U(e)),e.onToDateTime=e.onToDateTime.bind(U(e)),e.feedzyCategoriesList=e.feedzyCategoriesList.bind(U(e)),e.state={route:e.props.attributes.route,loading:!1,error:!1},e}return r=p,(a=[{key:"componentDidMount",value:(o=A(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 o.apply(this,arguments)})},{key:"componentDidUpdate",value:(n=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 n.apply(this,arguments)})},{key:"loadFeed",value:function(){var t=this,r=this.props.attributes.feeds;if(void 0!==r){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}(r,this.props.attributes.categories)){var a=r;r=e.stringify({category:a},{arrayFormat:"bracket"})}else r=r.replace(/\s/g,"").split(",").filter((function(e){return""!==e})),r=e.stringify({url:r},{arrayFormat:"bracket"});this.setState({route:"home",loading:!0}),H({path:"/feedzy/v1/feed?".concat(r),method:"POST",data:this.props.attributes}).then((function(e){return t.unmounting?e:e.error?(t.setState({route:"home",loading:!1,error:!0}),e):(t.props.setAttributes({feedData:e}),t.setState({route:"fetched",loading:!1}),e)})).fail((function(e){return t.setState({route:"home",loading:!1,error:!0}),e}))}}},{key:"loadCategories",value:function(){var e=this;H({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){this.props.setAttributes({title:Number(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:"render",value:function(){var e,t,r,a,n,o,s,i,l,p,u=this;return["fetched"===this.state.route&&wp.element.createElement(N,j({edit:this,state:this.state},this.props)),"home"===this.state.route&&wp.element.createElement("div",{className:this.props.className},wp.element.createElement(W,{key:"placeholder",icon:"rss",label:B("Feedzy RSS Feeds")},this.state.loading?wp.element.createElement("div",{key:"loading",className:"wp-block-embed is-loading"},wp.element.createElement(Z,null),wp.element.createElement("p",null,B("Fetching..."))):[wp.element.createElement("div",{className:"feedzy-source-wrap"},wp.element.createElement(X,{type:"url",className:"feedzy-source",placeholder:B("Enter URL or category of your feed here..."),onChange:this.onChangeFeed,value:this.props.attributes.feeds}),wp.element.createElement("span",{className:"dashicons dashicons-arrow-down-alt2",onClick:this.feedzyCategoriesList})),wp.element.createElement(Q,{isLarge:!0,isPrimary:!0,type:"submit",onClick:this.loadFeed},B("Load Feed")),wp.element.createElement(q,{href:this.getValidateURL(),title:B("Validate Feed ")},B("Validate ")),this.state.error&&wp.element.createElement("div",null,B("Feed URL is invalid. Invalid feeds will NOT display items.")),wp.element.createElement("p",null,B("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:B("feedzy categories "),target:"_blank"},B("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"},O(this.props.attributes.feedData.channel.title)),wp.element.createElement("span",{className:"rss_description"}," "+O(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=S(this.props.attributes.keywords_title),a=S(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=O(e.date)||"",n=O(e.time)||"",o=O(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=B("by")+" "+i,l.date=B("on")+" "+O(a),l.time=B("at")+" "+O(n),l.categories=B("in")+" "+O(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:O(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:O(e.title)}))),wp.element.createElement("div",{className:"rss_content_wrap"},wp.element.createElement("span",{className:"title"},wp.element.createElement("a",null,u.props.attributes.title&&O(e.title).length>u.props.attributes.title?O(e.title).substring(0,u.props.attributes.title)+"...":O(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&&O(e.description).length>u.props.attributes.summarylength?O(e.description).substring(0,u.props.attributes.summarylength)+" [...]":O(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}),B("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))))))}))))]}}])&&D(r.prototype,a),p}(Y);var J=wp.i18n.__;(0,wp.blocks.registerBlockType)("feedzy-rss-feeds/feedzy-block",{title:J("Feedzy RSS Feeds"),category:"common",icon:"rss",keywords:[J("Feedzy RSS Feeds"),J("RSS"),J("Feeds")],supports:{html:!1},attributes:{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"}},edit:G,save:function(){return null}})})()})();
includes/gutenberg/feedzy-rss-feeds-gutenberg-block.php CHANGED
@@ -147,9 +147,17 @@ class Feedzy_Rss_Feeds_Gutenberg_Block {
147
  'keywords_title' => array(
148
  'type' => 'string',
149
  ),
 
 
 
 
150
  'keywords_ban' => array(
151
  'type' => 'string',
152
  ),
 
 
 
 
153
  'thumb' => array(
154
  'type' => 'string',
155
  'default' => 'auto',
@@ -176,6 +184,12 @@ class Feedzy_Rss_Feeds_Gutenberg_Block {
176
  'type' => 'string',
177
  'default' => 'default',
178
  ),
 
 
 
 
 
 
179
  ),
180
  )
181
  );
147
  'keywords_title' => array(
148
  'type' => 'string',
149
  ),
150
+ 'keywords_inc_on' => array(
151
+ 'type' => 'string',
152
+ 'default' => 'title',
153
+ ),
154
  'keywords_ban' => array(
155
  'type' => 'string',
156
  ),
157
+ 'keywords_exc_on' => array(
158
+ 'type' => 'string',
159
+ 'default' => 'title',
160
+ ),
161
  'thumb' => array(
162
  'type' => 'string',
163
  'default' => 'auto',
184
  'type' => 'string',
185
  'default' => 'default',
186
  ),
187
+ 'from_datetime' => array(
188
+ 'type' => 'string',
189
+ ),
190
+ 'to_datetime' => array(
191
+ 'type' => 'string',
192
+ ),
193
  ),
194
  )
195
  );
includes/layouts/settings.php CHANGED
@@ -50,8 +50,8 @@
50
  $disble_featured_image = 'checked';
51
  }
52
 
 
53
  $default_thumbnail_id = isset( $settings['general']['default-thumbnail-id'] ) ? $settings['general']['default-thumbnail-id'] : 0;
54
-
55
  switch ( $active_tab ) {
56
  case 'general':
57
  ?>
@@ -74,6 +74,17 @@
74
  <a href="javascript:;" class="feedzy-remove-media button action <?php echo $default_thumbnail_id ? esc_attr( 'is-show' ) : ''; ?>"><?php esc_html_e( 'Remove image', 'feedzy-rss-feeds' ); ?></a>
75
  <input type="hidden" name="default-thumbnail-id" id="feed-post-default-thumbnail" value="<?php echo esc_attr( $default_thumbnail_id ); ?>">
76
  </div>
 
 
 
 
 
 
 
 
 
 
 
77
  <?php
78
  break;
79
  case 'headers':
50
  $disble_featured_image = 'checked';
51
  }
52
 
53
+ $feedzy_delete_days = isset( $settings['general']['feedzy-delete-days'] ) ? $settings['general']['feedzy-delete-days'] : 0;
54
  $default_thumbnail_id = isset( $settings['general']['default-thumbnail-id'] ) ? $settings['general']['default-thumbnail-id'] : 0;
 
55
  switch ( $active_tab ) {
56
  case 'general':
57
  ?>
74
  <a href="javascript:;" class="feedzy-remove-media button action <?php echo $default_thumbnail_id ? esc_attr( 'is-show' ) : ''; ?>"><?php esc_html_e( 'Remove image', 'feedzy-rss-feeds' ); ?></a>
75
  <input type="hidden" name="default-thumbnail-id" id="feed-post-default-thumbnail" value="<?php echo esc_attr( $default_thumbnail_id ); ?>">
76
  </div>
77
+ <?php if ( feedzy_is_pro() ) : ?>
78
+ <div class="fz-form-group">
79
+ <label><?php esc_html_e( 'Automatically delete the posts created for all imports after how many days?', 'feedzy-rss-feeds' ); ?></label>
80
+ </div>
81
+ <div class="fz-form-group">
82
+ <input type="number" min="0" max="9999" id="feedzy_delete_days" name="feedzy-delete-days" class="fz-form-control" value="<?php echo esc_attr( $feedzy_delete_days ); ?>"/>
83
+ <div>
84
+ <small><?php esc_html_e( 'Helpful if you want to remove stale or old items automatically. If you choose 0, it will be considered the individual import setting.', 'feedzy-rss-feeds' ); ?></small>
85
+ </div>
86
+ </div>
87
+ <?php endif; ?>
88
  <?php
89
  break;
90
  case 'headers':
includes/views/css/import-metabox-edit.css CHANGED
@@ -1798,6 +1798,7 @@ a:focus.dropdown-item {
1798
  #poststuff input[type="text"],
1799
  #poststuff input[type="password"],
1800
  #poststuff input[type="number"],
 
1801
  #poststuff textarea,
1802
  #poststuff textarea.form-control {
1803
  width: 100%;
@@ -2231,4 +2232,25 @@ span.feedzy-spinner {
2231
  border-top: 0;
2232
  background: #fff;
2233
  box-shadow: 0 4px 5px rgb(0 0 0 / 15%);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2234
  }
1798
  #poststuff input[type="text"],
1799
  #poststuff input[type="password"],
1800
  #poststuff input[type="number"],
1801
+ #poststuff input[type="datetime-local"],
1802
  #poststuff textarea,
1803
  #poststuff textarea.form-control {
1804
  width: 100%;
2232
  border-top: 0;
2233
  background: #fff;
2234
  box-shadow: 0 4px 5px rgb(0 0 0 / 15%);
2235
+ }
2236
+ #poststuff input[type="text"].feedzy-keyword-filter {
2237
+ width: 98%;
2238
+ }
2239
+ .form-group .feedzy_from_date {
2240
+ width: 49%;
2241
+ float: left;
2242
+ }
2243
+ .form-group .feedzy_to_date {
2244
+ width: 49%;
2245
+ float: right;
2246
+ }
2247
+ .form-group.item-date-filter {
2248
+ padding-top: 0 !important;
2249
+ }
2250
+ .form-group.item-date-filter input {
2251
+ padding: 0 10px !important;
2252
+ }
2253
+ .feedzy-chosen-nosearch + .chosen-container .chosen-search {
2254
+ clip: rect(0, 0, 0, 0);
2255
+ position: absolute;
2256
  }
includes/views/import-metabox-edit.php CHANGED
@@ -59,28 +59,69 @@
59
  <div class="feedzy-row <?php echo esc_attr( apply_filters( 'feedzy_upsell_class', '' ) ); ?>">
60
  <?php echo wp_kses_post( apply_filters( 'feedzy_upsell_content', '' ) ); ?>
61
  <div class="label_description">
62
- <label class="feedzy-sr-only"><?php esc_html_e( 'Display item only if the title or content contains specific keyword(s)', 'feedzy-rss-feeds' ); ?></label>
63
  <div>
64
- <small><?php echo wp_kses_post( sprintf( __( 'You can provide comma-separated words. Remember, these words are %1$scase sensitive%2$s .e.g. News, news, STOCK', 'feedzy-rss-feeds' ), '<b>', '</b>' ) ); ?></small>
65
  </div>
66
  </div>
67
  <div class="feedzy-separator"></div>
68
  <div class="form-group input-group form_item">
69
- <input type="text" name="feedzy_meta_data[inc_key]" placeholder="<?php esc_html_e( '(eg. news, Sports, STOCK etc.)', 'feedzy-rss-feeds' ); ?>" class="form-control" value="<?php echo esc_attr( $inc_key ); ?>"/>
 
 
 
 
 
 
 
 
 
 
70
  </div>
71
  </div>
72
 
73
  <div class="feedzy-row <?php echo esc_attr( apply_filters( 'feedzy_upsell_class', '' ) ); ?>">
74
  <?php echo wp_kses_post( apply_filters( 'feedzy_upsell_content', '' ) ); ?>
75
  <div class="label_description">
76
- <label class="feedzy-sr-only"><?php esc_html_e( 'Exclude item if the title or content contains specific keyword(s)', 'feedzy-rss-feeds' ); ?></label>
77
  <div>
78
- <small><?php echo wp_kses_post( sprintf( __( 'You can provide comma-separated words. Remember, these words are %1$scase sensitive%2$s .e.g. News, news, STOCK', 'feedzy-rss-feeds' ), '<b>', '</b>' ) ); ?></small>
79
  </div>
80
  </div>
81
  <div class="feedzy-separator"></div>
82
  <div class="form-group input-group form_item">
83
- <input type="text" name="feedzy_meta_data[exc_key]" placeholder="<?php esc_html_e( '(eg. news, Sports, STOCK etc.)', 'feedzy-rss-feeds' ); ?>" class="form-control" value="<?php echo esc_attr( $exc_key ); ?>"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  </div>
85
  </div>
86
 
@@ -102,7 +143,7 @@
102
  <div class="label_description">
103
  <label class="feedzy-sr-only"><?php esc_html_e( 'Automatically delete the posts created for this import after how many days?', 'feedzy-rss-feeds' ); ?></label>
104
  <div>
105
- <small><?php esc_html_e( 'Helpful if you want to remove stale or old items automatically. If you choose 0, the imported items will not be automatically deleted.', 'feedzy-rss-feeds' ); ?></small>
106
  </div>
107
  </div>
108
  <div class="feedzy-separator"></div>
@@ -348,7 +389,7 @@
348
  <div>
349
  <input id="use-external-image" name="feedzy_meta_data[import_use_external_image]" class="feedzy-toggle feedzy-toggle-round" type="checkbox" value="yes" <?php echo esc_attr( $import_item_img_url ); ?>>
350
  <label for="use-external-image" class="feedzy-inline"></label>
351
- <label class="feedzy-inline" style="margin-left: 10px;" for="import_use_external_image"><?php esc_html_e( 'User external image URL, Ignore feature post thumbnail', 'feedzy-rss-feeds' ); ?></label>
352
  </div>
353
  </div>
354
  </div>
59
  <div class="feedzy-row <?php echo esc_attr( apply_filters( 'feedzy_upsell_class', '' ) ); ?>">
60
  <?php echo wp_kses_post( apply_filters( 'feedzy_upsell_content', '' ) ); ?>
61
  <div class="label_description">
62
+ <label class="feedzy-sr-only"><?php esc_html_e( 'Display item only if the selected field contains specific keyword(s)', 'feedzy-rss-feeds' ); ?></label>
63
  <div>
64
+ <small><?php echo wp_kses_post( sprintf( __( 'You can provide separate multiple titles with %1$s,%2$s keyword for the optional titles and %1$s+%2$s keyword for the required titles.%1$s e.g. news, stock + market%2$s', 'feedzy-rss-feeds' ), '<code>', '</code>' ) ); ?></small>
65
  </div>
66
  </div>
67
  <div class="feedzy-separator"></div>
68
  <div class="form-group input-group form_item">
69
+ <input type="text" name="feedzy_meta_data[inc_key]" placeholder="<?php esc_html_e( '(eg. news, stock + market etc.)', 'feedzy-rss-feeds' ); ?>" class="form-control feedzy-keyword-filter" value="<?php echo esc_attr( $inc_key ); ?>"/>
70
+ <div class="input-group-btn">
71
+ <select class="form-control feedzy-chosen feedzy-chosen-nosearch" name="feedzy_meta_data[inc_on]">
72
+ <?php
73
+ foreach ( $keyword_filter_fields as $field ) :
74
+ $field_val = sanitize_key( $field );
75
+ ?>
76
+ <option value="<?php echo esc_attr( $field_val ); ?>"<?php selected( $inc_on, $field_val ); ?>><?php echo esc_html( $field ); ?></option>
77
+ <?php endforeach; ?>
78
+ </select>
79
+ </div>
80
  </div>
81
  </div>
82
 
83
  <div class="feedzy-row <?php echo esc_attr( apply_filters( 'feedzy_upsell_class', '' ) ); ?>">
84
  <?php echo wp_kses_post( apply_filters( 'feedzy_upsell_content', '' ) ); ?>
85
  <div class="label_description">
86
+ <label class="feedzy-sr-only"><?php esc_html_e( 'Exclude item if the selected field contains specific keyword(s)', 'feedzy-rss-feeds' ); ?></label>
87
  <div>
88
+ <small><?php echo wp_kses_post( sprintf( __( 'You can provide separate multiple titles with %1$s,%2$s keyword for the optional titles and %1$s+%2$s keyword for the required titles.%1$s e.g. news, stock + market%2$s', 'feedzy-rss-feeds' ), '<code>', '</code>' ) ); ?></small>
89
  </div>
90
  </div>
91
  <div class="feedzy-separator"></div>
92
  <div class="form-group input-group form_item">
93
+ <input type="text" name="feedzy_meta_data[exc_key]" placeholder="<?php esc_html_e( '(eg. news, stock + market etc.)', 'feedzy-rss-feeds' ); ?>" class="form-control feedzy-keyword-filter" value="<?php echo esc_attr( $exc_key ); ?>"/>
94
+ <div class="input-group-btn">
95
+ <select class="form-control feedzy-chosen feedzy-chosen-nosearch" name="feedzy_meta_data[exc_on]">
96
+ <?php
97
+ foreach ( $keyword_filter_fields as $field ) :
98
+ $field_val = sanitize_key( $field );
99
+ ?>
100
+ <option value="<?php echo esc_attr( $field_val ); ?>"<?php selected( $exc_on, $field_val ); ?>><?php echo esc_html( $field ); ?></option>
101
+ <?php endforeach; ?>
102
+ </select>
103
+ </div>
104
+ </div>
105
+ </div>
106
+
107
+ <div class="feedzy-row <?php echo esc_attr( apply_filters( 'feedzy_upsell_class', '' ) ); ?>">
108
+ <?php echo wp_kses_post( apply_filters( 'feedzy_upsell_content', '' ) ); ?>
109
+ <div class="label_description">
110
+ <label class="feedzy-sr-only"><?php esc_html_e( 'Filter item based on date range.', 'feedzy-rss-feeds' ); ?></label>
111
+ <div>
112
+ <small><?php echo wp_kses_post( __( 'You can select a date range to import items within the selected date.', 'feedzy-rss-feeds' ) ); ?></small>
113
+ </div>
114
+ </div>
115
+ <div class="feedzy-separator"></div>
116
+ <div class="form-group input-group item-date-filter form_item">
117
+ <div class="feedzy_from_date">
118
+ <label class="feedzy-inline" for="import_link_author_admin"><?php esc_html_e( 'From', 'feedzy-rss-feeds' ); ?></label>
119
+ <input type="datetime-local" name="feedzy_meta_data[from_datetime]" placeholder="<?php esc_html_e( 'From', 'feedzy-rss-feeds' ); ?>" class="form-control" value="<?php echo esc_attr( $from_datetime ); ?>"/>
120
+ </div>
121
+ <div class="feedzy_to_date">
122
+ <label class="feedzy-inline" for="import_link_author_admin"><?php esc_html_e( 'To', 'feedzy-rss-feeds' ); ?></label>
123
+ <input type="datetime-local" name="feedzy_meta_data[to_datetime]" placeholder="<?php esc_html_e( 'From', 'feedzy-rss-feeds' ); ?>" class="form-control" value="<?php echo esc_attr( $to_datetime ); ?>"/>
124
+ </div>
125
  </div>
126
  </div>
127
 
143
  <div class="label_description">
144
  <label class="feedzy-sr-only"><?php esc_html_e( 'Automatically delete the posts created for this import after how many days?', 'feedzy-rss-feeds' ); ?></label>
145
  <div>
146
+ <small><?php esc_html_e( 'Helpful if you want to remove stale or old items automatically. Using 0 will revert to the default global value.', 'feedzy-rss-feeds' ); ?></small>
147
  </div>
148
  </div>
149
  <div class="feedzy-separator"></div>
389
  <div>
390
  <input id="use-external-image" name="feedzy_meta_data[import_use_external_image]" class="feedzy-toggle feedzy-toggle-round" type="checkbox" value="yes" <?php echo esc_attr( $import_item_img_url ); ?>>
391
  <label for="use-external-image" class="feedzy-inline"></label>
392
+ <label class="feedzy-inline" style="margin-left: 10px;" for="import_use_external_image"><?php esc_html_e( 'Use external image URL, Ignore feature post thumbnail', 'feedzy-rss-feeds' ); ?></label>
393
  </div>
394
  </div>
395
  </div>
readme.txt CHANGED
@@ -462,6 +462,20 @@ You have to check first if your feed is valid. Please test it here: https://vali
462
 
463
  == Changelog ==
464
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
465
  ##### [Version 3.7.5](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v3.7.4...v3.7.5) (2021-09-06)
466
 
467
  #### Fixes
462
 
463
  == Changelog ==
464
 
465
+ #### [Version 3.8.0](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v3.7.5...v3.8.0) (2021-10-19)
466
+
467
+ #### Features:
468
+ - Adds compatibility with pro features for [Elementor Template Builder](https://docs.themeisle.com/article/1396-elementor-compatibility-in-feedzy) and Dynamic Tags support.
469
+ - Adds compatibility for pro [Enhanced keyword](https://docs.themeisle.com/article/1154-how-to-use-feed-to-post-feature-in-feedzy#filters) filtering support.
470
+
471
+ #### Fixes
472
+ - Fix category dropdown in Gutenberg Block
473
+ - Magic tags that are unavailable with the free version listed in one line.
474
+ - Fix typo in the import setup
475
+
476
+
477
+
478
+
479
  ##### [Version 3.7.5](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v3.7.4...v3.7.5) (2021-09-06)
480
 
481
  #### Fixes
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitc625b7b8e5257a95ea1e627c2f09f062::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit3cbdb6f4e7d2e7aa01fda9888df93861::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -42,30 +42,75 @@ namespace Composer\Autoload;
42
  */
43
  class ClassLoader
44
  {
 
45
  private $vendorDir;
46
 
47
  // PSR-4
 
 
 
 
48
  private $prefixLengthsPsr4 = array();
 
 
 
 
49
  private $prefixDirsPsr4 = array();
 
 
 
 
50
  private $fallbackDirsPsr4 = array();
51
 
52
  // PSR-0
 
 
 
 
53
  private $prefixesPsr0 = array();
 
 
 
 
54
  private $fallbackDirsPsr0 = array();
55
 
 
56
  private $useIncludePath = false;
 
 
 
 
 
57
  private $classMap = array();
 
 
58
  private $classMapAuthoritative = false;
 
 
 
 
 
59
  private $missingClasses = array();
 
 
60
  private $apcuPrefix;
61
 
 
 
 
62
  private static $registeredLoaders = array();
63
 
 
 
 
64
  public function __construct($vendorDir = null)
65
  {
66
  $this->vendorDir = $vendorDir;
67
  }
68
 
 
 
 
69
  public function getPrefixes()
70
  {
71
  if (!empty($this->prefixesPsr0)) {
@@ -75,28 +120,47 @@ class ClassLoader
75
  return array();
76
  }
77
 
 
 
 
 
78
  public function getPrefixesPsr4()
79
  {
80
  return $this->prefixDirsPsr4;
81
  }
82
 
 
 
 
 
83
  public function getFallbackDirs()
84
  {
85
  return $this->fallbackDirsPsr0;
86
  }
87
 
 
 
 
 
88
  public function getFallbackDirsPsr4()
89
  {
90
  return $this->fallbackDirsPsr4;
91
  }
92
 
 
 
 
 
93
  public function getClassMap()
94
  {
95
  return $this->classMap;
96
  }
97
 
98
  /**
99
- * @param array $classMap Class to filename map
 
 
 
100
  */
101
  public function addClassMap(array $classMap)
102
  {
@@ -111,9 +175,11 @@ class ClassLoader
111
  * Registers a set of PSR-0 directories for a given prefix, either
112
  * appending or prepending to the ones previously set for this prefix.
113
  *
114
- * @param string $prefix The prefix
115
- * @param array|string $paths The PSR-0 root directories
116
- * @param bool $prepend Whether to prepend the directories
 
 
117
  */
118
  public function add($prefix, $paths, $prepend = false)
119
  {
@@ -156,11 +222,13 @@ class ClassLoader
156
  * Registers a set of PSR-4 directories for a given namespace, either
157
  * appending or prepending to the ones previously set for this namespace.
158
  *
159
- * @param string $prefix The prefix/namespace, with trailing '\\'
160
- * @param array|string $paths The PSR-4 base directories
161
- * @param bool $prepend Whether to prepend the directories
162
  *
163
  * @throws \InvalidArgumentException
 
 
164
  */
165
  public function addPsr4($prefix, $paths, $prepend = false)
166
  {
@@ -204,8 +272,10 @@ class ClassLoader
204
  * Registers a set of PSR-0 directories for a given prefix,
205
  * replacing any others previously set for this prefix.
206
  *
207
- * @param string $prefix The prefix
208
- * @param array|string $paths The PSR-0 base directories
 
 
209
  */
210
  public function set($prefix, $paths)
211
  {
@@ -220,10 +290,12 @@ class ClassLoader
220
  * Registers a set of PSR-4 directories for a given namespace,
221
  * replacing any others previously set for this namespace.
222
  *
223
- * @param string $prefix The prefix/namespace, with trailing '\\'
224
- * @param array|string $paths The PSR-4 base directories
225
  *
226
  * @throws \InvalidArgumentException
 
 
227
  */
228
  public function setPsr4($prefix, $paths)
229
  {
@@ -243,6 +315,8 @@ class ClassLoader
243
  * Turns on searching the include path for class files.
244
  *
245
  * @param bool $useIncludePath
 
 
246
  */
247
  public function setUseIncludePath($useIncludePath)
248
  {
@@ -265,6 +339,8 @@ class ClassLoader
265
  * that have not been registered with the class map.
266
  *
267
  * @param bool $classMapAuthoritative
 
 
268
  */
269
  public function setClassMapAuthoritative($classMapAuthoritative)
270
  {
@@ -285,6 +361,8 @@ class ClassLoader
285
  * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
286
  *
287
  * @param string|null $apcuPrefix
 
 
288
  */
289
  public function setApcuPrefix($apcuPrefix)
290
  {
@@ -305,6 +383,8 @@ class ClassLoader
305
  * Registers this instance as an autoloader.
306
  *
307
  * @param bool $prepend Whether to prepend the autoloader or not
 
 
308
  */
309
  public function register($prepend = false)
310
  {
@@ -324,6 +404,8 @@ class ClassLoader
324
 
325
  /**
326
  * Unregisters this instance as an autoloader.
 
 
327
  */
328
  public function unregister()
329
  {
@@ -403,6 +485,11 @@ class ClassLoader
403
  return self::$registeredLoaders;
404
  }
405
 
 
 
 
 
 
406
  private function findFileWithExtension($class, $ext)
407
  {
408
  // PSR-4 lookup
@@ -474,6 +561,10 @@ class ClassLoader
474
  * Scope isolated include.
475
  *
476
  * Prevents access to $this/self from included files.
 
 
 
 
477
  */
478
  function includeFile($file)
479
  {
42
  */
43
  class ClassLoader
44
  {
45
+ /** @var ?string */
46
  private $vendorDir;
47
 
48
  // PSR-4
49
+ /**
50
+ * @var array[]
51
+ * @psalm-var array<string, array<string, int>>
52
+ */
53
  private $prefixLengthsPsr4 = array();
54
+ /**
55
+ * @var array[]
56
+ * @psalm-var array<string, array<int, string>>
57
+ */
58
  private $prefixDirsPsr4 = array();
59
+ /**
60
+ * @var array[]
61
+ * @psalm-var array<string, string>
62
+ */
63
  private $fallbackDirsPsr4 = array();
64
 
65
  // PSR-0
66
+ /**
67
+ * @var array[]
68
+ * @psalm-var array<string, array<string, string[]>>
69
+ */
70
  private $prefixesPsr0 = array();
71
+ /**
72
+ * @var array[]
73
+ * @psalm-var array<string, string>
74
+ */
75
  private $fallbackDirsPsr0 = array();
76
 
77
+ /** @var bool */
78
  private $useIncludePath = false;
79
+
80
+ /**
81
+ * @var string[]
82
+ * @psalm-var array<string, string>
83
+ */
84
  private $classMap = array();
85
+
86
+ /** @var bool */
87
  private $classMapAuthoritative = false;
88
+
89
+ /**
90
+ * @var bool[]
91
+ * @psalm-var array<string, bool>
92
+ */
93
  private $missingClasses = array();
94
+
95
+ /** @var ?string */
96
  private $apcuPrefix;
97
 
98
+ /**
99
+ * @var self[]
100
+ */
101
  private static $registeredLoaders = array();
102
 
103
+ /**
104
+ * @param ?string $vendorDir
105
+ */
106
  public function __construct($vendorDir = null)
107
  {
108
  $this->vendorDir = $vendorDir;
109
  }
110
 
111
+ /**
112
+ * @return string[]
113
+ */
114
  public function getPrefixes()
115
  {
116
  if (!empty($this->prefixesPsr0)) {
120
  return array();
121
  }
122
 
123
+ /**
124
+ * @return array[]
125
+ * @psalm-return array<string, array<int, string>>
126
+ */
127
  public function getPrefixesPsr4()
128
  {
129
  return $this->prefixDirsPsr4;
130
  }
131
 
132
+ /**
133
+ * @return array[]
134
+ * @psalm-return array<string, string>
135
+ */
136
  public function getFallbackDirs()
137
  {
138
  return $this->fallbackDirsPsr0;
139
  }
140
 
141
+ /**
142
+ * @return array[]
143
+ * @psalm-return array<string, string>
144
+ */
145
  public function getFallbackDirsPsr4()
146
  {
147
  return $this->fallbackDirsPsr4;
148
  }
149
 
150
+ /**
151
+ * @return string[] Array of classname => path
152
+ * @psalm-var array<string, string>
153
+ */
154
  public function getClassMap()
155
  {
156
  return $this->classMap;
157
  }
158
 
159
  /**
160
+ * @param string[] $classMap Class to filename map
161
+ * @psalm-param array<string, string> $classMap
162
+ *
163
+ * @return void
164
  */
165
  public function addClassMap(array $classMap)
166
  {
175
  * Registers a set of PSR-0 directories for a given prefix, either
176
  * appending or prepending to the ones previously set for this prefix.
177
  *
178
+ * @param string $prefix The prefix
179
+ * @param string[]|string $paths The PSR-0 root directories
180
+ * @param bool $prepend Whether to prepend the directories
181
+ *
182
+ * @return void
183
  */
184
  public function add($prefix, $paths, $prepend = false)
185
  {
222
  * Registers a set of PSR-4 directories for a given namespace, either
223
  * appending or prepending to the ones previously set for this namespace.
224
  *
225
+ * @param string $prefix The prefix/namespace, with trailing '\\'
226
+ * @param string[]|string $paths The PSR-4 base directories
227
+ * @param bool $prepend Whether to prepend the directories
228
  *
229
  * @throws \InvalidArgumentException
230
+ *
231
+ * @return void
232
  */
233
  public function addPsr4($prefix, $paths, $prepend = false)
234
  {
272
  * Registers a set of PSR-0 directories for a given prefix,
273
  * replacing any others previously set for this prefix.
274
  *
275
+ * @param string $prefix The prefix
276
+ * @param string[]|string $paths The PSR-0 base directories
277
+ *
278
+ * @return void
279
  */
280
  public function set($prefix, $paths)
281
  {
290
  * Registers a set of PSR-4 directories for a given namespace,
291
  * replacing any others previously set for this namespace.
292
  *
293
+ * @param string $prefix The prefix/namespace, with trailing '\\'
294
+ * @param string[]|string $paths The PSR-4 base directories
295
  *
296
  * @throws \InvalidArgumentException
297
+ *
298
+ * @return void
299
  */
300
  public function setPsr4($prefix, $paths)
301
  {
315
  * Turns on searching the include path for class files.
316
  *
317
  * @param bool $useIncludePath
318
+ *
319
+ * @return void
320
  */
321
  public function setUseIncludePath($useIncludePath)
322
  {
339
  * that have not been registered with the class map.
340
  *
341
  * @param bool $classMapAuthoritative
342
+ *
343
+ * @return void
344
  */
345
  public function setClassMapAuthoritative($classMapAuthoritative)
346
  {
361
  * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
362
  *
363
  * @param string|null $apcuPrefix
364
+ *
365
+ * @return void
366
  */
367
  public function setApcuPrefix($apcuPrefix)
368
  {
383
  * Registers this instance as an autoloader.
384
  *
385
  * @param bool $prepend Whether to prepend the autoloader or not
386
+ *
387
+ * @return void
388
  */
389
  public function register($prepend = false)
390
  {
404
 
405
  /**
406
  * Unregisters this instance as an autoloader.
407
+ *
408
+ * @return void
409
  */
410
  public function unregister()
411
  {
485
  return self::$registeredLoaders;
486
  }
487
 
488
+ /**
489
+ * @param string $class
490
+ * @param string $ext
491
+ * @return string|false
492
+ */
493
  private function findFileWithExtension($class, $ext)
494
  {
495
  // PSR-4 lookup
561
  * Scope isolated include.
562
  *
563
  * Prevents access to $this/self from included files.
564
+ *
565
+ * @param string $file
566
+ * @return void
567
+ * @private
568
  */
569
  function includeFile($file)
570
  {
vendor/composer/InstalledVersions.php CHANGED
@@ -20,7 +20,7 @@ use Composer\Semver\VersionParser;
20
  *
21
  * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
22
  *
23
- * To require it's presence, you can require `composer-runtime-api ^2.0`
24
  */
25
  class InstalledVersions
26
  {
@@ -228,7 +228,7 @@ class InstalledVersions
228
 
229
  /**
230
  * @return array
231
- * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
232
  */
233
  public static function getRootPackage()
234
  {
@@ -242,7 +242,7 @@ class InstalledVersions
242
  *
243
  * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
244
  * @return array[]
245
- * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
246
  */
247
  public static function getRawData()
248
  {
@@ -265,7 +265,7 @@ class InstalledVersions
265
  * Returns the raw data of all installed.php which are currently loaded for custom implementations
266
  *
267
  * @return array[]
268
- * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
269
  */
270
  public static function getAllRawData()
271
  {
@@ -288,7 +288,7 @@ class InstalledVersions
288
  * @param array[] $data A vendor/composer/installed.php data set
289
  * @return void
290
  *
291
- * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
292
  */
293
  public static function reload($data)
294
  {
@@ -298,7 +298,7 @@ class InstalledVersions
298
 
299
  /**
300
  * @return array[]
301
- * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
302
  */
303
  private static function getInstalled()
304
  {
20
  *
21
  * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
22
  *
23
+ * To require its presence, you can require `composer-runtime-api ^2.0`
24
  */
25
  class InstalledVersions
26
  {
228
 
229
  /**
230
  * @return array
231
+ * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
232
  */
233
  public static function getRootPackage()
234
  {
242
  *
243
  * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
244
  * @return array[]
245
+ * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
246
  */
247
  public static function getRawData()
248
  {
265
  * Returns the raw data of all installed.php which are currently loaded for custom implementations
266
  *
267
  * @return array[]
268
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
269
  */
270
  public static function getAllRawData()
271
  {
288
  * @param array[] $data A vendor/composer/installed.php data set
289
  * @return void
290
  *
291
+ * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
292
  */
293
  public static function reload($data)
294
  {
298
 
299
  /**
300
  * @return array[]
301
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
302
  */
303
  private static function getInstalled()
304
  {
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitc625b7b8e5257a95ea1e627c2f09f062
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInitc625b7b8e5257a95ea1e627c2f09f062
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitc625b7b8e5257a95ea1e627c2f09f062', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
- spl_autoload_unregister(array('ComposerAutoloaderInitc625b7b8e5257a95ea1e627c2f09f062', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInitc625b7b8e5257a95ea1e627c2f09f062::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInitc625b7b8e5257a95ea1e627c2f09f062
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInitc625b7b8e5257a95ea1e627c2f09f062::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequirec625b7b8e5257a95ea1e627c2f09f062($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequirec625b7b8e5257a95ea1e627c2f09f062($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit3cbdb6f4e7d2e7aa01fda9888df93861
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit3cbdb6f4e7d2e7aa01fda9888df93861', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit3cbdb6f4e7d2e7aa01fda9888df93861', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit3cbdb6f4e7d2e7aa01fda9888df93861::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInit3cbdb6f4e7d2e7aa01fda9888df93861::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequire3cbdb6f4e7d2e7aa01fda9888df93861($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequire3cbdb6f4e7d2e7aa01fda9888df93861($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitc625b7b8e5257a95ea1e627c2f09f062
8
  {
9
  public static $files = array (
10
  '3df8ee254224091c21b9aebb792d2f8b' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
@@ -17,7 +17,7 @@ class ComposerStaticInitc625b7b8e5257a95ea1e627c2f09f062
17
  public static function getInitializer(ClassLoader $loader)
18
  {
19
  return \Closure::bind(function () use ($loader) {
20
- $loader->classMap = ComposerStaticInitc625b7b8e5257a95ea1e627c2f09f062::$classMap;
21
 
22
  }, null, ClassLoader::class);
23
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit3cbdb6f4e7d2e7aa01fda9888df93861
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 = ComposerStaticInit3cbdb6f4e7d2e7aa01fda9888df93861::$classMap;
21
 
22
  }, null, ClassLoader::class);
23
  }
vendor/composer/installed.php CHANGED
@@ -1,22 +1,22 @@
1
  <?php return array(
2
  'root' => array(
3
- 'pretty_version' => 'v3.7.5',
4
- 'version' => '3.7.5.0',
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
- 'reference' => '423d3f0823ed27d67cc0123c10ec70f5dca227e7',
9
  'name' => 'codeinwp/feedzy-rss-feeds',
10
  'dev' => false,
11
  ),
12
  'versions' => array(
13
  'codeinwp/feedzy-rss-feeds' => array(
14
- 'pretty_version' => 'v3.7.5',
15
- 'version' => '3.7.5.0',
16
  'type' => 'wordpress-plugin',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
- 'reference' => '423d3f0823ed27d67cc0123c10ec70f5dca227e7',
20
  'dev_requirement' => false,
21
  ),
22
  'codeinwp/themeisle-sdk' => array(
1
  <?php return array(
2
  'root' => array(
3
+ 'pretty_version' => 'v3.8.0',
4
+ 'version' => '3.8.0.0',
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
+ 'reference' => '59cce95cac69d1a6d94e3e60cf77c7cbc4814f2b',
9
  'name' => 'codeinwp/feedzy-rss-feeds',
10
  'dev' => false,
11
  ),
12
  'versions' => array(
13
  'codeinwp/feedzy-rss-feeds' => array(
14
+ 'pretty_version' => 'v3.8.0',
15
+ 'version' => '3.8.0.0',
16
  'type' => 'wordpress-plugin',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
+ 'reference' => '59cce95cac69d1a6d94e3e60cf77c7cbc4814f2b',
20
  'dev_requirement' => false,
21
  ),
22
  'codeinwp/themeisle-sdk' => array(