FEEDZY RSS Feeds Lite - Version 3.5.2

Version Description

  • 2020-12-24
Download this release

Release Info

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

Code changes from version 3.5.1 to 3.5.2

CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
 
 
 
 
 
 
2
  ### v3.5.1 - 2020-10-30
3
  **Changes:**
4
  * [Fix] Importing random images with https://source.unsplash.com/random generator link in Feed to Post
1
 
2
+ ### v3.5.2 - 2020-12-24
3
+ **Changes:**
4
+ * [Fix] Compatibility with WP 5.6
5
+ * [Fix] Composer requiring PHP greater than 7.1.0
6
+
7
  ### v3.5.1 - 2020-10-30
8
  **Changes:**
9
  * [Fix] Importing random images with https://source.unsplash.com/random generator link in Feed to Post
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.5.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.5.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.5.1
19
  * Author: Themeisle
20
  * Author URI: http://themeisle.com
21
  * License: GPL-2.0+
@@ -128,7 +128,7 @@ function run_feedzy_rss_feeds() {
128
 
129
  $feedzy = Feedzy_Rss_Feeds::instance();
130
  $feedzy->run();
131
- $vendor_file = FEEDZY_ABSPATH . '/vendor/autoload_52.php';
132
  if ( is_readable( $vendor_file ) ) {
133
  require_once $vendor_file;
134
  }
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.5.2
19
  * Author: Themeisle
20
  * Author URI: http://themeisle.com
21
  * License: GPL-2.0+
128
 
129
  $feedzy = Feedzy_Rss_Feeds::instance();
130
  $feedzy->run();
131
+ $vendor_file = FEEDZY_ABSPATH . '/vendor/autoload.php';
132
  if ( is_readable( $vendor_file ) ) {
133
  require_once $vendor_file;
134
  }
includes/abstract/feedzy-rss-feeds-admin-abstract.php CHANGED
@@ -260,20 +260,42 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
260
  if ( feedzy_is_new() && ! feedzy_is_pro() ) {
261
  return true;
262
  }
263
- $keywords_title = $sc['keywords_title'];
264
- if ( ! empty( $keywords_title ) ) {
265
- $continue = false;
266
- foreach ( $keywords_title as $keyword ) {
267
- if ( strpos( $item->get_title(), $keyword ) !== false ) {
268
- $continue = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  }
270
  }
271
  }
272
 
273
- if ( array_key_exists( 'keywords_ban', $sc ) ) {
274
- $keywords_ban = $sc['keywords_ban'];
275
- if ( ! empty( $keywords_ban ) ) {
276
- foreach ( $keywords_ban as $keyword ) {
 
 
 
 
 
 
 
 
 
277
  if ( strpos( $item->get_title(), $keyword ) !== false ) {
278
  return false;
279
  }
@@ -500,6 +522,8 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
500
  'size' => '',
501
  // only display item if title contains specific keywords (comma-separated list/case sensitive)
502
  'keywords_title' => '',
 
 
503
  // cache refresh
504
  'refresh' => '12_hours',
505
  // sorting.
@@ -663,8 +687,6 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
663
  )
664
  );
665
  }
666
-
667
- require_once( ABSPATH . WPINC . '/class-wp-feed-cache.php' );
668
  require_once( ABSPATH . WPINC . '/class-wp-feed-cache-transient.php' );
669
  require_once( ABSPATH . WPINC . '/class-wp-simplepie-file.php' );
670
 
@@ -672,7 +694,8 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
672
  $default_agent = $this->get_default_user_agent( $feed_url );
673
  $feed->set_useragent( apply_filters( 'http_headers_useragent', $default_agent ) );
674
  if ( false === apply_filters( 'feedzy_disable_db_cache', false, $feed_url ) ) {
675
- $feed->set_cache_class( 'WP_Feed_Cache' );
 
676
  add_filter(
677
  'wp_feed_cache_transient_lifetime', function( $time ) use ( $cache_time ) {
678
  return $cache_time;
@@ -860,10 +883,18 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
860
  $sc['keywords_title'] = rtrim( $sc['keywords_title'], ',' );
861
  $sc['keywords_title'] = array_map( 'trim', explode( ',', $sc['keywords_title'] ) );
862
  }
 
 
 
 
863
  if ( ! empty( $sc['keywords_ban'] ) ) {
864
  $sc['keywords_ban'] = rtrim( $sc['keywords_ban'], ',' );
865
  $sc['keywords_ban'] = array_map( 'trim', explode( ',', $sc['keywords_ban'] ) );
866
  }
 
 
 
 
867
  if ( empty( $sc['summarylength'] ) || ! is_numeric( $sc['summarylength'] ) ) {
868
  $sc['summarylength'] = '';
869
  }
@@ -1079,18 +1110,20 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
1079
  public function get_feed_array( $feed_items, $sc, $feed, $feed_url, $sizes ) {
1080
  $count = 0;
1081
  $items = apply_filters( 'feedzy_feed_items', $feed->get_items( $sc['offset'] ), $feed_url );
 
1082
  foreach ( (array) $items as $item ) {
1083
- $continue = apply_filters( 'feedzy_item_keyword', true, $sc, $item, $feed_url );
1084
  if ( $continue === true ) {
1085
  // Count items. This should be > and not >= because max, when not defined and empty, becomes 0.
1086
  if ( $count >= $sc['max'] ) {
1087
  break;
1088
  }
1089
- $item_attr = apply_filters( 'feedzy_item_attributes', $item_attr = '', $sizes, $item, $feed_url, $sc );
1090
- $feed_items[ $count ] = $this->get_feed_item_filter( $sc, $sizes, $item, $feed_url, $count );
1091
  $feed_items[ $count ]['itemAttr'] = $item_attr;
1092
- $count ++;
1093
  }
 
1094
  }
1095
 
1096
  return $feed_items;
@@ -1106,11 +1139,12 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
1106
  * @param array $sizes The sizes array.
1107
  * @param object $item The feed item object.
1108
  * @param string $feed_url The feed url.
1109
- * @param int $index The item number.
 
1110
  *
1111
  * @return array
1112
  */
1113
- private function get_feed_item_filter( $sc, $sizes, $item, $feed_url, $index ) {
1114
  $item_link = $item->get_permalink();
1115
  // if the item has no link (possible in some cases), use the feed link
1116
  if ( empty( $item_link ) ) {
@@ -1295,7 +1329,7 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
1295
  'item_content' => apply_filters( 'feedzy_content', $item->get_content( false ), $item ),
1296
  'item_source' => $feed_source,
1297
  );
1298
- $item_array = apply_filters( 'feedzy_item_filter', $item_array, $item, $sc, $index );
1299
 
1300
  return $item_array;
1301
  }
260
  if ( feedzy_is_new() && ! feedzy_is_pro() ) {
261
  return true;
262
  }
263
+
264
+ if ( isset( $sc['keywords_inc'] ) && ! empty( $sc['keywords_inc'] ) ) {
265
+ $keywords = $sc['keywords_inc'];
266
+ if ( ! empty( $keywords ) ) {
267
+ $continue = false;
268
+ foreach ( $keywords as $keyword ) {
269
+ if ( strpos( $item->get_title(), $keyword ) !== false || strpos( $item->get_description(), $keyword ) !== false ) {
270
+ $continue = true;
271
+ }
272
+ }
273
+ }
274
+ } elseif ( isset( $sc['keywords_title'] ) && ! empty( $sc['keywords_title'] ) ) {
275
+ $keywords = $sc['keywords_title'];
276
+ if ( ! empty( $keywords ) ) {
277
+ $continue = false;
278
+ foreach ( $keywords as $keyword ) {
279
+ if ( strpos( $item->get_title(), $keyword ) !== false ) {
280
+ $continue = true;
281
+ }
282
  }
283
  }
284
  }
285
 
286
+ if ( isset( $sc['keywords_exc'] ) && ! empty( $sc['keywords_exc'] ) ) {
287
+ $keywords = $sc['keywords_exc'];
288
+ if ( ! empty( $keywords ) ) {
289
+ foreach ( $keywords as $keyword ) {
290
+ if ( strpos( $item->get_title(), $keyword ) !== false || strpos( $item->get_description(), $keyword ) !== false ) {
291
+ return false;
292
+ }
293
+ }
294
+ }
295
+ } elseif ( isset( $sc['keywords_ban'] ) && ! empty( $sc['keywords_ban'] ) ) {
296
+ $keywords = $sc['keywords_ban'];
297
+ if ( ! empty( $keywords ) ) {
298
+ foreach ( $keywords as $keyword ) {
299
  if ( strpos( $item->get_title(), $keyword ) !== false ) {
300
  return false;
301
  }
522
  'size' => '',
523
  // only display item if title contains specific keywords (comma-separated list/case sensitive)
524
  'keywords_title' => '',
525
+ // only display item if title OR content contains specific keywords (comma-separated list/case sensitive)
526
+ 'keywords_inc' => '',
527
  // cache refresh
528
  'refresh' => '12_hours',
529
  // sorting.
687
  )
688
  );
689
  }
 
 
690
  require_once( ABSPATH . WPINC . '/class-wp-feed-cache-transient.php' );
691
  require_once( ABSPATH . WPINC . '/class-wp-simplepie-file.php' );
692
 
694
  $default_agent = $this->get_default_user_agent( $feed_url );
695
  $feed->set_useragent( apply_filters( 'http_headers_useragent', $default_agent ) );
696
  if ( false === apply_filters( 'feedzy_disable_db_cache', false, $feed_url ) ) {
697
+ SimplePie_Cache::register( 'wp_transient', 'WP_Feed_Cache_Transient' );
698
+ $feed->set_cache_location( 'wp_transient' );
699
  add_filter(
700
  'wp_feed_cache_transient_lifetime', function( $time ) use ( $cache_time ) {
701
  return $cache_time;
883
  $sc['keywords_title'] = rtrim( $sc['keywords_title'], ',' );
884
  $sc['keywords_title'] = array_map( 'trim', explode( ',', $sc['keywords_title'] ) );
885
  }
886
+ if ( ! empty( $sc['keywords_inc'] ) ) {
887
+ $sc['keywords_inc'] = rtrim( $sc['keywords_inc'], ',' );
888
+ $sc['keywords_inc'] = array_map( 'trim', explode( ',', $sc['keywords_inc'] ) );
889
+ }
890
  if ( ! empty( $sc['keywords_ban'] ) ) {
891
  $sc['keywords_ban'] = rtrim( $sc['keywords_ban'], ',' );
892
  $sc['keywords_ban'] = array_map( 'trim', explode( ',', $sc['keywords_ban'] ) );
893
  }
894
+ if ( ! empty( $sc['keywords_exc'] ) ) {
895
+ $sc['keywords_exc'] = rtrim( $sc['keywords_exc'], ',' );
896
+ $sc['keywords_exc'] = array_map( 'trim', explode( ',', $sc['keywords_exc'] ) );
897
+ }
898
  if ( empty( $sc['summarylength'] ) || ! is_numeric( $sc['summarylength'] ) ) {
899
  $sc['summarylength'] = '';
900
  }
1110
  public function get_feed_array( $feed_items, $sc, $feed, $feed_url, $sizes ) {
1111
  $count = 0;
1112
  $items = apply_filters( 'feedzy_feed_items', $feed->get_items( $sc['offset'] ), $feed_url );
1113
+ $index = 0;
1114
  foreach ( (array) $items as $item ) {
1115
+ $continue = apply_filters( 'feedzy_item_keyword', true, $sc, $item, $feed_url, $index );
1116
  if ( $continue === true ) {
1117
  // Count items. This should be > and not >= because max, when not defined and empty, becomes 0.
1118
  if ( $count >= $sc['max'] ) {
1119
  break;
1120
  }
1121
+ $item_attr = apply_filters( 'feedzy_item_attributes', $item_attr = '', $sizes, $item, $feed_url, $sc, $index );
1122
+ $feed_items[ $count ] = $this->get_feed_item_filter( $sc, $sizes, $item, $feed_url, $count, $index );
1123
  $feed_items[ $count ]['itemAttr'] = $item_attr;
1124
+ $count++;
1125
  }
1126
+ $index++;
1127
  }
1128
 
1129
  return $feed_items;
1139
  * @param array $sizes The sizes array.
1140
  * @param object $item The feed item object.
1141
  * @param string $feed_url The feed url.
1142
+ * @param int $index The item number (may not be the same as the item_index).
1143
+ * @param int $item_index The real index of this items in the feed (maybe be different from $index if filters are used).
1144
  *
1145
  * @return array
1146
  */
1147
+ private function get_feed_item_filter( $sc, $sizes, $item, $feed_url, $index, $item_index ) {
1148
  $item_link = $item->get_permalink();
1149
  // if the item has no link (possible in some cases), use the feed link
1150
  if ( empty( $item_link ) ) {
1329
  'item_content' => apply_filters( 'feedzy_content', $item->get_content( false ), $item ),
1330
  'item_source' => $feed_source,
1331
  );
1332
+ $item_array = apply_filters( 'feedzy_item_filter', $item_array, $item, $sc, $index, $item_index );
1333
 
1334
  return $item_array;
1335
  }
includes/admin/feedzy-rss-feeds-import.php CHANGED
@@ -164,11 +164,12 @@ class Feedzy_Rss_Feeds_Import {
164
  * @param array $itemArray The item attributes array.
165
  * @param object $item The feed item.
166
  * @param array $sc The shorcode attributes array.
167
- * @param int $index The item number.
 
168
  *
169
  * @return mixed
170
  */
171
- public function add_data_to_item( $itemArray, $item, $sc = null, $index = null ) {
172
  $itemArray['item_categories'] = $this->retrieve_categories( null, $item );
173
 
174
  // If set to true, SimplePie will return a unique MD5 hash for the item.
@@ -176,6 +177,7 @@ class Feedzy_Rss_Feeds_Import {
176
  $itemArray['item_id'] = $item->get_id( false );
177
 
178
  $itemArray['item'] = $item;
 
179
  return $itemArray;
180
  }
181
 
@@ -972,11 +974,13 @@ class Feedzy_Rss_Feeds_Import {
972
  }
973
 
974
  $shortcode = sprintf(
975
- '[feedzy-rss feeds="%s" max="%d" feed_title=no meta=no summary=no thumb=no error_empty="%s" keywords_title="%s" %s="%s" _dry_run_tags_="%s" _dryrun_="yes"]',
976
  $feedzy_meta_data['source'],
977
  $feedzy_meta_data['import_feed_limit'],
978
  '', // should be empty
979
  $feedzy_meta_data['inc_key'],
 
 
980
  feedzy_is_pro() ? 'keywords_ban' : '',
981
  feedzy_is_pro() ? $feedzy_meta_data['exc_key'] : '',
982
  implode( ',', $tags )
@@ -1072,8 +1076,9 @@ class Feedzy_Rss_Feeds_Import {
1072
  'thumb' => 'auto',
1073
  'default' => '',
1074
  'size' => '250',
1075
- 'keywords_title' => $inc_key,
1076
- 'keywords_ban' => $exc_key,
 
1077
  'columns' => 1,
1078
  'offset' => 0,
1079
  'multiple_meta' => 'no',
@@ -1081,6 +1086,9 @@ class Feedzy_Rss_Feeds_Import {
1081
  ), $job
1082
  );
1083
 
 
 
 
1084
  $options['__jobID'] = $job->ID;
1085
 
1086
  $last_run = time();
@@ -1184,7 +1192,7 @@ class Feedzy_Rss_Feeds_Import {
1184
  );
1185
 
1186
  if ( $this->feedzy_is_business() ) {
1187
- $post_title = apply_filters( 'feedzy_parse_custom_tags', $post_title, $results['feed'], $index );
1188
  }
1189
 
1190
  $post_title = apply_filters( 'feedzy_invoke_services', $post_title, 'title', $item['item_title'], $job );
@@ -1241,7 +1249,7 @@ class Feedzy_Rss_Feeds_Import {
1241
  }
1242
 
1243
  if ( $this->feedzy_is_business() ) {
1244
- $post_content = apply_filters( 'feedzy_parse_custom_tags', $post_content, $results['feed'], $index );
1245
  }
1246
 
1247
  $post_content = apply_filters( 'feedzy_invoke_services', $post_content, 'content', $item['item_description'], $job );
@@ -1317,9 +1325,7 @@ class Feedzy_Rss_Feeds_Import {
1317
  }
1318
  }
1319
 
1320
- do_action( 'feedzy_import_extra', $job, $results, $new_post_id, $index, $import_errors, $import_info );
1321
-
1322
- $index++;
1323
 
1324
  if ( ! empty( $import_featured_img ) ) {
1325
  $image_url = '';
@@ -1333,6 +1339,14 @@ class Feedzy_Rss_Feeds_Import {
1333
  } else {
1334
  $img_success = false;
1335
  }
 
 
 
 
 
 
 
 
1336
  } else {
1337
  $image_url = $import_featured_img;
1338
  }
@@ -1347,6 +1361,8 @@ class Feedzy_Rss_Feeds_Import {
1347
  }
1348
  }
1349
 
 
 
1350
  // indicate that this post was imported by feedzy.
1351
  update_post_meta( $new_post_id, 'feedzy', 1 );
1352
  update_post_meta( $new_post_id, 'feedzy_item_url', esc_url_raw( $item['item_url'] ) );
164
  * @param array $itemArray The item attributes array.
165
  * @param object $item The feed item.
166
  * @param array $sc The shorcode attributes array.
167
+ * @param int $index The item number (may not be the same as the item_index).
168
+ * @param int $item_index The real index of this items in the feed (maybe be different from $index if filters are used).
169
  *
170
  * @return mixed
171
  */
172
+ public function add_data_to_item( $itemArray, $item, $sc = null, $index = null, $item_index = null ) {
173
  $itemArray['item_categories'] = $this->retrieve_categories( null, $item );
174
 
175
  // If set to true, SimplePie will return a unique MD5 hash for the item.
177
  $itemArray['item_id'] = $item->get_id( false );
178
 
179
  $itemArray['item'] = $item;
180
+ $itemArray['item_index'] = $item_index;
181
  return $itemArray;
182
  }
183
 
974
  }
975
 
976
  $shortcode = sprintf(
977
+ '[feedzy-rss feeds="%s" max="%d" feed_title=no meta=no summary=no thumb=no error_empty="%s" keywords_inc="%s" %s="%s" %s="%s" _dry_run_tags_="%s" _dryrun_="yes"]',
978
  $feedzy_meta_data['source'],
979
  $feedzy_meta_data['import_feed_limit'],
980
  '', // should be empty
981
  $feedzy_meta_data['inc_key'],
982
+ feedzy_is_pro() ? 'keywords_exc' : '',
983
+ feedzy_is_pro() ? $feedzy_meta_data['exc_key'] : '',
984
  feedzy_is_pro() ? 'keywords_ban' : '',
985
  feedzy_is_pro() ? $feedzy_meta_data['exc_key'] : '',
986
  implode( ',', $tags )
1076
  'thumb' => 'auto',
1077
  'default' => '',
1078
  'size' => '250',
1079
+ 'keywords_inc' => $inc_key, // this is not keywords_title
1080
+ 'keywords_ban' => $exc_key, // to support old pro that does not support keywords_exc
1081
+ 'keywords_exc' => $exc_key, // this is not keywords_ban
1082
  'columns' => 1,
1083
  'offset' => 0,
1084
  'multiple_meta' => 'no',
1086
  ), $job
1087
  );
1088
 
1089
+ $admin = Feedzy_Rss_Feeds::instance()->get_admin();
1090
+ $options = $admin->sanitize_attr( $options, $source );
1091
+
1092
  $options['__jobID'] = $job->ID;
1093
 
1094
  $last_run = time();
1192
  );
1193
 
1194
  if ( $this->feedzy_is_business() ) {
1195
+ $post_title = apply_filters( 'feedzy_parse_custom_tags', $post_title, $results['feed'], $item['item_index'] );
1196
  }
1197
 
1198
  $post_title = apply_filters( 'feedzy_invoke_services', $post_title, 'title', $item['item_title'], $job );
1249
  }
1250
 
1251
  if ( $this->feedzy_is_business() ) {
1252
+ $post_content = apply_filters( 'feedzy_parse_custom_tags', $post_content, $results['feed'], $item['item_index'] );
1253
  }
1254
 
1255
  $post_content = apply_filters( 'feedzy_invoke_services', $post_content, 'content', $item['item_description'], $job );
1325
  }
1326
  }
1327
 
1328
+ do_action( 'feedzy_import_extra', $job, $results, $new_post_id, $index, $item['item_index'], $import_errors, $import_info );
 
 
1329
 
1330
  if ( ! empty( $import_featured_img ) ) {
1331
  $image_url = '';
1339
  } else {
1340
  $img_success = false;
1341
  }
1342
+ } elseif ( strpos( $import_featured_img, '[#item_custom' ) !== false ) {
1343
+ // custom image tag
1344
+ $value = apply_filters( 'feedzy_parse_custom_tags', $import_featured_img, $results['feed'], $index );
1345
+ if ( ! empty( $value ) && strpos( $value, '[#item_custom' ) === false ) {
1346
+ $image_url = $value;
1347
+ } else {
1348
+ $img_success = false;
1349
+ }
1350
  } else {
1351
  $image_url = $import_featured_img;
1352
  }
1361
  }
1362
  }
1363
 
1364
+ $index++;
1365
+
1366
  // indicate that this post was imported by feedzy.
1367
  update_post_meta( $new_post_id, 'feedzy', 1 );
1368
  update_post_meta( $new_post_id, 'feedzy_item_url', esc_url_raw( $item['item_url'] ) );
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.5.1';
108
  self::$instance->load_dependencies();
109
  self::$instance->set_locale();
110
  self::$instance->define_admin_hooks();
@@ -249,7 +249,7 @@ class Feedzy_Rss_Feeds {
249
  self::$instance->loader->add_filter( 'manage_feedzy_imports_posts_columns', $plugin_import, 'feedzy_import_columns' );
250
  self::$instance->loader->add_action( 'admin_notices', $plugin_import, 'admin_notices' );
251
  self::$instance->loader->add_action( 'plugins_loaded', $plugin_import, 'add_cron' );
252
- self::$instance->loader->add_filter( 'feedzy_item_filter', $plugin_import, 'add_data_to_item', 10, 4 );
253
  self::$instance->loader->add_filter( 'feedzy_display_tab_settings', $plugin_import, 'display_tab_settings', 10, 2 );
254
  self::$instance->loader->add_filter( 'feedzy_save_tab_settings', $plugin_import, 'save_tab_settings', 10, 2 );
255
  self::$instance->loader->add_filter( 'feedzy_render_magic_tags', $plugin_import, 'render_magic_tags', 10, 3 );
104
  */
105
  public function init() {
106
  self::$plugin_name = 'feedzy-rss-feeds';
107
+ self::$version = '3.5.2';
108
  self::$instance->load_dependencies();
109
  self::$instance->set_locale();
110
  self::$instance->define_admin_hooks();
249
  self::$instance->loader->add_filter( 'manage_feedzy_imports_posts_columns', $plugin_import, 'feedzy_import_columns' );
250
  self::$instance->loader->add_action( 'admin_notices', $plugin_import, 'admin_notices' );
251
  self::$instance->loader->add_action( 'plugins_loaded', $plugin_import, 'add_cron' );
252
+ self::$instance->loader->add_filter( 'feedzy_item_filter', $plugin_import, 'add_data_to_item', 10, 5 );
253
  self::$instance->loader->add_filter( 'feedzy_display_tab_settings', $plugin_import, 'display_tab_settings', 10, 2 );
254
  self::$instance->loader->add_filter( 'feedzy_save_tab_settings', $plugin_import, 'save_tab_settings', 10, 2 );
255
  self::$instance->loader->add_filter( 'feedzy_render_magic_tags', $plugin_import, 'render_magic_tags', 10, 3 );
includes/util/feedzy-rss-feeds-util-simplepie.php CHANGED
@@ -10,7 +10,6 @@
10
 
11
  if ( ! class_exists( 'SimplePie' ) ) {
12
  require_once( ABSPATH . WPINC . '/class-simplepie.php' );
13
- require_once( ABSPATH . WPINC . '/class-wp-feed-cache.php' );
14
  require_once( ABSPATH . WPINC . '/class-wp-feed-cache-transient.php' );
15
  require_once( ABSPATH . WPINC . '/class-wp-simplepie-file.php' );
16
  }
10
 
11
  if ( ! class_exists( 'SimplePie' ) ) {
12
  require_once( ABSPATH . WPINC . '/class-simplepie.php' );
 
13
  require_once( ABSPATH . WPINC . '/class-wp-feed-cache-transient.php' );
14
  require_once( ABSPATH . WPINC . '/class-wp-simplepie-file.php' );
15
  }
includes/views/import-metabox-edit.php CHANGED
@@ -57,28 +57,28 @@
57
  <div class="feedzy-row <?php echo apply_filters( 'feedzy_upsell_class', '' ); ?>">
58
  <?php echo apply_filters( 'feedzy_upsell_content', '' ); ?>
59
  <div class="label_description">
60
- <label class="feedzy-sr-only"><?php echo __( 'Display item only if the title contains specific keyword(s)', 'feedzy-rss-feeds' ); ?></label>
61
  <div>
62
  <small><?php echo 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>
63
  </div>
64
  </div>
65
  <div class="feedzy-separator"></div>
66
  <div class="form-group input-group form_item">
67
- <input type="text" name="feedzy_meta_data[inc_key]" placeholder="<?php echo __( '(eg. news, sports etc.)', 'feedzy-rss-feeds' ); ?>" class="form-control" value="<?php echo $inc_key; ?>"/>
68
  </div>
69
  </div>
70
 
71
  <div class="feedzy-row <?php echo apply_filters( 'feedzy_upsell_class', '' ); ?>">
72
  <?php echo apply_filters( 'feedzy_upsell_content', '' ); ?>
73
  <div class="label_description">
74
- <label class="feedzy-sr-only"><?php echo __( 'Exclude item if the title contains specific keyword(s)', 'feedzy-rss-feeds' ); ?></label>
75
  <div>
76
  <small><?php echo 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>
77
  </div>
78
  </div>
79
  <div class="feedzy-separator"></div>
80
  <div class="form-group input-group form_item">
81
- <input type="text" name="feedzy_meta_data[exc_key]" placeholder="<?php echo __( '(eg. news, sports etc.)', 'feedzy-rss-feeds' ); ?>" class="form-control" value="<?php echo $exc_key; ?>"/>
82
  </div>
83
  </div>
84
 
@@ -86,7 +86,7 @@
86
  <div class="label_description">
87
  <label class="feedzy-sr-only"><?php _e( 'How many feed items to import from the source?', 'feedzy-rss-feeds' ); ?></label>
88
  <div>
89
- <small><?php echo sprintf( __( 'If you choose a high number, please check that you configuration can support it or your imports may fail.', 'feedzy-rss-feeds' ), '<b>', '</b>' ); ?></small>
90
  </div>
91
  </div>
92
  <div class="feedzy-separator"></div>
@@ -100,7 +100,7 @@
100
  <div class="label_description">
101
  <label class="feedzy-sr-only"><?php _e( 'Automatically delete the posts created for this import after how many days?', 'feedzy-rss-feeds' ); ?></label>
102
  <div>
103
- <small><?php _e( 'Helpful if you want to remove stale or old items automatically. If you choose 0, the imported items will never be deleted.', 'feedzy-rss-feeds' ); ?></small>
104
  </div>
105
  </div>
106
  <div class="feedzy-separator"></div>
57
  <div class="feedzy-row <?php echo apply_filters( 'feedzy_upsell_class', '' ); ?>">
58
  <?php echo apply_filters( 'feedzy_upsell_content', '' ); ?>
59
  <div class="label_description">
60
+ <label class="feedzy-sr-only"><?php echo __( 'Display item only if the title or content contains specific keyword(s)', 'feedzy-rss-feeds' ); ?></label>
61
  <div>
62
  <small><?php echo 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>
63
  </div>
64
  </div>
65
  <div class="feedzy-separator"></div>
66
  <div class="form-group input-group form_item">
67
+ <input type="text" name="feedzy_meta_data[inc_key]" placeholder="<?php echo __( '(eg. news, Sports, STOCK etc.)', 'feedzy-rss-feeds' ); ?>" class="form-control" value="<?php echo $inc_key; ?>"/>
68
  </div>
69
  </div>
70
 
71
  <div class="feedzy-row <?php echo apply_filters( 'feedzy_upsell_class', '' ); ?>">
72
  <?php echo apply_filters( 'feedzy_upsell_content', '' ); ?>
73
  <div class="label_description">
74
+ <label class="feedzy-sr-only"><?php echo __( 'Exclude item if the title or content contains specific keyword(s)', 'feedzy-rss-feeds' ); ?></label>
75
  <div>
76
  <small><?php echo 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>
77
  </div>
78
  </div>
79
  <div class="feedzy-separator"></div>
80
  <div class="form-group input-group form_item">
81
+ <input type="text" name="feedzy_meta_data[exc_key]" placeholder="<?php echo __( '(eg. news, Sports, STOCK etc.)', 'feedzy-rss-feeds' ); ?>" class="form-control" value="<?php echo $exc_key; ?>"/>
82
  </div>
83
  </div>
84
 
86
  <div class="label_description">
87
  <label class="feedzy-sr-only"><?php _e( 'How many feed items to import from the source?', 'feedzy-rss-feeds' ); ?></label>
88
  <div>
89
+ <small><?php echo sprintf( __( 'If you choose a high number, please check that your configuration can support it or your imports may fail.', 'feedzy-rss-feeds' ), '<b>', '</b>' ); ?></small>
90
  </div>
91
  </div>
92
  <div class="feedzy-separator"></div>
100
  <div class="label_description">
101
  <label class="feedzy-sr-only"><?php _e( 'Automatically delete the posts created for this import after how many days?', 'feedzy-rss-feeds' ); ?></label>
102
  <div>
103
+ <small><?php _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>
104
  </div>
105
  </div>
106
  <div class="feedzy-separator"></div>
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.5
7
  **Stable tag:** trunk
8
  **License:** GPLv2 or later
9
  **License URI:** http://www.gnu.org/licenses/gpl-2.0.html
@@ -461,6 +461,12 @@ You have to check first if your feed is valid. Please test it here: https://vali
461
 
462
 
463
  == Changelog ==
 
 
 
 
 
 
464
  ### 3.5.1 - 2020-10-30 ###
465
 
466
  * [Fix] Importing random images with https://source.unsplash.com/random generator link in Feed to Post
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.6
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.5.2 - 2020-12-24 ###
465
+
466
+ * [Fix] Compatibility with WP 5.6
467
+ * [Fix] Composer requiring PHP greater than 7.1.0
468
+
469
+
470
  ### 3.5.1 - 2020-10-30 ###
471
 
472
  * [Fix] Importing random images with https://source.unsplash.com/random generator link in Feed to Post
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.5
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -461,33 +461,39 @@ You have to check first if your feed is valid. Please test it here: https://vali
461
 
462
 
463
  == Changelog ==
464
- = 3.5.1 - 2020-10-30 =
 
 
 
 
 
 
465
 
466
  * [Fix] Importing random images with https://source.unsplash.com/random generator link in Feed to Post
467
  * [Fix] Importing fixed featured image in Feed to Post
468
  * [Fix] Enclosures that do no specify image extension are not imported even if the type is image/jpeg
469
 
470
 
471
- = 3.5.0 - 2020-10-12 =
472
 
473
  * [Feat] Improved interface for adding new imports and for the imports listing page
474
  * [Feat] Improved checks for feeds validity
475
 
476
 
477
- = 3.4.3 - 2020-08-26 =
478
 
479
  * [Fix] HTML tags being trimmed on save of the import job
480
  * [Fix] Issue with nonce not being checked correctly
481
 
482
 
483
- = 3.4.2 - 2020-08-12 =
484
 
485
  * - [Fix] Compatibility with WP 5.5
486
  * - [Feat] Link to items imported across runs in Feed2Post
487
 
488
 
489
 
490
- = 3.4.1 - 2020-07-23 =
491
 
492
  * - [Feat] Feed2Post - Provide more info on imported content and possible errors
493
  * - [Feat] Feed2Post - New Purge & Reset button which allows to clear data of already imported items to reimport those again
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.6
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.5.2 - 2020-12-24 =
465
+
466
+ * [Fix] Compatibility with WP 5.6
467
+ * [Fix] Composer requiring PHP greater than 7.1.0
468
+
469
+
470
+ = 3.5.1 - 2020-10-30 =
471
 
472
  * [Fix] Importing random images with https://source.unsplash.com/random generator link in Feed to Post
473
  * [Fix] Importing fixed featured image in Feed to Post
474
  * [Fix] Enclosures that do no specify image extension are not imported even if the type is image/jpeg
475
 
476
 
477
+ = 3.5.0 - 2020-10-12 =
478
 
479
  * [Feat] Improved interface for adding new imports and for the imports listing page
480
  * [Feat] Improved checks for feeds validity
481
 
482
 
483
+ = 3.4.3 - 2020-08-26 =
484
 
485
  * [Fix] HTML tags being trimmed on save of the import job
486
  * [Fix] Issue with nonce not being checked correctly
487
 
488
 
489
+ = 3.4.2 - 2020-08-12 =
490
 
491
  * - [Fix] Compatibility with WP 5.5
492
  * - [Feat] Link to items imported across runs in Feed2Post
493
 
494
 
495
 
496
+ = 3.4.1 - 2020-07-23 =
497
 
498
  * - [Feat] Feed2Post - Provide more info on imported content and possible errors
499
  * - [Feat] Feed2Post - New Purge & Reset button which allows to clear data of already imported items to reimport those again
themeisle-hash.json CHANGED
@@ -1 +1 @@
1
- {"feedzy-rss-feed.php":"e893f730727345d6269b9932fd862c85","index.php":"71c0755260138a4b7b2182c3c61179f6","uninstall.php":"cdb21f8648e005cbb9c73481d1750186"}
1
+ {"feedzy-rss-feed.php":"7ec860bb8fff4bc5fbc54b24a7823788","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 ComposerAutoloaderInita8bbe8b2d9dd55695f1245350eb5f93c::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit4f93c5e0c4064494ba1171bd88732555::getLoader();
vendor/autoload_52.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
- // autoload_52.php generated by xrstf/composer-php52
4
-
5
- require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
-
7
- return ComposerAutoloaderInitde358a322445089daa86875e89b9e4df::getLoader();
 
 
 
 
 
 
 
vendor/codeinwp/themeisle-sdk/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
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
1
+ ##### [Version 3.2.16](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.15...v3.2.16) (2020-11-17)
2
+
3
+ * Fix long texts on rollback.
4
+ * Fix RTL mode for uninstall feedback.
5
+
6
  ##### [Version 3.2.15](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.14...v3.2.15) (2020-07-23)
7
 
8
  * remove no redundant module
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.15';
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.16';
18
  $themeisle_sdk_path = dirname( __FILE__ );
19
 
20
  global $themeisle_sdk_max_version;
vendor/codeinwp/themeisle-sdk/src/Modules/Rollback.php CHANGED
@@ -228,6 +228,9 @@ class Rollback extends Abstract_Module {
228
 
229
  $transient = get_transient( $this->product->get_key() . '_warning_rollback' );
230
 
 
 
 
231
  if ( false === $transient ) {
232
  set_transient( $this->product->get_key() . '_warning_rollback', 'in progress', 30 );
233
  require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
@@ -268,6 +271,9 @@ class Rollback extends Abstract_Module {
268
 
269
  $transient = get_transient( $this->product->get_key() . '_warning_rollback' );
270
 
 
 
 
271
  if ( false === $transient ) {
272
  set_transient( $this->product->get_key() . '_warning_rollback', 'in progress', 30 );
273
  require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
228
 
229
  $transient = get_transient( $this->product->get_key() . '_warning_rollback' );
230
 
231
+ // Style fix for the api link that gets outside the content.
232
+ echo '<style>body#error-page{word-break:break-word;}</style>';
233
+
234
  if ( false === $transient ) {
235
  set_transient( $this->product->get_key() . '_warning_rollback', 'in progress', 30 );
236
  require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
271
 
272
  $transient = get_transient( $this->product->get_key() . '_warning_rollback' );
273
 
274
+ // Style fix for the api link that gets outside the content.
275
+ echo '<style>body#error-page{word-break:break-word;}</style>';
276
+
277
  if ( false === $transient ) {
278
  set_transient( $this->product->get_key() . '_warning_rollback', 'in progress', 30 );
279
  require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
vendor/codeinwp/themeisle-sdk/src/Modules/Uninstall_feedback.php CHANGED
@@ -236,7 +236,7 @@ class Uninstall_Feedback extends Abstract_Module {
236
  }
237
 
238
  .ti-feedback .popup--form input[type="radio"] {
239
- margin: 0 10px 0 0;
240
  }
241
 
242
  .ti-feedback .popup--form input[type="radio"]:checked ~ textarea {
@@ -314,7 +314,7 @@ class Uninstall_Feedback extends Abstract_Module {
314
  }
315
 
316
  .ti-feedback .buttons input:last-child {
317
- margin-left: auto;
318
  }
319
 
320
  .ti-theme-uninstall-feedback-drawer {
@@ -366,13 +366,19 @@ class Uninstall_Feedback extends Abstract_Module {
366
  content: "";
367
  display: block;
368
  position: absolute;
369
- border: 20px solid #23A1CE;
370
- left: -10px;
371
  top: 50%;
372
- border-top: 20px solid transparent;
373
- border-bottom: 20px solid transparent;
374
- border-left: 0;
375
  transform: translateY(-50%);
 
 
 
 
 
 
 
 
 
 
 
376
  }
377
 
378
  .ti-plugin-uninstall-feedback-popup {
@@ -380,7 +386,7 @@ class Uninstall_Feedback extends Abstract_Module {
380
  position: absolute;
381
  white-space: normal;
382
  width: 400px;
383
- left: 100%;
384
  top: -15px;
385
  }
386
 
236
  }
237
 
238
  .ti-feedback .popup--form input[type="radio"] {
239
+ <?php echo is_rtl() ? 'margin: 0 0 0 10px;' : 'margin: 0 10px 0 0;'; ?>
240
  }
241
 
242
  .ti-feedback .popup--form input[type="radio"]:checked ~ textarea {
314
  }
315
 
316
  .ti-feedback .buttons input:last-child {
317
+ <?php echo is_rtl() ? 'margin-right: auto;' : 'margin-left: auto;'; ?>
318
  }
319
 
320
  .ti-theme-uninstall-feedback-drawer {
366
  content: "";
367
  display: block;
368
  position: absolute;
 
 
369
  top: 50%;
 
 
 
370
  transform: translateY(-50%);
371
+ <?php
372
+ echo is_rtl() ?
373
+ 'right: -10px;
374
+ border-top: 20px solid transparent;
375
+ border-left: 20px solid #23A1CE;
376
+ border-bottom: 20px solid transparent;' :
377
+ 'left: -10px;
378
+ border-top: 20px solid transparent;
379
+ border-right: 20px solid #23A1CE;
380
+ border-bottom: 20px solid transparent;';
381
+ ?>
382
  }
383
 
384
  .ti-plugin-uninstall-feedback-popup {
386
  position: absolute;
387
  white-space: normal;
388
  width: 400px;
389
+ <?php echo is_rtl() ? 'right: calc( 100% + 15px );' : 'left: calc( 100% + 15px );'; ?>
390
  top: -15px;
391
  }
392
 
vendor/composer/ClassLoader52.php DELETED
@@ -1,271 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- *
10
- * --------------------------------------------------------------------------
11
- *
12
- * 99% of this is copied as-is from the original Composer source code and is
13
- * released under MIT license as well. Copyright goes to:
14
- *
15
- * - Fabien Potencier <fabien@symfony.com>
16
- * - Jordi Boggiano <j.boggiano@seld.be>
17
- */
18
-
19
- class xrstf_Composer52_ClassLoader {
20
- private $prefixes = array();
21
- private $fallbackDirs = array();
22
- private $useIncludePath = false;
23
- private $classMap = array();
24
- private $classMapAuthoratative = false;
25
- private $allowUnderscore = false;
26
-
27
- /**
28
- * @param boolean $flag true to allow class names with a leading underscore, false to disable
29
- */
30
- public function setAllowUnderscore($flag) {
31
- $this->allowUnderscore = (boolean) $flag;
32
- }
33
-
34
- /**
35
- * @return array
36
- */
37
- public function getPrefixes() {
38
- return $this->prefixes;
39
- }
40
-
41
- /**
42
- * Turns off searching the prefix and fallback directories for classes
43
- * that have not been registered with the class map.
44
- *
45
- * @param bool $classMapAuthoratative
46
- */
47
- public function setClassMapAuthoritative($classMapAuthoratative) {
48
- $this->classMapAuthoratative = $classMapAuthoratative;
49
- }
50
-
51
- /**
52
- * Should class lookup fail if not found in the current class map?
53
- *
54
- * @return bool
55
- */
56
- public function getClassMapAuthoratative() {
57
- return $this->classMapAuthoratative;
58
- }
59
-
60
- /**
61
- * @return array
62
- */
63
- public function getFallbackDirs() {
64
- return $this->fallbackDirs;
65
- }
66
-
67
- /**
68
- * @return array
69
- */
70
- public function getClassMap() {
71
- return $this->classMap;
72
- }
73
-
74
- /**
75
- * @param array $classMap class to filename map
76
- */
77
- public function addClassMap(array $classMap) {
78
- if ($this->classMap) {
79
- $this->classMap = array_merge($this->classMap, $classMap);
80
- }
81
- else {
82
- $this->classMap = $classMap;
83
- }
84
- }
85
-
86
- /**
87
- * Registers a set of classes, merging with any others previously set.
88
- *
89
- * @param string $prefix the classes prefix
90
- * @param array|string $paths the location(s) of the classes
91
- * @param bool $prepend prepend the location(s)
92
- */
93
- public function add($prefix, $paths, $prepend = false) {
94
- if (!$prefix) {
95
- if ($prepend) {
96
- $this->fallbackDirs = array_merge(
97
- (array) $paths,
98
- $this->fallbackDirs
99
- );
100
- }
101
- else {
102
- $this->fallbackDirs = array_merge(
103
- $this->fallbackDirs,
104
- (array) $paths
105
- );
106
- }
107
-
108
- return;
109
- }
110
-
111
- if (!isset($this->prefixes[$prefix])) {
112
- $this->prefixes[$prefix] = (array) $paths;
113
- return;
114
- }
115
-
116
- if ($prepend) {
117
- $this->prefixes[$prefix] = array_merge(
118
- (array) $paths,
119
- $this->prefixes[$prefix]
120
- );
121
- }
122
- else {
123
- $this->prefixes[$prefix] = array_merge(
124
- $this->prefixes[$prefix],
125
- (array) $paths
126
- );
127
- }
128
- }
129
-
130
- /**
131
- * Registers a set of classes, replacing any others previously set.
132
- *
133
- * @param string $prefix the classes prefix
134
- * @param array|string $paths the location(s) of the classes
135
- */
136
- public function set($prefix, $paths) {
137
- if (!$prefix) {
138
- $this->fallbackDirs = (array) $paths;
139
- return;
140
- }
141
-
142
- $this->prefixes[$prefix] = (array) $paths;
143
- }
144
-
145
- /**
146
- * Turns on searching the include path for class files.
147
- *
148
- * @param bool $useIncludePath
149
- */
150
- public function setUseIncludePath($useIncludePath) {
151
- $this->useIncludePath = $useIncludePath;
152
- }
153
-
154
- /**
155
- * Can be used to check if the autoloader uses the include path to check
156
- * for classes.
157
- *
158
- * @return bool
159
- */
160
- public function getUseIncludePath() {
161
- return $this->useIncludePath;
162
- }
163
-
164
- /**
165
- * Registers this instance as an autoloader.
166
- */
167
- public function register() {
168
- spl_autoload_register(array($this, 'loadClass'), true);
169
- }
170
-
171
- /**
172
- * Unregisters this instance as an autoloader.
173
- */
174
- public function unregister() {
175
- spl_autoload_unregister(array($this, 'loadClass'));
176
- }
177
-
178
- /**
179
- * Loads the given class or interface.
180
- *
181
- * @param string $class the name of the class
182
- * @return bool|null true, if loaded
183
- */
184
- public function loadClass($class) {
185
- if ($file = $this->findFile($class)) {
186
- include $file;
187
- return true;
188
- }
189
- }
190
-
191
- /**
192
- * Finds the path to the file where the class is defined.
193
- *
194
- * @param string $class the name of the class
195
- * @return string|null the path, if found
196
- */
197
- public function findFile($class) {
198
- if ('\\' === $class[0]) {
199
- $class = substr($class, 1);
200
- }
201
-
202
- if (isset($this->classMap[$class])) {
203
- return $this->classMap[$class];
204
- }
205
- elseif ($this->classMapAuthoratative) {
206
- return false;
207
- }
208
-
209
- $classPath = $this->getClassPath($class);
210
-
211
- foreach ($this->prefixes as $prefix => $dirs) {
212
- if (0 === strpos($class, $prefix)) {
213
- foreach ($dirs as $dir) {
214
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
215
- return $dir.DIRECTORY_SEPARATOR.$classPath;
216
- }
217
- }
218
- }
219
- }
220
-
221
- foreach ($this->fallbackDirs as $dir) {
222
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
223
- return $dir.DIRECTORY_SEPARATOR.$classPath;
224
- }
225
- }
226
-
227
- if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
228
- return $file;
229
- }
230
-
231
- return $this->classMap[$class] = false;
232
- }
233
-
234
- private function getClassPath($class) {
235
- if (false !== $pos = strrpos($class, '\\')) {
236
- // namespaced class name
237
- $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
238
- $className = substr($class, $pos + 1);
239
- }
240
- else {
241
- // PEAR-like class name
242
- $classPath = null;
243
- $className = $class;
244
- }
245
-
246
- $className = str_replace('_', DIRECTORY_SEPARATOR, $className);
247
-
248
- // restore the prefix
249
- if ($this->allowUnderscore && DIRECTORY_SEPARATOR === $className[0]) {
250
- $className[0] = '_';
251
- }
252
-
253
- $classPath .= $className.'.php';
254
-
255
- return $classPath;
256
- }
257
-
258
- public static function resolveIncludePath($classPath) {
259
- $paths = explode(PATH_SEPARATOR, get_include_path());
260
-
261
- foreach ($paths as $path) {
262
- $path = rtrim($path, '/\\');
263
-
264
- if ($file = file_exists($path.DIRECTORY_SEPARATOR.$file)) {
265
- return $file;
266
- }
267
- }
268
-
269
- return false;
270
- }
271
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_namespaces.php CHANGED
@@ -6,5 +6,4 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
- 'xrstf\\Composer52' => array($vendorDir . '/xrstf/composer-php52/lib'),
10
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInita8bbe8b2d9dd55695f1245350eb5f93c
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInita8bbe8b2d9dd55695f1245350eb5f93c
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInita8bbe8b2d9dd55695f1245350eb5f93c', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInita8bbe8b2d9dd55695f1245350eb5f93c', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInita8bbe8b2d9dd55695f1245350eb5f93c
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequirea8bbe8b2d9dd55695f1245350eb5f93c($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequirea8bbe8b2d9dd55695f1245350eb5f93c($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 ComposerAutoloaderInit4f93c5e0c4064494ba1171bd88732555
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit4f93c5e0c4064494ba1171bd88732555', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit4f93c5e0c4064494ba1171bd88732555', '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
+ composerRequire4f93c5e0c4064494ba1171bd88732555($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequire4f93c5e0c4064494ba1171bd88732555($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
vendor/composer/autoload_real_52.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
-
3
- // autoload_real_52.php generated by xrstf/composer-php52
4
-
5
- class ComposerAutoloaderInitde358a322445089daa86875e89b9e4df {
6
- private static $loader;
7
-
8
- public static function loadClassLoader($class) {
9
- if ('xrstf_Composer52_ClassLoader' === $class) {
10
- require dirname(__FILE__).'/ClassLoader52.php';
11
- }
12
- }
13
-
14
- /**
15
- * @return xrstf_Composer52_ClassLoader
16
- */
17
- public static function getLoader() {
18
- if (null !== self::$loader) {
19
- return self::$loader;
20
- }
21
-
22
- spl_autoload_register(array('ComposerAutoloaderInitde358a322445089daa86875e89b9e4df', 'loadClassLoader'), true /*, true */);
23
- self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitde358a322445089daa86875e89b9e4df', 'loadClassLoader'));
25
-
26
- $vendorDir = dirname(dirname(__FILE__));
27
- $baseDir = dirname($vendorDir);
28
- $dir = dirname(__FILE__);
29
-
30
- $map = require $dir.'/autoload_namespaces.php';
31
- foreach ($map as $namespace => $path) {
32
- $loader->add($namespace, $path);
33
- }
34
-
35
- $classMap = require $dir.'/autoload_classmap.php';
36
- if ($classMap) {
37
- $loader->addClassMap($classMap);
38
- }
39
-
40
- $loader->register(true);
41
-
42
- require $vendorDir . '/codeinwp/themeisle-sdk/load.php';
43
-
44
- return $loader;
45
- }
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installed.json CHANGED
@@ -6,20 +6,22 @@
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": {
18
- "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
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/",
@@ -33,43 +35,10 @@
33
  "homepage": "https://themeisle.com"
34
  }
35
  ],
36
- "description": "ThemeIsle SDK.",
37
  "homepage": "https://github.com/Codeinwp/themeisle-sdk",
38
  "keywords": [
39
  "wordpress"
40
  ]
41
- },
42
- {
43
- "name": "xrstf/composer-php52",
44
- "version": "v1.0.20",
45
- "version_normalized": "1.0.20.0",
46
- "source": {
47
- "type": "git",
48
- "url": "https://github.com/composer-php52/composer-php52.git",
49
- "reference": "bd41459d5e27df8d33057842b32377c39e97a5a8"
50
- },
51
- "dist": {
52
- "type": "zip",
53
- "url": "https://api.github.com/repos/composer-php52/composer-php52/zipball/bd41459d5e27df8d33057842b32377c39e97a5a8",
54
- "reference": "bd41459d5e27df8d33057842b32377c39e97a5a8",
55
- "shasum": ""
56
- },
57
- "time": "2016-04-16 21:52:24",
58
- "type": "library",
59
- "extra": {
60
- "branch-alias": {
61
- "dev-default": "1.x-dev"
62
- }
63
- },
64
- "installation-source": "dist",
65
- "autoload": {
66
- "psr-0": {
67
- "xrstf\\Composer52": "lib/"
68
- }
69
- },
70
- "notification-url": "https://packagist.org/downloads/",
71
- "license": [
72
- "MIT"
73
- ]
74
  }
75
  ]
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
9
+ "reference": "b116dffbe39ea9e37169fdd683bab54c545fe560"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/b116dffbe39ea9e37169fdd683bab54c545fe560",
14
+ "reference": "b116dffbe39ea9e37169fdd683bab54c545fe560",
15
  "shasum": ""
16
  },
17
  "require-dev": {
18
+ "automattic/vipwpcs": "^1.0.0",
19
+ "dealerdirect/phpcodesniffer-composer-installer": "0.7.0",
20
+ "phpcompatibility/php-compatibility": "^9",
21
+ "squizlabs/php_codesniffer": "^3.3",
22
+ "wp-coding-standards/wpcs": "^1"
23
  },
24
+ "time": "2020-11-17 08:35:16",
25
  "type": "library",
26
  "installation-source": "source",
27
  "notification-url": "https://packagist.org/downloads/",
35
  "homepage": "https://themeisle.com"
36
  }
37
  ],
38
+ "description": "ThemeIsle SDK",
39
  "homepage": "https://github.com/Codeinwp/themeisle-sdk",
40
  "keywords": [
41
  "wordpress"
42
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
  ]
vendor/xrstf/composer-php52/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) 2013 Christoph Mewes
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is furnished
8
- to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/README.md DELETED
@@ -1,37 +0,0 @@
1
- PHP 5.2 Autoloading for Composer
2
- ================================
3
-
4
- This package provides an easy way to get a PHP 5.2 compatible autoloader out of Composer. The generated autoloader is fully compatible to the original and is written into separate files, each ending with `_52.php`.
5
-
6
- Legacy
7
- ------
8
-
9
- Please do not use this, if you can avoid it. It's a horrible hack, often breaks and is extremely tied to Composer's interna. This package was originally developed in 2012, when PHP 5.2 was much more common on cheap webhosts.
10
-
11
- In 2016, this package has been moved from Bitbucket to a Github organization, because the original developer could no longer reliably maintain it. This is the reason for this legacy package name ``xrstf/...``.
12
-
13
- Usage
14
- -----
15
-
16
- In your project's `composer.json`, add the following lines:
17
-
18
- ```json
19
- {
20
- "require": {
21
- "xrstf/composer-php52": "1.*"
22
- },
23
- "scripts": {
24
- "post-install-cmd": [
25
- "xrstf\\Composer52\\Generator::onPostInstallCmd"
26
- ],
27
- "post-update-cmd": [
28
- "xrstf\\Composer52\\Generator::onPostInstallCmd"
29
- ],
30
- "post-autoload-dump": [
31
- "xrstf\\Composer52\\Generator::onPostInstallCmd"
32
- ]
33
- }
34
- }
35
- ```
36
-
37
- After the next update/install, you will have a `vendor/autoload_52.php` file, that you can simply include and use in PHP 5.2 projects.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php DELETED
@@ -1,346 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- *
10
- * --------------------------------------------------------------------------
11
- *
12
- * 99% of this is copied as-is from the original Composer source code and is
13
- * released under MIT license as well. Copyright goes to:
14
- *
15
- * - Igor Wiedler <igor@wiedler.ch>
16
- * - Jordi Boggiano <j.boggiano@seld.be>
17
- */
18
-
19
- namespace xrstf\Composer52;
20
-
21
- use Composer\Autoload\AutoloadGenerator as BaseGenerator;
22
- use Composer\Autoload\ClassMapGenerator;
23
- use Composer\Config;
24
- use Composer\Installer\InstallationManager;
25
- use Composer\Package\AliasPackage;
26
- use Composer\Package\PackageInterface;
27
- use Composer\Repository\InstalledRepositoryInterface;
28
- use Composer\Util\Filesystem;
29
-
30
- class AutoloadGenerator extends BaseGenerator {
31
-
32
- /**
33
- * @var bool
34
- */
35
- private $classMapAuthoritative = false;
36
-
37
- public function __construct() {
38
- // do nothing (but keep this constructor so we can build an instance without the need for an event dispatcher)
39
- }
40
-
41
- /**
42
- * Whether or not generated autoloader considers the class map
43
- * authoritative.
44
- *
45
- * @param bool $classMapAuthoritative
46
- */
47
- public function setClassMapAuthoritative($classMapAuthoritative)
48
- {
49
- $this->classMapAuthoritative = (boolean) $classMapAuthoritative;
50
- }
51
-
52
- public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '') {
53
- if ($this->classMapAuthoritative) {
54
- // Force scanPsr0Packages when classmap is authoritative
55
- $scanPsr0Packages = true;
56
- }
57
-
58
- $filesystem = new Filesystem();
59
- $filesystem->ensureDirectoryExists($config->get('vendor-dir'));
60
-
61
- $cwd = getcwd();
62
- $basePath = $filesystem->normalizePath($cwd);
63
- $vendorPath = $filesystem->normalizePath(realpath($config->get('vendor-dir')));
64
- $targetDir = $vendorPath.'/'.$targetDir;
65
- $filesystem->ensureDirectoryExists($targetDir);
66
-
67
- $useGlobalIncludePath = (bool) $config->get('use-include-path');
68
- $prependAutoloader = $config->get('prepend-autoloader') === false ? 'false' : 'true';
69
- $classMapAuthoritative = $config->get('classmap-authoritative');
70
-
71
- $vendorPathCode = $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true);
72
- $vendorPathToTargetDirCode = $filesystem->findShortestPathCode($vendorPath, realpath($targetDir), true);
73
-
74
- $appBaseDirCode = $filesystem->findShortestPathCode($vendorPath, $basePath, true);
75
- $appBaseDirCode = str_replace('__DIR__', '$vendorDir', $appBaseDirCode);
76
-
77
- // add 5.2 compat
78
- $vendorPathCode = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathCode);
79
- $vendorPathToTargetDirCode = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathToTargetDirCode);
80
-
81
- $packageMap = $this->buildPackageMap($installationManager, $mainPackage, $localRepo->getCanonicalPackages());
82
- $autoloads = $this->parseAutoloads($packageMap, $mainPackage);
83
-
84
- // add custom psr-0 autoloading if the root package has a target dir
85
- $targetDirLoader = null;
86
- $mainAutoload = $mainPackage->getAutoload();
87
- if ($mainPackage->getTargetDir() && !empty($mainAutoload['psr-0'])) {
88
- $levels = count(explode('/', $filesystem->normalizePath($mainPackage->getTargetDir())));
89
- $prefixes = implode(', ', array_map(function ($prefix) {
90
- return var_export($prefix, true);
91
- }, array_keys($mainAutoload['psr-0'])));
92
-
93
- $baseDirFromTargetDirCode = $filesystem->findShortestPathCode($targetDir, $basePath, true);
94
-
95
- $targetDirLoader = <<<EOF
96
-
97
- public static function autoload(\$class) {
98
- \$dir = $baseDirFromTargetDirCode.'/';
99
- \$prefixes = array($prefixes);
100
-
101
- foreach (\$prefixes as \$prefix) {
102
- if (0 !== strpos(\$class, \$prefix)) {
103
- continue;
104
- }
105
-
106
- \$path = explode(DIRECTORY_SEPARATOR, self::getClassPath(\$class));
107
- \$path = \$dir.implode('/', array_slice(\$path, $levels));
108
-
109
- if (!\$path = self::resolveIncludePath(\$path)) {
110
- return false;
111
- }
112
-
113
- require \$path;
114
- return true;
115
- }
116
- }
117
-
118
- EOF;
119
- }
120
-
121
- $filesCode = "";
122
- $autoloads['files'] = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($autoloads['files']));
123
- foreach ($autoloads['files'] as $functionFile) {
124
- // don't include file if it is using PHP 5.3+ syntax
125
- // https://bitbucket.org/xrstf/composer-php52/issue/4
126
- if ($this->isPHP53($functionFile)) {
127
- $filesCode .= '// require '.$this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile)."; // disabled because of PHP 5.3 syntax\n";
128
- }
129
- else {
130
- $filesCode .= ' require '.$this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile).";\n";
131
- }
132
- }
133
-
134
- if (!$suffix) {
135
- $suffix = md5(uniqid('', true));
136
- }
137
-
138
- $includePathFile = $this->getIncludePathsFile($packageMap, $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode);
139
-
140
- file_put_contents($vendorPath.'/autoload_52.php', $this->getAutoloadFile($vendorPathToTargetDirCode, $suffix));
141
- file_put_contents($targetDir.'/autoload_real_52.php', $this->getAutoloadRealFile(true, (bool) $includePathFile, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader));
142
-
143
- // use stream_copy_to_stream instead of copy
144
- // to work around https://bugs.php.net/bug.php?id=64634
145
- $sourceLoader = fopen(__DIR__.'/ClassLoader.php', 'r');
146
- $targetLoader = fopen($targetDir.'/ClassLoader52.php', 'w+');
147
- stream_copy_to_stream($sourceLoader, $targetLoader);
148
- fclose($sourceLoader);
149
- fclose($targetLoader);
150
- unset($sourceLoader, $targetLoader);
151
- }
152
-
153
- protected function isPHP53($file) {
154
- $tokens = token_get_all(file_get_contents($file));
155
- $php53 = array(T_DIR, T_GOTO, T_NAMESPACE, T_NS_C, T_NS_SEPARATOR, T_USE);
156
-
157
- // PHP 5.4+
158
- if (defined('T_TRAIT')) {
159
- $php53[] = T_TRAIT;
160
- $php53[] = T_TRAIT_C;
161
- $php53[] = T_TRAIT_C;
162
- }
163
-
164
- // PHP 5.5+
165
- if (defined('T_FINALLY')) {
166
- $php53[] = T_FINALLY;
167
- $php53[] = T_YIELD;
168
- }
169
-
170
- foreach ($tokens as $token) {
171
- if (is_array($token) && in_array($token[0], $php53)) {
172
- return true;
173
- }
174
- }
175
-
176
- return false;
177
- }
178
-
179
- protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode) {
180
- $includePaths = array();
181
-
182
- foreach ($packageMap as $item) {
183
- list($package, $installPath) = $item;
184
-
185
- if (null !== $package->getTargetDir() && strlen($package->getTargetDir()) > 0) {
186
- $installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir()));
187
- }
188
-
189
- foreach ($package->getIncludePaths() as $includePath) {
190
- $includePath = trim($includePath, '/');
191
- $includePaths[] = empty($installPath) ? $includePath : $installPath.'/'.$includePath;
192
- }
193
- }
194
-
195
- if (!$includePaths) {
196
- return;
197
- }
198
-
199
- $includePathsFile = <<<EOF
200
- <?php
201
-
202
- // include_paths_52.php generated by xrstf/composer-php52
203
-
204
- \$vendorDir = $vendorPathCode;
205
- \$baseDir = $appBaseDirCode;
206
-
207
- return array(
208
-
209
- EOF;
210
-
211
- foreach ($includePaths as $path) {
212
- $includePathsFile .= "\t" . $this->getPathCode($filesystem, $basePath, $vendorPath, $path) . ",\n";
213
- }
214
-
215
- return $includePathsFile . ");\n";
216
- }
217
-
218
- protected function getAutoloadFile($vendorPathToTargetDirCode, $suffix) {
219
- return <<<AUTOLOAD
220
- <?php
221
-
222
- // autoload_52.php generated by xrstf/composer-php52
223
-
224
- require_once $vendorPathToTargetDirCode.'/autoload_real_52.php';
225
-
226
- return ComposerAutoloaderInit$suffix::getLoader();
227
-
228
- AUTOLOAD;
229
- }
230
-
231
- protected function getAutoloadRealFile($useClassMap, $useIncludePath, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion = 70000) {
232
- // TODO the class ComposerAutoloaderInit should be revert to a closure
233
- // when APC has been fixed:
234
- // - https://github.com/composer/composer/issues/959
235
- // - https://bugs.php.net/bug.php?id=52144
236
- // - https://bugs.php.net/bug.php?id=61576
237
- // - https://bugs.php.net/bug.php?id=59298
238
-
239
- if ($filesCode) {
240
- $filesCode = "\n\n".rtrim($filesCode);
241
- }
242
-
243
- $file = <<<HEADER
244
- <?php
245
-
246
- // autoload_real_52.php generated by xrstf/composer-php52
247
-
248
- class ComposerAutoloaderInit$suffix {
249
- private static \$loader;
250
-
251
- public static function loadClassLoader(\$class) {
252
- if ('xrstf_Composer52_ClassLoader' === \$class) {
253
- require dirname(__FILE__).'/ClassLoader52.php';
254
- }
255
- }
256
-
257
- /**
258
- * @return xrstf_Composer52_ClassLoader
259
- */
260
- public static function getLoader() {
261
- if (null !== self::\$loader) {
262
- return self::\$loader;
263
- }
264
-
265
- spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'), true /*, true */);
266
- self::\$loader = \$loader = new xrstf_Composer52_ClassLoader();
267
- spl_autoload_unregister(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'));
268
-
269
- \$vendorDir = $vendorPathCode;
270
- \$baseDir = $appBaseDirCode;
271
- \$dir = dirname(__FILE__);
272
-
273
-
274
- HEADER;
275
-
276
- if ($useIncludePath) {
277
- $file .= <<<'INCLUDE_PATH'
278
- $includePaths = require $dir.'/include_paths.php';
279
- array_push($includePaths, get_include_path());
280
- set_include_path(implode(PATH_SEPARATOR, $includePaths));
281
-
282
-
283
- INCLUDE_PATH;
284
- }
285
-
286
- $file .= <<<'PSR0'
287
- $map = require $dir.'/autoload_namespaces.php';
288
- foreach ($map as $namespace => $path) {
289
- $loader->add($namespace, $path);
290
- }
291
-
292
-
293
- PSR0;
294
-
295
- if ($useClassMap) {
296
- $file .= <<<'CLASSMAP'
297
- $classMap = require $dir.'/autoload_classmap.php';
298
- if ($classMap) {
299
- $loader->addClassMap($classMap);
300
- }
301
-
302
-
303
- CLASSMAP;
304
- }
305
-
306
- if ($this->classMapAuthoritative) {
307
- $file .= <<<'CLASSMAPAUTHORITATIVE'
308
- $loader->setClassMapAuthoritative(true);
309
-
310
- CLASSMAPAUTHORITATIVE;
311
- }
312
-
313
- if ($useGlobalIncludePath) {
314
- $file .= <<<'INCLUDEPATH'
315
- $loader->setUseIncludePath(true);
316
-
317
-
318
- INCLUDEPATH;
319
- }
320
-
321
- if ($targetDirLoader) {
322
- $file .= <<<REGISTER_AUTOLOAD
323
- spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'autoload'), true);
324
-
325
-
326
- REGISTER_AUTOLOAD;
327
-
328
- }
329
-
330
- $file .= <<<METHOD_FOOTER
331
- \$loader->register($prependAutoloader);{$filesCode}
332
-
333
- return \$loader;
334
- }
335
-
336
- METHOD_FOOTER;
337
-
338
- $file .= $targetDirLoader;
339
-
340
- return $file . <<<FOOTER
341
- }
342
-
343
- FOOTER;
344
-
345
- }
346
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/lib/xrstf/Composer52/ClassLoader.php DELETED
@@ -1,271 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- *
10
- * --------------------------------------------------------------------------
11
- *
12
- * 99% of this is copied as-is from the original Composer source code and is
13
- * released under MIT license as well. Copyright goes to:
14
- *
15
- * - Fabien Potencier <fabien@symfony.com>
16
- * - Jordi Boggiano <j.boggiano@seld.be>
17
- */
18
-
19
- class xrstf_Composer52_ClassLoader {
20
- private $prefixes = array();
21
- private $fallbackDirs = array();
22
- private $useIncludePath = false;
23
- private $classMap = array();
24
- private $classMapAuthoratative = false;
25
- private $allowUnderscore = false;
26
-
27
- /**
28
- * @param boolean $flag true to allow class names with a leading underscore, false to disable
29
- */
30
- public function setAllowUnderscore($flag) {
31
- $this->allowUnderscore = (boolean) $flag;
32
- }
33
-
34
- /**
35
- * @return array
36
- */
37
- public function getPrefixes() {
38
- return $this->prefixes;
39
- }
40
-
41
- /**
42
- * Turns off searching the prefix and fallback directories for classes
43
- * that have not been registered with the class map.
44
- *
45
- * @param bool $classMapAuthoratative
46
- */
47
- public function setClassMapAuthoritative($classMapAuthoratative) {
48
- $this->classMapAuthoratative = $classMapAuthoratative;
49
- }
50
-
51
- /**
52
- * Should class lookup fail if not found in the current class map?
53
- *
54
- * @return bool
55
- */
56
- public function getClassMapAuthoratative() {
57
- return $this->classMapAuthoratative;
58
- }
59
-
60
- /**
61
- * @return array
62
- */
63
- public function getFallbackDirs() {
64
- return $this->fallbackDirs;
65
- }
66
-
67
- /**
68
- * @return array
69
- */
70
- public function getClassMap() {
71
- return $this->classMap;
72
- }
73
-
74
- /**
75
- * @param array $classMap class to filename map
76
- */
77
- public function addClassMap(array $classMap) {
78
- if ($this->classMap) {
79
- $this->classMap = array_merge($this->classMap, $classMap);
80
- }
81
- else {
82
- $this->classMap = $classMap;
83
- }
84
- }
85
-
86
- /**
87
- * Registers a set of classes, merging with any others previously set.
88
- *
89
- * @param string $prefix the classes prefix
90
- * @param array|string $paths the location(s) of the classes
91
- * @param bool $prepend prepend the location(s)
92
- */
93
- public function add($prefix, $paths, $prepend = false) {
94
- if (!$prefix) {
95
- if ($prepend) {
96
- $this->fallbackDirs = array_merge(
97
- (array) $paths,
98
- $this->fallbackDirs
99
- );
100
- }
101
- else {
102
- $this->fallbackDirs = array_merge(
103
- $this->fallbackDirs,
104
- (array) $paths
105
- );
106
- }
107
-
108
- return;
109
- }
110
-
111
- if (!isset($this->prefixes[$prefix])) {
112
- $this->prefixes[$prefix] = (array) $paths;
113
- return;
114
- }
115
-
116
- if ($prepend) {
117
- $this->prefixes[$prefix] = array_merge(
118
- (array) $paths,
119
- $this->prefixes[$prefix]
120
- );
121
- }
122
- else {
123
- $this->prefixes[$prefix] = array_merge(
124
- $this->prefixes[$prefix],
125
- (array) $paths
126
- );
127
- }
128
- }
129
-
130
- /**
131
- * Registers a set of classes, replacing any others previously set.
132
- *
133
- * @param string $prefix the classes prefix
134
- * @param array|string $paths the location(s) of the classes
135
- */
136
- public function set($prefix, $paths) {
137
- if (!$prefix) {
138
- $this->fallbackDirs = (array) $paths;
139
- return;
140
- }
141
-
142
- $this->prefixes[$prefix] = (array) $paths;
143
- }
144
-
145
- /**
146
- * Turns on searching the include path for class files.
147
- *
148
- * @param bool $useIncludePath
149
- */
150
- public function setUseIncludePath($useIncludePath) {
151
- $this->useIncludePath = $useIncludePath;
152
- }
153
-
154
- /**
155
- * Can be used to check if the autoloader uses the include path to check
156
- * for classes.
157
- *
158
- * @return bool
159
- */
160
- public function getUseIncludePath() {
161
- return $this->useIncludePath;
162
- }
163
-
164
- /**
165
- * Registers this instance as an autoloader.
166
- */
167
- public function register() {
168
- spl_autoload_register(array($this, 'loadClass'), true);
169
- }
170
-
171
- /**
172
- * Unregisters this instance as an autoloader.
173
- */
174
- public function unregister() {
175
- spl_autoload_unregister(array($this, 'loadClass'));
176
- }
177
-
178
- /**
179
- * Loads the given class or interface.
180
- *
181
- * @param string $class the name of the class
182
- * @return bool|null true, if loaded
183
- */
184
- public function loadClass($class) {
185
- if ($file = $this->findFile($class)) {
186
- include $file;
187
- return true;
188
- }
189
- }
190
-
191
- /**
192
- * Finds the path to the file where the class is defined.
193
- *
194
- * @param string $class the name of the class
195
- * @return string|null the path, if found
196
- */
197
- public function findFile($class) {
198
- if ('\\' === $class[0]) {
199
- $class = substr($class, 1);
200
- }
201
-
202
- if (isset($this->classMap[$class])) {
203
- return $this->classMap[$class];
204
- }
205
- elseif ($this->classMapAuthoratative) {
206
- return false;
207
- }
208
-
209
- $classPath = $this->getClassPath($class);
210
-
211
- foreach ($this->prefixes as $prefix => $dirs) {
212
- if (0 === strpos($class, $prefix)) {
213
- foreach ($dirs as $dir) {
214
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
215
- return $dir.DIRECTORY_SEPARATOR.$classPath;
216
- }
217
- }
218
- }
219
- }
220
-
221
- foreach ($this->fallbackDirs as $dir) {
222
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
223
- return $dir.DIRECTORY_SEPARATOR.$classPath;
224
- }
225
- }
226
-
227
- if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
228
- return $file;
229
- }
230
-
231
- return $this->classMap[$class] = false;
232
- }
233
-
234
- private function getClassPath($class) {
235
- if (false !== $pos = strrpos($class, '\\')) {
236
- // namespaced class name
237
- $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
238
- $className = substr($class, $pos + 1);
239
- }
240
- else {
241
- // PEAR-like class name
242
- $classPath = null;
243
- $className = $class;
244
- }
245
-
246
- $className = str_replace('_', DIRECTORY_SEPARATOR, $className);
247
-
248
- // restore the prefix
249
- if ($this->allowUnderscore && DIRECTORY_SEPARATOR === $className[0]) {
250
- $className[0] = '_';
251
- }
252
-
253
- $classPath .= $className.'.php';
254
-
255
- return $classPath;
256
- }
257
-
258
- public static function resolveIncludePath($classPath) {
259
- $paths = explode(PATH_SEPARATOR, get_include_path());
260
-
261
- foreach ($paths as $path) {
262
- $path = rtrim($path, '/\\');
263
-
264
- if ($file = file_exists($path.DIRECTORY_SEPARATOR.$file)) {
265
- return $file;
266
- }
267
- }
268
-
269
- return false;
270
- }
271
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- */
10
-
11
- namespace xrstf\Composer52;
12
-
13
- use Composer\Repository\CompositeRepository;
14
- use Composer\Script\Event;
15
-
16
- class Generator {
17
- public static function onPostInstallCmd(Event $event) {
18
- $composer = $event->getComposer();
19
- $installationManager = $composer->getInstallationManager();
20
- $repoManager = $composer->getRepositoryManager();
21
- $localRepo = $repoManager->getLocalRepository();
22
- $package = $composer->getPackage();
23
- $config = $composer->getConfig();
24
-
25
- // We can't gain access to the Command's input object, so we have to look
26
- // for -o / --optimize-autoloader ourselves. Sadly, neither getopt() works
27
- // (always returns an empty array), nor does Symfony's Console Input, as
28
- // it expects a full definition of the current command line and we can't
29
- // provide that.
30
-
31
- $args = $_SERVER['argv'];
32
- $optimize = in_array('-o', $args) || in_array('--optimize-autoloader', $args) || in_array('--optimize', $args);
33
-
34
- $suffix = $config->get('autoloader-suffix');
35
-
36
- $generator = new AutoloadGenerator();
37
- $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize, $suffix);
38
- }
39
- }