Menu Icons by ThemeIsle - Version 0.12.6

Version Description

Download this release

Release Info

Developer themeisle
Plugin Icon 128x128 Menu Icons by ThemeIsle
Version 0.12.6
Comparing to
See all releases

Code changes from version 0.12.5 to 0.12.6

Files changed (63) hide show
  1. .releaserc.yml +34 -0
  2. CHANGELOG.md +4 -2
  3. CONTRIBUTING.md +13 -0
  4. assets/banner-1544x500.jpg +0 -0
  5. assets/banner-772x250.jpg +0 -0
  6. assets/screenshot-1.png +0 -0
  7. assets/screenshot-2.png +0 -0
  8. assets/screenshot-3.png +0 -0
  9. assets/screenshot-4.png +0 -0
  10. assets/screenshot-5.png +0 -0
  11. assets/screenshot-6.png +0 -0
  12. assets/screenshot-7.png +0 -0
  13. assets/screenshot-8.png +0 -0
  14. includes/front.php +15 -1
  15. includes/picker.php +3 -3
  16. readme.txt +11 -6
  17. vendor/autoload.php +2 -2
  18. vendor/codeinwp/icon-picker/assets/screenshot-1.png +0 -0
  19. vendor/codeinwp/icon-picker/assets/screenshot-2.png +0 -0
  20. vendor/codeinwp/icon-picker/icon-picker.php +3 -1
  21. vendor/codeinwp/icon-picker/js/src/icon-picker.js +0 -101
  22. vendor/codeinwp/icon-picker/js/src/media/controllers/font.js +0 -69
  23. vendor/codeinwp/icon-picker/js/src/media/controllers/img.js +0 -148
  24. vendor/codeinwp/icon-picker/js/src/media/controllers/mixin.js +0 -35
  25. vendor/codeinwp/icon-picker/js/src/media/manifest.js +0 -16
  26. vendor/codeinwp/icon-picker/js/src/media/models/fonts.js +0 -77
  27. vendor/codeinwp/icon-picker/js/src/media/models/target.js +0 -18
  28. vendor/codeinwp/icon-picker/js/src/media/views/browser.js +0 -15
  29. vendor/codeinwp/icon-picker/js/src/media/views/font-browser.js +0 -63
  30. vendor/codeinwp/icon-picker/js/src/media/views/font-filter.js +0 -33
  31. vendor/codeinwp/icon-picker/js/src/media/views/font-item.js +0 -30
  32. vendor/codeinwp/icon-picker/js/src/media/views/font-library.js +0 -100
  33. vendor/codeinwp/icon-picker/js/src/media/views/frame.js +0 -118
  34. vendor/codeinwp/icon-picker/js/src/media/views/img-browser.js +0 -6
  35. vendor/codeinwp/icon-picker/js/src/media/views/sidebar.js +0 -29
  36. vendor/codeinwp/icon-picker/js/src/media/views/svg-item.js +0 -8
  37. vendor/codeinwp/icon-picker/phpcs.ruleset.xml +0 -17
  38. vendor/codeinwp/icon-picker/readme.md +0 -85
  39. vendor/codeinwp/menu-item-custom-fields/menu-item-custom-fields.php +1 -1
  40. vendor/codeinwp/menu-item-custom-fields/phpcs.ruleset.xml +0 -18
  41. vendor/codeinwp/menu-item-custom-fields/readme.md +0 -66
  42. vendor/codeinwp/themeisle-sdk/CHANGELOG.md +22 -0
  43. vendor/codeinwp/themeisle-sdk/load.php +1 -1
  44. vendor/codeinwp/themeisle-sdk/src/Common/Abstract_module.php +19 -2
  45. vendor/codeinwp/themeisle-sdk/src/Common/Module_factory.php +1 -1
  46. vendor/codeinwp/themeisle-sdk/src/Modules/Dashboard_widget.php +36 -32
  47. vendor/codeinwp/themeisle-sdk/src/Modules/Licenser.php +157 -119
  48. vendor/codeinwp/themeisle-sdk/src/Modules/Logger.php +1 -1
  49. vendor/codeinwp/themeisle-sdk/src/Modules/Notification.php +3 -3
  50. vendor/codeinwp/themeisle-sdk/src/Modules/Recommendation.php +13 -10
  51. vendor/codeinwp/themeisle-sdk/src/Modules/Rollback.php +15 -7
  52. vendor/codeinwp/themeisle-sdk/src/Modules/Translate.php +1 -1
  53. vendor/codeinwp/themeisle-sdk/src/Modules/Uninstall_feedback.php +42 -36
  54. vendor/codeinwp/themeisle-sdk/src/Product.php +1 -1
  55. vendor/codeinwp/themeisle-sdk/start.php +19 -19
  56. vendor/composer/ClassLoader.php +83 -17
  57. vendor/composer/InstalledVersions.php +329 -0
  58. vendor/composer/LICENSE +1 -1
  59. vendor/composer/autoload_classmap.php +1 -0
  60. vendor/composer/autoload_real.php +32 -18
  61. vendor/composer/autoload_static.php +27 -0
  62. vendor/composer/installed.json +184 -161
  63. vendor/composer/installed.php +70 -0
.releaserc.yml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ branch: master
3
+ plugins:
4
+ - - "@semantic-release/commit-analyzer"
5
+ - preset: simple-preset
6
+ releaseRules: conventional-changelog-simple-preset/release-rules
7
+ - - "@semantic-release/changelog"
8
+ - changelogFile: CHANGELOG.md
9
+ - - "@semantic-release/release-notes-generator"
10
+ - preset: simple-preset
11
+ - - "@semantic-release/exec"
12
+ - prepareCmd: "replace-in-file \"== Changelog ==\" \"== Changelog ==\n\n${nextRelease.notes}\" readme.txt"
13
+ - - "@semantic-release/exec"
14
+ - prepareCmd: grunt version::${nextRelease.version} && grunt wp_readme_to_markdown
15
+ - - "semantic-release-slack-bot"
16
+ - notifyOnSuccess: false
17
+ notifyOnFail: false
18
+ markdownReleaseNotes: true
19
+ branchesConfig:
20
+ - pattern: master
21
+ notifyOnSuccess: true
22
+ notifyOnFail: false
23
+ - - "@semantic-release/git"
24
+ - assets:
25
+ - CHANGELOG.md
26
+ - readme.md
27
+ - readme.txt
28
+ - classes/Visualizer/Plugin.php
29
+ - css/media.css
30
+ - index.php
31
+ - package-lock.json
32
+ - package.json
33
+ message: "chore(release): ${nextRelease.version} \n\n${nextRelease.notes}"
34
+ - - "@semantic-release/github"
CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
 
1
 
2
- ### v0.12.5 - 2020-08-18
 
 
3
  **Changes:**
4
 
5
  ### v0.12.4 - 2020-07-13
@@ -46,4 +49,3 @@
46
  **Changes:**
47
  * Change ownership to ThemeIsle.
48
  * Improves compatibility with various ThemeIsle products.
49
-
1
+ ##### [Version 0.12.6](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.5...v0.12.6) (2021-05-05)
2
 
3
+ * Adds explicit width/height to icons to prevent layout shifts issues
4
+
5
+ ### v0.12.5 - 2020-08-18
6
  **Changes:**
7
 
8
  ### v0.12.4 - 2020-07-13
49
  **Changes:**
50
  * Change ownership to ThemeIsle.
51
  * Improves compatibility with various ThemeIsle products.
 
CONTRIBUTING.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Releasing
2
+
3
+ This repository uses conventional [changelog commit](https://github.com/Codeinwp/conventional-changelog-simple-preset) messages to trigger release
4
+
5
+ How to release a new version:
6
+
7
+ - Clone the master branch
8
+ - Do your changes
9
+ - Send a PR to master and merge it using the following subject message
10
+ - `release: <release short description>` - for patch release
11
+ - `release(minor): <release short description>` - for minor release
12
+ - `release(major): <release short description>` - for major release
13
+ The release notes will inherit the body of the commit message which triggered the release. For more details check the [simple-preset](https://github.com/Codeinwp/conventional-changelog-simple-preset) that we use.
assets/banner-1544x500.jpg DELETED
Binary file
assets/banner-772x250.jpg DELETED
Binary file
assets/screenshot-1.png DELETED
Binary file
assets/screenshot-2.png DELETED
Binary file
assets/screenshot-3.png DELETED
Binary file
assets/screenshot-4.png DELETED
Binary file
assets/screenshot-5.png DELETED
Binary file
assets/screenshot-6.png DELETED
Binary file
assets/screenshot-7.png DELETED
Binary file
assets/screenshot-8.png DELETED
Binary file
includes/front.php CHANGED
@@ -420,10 +420,24 @@ final class Menu_Icons_Front_End {
420
  $classes = sprintf( '%s _svg', self::get_icon_classes( $meta ) );
421
  $style = self::get_icon_style( $meta, array( 'svg_width', 'vertical_align' ) );
422
 
 
 
 
 
 
 
 
 
 
 
 
 
423
  return sprintf(
424
- '<img src="%s" class="%s" aria-hidden="true"%s />',
425
  esc_url( wp_get_attachment_url( $meta['icon'] ) ),
426
  esc_attr( $classes ),
 
 
427
  $style
428
  );
429
  }
420
  $classes = sprintf( '%s _svg', self::get_icon_classes( $meta ) );
421
  $style = self::get_icon_style( $meta, array( 'svg_width', 'vertical_align' ) );
422
 
423
+ $svg_icon = esc_url( wp_get_attachment_url( $meta['icon'] ) );
424
+ $svg_icon_content = file_get_contents( $svg_icon );
425
+ $width = 0;
426
+ $height = 0;
427
+ if ( $svg_icon_content ) {
428
+ $xmlget = simplexml_load_string( $svg_icon_content );
429
+ $xmlattributes = $xmlget->attributes();
430
+ $width = (string) $xmlattributes->width;
431
+ $width = (int) filter_var( $xmlattributes->width, FILTER_SANITIZE_NUMBER_INT );
432
+ $height = (string) $xmlattributes->height;
433
+ $height = (int) filter_var( $xmlattributes->height, FILTER_SANITIZE_NUMBER_INT );
434
+ }
435
  return sprintf(
436
+ '<img src="%s" class="%s" aria-hidden="true" width="%dpx" height="%dpx"%s/>',
437
  esc_url( wp_get_attachment_url( $meta['icon'] ) ),
438
  esc_attr( $classes ),
439
+ $width,
440
+ $height,
441
  $style
442
  );
443
  }
includes/picker.php CHANGED
@@ -186,9 +186,9 @@ final class Menu_Icons_Picker {
186
  return;
187
  }
188
 
189
- if( ! function_exists( 'get_current_screen' ) ) {
190
- return;
191
- }
192
 
193
  $screen = get_current_screen();
194
  if ( ! $screen instanceof WP_Screen || 'nav-menus' !== $screen->id ) {
186
  return;
187
  }
188
 
189
+ if ( ! function_exists( 'get_current_screen' ) ) {
190
+ return;
191
+ }
192
 
193
  $screen = get_current_screen();
194
  if ( ! $screen instanceof WP_Screen || 'nav-menus' !== $screen->id ) {
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: codeinwp, themeisle
3
  Tags: menu, nav-menu, icons, navigation
4
  Requires at least: 4.3
5
- Tested up to: 5.4
6
  Stable tag: trunk
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -224,7 +224,12 @@ add_filter( 'menu_icons_menu_settings', 'my_menu_icons_menu_settings', 10, 2 );
224
  Read [this blog post](http://kucrut.org/add-custom-image-sizes-right-way/).
225
 
226
  == Changelog ==
227
- = 0.12.5 - 2020-08-18 =
 
 
 
 
 
228
 
229
 
230
 
@@ -233,22 +238,22 @@ Read [this blog post](http://kucrut.org/add-custom-image-sizes-right-way/).
233
  * Fix Font Awesome not loading
234
 
235
 
236
- = 0.12.3 - 2020-07-13 =
237
 
238
  * Fixed Menu Icons in Block Editor not working
239
  * Fixed CWP links.
240
 
241
 
242
- = 0.12.2 - 2019-11-15 =
243
 
244
 
245
 
246
- = 0.12.1 - 2019-11-15 =
247
 
248
  * Improve legacy compatibility
249
 
250
 
251
- = 0.12.0 - 2019-11-15 =
252
 
253
  * Fix issues with WordPress 5.3.
254
 
2
  Contributors: codeinwp, themeisle
3
  Tags: menu, nav-menu, icons, navigation
4
  Requires at least: 4.3
5
+ Tested up to: 5.7
6
  Stable tag: trunk
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
224
  Read [this blog post](http://kucrut.org/add-custom-image-sizes-right-way/).
225
 
226
  == Changelog ==
227
+
228
+ ##### [Version 0.12.6](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.5...v0.12.6) (2021-05-05)
229
+
230
+ * Adds explicit width/height to icons to prevent layout shifts issues
231
+
232
+
233
 
234
 
235
 
238
  * Fix Font Awesome not loading
239
 
240
 
241
+ = 0.12.3 - 2020-07-13 =
242
 
243
  * Fixed Menu Icons in Block Editor not working
244
  * Fixed CWP links.
245
 
246
 
247
+ = 0.12.2 - 2019-11-15 =
248
 
249
 
250
 
251
+ = 0.12.1 - 2019-11-15 =
252
 
253
  * Improve legacy compatibility
254
 
255
 
256
+ = 0.12.0 - 2019-11-15 =
257
 
258
  * Fix issues with WordPress 5.3.
259
 
vendor/autoload.php CHANGED
@@ -2,6 +2,6 @@
2
 
3
  // autoload.php @generated by Composer
4
 
5
- require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitabef56b0da707c7e3eaebd0d256cca29::getLoader();
2
 
3
  // autoload.php @generated by Composer
4
 
5
+ require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit66e1d66cf653b778d8f616ff7b2c524b::getLoader();
vendor/codeinwp/icon-picker/assets/screenshot-1.png DELETED
Binary file
vendor/codeinwp/icon-picker/assets/screenshot-2.png DELETED
Binary file
vendor/codeinwp/icon-picker/icon-picker.php CHANGED
@@ -337,4 +337,6 @@ final class Icon_Picker {
337
  $this->is_admin_loaded = true;
338
  }
339
  }
340
- add_action( 'plugins_loaded', array( 'Icon_Picker', 'instance' ), 7 );
 
 
337
  $this->is_admin_loaded = true;
338
  }
339
  }
340
+ if ( function_exists( 'add_action' ) ) {
341
+ add_action( 'plugins_loaded', array( 'Icon_Picker', 'instance' ), 7 );
342
+ }
vendor/codeinwp/icon-picker/js/src/icon-picker.js DELETED
@@ -1,101 +0,0 @@
1
- require( './media/manifest' );
2
-
3
- ( function( $ ) {
4
- var l10n = wp.media.view.l10n.iconPicker,
5
- templates = {},
6
- frame, selectIcon, removeIcon, getFrame, updateField, updatePreview, $field;
7
-
8
- getFrame = function() {
9
- if ( ! frame ) {
10
- frame = new wp.media.view.MediaFrame.IconPicker();
11
-
12
- frame.target.on( 'change', updateField );
13
- }
14
-
15
- return frame;
16
- };
17
-
18
- updateField = function( model ) {
19
- _.each( model.get( 'inputs' ), function( $input, key ) {
20
- $input.val( model.get( key ) );
21
- });
22
-
23
- model.clear({ silent: true });
24
- $field.trigger( 'ipf:update' );
25
- };
26
-
27
- updatePreview = function( e ) {
28
- var $el = $( e.currentTarget ),
29
- $select = $el.find( 'a.ipf-select' ),
30
- $remove = $el.find( 'a.ipf-remove' ),
31
- type = $el.find( 'input.ipf-type' ).val(),
32
- icon = $el.find( 'input.ipf-icon' ).val(),
33
- url = $el.find( 'input.url' ).val(),
34
- template;
35
-
36
- if ( type === '' || icon === '' || ! _.has( iconPicker.types, type ) ) {
37
- $remove.addClass( 'hidden' );
38
- $select
39
- .removeClass( 'has-icon' )
40
- .addClass( 'button' )
41
- .text( l10n.selectIcon )
42
- .attr( 'title', '' );
43
-
44
- return;
45
- }
46
-
47
- if ( templates[ type ]) {
48
- template = templates[ type ];
49
- } else {
50
- template = templates[ type ] = wp.template( 'iconpicker-' + iconPicker.types[ type ].templateId + '-icon' );
51
- }
52
-
53
- $remove.removeClass( 'hidden' );
54
- $select
55
- .attr( 'title', l10n.selectIcon )
56
- .addClass( 'has-icon' )
57
- .removeClass( 'button' )
58
- .html( template({
59
- type: type,
60
- icon: icon,
61
- url: url
62
- }) );
63
- };
64
-
65
- selectIcon = function( e ) {
66
- var frame = getFrame(),
67
- model = { inputs: {} };
68
-
69
- e.preventDefault();
70
-
71
- $field = $( e.currentTarget ).closest( '.ipf' );
72
- model.id = $field.attr( 'id' );
73
-
74
- // Collect input fields and use them as the model's attributes.
75
- $field.find( 'input' ).each( function() {
76
- var $input = $( this ),
77
- key = $input.attr( 'class' ).replace( 'ipf-', '' ),
78
- value = $input.val();
79
-
80
- model[ key ] = value;
81
- model.inputs[ key ] = $input;
82
- });
83
-
84
- frame.target.set( model, { silent: true });
85
- frame.open();
86
- };
87
-
88
- removeIcon = function( e ) {
89
- var $el = $( e.currentTarget ).closest( 'div.ipf' );
90
-
91
- $el.find( 'input' ).val( '' );
92
- $el.trigger( 'ipf:update' );
93
- };
94
-
95
- $( document )
96
- .on( 'click', 'a.ipf-select', selectIcon )
97
- .on( 'click', 'a.ipf-remove', removeIcon )
98
- .on( 'ipf:update', 'div.ipf', updatePreview );
99
-
100
- $( 'div.ipf' ).trigger( 'ipf:update' );
101
- }( jQuery ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/controllers/font.js DELETED
@@ -1,69 +0,0 @@
1
- /**
2
- * wp.media.controller.IconPickerFont
3
- *
4
- * @class
5
- * @augments wp.media.controller.State
6
- * @augments Backbone.Model
7
- * @mixes wp.media.controller.iconPickerMixin
8
- */
9
- var IconPickerFont = wp.media.controller.State.extend( _.extend({}, wp.media.controller.iconPickerMixin, {
10
- defaults: {
11
- multiple: false,
12
- menu: 'default',
13
- toolbar: 'select',
14
- baseType: 'font'
15
- },
16
-
17
- initialize: function() {
18
- var data = this.get( 'data' );
19
-
20
- this.set( 'groups', new Backbone.Collection( data.groups ) );
21
- this.set( 'library', new wp.media.model.IconPickerFonts( data.items ) );
22
- this.set( 'selection', new wp.media.model.Selection( null, {
23
- multiple: this.get( 'multiple' )
24
- }) );
25
- },
26
-
27
- activate: function() {
28
- this.frame.on( 'open', this.updateSelection, this );
29
- this.resetFilter();
30
- this.updateSelection();
31
- },
32
-
33
- deactivate: function() {
34
- this.frame.off( 'open', this.updateSelection, this );
35
- },
36
-
37
- resetFilter: function() {
38
- this.get( 'library' ).props.set( 'group', 'all' );
39
- },
40
-
41
- updateSelection: function() {
42
- var selection = this.get( 'selection' ),
43
- library = this.get( 'library' ),
44
- target = this.frame.target,
45
- icon = target.get( 'icon' ),
46
- type = target.get( 'type' ),
47
- selected;
48
-
49
- if ( this.id === type ) {
50
- selected = library.findWhere({ id: icon });
51
- }
52
-
53
- selection.reset( selected ? selected : null );
54
- },
55
-
56
- getContentView: function() {
57
- return new wp.media.view.IconPickerFontBrowser( _.extend({
58
- controller: this.frame,
59
- model: this,
60
- groups: this.get( 'groups' ),
61
- collection: this.get( 'library' ),
62
- selection: this.get( 'selection' ),
63
- baseType: this.get( 'baseType' ),
64
- type: this.get( 'id' )
65
- }, this.ipGetSidebarOptions() ) );
66
- }
67
- }) );
68
-
69
- module.exports = IconPickerFont;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/controllers/img.js DELETED
@@ -1,148 +0,0 @@
1
- var Library = wp.media.controller.Library,
2
- l10n = wp.media.view.l10n,
3
- models = wp.media.model,
4
- views = wp.media.view,
5
- IconPickerImg;
6
-
7
- /**
8
- * wp.media.controller.IconPickerImg
9
- *
10
- * @augments wp.media.controller.Library
11
- * @augments wp.media.controller.State
12
- * @augments Backbone.Model
13
- * @mixes media.selectionSync
14
- * @mixes wp.media.controller.iconPickerMixin
15
- */
16
- IconPickerImg = Library.extend( _.extend({}, wp.media.controller.iconPickerMixin, {
17
- defaults: _.defaults({
18
- id: 'image',
19
- baseType: 'image',
20
- syncSelection: false
21
- }, Library.prototype.defaults ),
22
-
23
- initialize: function( options ) {
24
- var selection = this.get( 'selection' );
25
-
26
- this.options = options;
27
-
28
- this.set( 'library', wp.media.query({ type: options.data.mimeTypes }) );
29
-
30
- this.routers = {
31
- upload: {
32
- text: l10n.uploadFilesTitle,
33
- priority: 20
34
- },
35
- browse: {
36
- text: l10n.mediaLibraryTitle,
37
- priority: 40
38
- }
39
- };
40
-
41
- if ( ! ( selection instanceof models.Selection ) ) {
42
- this.set( 'selection', new models.Selection( selection, {
43
- multiple: false
44
- }) );
45
- }
46
-
47
- Library.prototype.initialize.apply( this, arguments );
48
- },
49
-
50
- activate: function() {
51
- Library.prototype.activate.apply( this, arguments );
52
- this.get( 'library' ).observe( wp.Uploader.queue );
53
- this.frame.on( 'open', this.updateSelection, this );
54
- this.updateSelection();
55
- },
56
-
57
- deactivate: function() {
58
- Library.prototype.deactivate.apply( this, arguments );
59
- this.get( 'library' ).unobserve( wp.Uploader.queue );
60
- this.frame.off( 'open', this.updateSelection, this );
61
- },
62
-
63
- getContentView: function( mode ) {
64
- var content = ( mode === 'upload' ) ? this.uploadContent() : this.browseContent();
65
-
66
- this.frame.$el.removeClass( 'hide-toolbar' );
67
-
68
- return content;
69
- },
70
-
71
- /**
72
- * Media library content
73
- *
74
- * @returns {wp.media.view.IconPickerImgBrowser} "Browse" content view.
75
- */
76
- browseContent: function() {
77
- var options = _.extend({
78
- model: this,
79
- controller: this.frame,
80
- collection: this.get( 'library' ),
81
- selection: this.get( 'selection' ),
82
- sortable: this.get( 'sortable' ),
83
- search: this.get( 'searchable' ),
84
- filters: this.get( 'filterable' ),
85
- dragInfo: this.get( 'dragInfo' ),
86
- idealColumnWidth: this.get( 'idealColumnWidth' ),
87
- suggestedWidth: this.get( 'suggestedWidth' ),
88
- suggestedHeight: this.get( 'suggestedHeight' )
89
- }, this.ipGetSidebarOptions() );
90
-
91
- if ( this.id === 'svg' ) {
92
- options.AttachmentView = views.IconPickerSvgItem;
93
- }
94
-
95
- return new views.IconPickerImgBrowser( options );
96
- },
97
-
98
- /**
99
- * Render callback for the content region in the `upload` mode.
100
- *
101
- * @returns {wp.media.view.UploaderInline} "Upload" content view.
102
- */
103
- uploadContent: function() {
104
- return new wp.media.view.UploaderInline({
105
- controller: this.frame
106
- });
107
- },
108
-
109
- updateSelection: function() {
110
- var selection = this.get( 'selection' ),
111
- target = this.frame.target,
112
- icon = target.get( 'icon' ),
113
- type = target.get( 'type' ),
114
- selected;
115
-
116
- if ( this.id === type ) {
117
- selected = models.Attachment.get( icon );
118
- this.dfd = selected.fetch();
119
- }
120
-
121
- selection.reset( selected ? selected : null );
122
- },
123
-
124
- /**
125
- * Get image icon URL
126
- *
127
- * @param {object} model - Selected icon model.
128
- * @param {string} size - Image size.
129
- *
130
- * @returns {string} Icon URL.
131
- */
132
- ipGetIconUrl: function( model, size ) {
133
- var url = model.get( 'url' ),
134
- sizes = model.get( 'sizes' );
135
-
136
- if ( undefined === size ) {
137
- size = 'thumbnail';
138
- }
139
-
140
- if ( sizes && sizes[ size ]) {
141
- url = sizes[ size ].url;
142
- }
143
-
144
- return url;
145
- }
146
- }) );
147
-
148
- module.exports = IconPickerImg;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/controllers/mixin.js DELETED
@@ -1,35 +0,0 @@
1
- /**
2
- * Methods for the state
3
- *
4
- * @mixin
5
- */
6
- var iconPickerMixin = {
7
-
8
- /**
9
- * @returns {object}
10
- */
11
- ipGetSidebarOptions: function() {
12
- var frameOptions = this.frame.options,
13
- options = {};
14
-
15
- if ( frameOptions.SidebarView && frameOptions.SidebarView.prototype instanceof wp.media.view.IconPickerSidebar ) {
16
- options.sidebar = true;
17
- options.SidebarView = frameOptions.SidebarView;
18
- } else {
19
- options.sidebar = false;
20
- }
21
-
22
- return options;
23
- },
24
-
25
- /**
26
- * Get image icon URL
27
- *
28
- * @returns {string}
29
- */
30
- ipGetIconUrl: function() {
31
- return '';
32
- }
33
- };
34
-
35
- module.exports = iconPickerMixin;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/manifest.js DELETED
@@ -1,16 +0,0 @@
1
- wp.media.model.IconPickerTarget = require( './models/target.js' );
2
- wp.media.model.IconPickerFonts = require( './models/fonts.js' );
3
-
4
- wp.media.controller.iconPickerMixin = require( './controllers/mixin.js' );
5
- wp.media.controller.IconPickerFont = require( './controllers/font.js' );
6
- wp.media.controller.IconPickerImg = require( './controllers/img.js' );
7
-
8
- wp.media.view.IconPickerBrowser = require( './views/browser.js' );
9
- wp.media.view.IconPickerSidebar = require( './views/sidebar.js' );
10
- wp.media.view.IconPickerFontItem = require( './views/font-item.js' );
11
- wp.media.view.IconPickerFontLibrary = require( './views/font-library.js' );
12
- wp.media.view.IconPickerFontFilter = require( './views/font-filter.js' );
13
- wp.media.view.IconPickerFontBrowser = require( './views/font-browser.js' );
14
- wp.media.view.IconPickerImgBrowser = require( './views/img-browser.js' );
15
- wp.media.view.IconPickerSvgItem = require( './views/svg-item.js' );
16
- wp.media.view.MediaFrame.IconPicker = require( './views/frame.js' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/models/fonts.js DELETED
@@ -1,77 +0,0 @@
1
- /**
2
- * wp.media.model.IconPickerFonts
3
- */
4
- var IconPickerFonts = Backbone.Collection.extend({
5
- constructor: function() {
6
- Backbone.Collection.prototype.constructor.apply( this, arguments );
7
-
8
- this.items = new Backbone.Collection( this.models );
9
- this.props = new Backbone.Model({
10
- group: 'all',
11
- search: ''
12
- });
13
-
14
- this.props.on( 'change', this.refresh, this );
15
- },
16
-
17
- /**
18
- * Refresh library when props is changed
19
- *
20
- * @param {Backbone.Model} props
21
- */
22
- refresh: function( props ) {
23
- let items = _.clone( this.items.models );
24
-
25
- _.each( props.toJSON(), ( value, filter ) => {
26
- const method = this.filters[ filter ];
27
-
28
- if ( method ) {
29
- items = items.filter( item => {
30
- return method( item, value );
31
- });
32
- }
33
- });
34
-
35
- this.reset( items );
36
- },
37
-
38
- filters: {
39
- /**
40
- * @static
41
- *
42
- * @param {Backbone.Model} item Item model.
43
- * @param {string} group Group ID.
44
- *
45
- * @returns {Boolean}
46
- */
47
- group: function( item, group ) {
48
- return ( group === 'all' || item.get( 'group' ) === group || item.get( 'group' ) === '' );
49
- },
50
-
51
- /**
52
- * @static
53
- *
54
- * @param {Backbone.Model} item Item model.
55
- * @param {string} term Search term.
56
- *
57
- * @returns {Boolean}
58
- */
59
- search: function( item, term ) {
60
- let result;
61
-
62
- if ( term === '' ) {
63
- result = true;
64
- } else {
65
- result = _.any([ 'id', 'name' ], attribute => {
66
- const value = item.get( attribute );
67
-
68
- return value && value.search( term ) >= 0;
69
- }, term );
70
- }
71
-
72
- return result;
73
- }
74
- }
75
- });
76
-
77
- module.exports = IconPickerFonts;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/models/target.js DELETED
@@ -1,18 +0,0 @@
1
- /**
2
- * wp.media.model.IconPickerTarget
3
- *
4
- * A target where the picked icon should be sent to
5
- *
6
- * @augments Backbone.Model
7
- */
8
- var IconPickerTarget = Backbone.Model.extend({
9
- defaults: {
10
- type: '',
11
- group: 'all',
12
- icon: '',
13
- url: '',
14
- sizes: []
15
- }
16
- });
17
-
18
- module.exports = IconPickerTarget;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/views/browser.js DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * Methods for the browser views
3
- */
4
- var IconPickerBrowser = {
5
- createSidebar: function() {
6
- this.sidebar = new this.options.SidebarView({
7
- controller: this.controller,
8
- selection: this.options.selection
9
- });
10
-
11
- this.views.add( this.sidebar );
12
- }
13
- };
14
-
15
- module.exports = IconPickerBrowser;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/views/font-browser.js DELETED
@@ -1,63 +0,0 @@
1
- /**
2
- * wp.media.view.IconPickerFontBrowser
3
- */
4
- var IconPickerFontBrowser = wp.media.View.extend( _.extend({
5
- className: function() {
6
- var className = 'attachments-browser iconpicker-fonts-browser';
7
-
8
- if ( ! this.options.sidebar ) {
9
- className += ' hide-sidebar';
10
- }
11
-
12
- return className;
13
- },
14
-
15
- initialize: function() {
16
- this.groups = this.options.groups;
17
-
18
- this.createToolbar();
19
- this.createLibrary();
20
-
21
- if ( this.options.sidebar ) {
22
- this.createSidebar();
23
- }
24
- },
25
-
26
- createLibrary: function() {
27
- this.items = new wp.media.view.IconPickerFontLibrary({
28
- controller: this.controller,
29
- collection: this.collection,
30
- selection: this.options.selection,
31
- baseType: this.options.baseType,
32
- type: this.options.type
33
- });
34
-
35
- // Add keydown listener to the instance of the library view
36
-
37
- this.views.add( this.items );
38
- },
39
-
40
- createToolbar: function() {
41
- this.toolbar = new wp.media.view.Toolbar({
42
- controller: this.controller
43
- });
44
-
45
- this.views.add( this.toolbar );
46
-
47
- // Dropdown filter
48
- this.toolbar.set( 'filters', new wp.media.view.IconPickerFontFilter({
49
- controller: this.controller,
50
- model: this.collection.props,
51
- priority: - 80
52
- }).render() );
53
-
54
- // Search field
55
- this.toolbar.set( 'search', new wp.media.view.Search({
56
- controller: this.controller,
57
- model: this.collection.props,
58
- priority: 60
59
- }).render() );
60
- }
61
- }, wp.media.view.IconPickerBrowser ) );
62
-
63
- module.exports = IconPickerFontBrowser;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/views/font-filter.js DELETED
@@ -1,33 +0,0 @@
1
- /**
2
- * wp.media.view.IconPickerFontFilter
3
- */
4
- var IconPickerFontFilter = wp.media.view.AttachmentFilters.extend({
5
- createFilters: function() {
6
- var groups = this.controller.state().get( 'groups' ),
7
- filters = {};
8
-
9
- filters.all = {
10
- text: wp.media.view.l10n.iconPicker.allFilter,
11
- props: { group: 'all' }
12
- };
13
-
14
- groups.each( function( group ) {
15
- filters[ group.id ] = {
16
- text: group.get( 'name' ),
17
- props: { group: group.id }
18
- };
19
- });
20
-
21
- this.filters = filters;
22
- },
23
-
24
- change: function() {
25
- var filter = this.filters[ this.el.value ];
26
-
27
- if ( filter ) {
28
- this.model.set( 'group', filter.props.group );
29
- }
30
- }
31
- });
32
-
33
- module.exports = IconPickerFontFilter;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/views/font-item.js DELETED
@@ -1,30 +0,0 @@
1
- var Attachment = wp.media.view.Attachment.Library,
2
- IconPickerFontItem;
3
-
4
- /**
5
- * wp.media.view.IconPickerFontItem
6
- */
7
- IconPickerFontItem = Attachment.extend({
8
- className: 'attachment iconpicker-item',
9
-
10
- initialize: function() {
11
- this.template = wp.media.template( 'iconpicker-' + this.options.baseType + '-item' );
12
- Attachment.prototype.initialize.apply( this, arguments );
13
- },
14
-
15
- render: function() {
16
- var options = _.defaults( this.model.toJSON(), {
17
- baseType: this.options.baseType,
18
- type: this.options.type
19
- });
20
-
21
- this.views.detach();
22
- this.$el.html( this.template( options ) );
23
- this.updateSelect();
24
- this.views.render();
25
-
26
- return this;
27
- }
28
- });
29
-
30
- module.exports = IconPickerFontItem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/views/font-library.js DELETED
@@ -1,100 +0,0 @@
1
- var $ = jQuery,
2
- Attachments = wp.media.view.Attachments,
3
- IconPickerFontLibrary;
4
-
5
- /**
6
- * wp.media.view.IconPickerFontLibrary
7
- */
8
- IconPickerFontLibrary = Attachments.extend({
9
- className: 'attachments iconpicker-items clearfix',
10
-
11
- initialize: function() {
12
- Attachments.prototype.initialize.apply( this, arguments );
13
-
14
- _.bindAll( this, 'scrollToSelected' );
15
- _.defer( this.scrollToSelected, this );
16
- this.controller.on( 'open', this.scrollToSelected, this );
17
- $( this.options.scrollElement ).off( 'scroll', this.scroll );
18
- },
19
-
20
- _addItem: function( model ) {
21
- this.views.add( this.createAttachmentView( model ), {
22
- at: this.collection.indexOf( model )
23
- });
24
- },
25
-
26
- _removeItem: function( model ) {
27
- var view = this._viewsByCid[ model.cid ];
28
- delete this._viewsByCid[ model.cid ];
29
-
30
- if ( view ) {
31
- view.remove();
32
- }
33
- },
34
-
35
- render: function() {
36
- _.each( this._viewsByCid, this._removeItem, this );
37
- this.collection.each( this._addItem, this );
38
-
39
- return this;
40
- },
41
-
42
- createAttachmentView: function( model ) {
43
- var view = new wp.media.view.IconPickerFontItem({
44
- controller: this.controller,
45
- model: model,
46
- collection: this.collection,
47
- selection: this.options.selection,
48
- baseType: this.options.baseType,
49
- type: this.options.type
50
- });
51
-
52
- return this._viewsByCid[ view.cid ] = view;
53
- },
54
-
55
- /**
56
- * Scroll to selected item
57
- */
58
- scrollToSelected: function() {
59
- var selected = this.options.selection.single(),
60
- singleView, distance;
61
-
62
- if ( ! selected ) {
63
- return;
64
- }
65
-
66
- singleView = this.getView( selected );
67
-
68
- if ( singleView && ! this.isInView( singleView.$el ) ) {
69
- distance = (
70
- singleView.$el.offset().top -
71
- parseInt( singleView.$el.css( 'paddingTop' ), 10 ) -
72
- this.$el.offset().top +
73
- this.$el.scrollTop() -
74
- parseInt( this.$el.css( 'paddingTop' ), 10 )
75
- );
76
-
77
- this.$el.scrollTop( distance );
78
- }
79
- },
80
-
81
- getView: function( model ) {
82
- return _.findWhere( this._viewsByCid, { model: model });
83
- },
84
-
85
- isInView: function( $elem ) {
86
- var docViewTop = this.$window.scrollTop(),
87
- docViewBottom = docViewTop + this.$window.height(),
88
- elemTop = $elem.offset().top,
89
- elemBottom = elemTop + $elem.height();
90
-
91
- return ( ( elemBottom <= docViewBottom ) && ( elemTop >= docViewTop ) );
92
- },
93
-
94
- prepare: function() {},
95
- ready: function() {},
96
- initSortable: function() {},
97
- scroll: function() {}
98
- });
99
-
100
- module.exports = IconPickerFontLibrary;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/views/frame.js DELETED
@@ -1,118 +0,0 @@
1
- /**
2
- * wp.media.view.MediaFrame.IconPicker
3
- *
4
- * A frame for selecting an icon.
5
- *
6
- * @class
7
- * @augments wp.media.view.MediaFrame.Select
8
- * @augments wp.media.view.MediaFrame
9
- * @augments wp.media.view.Frame
10
- * @augments wp.media.View
11
- * @augments wp.Backbone.View
12
- * @augments Backbone.View
13
- * @mixes wp.media.controller.StateMachine
14
- */
15
-
16
- var l10n = wp.media.view.l10n,
17
- Select = wp.media.view.MediaFrame.Select,
18
- IconPicker;
19
-
20
- IconPicker = Select.extend({
21
- initialize: function() {
22
- _.defaults( this.options, {
23
- title: l10n.iconPicker.frameTitle,
24
- multiple: false,
25
- ipTypes: iconPicker.types,
26
- target: null,
27
- SidebarView: null
28
- });
29
-
30
- if ( this.options.target instanceof wp.media.model.IconPickerTarget ) {
31
- this.target = this.options.target;
32
- } else {
33
- this.target = new wp.media.model.IconPickerTarget();
34
- }
35
-
36
- Select.prototype.initialize.apply( this, arguments );
37
- },
38
-
39
- createStates: function() {
40
- var Controller;
41
-
42
- _.each( this.options.ipTypes, function( props ) {
43
- if ( ! wp.media.controller.hasOwnProperty( 'IconPicker' + props.controller ) ) {
44
- return;
45
- }
46
-
47
- Controller = wp.media.controller[ 'IconPicker' + props.controller ];
48
-
49
- this.states.add( new Controller({
50
- id: props.id,
51
- content: props.id,
52
- title: props.name,
53
- data: props.data
54
- }) );
55
- }, this );
56
- },
57
-
58
- /**
59
- * Bind region mode event callbacks.
60
- */
61
- bindHandlers: function() {
62
- this.on( 'router:create:browse', this.createRouter, this );
63
- this.on( 'router:render:browse', this.browseRouter, this );
64
- this.on( 'content:render', this.ipRenderContent, this );
65
- this.on( 'toolbar:create:select', this.createSelectToolbar, this );
66
- this.on( 'open', this._ipSetState, this );
67
- this.on( 'select', this._ipUpdateTarget, this );
68
- },
69
-
70
- /**
71
- * Set state based on the target's icon type
72
- */
73
- _ipSetState: function() {
74
- var stateId = this.target.get( 'type' );
75
-
76
- if ( ! stateId || ! this.states.findWhere({ id: stateId }) ) {
77
- stateId = this.states.at( 0 ).id;
78
- }
79
-
80
- this.setState( stateId );
81
- },
82
-
83
- /**
84
- * Update target's attributes after selecting an icon
85
- */
86
- _ipUpdateTarget: function() {
87
- var state = this.state(),
88
- selected = state.get( 'selection' ).single(),
89
- props;
90
-
91
- props = {
92
- type: state.id,
93
- icon: selected.get( 'id' ),
94
- sizes: selected.get( 'sizes' ),
95
- url: state.ipGetIconUrl( selected )
96
- };
97
-
98
- this.target.set( props );
99
- },
100
-
101
- browseRouter: function( routerView ) {
102
- var routers = this.state().routers;
103
-
104
- if ( routers ) {
105
- routerView.set( routers );
106
- }
107
- },
108
-
109
- ipRenderContent: function() {
110
- var state = this.state(),
111
- mode = this.content.mode(),
112
- content = state.getContentView( mode );
113
-
114
- this.content.set( content );
115
- }
116
- });
117
-
118
- module.exports = IconPicker;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/views/img-browser.js DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * wp.media.view.IconPickerImgBrowser
3
- */
4
- var IconPickerImgBrowser = wp.media.view.AttachmentsBrowser.extend( wp.media.view.IconPickerBrowser );
5
-
6
- module.exports = IconPickerImgBrowser;
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/views/sidebar.js DELETED
@@ -1,29 +0,0 @@
1
- /**
2
- * wp.media.view.IconPickerSidebar
3
- */
4
- var IconPickerSidebar = wp.media.view.Sidebar.extend({
5
- initialize: function() {
6
- var selection = this.options.selection;
7
-
8
- wp.media.view.Sidebar.prototype.initialize.apply( this, arguments );
9
-
10
- selection.on( 'selection:single', this.createSingle, this );
11
- selection.on( 'selection:unsingle', this.disposeSingle, this );
12
-
13
- if ( selection.single() ) {
14
- this.createSingle();
15
- }
16
- },
17
-
18
- /**
19
- * @abstract
20
- */
21
- createSingle: function() {},
22
-
23
- /**
24
- * @abstract
25
- */
26
- disposeSingle: function() {}
27
- });
28
-
29
- module.exports = IconPickerSidebar;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/js/src/media/views/svg-item.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * wp.media.view.IconPickerSvgItem
3
- */
4
- var IconPickerSvgItem = wp.media.view.Attachment.Library.extend({
5
- template: wp.template( 'iconpicker-svg-item' )
6
- });
7
-
8
- module.exports = IconPickerSvgItem;
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/phpcs.ruleset.xml DELETED
@@ -1,17 +0,0 @@
1
- <?xml version="1.0"?>
2
- <ruleset name="Icon Picker Coding Standards">
3
- <config name="installed_paths" value="vendor/wp-coding-standards/wpcs" />
4
-
5
- <exclude-pattern>*/node_modules/*</exclude-pattern>
6
- <exclude-pattern>*/vendor/*</exclude-pattern>
7
-
8
- <rule ref="WordPress-VIP">
9
- <!-- ...Except for VIP-specific things -->
10
- <exclude name="WordPress.VIP.FileSystemWritesDisallow" />
11
- <exclude name="WordPress.VIP.RestrictedFunctions" />
12
- <exclude name="WordPress.VIP.RestrictedVariables" />
13
- <exclude name="WordPress.VIP.SuperGlobalInputUsage" />
14
- <exclude name="WordPress.VIP.ValidatedSanitizedInput" />
15
- <exclude name="WordPress.VIP.DirectDatabaseQuery" />
16
- </rule>
17
- </ruleset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/icon-picker/readme.md DELETED
@@ -1,85 +0,0 @@
1
- <!-- DO NOT EDIT THIS FILE; it is auto-generated from readme.txt -->
2
- # Icon Picker
3
-
4
- Pick an icon of your choice.
5
-
6
- **Contributors:** [kucrut](https://profiles.wordpress.org/kucrut)
7
- **Tags:** [icons](https://wordpress.org/plugins/tags/icons), [image](https://wordpress.org/plugins/tags/image), [svg](https://wordpress.org/plugins/tags/svg)
8
- **Requires at least:** 4.3
9
- **Tested up to:** 4.7.2
10
- **Stable tag:** 0.5.0
11
- **License:** [GPLv2](http://www.gnu.org/licenses/gpl-2.0.html)
12
- **Donate Link:** http://kucrut.org/#coffee
13
-
14
- [![Build Status](https://travis-ci.org/kucrut/wp-icon-picker.svg?branch=master)](https://travis-ci.org/kucrut/wp-icon-picker) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.svg)](http://gruntjs.com)
15
-
16
- ## Description ##
17
-
18
- An icon picker library plugin.
19
-
20
- ## Screenshots ##
21
-
22
- ### Icon selector
23
-
24
- ![Icon selector](assets/screenshot-1.png)
25
-
26
- ### Icon fields in a post meta box using [CMB](https://github.com/humanmade/Custom-Meta-Boxes/)
27
-
28
- ![Icon fields in a post meta box using [CMB](https://github.com/humanmade/Custom-Meta-Boxes/)](assets/screenshot-2.png)
29
-
30
- ## Frequently Asked Questions ##
31
-
32
- ### How do I use css file from CDN? ###
33
- You can use the `icon_picker_icon_type_stylesheet_uri` filter, eg:
34
- ```php
35
- /**
36
- * Load Font Awesome's CSS from CDN
37
- *
38
- * @param string $stylesheet_uri Icon type's stylesheet URI.
39
- * @param string $icon_type_id Icon type's ID.
40
- * @param Icon_Picker_Type_Font $icon_type Icon type's instance.
41
- *
42
- * @return string
43
- */
44
- function myprefix_font_awesome_css_from_cdn( $stylesheet_uri, $icon_type_id, $icon_type ) {
45
- if ( 'fa' === $icon_type_id ) {
46
- $stylesheet_uri = sprintf(
47
- 'https://maxcdn.bootstrapcdn.com/font-awesome/%s/css/font-awesome.min.css',
48
- $icon_type->version
49
- );
50
- }
51
-
52
- return $stylesheet_uri;
53
- }
54
- add_filter( 'icon_picker_icon_type_stylesheet_uri', 'myprefix_font_awesome_css_from_cdn', 10, 3 );
55
- ```
56
-
57
-
58
- ## Changelog ##
59
-
60
- ### 0.5.0 ###
61
- * Update Font Awesome to 4.7.0.
62
- * Switch to Webpack.
63
- * Various [bug fixes and enhancements](https://github.com/kucrut/wp-icon-picker/issues?q=is%3Aissue+milestone%3A0.5.0+is%3Aclosed).
64
-
65
- ### 0.4.1 ###
66
- * Improve support for CMB: Make the field usable in a repeatable field.
67
-
68
- ### 0.4.0 ###
69
- * Introduce `icon_picker_icon_type_stylesheet_uri` filter hook.
70
- * Font Awesome 4.6.1
71
-
72
- ### 0.3.0 ###
73
- * Fix CSS classname conflicts.
74
-
75
- ### 0.2.0 ###
76
- * Introduce `icon_picker_field()`.
77
- * Add support for [CMB](https://github.com/humanmade/Custom-Meta-Boxes/).
78
-
79
- ### 0.1.1 ###
80
- * Load translation, props [Eduardo Larequi](https://wordpress.org/support/profile/elarequi).
81
-
82
- ### 0.1.0 ###
83
- * Initial
84
-
85
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/menu-item-custom-fields/menu-item-custom-fields.php CHANGED
@@ -17,7 +17,7 @@
17
  * Text Domain: menu-item-custom-fields
18
  */
19
 
20
- if ( ! class_exists( 'Menu_Item_Custom_Fields' ) && ! version_compare( get_bloginfo( 'version' ), '5.4', '>=' ) ) :
21
  /**
22
  * Menu Item Custom Fields Loader
23
  */
17
  * Text Domain: menu-item-custom-fields
18
  */
19
 
20
+ if ( ! class_exists( 'Menu_Item_Custom_Fields' ) && ( function_exists('get_bloginfo') && ! version_compare( get_bloginfo( 'version' ), '5.4', '>=' ) ) ) :
21
  /**
22
  * Menu Item Custom Fields Loader
23
  */
vendor/codeinwp/menu-item-custom-fields/phpcs.ruleset.xml DELETED
@@ -1,18 +0,0 @@
1
- <?xml version="1.0"?>
2
- <ruleset name="Icon Picker Coding Standards">
3
- <config name="installed_paths" value="vendor/wp-coding-standards/wpcs" />
4
-
5
- <exclude-pattern>*/node_modules/*</exclude-pattern>
6
- <exclude-pattern>*/vendor/*</exclude-pattern>
7
-
8
- <rule ref="WordPress-VIP">
9
- <!-- ...Except for VIP-specific things -->
10
- <exclude name="Squiz.PHP.CommentedOutCode.Found" />
11
- <exclude name="WordPress.VIP.FileSystemWritesDisallow" />
12
- <exclude name="WordPress.VIP.RestrictedFunctions" />
13
- <exclude name="WordPress.VIP.RestrictedVariables" />
14
- <exclude name="WordPress.VIP.SuperGlobalInputUsage" />
15
- <exclude name="WordPress.VIP.ValidatedSanitizedInput" />
16
- <exclude name="WordPress.VIP.DirectDatabaseQuery" />
17
- </rule>
18
- </ruleset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/menu-item-custom-fields/readme.md DELETED
@@ -1,66 +0,0 @@
1
- <!-- DO NOT EDIT THIS FILE; it is auto-generated from readme.txt -->
2
- # Menu Item Custom Fields
3
-
4
- Easily add custom fields to nav menu items.
5
-
6
- **Contributors:** [kucrut](https://profiles.wordpress.org/kucrut)
7
- **Tags:** [menu](https://wordpress.org/plugins/tags/menu), [nav-menu](https://wordpress.org/plugins/tags/nav-menu), [custom-fields](https://wordpress.org/plugins/tags/custom-fields), [metadata](https://wordpress.org/plugins/tags/metadata)
8
- **Requires at least:** 3.8
9
- **Tested up to:** 4.7.2
10
- **Stable tag:** 1.0.0
11
- **License:** [GPLv2](http://www.gnu.org/licenses/gpl-2.0.html)
12
- **Donate Link:** https://www.paypal.me/kucrut
13
-
14
- [![Build Status](https://travis-ci.org/kucrut/wp-menu-item-custom-fields.svg?branch=master)](https://travis-ci.org/kucrut/wp-menu-item-custom-fields)
15
-
16
- ## Description ##
17
-
18
- ### Breaking Change ###
19
- Since version `1.0.0`, the first parameter passed to the `wp_nav_menu_item_custom_fields` is the menu item ID, instead of the nav menu ID. This should not have a big impact, since the nav menu ID passed was always `0` (not used by core).
20
-
21
- This is a *library* plugin. It doesn't do anything visible on its own. It was written to allow other plugins/themes to add custom fields to menu items *easily*. See **Installation**.
22
-
23
- Development of this plugin is done on [GitHub](https://github.com/kucrut/wp-menu-item-custom-fields). **Pull requests welcome**. Please see [issues reported](https://github.com/kucrut/wp-menu-item-custom-fields/issues) there before going to the plugin forum.
24
-
25
-
26
- ## Installation ##
27
-
28
- ### As regular plugin ###
29
- 1. Upload `menu-item-custom-fields` to the `/wp-content/plugins/` directory
30
- 1. Activate the plugin through the 'Plugins' menu in WordPress
31
-
32
- ### As library in your plugin/theme ###
33
- Simply copy `menu-item-custom-fields` to your plugin directory and require the main plugin file, eg:
34
- `
35
- require_once dirname( __FILE__ ) . '/menu-item-custom-fields/menu-item-custom-fields.php';
36
- `
37
-
38
- ### Usage ###
39
- Copy (and customize) and include the `menu-item-custom-fields-example.php` file found in the `doc/` directory of this plugin into your plugin/theme.
40
-
41
-
42
- ## Changelog ##
43
-
44
- ### 1.0.0 ###
45
- * Pass correct parameters to the `wp_nav_menu_item_custom_fields` hook, props [@helgatheviking](https://github.com/helgatheviking).
46
-
47
- ### 0.4.0 ###
48
- * Support WordPress 4.7, props [rahulnever2far](https://github.com/rahulnever2far).
49
-
50
- ### 0.3.0 ###
51
- * Use `wp_nav_menu_item_custom_fields` as walker hook. See this [blog post](http://shazdeh.me/2014/06/25/custom-fields-nav-menu-items/).
52
- * Update example plugin
53
-
54
- ### 0.2.1 ###
55
- * Update compatibility info
56
-
57
- ### 0.2.0 ###
58
- * Improve walker class loader
59
-
60
- ### 0.1.1 ###
61
- * Move custom fields up (before `<p.field-move />`)
62
-
63
- ### 0.1.0 ###
64
- * Initial public release
65
-
66
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/themeisle-sdk/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.20](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.19...v3.2.20) (2021-03-30)
2
+
3
+ add wp-config support
4
+
5
+ ##### [Version 3.2.19](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.18...v3.2.19) (2021-03-12)
6
+
7
+ * Adds compatibility with latest PHPCS coding standards.
8
+ * Adds compatibility with core auto-update.
9
+
10
+ ##### [Version 3.2.18](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.17...v3.2.18) (2021-03-04)
11
+
12
+ * Fix regression on rollback order
13
+
14
+ ##### [Version 3.2.17](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.16...v3.2.17) (2021-03-04)
15
+
16
+ * Fix compatibility with PHP 8 due to usort
17
+
18
+ ##### [Version 3.2.16](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.15...v3.2.16) (2020-11-17)
19
+
20
+ * Fix long texts on rollback.
21
+ * Fix RTL mode for uninstall feedback.
22
+
23
  ##### [Version 3.2.15](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.14...v3.2.15) (2020-07-23)
24
 
25
  * 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.20';
18
  $themeisle_sdk_path = dirname( __FILE__ );
19
 
20
  global $themeisle_sdk_max_version;
vendor/codeinwp/themeisle-sdk/src/Common/Abstract_module.php CHANGED
@@ -37,14 +37,14 @@ abstract class Abstract_Module {
37
  *
38
  * @return bool Should load module?
39
  */
40
- public abstract function can_load( $product );
41
 
42
  /**
43
  * Bootstrap the module.
44
  *
45
  * @param Product $product Product object.
46
  */
47
- public abstract function load( $product );
48
 
49
  /**
50
  * Check if the product is from partner.
@@ -63,4 +63,21 @@ abstract class Abstract_Module {
63
 
64
  return array_key_exists( $product->get_slug(), Module_Factory::$slugs );
65
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
37
  *
38
  * @return bool Should load module?
39
  */
40
+ abstract public function can_load( $product );
41
 
42
  /**
43
  * Bootstrap the module.
44
  *
45
  * @param Product $product Product object.
46
  */
47
+ abstract public function load( $product );
48
 
49
  /**
50
  * Check if the product is from partner.
63
 
64
  return array_key_exists( $product->get_slug(), Module_Factory::$slugs );
65
  }
66
+
67
+ /**
68
+ * Wrapper for wp_remote_get on VIP environments.
69
+ *
70
+ * @param string $url Url to check.
71
+ * @param array $args Option params.
72
+ *
73
+ * @return array|\WP_Error
74
+ */
75
+ public function safe_get( $url, $args = array() ) {
76
+ return function_exists( 'vip_safe_wp_remote_get' )
77
+ ? vip_safe_wp_remote_get( $url )
78
+ : wp_remote_get( //phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get, Already used.
79
+ $url,
80
+ $args
81
+ );
82
+ }
83
  }
vendor/codeinwp/themeisle-sdk/src/Common/Module_factory.php CHANGED
@@ -88,7 +88,7 @@ class Module_Factory {
88
  *
89
  * @var Abstract_Module $module_object Module instance.
90
  */
91
- $module_object = new $class( $product );
92
 
93
  if ( ! $module_object->can_load( $product ) ) {
94
  continue;
88
  *
89
  * @var Abstract_Module $module_object Module instance.
90
  */
91
+ $module_object = new $class( $product );
92
 
93
  if ( ! $module_object->can_load( $product ) ) {
94
  continue;
vendor/codeinwp/themeisle-sdk/src/Modules/Dashboard_widget.php CHANGED
@@ -96,7 +96,7 @@ class Dashboard_Widget extends Abstract_Module {
96
  *
97
  * @return string|void
98
  */
99
- function add_widget() {
100
  global $wp_meta_boxes;
101
  if ( isset( $wp_meta_boxes['dashboard']['normal']['core']['themeisle'] ) ) {
102
  return;
@@ -114,7 +114,7 @@ class Dashboard_Widget extends Abstract_Module {
114
  /**
115
  * Render widget content
116
  */
117
- function render_dashboard_widget() {
118
  $this->setup_feeds();
119
  if ( empty( $this->items ) || ! is_array( $this->items ) ) {
120
  return;
@@ -220,19 +220,21 @@ class Dashboard_Widget extends Abstract_Module {
220
  <li class="ti-dw-feed-item">
221
  <a href="
222
  <?php
223
- echo add_query_arg(
224
- array(
225
- 'utm_source' => 'wpadmin',
226
- 'utm_campaign' => 'feed',
227
- 'utm_medium' => 'dashboard_widget',
228
- ),
229
- $item['link']
 
 
230
  );
231
  ?>
232
  " target="_blank">
233
  <span class="ti-dw-date-container"><span
234
- class="ti-dw-day-container"><?php echo date( 'd', $item['date'] ); ?></span> <span
235
- class="ti-dw-month-container"><?php echo substr( date( 'M', $item['date'] ), 0, 3 ); ?></span></span><?php echo $item['title']; ?>
236
  </a>
237
  </li>
238
  <?php
@@ -275,26 +277,28 @@ class Dashboard_Widget extends Abstract_Module {
275
  ?>
276
  <div class="ti-dw-footer">
277
  <span class="ti-dw-recommend-item ">
278
- <span class="ti-dw-recommend"><?php echo apply_filters( 'themeisle_sdk_dashboard_popular_label', sprintf( 'Popular %s', ucwords( $type ) ) ); ?>
279
  : </span>
280
  <?php
281
- echo trim(
282
- str_replace(
283
- array(
284
- 'lite',
285
- 'Lite',
286
- '(Lite)',
287
- '(lite)',
288
- ),
289
- '',
290
- $recommend['name']
 
 
291
  )
292
  );
293
  ?>
294
  (<a class="thickbox open-plugin-details-modal"
295
- href="<?php echo $url . '&TB_iframe=true&width=600&height=500'; ?>"><?php echo apply_filters( 'themeisle_sdk_dashboard_install_label', 'Install' ); ?></a>)
296
  </span>
297
- <span class="ti-dw-powered-by"><span><?php echo apply_filters( 'themeisle_sdk_dashboard_widget_powered_by', esc_attr( sprintf( 'Powered by %s', $this->product->get_friendly_name() ) ) ); ?></span></span>
298
  </div>
299
 
300
  <?php
@@ -305,7 +309,7 @@ class Dashboard_Widget extends Abstract_Module {
305
  * Setup feed items.
306
  */
307
  private function setup_feeds() {
308
- if ( false === ( $items_normalized = get_transient( 'themeisle_sdk_feed_items' ) ) ) {
309
  // Load SimplePie Instance.
310
  $feed = fetch_feed( $this->feeds );
311
  // TODO report error when is an error loading the feed.
@@ -353,7 +357,7 @@ class Dashboard_Widget extends Abstract_Module {
353
  /**
354
  * Contact the API and fetch the recommended plugins/themes
355
  */
356
- function recommend_plugin_or_theme() {
357
  $products = $this->get_product_from_api();
358
  if ( ! is_array( $products ) ) {
359
  $products = array();
@@ -374,8 +378,8 @@ class Dashboard_Widget extends Abstract_Module {
374
  *
375
  * @return array|mixed The list of products to use in recomended section.
376
  */
377
- function get_product_from_api() {
378
- if ( false === ( $products = get_transient( 'themeisle_sdk_products' ) ) ) {
379
  $products = array();
380
  $all_themes = $this->get_themes_from_wporg( 'themeisle' );
381
  $all_plugins = $this->get_plugins_from_wporg( 'themeisle' );
@@ -429,8 +433,8 @@ class Dashboard_Widget extends Abstract_Module {
429
  *
430
  * @return array The list of themes.
431
  */
432
- function get_themes_from_wporg( $author ) {
433
- $products = wp_remote_get(
434
  'https://api.wordpress.org/themes/info/1.1/?action=query_themes&request[author]=' . $author . '&request[per_page]=30&request[fields][active_installs]=true'
435
  );
436
  $products = json_decode( wp_remote_retrieve_body( $products ) );
@@ -450,8 +454,8 @@ class Dashboard_Widget extends Abstract_Module {
450
  *
451
  * @return array The list of plugins for the selected author.
452
  */
453
- function get_plugins_from_wporg( $author ) {
454
- $products = wp_remote_get(
455
  'https://api.wordpress.org/plugins/info/1.1/?action=query_plugins&request[author]=' . $author . '&request[per_page]=40&request[fields][active_installs]=true'
456
  );
457
  $products = json_decode( wp_remote_retrieve_body( $products ) );
96
  *
97
  * @return string|void
98
  */
99
+ public function add_widget() {
100
  global $wp_meta_boxes;
101
  if ( isset( $wp_meta_boxes['dashboard']['normal']['core']['themeisle'] ) ) {
102
  return;
114
  /**
115
  * Render widget content
116
  */
117
+ public function render_dashboard_widget() {
118
  $this->setup_feeds();
119
  if ( empty( $this->items ) || ! is_array( $this->items ) ) {
120
  return;
220
  <li class="ti-dw-feed-item">
221
  <a href="
222
  <?php
223
+ echo esc_url(
224
+ add_query_arg(
225
+ array(
226
+ 'utm_source' => 'wpadmin',
227
+ 'utm_campaign' => 'feed',
228
+ 'utm_medium' => 'dashboard_widget',
229
+ ),
230
+ $item['link']
231
+ )
232
  );
233
  ?>
234
  " target="_blank">
235
  <span class="ti-dw-date-container"><span
236
+ class="ti-dw-day-container"><?php echo esc_attr( gmdate( 'd', $item['date'] ) ); ?></span> <span
237
+ class="ti-dw-month-container"><?php echo esc_attr( substr( gmdate( 'M', $item['date'] ), 0, 3 ) ); ?></span></span><?php echo esc_attr( $item['title'] ); ?>
238
  </a>
239
  </li>
240
  <?php
277
  ?>
278
  <div class="ti-dw-footer">
279
  <span class="ti-dw-recommend-item ">
280
+ <span class="ti-dw-recommend"><?php echo esc_attr( apply_filters( 'themeisle_sdk_dashboard_popular_label', sprintf( 'Popular %s', ucwords( $type ) ) ) ); ?>
281
  : </span>
282
  <?php
283
+ echo esc_attr(
284
+ trim(
285
+ str_replace(
286
+ array(
287
+ 'lite',
288
+ 'Lite',
289
+ '(Lite)',
290
+ '(lite)',
291
+ ),
292
+ '',
293
+ $recommend['name']
294
+ )
295
  )
296
  );
297
  ?>
298
  (<a class="thickbox open-plugin-details-modal"
299
+ href="<?php echo esc_url( $url . '&TB_iframe=true&width=600&height=500' ); ?>"><?php echo esc_attr( apply_filters( 'themeisle_sdk_dashboard_install_label', 'Install' ) ); ?></a>)
300
  </span>
301
+ <span class="ti-dw-powered-by"><span><?php echo esc_attr( apply_filters( 'themeisle_sdk_dashboard_widget_powered_by', sprintf( 'Powered by %s', $this->product->get_friendly_name() ) ) ); ?></span></span>
302
  </div>
303
 
304
  <?php
309
  * Setup feed items.
310
  */
311
  private function setup_feeds() {
312
+ if ( false === ( $items_normalized = get_transient( 'themeisle_sdk_feed_items' ) ) ) { //phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure
313
  // Load SimplePie Instance.
314
  $feed = fetch_feed( $this->feeds );
315
  // TODO report error when is an error loading the feed.
357
  /**
358
  * Contact the API and fetch the recommended plugins/themes
359
  */
360
+ public function recommend_plugin_or_theme() {
361
  $products = $this->get_product_from_api();
362
  if ( ! is_array( $products ) ) {
363
  $products = array();
378
  *
379
  * @return array|mixed The list of products to use in recomended section.
380
  */
381
+ public function get_product_from_api() {
382
+ if ( false === ( $products = get_transient( 'themeisle_sdk_products' ) ) ) { //phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure
383
  $products = array();
384
  $all_themes = $this->get_themes_from_wporg( 'themeisle' );
385
  $all_plugins = $this->get_plugins_from_wporg( 'themeisle' );
433
  *
434
  * @return array The list of themes.
435
  */
436
+ public function get_themes_from_wporg( $author ) {
437
+ $products = $this->safe_get(
438
  'https://api.wordpress.org/themes/info/1.1/?action=query_themes&request[author]=' . $author . '&request[per_page]=30&request[fields][active_installs]=true'
439
  );
440
  $products = json_decode( wp_remote_retrieve_body( $products ) );
454
  *
455
  * @return array The list of plugins for the selected author.
456
  */
457
+ public function get_plugins_from_wporg( $author ) {
458
+ $products = $this->safe_get(
459
  'https://api.wordpress.org/plugins/info/1.1/?action=query_plugins&request[author]=' . $author . '&request[per_page]=40&request[fields][active_installs]=true'
460
  );
461
  $products = json_decode( wp_remote_retrieve_body( $products ) );
vendor/codeinwp/themeisle-sdk/src/Modules/Licenser.php CHANGED
@@ -62,6 +62,12 @@ class Licenser extends Abstract_Module {
62
  * @var null Local license object.
63
  */
64
  private $license_local = null;
 
 
 
 
 
 
65
 
66
  /**
67
  * Disable wporg updates for premium products.
@@ -71,7 +77,7 @@ class Licenser extends Abstract_Module {
71
  *
72
  * @return mixed List of themes to check for update.
73
  */
74
- function disable_wporg_update( $r, $url ) {
75
 
76
  if ( 0 !== strpos( $url, 'https://api.wordpress.org/themes/update-check/' ) ) {
77
  return $r;
@@ -83,7 +89,7 @@ class Licenser extends Abstract_Module {
83
  unset( $themes->themes->{$this->product->get_slug()} );
84
 
85
  // Encode the updated JSON response.
86
- $r['body']['themes'] = json_encode( $themes );
87
 
88
  return $r;
89
  }
@@ -172,18 +178,18 @@ class Licenser extends Abstract_Module {
172
  <?php
173
  echo sprintf(
174
  '<p>%s<input class="themeisle-sdk-license-input %s" type="text" id="%s_license" name="%s_license" value="%s" /><a class="%s">%s</a>&nbsp;&nbsp;&nbsp;<button name="%s_btn_trigger" class="button button-primary themeisle-sdk-licenser-button-cta" value="yes" type="submit" >%s</button></p><p class="description">%s</p>%s',
175
- ( ( 'valid' === $status ) ? sprintf( '<input type="hidden" value="%s" name="%s_license" />', $value, $this->product->get_key() ) : '' ),
176
  ( ( 'valid' === $status ) ? 'themeisle-sdk-text-input-valid' : '' ),
177
- $this->product->get_key(),
178
- ( ( 'valid' === $status ) ? $this->product->get_key() . '_mask' : $this->product->get_key() ),
179
- ( ( 'valid' === $status ) ? ( str_repeat( '*', 30 ) . substr( $value, - 5 ) ) : $value ),
180
- ( 'valid' === $status ? 'themeisle-sdk-license-deactivate-cta' : 'themeisle-sdk-license-activate-cta' ),
181
- ( 'valid' === $status ? $valid_string : $invalid_string ),
182
- $this->product->get_key(),
183
- ( 'valid' === $status ? $deactivate_string : $activate_string ),
184
- sprintf( $license_message, '<a href="' . $this->get_api_url() . '">' . $this->get_distributor_name() . '</a> ', $this->product->get_type() ),
185
- empty( $error_message ) ? '' : sprintf( '<p style="color:#dd3d36">%s</p>', $error_message )
186
- );
187
 
188
  }
189
 
@@ -210,17 +216,12 @@ class Licenser extends Abstract_Module {
210
  }
211
 
212
  /**
213
- * License price id.
214
  *
215
- * @return int License plan.
216
  */
217
- public function get_plan() {
218
- $license_data = get_option( $this->product->get_key() . '_license_data', '' );
219
- if ( ! isset( $license_data->price_id ) ) {
220
- return -1;
221
- }
222
-
223
- return (int) $license_data->price_id;
224
  }
225
 
226
  /**
@@ -249,12 +250,26 @@ class Licenser extends Abstract_Module {
249
  return $this->product->get_store_name();
250
  }
251
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  /**
253
  * Show the admin notice regarding the license status.
254
  *
255
  * @return bool Should we show the notice ?
256
  */
257
- function show_notice() {
258
  if ( ! is_admin() ) {
259
  return false;
260
  }
@@ -274,10 +289,10 @@ class Licenser extends Abstract_Module {
274
  <p><strong>
275
  <?php
276
  echo sprintf(
277
- $no_activations_string,
278
- $this->product->get_name(),
279
- $this->product->get_name(),
280
- '<a href="' . $this->get_api_url() . '" target="_blank">' . $this->get_distributor_name() . '</a>'
281
  );
282
  ?>
283
  </strong>
@@ -292,7 +307,7 @@ class Licenser extends Abstract_Module {
292
  ?>
293
  <div class="error">
294
  <p>
295
- <strong><?php echo sprintf( $expired_license_string, $this->product->get_name() . ' ' . $this->product->get_type(), $this->get_api_url() . '?license=' . $this->license_key ); ?> </strong>
296
  </p>
297
  </div>
298
  <?php
@@ -304,7 +319,7 @@ class Licenser extends Abstract_Module {
304
  ?>
305
  <div class="error">
306
  <p>
307
- <strong><?php echo sprintf( $no_valid_string, $this->product->get_name() . ' ' . $this->product->get_type(), $this->get_api_url(), admin_url( 'options-general.php' ) . '#' . $this->product->get_key() . '_license' ); ?> </strong>
308
  </p>
309
  </div>
310
  <?php
@@ -335,7 +350,7 @@ class Licenser extends Abstract_Module {
335
  *
336
  * @return bool
337
  */
338
- function check_expiration() {
339
  $license_data = get_option( $this->product->get_key() . '_license_data', '' );
340
  if ( '' === $license_data ) {
341
  return false;
@@ -355,7 +370,7 @@ class Licenser extends Abstract_Module {
355
  *
356
  * @return string The renew url.
357
  */
358
- function renew_url() {
359
  $license_data = get_option( $this->product->get_key() . '_license_data', '' );
360
  if ( '' === $license_data ) {
361
  return $this->get_api_url();
@@ -371,7 +386,7 @@ class Licenser extends Abstract_Module {
371
  * Run the license check call.
372
  */
373
  public function product_valid() {
374
- if ( false !== ( $license = get_transient( $this->product->get_key() . '_license_data' ) ) ) {
375
  return;
376
  }
377
  $license = $this->check_license();
@@ -423,42 +438,6 @@ class Licenser extends Abstract_Module {
423
 
424
  }
425
 
426
- /**
427
- * Increment the failed checks.
428
- */
429
- private function increment_failed_checks() {
430
- $this->failed_checks ++;
431
- update_option( $this->product->get_key() . '_failed_checks', $this->failed_checks );
432
- }
433
-
434
- /**
435
- * Reset the failed checks
436
- */
437
- private function reset_failed_checks() {
438
- $this->failed_checks = 1;
439
- update_option( $this->product->get_key() . '_failed_checks', $this->failed_checks );
440
- }
441
-
442
- /**
443
- * Set license validation error message.
444
- *
445
- * @param string $message Error message.
446
- */
447
- public function set_error( $message = '' ) {
448
- set_transient( $this->product->get_key() . 'act_err', $message, MINUTE_IN_SECONDS );
449
-
450
- return;
451
- }
452
-
453
- /**
454
- * Return the last error message.
455
- *
456
- * @return mixed Error message.
457
- */
458
- public function get_error() {
459
- return get_transient( $this->product->get_key() . 'act_err' );
460
- }
461
-
462
  /**
463
  * Do license activation/deactivation.
464
  *
@@ -486,7 +465,7 @@ class Licenser extends Abstract_Module {
486
 
487
  // Call the custom API.
488
  if ( 'check' === $action ) {
489
- $response = wp_remote_get( sprintf( '%slicense/check/%s/%s/%s/%s', Product::API_URL, rawurlencode( $this->product->get_name() ), $license, rawurlencode( home_url() ), Loader::get_cache_token() ) );
490
  } else {
491
  $response = wp_remote_post(
492
  sprintf( '%slicense/%s/%s/%s', Product::API_URL, $action, rawurlencode( $this->product->get_name() ), $license ),
@@ -550,15 +529,42 @@ class Licenser extends Abstract_Module {
550
  return true;
551
  }
552
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
553
  /**
554
  * Activate the license remotely.
555
  */
556
- function process_license() {
557
  // listen for our activate button to be clicked.
558
  if ( ! isset( $_POST[ $this->product->get_key() . '_btn_trigger' ] ) ) {
559
  return;
560
  }
561
- $license = $_POST[ $this->product->get_key() . '_license' ];
 
 
 
 
 
 
 
 
 
 
 
562
  $response = $this->do_license_process( $license, 'toggle' );
563
  if ( is_wp_error( $response ) ) {
564
  $this->set_error( $response->get_error_message() );
@@ -568,14 +574,22 @@ class Licenser extends Abstract_Module {
568
  if ( true === $response ) {
569
  $this->set_error( '' );
570
  }
 
 
 
 
 
 
 
 
 
571
 
572
- return;
573
  }
574
 
575
  /**
576
  * Load the Themes screen.
577
  */
578
- function load_themes_screen() {
579
  add_thickbox();
580
  add_action( 'admin_notices', array( &$this, 'update_nag' ) );
581
  }
@@ -583,7 +597,7 @@ class Licenser extends Abstract_Module {
583
  /**
584
  * Alter the nag for themes update.
585
  */
586
- function update_nag() {
587
  $theme = wp_get_theme( $this->product->get_slug() );
588
  $api_response = get_transient( $this->product_key );
589
  if ( false === $api_response || ! isset( $api_response->new_version ) ) {
@@ -596,16 +610,16 @@ class Licenser extends Abstract_Module {
596
  echo '<div id="update-nag">';
597
  printf(
598
  '<strong>%1$s %2$s</strong> is available. <a href="%3$s" class="thickbox" title="%4s">Check out what\'s new</a> or <a href="%5$s"%6$s>update now</a>.',
599
- $theme->get( 'Name' ),
600
- $api_response->new_version,
601
- sprintf( '%s&TB_iframe=true&amp;width=1024&amp;height=800', $this->product->get_changelog() ),
602
- $theme->get( 'Name' ),
603
- $update_url,
604
- $update_onclick
605
  );
606
  echo '</div>';
607
- echo '<div id="' . $this->product->get_slug() . '_' . 'changelog" style="display:none;">';
608
- echo wpautop( $api_response->sections['changelog'] );
609
  echo '</div>';
610
  }
611
  }
@@ -617,7 +631,7 @@ class Licenser extends Abstract_Module {
617
  *
618
  * @return mixed
619
  */
620
- function theme_update_transient( $value ) {
621
  $update_data = $this->check_for_update();
622
  if ( $update_data ) {
623
  $value->response[ $this->product->get_slug() ] = $update_data;
@@ -631,7 +645,7 @@ class Licenser extends Abstract_Module {
631
  *
632
  * @return array|bool Either the update data or false in case of failure.
633
  */
634
- function check_for_update() {
635
  $update_data = get_transient( $this->product_key );
636
 
637
  if ( false === $update_data ) {
@@ -669,7 +683,7 @@ class Licenser extends Abstract_Module {
669
  */
670
  private function get_version_data() {
671
 
672
- $response = wp_remote_get(
673
  sprintf(
674
  '%slicense/version/%s/%s/%s/%s',
675
  Product::API_URL,
@@ -679,7 +693,7 @@ class Licenser extends Abstract_Module {
679
  rawurlencode( home_url() )
680
  ),
681
  array(
682
- 'timeout' => 15,
683
  'sslverify' => false,
684
  )
685
  );
@@ -706,8 +720,8 @@ class Licenser extends Abstract_Module {
706
  /**
707
  * Delete the update transient
708
  */
709
- function delete_theme_update_transient() {
710
- delete_transient( $this->product_key );
711
  }
712
 
713
  /**
@@ -727,6 +741,8 @@ class Licenser extends Abstract_Module {
727
  if ( false !== $api_response && is_object( $api_response ) && isset( $api_response->new_version ) ) {
728
  if ( version_compare( $this->product->get_version(), $api_response->new_version, '<' ) ) {
729
  $_transient_data->response[ $this->product->get_slug() . '/' . $this->product->get_file() ] = $api_response;
 
 
730
  }
731
  }
732
 
@@ -782,7 +798,7 @@ class Licenser extends Abstract_Module {
782
  *
783
  * @return array $array
784
  */
785
- function http_request_args( $args, $url ) {
786
  // If it is an https request and we are performing a package download, disable ssl verification.
787
  if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
788
  $args['sslverify'] = false;
@@ -829,6 +845,7 @@ class Licenser extends Abstract_Module {
829
  $namespace = apply_filters( 'themesle_sdk_namespace_' . md5( $product->get_basefile() ), false );
830
 
831
  if ( false !== $namespace ) {
 
832
  add_filter( 'themeisle_sdk_license_process_' . $namespace, [ $this, 'do_license_process' ], 10, 2 );
833
  add_filter( 'product_' . $namespace . '_license_status', [ $this, 'get_license_status' ], PHP_INT_MAX );
834
  add_filter( 'product_' . $namespace . '_license_key', [ $this->product, 'get_license' ] );
@@ -850,17 +867,17 @@ class Licenser extends Abstract_Module {
850
  ]
851
  );
852
  add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
853
- add_filter( 'http_request_args', array( $this, 'http_request_args' ), 10, 2 );
854
 
855
  return $this;
856
  }
857
  if ( $this->product->is_theme() ) {
858
  add_filter( 'site_transient_update_themes', array( &$this, 'theme_update_transient' ) );
859
- add_filter( 'delete_site_transient_update_themes', array( &$this, 'delete_theme_update_transient' ) );
860
  add_action( 'load-update-core.php', array( &$this, 'delete_theme_update_transient' ) );
861
  add_action( 'load-themes.php', array( &$this, 'delete_theme_update_transient' ) );
862
  add_action( 'load-themes.php', array( &$this, 'load_themes_screen' ) );
863
- add_filter( 'http_request_args', array( $this, 'disable_wporg_update' ), 5, 2 );
864
 
865
  return $this;
866
 
@@ -870,42 +887,74 @@ class Licenser extends Abstract_Module {
870
  }
871
 
872
  /**
873
- * Run license activation on plugin activate.
874
  */
875
- public function auto_activate() {
876
- if ( ! current_user_can( 'switch_themes' ) ) {
877
- return;
878
- }
879
- $status = $this->get_license_status();
880
- if ( 'not_active' !== $status ) {
881
- return;
882
- }
 
 
 
 
 
 
883
 
884
  $license_file = dirname( $this->product->get_basefile() ) . '/license.json';
885
 
886
  global $wp_filesystem;
887
  if ( ! is_file( $license_file ) ) {
888
- return;
889
  }
890
 
891
- require_once( ABSPATH . '/wp-admin/includes/file.php' );
892
  \WP_Filesystem();
893
  $content = json_decode( $wp_filesystem->get_contents( $license_file ) );
894
  if ( ! is_object( $content ) ) {
895
- return;
896
  }
897
  if ( ! isset( $content->key ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
898
  return;
899
  }
900
- $this->license_local = $content;
 
 
901
  $lock_key = $this->product->get_key() . '_autoactivated';
902
 
903
  if ( 'yes' === get_option( $lock_key, '' ) ) {
904
  return;
905
  }
906
- $response = $this->do_license_process( $content->key, 'activate' );
 
 
 
907
 
908
- update_option( $lock_key, 'yes' );
909
 
910
  if ( apply_filters( $this->product->get_key() . '_hide_license_notices', false ) ) {
911
  return;
@@ -922,7 +971,7 @@ class Licenser extends Abstract_Module {
922
  public function autoactivate_notice() {
923
  ?>
924
  <div class="notice notice-success is-dismissible">
925
- <p><?php echo sprintf( '<strong>%s</strong> has been successfully activated using <strong>%s</strong> license !', $this->product->get_name(), str_repeat( '*', 20 ) . substr( $this->license_local->key, - 10 ) ); ?></p>
926
  </div>
927
  <?php
928
  }
@@ -989,15 +1038,4 @@ class Licenser extends Abstract_Module {
989
 
990
  \WP_CLI::halt( 1 );
991
  }
992
-
993
- /**
994
- * Register license fields for the products.
995
- */
996
- public function register_license_hooks() {
997
- add_action( 'admin_init', array( $this, 'register_settings' ) );
998
- add_action( 'admin_init', array( $this, 'process_license' ) );
999
- add_action( 'admin_init', array( $this, 'product_valid' ), 99999999 );
1000
- add_action( 'admin_notices', array( $this, 'show_notice' ) );
1001
- add_filter( $this->product->get_key() . '_license_status', array( $this, 'get_license_status' ) );
1002
- }
1003
  }
62
  * @var null Local license object.
63
  */
64
  private $license_local = null;
65
+ /**
66
+ * Product namespace, used for fixed name filters/cli commands.
67
+ *
68
+ * @var string $namespace Product namespace.
69
+ */
70
+ private $namespace = null;
71
 
72
  /**
73
  * Disable wporg updates for premium products.
77
  *
78
  * @return mixed List of themes to check for update.
79
  */
80
+ public function disable_wporg_update( $r, $url ) {
81
 
82
  if ( 0 !== strpos( $url, 'https://api.wordpress.org/themes/update-check/' ) ) {
83
  return $r;
89
  unset( $themes->themes->{$this->product->get_slug()} );
90
 
91
  // Encode the updated JSON response.
92
+ $r['body']['themes'] = wp_json_encode( $themes );
93
 
94
  return $r;
95
  }
178
  <?php
179
  echo sprintf(
180
  '<p>%s<input class="themeisle-sdk-license-input %s" type="text" id="%s_license" name="%s_license" value="%s" /><a class="%s">%s</a>&nbsp;&nbsp;&nbsp;<button name="%s_btn_trigger" class="button button-primary themeisle-sdk-licenser-button-cta" value="yes" type="submit" >%s</button></p><p class="description">%s</p>%s',
181
+ ( ( 'valid' === $status ) ? sprintf( '<input type="hidden" value="%s" name="%s_license" />', esc_attr( $value ), esc_attr( $this->product->get_key() ) ) : '' ),
182
  ( ( 'valid' === $status ) ? 'themeisle-sdk-text-input-valid' : '' ),
183
+ esc_attr( $this->product->get_key() ),
184
+ esc_attr( ( ( 'valid' === $status ) ? $this->product->get_key() . '_mask' : $this->product->get_key() ) ),
185
+ esc_attr( ( ( 'valid' === $status ) ? ( str_repeat( '*', 30 ) . substr( $value, - 5 ) ) : $value ) ),
186
+ esc_attr( ( 'valid' === $status ? 'themeisle-sdk-license-deactivate-cta' : 'themeisle-sdk-license-activate-cta' ) ),
187
+ esc_attr( 'valid' === $status ? $valid_string : $invalid_string ),
188
+ esc_attr( $this->product->get_key() ),
189
+ esc_attr( 'valid' === $status ? $deactivate_string : $activate_string ),
190
+ sprintf( wp_kses_data( $license_message ), '<a href="' . esc_url( $this->get_api_url() ) . '">' . esc_attr( $this->get_distributor_name() ) . '</a> ', esc_attr( $this->product->get_type() ) ),
191
+ wp_kses_data( empty( $error_message ) ? '' : sprintf( '<p style="color:#dd3d36">%s</p>', ( $error_message ) ) )
192
+ ) . wp_nonce_field( $this->product->get_key() . 'nonce', $this->product->get_key() . 'nonce_field', false, false );//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
193
 
194
  }
195
 
216
  }
217
 
218
  /**
219
+ * Return the last error message.
220
  *
221
+ * @return mixed Error message.
222
  */
223
+ public function get_error() {
224
+ return get_transient( $this->product->get_key() . 'act_err' );
 
 
 
 
 
225
  }
226
 
227
  /**
250
  return $this->product->get_store_name();
251
  }
252
 
253
+ /**
254
+ * License price id.
255
+ *
256
+ * @return int License plan.
257
+ */
258
+ public function get_plan() {
259
+ $license_data = get_option( $this->product->get_key() . '_license_data', '' );
260
+ if ( ! isset( $license_data->price_id ) ) {
261
+ return - 1;
262
+ }
263
+
264
+ return (int) $license_data->price_id;
265
+ }
266
+
267
  /**
268
  * Show the admin notice regarding the license status.
269
  *
270
  * @return bool Should we show the notice ?
271
  */
272
+ public function show_notice() {
273
  if ( ! is_admin() ) {
274
  return false;
275
  }
289
  <p><strong>
290
  <?php
291
  echo sprintf(
292
+ wp_kses_data( $no_activations_string ),
293
+ esc_attr( $this->product->get_name() ),
294
+ esc_attr( $this->product->get_name() ),
295
+ '<a href="' . esc_url( $this->get_api_url() ) . '" target="_blank">' . esc_attr( $this->get_distributor_name() ) . '</a>'
296
  );
297
  ?>
298
  </strong>
307
  ?>
308
  <div class="error">
309
  <p>
310
+ <strong><?php echo sprintf( wp_kses_data( $expired_license_string ), esc_attr( $this->product->get_name() . ' ' . $this->product->get_type() ), esc_url( $this->get_api_url() . '?license=' . $this->license_key ) ); ?> </strong>
311
  </p>
312
  </div>
313
  <?php
319
  ?>
320
  <div class="error">
321
  <p>
322
+ <strong><?php echo sprintf( wp_kses_data( $no_valid_string ), esc_attr( $this->product->get_name() . ' ' . $this->product->get_type() ), esc_url( $this->get_api_url() ), esc_url( admin_url( 'options-general.php' ) . '#' . $this->product->get_key() . '_license' ) ); ?> </strong>
323
  </p>
324
  </div>
325
  <?php
350
  *
351
  * @return bool
352
  */
353
+ public function check_expiration() {
354
  $license_data = get_option( $this->product->get_key() . '_license_data', '' );
355
  if ( '' === $license_data ) {
356
  return false;
370
  *
371
  * @return string The renew url.
372
  */
373
+ public function renew_url() {
374
  $license_data = get_option( $this->product->get_key() . '_license_data', '' );
375
  if ( '' === $license_data ) {
376
  return $this->get_api_url();
386
  * Run the license check call.
387
  */
388
  public function product_valid() {
389
+ if ( false !== ( $license = get_transient( $this->product->get_key() . '_license_data' ) ) ) { //phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure
390
  return;
391
  }
392
  $license = $this->check_license();
438
 
439
  }
440
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
441
  /**
442
  * Do license activation/deactivation.
443
  *
465
 
466
  // Call the custom API.
467
  if ( 'check' === $action ) {
468
+ $response = $this->safe_get( sprintf( '%slicense/check/%s/%s/%s/%s', Product::API_URL, rawurlencode( $this->product->get_name() ), $license, rawurlencode( home_url() ), Loader::get_cache_token() ) );
469
  } else {
470
  $response = wp_remote_post(
471
  sprintf( '%slicense/%s/%s/%s', Product::API_URL, $action, rawurlencode( $this->product->get_name() ), $license ),
529
  return true;
530
  }
531
 
532
+ /**
533
+ * Reset the failed checks
534
+ */
535
+ private function reset_failed_checks() {
536
+ $this->failed_checks = 1;
537
+ update_option( $this->product->get_key() . '_failed_checks', $this->failed_checks );
538
+ }
539
+
540
+ /**
541
+ * Increment the failed checks.
542
+ */
543
+ private function increment_failed_checks() {
544
+ $this->failed_checks ++;
545
+ update_option( $this->product->get_key() . '_failed_checks', $this->failed_checks );
546
+ }
547
+
548
  /**
549
  * Activate the license remotely.
550
  */
551
+ public function process_license() {
552
  // listen for our activate button to be clicked.
553
  if ( ! isset( $_POST[ $this->product->get_key() . '_btn_trigger' ] ) ) {
554
  return;
555
  }
556
+ if ( ! isset( $_POST[ $this->product->get_key() . 'nonce_field' ] )
557
+ || ! wp_verify_nonce( $_POST[ $this->product->get_key() . 'nonce_field' ], $this->product->get_key() . 'nonce' ) //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
558
+ ) {
559
+ return;
560
+ }
561
+ if ( ! current_user_can( 'manage_options' ) ) {
562
+ return;
563
+ }
564
+ $license = isset( $_POST[ $this->product->get_key() . '_license' ] )
565
+ ? sanitize_text_field( $_POST[ $this->product->get_key() . '_license' ] )
566
+ : '';
567
+
568
  $response = $this->do_license_process( $license, 'toggle' );
569
  if ( is_wp_error( $response ) ) {
570
  $this->set_error( $response->get_error_message() );
574
  if ( true === $response ) {
575
  $this->set_error( '' );
576
  }
577
+ }
578
+
579
+ /**
580
+ * Set license validation error message.
581
+ *
582
+ * @param string $message Error message.
583
+ */
584
+ public function set_error( $message = '' ) {
585
+ set_transient( $this->product->get_key() . 'act_err', $message, MINUTE_IN_SECONDS );
586
 
 
587
  }
588
 
589
  /**
590
  * Load the Themes screen.
591
  */
592
+ public function load_themes_screen() {
593
  add_thickbox();
594
  add_action( 'admin_notices', array( &$this, 'update_nag' ) );
595
  }
597
  /**
598
  * Alter the nag for themes update.
599
  */
600
+ public function update_nag() {
601
  $theme = wp_get_theme( $this->product->get_slug() );
602
  $api_response = get_transient( $this->product_key );
603
  if ( false === $api_response || ! isset( $api_response->new_version ) ) {
610
  echo '<div id="update-nag">';
611
  printf(
612
  '<strong>%1$s %2$s</strong> is available. <a href="%3$s" class="thickbox" title="%4s">Check out what\'s new</a> or <a href="%5$s"%6$s>update now</a>.',
613
+ esc_attr( $theme->get( 'Name' ) ),
614
+ esc_attr( $api_response->new_version ),
615
+ esc_url( sprintf( '%s&TB_iframe=true&amp;width=1024&amp;height=800', $this->product->get_changelog() ) ),
616
+ esc_attr( $theme->get( 'Name' ) ),
617
+ esc_url( $update_url ),
618
+ $update_onclick // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, Already escaped.
619
  );
620
  echo '</div>';
621
+ echo '<div id="' . esc_attr( $this->product->get_slug() ) . '_changelog" style="display:none;">';
622
+ echo wp_kses_data( wpautop( $api_response->sections['changelog'] ) );
623
  echo '</div>';
624
  }
625
  }
631
  *
632
  * @return mixed
633
  */
634
+ public function theme_update_transient( $value ) {
635
  $update_data = $this->check_for_update();
636
  if ( $update_data ) {
637
  $value->response[ $this->product->get_slug() ] = $update_data;
645
  *
646
  * @return array|bool Either the update data or false in case of failure.
647
  */
648
+ public function check_for_update() {
649
  $update_data = get_transient( $this->product_key );
650
 
651
  if ( false === $update_data ) {
683
  */
684
  private function get_version_data() {
685
 
686
+ $response = $this->safe_get(
687
  sprintf(
688
  '%slicense/version/%s/%s/%s/%s',
689
  Product::API_URL,
693
  rawurlencode( home_url() )
694
  ),
695
  array(
696
+ 'timeout' => 15, //phpcs:ignore WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout, Inherited by wp_remote_get only, for vip environment we use defaults.
697
  'sslverify' => false,
698
  )
699
  );
720
  /**
721
  * Delete the update transient
722
  */
723
+ public function delete_theme_update_transient() {
724
+ return delete_transient( $this->product_key );
725
  }
726
 
727
  /**
741
  if ( false !== $api_response && is_object( $api_response ) && isset( $api_response->new_version ) ) {
742
  if ( version_compare( $this->product->get_version(), $api_response->new_version, '<' ) ) {
743
  $_transient_data->response[ $this->product->get_slug() . '/' . $this->product->get_file() ] = $api_response;
744
+ } else {
745
+ $_transient_data->no_update[ $this->product->get_slug() . '/' . $this->product->get_file() ] = $api_response;
746
  }
747
  }
748
 
798
  *
799
  * @return array $array
800
  */
801
+ public function http_request_args( $args, $url ) {
802
  // If it is an https request and we are performing a package download, disable ssl verification.
803
  if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
804
  $args['sslverify'] = false;
845
  $namespace = apply_filters( 'themesle_sdk_namespace_' . md5( $product->get_basefile() ), false );
846
 
847
  if ( false !== $namespace ) {
848
+ $this->namespace = $namespace;
849
  add_filter( 'themeisle_sdk_license_process_' . $namespace, [ $this, 'do_license_process' ], 10, 2 );
850
  add_filter( 'product_' . $namespace . '_license_status', [ $this, 'get_license_status' ], PHP_INT_MAX );
851
  add_filter( 'product_' . $namespace . '_license_key', [ $this->product, 'get_license' ] );
867
  ]
868
  );
869
  add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
870
+ add_filter( 'http_request_args', array( $this, 'http_request_args' ), 10, 2 ); //phpcs:ignore WordPressVIPMinimum.Hooks.RestrictedHooks.http_request_args
871
 
872
  return $this;
873
  }
874
  if ( $this->product->is_theme() ) {
875
  add_filter( 'site_transient_update_themes', array( &$this, 'theme_update_transient' ) );
876
+ add_action( 'delete_site_transient_update_themes', array( &$this, 'delete_theme_update_transient' ) );
877
  add_action( 'load-update-core.php', array( &$this, 'delete_theme_update_transient' ) );
878
  add_action( 'load-themes.php', array( &$this, 'delete_theme_update_transient' ) );
879
  add_action( 'load-themes.php', array( &$this, 'load_themes_screen' ) );
880
+ add_filter( 'http_request_args', array( $this, 'disable_wporg_update' ), 5, 2 ); //phpcs:ignore WordPressVIPMinimum.Hooks.RestrictedHooks.http_request_args
881
 
882
  return $this;
883
 
887
  }
888
 
889
  /**
890
+ * Register license fields for the products.
891
  */
892
+ public function register_license_hooks() {
893
+ add_action( 'admin_init', array( $this, 'register_settings' ) );
894
+ add_action( 'admin_init', array( $this, 'process_license' ) );
895
+ add_action( 'admin_init', array( $this, 'product_valid' ), 99999999 );
896
+ add_action( 'admin_notices', array( $this, 'show_notice' ) );
897
+ add_filter( $this->product->get_key() . '_license_status', array( $this, 'get_license_status' ) );
898
+ }
899
+
900
+ /**
901
+ * Check license on filesystem.
902
+ *
903
+ * @return mixed License key.
904
+ */
905
+ public function get_file_license() {
906
 
907
  $license_file = dirname( $this->product->get_basefile() ) . '/license.json';
908
 
909
  global $wp_filesystem;
910
  if ( ! is_file( $license_file ) ) {
911
+ return false;
912
  }
913
 
914
+ require_once ABSPATH . '/wp-admin/includes/file.php';
915
  \WP_Filesystem();
916
  $content = json_decode( $wp_filesystem->get_contents( $license_file ) );
917
  if ( ! is_object( $content ) ) {
918
+ return false;
919
  }
920
  if ( ! isset( $content->key ) ) {
921
+ return false;
922
+ }
923
+ return $content->key;
924
+ }
925
+ /**
926
+ * Run license activation on plugin activate.
927
+ */
928
+ public function auto_activate() {
929
+ $status = $this->get_license_status();
930
+ if ( 'not_active' !== $status ) {
931
+ return false;
932
+ }
933
+
934
+ if ( ! empty( $this->namespace ) ) {
935
+ $license_key = apply_filters( 'product_' . $this->namespace . '_license_key_constant', '' );
936
+ }
937
+
938
+ if ( empty( $license_key ) ) {
939
+ $license_key = $this->get_file_license();
940
+ }
941
+ if ( empty( $license_key ) ) {
942
  return;
943
  }
944
+
945
+
946
+ $this->license_local = $license_key;
947
  $lock_key = $this->product->get_key() . '_autoactivated';
948
 
949
  if ( 'yes' === get_option( $lock_key, '' ) ) {
950
  return;
951
  }
952
+ if ( 'yes' === get_transient( $lock_key ) ) {
953
+ return;
954
+ }
955
+ $response = $this->do_license_process( $license_key, 'activate' );
956
 
957
+ set_transient( $lock_key, 'yes', 6 * HOUR_IN_SECONDS );
958
 
959
  if ( apply_filters( $this->product->get_key() . '_hide_license_notices', false ) ) {
960
  return;
971
  public function autoactivate_notice() {
972
  ?>
973
  <div class="notice notice-success is-dismissible">
974
+ <p><?php echo sprintf( '<strong>%s</strong> has been successfully activated using <strong>%s</strong> license !', esc_attr( $this->product->get_name() ), esc_attr( str_repeat( '*', 20 ) . substr( $this->license_local, - 10 ) ) ); ?></p>
975
  </div>
976
  <?php
977
  }
1038
 
1039
  \WP_CLI::halt( 1 );
1040
  }
 
 
 
 
 
 
 
 
 
 
 
1041
  }
vendor/codeinwp/themeisle-sdk/src/Modules/Logger.php CHANGED
@@ -78,7 +78,7 @@ class Logger extends Abstract_Module {
78
  }
79
  $action_key = $this->product->get_key() . '_log_activity';
80
  if ( ! wp_next_scheduled( $action_key ) ) {
81
- wp_schedule_single_event( time() + ( rand( 1, 24 ) * 3600 ), $action_key );
82
  }
83
  add_action( $action_key, array( $this, 'send_log' ) );
84
 
78
  }
79
  $action_key = $this->product->get_key() . '_log_activity';
80
  if ( ! wp_next_scheduled( $action_key ) ) {
81
+ wp_schedule_single_event( time() + ( wp_rand( 1, 24 ) * 3600 ), $action_key );
82
  }
83
  add_action( $action_key, array( $this, 'send_log' ) );
84
 
vendor/codeinwp/themeisle-sdk/src/Modules/Notification.php CHANGED
@@ -84,7 +84,7 @@ class Notification extends Abstract_Module {
84
  $notification_html = self::get_notification_html( $notification_details );
85
  do_action( $notification_details['id'] . '_before_render' );
86
 
87
- echo $notification_html;
88
 
89
  do_action( $notification_details['id'] . '_after_render' );
90
  self::render_snippets();
@@ -340,7 +340,7 @@ class Notification extends Abstract_Module {
340
  $.post(
341
  ajaxurl,
342
  {
343
- 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
344
  'action': 'themeisle_sdk_dismiss_notice',
345
  'id': notification_id,
346
  'confirm': confirm
@@ -365,7 +365,7 @@ class Notification extends Abstract_Module {
365
  /**
366
  * Dismiss the notification.
367
  */
368
- static function dismiss() {
369
  check_ajax_referer( (string) __CLASS__, 'nonce' );
370
 
371
  $id = isset( $_POST['id'] ) ? sanitize_text_field( $_POST['id'] ) : '';
84
  $notification_html = self::get_notification_html( $notification_details );
85
  do_action( $notification_details['id'] . '_before_render' );
86
 
87
+ echo $notification_html; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, already escaped internally.
88
 
89
  do_action( $notification_details['id'] . '_after_render' );
90
  self::render_snippets();
340
  $.post(
341
  ajaxurl,
342
  {
343
+ 'nonce': '<?php echo esc_attr( wp_create_nonce( (string) __CLASS__ ) ); ?>',
344
  'action': 'themeisle_sdk_dismiss_notice',
345
  'id': notification_id,
346
  'confirm': confirm
365
  /**
366
  * Dismiss the notification.
367
  */
368
+ public static function dismiss() {
369
  check_ajax_referer( (string) __CLASS__, 'nonce' );
370
 
371
  $id = isset( $_POST['id'] ) ? sanitize_text_field( $_POST['id'] ) : '';
vendor/codeinwp/themeisle-sdk/src/Modules/Recommendation.php CHANGED
@@ -64,7 +64,7 @@ class Recommendation extends Abstract_Module {
64
  * @param array $strings - list of translated strings.
65
  * @param array $preferences - list of preferences.
66
  */
67
- function render_products_box( $plugins_list, $themes_list, $strings, $preferences = array() ) {
68
 
69
  if ( empty( $plugins_list ) && empty( $themes_list ) ) {
70
  return;
@@ -90,7 +90,7 @@ class Recommendation extends Abstract_Module {
90
 
91
  foreach ( $list as $theme ) {
92
  echo '<div class="plugin_box">';
93
- echo ' <img class="theme-banner" src="' . $theme->screenshot_url . '">';
94
  echo ' <div class="title-action-wrapper">';
95
  echo ' <span class="plugin-name">' . esc_html( $theme->custom_name ) . '</span>';
96
  if ( ! isset( $preferences['description'] ) || ( isset( $preferences['description'] ) && $preferences['description'] ) ) {
@@ -118,7 +118,7 @@ class Recommendation extends Abstract_Module {
118
 
119
  foreach ( $list as $current_plugin ) {
120
  echo '<div class="plugin_box">';
121
- echo ' <img class="plugin-banner" src="' . $current_plugin->custom_image . '">';
122
  echo ' <div class="title-action-wrapper">';
123
  echo ' <span class="plugin-name">' . esc_html( $current_plugin->custom_name ) . '</span>';
124
  if ( ! isset( $preferences['description'] ) || ( isset( $preferences['description'] ) && $preferences['description'] ) ) {
@@ -185,7 +185,7 @@ class Recommendation extends Abstract_Module {
185
  return $theme;
186
  }
187
 
188
- $products = wp_remote_get(
189
  'https://api.wordpress.org/themes/info/1.1/?action=query_themes&request[theme]=' . $slug . '&request[per_page]=1'
190
  );
191
  $products = json_decode( wp_remote_retrieve_body( $products ) );
@@ -246,7 +246,7 @@ class Recommendation extends Abstract_Module {
246
  * @return array|mixed|object
247
  */
248
  private function call_plugin_api( $slug ) {
249
- include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
250
 
251
  $call_api = get_transient( 'ti_plugin_info_' . $slug );
252
 
@@ -303,27 +303,30 @@ class Recommendation extends Abstract_Module {
303
  }
304
 
305
  .recommend-product .theme-banner {
306
- width:200px;
307
  margin: auto;
308
  }
 
309
  .recommend-product .plugin-banner {
310
  width: 100px;
311
  margin: auto;
312
  }
313
 
314
- .recommend-product .plugin_box .button span{
315
 
316
  margin-top: 2px;
317
  margin-right: 7px;
318
  }
319
- .recommend-product .plugin_box .button{
320
- margin-bottom:10px;
 
321
  }
 
322
  .recommend-product .plugin_box {
323
  margin-bottom: 20px;
324
  padding-top: 5px;
325
  display: flex;
326
- box-shadow: 0px 0px 10px -5px rgba(0,0,0,0.55);
327
  background: #fff;
328
  border-radius: 5px;
329
  flex-direction: column;
64
  * @param array $strings - list of translated strings.
65
  * @param array $preferences - list of preferences.
66
  */
67
+ public function render_products_box( $plugins_list, $themes_list, $strings, $preferences = array() ) {
68
 
69
  if ( empty( $plugins_list ) && empty( $themes_list ) ) {
70
  return;
90
 
91
  foreach ( $list as $theme ) {
92
  echo '<div class="plugin_box">';
93
+ echo ' <img class="theme-banner" src="' . esc_url( $theme->screenshot_url ) . '">';
94
  echo ' <div class="title-action-wrapper">';
95
  echo ' <span class="plugin-name">' . esc_html( $theme->custom_name ) . '</span>';
96
  if ( ! isset( $preferences['description'] ) || ( isset( $preferences['description'] ) && $preferences['description'] ) ) {
118
 
119
  foreach ( $list as $current_plugin ) {
120
  echo '<div class="plugin_box">';
121
+ echo ' <img class="plugin-banner" src="' . esc_url( $current_plugin->custom_image ) . '">';
122
  echo ' <div class="title-action-wrapper">';
123
  echo ' <span class="plugin-name">' . esc_html( $current_plugin->custom_name ) . '</span>';
124
  if ( ! isset( $preferences['description'] ) || ( isset( $preferences['description'] ) && $preferences['description'] ) ) {
185
  return $theme;
186
  }
187
 
188
+ $products = $this->safe_get(
189
  'https://api.wordpress.org/themes/info/1.1/?action=query_themes&request[theme]=' . $slug . '&request[per_page]=1'
190
  );
191
  $products = json_decode( wp_remote_retrieve_body( $products ) );
246
  * @return array|mixed|object
247
  */
248
  private function call_plugin_api( $slug ) {
249
+ include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
250
 
251
  $call_api = get_transient( 'ti_plugin_info_' . $slug );
252
 
303
  }
304
 
305
  .recommend-product .theme-banner {
306
+ width: 200px;
307
  margin: auto;
308
  }
309
+
310
  .recommend-product .plugin-banner {
311
  width: 100px;
312
  margin: auto;
313
  }
314
 
315
+ .recommend-product .plugin_box .button span {
316
 
317
  margin-top: 2px;
318
  margin-right: 7px;
319
  }
320
+
321
+ .recommend-product .plugin_box .button {
322
+ margin-bottom: 10px;
323
  }
324
+
325
  .recommend-product .plugin_box {
326
  margin-bottom: 20px;
327
  padding-top: 5px;
328
  display: flex;
329
+ box-shadow: 0px 0px 10px -5px rgba(0, 0, 0, 0.55);
330
  background: #fff;
331
  border-radius: 5px;
332
  flex-direction: column;
vendor/codeinwp/themeisle-sdk/src/Modules/Rollback.php CHANGED
@@ -120,7 +120,9 @@ class Rollback extends Abstract_Module {
120
  if ( empty( $url ) ) {
121
  return [];
122
  }
123
- $response = wp_remote_get( $url );
 
 
124
  if ( is_wp_error( $response ) ) {
125
  return array();
126
  }
@@ -191,7 +193,7 @@ class Rollback extends Abstract_Module {
191
  * Start the rollback operation.
192
  */
193
  public function start_rollback() {
194
- if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], $this->product->get_key() . '_rollback' ) ) {
195
  wp_nonce_ays( '' );
196
  }
197
 
@@ -228,9 +230,12 @@ 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' );
234
  $title = sprintf( apply_filters( $this->product->get_key() . '_rollback_message', 'Rolling back %s to v%s' ), $this->product->get_name(), $version );
235
  $plugin = $plugin_folder . '/' . $plugin_file;
236
  $nonce = 'upgrade-plugin_' . $plugin;
@@ -241,7 +246,7 @@ class Rollback extends Abstract_Module {
241
  delete_transient( $this->product->get_key() . '_warning_rollback' );
242
  wp_die(
243
  '',
244
- $title,
245
  array(
246
  'response' => 200,
247
  )
@@ -268,9 +273,12 @@ 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' );
274
  $title = sprintf( apply_filters( $this->product->get_key() . '_rollback_message', 'Rolling back %s to v%s' ), $this->product->get_name(), $version );
275
  $theme = $folder . '/style.css';
276
  $nonce = 'upgrade-theme_' . $theme;
@@ -281,7 +289,7 @@ class Rollback extends Abstract_Module {
281
  delete_transient( $this->product->get_key() . '_warning_rollback' );
282
  wp_die(
283
  '',
284
- $title,
285
  array(
286
  'response' => 200,
287
  )
@@ -335,7 +343,7 @@ class Rollback extends Abstract_Module {
335
  * @return bool Which version is greater?
336
  */
337
  public function sort_rollback_array( $a, $b ) {
338
- return version_compare( $a['version'], $b['version'], '<' ) > 0;
339
  }
340
 
341
  /**
120
  if ( empty( $url ) ) {
121
  return [];
122
  }
123
+ $response = function_exists( 'wp_remote_get_wp_remote_get' )
124
+ ? wp_remote_get_wp_remote_get( $url )
125
+ : wp_remote_get( $url ); //phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get
126
  if ( is_wp_error( $response ) ) {
127
  return array();
128
  }
193
  * Start the rollback operation.
194
  */
195
  public function start_rollback() {
196
+ if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], $this->product->get_key() . '_rollback' ) ) { //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
197
  wp_nonce_ays( '' );
198
  }
199
 
230
 
231
  $transient = get_transient( $this->product->get_key() . '_warning_rollback' );
232
 
233
+ // Style fix for the api link that gets outside the content.
234
+ echo '<style>body#error-page{word-break:break-word;}</style>';
235
+
236
  if ( false === $transient ) {
237
  set_transient( $this->product->get_key() . '_warning_rollback', 'in progress', 30 );
238
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
239
  $title = sprintf( apply_filters( $this->product->get_key() . '_rollback_message', 'Rolling back %s to v%s' ), $this->product->get_name(), $version );
240
  $plugin = $plugin_folder . '/' . $plugin_file;
241
  $nonce = 'upgrade-plugin_' . $plugin;
246
  delete_transient( $this->product->get_key() . '_warning_rollback' );
247
  wp_die(
248
  '',
249
+ esc_attr( $title ),
250
  array(
251
  'response' => 200,
252
  )
273
 
274
  $transient = get_transient( $this->product->get_key() . '_warning_rollback' );
275
 
276
+ // Style fix for the api link that gets outside the content.
277
+ echo '<style>body#error-page{word-break:break-word;}</style>';
278
+
279
  if ( false === $transient ) {
280
  set_transient( $this->product->get_key() . '_warning_rollback', 'in progress', 30 );
281
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
282
  $title = sprintf( apply_filters( $this->product->get_key() . '_rollback_message', 'Rolling back %s to v%s' ), $this->product->get_name(), $version );
283
  $theme = $folder . '/style.css';
284
  $nonce = 'upgrade-theme_' . $theme;
289
  delete_transient( $this->product->get_key() . '_warning_rollback' );
290
  wp_die(
291
  '',
292
+ esc_attr( $title ),
293
  array(
294
  'response' => 200,
295
  )
343
  * @return bool Which version is greater?
344
  */
345
  public function sort_rollback_array( $a, $b ) {
346
+ return version_compare( $b['version'], $a['version'] );
347
  }
348
 
349
  /**
vendor/codeinwp/themeisle-sdk/src/Modules/Translate.php CHANGED
@@ -805,7 +805,7 @@ class Translate extends Abstract_Module {
805
  $translations = get_transient( $cache_key );
806
 
807
  if ( false === $translations ) {
808
- require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
809
  $translations = translations_api(
810
  $product->get_type() . 's',
811
  array(
805
  $translations = get_transient( $cache_key );
806
 
807
  if ( false === $translations ) {
808
+ require_once ABSPATH . 'wp-admin/includes/translation-install.php';
809
  $translations = translations_api(
810
  $product->get_type() . 's',
811
  array(
vendor/codeinwp/themeisle-sdk/src/Modules/Uninstall_feedback.php CHANGED
@@ -132,7 +132,7 @@ class Uninstall_Feedback extends Abstract_Module {
132
  /**
133
  * Loads the additional resources
134
  */
135
- function load_resources() {
136
  $screen = get_current_screen();
137
 
138
  if ( ! $screen || ! in_array( $screen->id, array( 'theme-install', 'plugins' ) ) ) {
@@ -178,7 +178,7 @@ class Uninstall_Feedback extends Abstract_Module {
178
  echo wp_kses_post( $info_disclosure_link );
179
  echo wp_kses_post( $this->get_disclosure_labels() );
180
  echo '<div class="buttons">';
181
- echo get_submit_button(
182
  $button_submit,
183
  'secondary',
184
  $this->product->get_key() . 'ti-deactivate-yes',
@@ -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
 
@@ -408,7 +414,7 @@ class Uninstall_Feedback extends Abstract_Module {
408
  display: block;
409
  }
410
 
411
- tr[data-plugin^="<?php echo $this->product->get_slug(); ?>"] .deactivate {
412
  position: relative;
413
  }
414
 
@@ -469,20 +475,20 @@ class Uninstall_Feedback extends Abstract_Module {
469
  var radio = $(this);
470
  if (radio.parent().find('textarea').length > 0 &&
471
  radio.parent().find('textarea').val().length === 0) {
472
- $('#<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
473
  radio.parent().find('textarea').on('keyup', function (e) {
474
  if ($(this).val().length === 0) {
475
- $('#<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
476
  } else {
477
- $('#<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
478
  }
479
  });
480
  } else {
481
- $('#<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
482
  }
483
  });
484
 
485
- $('#<?php echo $key; ?>ti-deactivate-yes').on('click', function (e) {
486
  e.preventDefault();
487
  e.stopPropagation();
488
 
@@ -490,7 +496,7 @@ class Uninstall_Feedback extends Abstract_Module {
490
  '.ti-theme-uninstall-feedback-drawer input[name="ti-deactivate-option"]:checked');
491
  $.post(ajaxurl, {
492
  'action': '<?php echo esc_attr( $key ) . '_uninstall_feedback'; ?>',
493
- 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
494
  'id': selectedOption.parent().attr('ti-option-id'),
495
  'msg': selectedOption.parent().find('textarea').val(),
496
  'type': 'theme',
@@ -523,12 +529,12 @@ class Uninstall_Feedback extends Abstract_Module {
523
  <li ti-option-id="<?php echo esc_attr( $attributes['id'] ); ?>">
524
  <input type="radio" name="ti-deactivate-option" id="<?php echo esc_attr( $key . $attributes['id'] ); ?>">
525
  <label for="<?php echo esc_attr( $key . $attributes['id'] ); ?>">
526
- <?php echo str_replace( '{theme}', $this->product->get_name(), $title ); ?>
527
  </label>
528
  <?php
529
  if ( array_key_exists( 'type', $attributes ) ) {
530
  $placeholder = array_key_exists( 'placeholder', $attributes ) ? $attributes['placeholder'] : '';
531
- echo '<textarea width="100%" rows="' . $inputs_row_map[ $attributes['type'] ] . '" name="comments" placeholder="' . esc_attr( $placeholder ) . '"></textarea>';
532
  }
533
  ?>
534
  </li>
@@ -561,13 +567,13 @@ class Uninstall_Feedback extends Abstract_Module {
561
  echo wp_kses_post( $info_disclosure_link );
562
  echo wp_kses_post( $this->get_disclosure_labels() );
563
  echo '<div class="buttons">';
564
- echo get_submit_button(
565
  $button_cancel,
566
  'secondary',
567
  $this->product->get_key() . 'ti-deactivate-no',
568
  false
569
  );
570
- echo get_submit_button(
571
  $button_submit,
572
  'primary',
573
  $this->product->get_key() . 'ti-deactivate-yes',
@@ -596,7 +602,7 @@ class Uninstall_Feedback extends Abstract_Module {
596
  <script type="text/javascript" id="ti-deactivate-js">
597
  (function ($) {
598
  $(document).ready(function () {
599
- var targetElement = 'tr[data-plugin^="<?php echo $this->product->get_slug(); ?>/"] span.deactivate a';
600
  var redirectUrl = $(targetElement).attr('href');
601
  if ($('.ti-feedback-overlay').length === 0) {
602
  $('body').prepend('<div class="ti-feedback-overlay"></div>');
@@ -622,20 +628,20 @@ class Uninstall_Feedback extends Abstract_Module {
622
  var radio = $(this);
623
  if (radio.parent().find('textarea').length > 0 &&
624
  radio.parent().find('textarea').val().length === 0) {
625
- $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
626
  radio.parent().find('textarea').on('keyup', function (e) {
627
  if ($(this).val().length === 0) {
628
- $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
629
  } else {
630
- $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
631
  }
632
  });
633
  } else {
634
- $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
635
  }
636
  });
637
 
638
- $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-no').on('click', function (e) {
639
  e.preventDefault();
640
  e.stopPropagation();
641
  $(targetElement).unbind('click');
@@ -646,7 +652,7 @@ class Uninstall_Feedback extends Abstract_Module {
646
  }
647
  });
648
 
649
- $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').on('click', function (e) {
650
  e.preventDefault();
651
  e.stopPropagation();
652
  $(targetElement).unbind('click');
@@ -654,7 +660,7 @@ class Uninstall_Feedback extends Abstract_Module {
654
  '<?php echo esc_attr( $popup_id ); ?> input[name="ti-deactivate-option"]:checked');
655
  var data = {
656
  'action': '<?php echo esc_attr( $key ) . '_uninstall_feedback'; ?>',
657
- 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
658
  'id': selectedOption.parent().attr('ti-option-id'),
659
  'msg': selectedOption.parent().find('textarea').val(),
660
  'type': 'plugin',
@@ -719,7 +725,7 @@ class Uninstall_Feedback extends Abstract_Module {
719
  *
720
  * @param array $options The options array.
721
  */
722
- function randomize_options( $options ) {
723
  $new = array();
724
  $keys = array_keys( $options );
725
  shuffle( $keys );
@@ -734,7 +740,7 @@ class Uninstall_Feedback extends Abstract_Module {
734
  /**
735
  * Called when the deactivate button is clicked.
736
  */
737
- function post_deactivate() {
738
  check_ajax_referer( (string) __CLASS__, 'nonce' );
739
 
740
  $this->post_deactivate_or_cancel();
@@ -748,8 +754,8 @@ class Uninstall_Feedback extends Abstract_Module {
748
  $this->call_api(
749
  array(
750
  'type' => 'deactivate',
751
- 'id' => $_POST['id'],
752
- 'comment' => isset( $_POST['msg'] ) ? $_POST['msg'] : '',
753
  )
754
  );
755
  wp_send_json( [] );
@@ -760,14 +766,14 @@ class Uninstall_Feedback extends Abstract_Module {
760
  * Called when the deactivate/cancel button is clicked.
761
  */
762
  private function post_deactivate_or_cancel() {
763
- if ( ! isset( $_POST['type'] ) || ! isset( $_POST['key'] ) ) {
764
  return;
765
  }
766
- if ( 'theme' !== $_POST['type'] ) {
767
  return;
768
  }
769
 
770
- set_transient( 'ti_sdk_pause_' . $_POST['key'], true, self::PAUSE_DEACTIVATE_WINDOW_DAYS * DAY_IN_SECONDS );
771
 
772
  }
773
 
132
  /**
133
  * Loads the additional resources
134
  */
135
+ public function load_resources() {
136
  $screen = get_current_screen();
137
 
138
  if ( ! $screen || ! in_array( $screen->id, array( 'theme-install', 'plugins' ) ) ) {
178
  echo wp_kses_post( $info_disclosure_link );
179
  echo wp_kses_post( $this->get_disclosure_labels() );
180
  echo '<div class="buttons">';
181
+ echo get_submit_button( //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, Function has an internal sanitization.
182
  $button_submit,
183
  'secondary',
184
  $this->product->get_key() . 'ti-deactivate-yes',
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
 
414
  display: block;
415
  }
416
 
417
+ tr[data-plugin^="<?php echo esc_attr( $this->product->get_slug() ); ?>"] .deactivate {
418
  position: relative;
419
  }
420
 
475
  var radio = $(this);
476
  if (radio.parent().find('textarea').length > 0 &&
477
  radio.parent().find('textarea').val().length === 0) {
478
+ $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').attr('disabled', 'disabled');
479
  radio.parent().find('textarea').on('keyup', function (e) {
480
  if ($(this).val().length === 0) {
481
+ $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').attr('disabled', 'disabled');
482
  } else {
483
+ $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').removeAttr('disabled');
484
  }
485
  });
486
  } else {
487
+ $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').removeAttr('disabled');
488
  }
489
  });
490
 
491
+ $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').on('click', function (e) {
492
  e.preventDefault();
493
  e.stopPropagation();
494
 
496
  '.ti-theme-uninstall-feedback-drawer input[name="ti-deactivate-option"]:checked');
497
  $.post(ajaxurl, {
498
  'action': '<?php echo esc_attr( $key ) . '_uninstall_feedback'; ?>',
499
+ 'nonce': '<?php echo esc_attr( wp_create_nonce( (string) __CLASS__ ) ); ?>',
500
  'id': selectedOption.parent().attr('ti-option-id'),
501
  'msg': selectedOption.parent().find('textarea').val(),
502
  'type': 'theme',
529
  <li ti-option-id="<?php echo esc_attr( $attributes['id'] ); ?>">
530
  <input type="radio" name="ti-deactivate-option" id="<?php echo esc_attr( $key . $attributes['id'] ); ?>">
531
  <label for="<?php echo esc_attr( $key . $attributes['id'] ); ?>">
532
+ <?php echo esc_attr( str_replace( '{theme}', $this->product->get_name(), $title ) ); ?>
533
  </label>
534
  <?php
535
  if ( array_key_exists( 'type', $attributes ) ) {
536
  $placeholder = array_key_exists( 'placeholder', $attributes ) ? $attributes['placeholder'] : '';
537
+ echo '<textarea width="100%" rows="' . esc_attr( $inputs_row_map[ $attributes['type'] ] ) . '" name="comments" placeholder="' . esc_attr( $placeholder ) . '"></textarea>';
538
  }
539
  ?>
540
  </li>
567
  echo wp_kses_post( $info_disclosure_link );
568
  echo wp_kses_post( $this->get_disclosure_labels() );
569
  echo '<div class="buttons">';
570
+ echo get_submit_button( //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, Function internals are escaped.
571
  $button_cancel,
572
  'secondary',
573
  $this->product->get_key() . 'ti-deactivate-no',
574
  false
575
  );
576
+ echo get_submit_button( //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, Function internals are escaped.
577
  $button_submit,
578
  'primary',
579
  $this->product->get_key() . 'ti-deactivate-yes',
602
  <script type="text/javascript" id="ti-deactivate-js">
603
  (function ($) {
604
  $(document).ready(function () {
605
+ var targetElement = 'tr[data-plugin^="<?php echo esc_attr( $this->product->get_slug() ); ?>/"] span.deactivate a';
606
  var redirectUrl = $(targetElement).attr('href');
607
  if ($('.ti-feedback-overlay').length === 0) {
608
  $('body').prepend('<div class="ti-feedback-overlay"></div>');
628
  var radio = $(this);
629
  if (radio.parent().find('textarea').length > 0 &&
630
  radio.parent().find('textarea').val().length === 0) {
631
+ $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').attr('disabled', 'disabled');
632
  radio.parent().find('textarea').on('keyup', function (e) {
633
  if ($(this).val().length === 0) {
634
+ $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').attr('disabled', 'disabled');
635
  } else {
636
+ $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').removeAttr('disabled');
637
  }
638
  });
639
  } else {
640
+ $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').removeAttr('disabled');
641
  }
642
  });
643
 
644
+ $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-no').on('click', function (e) {
645
  e.preventDefault();
646
  e.stopPropagation();
647
  $(targetElement).unbind('click');
652
  }
653
  });
654
 
655
+ $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').on('click', function (e) {
656
  e.preventDefault();
657
  e.stopPropagation();
658
  $(targetElement).unbind('click');
660
  '<?php echo esc_attr( $popup_id ); ?> input[name="ti-deactivate-option"]:checked');
661
  var data = {
662
  'action': '<?php echo esc_attr( $key ) . '_uninstall_feedback'; ?>',
663
+ 'nonce': '<?php echo esc_attr( wp_create_nonce( (string) __CLASS__ ) ); ?>',
664
  'id': selectedOption.parent().attr('ti-option-id'),
665
  'msg': selectedOption.parent().find('textarea').val(),
666
  'type': 'plugin',
725
  *
726
  * @param array $options The options array.
727
  */
728
+ public function randomize_options( $options ) {
729
  $new = array();
730
  $keys = array_keys( $options );
731
  shuffle( $keys );
740
  /**
741
  * Called when the deactivate button is clicked.
742
  */
743
+ public function post_deactivate() {
744
  check_ajax_referer( (string) __CLASS__, 'nonce' );
745
 
746
  $this->post_deactivate_or_cancel();
754
  $this->call_api(
755
  array(
756
  'type' => 'deactivate',
757
+ 'id' => sanitize_key( $_POST['id'] ),
758
+ 'comment' => isset( $_POST['msg'] ) ? sanitize_textarea_field( $_POST['msg'] ) : '',
759
  )
760
  );
761
  wp_send_json( [] );
766
  * Called when the deactivate/cancel button is clicked.
767
  */
768
  private function post_deactivate_or_cancel() {
769
+ if ( ! isset( $_POST['type'] ) || ! isset( $_POST['key'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Missing, Nonce already present in caller function.
770
  return;
771
  }
772
+ if ( 'theme' !== $_POST['type'] ) { //phpcs:ignore WordPress.Security.NonceVerification.Missing, Nonce already present in caller function.
773
  return;
774
  }
775
 
776
+ set_transient( 'ti_sdk_pause_' . sanitize_text_field( $_POST['key'] ), true, self::PAUSE_DEACTIVATE_WINDOW_DAYS * DAY_IN_SECONDS );//phpcs:ignore WordPress.Security.NonceVerification.Missing, Nonce already present in caller function.
777
 
778
  }
779
 
vendor/codeinwp/themeisle-sdk/src/Product.php CHANGED
@@ -157,7 +157,7 @@ class Product {
157
  *
158
  * @return string $name The normalized string.
159
  */
160
- static function key_ready_name( $string ) {
161
  return str_replace( '-', '_', strtolower( trim( $string ) ) );
162
  }
163
 
157
  *
158
  * @return string $name The normalized string.
159
  */
160
+ public static function key_ready_name( $string ) {
161
  return str_replace( '-', '_', strtolower( trim( $string ) ) );
162
  }
163
 
vendor/codeinwp/themeisle-sdk/start.php CHANGED
@@ -13,25 +13,25 @@ namespace ThemeisleSDK;
13
  if ( ! defined( 'ABSPATH' ) ) {
14
  exit;
15
  }
16
- $products = apply_filters( 'themeisle_sdk_products', array() );
17
- $path = dirname( __FILE__ );
18
- $files_to_load = [
19
- $path . '/src/' . 'Loader.php',
20
- $path . '/src/' . 'Product.php',
21
-
22
- $path . '/src/' . 'Common/Abstract_module.php',
23
- $path . '/src/' . 'Common/Module_factory.php',
24
-
25
- $path . '/src/' . 'Modules/Dashboard_widget.php',
26
- $path . '/src/' . 'Modules/Rollback.php',
27
- $path . '/src/' . 'Modules/Uninstall_feedback.php',
28
- $path . '/src/' . 'Modules/Licenser.php',
29
- $path . '/src/' . 'Modules/Endpoint.php',
30
- $path . '/src/' . 'Modules/Notification.php',
31
- $path . '/src/' . 'Modules/Logger.php',
32
- $path . '/src/' . 'Modules/Translate.php',
33
- $path . '/src/' . 'Modules/Review.php',
34
- $path . '/src/' . 'Modules/Recommendation.php',
35
  ];
36
 
37
  $files_to_load = array_merge( $files_to_load, apply_filters( 'themeisle_sdk_required_files', [] ) );
13
  if ( ! defined( 'ABSPATH' ) ) {
14
  exit;
15
  }
16
+ $products = apply_filters( 'themeisle_sdk_products', array() );
17
+ $themeisle_library_path = dirname( __FILE__ );
18
+ $files_to_load = [
19
+ $themeisle_library_path . '/src/Loader.php',
20
+ $themeisle_library_path . '/src/Product.php',
21
+
22
+ $themeisle_library_path . '/src/Common/Abstract_module.php',
23
+ $themeisle_library_path . '/src/Common/Module_factory.php',
24
+
25
+ $themeisle_library_path . '/src/Modules/Dashboard_widget.php',
26
+ $themeisle_library_path . '/src/Modules/Rollback.php',
27
+ $themeisle_library_path . '/src/Modules/Uninstall_feedback.php',
28
+ $themeisle_library_path . '/src/Modules/Licenser.php',
29
+ $themeisle_library_path . '/src/Modules/Endpoint.php',
30
+ $themeisle_library_path . '/src/Modules/Notification.php',
31
+ $themeisle_library_path . '/src/Modules/Logger.php',
32
+ $themeisle_library_path . '/src/Modules/Translate.php',
33
+ $themeisle_library_path . '/src/Modules/Review.php',
34
+ $themeisle_library_path . '/src/Modules/Recommendation.php',
35
  ];
36
 
37
  $files_to_load = array_merge( $files_to_load, apply_filters( 'themeisle_sdk_required_files', [] ) );
vendor/composer/ClassLoader.php CHANGED
@@ -37,11 +37,13 @@ namespace Composer\Autoload;
37
  *
38
  * @author Fabien Potencier <fabien@symfony.com>
39
  * @author Jordi Boggiano <j.boggiano@seld.be>
40
- * @see http://www.php-fig.org/psr/psr-0/
41
- * @see http://www.php-fig.org/psr/psr-4/
42
  */
43
  class ClassLoader
44
  {
 
 
45
  // PSR-4
46
  private $prefixLengthsPsr4 = array();
47
  private $prefixDirsPsr4 = array();
@@ -53,13 +55,21 @@ class ClassLoader
53
 
54
  private $useIncludePath = false;
55
  private $classMap = array();
56
-
57
  private $classMapAuthoritative = false;
 
 
 
 
 
 
 
 
 
58
 
59
  public function getPrefixes()
60
  {
61
  if (!empty($this->prefixesPsr0)) {
62
- return call_user_func_array('array_merge', $this->prefixesPsr0);
63
  }
64
 
65
  return array();
@@ -271,6 +281,26 @@ class ClassLoader
271
  return $this->classMapAuthoritative;
272
  }
273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  /**
275
  * Registers this instance as an autoloader.
276
  *
@@ -279,6 +309,17 @@ class ClassLoader
279
  public function register($prepend = false)
280
  {
281
  spl_autoload_register(array($this, 'loadClass'), true, $prepend);
 
 
 
 
 
 
 
 
 
 
 
282
  }
283
 
284
  /**
@@ -287,6 +328,10 @@ class ClassLoader
287
  public function unregister()
288
  {
289
  spl_autoload_unregister(array($this, 'loadClass'));
 
 
 
 
290
  }
291
 
292
  /**
@@ -313,34 +358,49 @@ class ClassLoader
313
  */
314
  public function findFile($class)
315
  {
316
- // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
317
- if ('\\' == $class[0]) {
318
- $class = substr($class, 1);
319
- }
320
-
321
  // class map lookup
322
  if (isset($this->classMap[$class])) {
323
  return $this->classMap[$class];
324
  }
325
- if ($this->classMapAuthoritative) {
326
  return false;
327
  }
 
 
 
 
 
 
328
 
329
  $file = $this->findFileWithExtension($class, '.php');
330
 
331
  // Search for Hack files if we are running on HHVM
332
- if ($file === null && defined('HHVM_VERSION')) {
333
  $file = $this->findFileWithExtension($class, '.hh');
334
  }
335
 
336
- if ($file === null) {
 
 
 
 
337
  // Remember that this class does not exist.
338
- return $this->classMap[$class] = false;
339
  }
340
 
341
  return $file;
342
  }
343
 
 
 
 
 
 
 
 
 
 
 
344
  private function findFileWithExtension($class, $ext)
345
  {
346
  // PSR-4 lookup
@@ -348,10 +408,14 @@ class ClassLoader
348
 
349
  $first = $class[0];
350
  if (isset($this->prefixLengthsPsr4[$first])) {
351
- foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352
- if (0 === strpos($class, $prefix)) {
353
- foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
354
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
 
 
 
 
355
  return $file;
356
  }
357
  }
@@ -399,6 +463,8 @@ class ClassLoader
399
  if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400
  return $file;
401
  }
 
 
402
  }
403
  }
404
 
37
  *
38
  * @author Fabien Potencier <fabien@symfony.com>
39
  * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see https://www.php-fig.org/psr/psr-0/
41
+ * @see https://www.php-fig.org/psr/psr-4/
42
  */
43
  class ClassLoader
44
  {
45
+ private $vendorDir;
46
+
47
  // PSR-4
48
  private $prefixLengthsPsr4 = array();
49
  private $prefixDirsPsr4 = array();
55
 
56
  private $useIncludePath = false;
57
  private $classMap = array();
 
58
  private $classMapAuthoritative = false;
59
+ private $missingClasses = array();
60
+ private $apcuPrefix;
61
+
62
+ private static $registeredLoaders = array();
63
+
64
+ public function __construct($vendorDir = null)
65
+ {
66
+ $this->vendorDir = $vendorDir;
67
+ }
68
 
69
  public function getPrefixes()
70
  {
71
  if (!empty($this->prefixesPsr0)) {
72
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
73
  }
74
 
75
  return array();
281
  return $this->classMapAuthoritative;
282
  }
283
 
284
+ /**
285
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
286
+ *
287
+ * @param string|null $apcuPrefix
288
+ */
289
+ public function setApcuPrefix($apcuPrefix)
290
+ {
291
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
292
+ }
293
+
294
+ /**
295
+ * The APCu prefix in use, or null if APCu caching is not enabled.
296
+ *
297
+ * @return string|null
298
+ */
299
+ public function getApcuPrefix()
300
+ {
301
+ return $this->apcuPrefix;
302
+ }
303
+
304
  /**
305
  * Registers this instance as an autoloader.
306
  *
309
  public function register($prepend = false)
310
  {
311
  spl_autoload_register(array($this, 'loadClass'), true, $prepend);
312
+
313
+ if (null === $this->vendorDir) {
314
+ return;
315
+ }
316
+
317
+ if ($prepend) {
318
+ self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
319
+ } else {
320
+ unset(self::$registeredLoaders[$this->vendorDir]);
321
+ self::$registeredLoaders[$this->vendorDir] = $this;
322
+ }
323
  }
324
 
325
  /**
328
  public function unregister()
329
  {
330
  spl_autoload_unregister(array($this, 'loadClass'));
331
+
332
+ if (null !== $this->vendorDir) {
333
+ unset(self::$registeredLoaders[$this->vendorDir]);
334
+ }
335
  }
336
 
337
  /**
358
  */
359
  public function findFile($class)
360
  {
 
 
 
 
 
361
  // class map lookup
362
  if (isset($this->classMap[$class])) {
363
  return $this->classMap[$class];
364
  }
365
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
366
  return false;
367
  }
368
+ if (null !== $this->apcuPrefix) {
369
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
370
+ if ($hit) {
371
+ return $file;
372
+ }
373
+ }
374
 
375
  $file = $this->findFileWithExtension($class, '.php');
376
 
377
  // Search for Hack files if we are running on HHVM
378
+ if (false === $file && defined('HHVM_VERSION')) {
379
  $file = $this->findFileWithExtension($class, '.hh');
380
  }
381
 
382
+ if (null !== $this->apcuPrefix) {
383
+ apcu_add($this->apcuPrefix.$class, $file);
384
+ }
385
+
386
+ if (false === $file) {
387
  // Remember that this class does not exist.
388
+ $this->missingClasses[$class] = true;
389
  }
390
 
391
  return $file;
392
  }
393
 
394
+ /**
395
+ * Returns the currently registered loaders indexed by their corresponding vendor directories.
396
+ *
397
+ * @return self[]
398
+ */
399
+ public static function getRegisteredLoaders()
400
+ {
401
+ return self::$registeredLoaders;
402
+ }
403
+
404
  private function findFileWithExtension($class, $ext)
405
  {
406
  // PSR-4 lookup
408
 
409
  $first = $class[0];
410
  if (isset($this->prefixLengthsPsr4[$first])) {
411
+ $subPath = $class;
412
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
413
+ $subPath = substr($subPath, 0, $lastPos);
414
+ $search = $subPath . '\\';
415
+ if (isset($this->prefixDirsPsr4[$search])) {
416
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
417
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
418
+ if (file_exists($file = $dir . $pathEnd)) {
419
  return $file;
420
  }
421
  }
463
  if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
464
  return $file;
465
  }
466
+
467
+ return false;
468
  }
469
  }
470
 
vendor/composer/InstalledVersions.php ADDED
@@ -0,0 +1,329 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+ namespace Composer;
14
+
15
+ use Composer\Autoload\ClassLoader;
16
+ use Composer\Semver\VersionParser;
17
+
18
+
19
+
20
+
21
+
22
+
23
+ class InstalledVersions
24
+ {
25
+ private static $installed = array (
26
+ 'root' =>
27
+ array (
28
+ 'pretty_version' => 'v0.12.6',
29
+ 'version' => '0.12.6.0',
30
+ 'aliases' =>
31
+ array (
32
+ ),
33
+ 'reference' => 'b68bc7edd282392450ee66e44aa35376ff08cd36',
34
+ 'name' => 'codeinwp/wp-menu-icons',
35
+ ),
36
+ 'versions' =>
37
+ array (
38
+ 'codeinwp/gutenberg-menu-icons' =>
39
+ array (
40
+ 'pretty_version' => '1.0.4',
41
+ 'version' => '1.0.4.0',
42
+ 'aliases' =>
43
+ array (
44
+ ),
45
+ 'reference' => '121ef82c57a556301265cbd1032d28619235e488',
46
+ ),
47
+ 'codeinwp/icon-picker' =>
48
+ array (
49
+ 'pretty_version' => 'dev-master',
50
+ 'version' => 'dev-master',
51
+ 'aliases' =>
52
+ array (
53
+ 0 => '9999999-dev',
54
+ ),
55
+ 'reference' => '0c60ce3a41653e41a20e710c4d5a6a2104c85020',
56
+ ),
57
+ 'codeinwp/menu-item-custom-fields' =>
58
+ array (
59
+ 'pretty_version' => 'dev-master',
60
+ 'version' => 'dev-master',
61
+ 'aliases' =>
62
+ array (
63
+ 0 => '9999999-dev',
64
+ ),
65
+ 'reference' => 'f491fcfa873e92006e3d92a4ede8775e9cf53bae',
66
+ ),
67
+ 'codeinwp/themeisle-sdk' =>
68
+ array (
69
+ 'pretty_version' => 'dev-master',
70
+ 'version' => 'dev-master',
71
+ 'aliases' =>
72
+ array (
73
+ 0 => '9999999-dev',
74
+ ),
75
+ 'reference' => '24668ab249d8fb6596cc908c323205648aad0ed8',
76
+ ),
77
+ 'codeinwp/wp-menu-icons' =>
78
+ array (
79
+ 'pretty_version' => 'v0.12.6',
80
+ 'version' => '0.12.6.0',
81
+ 'aliases' =>
82
+ array (
83
+ ),
84
+ 'reference' => 'b68bc7edd282392450ee66e44aa35376ff08cd36',
85
+ ),
86
+ 'composer/installers' =>
87
+ array (
88
+ 'replaced' =>
89
+ array (
90
+ 0 => '*',
91
+ ),
92
+ ),
93
+ ),
94
+ );
95
+ private static $canGetVendors;
96
+ private static $installedByVendor = array();
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+ public static function getInstalledPackages()
105
+ {
106
+ $packages = array();
107
+ foreach (self::getInstalled() as $installed) {
108
+ $packages[] = array_keys($installed['versions']);
109
+ }
110
+
111
+
112
+ if (1 === \count($packages)) {
113
+ return $packages[0];
114
+ }
115
+
116
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
117
+ }
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+ public static function isInstalled($packageName)
128
+ {
129
+ foreach (self::getInstalled() as $installed) {
130
+ if (isset($installed['versions'][$packageName])) {
131
+ return true;
132
+ }
133
+ }
134
+
135
+ return false;
136
+ }
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
152
+ {
153
+ $constraint = $parser->parseConstraints($constraint);
154
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
155
+
156
+ return $provided->matches($constraint);
157
+ }
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+ public static function getVersionRanges($packageName)
169
+ {
170
+ foreach (self::getInstalled() as $installed) {
171
+ if (!isset($installed['versions'][$packageName])) {
172
+ continue;
173
+ }
174
+
175
+ $ranges = array();
176
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
177
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
178
+ }
179
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
180
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
181
+ }
182
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
183
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
184
+ }
185
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
186
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
187
+ }
188
+
189
+ return implode(' || ', $ranges);
190
+ }
191
+
192
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
193
+ }
194
+
195
+
196
+
197
+
198
+
199
+ public static function getVersion($packageName)
200
+ {
201
+ foreach (self::getInstalled() as $installed) {
202
+ if (!isset($installed['versions'][$packageName])) {
203
+ continue;
204
+ }
205
+
206
+ if (!isset($installed['versions'][$packageName]['version'])) {
207
+ return null;
208
+ }
209
+
210
+ return $installed['versions'][$packageName]['version'];
211
+ }
212
+
213
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
214
+ }
215
+
216
+
217
+
218
+
219
+
220
+ public static function getPrettyVersion($packageName)
221
+ {
222
+ foreach (self::getInstalled() as $installed) {
223
+ if (!isset($installed['versions'][$packageName])) {
224
+ continue;
225
+ }
226
+
227
+ if (!isset($installed['versions'][$packageName]['pretty_version'])) {
228
+ return null;
229
+ }
230
+
231
+ return $installed['versions'][$packageName]['pretty_version'];
232
+ }
233
+
234
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
235
+ }
236
+
237
+
238
+
239
+
240
+
241
+ public static function getReference($packageName)
242
+ {
243
+ foreach (self::getInstalled() as $installed) {
244
+ if (!isset($installed['versions'][$packageName])) {
245
+ continue;
246
+ }
247
+
248
+ if (!isset($installed['versions'][$packageName]['reference'])) {
249
+ return null;
250
+ }
251
+
252
+ return $installed['versions'][$packageName]['reference'];
253
+ }
254
+
255
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
256
+ }
257
+
258
+
259
+
260
+
261
+
262
+ public static function getRootPackage()
263
+ {
264
+ $installed = self::getInstalled();
265
+
266
+ return $installed[0]['root'];
267
+ }
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+ public static function getRawData()
276
+ {
277
+ return self::$installed;
278
+ }
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+ public static function reload($data)
299
+ {
300
+ self::$installed = $data;
301
+ self::$installedByVendor = array();
302
+ }
303
+
304
+
305
+
306
+
307
+ private static function getInstalled()
308
+ {
309
+ if (null === self::$canGetVendors) {
310
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
311
+ }
312
+
313
+ $installed = array();
314
+
315
+ if (self::$canGetVendors) {
316
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
317
+ if (isset(self::$installedByVendor[$vendorDir])) {
318
+ $installed[] = self::$installedByVendor[$vendorDir];
319
+ } elseif (is_file($vendorDir.'/composer/installed.php')) {
320
+ $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
321
+ }
322
+ }
323
+ }
324
+
325
+ $installed[] = self::$installed;
326
+
327
+ return $installed;
328
+ }
329
+ }
vendor/composer/LICENSE CHANGED
@@ -1,5 +1,5 @@
1
 
2
- Copyright (c) 2016 Nils Adermann, Jordi Boggiano
3
 
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
  of this software and associated documentation files (the "Software"), to deal
1
 
2
+ Copyright (c) Nils Adermann, Jordi Boggiano
3
 
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
  of this software and associated documentation files (the "Software"), to deal
vendor/composer/autoload_classmap.php CHANGED
@@ -6,4 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
10
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitabef56b0da707c7e3eaebd0d256cca29
6
  {
7
  private static $loader;
8
 
@@ -13,43 +13,57 @@ class ComposerAutoloaderInitabef56b0da707c7e3eaebd0d256cca29
13
  }
14
  }
15
 
 
 
 
16
  public static function getLoader()
17
  {
18
  if (null !== self::$loader) {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitabef56b0da707c7e3eaebd0d256cca29', 'loadClassLoader'), true, true);
23
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitabef56b0da707c7e3eaebd0d256cca29', 'loadClassLoader'));
25
 
26
- $map = require __DIR__ . '/autoload_namespaces.php';
27
- foreach ($map as $namespace => $path) {
28
- $loader->set($namespace, $path);
29
- }
30
 
31
- $map = require __DIR__ . '/autoload_psr4.php';
32
- foreach ($map as $namespace => $path) {
33
- $loader->setPsr4($namespace, $path);
34
- }
 
 
35
 
36
- $classMap = require __DIR__ . '/autoload_classmap.php';
37
- if ($classMap) {
38
- $loader->addClassMap($classMap);
 
 
 
 
 
 
39
  }
40
 
41
  $loader->register(true);
42
 
43
- $includeFiles = require __DIR__ . '/autoload_files.php';
 
 
 
 
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequireabef56b0da707c7e3eaebd0d256cca29($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequireabef56b0da707c7e3eaebd0d256cca29($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 ComposerAutoloaderInit66e1d66cf653b778d8f616ff7b2c524b
6
  {
7
  private static $loader;
8
 
13
  }
14
  }
15
 
16
+ /**
17
+ * @return \Composer\Autoload\ClassLoader
18
+ */
19
  public static function getLoader()
20
  {
21
  if (null !== self::$loader) {
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit66e1d66cf653b778d8f616ff7b2c524b', 'loadClassLoader'), true, true);
26
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit66e1d66cf653b778d8f616ff7b2c524b', 'loadClassLoader'));
28
 
29
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
+ if ($useStaticLoader) {
31
+ require __DIR__ . '/autoload_static.php';
 
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit66e1d66cf653b778d8f616ff7b2c524b::getInitializer($loader));
34
+ } else {
35
+ $map = require __DIR__ . '/autoload_namespaces.php';
36
+ foreach ($map as $namespace => $path) {
37
+ $loader->set($namespace, $path);
38
+ }
39
 
40
+ $map = require __DIR__ . '/autoload_psr4.php';
41
+ foreach ($map as $namespace => $path) {
42
+ $loader->setPsr4($namespace, $path);
43
+ }
44
+
45
+ $classMap = require __DIR__ . '/autoload_classmap.php';
46
+ if ($classMap) {
47
+ $loader->addClassMap($classMap);
48
+ }
49
  }
50
 
51
  $loader->register(true);
52
 
53
+ if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInit66e1d66cf653b778d8f616ff7b2c524b::$files;
55
+ } else {
56
+ $includeFiles = require __DIR__ . '/autoload_files.php';
57
+ }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequire66e1d66cf653b778d8f616ff7b2c524b($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequire66e1d66cf653b778d8f616ff7b2c524b($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_static.php @generated by Composer
4
+
5
+ namespace Composer\Autoload;
6
+
7
+ class ComposerStaticInit66e1d66cf653b778d8f616ff7b2c524b
8
+ {
9
+ public static $files = array (
10
+ '2c2d2fe92db4cd03403dbb108ac263b7' => __DIR__ . '/..' . '/codeinwp/gutenberg-menu-icons/load.php',
11
+ '0498965e576e4ec1efaedeccfee8b5f0' => __DIR__ . '/..' . '/codeinwp/menu-item-custom-fields/menu-item-custom-fields.php',
12
+ '347e48cf03d89942a6ddafc17d247b11' => __DIR__ . '/..' . '/codeinwp/icon-picker/icon-picker.php',
13
+ '5a095c604245b0e67e4573f0a3b240cd' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
14
+ );
15
+
16
+ public static $classMap = array (
17
+ 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
18
+ );
19
+
20
+ public static function getInitializer(ClassLoader $loader)
21
+ {
22
+ return \Closure::bind(function () use ($loader) {
23
+ $loader->classMap = ComposerStaticInit66e1d66cf653b778d8f616ff7b2c524b::$classMap;
24
+
25
+ }, null, ClassLoader::class);
26
+ }
27
+ }
vendor/composer/installed.json CHANGED
@@ -1,164 +1,187 @@
1
- [
2
- {
3
- "name": "codeinwp/icon-picker",
4
- "version": "dev-master",
5
- "version_normalized": "9999999-dev",
6
- "source": {
7
- "type": "git",
8
- "url": "https://github.com/Codeinwp/icon-picker.git",
9
- "reference": "980abcd0325414f6264ac62320990bf10a3ceb8f"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  },
11
- "dist": {
12
- "type": "zip",
13
- "url": "https://api.github.com/repos/Codeinwp/icon-picker/zipball/980abcd0325414f6264ac62320990bf10a3ceb8f",
14
- "reference": "980abcd0325414f6264ac62320990bf10a3ceb8f",
15
- "shasum": ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  },
17
- "require": {
18
- "composer/installers": "~1.0"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  },
20
- "require-dev": {
21
- "wp-coding-standards/wpcs": "^0.10.0"
22
- },
23
- "time": "2019-11-15 16:51:01",
24
- "type": "wordpress-plugin",
25
- "installation-source": "source",
26
- "notification-url": "https://packagist.org/downloads/",
27
- "license": [
28
- "GPL-2.0"
29
- ],
30
- "description": "Pick an icon of your choice.",
31
- "homepage": "https://github.com/codeinwp/icon-picker",
32
- "keywords": [
33
- "dashicons",
34
- "elusive",
35
- "font-awesome",
36
- "foundation-icons",
37
- "genericons",
38
- "icons",
39
- "plugin",
40
- "wordpress"
41
- ]
42
- },
43
- {
44
- "name": "codeinwp/menu-item-custom-fields",
45
- "version": "dev-master",
46
- "version_normalized": "9999999-dev",
47
- "source": {
48
- "type": "git",
49
- "url": "https://github.com/Codeinwp/menu-item-custom-fields.git",
50
- "reference": "26a5849e5b60556fe577afa3622fff512b5826c4"
51
- },
52
- "dist": {
53
- "type": "zip",
54
- "url": "https://api.github.com/repos/Codeinwp/menu-item-custom-fields/zipball/26a5849e5b60556fe577afa3622fff512b5826c4",
55
- "reference": "26a5849e5b60556fe577afa3622fff512b5826c4",
56
- "shasum": ""
57
- },
58
- "require": {
59
- "composer/installers": "~1.0"
60
- },
61
- "require-dev": {
62
- "wp-coding-standards/wpcs": "^0.10.0"
63
- },
64
- "time": "2020-04-27 19:54:38",
65
- "type": "wordpress-plugin",
66
- "installation-source": "source",
67
- "notification-url": "https://packagist.org/downloads/",
68
- "license": [
69
- "GPL-2.0"
70
- ],
71
- "description": "Easily add custom fields to nav menu items.",
72
- "homepage": "https://github.com/Codeinwp/wp-menu-item-custom-fields",
73
- "keywords": [
74
- "custom-fields",
75
- "menu",
76
- "plugin",
77
- "wordpress"
78
- ]
79
- },
80
- {
81
- "name": "codeinwp/themeisle-sdk",
82
- "version": "3.2.15",
83
- "version_normalized": "3.2.15.0",
84
- "source": {
85
- "type": "git",
86
- "url": "https://github.com/Codeinwp/themeisle-sdk.git",
87
- "reference": "95b7447a5f4faba410c281c4bf278fbd740fed71"
88
- },
89
- "dist": {
90
- "type": "zip",
91
- "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/95b7447a5f4faba410c281c4bf278fbd740fed71",
92
- "reference": "95b7447a5f4faba410c281c4bf278fbd740fed71",
93
- "shasum": ""
94
- },
95
- "require-dev": {
96
- "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
97
- "squizlabs/php_codesniffer": "^3.1",
98
- "wp-coding-standards/wpcs": "^1.0.0"
99
- },
100
- "time": "2020-07-23 15:02:10",
101
- "type": "library",
102
- "installation-source": "dist",
103
- "notification-url": "https://packagist.org/downloads/",
104
- "license": [
105
- "GPL-2.0+"
106
- ],
107
- "authors": [
108
- {
109
- "name": "ThemeIsle team",
110
- "email": "friends@themeisle.com",
111
- "homepage": "https://themeisle.com"
112
- }
113
- ],
114
- "description": "ThemeIsle SDK.",
115
- "homepage": "https://github.com/Codeinwp/themeisle-sdk",
116
- "keywords": [
117
- "wordpress"
118
- ]
119
- },
120
- {
121
- "name": "codeinwp/gutenberg-menu-icons",
122
- "version": "1.0.4",
123
- "version_normalized": "1.0.4.0",
124
- "source": {
125
- "type": "git",
126
- "url": "https://github.com/Codeinwp/gutenberg-menu-icons.git",
127
- "reference": "121ef82c57a556301265cbd1032d28619235e488"
128
- },
129
- "dist": {
130
- "type": "zip",
131
- "url": "https://api.github.com/repos/Codeinwp/gutenberg-menu-icons/zipball/121ef82c57a556301265cbd1032d28619235e488",
132
- "reference": "121ef82c57a556301265cbd1032d28619235e488",
133
- "shasum": ""
134
- },
135
- "require-dev": {
136
- "automattic/vipwpcs": "^0.3.0 || ^1.0.0",
137
- "dealerdirect/phpcodesniffer-composer-installer": "0.6.2",
138
- "phpcompatibility/php-compatibility": "^9",
139
- "squizlabs/php_codesniffer": "^3.3",
140
- "wp-coding-standards/wpcs": "^1"
141
- },
142
- "time": "2020-05-17 21:08:46",
143
- "type": "library",
144
- "installation-source": "dist",
145
- "autoload": {
146
- "files": [
147
- "load.php"
148
- ]
149
- },
150
- "notification-url": "https://packagist.org/downloads/",
151
- "license": [
152
- "GPL-3.0-or-later"
153
- ],
154
- "authors": [
155
- {
156
- "name": "ThemeIsle team",
157
- "email": "friends@themeisle.com",
158
- "homepage": "https://themeisle.com"
159
- }
160
- ],
161
- "description": "Menu Icons for Gutenberg",
162
- "homepage": "https://github.com/Codeinwp/gutenberg-menu-icons"
163
- }
164
- ]
1
+ {
2
+ "packages": [
3
+ {
4
+ "name": "codeinwp/gutenberg-menu-icons",
5
+ "version": "1.0.4",
6
+ "version_normalized": "1.0.4.0",
7
+ "source": {
8
+ "type": "git",
9
+ "url": "https://github.com/Codeinwp/gutenberg-menu-icons.git",
10
+ "reference": "121ef82c57a556301265cbd1032d28619235e488"
11
+ },
12
+ "dist": {
13
+ "type": "zip",
14
+ "url": "https://api.github.com/repos/Codeinwp/gutenberg-menu-icons/zipball/121ef82c57a556301265cbd1032d28619235e488",
15
+ "reference": "121ef82c57a556301265cbd1032d28619235e488",
16
+ "shasum": ""
17
+ },
18
+ "require-dev": {
19
+ "automattic/vipwpcs": "^0.3.0 || ^1.0.0",
20
+ "dealerdirect/phpcodesniffer-composer-installer": "0.6.2",
21
+ "phpcompatibility/php-compatibility": "^9",
22
+ "squizlabs/php_codesniffer": "^3.3",
23
+ "wp-coding-standards/wpcs": "^1"
24
+ },
25
+ "time": "2020-05-17T21:08:46+00:00",
26
+ "type": "library",
27
+ "installation-source": "dist",
28
+ "autoload": {
29
+ "files": [
30
+ "load.php"
31
+ ]
32
+ },
33
+ "notification-url": "https://packagist.org/downloads/",
34
+ "license": [
35
+ "GPL-3.0-or-later"
36
+ ],
37
+ "authors": [
38
+ {
39
+ "name": "ThemeIsle team",
40
+ "email": "friends@themeisle.com",
41
+ "homepage": "https://themeisle.com"
42
+ }
43
+ ],
44
+ "description": "Menu Icons for Gutenberg",
45
+ "homepage": "https://github.com/Codeinwp/gutenberg-menu-icons",
46
+ "support": {
47
+ "issues": "https://github.com/Codeinwp/gutenberg-menu-icons/issues",
48
+ "source": "https://github.com/Codeinwp/gutenberg-menu-icons/tree/v1.0.4"
49
+ },
50
+ "install-path": "../codeinwp/gutenberg-menu-icons"
51
  },
52
+ {
53
+ "name": "codeinwp/icon-picker",
54
+ "version": "dev-master",
55
+ "version_normalized": "dev-master",
56
+ "source": {
57
+ "type": "git",
58
+ "url": "https://github.com/Codeinwp/icon-picker.git",
59
+ "reference": "0c60ce3a41653e41a20e710c4d5a6a2104c85020"
60
+ },
61
+ "dist": {
62
+ "type": "zip",
63
+ "url": "https://api.github.com/repos/Codeinwp/icon-picker/zipball/0c60ce3a41653e41a20e710c4d5a6a2104c85020",
64
+ "reference": "0c60ce3a41653e41a20e710c4d5a6a2104c85020",
65
+ "shasum": ""
66
+ },
67
+ "require": {
68
+ "composer/installers": "~1.0"
69
+ },
70
+ "require-dev": {
71
+ "wp-coding-standards/wpcs": "^0.10.0"
72
+ },
73
+ "time": "2021-05-05T18:52:26+00:00",
74
+ "default-branch": true,
75
+ "type": "wordpress-plugin",
76
+ "installation-source": "dist",
77
+ "notification-url": "https://packagist.org/downloads/",
78
+ "license": [
79
+ "GPL-2.0"
80
+ ],
81
+ "description": "Pick an icon of your choice.",
82
+ "homepage": "https://github.com/codeinwp/icon-picker",
83
+ "keywords": [
84
+ "dashicons",
85
+ "elusive",
86
+ "font-awesome",
87
+ "foundation-icons",
88
+ "genericons",
89
+ "icons",
90
+ "plugin",
91
+ "wordpress"
92
+ ],
93
+ "support": {
94
+ "source": "https://github.com/Codeinwp/icon-picker/tree/master"
95
+ },
96
+ "install-path": "../codeinwp/icon-picker"
97
  },
98
+ {
99
+ "name": "codeinwp/menu-item-custom-fields",
100
+ "version": "dev-master",
101
+ "version_normalized": "dev-master",
102
+ "source": {
103
+ "type": "git",
104
+ "url": "https://github.com/Codeinwp/menu-item-custom-fields.git",
105
+ "reference": "f491fcfa873e92006e3d92a4ede8775e9cf53bae"
106
+ },
107
+ "dist": {
108
+ "type": "zip",
109
+ "url": "https://api.github.com/repos/Codeinwp/menu-item-custom-fields/zipball/f491fcfa873e92006e3d92a4ede8775e9cf53bae",
110
+ "reference": "f491fcfa873e92006e3d92a4ede8775e9cf53bae",
111
+ "shasum": ""
112
+ },
113
+ "require": {
114
+ "composer/installers": "~1.0"
115
+ },
116
+ "require-dev": {
117
+ "wp-coding-standards/wpcs": "^0.10.0"
118
+ },
119
+ "time": "2021-05-05T18:49:57+00:00",
120
+ "default-branch": true,
121
+ "type": "wordpress-plugin",
122
+ "installation-source": "dist",
123
+ "notification-url": "https://packagist.org/downloads/",
124
+ "license": [
125
+ "GPL-2.0"
126
+ ],
127
+ "description": "Easily add custom fields to nav menu items.",
128
+ "homepage": "https://github.com/Codeinwp/wp-menu-item-custom-fields",
129
+ "keywords": [
130
+ "custom-fields",
131
+ "menu",
132
+ "plugin",
133
+ "wordpress"
134
+ ],
135
+ "support": {
136
+ "source": "https://github.com/Codeinwp/menu-item-custom-fields/tree/master"
137
+ },
138
+ "install-path": "../codeinwp/menu-item-custom-fields"
139
  },
140
+ {
141
+ "name": "codeinwp/themeisle-sdk",
142
+ "version": "dev-master",
143
+ "version_normalized": "dev-master",
144
+ "source": {
145
+ "type": "git",
146
+ "url": "https://github.com/Codeinwp/themeisle-sdk.git",
147
+ "reference": "24668ab249d8fb6596cc908c323205648aad0ed8"
148
+ },
149
+ "dist": {
150
+ "type": "zip",
151
+ "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/24668ab249d8fb6596cc908c323205648aad0ed8",
152
+ "reference": "24668ab249d8fb6596cc908c323205648aad0ed8",
153
+ "shasum": ""
154
+ },
155
+ "require-dev": {
156
+ "codeinwp/phpcs-ruleset": "dev-main"
157
+ },
158
+ "time": "2021-05-05T17:45:51+00:00",
159
+ "default-branch": true,
160
+ "type": "library",
161
+ "installation-source": "dist",
162
+ "notification-url": "https://packagist.org/downloads/",
163
+ "license": [
164
+ "GPL-2.0+"
165
+ ],
166
+ "authors": [
167
+ {
168
+ "name": "ThemeIsle team",
169
+ "email": "friends@themeisle.com",
170
+ "homepage": "https://themeisle.com"
171
+ }
172
+ ],
173
+ "description": "ThemeIsle SDK",
174
+ "homepage": "https://github.com/Codeinwp/themeisle-sdk",
175
+ "keywords": [
176
+ "wordpress"
177
+ ],
178
+ "support": {
179
+ "issues": "https://github.com/Codeinwp/themeisle-sdk/issues",
180
+ "source": "https://github.com/Codeinwp/themeisle-sdk/tree/master"
181
+ },
182
+ "install-path": "../codeinwp/themeisle-sdk"
183
+ }
184
+ ],
185
+ "dev": false,
186
+ "dev-package-names": []
187
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installed.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php return array (
2
+ 'root' =>
3
+ array (
4
+ 'pretty_version' => 'v0.12.6',
5
+ 'version' => '0.12.6.0',
6
+ 'aliases' =>
7
+ array (
8
+ ),
9
+ 'reference' => 'b68bc7edd282392450ee66e44aa35376ff08cd36',
10
+ 'name' => 'codeinwp/wp-menu-icons',
11
+ ),
12
+ 'versions' =>
13
+ array (
14
+ 'codeinwp/gutenberg-menu-icons' =>
15
+ array (
16
+ 'pretty_version' => '1.0.4',
17
+ 'version' => '1.0.4.0',
18
+ 'aliases' =>
19
+ array (
20
+ ),
21
+ 'reference' => '121ef82c57a556301265cbd1032d28619235e488',
22
+ ),
23
+ 'codeinwp/icon-picker' =>
24
+ array (
25
+ 'pretty_version' => 'dev-master',
26
+ 'version' => 'dev-master',
27
+ 'aliases' =>
28
+ array (
29
+ 0 => '9999999-dev',
30
+ ),
31
+ 'reference' => '0c60ce3a41653e41a20e710c4d5a6a2104c85020',
32
+ ),
33
+ 'codeinwp/menu-item-custom-fields' =>
34
+ array (
35
+ 'pretty_version' => 'dev-master',
36
+ 'version' => 'dev-master',
37
+ 'aliases' =>
38
+ array (
39
+ 0 => '9999999-dev',
40
+ ),
41
+ 'reference' => 'f491fcfa873e92006e3d92a4ede8775e9cf53bae',
42
+ ),
43
+ 'codeinwp/themeisle-sdk' =>
44
+ array (
45
+ 'pretty_version' => 'dev-master',
46
+ 'version' => 'dev-master',
47
+ 'aliases' =>
48
+ array (
49
+ 0 => '9999999-dev',
50
+ ),
51
+ 'reference' => '24668ab249d8fb6596cc908c323205648aad0ed8',
52
+ ),
53
+ 'codeinwp/wp-menu-icons' =>
54
+ array (
55
+ 'pretty_version' => 'v0.12.6',
56
+ 'version' => '0.12.6.0',
57
+ 'aliases' =>
58
+ array (
59
+ ),
60
+ 'reference' => 'b68bc7edd282392450ee66e44aa35376ff08cd36',
61
+ ),
62
+ 'composer/installers' =>
63
+ array (
64
+ 'replaced' =>
65
+ array (
66
+ 0 => '*',
67
+ ),
68
+ ),
69
+ ),
70
+ );