updated plugin Menu Icons
version 0.13.5
This commit is contained in:
parent
39646e6577
commit
97859556db
@ -1,3 +1,7 @@
|
|||||||
|
##### [Version 0.13.5](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.4...v0.13.5) (2023-03-30)
|
||||||
|
|
||||||
|
- Updated Dependencies and WordPress core tested up to version 6.2
|
||||||
|
|
||||||
##### [Version 0.13.4](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.3...v0.13.4) (2023-03-01)
|
##### [Version 0.13.4](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.3...v0.13.4) (2023-03-01)
|
||||||
|
|
||||||
Update dependencies
|
Update dependencies
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* Plugin name: Menu Icons
|
* Plugin name: Menu Icons
|
||||||
* Plugin URI: https://github.com/Codeinwp/wp-menu-icons
|
* Plugin URI: https://github.com/Codeinwp/wp-menu-icons
|
||||||
* Description: Spice up your navigation menus with pretty icons, easily.
|
* Description: Spice up your navigation menus with pretty icons, easily.
|
||||||
* Version: 0.13.4
|
* Version: 0.13.5
|
||||||
* Author: ThemeIsle
|
* Author: ThemeIsle
|
||||||
* Author URI: https://themeisle.com
|
* Author URI: https://themeisle.com
|
||||||
* License: GPLv2
|
* License: GPLv2
|
||||||
@ -29,7 +29,7 @@ final class Menu_Icons {
|
|||||||
|
|
||||||
const DISMISS_NOTICE = 'menu-icons-dismiss-notice';
|
const DISMISS_NOTICE = 'menu-icons-dismiss-notice';
|
||||||
|
|
||||||
const VERSION = '0.13.4';
|
const VERSION = '0.13.5';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds plugin data
|
* Holds plugin data
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Contributors: codeinwp, themeisle
|
Contributors: codeinwp, themeisle
|
||||||
Tags: menu, nav-menu, icons, navigation
|
Tags: menu, nav-menu, icons, navigation
|
||||||
Requires at least: 4.3
|
Requires at least: 4.3
|
||||||
Tested up to: 6.1
|
Tested up to: 6.2
|
||||||
Stable tag: trunk
|
Stable tag: trunk
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
@ -225,6 +225,13 @@ Read [this blog post](http://kucrut.org/add-custom-image-sizes-right-way/).
|
|||||||
|
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
|
||||||
|
##### [Version 0.13.5](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.4...v0.13.5) (2023-03-30)
|
||||||
|
|
||||||
|
- Updated Dependencies and WordPress core tested up to version 6.2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##### [Version 0.13.4](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.3...v0.13.4) (2023-03-01)
|
##### [Version 0.13.4](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.3...v0.13.4) (2023-03-01)
|
||||||
|
|
||||||
Update dependencies
|
Update dependencies
|
||||||
|
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
|||||||
|
|
||||||
require_once __DIR__ . '/composer/autoload_real.php';
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
return ComposerAutoloaderInit95753d5aa2e3a7942eae2a5b015550e7::getLoader();
|
return ComposerAutoloaderInitbf1297da02d6475c76ee8fa5bb3a7c73::getLoader();
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
##### [Version 3.2.40](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.39...v3.2.40) (2023-03-30)
|
||||||
|
|
||||||
|
- Add ROP upsell to all products
|
||||||
|
|
||||||
|
##### [Version 3.2.39](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.38...v3.2.39) (2023-03-17)
|
||||||
|
|
||||||
|
* Adds direct utility function for a direct support link.
|
||||||
|
|
||||||
|
##### [Version 3.2.38](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.37...v3.2.38) (2023-03-10)
|
||||||
|
|
||||||
|
Fix promotions path-breaking
|
||||||
|
|
||||||
##### [Version 3.2.37](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.36...v3.2.37) (2023-03-01)
|
##### [Version 3.2.37](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.36...v3.2.37) (2023-03-01)
|
||||||
|
|
||||||
Fix array casting
|
Fix array casting
|
||||||
|
@ -1 +1 @@
|
|||||||
<?php return array('dependencies' => array('wp-api', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-plugins'), 'version' => '482f75f37b88f9ea2e79');
|
<?php return array('dependencies' => array('wp-api', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-plugins'), 'version' => '3d1ed0347f48fcdf607c');
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1 +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{align-items:center;display:flex;gap:10px}.ti-sdk-om-notice .form-wrap{display:grid}.ti-sdk-om-notice .form-wrap span:not(.dashicons){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 .is-link{align-items:center;display:flex;text-decoration:none}.ti-sdk-om-notice .is-link span{line-height:normal}.ti-sdk-om-notice .dashicons{margin-right:2px;text-decoration:none}.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}.block-editor-block-inspector .ti-om-stack-wrap{border-top:1px solid #e0e0e0}.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}.media-sidebar .ti-sdk-om-notice input{flex-grow:1;min-width:unset}.media-sidebar .ti-sdk-om-notice .description{margin-bottom:10px}.media-sidebar .ti-sdk-om-notice .content{padding:15px 10px}.media-sidebar .ti-sdk-om-notice .actions{gap:10px}.media-sidebar .ti-sdk-om-notice form{flex-wrap:wrap;justify-content:center}.attachment-info .ti-sdk-om-notice input{flex-grow:1;min-width:unset}.attachment-info .ti-sdk-om-notice form{flex-wrap:wrap;justify-content:center}@media screen and (min-width:1200px){.attachment-info .ti-sdk-om-notice form{flex-wrap:unset}}
|
.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{align-items:center;display:flex;gap:10px}.ti-sdk-om-notice .form-wrap{display:grid}.ti-sdk-om-notice .form-wrap span:not(.dashicons){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 .is-link{align-items:center;display:flex;text-decoration:none}.ti-sdk-om-notice .is-link span{line-height:normal}.ti-sdk-om-notice .dashicons{margin-right:2px;text-decoration:none}.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}.block-editor-block-inspector .ti-om-stack-wrap{border-top:1px solid #e0e0e0}.om-progress{align-items:center;display:flex;font-size:14px;gap:5px}.om-progress .spin{-webkit-animation:om-rotation 2s linear infinite;animation:om-rotation 2s linear infinite}@-webkit-keyframes om-rotation{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes om-rotation{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}.ti-sdk-om-promo.hidden{display:none}.media-sidebar .ti-sdk-om-notice input{flex-grow:1;min-width:unset}.media-sidebar .ti-sdk-om-notice .description{margin-bottom:10px}.media-sidebar .ti-sdk-om-notice .content{padding:15px 10px}.media-sidebar .ti-sdk-om-notice .actions{gap:10px}.media-sidebar .ti-sdk-om-notice form{flex-wrap:wrap;justify-content:center}.attachment-info .ti-sdk-om-notice input{flex-grow:1;min-width:unset}.attachment-info .ti-sdk-om-notice form{flex-wrap:wrap;justify-content:center}@media screen and (min-width:1200px){.attachment-info .ti-sdk-om-notice form{flex-wrap:unset}}.ti-sdk-rop-notice{padding:10px;position:relative}.ti-sdk-rop-notice .rop-notice-actions{display:flex;gap:10px}.ti-sdk-rop-notice p{padding:0 10px 0 0}
|
||||||
|
@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Current SDK version and path.
|
// Current SDK version and path.
|
||||||
$themeisle_sdk_version = '3.2.37';
|
$themeisle_sdk_version = '3.2.40';
|
||||||
$themeisle_sdk_path = dirname( __FILE__ );
|
$themeisle_sdk_path = dirname( __FILE__ );
|
||||||
|
|
||||||
global $themeisle_sdk_max_version;
|
global $themeisle_sdk_max_version;
|
||||||
@ -29,7 +29,7 @@ if ( ! is_file( $themeisle_sdk_path . $themeisle_sdk_relative_licenser_path ) &&
|
|||||||
add_filter( 'themeisle_sdk_required_files', 'themeisle_sdk_load_licenser_if_present' );
|
add_filter( 'themeisle_sdk_required_files', 'themeisle_sdk_load_licenser_if_present' );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ( is_null( $themeisle_sdk_max_path ) || version_compare( $themeisle_sdk_version, $themeisle_sdk_max_path ) == 0 ) &&
|
if ( ( is_null( $themeisle_sdk_max_path ) || version_compare( $themeisle_sdk_version, $themeisle_sdk_max_version ) == 0 ) &&
|
||||||
apply_filters( 'themeisle_sdk_should_overwrite_path', false, $themeisle_sdk_path, $themeisle_sdk_max_path ) ) {
|
apply_filters( 'themeisle_sdk_should_overwrite_path', false, $themeisle_sdk_path, $themeisle_sdk_max_path ) ) {
|
||||||
$themeisle_sdk_max_path = $themeisle_sdk_path;
|
$themeisle_sdk_max_path = $themeisle_sdk_path;
|
||||||
}
|
}
|
||||||
@ -173,3 +173,46 @@ if ( ! function_exists( 'tsdk_lkey' ) ) {
|
|||||||
return \ThemeisleSDK\Modules\Licenser::key( $file );
|
return \ThemeisleSDK\Modules\Licenser::key( $file );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( ! function_exists( 'tsdk_support_link' ) ) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Themeisle Support URL.
|
||||||
|
*
|
||||||
|
* @param string $file Product basefile.
|
||||||
|
*
|
||||||
|
* @return false|string Return support URL or false if no license is active.
|
||||||
|
*/
|
||||||
|
function tsdk_support_link( $file ) {
|
||||||
|
|
||||||
|
if ( ! did_action( 'init' ) ) {
|
||||||
|
_doing_it_wrong( __FUNCTION__, 'tsdk_support_link() should not be called before the init action.', '3.2.39' );
|
||||||
|
}
|
||||||
|
$params = [];
|
||||||
|
if ( ! tsdk_lis_valid( $file ) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$product = \ThemeisleSDK\Product::get( $file );
|
||||||
|
if ( ! $product->requires_license() ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
static $site_params = null;
|
||||||
|
if ( $site_params === null ) {
|
||||||
|
if ( is_user_logged_in() && function_exists( 'wp_get_current_user' ) ) {
|
||||||
|
$current_user = wp_get_current_user();
|
||||||
|
$site_params['semail'] = urlencode( $current_user->user_email );
|
||||||
|
}
|
||||||
|
$site_params['swb'] = urlencode( home_url() );
|
||||||
|
global $wp_version;
|
||||||
|
$site_params['snv'] = urlencode( sprintf( 'WP-%s-PHP-%s', $wp_version, ( PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION ) ) );
|
||||||
|
}
|
||||||
|
$params['slkey'] = tsdk_lkey( $file );
|
||||||
|
$params['sprd'] = urlencode( $product->get_name() );
|
||||||
|
$params['svrs'] = urlencode( $product->get_version() );
|
||||||
|
|
||||||
|
|
||||||
|
return add_query_arg(
|
||||||
|
array_merge( $site_params, $params ),
|
||||||
|
'https://store.themeisle.com/direct-support/'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -54,6 +54,13 @@ class Promotions extends Abstract_Module {
|
|||||||
*/
|
*/
|
||||||
private $option_optimole = 'themeisle_sdk_promotions_optimole_installed';
|
private $option_optimole = 'themeisle_sdk_promotions_optimole_installed';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Option key for ROP promos.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $option_rop = 'themeisle_sdk_promotions_rop_installed';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loaded promotion.
|
* Loaded promotion.
|
||||||
*
|
*
|
||||||
@ -86,6 +93,7 @@ class Promotions extends Abstract_Module {
|
|||||||
$this->debug = apply_filters( 'themeisle_sdk_promo_debug', $this->debug );
|
$this->debug = apply_filters( 'themeisle_sdk_promo_debug', $this->debug );
|
||||||
$promotions_to_load = apply_filters( $product->get_key() . '_load_promotions', array() );
|
$promotions_to_load = apply_filters( $product->get_key() . '_load_promotions', array() );
|
||||||
$promotions_to_load[] = 'optimole';
|
$promotions_to_load[] = 'optimole';
|
||||||
|
$promotions_to_load[] = 'rop';
|
||||||
|
|
||||||
$this->promotions = $this->get_promotions();
|
$this->promotions = $this->get_promotions();
|
||||||
|
|
||||||
@ -152,6 +160,10 @@ class Promotions extends Abstract_Module {
|
|||||||
if ( isset( $_GET['optimole_reference_key'] ) ) {
|
if ( isset( $_GET['optimole_reference_key'] ) ) {
|
||||||
update_option( 'optimole_reference_key', sanitize_key( $_GET['optimole_reference_key'] ) );
|
update_option( 'optimole_reference_key', sanitize_key( $_GET['optimole_reference_key'] ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( isset( $_GET['rop_reference_key'] ) ) {
|
||||||
|
update_option( 'rop_reference_key', sanitize_key( $_GET['rop_reference_key'] ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -191,6 +203,16 @@ class Promotions extends Abstract_Module {
|
|||||||
'default' => false,
|
'default' => false,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
register_setting(
|
||||||
|
'themeisle_sdk_settings',
|
||||||
|
$this->option_rop,
|
||||||
|
array(
|
||||||
|
'type' => 'boolean',
|
||||||
|
'sanitize_callback' => 'rest_sanitize_boolean',
|
||||||
|
'show_in_rest' => true,
|
||||||
|
'default' => false,
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -201,7 +223,12 @@ class Promotions extends Abstract_Module {
|
|||||||
private function get_sdk_uri() {
|
private function get_sdk_uri() {
|
||||||
global $themeisle_sdk_max_path;
|
global $themeisle_sdk_max_path;
|
||||||
|
|
||||||
if ( $this->product->is_plugin() ) {
|
/**
|
||||||
|
* $themeisle_sdk_max_path can point to the theme when the theme version is higher.
|
||||||
|
* hence we also need to check that the path does not point to the theme else this will break the URL.
|
||||||
|
* References: https://github.com/Codeinwp/neve-pro-addon/issues/2403
|
||||||
|
*/
|
||||||
|
if ( $this->product->is_plugin() && false === strpos( $themeisle_sdk_max_path, get_template_directory() ) ) {
|
||||||
return plugins_url( '/', $themeisle_sdk_max_path . '/themeisle-sdk/' );
|
return plugins_url( '/', $themeisle_sdk_max_path . '/themeisle-sdk/' );
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -237,6 +264,7 @@ class Promotions extends Abstract_Module {
|
|||||||
static $allowed_keys = [
|
static $allowed_keys = [
|
||||||
'otter-blocks' => 'otter-blocks/otter-blocks.php',
|
'otter-blocks' => 'otter-blocks/otter-blocks.php',
|
||||||
'optimole-wp' => 'optimole-wp/optimole-wp.php',
|
'optimole-wp' => 'optimole-wp/optimole-wp.php',
|
||||||
|
'tweet-old-post' => 'tweet-old-post/tweet-old-post.php',
|
||||||
];
|
];
|
||||||
|
|
||||||
if ( ! isset( $allowed_keys[ $plugin ] ) ) {
|
if ( ! isset( $allowed_keys[ $plugin ] ) ) {
|
||||||
@ -260,8 +288,11 @@ class Promotions extends Abstract_Module {
|
|||||||
$had_otter_from_promo = get_option( $this->option_otter, false );
|
$had_otter_from_promo = get_option( $this->option_otter, false );
|
||||||
$has_optimole = defined( 'OPTIMOLE_VERSION' ) || $this->is_plugin_installed( 'optimole-wp' );
|
$has_optimole = defined( 'OPTIMOLE_VERSION' ) || $this->is_plugin_installed( 'optimole-wp' );
|
||||||
$had_optimole_from_promo = get_option( $this->option_optimole, false );
|
$had_optimole_from_promo = get_option( $this->option_optimole, false );
|
||||||
|
$has_rop = defined( 'ROP_LITE_VERSION' ) || $this->is_plugin_installed( 'tweet-old-post' );
|
||||||
|
$had_rop_from_promo = get_option( $this->option_rop, false );
|
||||||
$is_min_req_v = version_compare( get_bloginfo( 'version' ), '5.8', '>=' );
|
$is_min_req_v = version_compare( get_bloginfo( 'version' ), '5.8', '>=' );
|
||||||
$has_enough_attachments = $this->has_min_media_attachments();
|
$has_enough_attachments = $this->has_min_media_attachments();
|
||||||
|
$has_enough_old_posts = $this->has_old_posts();
|
||||||
|
|
||||||
$all = [
|
$all = [
|
||||||
'optimole' => [
|
'optimole' => [
|
||||||
@ -300,6 +331,12 @@ class Promotions extends Abstract_Module {
|
|||||||
'screen' => 'editor',
|
'screen' => 'editor',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'rop' => [
|
||||||
|
'rop-posts' => [
|
||||||
|
'env' => ! $has_rop && ! $had_rop_from_promo && $has_enough_old_posts,
|
||||||
|
'screen' => 'edit-post',
|
||||||
|
],
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ( $all as $slug => $data ) {
|
foreach ( $all as $slug => $data ) {
|
||||||
@ -370,6 +407,7 @@ class Promotions extends Abstract_Module {
|
|||||||
|
|
||||||
$is_elementor = isset( $_GET['action'] ) && $_GET['action'] === 'elementor';
|
$is_elementor = isset( $_GET['action'] ) && $_GET['action'] === 'elementor';
|
||||||
$is_media = isset( $current_screen->id ) && $current_screen->id === 'upload';
|
$is_media = isset( $current_screen->id ) && $current_screen->id === 'upload';
|
||||||
|
$is_posts = isset( $current_screen->id ) && $current_screen->id === 'edit-post';
|
||||||
$is_editor = method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor();
|
$is_editor = method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor();
|
||||||
|
|
||||||
$return = [];
|
$return = [];
|
||||||
@ -397,6 +435,11 @@ class Promotions extends Abstract_Module {
|
|||||||
unset( $this->promotions[ $slug ][ $key ] );
|
unset( $this->promotions[ $slug ][ $key ] );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'edit-post':
|
||||||
|
if ( ! $is_posts ) {
|
||||||
|
unset( $this->promotions[ $slug ][ $key ] );
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -420,6 +463,9 @@ class Promotions extends Abstract_Module {
|
|||||||
if ( $this->get_upsells_dismiss_time( 'om-media' ) === false ) {
|
if ( $this->get_upsells_dismiss_time( 'om-media' ) === false ) {
|
||||||
add_action( 'admin_notices', [ $this, 'render_optimole_dash_notice' ] );
|
add_action( 'admin_notices', [ $this, 'render_optimole_dash_notice' ] );
|
||||||
}
|
}
|
||||||
|
if ( $this->get_upsells_dismiss_time( 'rop-posts' ) === false ) {
|
||||||
|
add_action( 'admin_notices', [ $this, 'render_rop_dash_notice' ] );
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -439,6 +485,10 @@ class Promotions extends Abstract_Module {
|
|||||||
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] );
|
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] );
|
||||||
add_action( 'admin_notices', [ $this, 'render_optimole_dash_notice' ] );
|
add_action( 'admin_notices', [ $this, 'render_optimole_dash_notice' ] );
|
||||||
break;
|
break;
|
||||||
|
case 'rop-posts':
|
||||||
|
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] );
|
||||||
|
add_action( 'admin_notices', [ $this, 'render_rop_dash_notice' ] );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -483,7 +533,9 @@ class Promotions extends Abstract_Module {
|
|||||||
'optimoleApi' => esc_url( rest_url( 'optml/v1/register_service' ) ),
|
'optimoleApi' => esc_url( rest_url( 'optml/v1/register_service' ) ),
|
||||||
'optimoleActivationUrl' => $this->get_plugin_activation_link( 'optimole-wp' ),
|
'optimoleActivationUrl' => $this->get_plugin_activation_link( 'optimole-wp' ),
|
||||||
'otterActivationUrl' => $this->get_plugin_activation_link( 'otter-blocks' ),
|
'otterActivationUrl' => $this->get_plugin_activation_link( 'otter-blocks' ),
|
||||||
|
'ropActivationUrl' => $this->get_plugin_activation_link( 'tweet-old-post' ),
|
||||||
'optimoleDash' => esc_url( add_query_arg( [ 'page' => 'optimole' ], admin_url( 'upload.php' ) ) ),
|
'optimoleDash' => esc_url( add_query_arg( [ 'page' => 'optimole' ], admin_url( 'upload.php' ) ) ),
|
||||||
|
'ropDash' => esc_url( add_query_arg( [ 'page' => 'TweetOldPost' ], admin_url( 'admin.php' ) ) ),
|
||||||
// translators: %s is the product name.
|
// translators: %s is the product name.
|
||||||
'title' => esc_html( sprintf( __( 'Recommended by %s', 'textdomain' ), $this->product->get_name() ) ),
|
'title' => esc_html( sprintf( __( 'Recommended by %s', 'textdomain' ), $this->product->get_name() ) ),
|
||||||
]
|
]
|
||||||
@ -492,6 +544,19 @@ class Promotions extends Abstract_Module {
|
|||||||
wp_enqueue_style( $handle, $themeisle_sdk_src . 'assets/js/build/style-index.css', [ 'wp-components' ], $asset_file['version'] );
|
wp_enqueue_style( $handle, $themeisle_sdk_src . 'assets/js/build/style-index.css', [ 'wp-components' ], $asset_file['version'] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render rop notice.
|
||||||
|
*/
|
||||||
|
public function render_rop_dash_notice() {
|
||||||
|
$screen = get_current_screen();
|
||||||
|
|
||||||
|
if ( ! isset( $screen->id ) || $screen->id !== 'edit-post' ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '<div id="ti-rop-notice" class="notice notice-info ti-sdk-rop-notice"></div>';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add promo to attachment modal.
|
* Add promo to attachment modal.
|
||||||
*
|
*
|
||||||
@ -580,4 +645,54 @@ class Promotions extends Abstract_Module {
|
|||||||
}
|
}
|
||||||
return $attachment_count > 50;
|
return $attachment_count > 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the website has more than 100 posts and over 10 are over a year old.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
private function has_old_posts() {
|
||||||
|
if ( $this->debug ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$posts_count = get_transient( 'tsk_posts_count' );
|
||||||
|
|
||||||
|
// Create a new WP_Query object to get all posts
|
||||||
|
$args = array(
|
||||||
|
'post_type' => 'post',
|
||||||
|
'posts_per_page' => 101, //phpcs:ignore WordPress.WP.PostsPerPage.posts_per_page_posts_per_page
|
||||||
|
'fields' => 'ids',
|
||||||
|
'no_found_rows' => true,
|
||||||
|
);
|
||||||
|
|
||||||
|
if ( false === $posts_count ) {
|
||||||
|
$query = new \WP_Query( $args );
|
||||||
|
$total_posts = $query->post_count;
|
||||||
|
wp_reset_postdata();
|
||||||
|
|
||||||
|
// Count the number of posts older than 1 year
|
||||||
|
$one_year_ago = gmdate( 'Y-m-d H:i:s', strtotime( '-1 year' ) );
|
||||||
|
$args['date_query'] = array(
|
||||||
|
array(
|
||||||
|
'before' => $one_year_ago,
|
||||||
|
'inclusive' => true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
$query = new \WP_Query( $args );
|
||||||
|
$old_posts = $query->post_count;
|
||||||
|
wp_reset_postdata();
|
||||||
|
|
||||||
|
$posts_count = array(
|
||||||
|
'total_posts' => $total_posts,
|
||||||
|
'old_posts' => $old_posts,
|
||||||
|
);
|
||||||
|
|
||||||
|
set_transient( 'tsk_posts_count', $posts_count, DAY_IN_SECONDS );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if there are more than 100 posts and more than 10 old posts
|
||||||
|
return $posts_count['total_posts'] > 100 && $posts_count['old_posts'] > 10;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ class InstalledVersions
|
|||||||
{
|
{
|
||||||
foreach (self::getInstalled() as $installed) {
|
foreach (self::getInstalled() as $installed) {
|
||||||
if (isset($installed['versions'][$packageName])) {
|
if (isset($installed['versions'][$packageName])) {
|
||||||
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ class InstalledVersions
|
|||||||
*/
|
*/
|
||||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||||
{
|
{
|
||||||
$constraint = $parser->parseConstraints($constraint);
|
$constraint = $parser->parseConstraints((string) $constraint);
|
||||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||||
|
|
||||||
return $provided->matches($constraint);
|
return $provided->matches($constraint);
|
||||||
@ -328,7 +328,9 @@ class InstalledVersions
|
|||||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||||
$installed[] = self::$installedByVendor[$vendorDir];
|
$installed[] = self::$installedByVendor[$vendorDir];
|
||||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||||
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||||
|
$required = require $vendorDir.'/composer/installed.php';
|
||||||
|
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
||||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||||
self::$installed = $installed[count($installed) - 1];
|
self::$installed = $installed[count($installed) - 1];
|
||||||
}
|
}
|
||||||
@ -340,12 +342,17 @@ class InstalledVersions
|
|||||||
// only require the installed.php file if this file is loaded from its dumped location,
|
// only require the installed.php file if this file is loaded from its dumped location,
|
||||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||||
self::$installed = require __DIR__ . '/installed.php';
|
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||||
|
$required = require __DIR__ . '/installed.php';
|
||||||
|
self::$installed = $required;
|
||||||
} else {
|
} else {
|
||||||
self::$installed = array();
|
self::$installed = array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (self::$installed !== array()) {
|
||||||
$installed[] = self::$installed;
|
$installed[] = self::$installed;
|
||||||
|
}
|
||||||
|
|
||||||
return $installed;
|
return $installed;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// autoload_real.php @generated by Composer
|
// autoload_real.php @generated by Composer
|
||||||
|
|
||||||
class ComposerAutoloaderInit95753d5aa2e3a7942eae2a5b015550e7
|
class ComposerAutoloaderInitbf1297da02d6475c76ee8fa5bb3a7c73
|
||||||
{
|
{
|
||||||
private static $loader;
|
private static $loader;
|
||||||
|
|
||||||
@ -22,16 +22,16 @@ class ComposerAutoloaderInit95753d5aa2e3a7942eae2a5b015550e7
|
|||||||
return self::$loader;
|
return self::$loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
spl_autoload_register(array('ComposerAutoloaderInit95753d5aa2e3a7942eae2a5b015550e7', 'loadClassLoader'), true, true);
|
spl_autoload_register(array('ComposerAutoloaderInitbf1297da02d6475c76ee8fa5bb3a7c73', 'loadClassLoader'), true, true);
|
||||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||||
spl_autoload_unregister(array('ComposerAutoloaderInit95753d5aa2e3a7942eae2a5b015550e7', 'loadClassLoader'));
|
spl_autoload_unregister(array('ComposerAutoloaderInitbf1297da02d6475c76ee8fa5bb3a7c73', 'loadClassLoader'));
|
||||||
|
|
||||||
require __DIR__ . '/autoload_static.php';
|
require __DIR__ . '/autoload_static.php';
|
||||||
call_user_func(\Composer\Autoload\ComposerStaticInit95753d5aa2e3a7942eae2a5b015550e7::getInitializer($loader));
|
call_user_func(\Composer\Autoload\ComposerStaticInitbf1297da02d6475c76ee8fa5bb3a7c73::getInitializer($loader));
|
||||||
|
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit95753d5aa2e3a7942eae2a5b015550e7::$files;
|
$filesToLoad = \Composer\Autoload\ComposerStaticInitbf1297da02d6475c76ee8fa5bb3a7c73::$files;
|
||||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace Composer\Autoload;
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
class ComposerStaticInit95753d5aa2e3a7942eae2a5b015550e7
|
class ComposerStaticInitbf1297da02d6475c76ee8fa5bb3a7c73
|
||||||
{
|
{
|
||||||
public static $files = array (
|
public static $files = array (
|
||||||
'2c2d2fe92db4cd03403dbb108ac263b7' => __DIR__ . '/..' . '/codeinwp/gutenberg-menu-icons/load.php',
|
'2c2d2fe92db4cd03403dbb108ac263b7' => __DIR__ . '/..' . '/codeinwp/gutenberg-menu-icons/load.php',
|
||||||
@ -20,7 +20,7 @@ class ComposerStaticInit95753d5aa2e3a7942eae2a5b015550e7
|
|||||||
public static function getInitializer(ClassLoader $loader)
|
public static function getInitializer(ClassLoader $loader)
|
||||||
{
|
{
|
||||||
return \Closure::bind(function () use ($loader) {
|
return \Closure::bind(function () use ($loader) {
|
||||||
$loader->classMap = ComposerStaticInit95753d5aa2e3a7942eae2a5b015550e7::$classMap;
|
$loader->classMap = ComposerStaticInitbf1297da02d6475c76ee8fa5bb3a7c73::$classMap;
|
||||||
|
|
||||||
}, null, ClassLoader::class);
|
}, null, ClassLoader::class);
|
||||||
}
|
}
|
||||||
|
@ -139,23 +139,23 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "codeinwp/themeisle-sdk",
|
"name": "codeinwp/themeisle-sdk",
|
||||||
"version": "3.2.37",
|
"version": "3.2.40",
|
||||||
"version_normalized": "3.2.37.0",
|
"version_normalized": "3.2.40.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Codeinwp/themeisle-sdk.git",
|
"url": "https://github.com/Codeinwp/themeisle-sdk.git",
|
||||||
"reference": "a2079ee8cea68b5dbaabec1e06f15048ae9c9de7"
|
"reference": "d719fff89cb6643e555f5e3daa4ebd627ccb4fd7"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/a2079ee8cea68b5dbaabec1e06f15048ae9c9de7",
|
"url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/d719fff89cb6643e555f5e3daa4ebd627ccb4fd7",
|
||||||
"reference": "a2079ee8cea68b5dbaabec1e06f15048ae9c9de7",
|
"reference": "d719fff89cb6643e555f5e3daa4ebd627ccb4fd7",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"codeinwp/phpcs-ruleset": "dev-main"
|
"codeinwp/phpcs-ruleset": "dev-main"
|
||||||
},
|
},
|
||||||
"time": "2023-03-01T18:02:16+00:00",
|
"time": "2023-03-30T09:29:30+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
@ -176,7 +176,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/Codeinwp/themeisle-sdk/issues",
|
"issues": "https://github.com/Codeinwp/themeisle-sdk/issues",
|
||||||
"source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.2.37"
|
"source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.2.40"
|
||||||
},
|
},
|
||||||
"install-path": "../codeinwp/themeisle-sdk"
|
"install-path": "../codeinwp/themeisle-sdk"
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php return array(
|
<?php return array(
|
||||||
'root' => array(
|
'root' => array(
|
||||||
'name' => 'codeinwp/wp-menu-icons',
|
'name' => 'codeinwp/wp-menu-icons',
|
||||||
'pretty_version' => 'v0.13.4',
|
'pretty_version' => 'v0.13.5',
|
||||||
'version' => '0.13.4.0',
|
'version' => '0.13.5.0',
|
||||||
'reference' => '8ea03e3323f7f4c4a6d07bd33f3a305b46cc1fbe',
|
'reference' => '90e8cdc9710ce66bc735545ccea2bd5048d7f2f6',
|
||||||
'type' => 'wordpress-plugin',
|
'type' => 'wordpress-plugin',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@ -42,18 +42,18 @@
|
|||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'codeinwp/themeisle-sdk' => array(
|
'codeinwp/themeisle-sdk' => array(
|
||||||
'pretty_version' => '3.2.37',
|
'pretty_version' => '3.2.40',
|
||||||
'version' => '3.2.37.0',
|
'version' => '3.2.40.0',
|
||||||
'reference' => 'a2079ee8cea68b5dbaabec1e06f15048ae9c9de7',
|
'reference' => 'd719fff89cb6643e555f5e3daa4ebd627ccb4fd7',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../codeinwp/themeisle-sdk',
|
'install_path' => __DIR__ . '/../codeinwp/themeisle-sdk',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'codeinwp/wp-menu-icons' => array(
|
'codeinwp/wp-menu-icons' => array(
|
||||||
'pretty_version' => 'v0.13.4',
|
'pretty_version' => 'v0.13.5',
|
||||||
'version' => '0.13.4.0',
|
'version' => '0.13.5.0',
|
||||||
'reference' => '8ea03e3323f7f4c4a6d07bd33f3a305b46cc1fbe',
|
'reference' => '90e8cdc9710ce66bc735545ccea2bd5048d7f2f6',
|
||||||
'type' => 'wordpress-plugin',
|
'type' => 'wordpress-plugin',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
|
Loading…
Reference in New Issue
Block a user