FEEDZY RSS Feeds Lite - Version 3.4.2

Version Description

  • 2020-08-12
Download this release

Release Info

Developer codeinwp
Plugin Icon 128x128 FEEDZY RSS Feeds Lite
Version 3.4.2
Comparing to
See all releases

Code changes from version 3.4.1 to 3.4.2

CHANGELOG.md CHANGED
@@ -1,7 +1,12 @@
1
 
2
- ### v3.4.1 - 2020-07-23
3
  **Changes:**
4
 
 
 
 
 
 
5
  ### v3.4.1 - 2020-07-23
6
  **Changes:**
7
  * [Feat] Feed2Post - Provide more info on imported content and possible errors
1
 
2
+ ### v3.4.2 - 2020-08-12
3
  **Changes:**
4
 
5
+ ### v3.4.2 - 2020-08-12
6
+ **Changes:**
7
+ * [Fix] Compatibility with WP 5.5
8
+ * [Feat] Link to items imported across runs in Feed2Post
9
+
10
  ### v3.4.1 - 2020-07-23
11
  **Changes:**
12
  * [Feat] Feed2Post - Provide more info on imported content and possible errors
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.4.1
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.4.2
6
  * Plugin Name: FEEDZY RSS Feeds
7
  * Plugin URI: http://themeisle.com/plugins/feedzy-rss-feeds/
8
  * Author: Themeisle
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.4.1
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.4.2
19
  * Author: Themeisle
20
  * Author URI: http://themeisle.com
21
  * License: GPL-2.0+
includes/abstract/feedzy-rss-feeds-admin-abstract.php CHANGED
@@ -398,6 +398,7 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
398
  'feedzy/v' . FEEDZY_REST_VERSION, '/lazy/', array(
399
  'methods' => 'POST',
400
  'callback' => array( $this, 'feedzy_lazy_load' ),
 
401
  'args' => array(
402
  'nonce' => array(
403
  'validate_callback' => function( $value ) {
398
  'feedzy/v' . FEEDZY_REST_VERSION, '/lazy/', array(
399
  'methods' => 'POST',
400
  'callback' => array( $this, 'feedzy_lazy_load' ),
401
+ 'permission_callback' => '__return_true',
402
  'args' => array(
403
  'nonce' => array(
404
  'validate_callback' => function( $value ) {
includes/admin/feedzy-rss-feeds-import.php CHANGED
@@ -357,6 +357,10 @@ class Feedzy_Rss_Feeds_Import {
357
  $custom_fields[ $key_value ] = $value;
358
  }
359
  if ( $post->post_type !== 'revision' ) {
 
 
 
 
360
  foreach ( $data_meta as $key => $value ) {
361
  $value = is_array( $value ) ? implode( ',', $value ) : implode( ',', (array) $value );
362
  if ( get_post_meta( $post_id, $key, false ) ) {
@@ -527,7 +531,12 @@ class Feedzy_Rss_Feeds_Import {
527
  $items = get_post_meta( $post_id, 'imported_items', true );
528
  }
529
  $count = $items ? count( $items ) : 0;
530
- $msg .= '<hr>' . sprintf( '%s: <b>%d</b>', __( 'Items imported across runs', 'feedzy-rss-feeds' ), $count );
 
 
 
 
 
531
  }
532
  echo $msg;
533
  break;
@@ -1610,4 +1619,27 @@ class Feedzy_Rss_Feeds_Import {
1610
  delete_post_meta( $id, 'last_run' );
1611
  wp_die();
1612
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1613
  }
357
  $custom_fields[ $key_value ] = $value;
358
  }
359
  if ( $post->post_type !== 'revision' ) {
360
+ // delete these checkbox related fields; if checked, they will be added below.
361
+ delete_post_meta( $post_id, 'import_link_author_admin' );
362
+ delete_post_meta( $post_id, 'import_link_author_public' );
363
+
364
  foreach ( $data_meta as $key => $value ) {
365
  $value = is_array( $value ) ? implode( ',', $value ) : implode( ',', (array) $value );
366
  if ( get_post_meta( $post_id, $key, false ) ) {
531
  $items = get_post_meta( $post_id, 'imported_items', true );
532
  }
533
  $count = $items ? count( $items ) : 0;
534
+ $url = add_query_arg( array( 'feedzy_job_id' => $post_id, 'post_type' => get_post_meta( $post_id, 'import_post_type', true ) ), admin_url( 'edit.php' ) );
535
+ if ( ! defined( 'TI_CYPRESS_TESTING' ) && $count > 0 ) {
536
+ $msg .= '<hr>' . sprintf( '%s: <b><a href="%s" target="_blank" title="%s">%d</a></b>', __( 'Items imported across runs', 'feedzy-rss-feeds' ), $url, __( 'Click to view', 'feedzy-rss-feeds' ), $count );
537
+ } else {
538
+ $msg .= '<hr>' . sprintf( '%s: <b>%d</b>', __( 'Items imported across runs', 'feedzy-rss-feeds' ), $count );
539
+ }
540
  }
541
  echo $msg;
542
  break;
1619
  delete_post_meta( $id, 'last_run' );
1620
  wp_die();
1621
  }
1622
+
1623
+ /**
1624
+ * Load only those posts that are linked to a particular import job.
1625
+ *
1626
+ * @since ?
1627
+ * @access public
1628
+ */
1629
+ public function pre_get_posts( $query ) {
1630
+ if ( is_admin() && $query->is_main_query() && ! empty( $_GET['feedzy_job_id'] ) ) {
1631
+ $query->set(
1632
+ 'meta_query', array(
1633
+ array(
1634
+ 'key' => 'feedzy',
1635
+ 'value' => 1,
1636
+ ),
1637
+ array(
1638
+ 'key' => 'feedzy_job',
1639
+ 'value' => $_GET['feedzy_job_id'],
1640
+ ),
1641
+ )
1642
+ );
1643
+ }
1644
+ }
1645
  }
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.4.1';
108
  self::$instance->load_dependencies();
109
  self::$instance->set_locale();
110
  self::$instance->define_admin_hooks();
@@ -232,6 +232,7 @@ class Feedzy_Rss_Feeds {
232
  self::$instance->loader->add_action( 'wp_ajax_feedzy', $plugin_import, 'ajax' );
233
  self::$instance->loader->add_action( 'manage_feedzy_imports_posts_custom_column', $plugin_import, 'manage_feedzy_import_columns', 10, 2 );
234
  self::$instance->loader->add_action( 'wp', $plugin_import, 'wp' );
 
235
 
236
  self::$instance->loader->add_filter( 'feedzy_items_limit', $plugin_import, 'items_limit', 10, 2 );
237
  self::$instance->loader->add_filter( 'feedzy_settings_tabs', $plugin_import, 'settings_tabs', 10, 1 );
104
  */
105
  public function init() {
106
  self::$plugin_name = 'feedzy-rss-feeds';
107
+ self::$version = '3.4.2';
108
  self::$instance->load_dependencies();
109
  self::$instance->set_locale();
110
  self::$instance->define_admin_hooks();
232
  self::$instance->loader->add_action( 'wp_ajax_feedzy', $plugin_import, 'ajax' );
233
  self::$instance->loader->add_action( 'manage_feedzy_imports_posts_custom_column', $plugin_import, 'manage_feedzy_import_columns', 10, 2 );
234
  self::$instance->loader->add_action( 'wp', $plugin_import, 'wp' );
235
+ self::$instance->loader->add_filter( 'pre_get_posts', $plugin_import, 'pre_get_posts', 10, 1 );
236
 
237
  self::$instance->loader->add_filter( 'feedzy_items_limit', $plugin_import, 'items_limit', 10, 2 );
238
  self::$instance->loader->add_filter( 'feedzy_settings_tabs', $plugin_import, 'settings_tabs', 10, 1 );
includes/gutenberg/feedzy-rss-feeds-gutenberg-block.php CHANGED
@@ -209,6 +209,9 @@ class Feedzy_Rss_Feeds_Gutenberg_Block {
209
  'feedzy/v1', '/feed/', array(
210
  'methods' => 'POST',
211
  'callback' => array( $this, 'feedzy_rest_route' ),
 
 
 
212
  'args' => array(
213
  'url' => array(
214
  'sanitize_callback' => array( $this, 'feedzy_sanitize_feeds' ),
209
  'feedzy/v1', '/feed/', array(
210
  'methods' => 'POST',
211
  'callback' => array( $this, 'feedzy_rest_route' ),
212
+ 'permission_callback' => function () {
213
+ return is_user_logged_in();
214
+ },
215
  'args' => array(
216
  'url' => array(
217
  'sanitize_callback' => array( $this, 'feedzy_sanitize_feeds' ),
readme.md CHANGED
@@ -3,7 +3,7 @@
3
  **Tags:** rss aggregator, news aggregator, autoblogging, feed to post, rss import
4
  **Requires at least:** 3.7
5
  **Requires PHP:** 5.3
6
- **Tested up to:** 5.4
7
  **Stable tag:** trunk
8
  **License:** GPLv2 or later
9
  **License URI:** http://www.gnu.org/licenses/gpl-2.0.html
@@ -461,6 +461,13 @@ You have to check first if your feed is valid. Please test it here: https://vali
461
 
462
 
463
  == Changelog ==
 
 
 
 
 
 
 
464
  ### 3.4.1 - 2020-07-23 ###
465
 
466
  * - [Feat] Feed2Post - Provide more info on imported content and possible errors
@@ -470,7 +477,6 @@ You have to check first if your feed is valid. Please test it here: https://vali
470
  * - [Fix] Sync item image options between classic and block editor
471
  * - [Fix] Posts keeps "uncategorized" category in non-English sites
472
 
473
-
474
  ### 3.4.0 - 2020-05-28 ###
475
 
476
  * - [Feat] Options to import feeds to posts
3
  **Tags:** rss aggregator, news aggregator, autoblogging, feed to post, rss import
4
  **Requires at least:** 3.7
5
  **Requires PHP:** 5.3
6
+ **Tested up to:** 5.5
7
  **Stable tag:** trunk
8
  **License:** GPLv2 or later
9
  **License URI:** http://www.gnu.org/licenses/gpl-2.0.html
461
 
462
 
463
  == Changelog ==
464
+ ### 3.4.2 - 2020-08-12 ###
465
+
466
+ * - [Fix] Compatibility with WP 5.5
467
+ * - [Feat] Link to items imported across runs in Feed2Post
468
+
469
+
470
+
471
  ### 3.4.1 - 2020-07-23 ###
472
 
473
  * - [Feat] Feed2Post - Provide more info on imported content and possible errors
477
  * - [Fix] Sync item image options between classic and block editor
478
  * - [Fix] Posts keeps "uncategorized" category in non-English sites
479
 
 
480
  ### 3.4.0 - 2020-05-28 ###
481
 
482
  * - [Feat] Options to import feeds to posts
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: themeisle,codeinwp,hardeepasrani,rozroz
3
  Tags: rss aggregator, news aggregator, autoblogging, feed to post, rss import
4
  Requires at least: 3.7
5
  Requires PHP: 5.3
6
- Tested up to: 5.4
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -461,6 +461,13 @@ You have to check first if your feed is valid. Please test it here: https://vali
461
 
462
 
463
  == Changelog ==
 
 
 
 
 
 
 
464
  = 3.4.1 - 2020-07-23 =
465
 
466
  * - [Feat] Feed2Post - Provide more info on imported content and possible errors
@@ -470,7 +477,6 @@ You have to check first if your feed is valid. Please test it here: https://vali
470
  * - [Fix] Sync item image options between classic and block editor
471
  * - [Fix] Posts keeps "uncategorized" category in non-English sites
472
 
473
-
474
  = 3.4.0 - 2020-05-28 =
475
 
476
  * - [Feat] Options to import feeds to posts
3
  Tags: rss aggregator, news aggregator, autoblogging, feed to post, rss import
4
  Requires at least: 3.7
5
  Requires PHP: 5.3
6
+ Tested up to: 5.5
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
461
 
462
 
463
  == Changelog ==
464
+ = 3.4.2 - 2020-08-12 =
465
+
466
+ * - [Fix] Compatibility with WP 5.5
467
+ * - [Feat] Link to items imported across runs in Feed2Post
468
+
469
+
470
+
471
  = 3.4.1 - 2020-07-23 =
472
 
473
  * - [Feat] Feed2Post - Provide more info on imported content and possible errors
477
  * - [Fix] Sync item image options between classic and block editor
478
  * - [Fix] Posts keeps "uncategorized" category in non-English sites
479
 
 
480
  = 3.4.0 - 2020-05-28 =
481
 
482
  * - [Feat] Options to import feeds to posts
themeisle-hash.json CHANGED
@@ -1 +1 @@
1
- {"feedzy-rss-feed.php":"c92bb5e72d568fcad2a9b11c46fbdf05","index.php":"71c0755260138a4b7b2182c3c61179f6","uninstall.php":"cdb21f8648e005cbb9c73481d1750186"}
1
+ {"feedzy-rss-feed.php":"0bba4c8f86dc07f8c980eb77a09a7844","index.php":"71c0755260138a4b7b2182c3c61179f6","uninstall.php":"cdb21f8648e005cbb9c73481d1750186"}
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit6888702130a7801806a9ff9cfd1d19ff::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit3b96848ea3f80711478c2a5c404164c8::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInitbfb86e227ed8f4b1f4333db0bd6083c3::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInitba70d63a60f3044bb6bb7d4c5c7e9599::getLoader();
vendor/codeinwp/themeisle-sdk/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  ##### [Version 3.2.14](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.13...v3.2.14) (2020-06-10)
2
 
3
  > Things are getting better every day. 🚀
1
+ ##### [Version 3.2.15](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.14...v3.2.15) (2020-07-23)
2
+
3
+ * remove no redundant module
4
+
5
  ##### [Version 3.2.14](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.13...v3.2.14) (2020-06-10)
6
 
7
  > Things are getting better every day. 🚀
vendor/codeinwp/themeisle-sdk/load.php CHANGED
@@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
14
  return;
15
  }
16
  // Current SDK version and path.
17
- $themeisle_sdk_version = '3.2.14';
18
  $themeisle_sdk_path = dirname( __FILE__ );
19
 
20
  global $themeisle_sdk_max_version;
14
  return;
15
  }
16
  // Current SDK version and path.
17
+ $themeisle_sdk_version = '3.2.15';
18
  $themeisle_sdk_path = dirname( __FILE__ );
19
 
20
  global $themeisle_sdk_max_version;
vendor/codeinwp/themeisle-sdk/src/Loader.php CHANGED
@@ -50,7 +50,6 @@ final class Loader {
50
  'rollback',
51
  'uninstall_feedback',
52
  'licenser',
53
- 'endpoint',
54
  'logger',
55
  'translate',
56
  'review',
50
  'rollback',
51
  'uninstall_feedback',
52
  'licenser',
 
53
  'logger',
54
  'translate',
55
  'review',
vendor/codeinwp/themeisle-sdk/src/Modules/Endpoint.php DELETED
@@ -1,358 +0,0 @@
1
- <?php
2
- /**
3
- * The class that exposes endpoints.
4
- *
5
- * @package ThemeIsleSDK
6
- * @subpackage Rollback
7
- * @copyright Copyright (c) 2017, Marius Cristea
8
- * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
- * @since 1.0.0
10
- */
11
-
12
- namespace ThemeisleSDK\Modules;
13
-
14
- // Exit if accessed directly.
15
- use ThemeisleSDK\Common\Abstract_Module;
16
- use ThemeisleSDK\Loader;
17
- use ThemeisleSDK\Product;
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- }
22
-
23
- /**
24
- * Expose endpoints for ThemeIsle SDK.
25
- */
26
- class Endpoint extends Abstract_Module {
27
- /**
28
- * Endpoint slug.
29
- */
30
- const SDK_ENDPOINT = 'themeisle-sdk';
31
- /**
32
- * Endpoint version.
33
- */
34
- const SDK_ENDPOINT_VERSION = 1;
35
- /**
36
- * Hash file which contains the checksum.
37
- */
38
- const HASH_FILE = 'themeisle-hash.json';
39
-
40
- /*
41
- * If true, the endpoint will expect a product slug and will return the value only for that.
42
- */
43
- const PRODUCT_SPECIFIC = false;
44
-
45
- /**
46
- * Registers the endpoints.
47
- */
48
- function rest_register() {
49
- register_rest_route(
50
- self::SDK_ENDPOINT . '/v' . self::SDK_ENDPOINT_VERSION,
51
- '/checksum/' . ( self::PRODUCT_SPECIFIC ? '(?P<slug>.*)/' : '' ),
52
- array(
53
- 'methods' => 'GET',
54
- 'callback' => array( $this, 'checksum' ),
55
- )
56
- );
57
- }
58
-
59
- /**
60
- * The checksum endpoint.
61
- *
62
- * @param \WP_REST_Request $data the request.
63
- *
64
- * @return \WP_REST_Response Response or the error
65
- */
66
- function checksum( \WP_REST_Request $data ) {
67
- $products = Loader::get_products();
68
- if ( self::PRODUCT_SPECIFIC ) {
69
- $params = $this->validate_params( $data, array( 'slug' ) );
70
- foreach ( $products as $product ) {
71
- if ( $params['slug'] === $product->get_slug() ) {
72
- $products = array( $product );
73
- break;
74
- }
75
- }
76
- }
77
- $response = array();
78
- $custom_css = $this->has_custom_css();
79
- if ( is_bool( $custom_css ) ) {
80
- $response['custom_css'] = $custom_css;
81
- }
82
-
83
- $response['child_theme'] = $this->get_theme_properties();
84
-
85
- foreach ( $products as $product ) {
86
- $files = array();
87
- switch ( $product->get_type() ) {
88
- case 'plugin':
89
- $files = array();
90
- break;
91
- case 'theme':
92
- $files = array( 'style.css', 'functions.php' );
93
- break;
94
- }
95
-
96
- $error = '';
97
-
98
- // if any element in the $files array contains a '/', this would imply recursion is required.
99
- $diff = $this->generate_diff(
100
- $product,
101
- $files,
102
- array_reduce(
103
- $files,
104
- array(
105
- $this,
106
- 'is_recursion_required',
107
- ),
108
- false
109
- )
110
- );
111
- if ( is_wp_error( $diff ) ) {
112
- /**
113
- * Error returner by the diff checker method.
114
- *
115
- * @var \WP_Error $diff Error returned.
116
- */
117
- $error = $diff->get_error_message();
118
- $diff = array();
119
- }
120
-
121
- $response['products'][] = array(
122
- 'slug' => $product->get_slug(),
123
- 'version' => $product->get_version(),
124
- 'diffs' => $diff,
125
- 'error' => $error,
126
- );
127
- }
128
-
129
- return new \WP_REST_Response( array( 'checksum' => $response ) );
130
- }
131
-
132
- /**
133
- * Validates the parameters to the API
134
- *
135
- * @param \WP_REST_Request $data the request.
136
- * @param array $params the parameters to validate.
137
- *
138
- * @return array of parameter name=>value
139
- */
140
- private function validate_params( \WP_REST_Request $data, $params ) {
141
- $collect = array();
142
- foreach ( $params as $param ) {
143
- $value = sanitize_text_field( $data[ $param ] );
144
- if ( empty( $value ) ) {
145
- return rest_ensure_response(
146
- new \WP_Error(
147
- 'themeisle_' . $param . '_invalid',
148
- sprintf( 'Invalid %', $param ),
149
- array(
150
- 'status' => 403,
151
- )
152
- )
153
- );
154
- } else {
155
- $collect[ $param ] = $value;
156
- }
157
- }
158
-
159
- return $collect;
160
- }
161
-
162
- /**
163
- * Check if custom css has been added to the theme.
164
- *
165
- * @return bool Whether custom css has been added to the theme.
166
- */
167
- private function has_custom_css() {
168
- $query = new \WP_Query(
169
- array(
170
- 'post_type' => 'custom_css',
171
- 'post_status' => 'publish',
172
- 'numberposts' => 1,
173
- 'update_post_meta_cache' => false,
174
- 'update_post_term_cache' => false,
175
- )
176
- );
177
-
178
- if ( $query->have_posts() ) {
179
- $query->the_post();
180
- $content = get_the_content();
181
-
182
- // if the content contains a colon, a CSS rule has been added.
183
- return strpos( $content, ':' ) === false ? false : true;
184
- }
185
-
186
- return false;
187
- }
188
-
189
- /**
190
- * Get the current theme properties.
191
- *
192
- * @return mixed Properties of the current theme.
193
- */
194
- function get_theme_properties() {
195
- if ( ! is_child_theme() ) {
196
- return false;
197
- }
198
-
199
- $properties = array();
200
- $theme = wp_get_theme();
201
- // @codingStandardsIgnoreStart
202
- $properties['name'] = $theme->Name;
203
- // @codingStandardsIgnoreEnd
204
-
205
- // get the files in the child theme.
206
- require_once( ABSPATH . 'wp-admin/includes/file.php' );
207
- WP_Filesystem();
208
- global $wp_filesystem;
209
- $path = str_replace( ABSPATH, $wp_filesystem->abspath(), get_stylesheet_directory() );
210
- $list = $wp_filesystem->dirlist( $path, false, false );
211
- if ( $list ) {
212
- $list = array_keys( self::flatten_dirlist( $list ) );
213
- $properties['files'] = $list;
214
- }
215
-
216
- return $properties;
217
- }
218
-
219
- /**
220
- * Flatten the results of WP_Filesystem::dirlist() for iterating over.
221
- *
222
- * @access private
223
- *
224
- * @param array $nested_files Array of files as returned by WP_Filesystem::dirlist().
225
- * @param string $path Relative path to prepend to child nodes. Optional.
226
- *
227
- * @return array $files A flattened array of the $nested_files specified.
228
- */
229
- private static function flatten_dirlist( $nested_files, $path = '' ) {
230
- $files = array();
231
- foreach ( $nested_files as $name => $details ) {
232
- $files[ $path . $name ] = $details;
233
- // Append children recursively.
234
- if ( ! empty( $details['files'] ) ) {
235
- $children = self::flatten_dirlist( $details['files'], $path . $name . '/' );
236
- // Merge keeping possible numeric keys, which array_merge() will reindex from 0..n.
237
- $files = $files + $children;
238
- }
239
- }
240
-
241
- return $files;
242
- }
243
-
244
- /**
245
- * Generate the diff of the files.
246
- *
247
- * @param Product $product Themeisle Product.
248
- * @param array $files Array of files.
249
- * @param bool $recurse Whether to recurse or not.
250
- *
251
- * @return mixed Diff data.
252
- */
253
- private function generate_diff( $product, $files, $recurse = false ) {
254
- require_once( ABSPATH . 'wp-admin/includes/file.php' );
255
- WP_Filesystem();
256
- global $wp_filesystem;
257
-
258
- $diff = array();
259
- $path = str_replace( ABSPATH, $wp_filesystem->abspath(), plugin_dir_path( $product->get_basefile() ) );
260
- $list = $wp_filesystem->dirlist( $path, false, $recurse );
261
- // nothing found.
262
- if ( ! $list ) {
263
- return $diff;
264
- }
265
- $list = array_keys( self::flatten_dirlist( $list ) );
266
-
267
- // now let's get the valid files that actually exist.
268
- if ( empty( $files ) ) {
269
- $files = $list;
270
- } else {
271
- $files = array_intersect( $files, $list );
272
- }
273
-
274
- // fetch the calculated hashes.
275
- if ( ! $wp_filesystem->is_readable( $path . '/' . self::HASH_FILE ) ) {
276
- return new \WP_Error( 'themeisle_sdk_hash_not_found', sprintf( '%s not found', self::HASH_FILE ) );
277
- }
278
-
279
- $hashes = json_decode( $wp_filesystem->get_contents( $path . '/' . self::HASH_FILE ), true );
280
- ksort( $hashes );
281
-
282
- $diff = array();
283
- foreach ( $files as $file ) {
284
- // file does not exist in the hashes.
285
- if ( ! array_key_exists( $file, $hashes ) ) {
286
- continue;
287
- }
288
- $new = md5( $wp_filesystem->get_contents( $path . $file ) );
289
- $old = $hashes[ $file ];
290
-
291
- // same hash, bail.
292
- if ( $new === $old ) {
293
- continue;
294
- }
295
- $diff[] = $file;
296
- }
297
-
298
- return $diff;
299
- }
300
-
301
- /**
302
- * Check if recursion needs to be enabled on the WP_Filesystem by reducing the array of files to a boolean.
303
- *
304
- * @param string $carry Value of the previous iteration.
305
- * @param string $item Value of the current iteration.
306
- *
307
- * @return bool Whether to recurse or not.
308
- */
309
- function is_recursion_required( $carry, $item ) {
310
- if ( ! $carry ) {
311
- return ( strpos( $item, '/' ) !== false );
312
- }
313
-
314
- return $carry;
315
- }
316
-
317
- /**
318
- * Load module for this product.
319
- *
320
- * @param Product $product Product to check.
321
- *
322
- * @return bool Should we load this?
323
- */
324
- public function can_load( $product ) {
325
- return true;
326
- }
327
-
328
- /**
329
- * Load module logic.
330
- *
331
- * @param Product $product Product to load.
332
- */
333
- public function load( $product ) {
334
- $this->setup_endpoints();
335
-
336
- return $this;
337
- }
338
-
339
- /**
340
- * Setup endpoints.
341
- */
342
- private function setup_endpoints() {
343
- global $wp_version;
344
- if ( version_compare( $wp_version, '4.4', '<' ) ) {
345
- // no REST support.
346
- return;
347
- }
348
-
349
- $this->setup_rest();
350
- }
351
-
352
- /**
353
- * Setup REST endpoints.
354
- */
355
- private function setup_rest() {
356
- add_action( 'rest_api_init', array( $this, 'rest_register' ) );
357
- }
358
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit6888702130a7801806a9ff9cfd1d19ff
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit6888702130a7801806a9ff9cfd1d19ff
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit6888702130a7801806a9ff9cfd1d19ff', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit6888702130a7801806a9ff9cfd1d19ff', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInit6888702130a7801806a9ff9cfd1d19ff
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequire6888702130a7801806a9ff9cfd1d19ff($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequire6888702130a7801806a9ff9cfd1d19ff($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit3b96848ea3f80711478c2a5c404164c8
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit3b96848ea3f80711478c2a5c404164c8', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit3b96848ea3f80711478c2a5c404164c8', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequire3b96848ea3f80711478c2a5c404164c8($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequire3b96848ea3f80711478c2a5c404164c8($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInitbfb86e227ed8f4b1f4333db0bd6083c3 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitbfb86e227ed8f4b1f4333db0bd6083c3 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitbfb86e227ed8f4b1f4333db0bd6083c3', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitbfb86e227ed8f4b1f4333db0bd6083c3', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInitba70d63a60f3044bb6bb7d4c5c7e9599 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitba70d63a60f3044bb6bb7d4c5c7e9599', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitba70d63a60f3044bb6bb7d4c5c7e9599', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
vendor/composer/installed.json CHANGED
@@ -6,12 +6,12 @@
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
9
- "reference": "992f5e8347836e325ffc50760da1d550b79831c4"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/992f5e8347836e325ffc50760da1d550b79831c4",
14
- "reference": "992f5e8347836e325ffc50760da1d550b79831c4",
15
  "shasum": ""
16
  },
17
  "require-dev": {
@@ -19,7 +19,7 @@
19
  "squizlabs/php_codesniffer": "^3.1",
20
  "wp-coding-standards/wpcs": "^1.0.0"
21
  },
22
- "time": "2020-06-10 16:25:09",
23
  "type": "library",
24
  "installation-source": "source",
25
  "notification-url": "https://packagist.org/downloads/",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
9
+ "reference": "95b7447a5f4faba410c281c4bf278fbd740fed71"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/95b7447a5f4faba410c281c4bf278fbd740fed71",
14
+ "reference": "95b7447a5f4faba410c281c4bf278fbd740fed71",
15
  "shasum": ""
16
  },
17
  "require-dev": {
19
  "squizlabs/php_codesniffer": "^3.1",
20
  "wp-coding-standards/wpcs": "^1.0.0"
21
  },
22
+ "time": "2020-07-23 15:02:10",
23
  "type": "library",
24
  "installation-source": "source",
25
  "notification-url": "https://packagist.org/downloads/",