updated plugin Menu Icons version 0.13.2
				
					
				
			This commit is contained in:
		| @ -1,3 +1,11 @@ | ||||
| ##### [Version 0.13.2](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.1...v0.13.2) (2022-11-24) | ||||
|  | ||||
| * Fix - update dependencies | ||||
|  | ||||
| ##### [Version 0.13.1](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.0...v0.13.1) (2022-11-04) | ||||
|  | ||||
| Tested with the WordPress 6.1 version | ||||
|  | ||||
| #### [Version 0.13.0](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.12...v0.13.0) (2022-08-23) | ||||
|  | ||||
| * Fix Neve upsells showing up inconsistently on edge cases | ||||
|  | ||||
| @ -11,7 +11,7 @@ | ||||
|  * Plugin name: Menu Icons | ||||
|  * Plugin URI:  https://github.com/Codeinwp/wp-menu-icons | ||||
|  * Description: Spice up your navigation menus with pretty icons, easily. | ||||
|  * Version:     0.13.0 | ||||
|  * Version:     0.13.2 | ||||
|  * Author:      ThemeIsle | ||||
|  * Author URI:  https://themeisle.com | ||||
|  * License:     GPLv2 | ||||
| @ -29,7 +29,7 @@ final class Menu_Icons { | ||||
|  | ||||
| 	const DISMISS_NOTICE = 'menu-icons-dismiss-notice'; | ||||
|  | ||||
| 	const VERSION = '0.13.0'; | ||||
| 	const VERSION = '0.13.2'; | ||||
|  | ||||
| 	/** | ||||
| 	 * Holds plugin data | ||||
| @ -103,7 +103,7 @@ final class Menu_Icons { | ||||
| 		add_action( 'admin_action_menu_icon_hide_notice', array( __CLASS__, 'wp_menu_icons_dismiss_dashboard_notice' ) ); | ||||
|  | ||||
| 		add_filter( | ||||
| 			'wp_menu_icons_load_promotions', | ||||
| 			'menu_icons_load_promotions', | ||||
| 			function() { | ||||
| 				return array( 'otter' ); | ||||
| 			} | ||||
|  | ||||
| @ -2,7 +2,7 @@ | ||||
| Contributors: codeinwp, themeisle | ||||
| Tags: menu, nav-menu, icons, navigation | ||||
| Requires at least: 4.3 | ||||
| Tested up to: 6.0 | ||||
| Tested up to: 6.1 | ||||
| Stable tag: trunk | ||||
| License: GPLv2 | ||||
| License URI: http://www.gnu.org/licenses/gpl-2.0.html | ||||
| @ -225,6 +225,20 @@ Read [this blog post](http://kucrut.org/add-custom-image-sizes-right-way/). | ||||
|  | ||||
| == Changelog == | ||||
|  | ||||
| ##### [Version 0.13.2](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.1...v0.13.2) (2022-11-24) | ||||
|  | ||||
| * Fix - update dependencies | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| ##### [Version 0.13.1](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.0...v0.13.1) (2022-11-04) | ||||
|  | ||||
| Tested with the WordPress 6.1 version | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| #### [Version 0.13.0](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.12...v0.13.0) (2022-08-23) | ||||
|  | ||||
| * Fix Neve upsells showing up inconsistently on edge cases | ||||
|  | ||||
| @ -3,10 +3,23 @@ | ||||
| // autoload.php @generated by Composer | ||||
|  | ||||
| if (PHP_VERSION_ID < 50600) { | ||||
|     echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; | ||||
|     exit(1); | ||||
|     if (!headers_sent()) { | ||||
|         header('HTTP/1.1 500 Internal Server Error'); | ||||
|     } | ||||
|     $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; | ||||
|     if (!ini_get('display_errors')) { | ||||
|         if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { | ||||
|             fwrite(STDERR, $err); | ||||
|         } elseif (!headers_sent()) { | ||||
|             echo $err; | ||||
|         } | ||||
|     } | ||||
|     trigger_error( | ||||
|         $err, | ||||
|         E_USER_ERROR | ||||
|     ); | ||||
| } | ||||
|  | ||||
| require_once __DIR__ . '/composer/autoload_real.php'; | ||||
|  | ||||
| return ComposerAutoloaderInitc174f46a75555c6eef9a3e0706b0c0ab::getLoader(); | ||||
| return ComposerAutoloaderIniteaa5284efc067d9aba27d7d8f1a0b978::getLoader(); | ||||
|  | ||||
| @ -1,3 +1,22 @@ | ||||
| ##### [Version 3.2.31](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.30...v3.2.31) (2022-11-23) | ||||
|  | ||||
| - improve the promotions module | ||||
|  | ||||
| ##### [Version 3.2.30](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.29...v3.2.30) (2022-09-15) | ||||
|  | ||||
| - fix filesystem wrong use - ref [#138](https://github.com/Codeinwp/themeisle-sdk/issues/138), props [@ethanclevenger91](https://github.com/ethanclevenger91) for reporting | ||||
|  | ||||
| ##### [Version 3.2.29](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.28...v3.2.29) (2022-09-08) | ||||
|  | ||||
| * Adds compatibility mechanism | ||||
| * Adds content utms | ||||
| * Adds usage time on uninstall feedback | ||||
|  | ||||
| ##### [Version 3.2.28](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.27...v3.2.28) (2022-08-30) | ||||
|  | ||||
| * Adds utm handler | ||||
| * Improve promotions | ||||
|  | ||||
| ##### [Version 3.2.27](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.26...v3.2.27) (2022-08-23) | ||||
|  | ||||
| - Add Promotion Module | ||||
|  | ||||
							
								
								
									
										31
									
								
								wp-content/plugins/menu-icons/vendor/codeinwp/themeisle-sdk/assets/images/optimole-logo.svg
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								wp-content/plugins/menu-icons/vendor/codeinwp/themeisle-sdk/assets/images/optimole-logo.svg
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| After Width: | Height: | Size: 36 KiB | 
| @ -1 +1 @@ | ||||
| <?php return array('dependencies' => array('wp-api', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'a1e161cc7b075bdd9250'); | ||||
| <?php return array('dependencies' => array('wp-api', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins'), 'version' => '4990ea029287f2766945'); | ||||
|  | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										1
									
								
								wp-content/plugins/menu-icons/vendor/codeinwp/themeisle-sdk/assets/js/build/style-index.css
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								wp-content/plugins/menu-icons/vendor/codeinwp/themeisle-sdk/assets/js/build/style-index.css
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| .ti-sdk-om-notice{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2e47ba;border-left-color:#3858e9;padding:0;position:relative}.ti-sdk-om-notice .content{align-items:center;background:hsla(0,0%,100%,.75);display:flex;padding:15px 20px}.ti-sdk-om-notice img{display:none;margin-right:20px;max-width:100px}.ti-sdk-om-notice .description{color:#000;font-size:14px;margin-bottom:20px}.ti-sdk-om-notice .actions{display:flex;gap:20px;margin-bottom:0;margin-top:auto}.ti-sdk-om-notice form{display:flex;gap:10px}.ti-sdk-om-notice .form-wrap{display:grid}.ti-sdk-om-notice .form-wrap span{font-weight:500;margin-bottom:5px}.ti-sdk-om-notice input{border-radius:0;min-width:250px}.ti-sdk-om-notice a.components-button{align-items:center;display:flex;justify-content:center}.ti-sdk-om-notice .done{align-items:flex-start;display:flex;flex-direction:column}.ti-sdk-om-notice .done a{width:auto}@media screen and (min-width:768px){.ti-sdk-om-notice img{display:block}}.compat-field-optimole th{display:none!important}.compat-field-optimole td{width:100%!important}.compat-field-optimole .ti-sdk-om-notice{margin:0}.om-notice-dismiss{position:absolute;right:10px;text-decoration:none!important;top:10px}.om-notice-dismiss:before{content:none}.ti-om-stack-wrap .om-stack-notice{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2e47ba;align-items:center;display:flex;flex-direction:column;padding:20px 10px;position:relative;text-align:center}.ti-om-stack-wrap .om-stack-notice>span{display:none}.ti-om-stack-wrap .om-stack-notice img{max-width:90px!important}.ti-om-stack-wrap .om-stack-notice h2{font-size:18px;font-weight:600;margin:30px auto 10px}.ti-om-stack-wrap .om-stack-notice p{font-size:13px;line-height:17px;margin:0 auto;max-width:250px}.ti-om-stack-wrap .om-stack-notice i{color:#757575;font-size:12px;margin-top:10px}.ti-om-stack-wrap .om-stack-notice .cta{margin:20px auto 0;padding:10px 25px!important}.ti-om-stack-wrap .om-stack-notice .om-notice-dismiss{color:inherit}.ti-om-stack-wrap .om-stack-notice input{border-radius:0}.ti-om-stack-wrap .om-stack-notice form{display:grid;gap:10px;margin-top:10px;place-items:center;width:75%}.ti-om-stack-wrap .om-stack-notice .done{display:grid;gap:10px;margin-top:15px}.ti-om-stack-wrap .om-stack-notice .done p{font-size:15px;font-weight:500}.ti-om-stack-wrap .om-stack-notice .om-progress{margin:20px 0}.om-progress{align-items:center;display:flex;font-size:14px;gap:5px}.om-progress .spin{animation:om-rotation 2s linear infinite}@keyframes om-rotation{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}.ti-sdk-om-promo.hidden{display:none} | ||||
| @ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) { | ||||
| 	return; | ||||
| } | ||||
| // Current SDK version and path. | ||||
| $themeisle_sdk_version = '3.2.27'; | ||||
| $themeisle_sdk_version = '3.2.31'; | ||||
| $themeisle_sdk_path    = dirname( __FILE__ ); | ||||
|  | ||||
| global $themeisle_sdk_max_version; | ||||
| @ -71,3 +71,105 @@ if ( ! function_exists( 'themeisle_sdk_load_latest' ) ) : | ||||
| 	} | ||||
| endif; | ||||
| add_action( 'init', 'themeisle_sdk_load_latest' ); | ||||
|  | ||||
| if ( ! function_exists( 'tsdk_utmify' ) ) { | ||||
| 	/** | ||||
| 	 * Utmify a link. | ||||
| 	 * | ||||
| 	 * @param string $url URL to add utms. | ||||
| 	 * @param string $area Area in page where this is used ( CTA, image, section name). | ||||
| 	 * @param string $location Location, such as customizer, about page. | ||||
| 	 * | ||||
| 	 * @return string | ||||
| 	 */ | ||||
| 	function tsdk_utmify( $url, $area, $location = null ) { | ||||
| 		static $current_page = null; | ||||
| 		if ( $location === null && $current_page === null ) { | ||||
| 			global $pagenow; | ||||
| 			$screen       = function_exists( 'get_current_screen' ) ? get_current_screen() : $pagenow; | ||||
| 			$current_page = isset( $screen->id ) ? $screen->id : ( ( $screen === null ) ? 'non-admin' : $screen ); | ||||
| 			$current_page = sanitize_key( str_replace( '.php', '', $current_page ) ); | ||||
| 		} | ||||
| 		$location = $location === null ? $current_page : $location; | ||||
| 		$content  = sanitize_key( | ||||
| 			trim( | ||||
| 				str_replace( | ||||
| 					[ | ||||
| 						'https://', | ||||
| 						'themeisle.com', | ||||
| 						'/themes/', | ||||
| 						'/plugins/', | ||||
| 						'/upgrade', | ||||
| 					], | ||||
| 					'', | ||||
| 					$url  | ||||
| 				), | ||||
| 				'/'  | ||||
| 			)  | ||||
| 		); | ||||
| 		return esc_url_raw( | ||||
| 			add_query_arg( | ||||
| 				[ | ||||
| 					'utm_source'   => 'wpadmin', | ||||
| 					'utm_medium'   => $location, | ||||
| 					'utm_campaign' => $area, | ||||
| 					'utm_content'  => $content, | ||||
| 				], | ||||
| 				$url  | ||||
| 			)  | ||||
| 		); | ||||
| 	} | ||||
|  | ||||
| 	add_filter( 'tsdk_utmify', 'tsdk_utmify', 10, 3 ); | ||||
| } | ||||
|  | ||||
|  | ||||
| if ( ! function_exists( 'tsdk_lstatus' ) ) { | ||||
| 	/** | ||||
| 	 * Check license status. | ||||
| 	 * | ||||
| 	 * @param string $file Product basefile. | ||||
| 	 * | ||||
| 	 * @return string Status. | ||||
| 	 */ | ||||
| 	function tsdk_lstatus( $file ) { | ||||
| 		return \ThemeisleSDK\Modules\Licenser::status( $file ); | ||||
| 	} | ||||
| } | ||||
| if ( ! function_exists( 'tsdk_lis_valid' ) ) { | ||||
| 	/** | ||||
| 	 * Check if license is valid. | ||||
| 	 * | ||||
| 	 * @param string $file Product basefile. | ||||
| 	 * | ||||
| 	 * @return bool Validness. | ||||
| 	 */ | ||||
| 	function tsdk_lis_valid( $file ) { | ||||
| 		return \ThemeisleSDK\Modules\Licenser::is_valid( $file ); | ||||
| 	} | ||||
| } | ||||
| if ( ! function_exists( 'tsdk_lplan' ) ) { | ||||
| 	/** | ||||
| 	 * Get license plan. | ||||
| 	 * | ||||
| 	 * @param string $file Product basefile. | ||||
| 	 * | ||||
| 	 * @return string Plan. | ||||
| 	 */ | ||||
| 	function tsdk_lplan( $file ) { | ||||
| 		return \ThemeisleSDK\Modules\Licenser::plan( $file ); | ||||
| 	} | ||||
| } | ||||
|  | ||||
| if ( ! function_exists( 'tsdk_lkey' ) ) { | ||||
| 	/** | ||||
| 	 * Get license key. | ||||
| 	 * | ||||
| 	 * @param string $file Product basefile. | ||||
| 	 * | ||||
| 	 * @return string Key. | ||||
| 	 */ | ||||
| 	function tsdk_lkey( $file ) { | ||||
| 		return \ThemeisleSDK\Modules\Licenser::key( $file ); | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @ -56,6 +56,7 @@ final class Loader { | ||||
| 		'recommendation', | ||||
| 		'notification', | ||||
| 		'promotions', | ||||
| 		'compatibilities', | ||||
| 	]; | ||||
|  | ||||
| 	/** | ||||
|  | ||||
							
								
								
									
										236
									
								
								wp-content/plugins/menu-icons/vendor/codeinwp/themeisle-sdk/src/Modules/Compatibilities.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										236
									
								
								wp-content/plugins/menu-icons/vendor/codeinwp/themeisle-sdk/src/Modules/Compatibilities.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,236 @@ | ||||
| <?php | ||||
| /** | ||||
|  * The compatibilities model class for ThemeIsle SDK | ||||
|  * | ||||
|  * @package     ThemeIsleSDK | ||||
|  * @subpackage  Modules | ||||
|  * @copyright   Copyright (c) 2017, Marius Cristea | ||||
|  * @license     http://opensource.org/licenses/gpl-3.0.php GNU Public License | ||||
|  * @since       1.0.0 | ||||
|  */ | ||||
|  | ||||
| namespace ThemeisleSDK\Modules; | ||||
|  | ||||
| use ThemeisleSDK\Common\Abstract_Module; | ||||
| use ThemeisleSDK\Product; | ||||
|  | ||||
| // Exit if accessed directly. | ||||
| if ( ! defined( 'ABSPATH' ) ) { | ||||
| 	exit; | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Promotions module for ThemeIsle SDK. | ||||
|  */ | ||||
| class Compatibilities extends Abstract_Module { | ||||
| 	const REQUIRED  = 'required'; | ||||
| 	const TESTED_UP = 'tested_up'; | ||||
|  | ||||
| 	/** | ||||
| 	 * Should we load this module. | ||||
| 	 * | ||||
| 	 * @param Product $product Product object. | ||||
| 	 * | ||||
| 	 * @return bool | ||||
| 	 */ | ||||
| 	public function can_load( $product ) { | ||||
| 		if ( $this->is_from_partner( $product ) ) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		if ( $product->is_theme() && ! current_user_can( 'switch_themes' ) ) { | ||||
| 			return false; | ||||
| 		} | ||||
|  | ||||
| 		if ( $product->is_plugin() && ! current_user_can( 'install_plugins' ) ) { | ||||
| 			return false; | ||||
| 		} | ||||
|  | ||||
| 		return true; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Registers the hooks. | ||||
| 	 * | ||||
| 	 * @param Product $product Product to load. | ||||
| 	 * | ||||
| 	 * @throws \Exception If the configuration is invalid. | ||||
| 	 * | ||||
| 	 * @return Compatibilities Module instance. | ||||
| 	 */ | ||||
| 	public function load( $product ) { | ||||
|  | ||||
|  | ||||
| 		$this->product = $product; | ||||
|  | ||||
| 		$compatibilities = apply_filters( 'themeisle_sdk_compatibilities/' . $this->product->get_slug(), [] ); | ||||
| 		if ( empty( $compatibilities ) ) { | ||||
| 			return $this; | ||||
| 		} | ||||
| 		$requirement = null; | ||||
| 		$check_type  = null; | ||||
| 		foreach ( $compatibilities as $compatibility ) { | ||||
|  | ||||
| 			if ( empty( $compatibility['basefile'] ) ) { | ||||
| 				return $this; | ||||
| 			} | ||||
| 			$requirement = new Product( $compatibility['basefile'] ); | ||||
| 			$tested_up   = isset( $compatibility[ self::TESTED_UP ] ) ? $compatibility[ self::TESTED_UP ] : '999'; | ||||
| 			$required    = $compatibility[ self::REQUIRED ]; | ||||
| 			if ( ! version_compare( $required, $tested_up, '<' ) ) { | ||||
| 				throw new \Exception( sprintf( 'Invalid required/tested_up configuration. Required version %s should be lower than tested_up %s.', $required, $tested_up ) ); | ||||
| 			} | ||||
| 			$check_type = self::REQUIRED; | ||||
| 			if ( ! version_compare( $requirement->get_version(), $required, '<' ) ) { | ||||
| 				$check_type = self::TESTED_UP; | ||||
| 				if ( version_compare( $requirement->get_version(), $tested_up . '.9999', '<' ) ) { | ||||
| 					return $this; | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
| 			break; | ||||
| 		} | ||||
| 		if ( empty( $requirement ) ) { | ||||
| 			return $this; | ||||
| 		} | ||||
| 		if ( $check_type === self::REQUIRED ) { | ||||
| 			$this->mark_required( $product, $requirement ); | ||||
| 		} | ||||
| 		if ( $check_type === self::TESTED_UP ) { | ||||
| 			$this->mark_testedup( $product, $requirement ); | ||||
| 		} | ||||
|  | ||||
| 		return $this; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Mark the product tested up. | ||||
| 	 * | ||||
| 	 * @param Product $product Product object. | ||||
| 	 * @param Product $requirement Requirement object. | ||||
| 	 * | ||||
| 	 * @return void | ||||
| 	 */ | ||||
| 	public function mark_testedup( $product, $requirement ) { | ||||
| 		add_action( | ||||
| 			'admin_head', | ||||
| 			function () use ( $product, $requirement ) { | ||||
| 				$screen = function_exists( 'get_current_screen' ) ? get_current_screen() : ''; | ||||
|  | ||||
| 				if ( empty( $screen ) || ! isset( $screen->id ) ) { | ||||
| 					return; | ||||
| 				} | ||||
| 				if ( $requirement->is_theme() && $screen->id === 'themes' ) { | ||||
| 					?> | ||||
| 				<script type="text/javascript"> | ||||
| 					jQuery(document).ready(function ($) { | ||||
| 						setInterval(checkTheme, 500); | ||||
| 						function checkTheme() { | ||||
| 							var theme = jQuery( '.theme.active[data-slug="<?php echo esc_attr( $requirement->get_slug() ); ?>"]' ); | ||||
| 							var notice_id = 'testedup<?php echo esc_attr( $requirement->get_slug() . $product->get_slug() ); ?>'; | ||||
| 							var product_name = '<?php echo esc_attr( $product->get_friendly_name() ); ?>'; | ||||
| 							if (theme.length > 0 && jQuery('#' + notice_id).length === 0) { | ||||
| 								theme.find('.theme-id-container').prepend('<div style="bottom:100%;top:auto;" id="'+notice_id+'" class="notice notice-warning"><strong>Warning:</strong> This theme has not been tested with your current version of <strong>' + product_name +'</strong>. Please update '+product_name+' plugin.</div>'); | ||||
| 							} | ||||
| 							if (theme.length > 0 && jQuery('#' + notice_id + 'overlay').length === 0) { | ||||
| 								jQuery('.theme-overlay.active .theme-author').after('<div style="bottom:100%;top:auto;" id="'+notice_id+'overlay" class="notice notice-warning"><p><strong>Warning:</strong> This theme has not been tested with your current version of <strong>' + product_name +'</strong>. Please update '+product_name+' plugin.</p></div>'); | ||||
| 							} | ||||
| 						} | ||||
| 					}) | ||||
|  | ||||
| 				</script> | ||||
| 					<?php | ||||
| 				} | ||||
| 				if ( $requirement->is_plugin() && $screen->id === 'plugins' ) { | ||||
| 					?> | ||||
| 				<script type="text/javascript"> | ||||
| 					jQuery(document).ready(function ($) { | ||||
| 						setInterval(checkPlugin, 500); | ||||
| 						function checkPlugin() { | ||||
| 							var plugin = jQuery( '.plugins .active[data-slug="<?php echo esc_attr( $requirement->get_slug() ); ?>"]' ); | ||||
| 							var notice_id = 'testedup<?php echo esc_attr( $requirement->get_slug() . $product->get_slug() ); ?>'; | ||||
| 							var product_name = '<?php echo esc_attr( $product->get_friendly_name() ); ?>'; | ||||
| 							var product_type = '<?php echo ( $product->is_plugin() ? 'plugin' : 'theme' ); ?>'; | ||||
| 							if (plugin.length > 0 && jQuery('#' + notice_id).length === 0) { | ||||
| 								plugin.find('.column-description').append('<div style="bottom:100%;top:auto;" id="'+notice_id+'" class="notice notice-warning notice-alt notice-inline"><strong>Warning:</strong> This plugin has not been tested with your current version of <strong>' + product_name +'</strong>. Please update '+product_name+' '+product_type+'.</div>'); | ||||
| 							} | ||||
| 						} | ||||
| 					}) | ||||
|  | ||||
| 				</script> | ||||
| 					<?php | ||||
| 				} | ||||
| 			}  | ||||
| 		); | ||||
|  | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Mark the product requirements. | ||||
| 	 * | ||||
| 	 * @param Product $product Product object. | ||||
| 	 * @param Product $requirement Requirement object. | ||||
| 	 * | ||||
| 	 * @return void | ||||
| 	 */ | ||||
| 	public function mark_required( $product, $requirement ) { | ||||
| 		add_filter( | ||||
| 			'upgrader_pre_download', | ||||
| 			function ( $return, $package, $upgrader ) use ( $product, $requirement ) { | ||||
| 				/** | ||||
| 				 * Upgrader object. | ||||
| 				 * | ||||
| 				 * @var \WP_Upgrader $upgrader Upgrader object. | ||||
| 				 */ | ||||
| 				$should_block = false; | ||||
| 				if ( $product->is_theme() | ||||
| 					 && property_exists( $upgrader, 'skin' ) | ||||
| 					 && property_exists( $upgrader->skin, 'theme_info' ) | ||||
| 					 && $upgrader->skin->theme_info->template === $product->get_slug() ) { | ||||
| 					$should_block = true; | ||||
|  | ||||
| 				} | ||||
| 				if ( ! $should_block && $product->is_plugin() | ||||
| 					 && property_exists( $upgrader, 'skin' ) | ||||
| 					 && property_exists( $upgrader->skin, 'plugin_info' ) | ||||
| 					 && $upgrader->skin->plugin_info['Name'] === $product->get_name() ) { | ||||
| 					$should_block = true; | ||||
| 				} | ||||
| 				if ( $should_block ) { | ||||
| 					echo( sprintf( | ||||
| 						'%s update requires a newer version of %s. Please %supdate%s %s %s.', | ||||
| 						esc_attr( $product->get_friendly_name() ), | ||||
| 						esc_attr( $requirement->get_friendly_name() ), | ||||
| 						'<a href="' . esc_url( admin_url( $requirement->is_theme() ? 'themes.php' : 'plugins.php' ) ) . '">', | ||||
| 						'</a>', | ||||
| 						esc_attr( $requirement->get_friendly_name() ), | ||||
| 						esc_attr( $requirement->is_theme() ? 'theme' : 'plugin' ) | ||||
| 					) ); | ||||
| 					$upgrader->maintenance_mode( false ); | ||||
| 					die(); | ||||
| 				} | ||||
|  | ||||
| 				return $return; | ||||
| 			}, | ||||
| 			10, | ||||
| 			3 | ||||
| 		); | ||||
|  | ||||
| 		add_action( | ||||
| 			'admin_notices', | ||||
| 			function () use ( $product, $requirement ) { | ||||
| 				echo '<div class="notice notice-error "><p>'; | ||||
| 				echo( sprintf( | ||||
| 					'%s requires a newer version of %s. Please %supdate%s %s %s to the latest version.', | ||||
| 					'<strong>' . esc_attr( $product->get_friendly_name() ) . '</strong>', | ||||
| 					'<strong>' . esc_attr( $requirement->get_friendly_name() ) . '</strong>', | ||||
| 					'<a href="' . esc_url( admin_url( $requirement->is_theme() ? 'themes.php' : 'plugins.php' ) ) . '">', | ||||
| 					'</a>', | ||||
| 					'<strong>' . esc_attr( $requirement->get_friendly_name() ) . '</strong>', | ||||
| 					esc_attr( $requirement->is_theme() ? 'theme' : 'plugin' ) | ||||
| 				) ); | ||||
| 				echo '</p></div>'; | ||||
| 			} | ||||
| 		); | ||||
|  | ||||
| 	} | ||||
| } | ||||
| @ -131,8 +131,9 @@ class Dashboard_Widget extends Abstract_Module { | ||||
| 			#themeisle h2.hndle { | ||||
| 				background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABbCAMAAADncTNAAAAAtFBMVEVHcEyAgIB/f3+xsbGgoaGBgYGCgoKKioqAgIC1tbW5ubnFx8iAgIDU1taBgYGCgoKAgIC0tLXW19jW2NiAgIC3uLiBgYHLzMy4uLhycnLW19d/f3/T1NW0tLTX19mVlZWvr6+BgYHl5eWKiottbW5JSUnW2Nm5ubnh4eHT1NWVlZVjY2N4eHh9fX6pqqq+v79PT0/39/fu7u7Nzc7Z2ttYWFgBAQHDw8P////JysoZGRk0NTZqJc/sAAAAIXRSTlMA0FL7/oEnEPL6eibivm9gwJya76/enFq2CXI+2lFAyM8GATmPAAADj0lEQVR4Xu2YaW/iOhSGAwRCWDosnXa6znjJvm8svf//f12TuARyhiR2pfnUR6gSEnr0+uT4xK7yRb755pvhHePli5K7Bfpkuhoq8ozRJdMH+WWha6Z3sqYparCSLRJqspjImVbANJU03cNMMpofAwQZCGsmpQYyFvVM0Q00OQ9koMl5IPcCoro+RA1Dt2Ea9n9eZ0+YHJLkgIlkDywQx00wCTyaReiKH8LbNU9ybJOdkchV6QFxyCFLbVvdfaREqgUWg/tx2UbqIcK2Hex2TdGLwFTjIj3XP3YfCZFsb23KRZn/3263oymSFI0/a5S4PqUBjoBIJBDjeEhCN0wxQSRybIxtJ3K5SGzuE/vAwIQc8ZmMMJFAIM4oikZItfEFtorGgoE43FObwqHU68OtPCnOz8KZ2Jbl5LgkSW0Tc7YyIz/EFWmS4jMbiZU5mJOmKRaJpKGGyLZtDJh3iyaNUu/3+xyKnrtFL71EG+FTiMpENhQtxUQ8kSOXCIr2tnCNhg/gTX0SHYFp0t7TCwQZ7U841yoHrW6rtGroUwTWVnLMssxx+H4bgZcSOFf5MYx0Ae8FghomMDyC2EBNImBywPkNTDNqGLQpIg2TjUNU8tBy9DQMo0DAZF16rAi7vJAtFTIYFAHUc6hIRW6OuOhJgaCSwmDEAYK4oa7ro+qIEyJU/US7KTJKPNSFT9tFgVFBu0SF1y7yjX4masRA9Da7EFGj28R/BkQz6xGIOurkx38T/bKs9Uk8aIiMwm/Jw0VP1yLrJwt13xAxvABBgsK4KWLov35DkRF7ZaqgzuZ7MQ8MOntmVYyAqKTwaICKqvSUFnVccMN5sziEP/5+xGDTahbH5Q3ZB76zr8fI+nJtvUUU3t3ml5GKviK/npCg3CGodnuJ4JVkfRFJYGVDBZrqKnn9RLf+CzDTS5PaN5J38+auzX4ykU4Qoj0rdKfcYs5ijfo9OL/uRUgZyQr7NCWtWwiUSLc4arfJa7lpszTA1OJZAQ8w8dXFrR5YHzCWSnS3pZ18tOi4Ps4vl/c7i/6qomjRecN+UubrPyPGn/VEMU3T0UFHkaPzpgjxmJsnjmrtionlMDZiog0TsY/DPtn8SXtlBvbtxKtwopy7lqW3smQO+yoGE1Uu55GJ3pmI8ygoejZNnqj0vnIRCyTKfLstRdtStGQi09myUsvwvlkuzSUXbV+Xz5ryBebV33fln/A/moud69FZiEYAAAAASUVORK5CYII='); | ||||
| 				background-repeat: no-repeat; | ||||
| 				background-position: 92% 50%; | ||||
| 				background-position: 2% 50%; | ||||
| 				background-size: 25px; | ||||
| 				padding-left: 39px; | ||||
| 			} | ||||
|  | ||||
| 			#themeisle .inside { | ||||
|  | ||||
| @ -24,13 +24,30 @@ if ( ! defined( 'ABSPATH' ) ) { | ||||
|  * Licenser module for ThemeIsle SDK. | ||||
|  */ | ||||
| class Licenser extends Abstract_Module { | ||||
|  | ||||
| 	/** | ||||
| 	 * License VALID status string. | ||||
| 	 */ | ||||
| 	const STATUS_VALID = 'valid'; | ||||
| 	/** | ||||
| 	 * License NOT_ACTIVE status string. | ||||
| 	 */ | ||||
| 	const STATUS_NOT_ACTIVE = 'not_active'; | ||||
| 	/** | ||||
| 	 * License active expired status string. | ||||
| 	 */ | ||||
| 	const STATUS_ACTIVE_EXPIRED = 'active_expired'; | ||||
| 	/** | ||||
| 	 * Number of max failed checks before showing the license message. | ||||
| 	 * | ||||
| 	 * @var int $max_failed Maximum failed checks allowed before show the notice | ||||
| 	 */ | ||||
| 	private static $max_failed = 2; | ||||
| 	private static $max_failed = 1; | ||||
| 	/** | ||||
| 	 * Flag to check if the global actions were loaded. | ||||
| 	 * | ||||
| 	 * @var bool If the globals actions were loaded. | ||||
| 	 */ | ||||
| 	private static $globals_loaded = false; | ||||
| 	/** | ||||
| 	 * License key string. | ||||
| 	 * | ||||
| @ -215,6 +232,76 @@ class Licenser extends Abstract_Module { | ||||
| 		return ( 'valid' === $status && isset( $license_data->is_expired ) && 'yes' === $license_data->is_expired ) ? 'active_expired' : $status; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Check status. | ||||
| 	 * | ||||
| 	 * @param string $product_file Product basefile. | ||||
| 	 * | ||||
| 	 * @return string Status license. | ||||
| 	 */ | ||||
| 	public static function status( $product_file ) { | ||||
| 		$product = Product::get( $product_file ); | ||||
| 		if ( ! $product->requires_license() ) { | ||||
| 			return self::STATUS_VALID; | ||||
| 		} | ||||
| 		$license_data = self::get_license_data( $product->get_key() ); | ||||
|  | ||||
| 		$status = isset( $license_data->license ) ? $license_data->license : self::STATUS_NOT_ACTIVE; | ||||
|  | ||||
| 		return ( 'valid' === $status && isset( $license_data->is_expired ) && 'yes' === $license_data->is_expired ) ? 'active_expired' : $status; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Product license data. | ||||
| 	 * | ||||
| 	 * @param string $key Product key. | ||||
| 	 * | ||||
| 	 * @return false|mixed|null | ||||
| 	 */ | ||||
| 	private static function get_license_data( $key ) { | ||||
| 		$license_data = get_option( $key . '_license_data', '' ); | ||||
|  | ||||
| 		return isset( $license_data->license ) ? $license_data : false; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Check if license is valid. | ||||
| 	 * | ||||
| 	 * @param string $product_file Product basefile. | ||||
| 	 * | ||||
| 	 * @return bool Is valid? | ||||
| 	 */ | ||||
| 	public static function is_valid( $product_file ) { | ||||
| 		return self::status( $product_file ) === self::STATUS_VALID; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get product plan. | ||||
| 	 * | ||||
| 	 * @param string $product_file Product file. | ||||
| 	 * | ||||
| 	 * @return int Plan id. | ||||
| 	 */ | ||||
| 	public static function plan( $product_file ) { | ||||
| 		$product = Product::get( $product_file ); | ||||
| 		$data    = self::get_license_data( $product->get_key() ); | ||||
|  | ||||
| 		return isset( $data->price_id ) ? (int) $data->price_id : - 1; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get product license key. | ||||
| 	 * | ||||
| 	 * @param string $product_file Product file. | ||||
| 	 * | ||||
| 	 * @return string | ||||
| 	 */ | ||||
| 	public static function key( $product_file ) { | ||||
| 		$product = Product::get( $product_file ); | ||||
|  | ||||
| 		return $product->get_license(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Return the last error message. | ||||
| 	 * | ||||
| @ -256,12 +343,7 @@ class Licenser extends Abstract_Module { | ||||
| 	 * @return int License plan. | ||||
| 	 */ | ||||
| 	public function get_plan() { | ||||
| 		$license_data = get_option( $this->product->get_key() . '_license_data', '' ); | ||||
| 		if ( ! isset( $license_data->price_id ) ) { | ||||
| 			return - 1; | ||||
| 		} | ||||
|  | ||||
| 		return (int) $license_data->price_id; | ||||
| 		return self::plan( $this->product->get_basefile() ); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| @ -379,7 +461,7 @@ class Licenser extends Abstract_Module { | ||||
| 			return $this->get_api_url(); | ||||
| 		} | ||||
|  | ||||
| 		return $this->get_api_url() . '/checkout/?edd_license_key=' . $license_data->key . '&download_id=' . $license_data->download_id; | ||||
| 		return trim( $this->get_api_url(), '/' ) . '/checkout/?edd_license_key=' . $license_data->key . '&download_id=' . $license_data->download_id; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| @ -853,7 +935,13 @@ class Licenser extends Abstract_Module { | ||||
| 			$this->failed_checks = intval( get_option( $this->product->get_key() . '_failed_checks', 0 ) ); | ||||
| 			$this->register_license_hooks(); | ||||
| 		} | ||||
|  | ||||
| 		if ( ! self::$globals_loaded ) { | ||||
| 			add_filter( 'themeisle_sdk_license/status', [ __CLASS__, 'status' ], 999, 1 ); | ||||
| 			add_filter( 'themeisle_sdk_license/is-valid', [ __CLASS__, 'is_valid' ], 999, 1 ); | ||||
| 			add_filter( 'themeisle_sdk_license/plan', [ __CLASS__, 'plan' ], 999, 1 ); | ||||
| 			add_filter( 'themeisle_sdk_license/key', [ __CLASS__, 'key' ], 999, 1 ); | ||||
| 			$globals_loaded = true; | ||||
| 		} | ||||
| 		$namespace = apply_filters( 'themesle_sdk_namespace_' . md5( $product->get_basefile() ), false ); | ||||
|  | ||||
| 		if ( false !== $namespace ) { | ||||
| @ -880,6 +968,20 @@ class Licenser extends Abstract_Module { | ||||
| 			); | ||||
| 			add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 ); | ||||
| 			add_filter( 'http_request_args', array( $this, 'http_request_args' ), 10, 2 ); //phpcs:ignore WordPressVIPMinimum.Hooks.RestrictedHooks.http_request_args | ||||
| 			if ( ! self::is_valid( $product->get_basefile() ) ) { | ||||
| 				add_filter( | ||||
| 					'plugin_action_links_' . plugin_basename( $product->get_basefile() ), | ||||
| 					function ( $actions ) { | ||||
| 						if ( $this->get_license_status( true ) !== self::STATUS_ACTIVE_EXPIRED ) { | ||||
| 							return $actions; | ||||
| 						} | ||||
| 						$new_actions['deactivate'] = $actions['deactivate']; | ||||
| 						$new_actions['renew_link'] = '<a style="color:#d63638" href="' . esc_url( $this->renew_url() ) . '" target="_blank" rel="external noopener noreferrer">Renew license to update</a>'; | ||||
|  | ||||
| 						return $new_actions; | ||||
| 					}  | ||||
| 				); | ||||
| 			} | ||||
|  | ||||
| 			return $this; | ||||
| 		} | ||||
|  | ||||
| @ -25,12 +25,48 @@ if ( ! defined( 'ABSPATH' ) ) { | ||||
|  * Promotions module for ThemeIsle SDK. | ||||
|  */ | ||||
| class Promotions extends Abstract_Module { | ||||
|  | ||||
| 	/** | ||||
| 	 * Fetched feeds items. | ||||
| 	 * Holds the promotions. | ||||
| 	 * | ||||
| 	 * @var array Feed items. | ||||
| 	 * @var array | ||||
| 	 */ | ||||
| 	private $promotions_to_load = array(); | ||||
| 	private $promotions = array(); | ||||
|  | ||||
| 	/** | ||||
| 	 * Option key for promos. | ||||
| 	 * | ||||
| 	 * @var string | ||||
| 	 */ | ||||
| 	private $option_main = 'themeisle_sdk_promotions'; | ||||
|  | ||||
| 	/** | ||||
| 	 * Option key for otter promos. | ||||
| 	 * | ||||
| 	 * @var string | ||||
| 	 */ | ||||
| 	private $option_otter = 'themeisle_sdk_promotions_otter_installed'; | ||||
|  | ||||
| 	/** | ||||
| 	 * Option key for optimole promos. | ||||
| 	 * | ||||
| 	 * @var string | ||||
| 	 */ | ||||
| 	private $option_optimole = 'themeisle_sdk_promotions_optimole_installed'; | ||||
|  | ||||
| 	/** | ||||
| 	 * Loaded promotion. | ||||
| 	 * | ||||
| 	 * @var string | ||||
| 	 */ | ||||
| 	private $loaded_promo; | ||||
|  | ||||
| 	/** | ||||
| 	 * Debug mode. | ||||
| 	 * | ||||
| 	 * @var bool | ||||
| 	 */ | ||||
| 	private $debug = false; | ||||
|  | ||||
| 	/** | ||||
| 	 * Should we load this module. | ||||
| @ -40,153 +76,482 @@ class Promotions extends Abstract_Module { | ||||
| 	 * @return bool | ||||
| 	 */ | ||||
| 	public function can_load( $product ) { | ||||
| 		if ( apply_filters( 'themeisle_sdk_ran_promos', false ) === true ) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		if ( $this->is_from_partner( $product ) ) { | ||||
| 			return false; | ||||
| 		} | ||||
|  | ||||
| 		$this->promotions_to_load = apply_filters( $product->get_key() . '_load_promotions', array() ); | ||||
| 		$this->debug          = apply_filters( 'themeisle_sdk_promo_debug', $this->debug ); | ||||
| 		$promotions_to_load   = apply_filters( $product->get_key() . '_load_promotions', array() ); | ||||
| 		$promotions_to_load[] = 'optimole'; | ||||
|  | ||||
| 		if ( 0 === count( $this->promotions_to_load ) ) { | ||||
| 			return false; | ||||
| 		$this->promotions = $this->get_promotions(); | ||||
|  | ||||
| 		foreach ( $this->promotions as $slug => $data ) { | ||||
| 			if ( ! in_array( $slug, $promotions_to_load, true ) ) { | ||||
| 				unset( $this->promotions[ $slug ] ); | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		return true; | ||||
| 		add_action( 'init', array( $this, 'register_settings' ), 99 ); | ||||
| 		add_action( 'admin_init', array( $this, 'register_reference' ), 99 ); | ||||
|  | ||||
| 		return ! empty( $this->promotions ); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Registers the hooks. | ||||
| 	 * | ||||
| 	 * @param Product $product Product to load. | ||||
| 	 * | ||||
| 	 * @return Promotions Module instance. | ||||
| 	 */ | ||||
| 	public function load( $product ) { | ||||
| 		if ( 0 === count( $this->promotions_to_load ) ) { | ||||
| 		if ( ! $this->is_writeable() || ! current_user_can( 'install_plugins' ) ) { | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		$this->product = $product; | ||||
|  | ||||
| 		if ( in_array( 'otter', $this->promotions_to_load ) && false === apply_filters( 'themeisle_sdk_load_promotions_otter', false ) && ! ( defined( 'OTTER_BLOCKS_VERSION' ) || $this->is_otter_installed() ) && version_compare( get_bloginfo( 'version' ), '5.8', '>=' ) ) { | ||||
| 			add_filter( 'themeisle_sdk_load_promotions_otter', '__return_true' ); | ||||
| 			add_action( 'init', array( $this, 'register_settings' ), 99 ); | ||||
| 		$last_dismiss = $this->get_last_dismiss_time(); | ||||
|  | ||||
| 			if ( false !== $this->show_otter_promotion() ) { | ||||
| 				add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_editor_assets' ) ); | ||||
| 			} | ||||
| 		if ( ! $this->debug && $last_dismiss && ( time() - $last_dismiss ) < 7 * DAY_IN_SECONDS ) { | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		return $this; | ||||
| 		add_filter( 'attachment_fields_to_edit', array( $this, 'add_attachment_field' ), 10, 2 ); | ||||
| 		add_action( 'current_screen', [ $this, 'load_available' ] ); | ||||
| 		add_action( 'elementor/editor/after_enqueue_scripts', array( $this, 'enqueue' ) ); | ||||
| 		add_filter( 'themeisle_sdk_ran_promos', '__return_true' ); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Load available promotions. | ||||
| 	 */ | ||||
| 	public function load_available() { | ||||
| 		$this->promotions = $this->filter_by_screen_and_merge(); | ||||
|  | ||||
| 		if ( empty( $this->promotions ) ) { | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		$this->load_promotion( $this->promotions[ array_rand( $this->promotions ) ] ); | ||||
| 	} | ||||
|  | ||||
|  | ||||
| 	/** | ||||
| 	 * Register plugin reference. | ||||
| 	 * | ||||
| 	 * @return void | ||||
| 	 */ | ||||
| 	public function register_reference() { | ||||
| 		if ( isset( $_GET['reference_key'] ) ) { | ||||
| 			update_option( 'otter_reference_key', sanitize_key( $_GET['reference_key'] ) ); | ||||
| 		} | ||||
|  | ||||
| 		if ( isset( $_GET['optimole_reference_key'] ) ) { | ||||
| 			update_option( 'optimole_reference_key', sanitize_key( $_GET['optimole_reference_key'] ) ); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Register Settings | ||||
| 	 * | ||||
| 	 * @since   1.2.0 | ||||
| 	 * @access  public | ||||
| 	 */ | ||||
| 	public function register_settings() { | ||||
| 		$default = get_option( 'themeisle_sdk_promotions_otter', '{}' ); | ||||
|  | ||||
| 		register_setting( | ||||
| 			'themeisle_sdk_settings', | ||||
| 			'themeisle_sdk_promotions_otter', | ||||
| 			$this->option_main, | ||||
| 			array( | ||||
| 				'type'              => 'string', | ||||
| 				'sanitize_callback' => 'sanitize_text_field', | ||||
| 				'show_in_rest'      => true, | ||||
| 				'default'           => '{}', | ||||
| 				'default'           => $default, | ||||
| 			) | ||||
| 		); | ||||
|  | ||||
| 		register_setting( | ||||
| 			'themeisle_sdk_settings', | ||||
| 			$this->option_otter, | ||||
| 			array( | ||||
| 				'type'              => 'boolean', | ||||
| 				'sanitize_callback' => 'rest_sanitize_boolean', | ||||
| 				'show_in_rest'      => true, | ||||
| 				'default'           => false, | ||||
| 			) | ||||
| 		); | ||||
| 		register_setting( | ||||
| 			'themeisle_sdk_settings', | ||||
| 			$this->option_optimole, | ||||
| 			array( | ||||
| 				'type'              => 'boolean', | ||||
| 				'sanitize_callback' => 'rest_sanitize_boolean', | ||||
| 				'show_in_rest'      => true, | ||||
| 				'default'           => false, | ||||
| 			) | ||||
| 		); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get the Otter Blocks plugin status. | ||||
| 	 * Get the SDK base url. | ||||
| 	 * | ||||
| 	 * @return string | ||||
| 	 */ | ||||
| 	private function is_otter_installed() { | ||||
| 		$status = false; | ||||
| 	private function get_sdk_uri() { | ||||
| 		global $themeisle_sdk_max_path; | ||||
|  | ||||
| 		if ( file_exists( ABSPATH . 'wp-content/plugins/otter-blocks/otter-blocks.php' ) ) { | ||||
| 			return true; | ||||
| 		} | ||||
| 		if ( $this->product->is_plugin() ) { | ||||
| 			return plugins_url( '/', $themeisle_sdk_max_path . '/themeisle-sdk/' ); | ||||
| 		}; | ||||
|  | ||||
| 		return $status; | ||||
| 		return get_template_directory_uri() . '/vendor/codeinwp/themeisle-sdk/'; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get status of Otter promotion message. | ||||
| 	 * Check if the path is writable. | ||||
| 	 * | ||||
| 	 * @return mixed | ||||
| 	 * @return boolean | ||||
| 	 * @access  public | ||||
| 	 */ | ||||
| 	public function show_otter_promotion() { | ||||
| 		$promotions = array( | ||||
| 			'blocks_css', | ||||
| 			'blocks_animation', | ||||
| 			'blocks_conditions', | ||||
| 		); | ||||
| 	public function is_writeable() { | ||||
|  | ||||
| 		$option = json_decode( get_option( 'themeisle_sdk_promotions_otter', '{}' ), true ); | ||||
| 		include_once ABSPATH . 'wp-admin/includes/file.php'; | ||||
| 		$filesystem_method = get_filesystem_method(); | ||||
|  | ||||
| 		if ( 0 === count( $option ) ) { | ||||
| 			return 'blocks-css'; | ||||
| 		} | ||||
|  | ||||
| 		if ( isset( $option['blocks-css'] ) && ! isset( $option['blocks-animation'] ) && $option['blocks-css'] < strtotime( '-7 days' ) ) { | ||||
| 			return 'blocks-animation'; | ||||
| 		} | ||||
|  | ||||
| 		if ( isset( $option['blocks-animation'] ) && ! isset( $option['blocks-conditions'] ) && $option['blocks-animation'] < strtotime( '-7 days' ) ) { | ||||
| 			return 'blocks-conditions'; | ||||
| 		if ( 'direct' === $filesystem_method ) { | ||||
| 			return true; | ||||
| 		} | ||||
|  | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Load Gutenberg editor assets. | ||||
| 	 * Get the Otter Blocks plugin status. | ||||
| 	 * | ||||
| 	 * @since   1.0.0 | ||||
| 	 * @access  public | ||||
| 	 * @param string $plugin Plugin slug. | ||||
| 	 * | ||||
| 	 * @return bool | ||||
| 	 */ | ||||
| 	public function enqueue_editor_assets() { | ||||
| 	private function is_plugin_installed( $plugin ) { | ||||
| 		static $allowed_keys = [ | ||||
| 			'otter-blocks' => 'otter-blocks/otter-blocks.php', | ||||
| 			'optimole-wp'  => 'optimole-wp/optimole-wp.php', | ||||
| 		]; | ||||
|  | ||||
| 		if ( ! isset( $allowed_keys[ $plugin ] ) ) { | ||||
| 			return false; | ||||
| 		} | ||||
|  | ||||
| 		if ( file_exists( WP_CONTENT_DIR . '/plugins/' . $allowed_keys[ $plugin ] ) ) { | ||||
| 			return true; | ||||
| 		} | ||||
|  | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get promotions. | ||||
| 	 * | ||||
| 	 * @return array | ||||
| 	 */ | ||||
| 	private function get_promotions() { | ||||
| 		$has_otter               = defined( 'OTTER_BLOCKS_VERSION' ) || $this->is_plugin_installed( 'otter-blocks' ); | ||||
| 		$had_otter_from_promo    = get_option( $this->option_otter, false ); | ||||
| 		$has_optimole            = defined( 'OPTIMOLE_VERSION' ) || $this->is_plugin_installed( 'optimole-wp' ); | ||||
| 		$had_optimole_from_promo = get_option( $this->option_optimole, false ); | ||||
| 		$is_min_req_v            = version_compare( get_bloginfo( 'version' ), '5.8', '>=' ); | ||||
| 		$has_enough_attachments  = $this->has_min_media_attachments(); | ||||
|  | ||||
| 		$all = [ | ||||
| 			'optimole' => [ | ||||
| 				'om-editor'     => [ | ||||
| 					'env'    => ! $has_optimole && $is_min_req_v && ! $had_optimole_from_promo, | ||||
| 					'screen' => 'editor', | ||||
| 				], | ||||
| 				'om-attachment' => [ | ||||
| 					'env'    => ! $has_optimole && ! $had_optimole_from_promo, | ||||
| 					'screen' => 'media', | ||||
| 				], | ||||
| 				'om-media'      => [ | ||||
| 					'env'    => ! $has_optimole && ! $had_optimole_from_promo && $has_enough_attachments, | ||||
| 					'screen' => 'media', | ||||
| 				], | ||||
| 				'om-elementor'  => [ | ||||
| 					'env'    => ! $has_optimole && ! $had_optimole_from_promo && defined( 'ELEMENTOR_VERSION' ), | ||||
| 					'screen' => 'elementor', | ||||
| 				], | ||||
| 			], | ||||
| 			'otter'    => [ | ||||
| 				'blocks-css'        => [ | ||||
| 					'env'    => ! $has_otter && $is_min_req_v && ! $had_otter_from_promo, | ||||
| 					'screen' => 'editor', | ||||
| 				], | ||||
| 				'blocks-animation'  => [ | ||||
| 					'env'    => ! $has_otter && $is_min_req_v && ! $had_otter_from_promo, | ||||
| 					'screen' => 'editor', | ||||
| 				], | ||||
| 				'blocks-conditions' => [ | ||||
| 					'env'    => ! $has_otter && $is_min_req_v && ! $had_otter_from_promo, | ||||
| 					'screen' => 'editor', | ||||
| 				], | ||||
| 			], | ||||
| 		]; | ||||
|  | ||||
| 		foreach ( $all as $slug => $data ) { | ||||
| 			foreach ( $data as $key => $conditions ) { | ||||
| 				if ( ! $conditions['env'] ) { | ||||
| 					unset( $all[ $slug ][ $key ] ); | ||||
|  | ||||
| 					continue; | ||||
| 				} | ||||
|  | ||||
| 				if ( $this->get_upsells_dismiss_time( $key ) ) { | ||||
| 					unset( $all[ $slug ][ $key ] ); | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
| 			if ( empty( $all[ $slug ] ) ) { | ||||
| 				unset( $all[ $slug ] ); | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		return $all; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get the upsell dismiss time. | ||||
| 	 * | ||||
| 	 * @param string $key The upsell key. If empty will return all dismiss times. | ||||
| 	 * | ||||
| 	 * @return false | string | ||||
| 	 */ | ||||
| 	private function get_upsells_dismiss_time( $key = '' ) { | ||||
| 		$old  = get_option( 'themeisle_sdk_promotions_otter', '{}' ); | ||||
| 		$data = get_option( $this->option_main, $old ); | ||||
|  | ||||
| 		$data = json_decode( $data, true ); | ||||
|  | ||||
| 		if ( empty( $key ) ) { | ||||
| 			return $data; | ||||
| 		} | ||||
|  | ||||
| 		return isset( $data[ $key ] ) ? $data[ $key ] : false; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get the last dismiss time of a promotion. | ||||
| 	 * | ||||
| 	 * @return false | ||||
| 	 */ | ||||
| 	private function get_last_dismiss_time() { | ||||
| 		$dismissed = $this->get_upsells_dismiss_time(); | ||||
|  | ||||
| 		if ( empty( $dismissed ) ) { | ||||
| 			return false; | ||||
| 		} | ||||
|  | ||||
| 		$last_dismiss = max( array_values( $dismissed ) ); | ||||
|  | ||||
| 		return $last_dismiss; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Filter by screen & merge into single array of keys. | ||||
| 	 * | ||||
| 	 * @return array | ||||
| 	 */ | ||||
| 	private function filter_by_screen_and_merge() { | ||||
| 		$current_screen = get_current_screen(); | ||||
|  | ||||
| 		$is_elementor = isset( $_GET['action'] ) && $_GET['action'] === 'elementor'; | ||||
| 		$is_media     = isset( $current_screen->id ) && $current_screen->id === 'upload'; | ||||
| 		$is_editor    = method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor(); | ||||
|  | ||||
| 		$return = []; | ||||
|  | ||||
| 		foreach ( $this->promotions as $slug => $promos ) { | ||||
| 			foreach ( $promos as $key => $data ) { | ||||
| 				switch ( $data['screen'] ) { | ||||
| 					case 'media': | ||||
| 						if ( ! $is_media ) { | ||||
| 							unset( $this->promotions[ $slug ][ $key ] ); | ||||
| 						} | ||||
| 						break; | ||||
| 					case 'editor': | ||||
| 						if ( ! $is_editor || $is_elementor ) { | ||||
| 							unset( $this->promotions[ $slug ][ $key ] ); | ||||
| 						} | ||||
| 						break; | ||||
| 					case 'elementor': | ||||
| 						if ( ! $is_elementor ) { | ||||
| 							unset( $this->promotions[ $slug ][ $key ] ); | ||||
| 						} | ||||
| 						break; | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
| 			$return = array_merge( $return, $this->promotions[ $slug ] ); | ||||
| 		} | ||||
|  | ||||
| 		return array_keys( $return ); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Load single promotion. | ||||
| 	 * | ||||
| 	 * @param string $slug slug of the promotion. | ||||
| 	 */ | ||||
| 	private function load_promotion( $slug ) { | ||||
| 		$this->loaded_promo = $slug; | ||||
|  | ||||
| 		if ( $this->debug ) { | ||||
| 			add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue' ] ); | ||||
| 			add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] ); | ||||
| 			if ( $this->get_upsells_dismiss_time( 'om-media' ) === false ) { | ||||
| 				add_action( 'admin_notices', [ $this, 'render_optimole_dash_notice' ] ); | ||||
| 			} | ||||
|  | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		switch ( $slug ) { | ||||
| 			case 'om-editor': | ||||
| 			case 'blocks-css': | ||||
| 			case 'blocks-animation': | ||||
| 			case 'blocks-conditions': | ||||
| 				add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue' ] ); | ||||
| 				break; | ||||
| 			case 'om-attachment': | ||||
| 				add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] ); | ||||
| 				break; | ||||
| 			case 'om-media': | ||||
| 				add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] ); | ||||
| 				add_action( 'admin_notices', [ $this, 'render_optimole_dash_notice' ] ); | ||||
| 				break; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Render dashboard notice. | ||||
| 	 */ | ||||
| 	public function render_optimole_dash_notice() { | ||||
| 		$screen = get_current_screen(); | ||||
|  | ||||
| 		if ( ! isset( $screen->id ) || $screen->id !== 'upload' ) { | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		echo '<div id="ti-optml-notice" class="notice notice-info ti-sdk-om-notice"></div>'; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Enqueue the assets. | ||||
| 	 */ | ||||
| 	public function enqueue() { | ||||
| 		global $themeisle_sdk_max_path; | ||||
| 		$handle            = 'ti-sdk-promo'; | ||||
| 		$saved             = $this->get_upsells_dismiss_time(); | ||||
| 		$themeisle_sdk_src = $this->get_sdk_uri(); | ||||
| 		$user              = wp_get_current_user(); | ||||
| 		$asset_file        = require $themeisle_sdk_max_path . '/assets/js/build/index.asset.php'; | ||||
| 		$deps              = array_merge( $asset_file['dependencies'], [ 'updates' ] ); | ||||
|  | ||||
| 		$themeisle_sdk_path = dirname( $themeisle_sdk_max_path ); | ||||
| 		$themeisle_sdk_src  = plugins_url( '/', $themeisle_sdk_max_path ); | ||||
| 		wp_register_script( $handle, $themeisle_sdk_src . 'assets/js/build/index.js', $deps, $asset_file['version'], true ); | ||||
| 		wp_localize_script( | ||||
| 			$handle, | ||||
| 			'themeisleSDKPromotions', | ||||
| 			[ | ||||
| 				'debug'                 => $this->debug, | ||||
| 				'email'                 => $user->user_email, | ||||
| 				'showPromotion'         => $this->loaded_promo, | ||||
| 				'optionKey'             => $this->option_main, | ||||
| 				'product'               => $this->product->get_name(), | ||||
| 				'option'                => empty( $saved ) ? new \stdClass() : $saved, | ||||
| 				'nonce'                 => wp_create_nonce( 'wp_rest' ), | ||||
| 				'assets'                => $themeisle_sdk_src . 'assets/images/', | ||||
| 				'optimoleApi'           => esc_url( rest_url( 'optml/v1/register_service' ) ), | ||||
| 				'optimoleActivationUrl' => $this->get_plugin_activation_link( 'optimole-wp' ), | ||||
| 				'otterActivationUrl'    => $this->get_plugin_activation_link( 'otter-blocks' ), | ||||
| 				'optimoleDash'          => esc_url( add_query_arg( [ 'page' => 'optimole' ], admin_url( 'upload.php' ) ) ), | ||||
| 				// translators: %s is the product name. | ||||
| 				'title'                 => esc_html( sprintf( __( 'Recommended by %s', 'textdomain' ), $this->product->get_name() ) ), | ||||
| 			] | ||||
| 		); | ||||
| 		wp_enqueue_script( $handle ); | ||||
| 		wp_enqueue_style( $handle, $themeisle_sdk_src . 'assets/js/build/style-index.css', [ 'wp-components' ], $asset_file['version'] ); | ||||
| 	} | ||||
|  | ||||
| 		$asset_file = include $themeisle_sdk_path . '/themeisle-sdk/assets/js/build/index.asset.php'; | ||||
| 	/** | ||||
| 	 * Add promo to attachment modal. | ||||
| 	 * | ||||
| 	 * @param array    $fields Fields array. | ||||
| 	 * @param \WP_Post $post Post object. | ||||
| 	 * | ||||
| 	 * @return array | ||||
| 	 */ | ||||
| 	public function add_attachment_field( $fields, $post ) { | ||||
| 		if ( $post->post_type !== 'attachment' ) { | ||||
| 			return $fields; | ||||
| 		} | ||||
|  | ||||
| 		wp_enqueue_script( | ||||
| 			'themeisle-sdk-otter-promotions', | ||||
| 			$themeisle_sdk_src . 'themeisle-sdk/assets/js/build/index.js', | ||||
| 			array_merge( $asset_file['dependencies'], [ 'updates' ] ), | ||||
| 			$asset_file['version'], | ||||
| 			true | ||||
| 		if ( ! isset( $post->post_mime_type ) || strpos( $post->post_mime_type, 'image' ) === false ) { | ||||
| 			return $fields; | ||||
| 		} | ||||
|  | ||||
| 		$meta = wp_get_attachment_metadata( $post->ID ); | ||||
|  | ||||
| 		if ( isset( $meta['filesize'] ) && $meta['filesize'] < 200000 ) { | ||||
| 			return $fields; | ||||
| 		} | ||||
|  | ||||
| 		$fields['optimole'] = array( | ||||
| 			'input' => 'html', | ||||
| 			'html'  => '<div id="ti-optml-notice-helper"></div>', | ||||
| 		); | ||||
|  | ||||
| 		$option = get_option( 'themeisle_sdk_promotions_otter', '{}' ); | ||||
| 		if ( count( $fields ) < 2 ) { | ||||
| 			add_filter( 'wp_required_field_message', '__return_empty_string' ); | ||||
| 		} | ||||
|  | ||||
| 		wp_localize_script( | ||||
| 			'themeisle-sdk-otter-promotions', | ||||
| 			'themeisleSDKPromotions', | ||||
| 			array( | ||||
| 				'product'          => $this->product->get_name(), | ||||
| 				'assets'           => $themeisle_sdk_src . 'themeisle-sdk/assets/images/', | ||||
| 				'showPromotion'    => $this->show_otter_promotion(), | ||||
| 				'promotions_otter' => $option, | ||||
| 				'activationUrl'    => esc_url( | ||||
| 					add_query_arg( | ||||
| 						array( | ||||
| 							'plugin_status' => 'all', | ||||
| 							'paged'         => '1', | ||||
| 							'action'        => 'activate', | ||||
| 							'plugin'        => rawurlencode( 'otter-blocks/otter-blocks.php' ), | ||||
| 							'_wpnonce'      => wp_create_nonce( 'activate-plugin_otter-blocks/otter-blocks.php' ), | ||||
| 						), | ||||
| 						admin_url( 'plugins.php' )  | ||||
| 					)  | ||||
| 		return $fields; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get plugin activation link. | ||||
| 	 * | ||||
| 	 * @param string $slug The plugin slug. | ||||
| 	 * | ||||
| 	 * @return string | ||||
| 	 */ | ||||
| 	private function get_plugin_activation_link( $slug ) { | ||||
| 		$reference_key = $slug === 'otter-blocks' ? 'reference_key' : 'optimole_reference_key'; | ||||
|  | ||||
| 		return esc_url( | ||||
| 			add_query_arg( | ||||
| 				array( | ||||
| 					'plugin_status' => 'all', | ||||
| 					'paged'         => '1', | ||||
| 					'action'        => 'activate', | ||||
| 					$reference_key  => $this->product->get_key(), | ||||
| 					'plugin'        => rawurlencode( $slug . '/' . $slug . '.php' ), | ||||
| 					'_wpnonce'      => wp_create_nonce( 'activate-plugin_' . $slug . '/' . $slug . '.php' ), | ||||
| 				), | ||||
| 				admin_url( 'plugins.php' ) | ||||
| 			) | ||||
| 		); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Check if has 50 image media items. | ||||
| 	 * | ||||
| 	 * @return bool | ||||
| 	 */ | ||||
| 	private function has_min_media_attachments() { | ||||
| 		if ( $this->debug ) { | ||||
| 			return true; | ||||
| 		} | ||||
|  | ||||
| 		return array_sum( (array) wp_count_attachments( 'image' ) ) > 50; | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @ -701,10 +701,11 @@ class Uninstall_Feedback extends Abstract_Module { | ||||
| 		$disclosure_new_labels = apply_filters( $this->product->get_slug() . '_themeisle_sdk_disclosure_content_labels', [], $this->product ); | ||||
| 		$disclosure_labels     = array_merge( | ||||
| 			[ | ||||
| 				'title' => 'Below is a detailed view of all data that ThemeIsle will receive if you fill in this survey. No domain name, email address or IP addresses are transmited after you submit the survey.', | ||||
| 				'title' => 'Below is a detailed view of all data that ThemeIsle will receive if you fill in this survey. No email address or IP addresses are transmitted after you submit the survey.', | ||||
| 				'items' => [ | ||||
| 					sprintf( '%s %s version %s %s %s %s', '<strong>', ucwords( $this->product->get_type() ), '</strong>', '<code>', $this->product->get_version(), '</code>' ), | ||||
| 					sprintf( '%sCurrent website:%s %s %s %s', '<strong>', '</strong>', '<code>', get_site_url(), '</code>' ), | ||||
| 					sprintf( '%sUsage time:%s %s %s%s', '<strong>', '</strong>', '<code>', ( time() - $this->product->get_install_time() ), 's</code>' ), | ||||
| 					sprintf( '%s Uninstall reason %s %s Selected reason from the above survey %s ', '<strong>', '</strong>', '<i>', '</i>' ), | ||||
| 				], | ||||
| 			], | ||||
| @ -785,11 +786,12 @@ class Uninstall_Feedback extends Abstract_Module { | ||||
| 	 * @return bool Is the request succesfull? | ||||
| 	 */ | ||||
| 	protected function call_api( $attributes ) { | ||||
| 		$slug                  = $this->product->get_slug(); | ||||
| 		$version               = $this->product->get_version(); | ||||
| 		$attributes['slug']    = $slug; | ||||
| 		$attributes['version'] = $version; | ||||
| 		$attributes['url']     = get_site_url(); | ||||
| 		$slug                      = $this->product->get_slug(); | ||||
| 		$version                   = $this->product->get_version(); | ||||
| 		$attributes['slug']        = $slug; | ||||
| 		$attributes['version']     = $version; | ||||
| 		$attributes['url']         = get_site_url(); | ||||
| 		$attributes['active_time'] = ( time() - $this->product->get_install_time() ); | ||||
|  | ||||
| 		$response = wp_remote_post( | ||||
| 			self::FEEDBACK_ENDPOINT, | ||||
|  | ||||
| @ -106,10 +106,17 @@ class Product { | ||||
| 	 * @var string $version The product version. | ||||
| 	 */ | ||||
| 	private $version; | ||||
| 	/** | ||||
| 	 * Holds a map of loaded products objects. | ||||
| 	 * | ||||
| 	 * @var array Array of loaded products. | ||||
| 	 */ | ||||
| 	private static $cached_products = []; | ||||
| 	/** | ||||
| 	 * Root api endpoint. | ||||
| 	 */ | ||||
| 	const API_URL = 'https://api.themeisle.com/'; | ||||
|  | ||||
| 	/** | ||||
| 	 * ThemeIsle_SDK_Product constructor. | ||||
| 	 * | ||||
| @ -128,8 +135,25 @@ class Product { | ||||
| 			$install = time(); | ||||
| 			update_option( $this->get_key() . '_install', time() ); | ||||
| 		} | ||||
| 		$this->install = $install; | ||||
| 		$this->install                               = $install; | ||||
| 		self::$cached_products[ crc32( $basefile ) ] = $this; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Return a product. | ||||
| 	 * | ||||
| 	 * @param string $basefile Product basefile. | ||||
| 	 * | ||||
| 	 * @return Product Product Object. | ||||
| 	 */ | ||||
| 	public static function get( $basefile ) { | ||||
| 		$key = crc32( $basefile ); | ||||
| 		if ( isset( self::$cached_products[ $key ] ) ) { | ||||
| 			return self::$cached_products[ $key ]; | ||||
| 		} | ||||
| 		self::$cached_products[ $key ] = new Product( $basefile ); | ||||
|  | ||||
| 		return self::$cached_products[ $key ]; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|  | ||||
| @ -33,6 +33,7 @@ $files_to_load          = [ | ||||
| 	$themeisle_library_path . '/src/Modules/Review.php', | ||||
| 	$themeisle_library_path . '/src/Modules/Recommendation.php', | ||||
| 	$themeisle_library_path . '/src/Modules/Promotions.php', | ||||
| 	$themeisle_library_path . '/src/Modules/Compatibilities.php', | ||||
| ]; | ||||
|  | ||||
| $files_to_load = array_merge( $files_to_load, apply_filters( 'themeisle_sdk_required_files', [] ) ); | ||||
| @ -42,7 +43,6 @@ foreach ( $files_to_load as $file ) { | ||||
| 		require_once $file; | ||||
| 	} | ||||
| } | ||||
|  | ||||
| Loader::init(); | ||||
|  | ||||
| foreach ( $products as $product ) { | ||||
|  | ||||
| @ -2,7 +2,7 @@ | ||||
|  | ||||
| // autoload_real.php @generated by Composer | ||||
|  | ||||
| class ComposerAutoloaderInitc174f46a75555c6eef9a3e0706b0c0ab | ||||
| class ComposerAutoloaderIniteaa5284efc067d9aba27d7d8f1a0b978 | ||||
| { | ||||
|     private static $loader; | ||||
|  | ||||
| @ -22,18 +22,18 @@ class ComposerAutoloaderInitc174f46a75555c6eef9a3e0706b0c0ab | ||||
|             return self::$loader; | ||||
|         } | ||||
|  | ||||
|         spl_autoload_register(array('ComposerAutoloaderInitc174f46a75555c6eef9a3e0706b0c0ab', 'loadClassLoader'), true, true); | ||||
|         spl_autoload_register(array('ComposerAutoloaderIniteaa5284efc067d9aba27d7d8f1a0b978', 'loadClassLoader'), true, true); | ||||
|         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); | ||||
|         spl_autoload_unregister(array('ComposerAutoloaderInitc174f46a75555c6eef9a3e0706b0c0ab', 'loadClassLoader')); | ||||
|         spl_autoload_unregister(array('ComposerAutoloaderIniteaa5284efc067d9aba27d7d8f1a0b978', 'loadClassLoader')); | ||||
|  | ||||
|         require __DIR__ . '/autoload_static.php'; | ||||
|         call_user_func(\Composer\Autoload\ComposerStaticInitc174f46a75555c6eef9a3e0706b0c0ab::getInitializer($loader)); | ||||
|         call_user_func(\Composer\Autoload\ComposerStaticIniteaa5284efc067d9aba27d7d8f1a0b978::getInitializer($loader)); | ||||
|  | ||||
|         $loader->register(true); | ||||
|  | ||||
|         $includeFiles = \Composer\Autoload\ComposerStaticInitc174f46a75555c6eef9a3e0706b0c0ab::$files; | ||||
|         $includeFiles = \Composer\Autoload\ComposerStaticIniteaa5284efc067d9aba27d7d8f1a0b978::$files; | ||||
|         foreach ($includeFiles as $fileIdentifier => $file) { | ||||
|             composerRequirec174f46a75555c6eef9a3e0706b0c0ab($fileIdentifier, $file); | ||||
|             composerRequireeaa5284efc067d9aba27d7d8f1a0b978($fileIdentifier, $file); | ||||
|         } | ||||
|  | ||||
|         return $loader; | ||||
| @ -45,7 +45,7 @@ class ComposerAutoloaderInitc174f46a75555c6eef9a3e0706b0c0ab | ||||
|  * @param string $file | ||||
|  * @return void | ||||
|  */ | ||||
| function composerRequirec174f46a75555c6eef9a3e0706b0c0ab($fileIdentifier, $file) | ||||
| function composerRequireeaa5284efc067d9aba27d7d8f1a0b978($fileIdentifier, $file) | ||||
| { | ||||
|     if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { | ||||
|         $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; | ||||
|  | ||||
| @ -4,7 +4,7 @@ | ||||
|  | ||||
| namespace Composer\Autoload; | ||||
|  | ||||
| class ComposerStaticInitc174f46a75555c6eef9a3e0706b0c0ab | ||||
| class ComposerStaticIniteaa5284efc067d9aba27d7d8f1a0b978 | ||||
| { | ||||
|     public static $files = array ( | ||||
|         '2c2d2fe92db4cd03403dbb108ac263b7' => __DIR__ . '/..' . '/codeinwp/gutenberg-menu-icons/load.php', | ||||
| @ -20,7 +20,7 @@ class ComposerStaticInitc174f46a75555c6eef9a3e0706b0c0ab | ||||
|     public static function getInitializer(ClassLoader $loader) | ||||
|     { | ||||
|         return \Closure::bind(function () use ($loader) { | ||||
|             $loader->classMap = ComposerStaticInitc174f46a75555c6eef9a3e0706b0c0ab::$classMap; | ||||
|             $loader->classMap = ComposerStaticIniteaa5284efc067d9aba27d7d8f1a0b978::$classMap; | ||||
|  | ||||
|         }, null, ClassLoader::class); | ||||
|     } | ||||
|  | ||||
| @ -144,18 +144,18 @@ | ||||
|             "source": { | ||||
|                 "type": "git", | ||||
|                 "url": "https://github.com/Codeinwp/themeisle-sdk.git", | ||||
|                 "reference": "bab0314e1f6e2f811116a2da7736b94cbe6af90f" | ||||
|                 "reference": "04ab7589bf32dbfddbf66bbb69bb0ab2eb8d7c27" | ||||
|             }, | ||||
|             "dist": { | ||||
|                 "type": "zip", | ||||
|                 "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/bab0314e1f6e2f811116a2da7736b94cbe6af90f", | ||||
|                 "reference": "bab0314e1f6e2f811116a2da7736b94cbe6af90f", | ||||
|                 "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/04ab7589bf32dbfddbf66bbb69bb0ab2eb8d7c27", | ||||
|                 "reference": "04ab7589bf32dbfddbf66bbb69bb0ab2eb8d7c27", | ||||
|                 "shasum": "" | ||||
|             }, | ||||
|             "require-dev": { | ||||
|                 "codeinwp/phpcs-ruleset": "dev-main" | ||||
|             }, | ||||
|             "time": "2022-08-23T13:09:40+00:00", | ||||
|             "time": "2022-11-23T11:35:13+00:00", | ||||
|             "default-branch": true, | ||||
|             "type": "library", | ||||
|             "installation-source": "dist", | ||||
| @ -177,7 +177,7 @@ | ||||
|             ], | ||||
|             "support": { | ||||
|                 "issues": "https://github.com/Codeinwp/themeisle-sdk/issues", | ||||
|                 "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.2.27" | ||||
|                 "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.2.31" | ||||
|             }, | ||||
|             "install-path": "../codeinwp/themeisle-sdk" | ||||
|         } | ||||
|  | ||||
| @ -1,9 +1,9 @@ | ||||
| <?php return array( | ||||
|     'root' => array( | ||||
|         'name' => 'codeinwp/wp-menu-icons', | ||||
|         'pretty_version' => 'v0.13.0', | ||||
|         'version' => '0.13.0.0', | ||||
|         'reference' => '789aafe06b2183d940c0bdc43f6f81a49f84abc0', | ||||
|         'pretty_version' => 'v0.13.2', | ||||
|         'version' => '0.13.2.0', | ||||
|         'reference' => '3d2b34af71c45d63cea043054a93e7df346b4d1e', | ||||
|         'type' => 'wordpress-plugin', | ||||
|         'install_path' => __DIR__ . '/../../', | ||||
|         'aliases' => array(), | ||||
| @ -44,7 +44,7 @@ | ||||
|         'codeinwp/themeisle-sdk' => array( | ||||
|             'pretty_version' => 'dev-master', | ||||
|             'version' => 'dev-master', | ||||
|             'reference' => 'bab0314e1f6e2f811116a2da7736b94cbe6af90f', | ||||
|             'reference' => '04ab7589bf32dbfddbf66bbb69bb0ab2eb8d7c27', | ||||
|             'type' => 'library', | ||||
|             'install_path' => __DIR__ . '/../codeinwp/themeisle-sdk', | ||||
|             'aliases' => array( | ||||
| @ -53,9 +53,9 @@ | ||||
|             'dev_requirement' => false, | ||||
|         ), | ||||
|         'codeinwp/wp-menu-icons' => array( | ||||
|             'pretty_version' => 'v0.13.0', | ||||
|             'version' => '0.13.0.0', | ||||
|             'reference' => '789aafe06b2183d940c0bdc43f6f81a49f84abc0', | ||||
|             'pretty_version' => 'v0.13.2', | ||||
|             'version' => '0.13.2.0', | ||||
|             'reference' => '3d2b34af71c45d63cea043054a93e7df346b4d1e', | ||||
|             'type' => 'wordpress-plugin', | ||||
|             'install_path' => __DIR__ . '/../../', | ||||
|             'aliases' => array(), | ||||
|  | ||||
		Reference in New Issue
	
	Block a user