updated plugin Menu Icons version 0.13.15

This commit is contained in:
KawaiiPunk 2024-07-19 19:46:10 +00:00 committed by Gitium
parent 3b4e169a1e
commit 311bc308f5
32 changed files with 439 additions and 599 deletions

View File

@ -1,3 +1,8 @@
##### [Version 0.13.15](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.14...v0.13.15) (2024-07-10)
- Removed recommendations of unsupported plugins
- Fixed conditions for theme recommendation
##### [Version 0.13.14](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.13...v0.13.14) (2024-05-14)
- Enhanced security

View File

@ -367,12 +367,6 @@ final class Menu_Icons_Settings {
);
?>
<?php endforeach; ?>
<?php
printf(
'<li><a href="#" class="mi-settings-nav-tab" data-type="menu-icons-settings-extensions">%s</a></li>',
esc_html__( 'Extensions', 'menu-icons' )
);
?>
</ul>
<?php foreach ( self::_get_fields() as $section_index => $section ) : ?>
<div id="menu-icons-settings-<?php echo esc_attr( $section['id'] ) ?>"
@ -397,12 +391,6 @@ final class Menu_Icons_Settings {
<?php endforeach; ?>
</div>
<?php endforeach; ?>
<div id="menu-icons-settings-extensions" class="tabs-panel _extensions">
<h4 class="hide-if-js"><?php echo esc_html__( 'Extensions', 'menu-icons' ) ?></h4>
<ul>
<li><a target="_blank" href="http://wordpress.org/plugins/menu-icons-icomoon/">IcoMoon</a></li>
</ul>
</div>
</div>
<p class="submitbox button-controls">
<?php wp_nonce_field( self::UPDATE_KEY, self::UPDATE_KEY ) ?>
@ -782,14 +770,13 @@ final class Menu_Icons_Settings {
'all' => __( 'All', 'menu-icons' ),
'preview' => __( 'Preview', 'menu-icons' ),
'settingsInfo' => sprintf(
'<div> %1$s <p>' . esc_html__( 'Please note that the actual look of the icons on the front-end will also be affected by the style of your active theme. You can add your own CSS using %2$s or a plugin such as %3$s if you need to override it.', 'menu-icons' ) . '</p></div>',
'<div> %1$s <p>' . esc_html__( 'Please note that the actual look of the icons on the front-end will also be affected by the style of your active theme. You can add your own CSS using %2$s.', 'menu-icons' ) . '</p></div>',
$box_data,
sprintf(
'<a href="%s">%s</a>',
esc_url( $customizer_url ),
esc_html__( 'the customizer', 'menu-icons' )
),
'<a target="_blank" href="https://wordpress.org/plugins/advanced-css-editor/">Advanced CSS Editor</a>'
)
),
),
'settingsFields' => self::get_settings_fields(),

View File

@ -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.14
* Version: 0.13.15
* 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.14';
const VERSION = '0.13.15';
/**
* Holds plugin data
@ -196,6 +196,10 @@ final class Menu_Icons {
* Render dashboard notice.
*/
public static function _wp_menu_icons_dashboard_notice() {
$theme = get_template();
if ( 'neve' === $theme ) {
return;
}
$show_notice = true;
if ( ! empty( get_option( self::DISMISS_NOTICE, false ) ) ) {
$show_notice = false;

View File

@ -37,9 +37,6 @@ https://www.youtube.com/watch?v=YcSotWXIczI
### Planned supported icon types ###
- Image (URL)
### Extensions ###
- [IcoMoon](http://wordpress.org/plugins/menu-icons-icomoon/) by [IcoMoon.io](http://icomoon.io/)
### Compatible themes ###
Menu icons works with most of the themes out there, especially with popular ones like Twenty Seventeen or [Hestia](https://themeisle.com/themes/hestia/).

View File

@ -2,7 +2,7 @@
Contributors: codeinwp, themeisle
Tags: menu, nav-menu, icons, navigation
Requires at least: 4.7
Tested up to: 6.5
Tested up to: 6.6
Stable tag: trunk
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@ -37,9 +37,6 @@ https://www.youtube.com/watch?v=YcSotWXIczI
= Planned supported icon types =
- Image (URL)
= Extensions =
- [IcoMoon](http://wordpress.org/plugins/menu-icons-icomoon/) by [IcoMoon.io](http://icomoon.io/)
= Compatible themes =
Menu icons works with most of the themes out there, especially with popular ones like Twenty Seventeen or [Hestia](https://themeisle.com/themes/hestia/).
@ -225,6 +222,14 @@ Read [this blog post](http://kucrut.org/add-custom-image-sizes-right-way/).
== Changelog ==
##### [Version 0.13.15](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.14...v0.13.15) (2024-07-10)
- Removed recommendations of unsupported plugins
- Fixed conditions for theme recommendation
##### [Version 0.13.14](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.13...v0.13.14) (2024-05-14)
- Enhanced security

View File

@ -1,3 +1,29 @@
##### [Version 3.3.25](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.24...v3.3.25) (2024-07-08)
improve upgrade link
##### [Version 3.3.24](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.23...v3.3.24) (2024-06-25)
- Feat: Allow affiliate url change via DB option.
- Fix: Featured plugins displaying on some non-pro products.
##### [Version 3.3.23](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.22...v3.3.23) (2024-06-19)
- fix: compress images
- fix: replace huge SVG logo with png version
- fix: improve text on float widget
##### [Version 3.3.22](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.21...v3.3.22) (2024-05-17)
- Updated NPM packages
- Fixed the default state of the telemetry logger flag for PRO users
- Added floating widget functionality
- Updated the remote get check for WordPress VIP env
##### [Version 3.3.21](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.20...v3.3.21) (2024-04-29)
- fixes non-existant string being used in Licenser
##### [Version 3.3.20](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.19...v3.3.20) (2024-04-16)
fix required params on sprintf

Binary file not shown.

Before

Width:  |  Height:  |  Size: 669 KiB

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 210 KiB

View File

@ -1 +1 @@
<?php return array('dependencies' => array('wp-components', 'wp-element'), 'version' => '35f2cdc94ec1bd5b9745');
<?php return array('dependencies' => array('react', 'wp-components', 'wp-element'), 'version' => '2f7b01c785d210cc0a66');

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array('wp-components', 'wp-element'), 'version' => 'ce3090dc0e13b5e1c2e4');

View File

@ -0,0 +1 @@
#ti-sdk-float-widget .ti-float-button-enter{opacity:.01}#ti-sdk-float-widget .ti-float-button-enter.ti-float-button-enter-active{opacity:1;transition:opacity 200ms ease-in}#ti-sdk-float-widget .ti-float-button-leave{opacity:1}#ti-sdk-float-widget .ti-float-button-leave.ti-float-button-leave-active{opacity:.01;transition:opacity 200ms ease-in}#ti-sdk-float-widget .ti-float-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;padding:0;width:51px;height:51px;background-color:#f0f0f1;border-radius:50%;display:flex;align-items:center;justify-content:center;position:fixed;bottom:32px;right:24px}#ti-sdk-float-widget .ti-float-button:hover,#ti-sdk-float-widget .ti-float-button:focus{cursor:pointer}#ti-sdk-float-widget .ti-float-button>img,#ti-sdk-float-widget .ti-float-button>span{position:absolute;opacity:0;transition:opacity 200ms ease-in}#ti-sdk-float-widget .ti-float-button>img.active,#ti-sdk-float-widget .ti-float-button>span.active{opacity:1}#ti-sdk-float-widget .ti-float-button>img.active:hover,#ti-sdk-float-widget .ti-float-button>img.active:focus,#ti-sdk-float-widget .ti-float-button>span.active:hover,#ti-sdk-float-widget .ti-float-button>span.active:focus{opacity:.9}#ti-sdk-float-widget .ti-float-button>span{--ti-icon-size: 42px;font-size:var(--ti-icon-size);width:var(--ti-icon-size);height:var(--ti-icon-size);border-radius:50%;color:#fff;background-color:var(--ti-float-primary-color, #2271b1)}#ti-sdk-float-widget .ti-float-button>img{width:42px;height:42px}.ti-float-widget-panel{width:275px;border-radius:8px;background-color:#fff;box-shadow:0px 2px 15px 0px rgba(0,0,0,.1);margin:12px}.ti-float-widget-panel .ti-float-widget-panel__header{border-radius:8px 8px 0 0;padding:12px 12px 48px 12px;background:linear-gradient(75deg, var(--ti-float-primary-color, #2271b1) 15%, rgba(255, 255, 255, 0.65) 500%);display:flex;flex-direction:column;align-items:flex-start;gap:8px}.ti-float-widget-panel .ti-float-widget-panel__header img{background:#fff;border-radius:50%;width:42px;height:42px;box-shadow:0 0 0px 5px #fff;margin:5px}.ti-float-widget-panel .ti-float-widget-panel__header p,.ti-float-widget-panel .ti-float-widget-panel__header h3{color:#fff}.ti-float-widget-panel .ti-float-widget-panel__header p{font-size:14px}.ti-float-widget-panel .ti-float-widget-panel__header h3{font-size:20px;margin:0}.ti-float-widget-panel .ti-float-widget-panel__content{padding:12px;display:flex;flex-direction:column;gap:8px;margin-top:-36px}.ti-float-widget-panel .ti-float-widget-panel__content>a{display:flex;gap:8px;align-items:center;justify-content:flex-start;background:linear-gradient(-75deg, rgb(255, 255, 255) 0%, rgb(255, 255, 255) 100%);padding:12px;border-radius:8px;box-shadow:0px 2px 15px 0px rgba(0,0,0,.15);color:#000;font-size:14px;text-decoration:none;transition:background 200ms ease-in}.ti-float-widget-panel .ti-float-widget-panel__content>a:hover{background:linear-gradient(-75deg, var(--ti-float-primary-color, #2271b1) -150%, rgb(255, 255, 255) 50%)}.ti-float-widget-panel .ti-float-widget-panel__content>a:focus-visible{box-shadow:0 0 0 2px var(--ti-float-primary-color, #2271b1)}.ti-float-widget-panel .ti-float-widget-panel__content>a .dashicons{background:#2271b1;color:#efefef;font-size:16px;width:24px;height:24px;padding:4px;border-radius:4px}.ti-float-widget-panel .ti-float-widget-panel__content>a .dashicons.dashicons-book-alt{background:#fdd7ae;color:#ff9d32}.ti-float-widget-panel .ti-float-widget-panel__content>a .dashicons.dashicons-format-status{background:#96d7c7;color:#30955e}.ti-float-widget-panel .ti-float-widget-panel__content>a .dashicons.dashicons-admin-tools{background:#dac8ff;color:#783ff2}.ti-float-widget-panel .ti-float-widget-panel__content>a .dashicons.dashicons-superhero-alt{background:#ffe39e;color:#fdb600}.ti-float-widget-panel .ti-float-widget-panel__content>a .dashicons.dashicons-star-filled{background:#bfd0ff;color:#3068ff}

View File

@ -0,0 +1 @@
(()=>{"use strict";const e=window.wp.element;function t(t){let{isActive:l,onToggle:n}=t;const{logoUrl:a,primaryColor:o,strings:i,links:s}=window.tiSDKFloatData;return(0,e.createElement)("div",{className:"ti-float-widget-panel",style:{"--ti-float-primary-color":o}},(0,e.createElement)("div",{className:"ti-float-widget-panel__header"},(0,e.createElement)("img",{src:a,alt:"Site Logo"}),i.panelGreet&&(0,e.createElement)("p",null,i.panelGreet),i.panelTitle&&(0,e.createElement)("h3",null,i.panelTitle)),(0,e.createElement)("div",{className:"ti-float-widget-panel__content"},s&&s.map(((t,l)=>(0,e.createElement)("a",{key:"ti-float_link_"+l,href:t.link,target:!0===(null==t?void 0:t.internal)?"_self":"_blank"},(0,e.createElement)("span",{className:"dashicons "+t.icon}),t.title))),(0,e.createElement)("a",{href:"#ti-toggle-widget-float",className:"screen-reader-shortcut"},i.closeToggle?i.closeToggle:"Close")))}const l=window.wp.components;function n(n){let{isActive:a,onToggle:o,onClose:i}=n;const{logoUrl:s,strings:c}=window.tiSDKFloatData,r=c.toggleButton,m=a?"":"active",d=a?"active":"";return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{id:"ti-toggle-widget-float",tabIndex:"0",className:"ti-float-button",onClick:o,"aria-label":"","aria-pressed":a,"aria-disabled":!1,title:r},(0,e.createElement)("img",{className:"ti-float-logo "+m,src:s}),(0,e.createElement)("span",{className:"dashicons dashicons-no-alt ti-float-close-icon "+d}),(0,e.createElement)("span",{className:"screen-reader-text"},r),a&&(0,e.createElement)(l.Popover,{variant:"unstyled",placement:"top-end",onFocusOutside:()=>{console.log("Focus Outside"),i()}},(0,e.createElement)(t,null))))}function a(){const[t,l]=(0,e.useState)(!1);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n,{isActive:t,onToggle:()=>{l(!t)},onClose:()=>{l(!1)}}))}document.addEventListener("DOMContentLoaded",(()=>{const t=document.querySelector("#ti-sdk-float-widget");t&&(0,e.render)((0,e.createElement)(a,null),t)}))})();

View File

@ -1 +1 @@
<?php return array('dependencies' => array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-plugins'), 'version' => 'ba05d75f2096d5f440d0');
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-plugins'), 'version' => '81a0945a0f941cfc90fa');

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '7eac74bcd8abf2e43780');
<?php return array('dependencies' => array(), 'version' => 'd18c4036e32153ba476c');

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => 'bacc1f000efc9f479fc0');
<?php return array('dependencies' => array(), 'version' => 'b8af0b12ad3cabe4c4b8');

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
return;
}
// Current SDK version and path.
$themeisle_sdk_version = '3.3.20';
$themeisle_sdk_version = '3.3.25';
$themeisle_sdk_path = dirname( __FILE__ );
global $themeisle_sdk_max_version;
@ -91,6 +91,7 @@ if ( ! function_exists( 'tsdk_utmify' ) ) {
$current_page = sanitize_key( str_replace( '.php', '', $current_page ) );
}
$location = $location === null ? $current_page : $location;
$is_upgrade_url = strpos( $url, '/upgrade' ) !== false;
$content = sanitize_key(
trim(
str_replace(
@ -122,6 +123,26 @@ if ( ! function_exists( 'tsdk_utmify' ) ) {
)
);
/**
* Check if there is an affiliate URL for this upgrade link, if so use it.
*/
if ( $is_upgrade_url ) {
$option_content_key = str_replace( '-', '_', $filter_key );
$theme_upgrade_option_name = 'themeisle_af_' . $option_content_key . '_themes_upgrade';
$plugin_upgrade_option_name = 'themeisle_af_' . $option_content_key . '_plugins_upgrade';
$theme_option_url = get_option( $theme_upgrade_option_name, false );
if ( ! empty( $theme_option_url ) ) {
$utmify_url = esc_url_raw( $theme_option_url );
}
$plugin_option_url = get_option( $plugin_upgrade_option_name, false );
if ( ! empty( $plugin_option_url ) ) {
$utmify_url = esc_url_raw( $plugin_option_url );
}
}
return apply_filters( 'tsdk_utmify_url_' . $filter_key, $utmify_url, $url );
}

View File

@ -37,7 +37,7 @@ final class Loader {
/**
* Holds registered products.
*
* @var array The products which use the SDK.
* @var array<Product> The products which use the SDK.
*/
private static $products = [];
/**
@ -62,6 +62,7 @@ final class Loader {
'about_us',
'announcements',
'featured_plugins',
'float_widget',
];
/**
* Holds the labels for the modules.
@ -276,6 +277,22 @@ final class Loader {
],
],
],
'float_widget' => [
'button' => 'Toggle Help Widget for %s',
'panel' => [
'greeting' => 'Thank you for using %s',
'title' => 'How can we help you?',
'close' => 'Close Toggle Help Widget',
],
'links' => [
'documentation' => 'Documentation',
'support' => 'Get Support',
'wizard' => 'Run Setup Wizard',
'upgrade' => 'Upgrade to Pro',
'feature_request' => 'Suggest a Feature',
'rate' => 'Rate Us',
],
],
];
/**
@ -353,7 +370,7 @@ final class Loader {
/**
* Get all products using the SDK.
*
* @return array Products available.
* @return array<Product> Products available.
*/
public static function get_products() {
return self::$products;

View File

@ -124,12 +124,33 @@ class About_Us extends Abstract_Module {
add_submenu_page(
$this->about_data['location'],
$this->about_data['upgrade_text'],
$this->about_data['upgrade_text'],
'<span class="tsdk-upg-menu-item">' . $this->about_data['upgrade_text'] . '</span>',
'manage_options',
$this->about_data['upgrade_link'],
'',
101
);
add_action(
'admin_footer',
function () {
?>
<style>
.tsdk-upg-menu-item {
color: #009528;
}
.tsdk-upg-menu-item:hover {
color: #008a20;
}
</style>
<script type="text/javascript">
jQuery(document).ready(function ($) {
$('.tsdk-upg-menu-item').parent().attr('target', '_blank');
});
</script>
<?php
}
);
}
/**
@ -237,9 +258,9 @@ class About_Us extends Abstract_Module {
'heading' => Loader::$labels['about_us']['otter-page']['heading'],
'text' => Loader::$labels['about_us']['otter-page']['text'],
'buttons' => [
'install_otter_free' => Loader::$labels['about_us']['otter-page']['install_otter_free'],
'install_now' => Loader::$labels['about_us']['otter-page']['install_now'],
'learn_more' => Loader::$labels['about_us']['otter-page']['learn_more'],
'install_otter_free' => Loader::$labels['about_us']['otter-page']['buttons']['install_otter_free'],
'install_now' => Loader::$labels['about_us']['otter-page']['buttons']['install_now'],
'learn_more' => Loader::$labels['about_us']['otter-page']['buttons']['learn_more'],
'learn_more_link' => tsdk_utmify( 'https://themeisle.com/plugins/otter-blocks/', 'otter-page', 'about-us' ),
],
'features' => [

View File

@ -293,10 +293,11 @@ class Announcements extends Abstract_Module {
<style>
.themeisle-sale {
display: flex;
align-items: center;
}
</style>
<div class="themeisle-sale notice notice-info is-dismissible" data-announcement="black_friday">
<img src="<?php echo esc_url_raw( $this->get_sdk_uri() . 'assets/images/themeisle-logo.svg' ); ?>"/>
<img width="24" src="<?php echo esc_url_raw( $this->get_sdk_uri() . 'assets/images/themeisle-logo.png' ); ?>"/>
<p>
<strong><?php echo esc_html( Loader::$labels['announcements']['sale_live'] ); ?> ></strong>
- <?php echo sprintf( esc_html( Loader::$labels['announcements']['max_savings'] ), esc_html( implode( ', ', $product_names ) ) ); ?>

View File

@ -44,9 +44,7 @@ class Featured_Plugins extends Abstract_Module {
return false;
}
$slug = $product->get_slug();
// only load for products that contain "pro" in the slug.
if ( strpos( $slug, 'pro' ) === false ) {
if ( $product->is_wordpress_available() ) {
return false;
}

View File

@ -0,0 +1,274 @@
<?php
/**
* The float widget model class for ThemeIsle SDK
*
* Here's how to hook it in your plugin:
*
* add_filter( <product_slug>_float_widget_metadata', 'add_float_widget_meta' );
*
* function add_float_widget_meta($data) {
* return [
* 'logo' => <logo url>,
* 'nice_name' => <nice name>, // optional, will default to product name
* 'primary_color' => <hex_color_value>, // optional
* 'pages' => [ 'page-slugs' ], //pages where the float widget should be displayed
* 'has_upgrade_menu' => <condition>,
* 'upgrade_link' => <url>,
* 'documentation_link' => <url>,
* 'premium_support_link' => <url>, // optional, provide from pro version
* 'feature_request_link' => <url>, // optional, provide from pro version
* 'wizard_link' => <url>, // optional, provide if a user is available
* ]
* }
*
* @package ThemeIsleSDK
* @subpackage Modules
* @copyright Copyright (c) 2024, Bogdan Preda
* @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
* @since 3.2.42
*/
namespace ThemeisleSDK\Modules;
use ThemeisleSDK\Common\Abstract_Module;
use ThemeisleSDK\Loader;
use ThemeisleSDK\Product;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Float widget module for ThemeIsle SDK.
*/
class Float_Widget extends Abstract_Module {
/**
* Float widget data.
*
* @var array $float_widget_data Float widget data, received from the filter.
*
* Shape of the $about_data property array:
* [
* 'logo' => <logo url>,
* 'nice_name' => <nice name>, // optional, will default to product name
* 'primary_color' => <hex_color_value>, // optional
* 'pages' => [ 'page-slugs' ], //pages where the float widget should be displayed
* 'has_upgrade_menu' => <condition>,
* 'upgrade_link' => <url>,
* 'documentation_link' => <url>,
* 'premium_support_link' => <url>, // optional, provide from pro version
* 'feature_request_link' => <url>, // optional, provide from pro version
* 'wizard_link' => <url>, // optional, provide if a user is available
* ]
*/
private $float_widget_data = array();
/**
* 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;
}
$this->float_widget_data = apply_filters( $product->get_key() . '_float_widget_metadata', array() );
$can_load = ! empty( $this->float_widget_data );
$this->float_widget_data = array_merge(
[
'logo' => '',
'primary_color' => '#2271b1', // Default color.
'nice_name' => $product->get_name(),
'documentation_link' => '',
'premium_support_link' => '',
'feature_request_link' => '',
'wizard_link' => '',
],
$this->float_widget_data
);
return $can_load;
}
/**
* Registers the hooks.
*
* @param Product $product Product to load.
*/
public function load( $product ) {
$this->product = $product;
add_action( 'in_admin_footer', [ $this, 'render_float_placeholder' ] );
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_float_widget_script' ] );
}
/**
* Returns the allowed pages for the float widget.
*
* @return array
*/
private function get_allowed_pages() {
if ( ! isset( $this->float_widget_data['pages'] ) || ! is_array( $this->float_widget_data['pages'] ) ) {
return [];
}
return $this->float_widget_data['pages'];
}
/**
* Checks if the current screen is allowed for the float widget.
*
* @return bool
*/
private function is_current_screen_allowed() {
$current_screen = get_current_screen();
if ( ! isset( $current_screen->id ) ) {
return false;
}
if ( ! in_array( $current_screen->id, $this->get_allowed_pages(), true ) ) {
return false;
}
return true;
}
/**
* Renders the float widget placeholder.
*
* @return void
*/
public function render_float_placeholder() {
if ( ! $this->is_current_screen_allowed() ) {
return;
}
echo '<div id="ti-sdk-float-widget" style="--ti-float-primary-color: ' . esc_attr( $this->float_widget_data['primary_color'] ) . '"></div>';
}
/**
* Enqueue scripts & styles.
*
* @return void
*/
public function enqueue_float_widget_script() {
if ( ! $this->is_current_screen_allowed() ) {
return;
}
global $themeisle_sdk_max_path;
$handle = 'ti-sdk-float-' . $this->product->get_key();
$asset_file = require $themeisle_sdk_max_path . '/assets/js/build/float_widget/float.asset.php';
$deps = array_merge( $asset_file['dependencies'], [ 'updates' ] );
wp_register_script( $handle, $this->get_sdk_uri() . 'assets/js/build/float_widget/float.js', $deps, $asset_file['version'], true );
wp_localize_script( $handle, 'tiSDKFloatData', $this->get_float_localization_data() );
wp_enqueue_script( $handle );
wp_enqueue_style( $handle, $this->get_sdk_uri() . 'assets/js/build/float_widget/float.css', [ 'wp-components' ], $asset_file['version'] );
}
/**
* Get the float widget localization data.
*
* @return array
*/
private function get_float_localization_data() {
return [
'logoUrl' => $this->float_widget_data['logo'],
'primaryColor' => esc_attr( $this->float_widget_data['primary_color'] ),
'strings' => [
'toggleButton' => sprintf( Loader::$labels['float_widget']['button'], $this->float_widget_data['nice_name'] ),
'panelGreet' => sprintf( Loader::$labels['float_widget']['panel']['greeting'], $this->float_widget_data['nice_name'] ),
'panelTitle' => Loader::$labels['float_widget']['panel']['title'],
'closeToggle' => Loader::$labels['float_widget']['panel']['close'],
],
'links' => $this->get_links(),
];
}
/**
* Generates the links for the float widget.
*
* For Free:
* - Documentation (redirects to Themeisle doc page)
* - Get Support (redirects to WP free support forum)
* - Run Setup Wizard (this will trigger the setup wizard) if available
* - Upgrade to Pro (redirects to Themeisle upgrade page)
* - Rate Us (redirects to WP rating page)
*
* For Pro:
* - Documentation (redirects to Themeisle doc page)
* - Get Support (redirects to Themeisle support page to open a ticket)
* - Run Setup Wizard (this will trigger the setup wizard) if available
* - Feature Request (if available redirect to collect feedback requests)
* - Rate Us (redirects to WP rating page)
*
* @return array
*/
private function get_links() {
$links = [];
if ( ! empty( $this->float_widget_data['documentation_link'] ) ) {
$links[] = [
'icon' => 'dashicons-book-alt',
'title' => Loader::$labels['float_widget']['links']['documentation'],
'link' => $this->float_widget_data['documentation_link'],
];
}
$support_link = [
'icon' => 'dashicons-format-status',
'title' => Loader::$labels['float_widget']['links']['support'],
'link' => 'https://wordpress.org/support/' . $this->product->get_type() . '/' . $this->product->get_slug() . '/',
];
if ( ! $this->float_widget_data['has_upgrade_menu'] && ! empty( $this->float_widget_data['premium_support_link'] ) ) {
$support_link['link'] = $this->float_widget_data['premium_support_link'];
}
$links[] = $support_link;
if ( ! empty( $this->float_widget_data['wizard_link'] ) ) {
$links[] = [
'icon' => 'dashicons-admin-tools',
'title' => Loader::$labels['float_widget']['links']['wizard'],
'link' => $this->float_widget_data['wizard_link'],
'internal' => true,
];
}
$pro = [
'icon' => 'dashicons-superhero-alt',
'title' => Loader::$labels['float_widget']['links']['upgrade'],
'link' => $this->float_widget_data['upgrade_link'],
];
$featured_or_pro = $pro;
if ( ! $this->float_widget_data['has_upgrade_menu'] ) {
$featured_or_pro = []; // we remove the upgrade link
$featured = $pro;
$featured['title'] = Loader::$labels['float_widget']['links']['feature_request'];
$featured['link'] = $this->float_widget_data['feature_request_link'];
if ( ! empty( $featured['link'] ) ) {
$featured_or_pro = $featured;
}
}
if ( ! empty( $featured_or_pro ) ) {
$links[] = $featured_or_pro;
}
$links[] = [
'icon' => 'dashicons-star-filled',
'title' => Loader::$labels['float_widget']['links']['rate'],
'link' => 'https://wordpress.org/support/' . $this->product->get_type() . '/' . $this->product->get_slug() . '/reviews/#new-post',
];
return $links;
}
}

View File

@ -139,7 +139,7 @@ class Licenser extends Abstract_Module {
$value = $this->license_key;
$activate_string = apply_filters( $this->product->get_key() . '_lc_activate_string', Loader::$labels['licenser']['activate'] );
$deactivate_string = apply_filters( $this->product->get_key() . '_lc_deactivate_string', Loader::$labels['licenser']['deactivateactivate'] );
$deactivate_string = apply_filters( $this->product->get_key() . '_lc_deactivate_string', Loader::$labels['licenser']['deactivate'] );
$valid_string = apply_filters( $this->product->get_key() . '_lc_valid_string', Loader::$labels['licenser']['valid'] );
$invalid_string = apply_filters( $this->product->get_key() . '_lc_invalid_string', Loader::$labels['licenser']['invalid'] );
$license_message = apply_filters( $this->product->get_key() . '_lc_license_message', Loader::$labels['licenser']['notice'] );

View File

@ -188,7 +188,7 @@ class Logger extends Abstract_Module {
/**
* Load telemetry.
*
*
* @return void
*/
public function load_telemetry() {
@ -198,35 +198,35 @@ class Logger extends Abstract_Module {
$all_products = Loader::get_products();
$all_products[ $this->product->get_slug() ] = $this->product; // Add current product to the list of products to check for telemetry.
// Register telemetry params for eligible products.
foreach ( $all_products as $product_slug => $product ) {
// Ignore pro products.
// Ignore PRO products.
if ( false !== strstr( $product_slug, 'pro' ) ) {
continue;
}
$default = 'no';
$pro_slug = $product->get_pro_slug();
$logger_key = $product->get_key() . '_logger_flag';
if ( ! $product->is_wordpress_available() ) {
$default = 'yes';
} else {
$pro_slug = $product->get_pro_slug();
// If the product is not available in the WordPress store, or it's PRO version is installed, activate the logger if it was not initialized -- Pro users are opted in by default.
if ( ! $product->is_wordpress_available() || ( ! empty( $pro_slug ) && isset( $all_products[ $pro_slug ] ) ) ) {
$logger_flag = get_option( $logger_key );
if ( ! empty( $pro_slug ) && isset( $all_products[ $pro_slug ] ) ) {
$default = 'yes';
if ( false === $logger_flag ) {
update_option( $logger_key, 'yes' );
}
}
if ( 'yes' === get_option( $product->get_key() . '_logger_flag', $default ) ) {
if ( 'yes' === get_option( $product->get_key() . '_logger_flag', 'no' ) ) {
$main_slug = explode( '-', $product_slug );
$main_slug = $main_slug[0];
$pro_slug = $product->get_pro_slug();
$track_hash = Licenser::create_license_hash( str_replace( '-', '_', ! empty( $pro_slug ) ? $pro_slug : $product_slug ) );
// Check if product was already tracked.
$active_telemetry = false;
foreach ( $products_with_telemetry as &$product_with_telemetry ) {
foreach ( $products_with_telemetry as $product_with_telemetry ) {
if ( $product_with_telemetry['slug'] === $main_slug ) {
$active_telemetry = true;
break;
@ -236,7 +236,7 @@ class Logger extends Abstract_Module {
if ( $active_telemetry ) {
continue;
}
$products_with_telemetry[] = array(
'slug' => $main_slug,
'trackHash' => $track_hash ? $track_hash : 'free',
@ -251,7 +251,6 @@ class Logger extends Abstract_Module {
return;
}
$tracking_handler = apply_filters( 'themeisle_sdk_dependency_script_handler', 'tracking' );
if ( ! empty( $tracking_handler ) ) {
do_action( 'themeisle_sdk_dependency_enqueue_script', 'tracking' );
@ -268,10 +267,6 @@ class Logger extends Abstract_Module {
if ( defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) {
error_log( $e->getMessage() ); // phpcs:ignore
}
} catch ( \Error $e ) {
if ( defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) {
error_log( $e->getMessage() ); // phpcs:ignore
}
} finally {
return;
}

View File

@ -121,8 +121,8 @@ class Rollback extends Abstract_Module {
if ( empty( $url ) ) {
return [];
}
$response = function_exists( 'wp_remote_get_wp_remote_get' )
? wp_remote_get_wp_remote_get( $url )
$response = function_exists( 'vip_safe_wp_remote_get' )
? vip_safe_wp_remote_get( $url )
: wp_remote_get( $url ); //phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get
if ( is_wp_error( $response ) ) {
return array();

View File

@ -39,6 +39,7 @@ $files_to_load = [
$themeisle_library_path . '/src/Modules/About_us.php',
$themeisle_library_path . '/src/Modules/Announcements.php',
$themeisle_library_path . '/src/Modules/Featured_plugins.php',
$themeisle_library_path . '/src/Modules/Float_widget.php',
];
$files_to_load = array_merge( $files_to_load, apply_filters( 'themeisle_sdk_required_files', [] ) );

View File

@ -133,23 +133,23 @@
},
{
"name": "codeinwp/themeisle-sdk",
"version": "3.3.20",
"version_normalized": "3.3.20.0",
"version": "3.3.25",
"version_normalized": "3.3.25.0",
"source": {
"type": "git",
"url": "https://github.com/Codeinwp/themeisle-sdk.git",
"reference": "d1b92f3ab74f1b3f0afad7e23ddb1c058d66c03c"
"reference": "29b7c81f8ccd039f49d62ef7427a4cc06369becc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/d1b92f3ab74f1b3f0afad7e23ddb1c058d66c03c",
"reference": "d1b92f3ab74f1b3f0afad7e23ddb1c058d66c03c",
"url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/29b7c81f8ccd039f49d62ef7427a4cc06369becc",
"reference": "29b7c81f8ccd039f49d62ef7427a4cc06369becc",
"shasum": ""
},
"require-dev": {
"codeinwp/phpcs-ruleset": "dev-main"
},
"time": "2024-04-16T12:27:32+00:00",
"time": "2024-07-08T13:49:14+00:00",
"type": "library",
"installation-source": "dist",
"notification-url": "https://packagist.org/downloads/",
@ -168,6 +168,10 @@
"keywords": [
"wordpress"
],
"support": {
"issues": "https://github.com/Codeinwp/themeisle-sdk/issues",
"source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.25"
},
"install-path": "../codeinwp/themeisle-sdk"
},
{

View File

@ -1,9 +1,9 @@
<?php return array(
'root' => array(
'name' => 'codeinwp/wp-menu-icons',
'pretty_version' => 'v0.13.14',
'version' => '0.13.14.0',
'reference' => 'a7c071a7be5a809a8379624381d823e2d9b20e50',
'pretty_version' => 'v0.13.15',
'version' => '0.13.15.0',
'reference' => '6f28bd69233def87a6289b95d36c9b9b5500cefb',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -40,18 +40,18 @@
'dev_requirement' => false,
),
'codeinwp/themeisle-sdk' => array(
'pretty_version' => '3.3.20',
'version' => '3.3.20.0',
'reference' => 'd1b92f3ab74f1b3f0afad7e23ddb1c058d66c03c',
'pretty_version' => '3.3.25',
'version' => '3.3.25.0',
'reference' => '29b7c81f8ccd039f49d62ef7427a4cc06369becc',
'type' => 'library',
'install_path' => __DIR__ . '/../codeinwp/themeisle-sdk',
'aliases' => array(),
'dev_requirement' => false,
),
'codeinwp/wp-menu-icons' => array(
'pretty_version' => 'v0.13.14',
'version' => '0.13.14.0',
'reference' => 'a7c071a7be5a809a8379624381d823e2d9b20e50',
'pretty_version' => 'v0.13.15',
'version' => '0.13.15.0',
'reference' => '6f28bd69233def87a6289b95d36c9b9b5500cefb',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),