updated plugin `Menu Icons` version 0.13.8

This commit is contained in:
KawaiiPunk 2024-01-03 21:51:15 +00:00 committed by Gitium
parent 4c9acbf50f
commit 17dad8c76e
24 changed files with 310 additions and 2790 deletions

View File

@ -1,3 +1,8 @@
##### [Version 0.13.8](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.7...v0.13.8) (2023-12-19)
- SDK Updates
- Fixed global hide label issue
##### [Version 0.13.7](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.6...v0.13.7) (2023-08-17)
- Updated dependencies

View File

@ -240,9 +240,11 @@ final class Menu_Icons_Front_End {
if ( empty( $icon ) ) {
return $title;
}
$title_class = ! empty( $meta['hide_label'] ) ? self::$hidden_label_class : '';
$title_wrapped = sprintf(
$menu_id = Menu_Icons_Settings::get_current_menu_id();
$menu_key = sprintf( 'menu_%d', $menu_id );
$global_hide_label = Menu_Icons_Settings::get( $menu_key, 'hide_label' );
$title_class = ! empty( $global_hide_label ) || ! empty( $meta['hide_label'] ) ? self::$hidden_label_class : '';
$title_wrapped = sprintf(
'<span%s>%s</span>',
( ! empty( $title_class ) ) ? sprintf( ' class="%s"', esc_attr( $title_class ) ) : '',
$title

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.7
* Version: 0.13.8
* 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.7';
const VERSION = '0.13.8';
/**
* Holds plugin data

View File

@ -2,7 +2,7 @@
Contributors: codeinwp, themeisle
Tags: menu, nav-menu, icons, navigation
Requires at least: 4.7
Tested up to: 6.3
Tested up to: 6.4
Stable tag: trunk
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@ -225,6 +225,14 @@ Read [this blog post](http://kucrut.org/add-custom-image-sizes-right-way/).
== Changelog ==
##### [Version 0.13.8](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.7...v0.13.8) (2023-12-19)
- SDK Updates
- Fixed global hide label issue
##### [Version 0.13.7](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.6...v0.13.7) (2023-08-17)
- Updated dependencies

View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit2df3d2da63bd22bca27c5f9e05dba454::getLoader();
return ComposerAutoloaderInite0e064cdd82a4be104872380c8a68791::getLoader();

View File

@ -1,3 +1,42 @@
##### [Version 3.3.11](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.10...v3.3.11) (2023-12-12)
- fix: cached requests for wp options
- fix: php notice on failed xml feed
##### [Version 3.3.10](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.9...v3.3.10) (2023-12-11)
feat: add new filter for tsdk_utmify query arguments
##### [Version 3.3.9](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.8...v3.3.9) (2023-11-16)
- Fix: a debugging error when you activate Neve Pro after installing Otter & Otter Pro without the license.
##### [Version 3.3.8](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.7...v3.3.8) (2023-11-14)
- Add Product Telemetry
##### [Version 3.3.7](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.6...v3.3.7) (2023-10-31)
- fix: deprecating notice in Dashboard Widget
##### [Version 3.3.6](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.5...v3.3.6) (2023-10-05)
- Fix duplicate notification in Neve FSE
- Fix SDK breaking Enfold theme builder
##### [Version 3.3.5](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.4...v3.3.5) (2023-09-29)
Fix TPC message.
Fix TPC typo.
##### [Version 3.3.4](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.3...v3.3.4) (2023-09-18)
- Allow users to activate plugins from the About page
##### [Version 3.3.3](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.2...v3.3.3) (2023-08-22)
- Disable install buttons on the About page if users can not install plugins
##### [Version 3.3.2](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.1...v3.3.2) (2023-08-02)
- Added a new product page for Otter

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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' => 'c6a13557ef46b0a921d3');
<?php return array('dependencies' => array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-plugins'), 'version' => 'bae1a40c3811e093a7be');

File diff suppressed because one or more lines are too long

View File

@ -1,250 +1 @@
/*!****************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./assets/js/src/OptimoleNotice/style.scss ***!
\****************************************************************************************************************************************************************************************************************************************************************/
.ti-sdk-om-notice {
--wp-admin-theme-color: #3858E9;
--wp-admin-theme-color-darker-10: #2e47ba;
position: relative;
padding: 0;
border-left-color: #3858E9;
}
.ti-sdk-om-notice .content {
background: rgba(255, 255, 255, 0.75);
display: flex;
align-items: center;
padding: 15px 20px;
}
.ti-sdk-om-notice img {
max-width: 100px;
margin-right: 20px;
display: none;
}
.ti-sdk-om-notice .description {
font-size: 14px;
margin-bottom: 20px;
color: #000;
}
.ti-sdk-om-notice .actions {
margin-top: auto;
display: flex;
margin-bottom: 0;
gap: 20px;
}
.ti-sdk-om-notice form {
display: flex;
align-items: center;
gap: 10px;
}
.ti-sdk-om-notice .form-wrap {
display: grid;
}
.ti-sdk-om-notice .form-wrap span:not(.dashicons) {
margin-bottom: 5px;
font-weight: 500;
}
.ti-sdk-om-notice input {
border-radius: 0;
min-width: 250px;
}
.ti-sdk-om-notice a.components-button {
display: flex;
align-items: center;
justify-content: center;
}
.ti-sdk-om-notice .is-link {
text-decoration: none;
display: flex;
align-items: center;
}
.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 {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.ti-sdk-om-notice .done a {
width: auto;
}
.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 {
right: 10px;
top: 10px;
text-decoration: none !important;
position: absolute;
}
.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;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
text-align: center;
padding: 20px 10px;
}
.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;
margin: 30px auto 10px;
font-weight: 600;
}
.ti-om-stack-wrap .om-stack-notice p {
font-size: 13px;
max-width: 250px;
margin: 0 auto;
line-height: 17px;
}
.ti-om-stack-wrap .om-stack-notice i {
margin-top: 10px;
font-size: 12px;
color: #757575;
}
.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 {
place-items: center;
width: 75%;
display: grid;
margin-top: 10px;
gap: 10px;
}
.ti-om-stack-wrap .om-stack-notice .done {
margin-top: 15px;
display: grid;
gap: 10px;
}
.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 {
gap: 5px;
font-size: 14px;
display: flex;
align-items: center;
}
.om-progress .spin {
animation: om-rotation 2s infinite linear;
}
@keyframes om-rotation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(359deg);
}
}
.ti-sdk-om-promo.hidden {
display: none;
}
.media-sidebar .ti-sdk-om-notice input {
min-width: unset;
flex-grow: 1;
}
.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 {
min-width: unset;
flex-grow: 1;
}
.attachment-info .ti-sdk-om-notice form {
flex-wrap: wrap;
justify-content: center;
}
.ti-sdk-rop-notice {
position: relative;
padding: 10px;
}
.ti-sdk-rop-notice .rop-notice-actions {
display: flex;
gap: 10px;
}
.ti-sdk-rop-notice p {
padding: 0 10px 0 0;
}
.ti-sdk-neve-fse-notice {
position: relative;
padding: 10px;
}
.ti-sdk-neve-fse-notice .neve-fse-notice-actions {
display: flex;
gap: 10px;
}
.ti-sdk-neve-fse-notice .neve-fse-notice-actions a {
text-decoration: none;
}
.ti-sdk-neve-fse-notice .neve-fse-notice-actions a span:not(.dashicons) {
text-decoration: underline;
}
.ti-sdk-neve-fse-notice p {
padding: 0 10px 0 0;
font-size: 14px;
}
@media screen and (min-width: 768px) {
.ti-sdk-om-notice img {
display: block;
}
}
@media screen and (min-width: 1200px) {
.attachment-info .ti-sdk-om-notice form {
flex-wrap: unset;
}
}
/*# sourceMappingURL=style-index.css.map*/
.ti-sdk-om-notice{--wp-admin-theme-color: #3858E9;--wp-admin-theme-color-darker-10: #2e47ba;position:relative;padding:0;border-left-color:#3858e9}.ti-sdk-om-notice .content{background:rgba(255,255,255,.75);display:flex;align-items:center;padding:15px 20px}.ti-sdk-om-notice img{max-width:100px;margin-right:20px;display:none}.ti-sdk-om-notice .description{font-size:14px;margin-bottom:20px;color:#000}.ti-sdk-om-notice .actions{margin-top:auto;display:flex;margin-bottom:0;gap:20px}.ti-sdk-om-notice form{display:flex;align-items:center;gap:10px}.ti-sdk-om-notice .form-wrap{display:grid}.ti-sdk-om-notice .form-wrap span:not(.dashicons){margin-bottom:5px;font-weight:500}.ti-sdk-om-notice input{border-radius:0;min-width:250px}.ti-sdk-om-notice a.components-button{display:flex;align-items:center;justify-content:center}.ti-sdk-om-notice .is-link{text-decoration:none;display:flex;align-items:center}.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{display:flex;flex-direction:column;align-items:flex-start}.ti-sdk-om-notice .done a{width:auto}.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{right:10px;top:10px;text-decoration:none !important;position:absolute}.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;display:flex;flex-direction:column;align-items:center;position:relative;text-align:center;padding:20px 10px}.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;margin:30px auto 10px;font-weight:600}.ti-om-stack-wrap .om-stack-notice p{font-size:13px;max-width:250px;margin:0 auto;line-height:17px}.ti-om-stack-wrap .om-stack-notice i{margin-top:10px;font-size:12px;color:#757575}.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{place-items:center;width:75%;display:grid;margin-top:10px;gap:10px}.ti-om-stack-wrap .om-stack-notice .done{margin-top:15px;display:grid;gap:10px}.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{gap:5px;font-size:14px;display:flex;align-items:center}.om-progress .spin{animation:om-rotation 2s infinite linear}@keyframes om-rotation{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.ti-sdk-om-promo.hidden{display:none}.media-sidebar .ti-sdk-om-notice input{min-width:unset;flex-grow:1}.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{min-width:unset;flex-grow:1}.attachment-info .ti-sdk-om-notice form{flex-wrap:wrap;justify-content:center}.ti-sdk-rop-notice{position:relative;padding:10px}.ti-sdk-rop-notice .rop-notice-actions{display:flex;gap:10px}.ti-sdk-rop-notice p{padding:0 10px 0 0}.ti-sdk-neve-fse-notice{position:relative;padding:10px}.ti-sdk-neve-fse-notice .neve-fse-notice-actions{display:flex;gap:10px}.ti-sdk-neve-fse-notice .neve-fse-notice-actions a{text-decoration:none}.ti-sdk-neve-fse-notice .neve-fse-notice-actions a span:not(.dashicons){text-decoration:underline}.ti-sdk-neve-fse-notice p{padding:0 10px 0 0;font-size:14px}@media screen and (min-width: 768px){.ti-sdk-om-notice img{display:block}}@media screen and (min-width: 1200px){.attachment-info .ti-sdk-om-notice form{flex-wrap:unset}}

View File

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

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.2';
$themeisle_sdk_version = '3.3.11';
$themeisle_sdk_path = dirname( __FILE__ );
global $themeisle_sdk_max_version;
@ -90,8 +90,8 @@ if ( ! function_exists( 'tsdk_utmify' ) ) {
$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(
$location = $location === null ? $current_page : $location;
$content = sanitize_key(
trim(
str_replace(
[
@ -102,22 +102,26 @@ if ( ! function_exists( 'tsdk_utmify' ) ) {
'/upgrade',
],
'',
$url
$url
),
'/'
)
'/'
)
);
return esc_url_raw(
$filter_key = sanitize_key( $content );
$url_args = [
'utm_source' => 'wpadmin',
'utm_medium' => $location,
'utm_campaign' => $area,
'utm_content' => $content,
];
$query_arguments = apply_filters( 'tsdk_utmify_' . $filter_key, $url_args, $url );
$utmify_url = esc_url_raw(
add_query_arg(
[
'utm_source' => 'wpadmin',
'utm_medium' => $location,
'utm_campaign' => $area,
'utm_content' => $content,
],
$url
)
$query_arguments,
$url
)
);
return apply_filters( 'tsdk_utmify_url_' . $filter_key, $utmify_url, $url );
}
add_filter( 'tsdk_utmify', 'tsdk_utmify', 10, 3 );

View File

@ -175,20 +175,19 @@ class About_Us extends Abstract_Module {
private function get_about_localization_data() {
$links = isset( $this->about_data['page_menu'] ) ? $this->about_data['page_menu'] : [];
$product_pages = isset( $this->about_data['product_pages'] ) ? $this->about_data['product_pages'] : [];
return [
'links' => $links,
'logoUrl' => $this->about_data['logo'],
'productPages' => $this->get_product_pages_data( $product_pages ),
'products' => $this->get_other_products_data(),
'homeUrl' => esc_url( home_url() ),
'pageSlug' => $this->get_about_page_slug(),
'currentProduct' => [
'links' => $links,
'logoUrl' => $this->about_data['logo'],
'productPages' => $this->get_product_pages_data( $product_pages ),
'products' => $this->get_other_products_data(),
'homeUrl' => esc_url( home_url() ),
'pageSlug' => $this->get_about_page_slug(),
'currentProduct' => [
'slug' => $this->product->get_key(),
'name' => $this->product->get_name(),
],
'teamImage' => $this->get_sdk_uri() . 'assets/images/team.jpg',
'strings' => [
'teamImage' => $this->get_sdk_uri() . 'assets/images/team.jpg',
'strings' => [
'aboutUs' => __( 'About us', 'textdomain' ),
'heroHeader' => __( 'Our Story', 'textdomain' ),
'heroTextFirst' => __( 'Themeisle was founded in 2012 by a group of passionate developers who wanted to create beautiful and functional WordPress themes and plugins. Since then, we have grown into a team of over 20 dedicated professionals who are committed to delivering the best possible products to our customers.', 'textdomain' ),
@ -204,6 +203,8 @@ class About_Us extends Abstract_Module {
'notInstalled' => __( 'Not Installed', 'textdomain' ),
'active' => __( 'Active', 'textdomain' ),
],
'canInstallPlugins' => current_user_can( 'install_plugins' ),
'canActivatePlugins' => current_user_can( 'activate_plugins' ),
];
}
@ -286,8 +287,8 @@ class About_Us extends Abstract_Module {
$pages,
function ( $page_data, $page_key ) use ( $product_pages ) {
return in_array( $page_key, $product_pages, true ) &&
isset( $page_data['plugin']['status'] ) &&
$page_data['plugin']['status'] === 'not-installed';
isset( $page_data['plugin']['status'] ) &&
$page_data['plugin']['status'] === 'not-installed';
},
ARRAY_FILTER_USE_BOTH
);
@ -345,8 +346,8 @@ class About_Us extends Abstract_Module {
'condition' => class_exists( 'WooCommerce', false ),
],
'templates-patterns-collection' => [
'name' => 'Template Cloud',
'description' => __( 'Ultimate Free Templates Cloud for WordPress, for blocks, patters of full pages.', 'textdomain' ),
'name' => 'Templates Cloud',
'description' => __( 'Design, save, and revisit your templates anytime with your personal vault on Templates Cloud.', 'textdomain' ),
],
];

View File

@ -313,8 +313,35 @@ class Dashboard_Widget extends Abstract_Module {
*/
private function setup_feeds() {
if ( false === ( $items_normalized = get_transient( 'themeisle_sdk_feed_items' ) ) ) { //phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure
// Do not force the feed for the items in the sdk feeds list.
// this prevents showing notices if another plugin will force all SimplePie feeds to load, instead it will
// use the regular SimplePie validation and abort early if the feed is not valid.
$sdk_feeds = $this->feeds;
add_action(
'wp_feed_options',
function ( $feed, $url ) use ( $sdk_feeds ) {
if ( defined( 'TI_SDK_PHPUNIT' ) && true === TI_SDK_PHPUNIT ) {
return;
}
if ( ! is_string( $url ) && in_array( $url, $sdk_feeds, true ) ) {
$feed->force_feed( false );
return;
}
if ( is_array( $url ) ) {
foreach ( $url as $feed_url ) {
if ( in_array( $feed_url, $sdk_feeds, true ) ) {
$feed->force_feed( false );
return;
}
}
}
},
PHP_INT_MAX,
2
);
// Load SimplePie Instance.
$feed = fetch_feed( $this->feeds );
$feed = fetch_feed( $sdk_feeds );
// TODO report error when is an error loading the feed.
if ( is_wp_error( $feed ) ) {
return;
@ -322,6 +349,9 @@ class Dashboard_Widget extends Abstract_Module {
$items = $feed->get_items( 0, 5 );
$items = is_array( $items ) ? $items : [];
$items_normalized = [];
foreach ( $items as $item ) {
$items_normalized[] = array(
'title' => $item->get_title(),

View File

@ -264,6 +264,23 @@ class Licenser extends Abstract_Module {
return isset( $license_data->license ) ? $license_data : false;
}
/**
* Get license hash.
*
* @param string $key Product key.
*
* @return bool|string
*/
public static function create_license_hash( $key ) {
$data = self::get_license_data( $key );
if ( ! $data ) {
return false;
}
return isset( $data->key ) ? wp_hash( $data->key ) : false;
}
/**
* Check if license is valid.
*

View File

@ -29,6 +29,11 @@ class Logger extends Abstract_Module {
*/
const TRACKING_ENDPOINT = 'https://api.themeisle.com/tracking/log';
/**
* Endpoint where to collect telemetry.
*/
const TELEMETRY_ENDPOINT = 'https://api.themeisle.com/tracking/events';
/**
* Check if we should load the module for this product.
@ -38,7 +43,6 @@ class Logger extends Abstract_Module {
* @return bool Should we load ?
*/
public function can_load( $product ) {
return apply_filters( $product->get_slug() . '_sdk_enable_logger', true );
}
@ -53,7 +57,6 @@ class Logger extends Abstract_Module {
$this->product = $product;
$this->setup_notification();
$this->setup_actions();
return $this;
}
@ -76,12 +79,18 @@ class Logger extends Abstract_Module {
if ( ! $this->is_logger_active() ) {
return;
}
$can_load_telemetry = apply_filters( 'themeisle_sdk_enable_telemetry', false );
if ( $can_load_telemetry ) {
add_action( 'admin_enqueue_scripts', array( $this, 'load_telemetry' ) );
}
$action_key = $this->product->get_key() . '_log_activity';
if ( ! wp_next_scheduled( $action_key ) ) {
wp_schedule_single_event( time() + ( wp_rand( 1, 24 ) * 3600 ), $action_key );
}
add_action( $action_key, array( $this, 'send_log' ) );
}
/**
@ -176,4 +185,101 @@ class Logger extends Abstract_Module {
)
);
}
/**
* Load telemetry.
*
* @return void
*/
public function load_telemetry() {
// See which products have telemetry enabled.
try {
$products_with_telemetry = array();
$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.
foreach ( $all_products as $product_slug => $product ) {
// Ignore pro products.
if ( false !== strstr( $product_slug, 'pro' ) ) {
continue;
}
$default = 'no';
if ( ! $product->is_wordpress_available() ) {
$default = 'yes';
} else {
$pro_slug = $product->get_pro_slug();
if ( ! empty( $pro_slug ) && isset( $all_products[ $pro_slug ] ) ) {
$default = 'yes';
}
}
if ( 'yes' === get_option( $product->get_key() . '_logger_flag', $default ) ) {
$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 ) {
if ( $product_with_telemetry['slug'] === $main_slug ) {
$active_telemetry = true;
break;
}
}
if ( $active_telemetry ) {
continue;
}
$products_with_telemetry[] = array(
'slug' => $main_slug,
'trackHash' => $track_hash ? $track_hash : 'free',
'consent' => true,
);
}
}
$products_with_telemetry = apply_filters( 'themeisle_sdk_telemetry_products', $products_with_telemetry );
if ( 0 === count( $products_with_telemetry ) ) {
return;
}
global $themeisle_sdk_max_path;
$asset_file = require $themeisle_sdk_max_path . '/assets/js/build/tracking/tracking.asset.php';
wp_enqueue_script(
'themeisle_sdk_telemetry_script',
$this->get_sdk_uri() . 'assets/js/build/tracking/tracking.js',
$asset_file['dependencies'],
$asset_file['version'],
true
);
wp_localize_script(
'themeisle_sdk_telemetry_script',
'tiTelemetry',
array(
'products' => $products_with_telemetry,
'endpoint' => self::TELEMETRY_ENDPOINT,
)
);
} catch ( \Exception $e ) {
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

@ -159,7 +159,6 @@ class Promotions extends Abstract_Module {
*/
public function load_available() {
$this->promotions = $this->filter_by_screen_and_merge();
if ( empty( $this->promotions ) ) {
return;
}
@ -268,6 +267,22 @@ class Promotions extends Abstract_Module {
return false;
}
/**
* Third-party compatibility.
*
* @return boolean
*/
private function has_conflicts() {
global $pagenow;
// Editor notices aren't compatible with Enfold theme.
if ( defined( 'AV_FRAMEWORK_VERSION' ) && in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) {
return true;
}
return false;
}
/**
* Get promotions.
*
@ -285,6 +300,8 @@ class Promotions extends Abstract_Module {
$has_ppom = defined( 'PPOM_VERSION' ) || $this->is_plugin_installed( 'woocommerce-product-addon' );
$is_min_req_v = version_compare( get_bloginfo( 'version' ), '5.8', '>=' );
$is_min_fse_v = version_compare( get_bloginfo( 'version' ), '6.2', '>=' );
$current_theme = wp_get_theme();
$has_neve_fse = $current_theme->template === 'neve-fse' || $current_theme->parent() === 'neve-fse';
$has_enough_attachments = $this->has_min_media_attachments();
$has_enough_old_posts = $this->has_old_posts();
@ -351,7 +368,7 @@ class Promotions extends Abstract_Module {
],
'neve-fse' => [
'neve-fse-themes-popular' => [
'env' => $is_min_fse_v,
'env' => ! $has_neve_fse && $is_min_fse_v,
'screen' => 'themes-install-popular',
],
],
@ -359,7 +376,7 @@ class Promotions extends Abstract_Module {
foreach ( $all as $slug => $data ) {
foreach ( $data as $key => $conditions ) {
if ( ! $conditions['env'] ) {
if ( ! $conditions['env'] || $this->has_conflicts() ) {
unset( $all[ $slug ][ $key ] );
continue;
@ -530,6 +547,12 @@ class Promotions extends Abstract_Module {
$this->load_woo_promos();
break;
case 'neve-fse-themes-popular':
// Remove any other notifications if Neve FSE promotion is showing
remove_action( 'admin_notices', array( 'ThemeisleSDK\Modules\Notification', 'show_notification' ) );
remove_action( 'wp_ajax_themeisle_sdk_dismiss_notice', array( 'ThemeisleSDK\Modules\Notification', 'dismiss' ) );
remove_action( 'admin_head', array( 'ThemeisleSDK\Modules\Notification', 'dismiss_get' ) );
remove_action( 'admin_head', array( 'ThemeisleSDK\Modules\Notification', 'setup_notifications' ) );
// Add required actions to display this notification
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] );
add_action( 'admin_notices', [ $this, 'render_neve_fse_themes_notice' ] );
break;
@ -784,7 +807,7 @@ class Promotions extends Abstract_Module {
);
return $tabs;
}
}
);
add_action( 'woocommerce_product_data_panels', array( $this, 'woocommerce_tab_content' ) );
@ -800,7 +823,7 @@ class Promotions extends Abstract_Module {
function( $key ) {
return in_array( $key, $this->promotions, true );
},
ARRAY_FILTER_USE_KEY
ARRAY_FILTER_USE_KEY
);
// Display CSS

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit2df3d2da63bd22bca27c5f9e05dba454
class ComposerAutoloaderInite0e064cdd82a4be104872380c8a68791
{
private static $loader;
@ -22,16 +22,16 @@ class ComposerAutoloaderInit2df3d2da63bd22bca27c5f9e05dba454
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit2df3d2da63bd22bca27c5f9e05dba454', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInite0e064cdd82a4be104872380c8a68791', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit2df3d2da63bd22bca27c5f9e05dba454', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInite0e064cdd82a4be104872380c8a68791', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit2df3d2da63bd22bca27c5f9e05dba454::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInite0e064cdd82a4be104872380c8a68791::getInitializer($loader));
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit2df3d2da63bd22bca27c5f9e05dba454::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInite0e064cdd82a4be104872380c8a68791::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit2df3d2da63bd22bca27c5f9e05dba454
class ComposerStaticInite0e064cdd82a4be104872380c8a68791
{
public static $files = array (
'2c2d2fe92db4cd03403dbb108ac263b7' => __DIR__ . '/..' . '/codeinwp/gutenberg-menu-icons/load.php',
@ -20,7 +20,7 @@ class ComposerStaticInit2df3d2da63bd22bca27c5f9e05dba454
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->classMap = ComposerStaticInit2df3d2da63bd22bca27c5f9e05dba454::$classMap;
$loader->classMap = ComposerStaticInite0e064cdd82a4be104872380c8a68791::$classMap;
}, null, ClassLoader::class);
}

View File

@ -128,23 +128,23 @@
},
{
"name": "codeinwp/themeisle-sdk",
"version": "3.3.2",
"version_normalized": "3.3.2.0",
"version": "3.3.11",
"version_normalized": "3.3.11.0",
"source": {
"type": "git",
"url": "https://github.com/Codeinwp/themeisle-sdk.git",
"reference": "b799403bec877749ee0a2916dc859366d62bd76c"
"reference": "583c474d8b5a8d12592f4a78ab8fa335aaf42fc0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/b799403bec877749ee0a2916dc859366d62bd76c",
"reference": "b799403bec877749ee0a2916dc859366d62bd76c",
"url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/583c474d8b5a8d12592f4a78ab8fa335aaf42fc0",
"reference": "583c474d8b5a8d12592f4a78ab8fa335aaf42fc0",
"shasum": ""
},
"require-dev": {
"codeinwp/phpcs-ruleset": "dev-main"
},
"time": "2023-08-02T13:04:20+00:00",
"time": "2023-12-12T10:06:27+00:00",
"type": "library",
"installation-source": "dist",
"notification-url": "https://packagist.org/downloads/",

View File

@ -1,9 +1,9 @@
<?php return array(
'root' => array(
'name' => 'codeinwp/wp-menu-icons',
'pretty_version' => 'v0.13.7',
'version' => '0.13.7.0',
'reference' => 'd7c7cb963c564590d2c233714b80e6b0547bd5bd',
'pretty_version' => 'v0.13.8',
'version' => '0.13.8.0',
'reference' => '3d0f5fe65015775d09b4cd6d7db74aa0367430da',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -38,18 +38,18 @@
'dev_requirement' => false,
),
'codeinwp/themeisle-sdk' => array(
'pretty_version' => '3.3.2',
'version' => '3.3.2.0',
'reference' => 'b799403bec877749ee0a2916dc859366d62bd76c',
'pretty_version' => '3.3.11',
'version' => '3.3.11.0',
'reference' => '583c474d8b5a8d12592f4a78ab8fa335aaf42fc0',
'type' => 'library',
'install_path' => __DIR__ . '/../codeinwp/themeisle-sdk',
'aliases' => array(),
'dev_requirement' => false,
),
'codeinwp/wp-menu-icons' => array(
'pretty_version' => 'v0.13.7',
'version' => '0.13.7.0',
'reference' => 'd7c7cb963c564590d2c233714b80e6b0547bd5bd',
'pretty_version' => 'v0.13.8',
'version' => '0.13.8.0',
'reference' => '3d0f5fe65015775d09b4cd6d7db74aa0367430da',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),