Version Description
Released on Sep 20, 2018
- Fix: Compatibility issue with WPML and RTL languages.
Download this release
Release Info
Developer | yithemes |
Plugin | YITH WooCommerce Compare |
Version | 2.3.3 |
Comparing to | |
See all releases |
Code changes from version 2.3.2 to 2.3.3
- README.txt +7 -9
- assets/images/12-bg.png +0 -0
- assets/images/12-icon.png +0 -0
- assets/images/12.png +0 -0
- includes/class.yith-woocompare-frontend.php +23 -5
- includes/class.yith-woocompare-helper.php +0 -9
- init.php +4 -4
- plugin-fw/init.php +2 -2
- plugin-fw/lib/yit-plugin-panel-wc.php +9 -7
- plugin-fw/lib/yit-plugin-panel.php +16 -14
- plugin-fw/lib/yit-plugin-subpanel.php +4 -4
- plugin-fw/licence/assets/js/yit-licence.js +145 -141
- plugin-fw/licence/assets/js/yit-licence.min.js +10 -7
- plugin-fw/licence/lib/yit-licence.php +15 -8
- plugin-fw/licence/lib/yit-plugin-licence.php +1 -1
- plugin-fw/licence/templates/panel/activation/activation-panel.php +148 -144
- templates/admin/premium.php +33 -8
README.txt
CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
|
|
4 |
Tags: woocommerce compare, compare products, product compare, product comparison, compare table
|
5 |
Requires at least: 3.5.1
|
6 |
Tested up to: 4.9
|
7 |
-
Stable tag: 2.3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -66,6 +66,10 @@ yith-woocommerce-compare-<WORDPRESS LOCALE >.mo
|
|
66 |
|
67 |
== Changelog ==
|
68 |
|
|
|
|
|
|
|
|
|
69 |
= 2.3.2 = Released on Sep 10, 2018
|
70 |
|
71 |
* New: Support to WooCommerce 3.4.5.
|
@@ -292,12 +296,6 @@ Full documentation is available [here](http://yithemes.com/docs-plugins/yith-woo
|
|
292 |
|
293 |
== Upgrade notice ==
|
294 |
|
295 |
-
= 2.3.
|
296 |
|
297 |
-
*
|
298 |
-
* New: Support to WordPress 4.9.8.
|
299 |
-
* Update: Plugin Core.
|
300 |
-
* Update: All external scripts to latest available version.
|
301 |
-
* Update: Compare table template (compare.php) to version 2.3.2.
|
302 |
-
* Update: Compare table style.
|
303 |
-
* Fix: Check product status before add it to compare list.
|
4 |
Tags: woocommerce compare, compare products, product compare, product comparison, compare table
|
5 |
Requires at least: 3.5.1
|
6 |
Tested up to: 4.9
|
7 |
+
Stable tag: 2.3.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
66 |
|
67 |
== Changelog ==
|
68 |
|
69 |
+
= 2.3.3 = Released on Sep 20, 2018
|
70 |
+
|
71 |
+
* Fix: Compatibility issue with WPML and RTL languages.
|
72 |
+
|
73 |
= 2.3.2 = Released on Sep 10, 2018
|
74 |
|
75 |
* New: Support to WooCommerce 3.4.5.
|
296 |
|
297 |
== Upgrade notice ==
|
298 |
|
299 |
+
= 2.3.3 = Released on Sep 20, 2018
|
300 |
|
301 |
+
* Fix: Compatibility issue with WPML and RTL languages.
|
|
|
|
|
|
|
|
|
|
|
|
assets/images/12-bg.png
ADDED
Binary file
|
assets/images/12-icon.png
ADDED
Binary file
|
assets/images/12.png
ADDED
Binary file
|
includes/class.yith-woocompare-frontend.php
CHANGED
@@ -104,14 +104,10 @@ if( !class_exists( 'YITH_Woocompare_Frontend' ) ) {
|
|
104 |
*/
|
105 |
public function __construct() {
|
106 |
|
107 |
-
// set coookiename
|
108 |
-
if ( is_multisite() ) $this->cookie_name .= '_' . get_current_blog_id();
|
109 |
|
|
|
110 |
add_action( 'init', array( $this, 'populate_products_list' ), 10 );
|
111 |
|
112 |
-
// populate default fields for the comparison table
|
113 |
-
$this->default_fields = YITH_Woocompare_Helper::standard_fields();
|
114 |
-
|
115 |
// Add link or button in the products list or
|
116 |
if ( get_option('yith_woocompare_compare_button_in_product_page') == 'yes' ) add_action( 'woocommerce_single_product_summary', array( $this, 'add_compare_link' ), 35 );
|
117 |
if ( get_option('yith_woocompare_compare_button_in_products_list') == 'yes' ) add_action( 'woocommerce_after_shop_loop_item', array( $this, 'add_compare_link' ), 20 );
|
@@ -142,6 +138,28 @@ if( !class_exists( 'YITH_Woocompare_Frontend' ) ) {
|
|
142 |
return $this;
|
143 |
}
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
/**
|
146 |
* Populate the compare product list
|
147 |
*/
|
104 |
*/
|
105 |
public function __construct() {
|
106 |
|
|
|
|
|
107 |
|
108 |
+
add_action( 'init', array( $this, 'init_variables' ), 1 );
|
109 |
add_action( 'init', array( $this, 'populate_products_list' ), 10 );
|
110 |
|
|
|
|
|
|
|
111 |
// Add link or button in the products list or
|
112 |
if ( get_option('yith_woocompare_compare_button_in_product_page') == 'yes' ) add_action( 'woocommerce_single_product_summary', array( $this, 'add_compare_link' ), 35 );
|
113 |
if ( get_option('yith_woocompare_compare_button_in_products_list') == 'yes' ) add_action( 'woocommerce_after_shop_loop_item', array( $this, 'add_compare_link' ), 20 );
|
138 |
return $this;
|
139 |
}
|
140 |
|
141 |
+
/**
|
142 |
+
* Init class variables
|
143 |
+
*
|
144 |
+
* @since 2.3.4
|
145 |
+
* @author Francesco Licandro
|
146 |
+
*/
|
147 |
+
public function init_variables(){
|
148 |
+
global $sitepress;
|
149 |
+
|
150 |
+
$lang = isset( $_REQUEST['lang'] ) ? $_REQUEST['lang'] : false;
|
151 |
+
|
152 |
+
if( defined( 'ICL_LANGUAGE_CODE' ) && $lang && isset( $sitepress ) ) {
|
153 |
+
$sitepress->switch_lang( $lang, true );
|
154 |
+
}
|
155 |
+
|
156 |
+
// set coookiename
|
157 |
+
if ( is_multisite() ) $this->cookie_name .= '_' . get_current_blog_id();
|
158 |
+
|
159 |
+
// populate default fields for the comparison table
|
160 |
+
$this->default_fields = YITH_Woocompare_Helper::standard_fields();
|
161 |
+
}
|
162 |
+
|
163 |
/**
|
164 |
* Populate the compare product list
|
165 |
*/
|
includes/class.yith-woocompare-helper.php
CHANGED
@@ -42,15 +42,6 @@ if( !class_exists( 'YITH_Woocompare_Helper' ) ) {
|
|
42 |
*/
|
43 |
public static function standard_fields( $with_attr = true ) {
|
44 |
|
45 |
-
global $sitepress;
|
46 |
-
|
47 |
-
$lang = isset( $_REQUEST['lang'] ) ? $_REQUEST['lang'] : false;
|
48 |
-
|
49 |
-
if( defined( 'ICL_LANGUAGE_CODE' ) && $lang && isset( $sitepress ) ) {
|
50 |
-
$sitepress->switch_lang( $lang, true );
|
51 |
-
}
|
52 |
-
|
53 |
-
|
54 |
$fields = array(
|
55 |
'image' => __( 'Image', 'yith-woocommerce-compare' ),
|
56 |
'title' => __( 'Title', 'yith-woocommerce-compare' ),
|
42 |
*/
|
43 |
public static function standard_fields( $with_attr = true ) {
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
$fields = array(
|
46 |
'image' => __( 'Image', 'yith-woocommerce-compare' ),
|
47 |
'title' => __( 'Title', 'yith-woocommerce-compare' ),
|
init.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
/**
|
3 |
* Plugin Name: YITH WooCommerce Compare
|
4 |
* Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-compare/
|
5 |
-
* Description: The <code><strong>YITH WooCommerce Compare</strong></code> plugin
|
6 |
-
* Version: 2.3.
|
7 |
* Author: YITHEMES
|
8 |
* Author URI: https://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-compare
|
@@ -13,7 +13,7 @@
|
|
13 |
*
|
14 |
* @author Yithemes
|
15 |
* @package YITH WooCommerce Compare
|
16 |
-
* @version 2.3.
|
17 |
*/
|
18 |
/* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
|
19 |
|
@@ -58,7 +58,7 @@ if ( ! function_exists( 'yith_plugin_registration_hook' ) ) {
|
|
58 |
register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
|
59 |
|
60 |
if ( ! defined( 'YITH_WOOCOMPARE_VERSION' ) ){
|
61 |
-
define( 'YITH_WOOCOMPARE_VERSION', '2.3.
|
62 |
}
|
63 |
if ( ! defined( 'YITH_WOOCOMPARE_FREE_INIT' ) ) {
|
64 |
define( 'YITH_WOOCOMPARE_FREE_INIT', plugin_basename( __FILE__ ) );
|
2 |
/**
|
3 |
* Plugin Name: YITH WooCommerce Compare
|
4 |
* Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-compare/
|
5 |
+
* Description: The <code><strong>YITH WooCommerce Compare</strong></code> plugin allows you to compare in a simple and efficient way products on sale in your shop and compare their main features in a single table. <a href="https://yithemes.com/" target="_blank">Find new awesome plugins on <strong>YITH</strong></a>.
|
6 |
+
* Version: 2.3.3
|
7 |
* Author: YITHEMES
|
8 |
* Author URI: https://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-compare
|
13 |
*
|
14 |
* @author Yithemes
|
15 |
* @package YITH WooCommerce Compare
|
16 |
+
* @version 2.3.3
|
17 |
*/
|
18 |
/* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
|
19 |
|
58 |
register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
|
59 |
|
60 |
if ( ! defined( 'YITH_WOOCOMPARE_VERSION' ) ){
|
61 |
+
define( 'YITH_WOOCOMPARE_VERSION', '2.3.3' );
|
62 |
}
|
63 |
if ( ! defined( 'YITH_WOOCOMPARE_FREE_INIT' ) ) {
|
64 |
define( 'YITH_WOOCOMPARE_FREE_INIT', plugin_basename( __FILE__ ) );
|
plugin-fw/init.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Framework Name: YIT Plugin Framework
|
4 |
-
* Version: 3.0.
|
5 |
* Author: YITHEMES
|
6 |
* Text Domain: yith-plugin-fw
|
7 |
* Domain Path: /languages/
|
8 |
*
|
9 |
* @author Your Inspiration Themes
|
10 |
-
* @version 3.0.
|
11 |
*/
|
12 |
/**
|
13 |
* This file belongs to the YIT Plugin Framework.
|
1 |
<?php
|
2 |
/**
|
3 |
* Framework Name: YIT Plugin Framework
|
4 |
+
* Version: 3.0.22
|
5 |
* Author: YITHEMES
|
6 |
* Text Domain: yith-plugin-fw
|
7 |
* Domain Path: /languages/
|
8 |
*
|
9 |
* @author Your Inspiration Themes
|
10 |
+
* @version 3.0.22
|
11 |
*/
|
12 |
/**
|
13 |
* This file belongs to the YIT Plugin Framework.
|
plugin-fw/lib/yit-plugin-panel-wc.php
CHANGED
@@ -59,9 +59,11 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
59 |
* @author Antonio La Rocca <antonio.larocca@yithemes.com>
|
60 |
*/
|
61 |
public function __construct( $args = array() ) {
|
62 |
-
|
63 |
$args = apply_filters( 'yit_plugin_fw_wc_panel_option_args', $args );
|
64 |
if ( !empty( $args ) ) {
|
|
|
|
|
|
|
65 |
$this->settings = $args;
|
66 |
$this->_tabs_path_files = $this->get_tabs_path_files();
|
67 |
|
@@ -176,7 +178,7 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
176 |
* @param $screen_ids
|
177 |
*
|
178 |
* @return mixed
|
179 |
-
* @since
|
180 |
* @author Antonino Scarfì <antonino.scarfi@yithemes.com>
|
181 |
*/
|
182 |
public function add_allowed_screen_id( $screen_ids ) {
|
@@ -323,7 +325,7 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
323 |
do_action( 'yit_panel_wc_after_update' );
|
324 |
|
325 |
} elseif ( isset( $_REQUEST[ 'yit-action' ] ) && $_REQUEST[ 'yit-action' ] == 'wc-options-reset'
|
326 |
-
|
327 |
) {
|
328 |
|
329 |
do_action( 'yit_panel_wc_before_reset' );
|
@@ -404,7 +406,7 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
404 |
*
|
405 |
* @access public
|
406 |
* @return void
|
407 |
-
* @since
|
408 |
*/
|
409 |
public function set_default_options() {
|
410 |
// check if the default options for this panel are already set
|
@@ -450,7 +452,7 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
450 |
* Add the woocommerce body class in plugin panel page
|
451 |
*
|
452 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
453 |
-
* @since
|
454 |
*
|
455 |
* @param $classes The body classes
|
456 |
*
|
@@ -474,7 +476,7 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
474 |
*
|
475 |
* @return mixed Filtered return value
|
476 |
* @author Antonio La Rocca <antonio.larocca@yithemes.com>
|
477 |
-
* @since
|
478 |
*/
|
479 |
public function maybe_unserialize_panel_data( $value, $option, $raw_value ) {
|
480 |
|
@@ -506,7 +508,7 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
506 |
*
|
507 |
* @return mixed Filtered return value
|
508 |
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
509 |
-
* @since
|
510 |
*/
|
511 |
public static function sanitize_option( $value, $option, $raw_value ) {
|
512 |
if ( isset( $option[ 'type' ] ) && 'yith-field' === $option[ 'type' ] ) {
|
59 |
* @author Antonio La Rocca <antonio.larocca@yithemes.com>
|
60 |
*/
|
61 |
public function __construct( $args = array() ) {
|
|
|
62 |
$args = apply_filters( 'yit_plugin_fw_wc_panel_option_args', $args );
|
63 |
if ( !empty( $args ) ) {
|
64 |
+
if ( isset( $args[ 'parent_page' ] ) && 'yit_plugin_panel' === $args[ 'parent_page' ] )
|
65 |
+
$args[ 'parent_page' ] = 'yith_plugin_panel';
|
66 |
+
|
67 |
$this->settings = $args;
|
68 |
$this->_tabs_path_files = $this->get_tabs_path_files();
|
69 |
|
178 |
* @param $screen_ids
|
179 |
*
|
180 |
* @return mixed
|
181 |
+
* @since 1.0.0
|
182 |
* @author Antonino Scarfì <antonino.scarfi@yithemes.com>
|
183 |
*/
|
184 |
public function add_allowed_screen_id( $screen_ids ) {
|
325 |
do_action( 'yit_panel_wc_after_update' );
|
326 |
|
327 |
} elseif ( isset( $_REQUEST[ 'yit-action' ] ) && $_REQUEST[ 'yit-action' ] == 'wc-options-reset'
|
328 |
+
&& isset( $_POST[ 'yith_wc_reset_options_nonce' ] ) && wp_verify_nonce( $_POST[ 'yith_wc_reset_options_nonce' ], 'yith_wc_reset_options_' . $this->settings[ 'page' ] )
|
329 |
) {
|
330 |
|
331 |
do_action( 'yit_panel_wc_before_reset' );
|
406 |
*
|
407 |
* @access public
|
408 |
* @return void
|
409 |
+
* @since 1.0.0
|
410 |
*/
|
411 |
public function set_default_options() {
|
412 |
// check if the default options for this panel are already set
|
452 |
* Add the woocommerce body class in plugin panel page
|
453 |
*
|
454 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
455 |
+
* @since 2.0
|
456 |
*
|
457 |
* @param $classes The body classes
|
458 |
*
|
476 |
*
|
477 |
* @return mixed Filtered return value
|
478 |
* @author Antonio La Rocca <antonio.larocca@yithemes.com>
|
479 |
+
* @since 2.0
|
480 |
*/
|
481 |
public function maybe_unserialize_panel_data( $value, $option, $raw_value ) {
|
482 |
|
508 |
*
|
509 |
* @return mixed Filtered return value
|
510 |
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
511 |
+
* @since 3.0.0
|
512 |
*/
|
513 |
public static function sanitize_option( $value, $option, $raw_value ) {
|
514 |
if ( isset( $option[ 'type' ] ) && 'yith-field' === $option[ 'type' ] ) {
|
plugin-fw/lib/yit-plugin-panel.php
CHANGED
@@ -18,7 +18,7 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
18 |
*
|
19 |
* Setting Page to Manage Plugins
|
20 |
*
|
21 |
-
* @class
|
22 |
* @package Yithemes
|
23 |
* @since 1.0
|
24 |
* @author Your Inspiration Themes
|
@@ -77,6 +77,8 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
77 |
);
|
78 |
|
79 |
$args = apply_filters( 'yit_plugin_fw_panel_option_args', wp_parse_args( $args, $default_args ) );
|
|
|
|
|
80 |
|
81 |
$this->settings = $args;
|
82 |
$this->_tabs_path_files = $this->get_tabs_path_files();
|
@@ -105,7 +107,7 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
105 |
/**
|
106 |
* Init actions once to prevent multiple actions
|
107 |
*
|
108 |
-
* @since
|
109 |
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
110 |
*/
|
111 |
protected static function _init_actions() {
|
@@ -126,7 +128,7 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
126 |
*
|
127 |
* @param $admin_body_classes
|
128 |
*
|
129 |
-
* @since
|
130 |
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
131 |
*
|
132 |
* @return string
|
@@ -149,13 +151,13 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
149 |
public function add_menu_page() {
|
150 |
global $admin_page_hooks;
|
151 |
|
152 |
-
if ( !isset( $admin_page_hooks[ '
|
153 |
$position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
|
154 |
$capability = apply_filters( 'yit_plugin_panel_menu_page_capability', 'manage_options' );
|
155 |
$show = apply_filters( 'yit_plugin_panel_menu_page_show', true );
|
156 |
|
157 |
// YITH Plugins text must not be translated
|
158 |
-
!!$show && add_menu_page( '
|
159 |
}
|
160 |
}
|
161 |
|
@@ -170,7 +172,7 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
170 |
*/
|
171 |
public function remove_duplicate_submenu_page() {
|
172 |
/* === Duplicate Items Hack === */
|
173 |
-
remove_submenu_page( '
|
174 |
}
|
175 |
|
176 |
/**
|
@@ -325,8 +327,8 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
325 |
public function add_premium_version_upgrade_to_menu() {
|
326 |
global $submenu;
|
327 |
|
328 |
-
if ( apply_filters( 'yit_show_upgrade_to_premium_version', isset( $submenu[ '
|
329 |
-
$submenu[ '
|
330 |
sprintf( '%s%s%s', '<span id="yith-how-to-premium">', __( 'How to install premium version', 'yith-plugin-fw' ), '</span>' ),
|
331 |
'install_plugins',
|
332 |
'//support.yithemes.com/hc/en-us/articles/217840988',
|
@@ -889,14 +891,14 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
889 |
*/
|
890 |
public static function sort_plugins() {
|
891 |
global $submenu;
|
892 |
-
if ( !empty( $submenu[ '
|
893 |
-
$sorted_plugins = $submenu[ '
|
894 |
|
895 |
usort( $sorted_plugins, function ( $a, $b ) {
|
896 |
return strcmp( current( $a ), current( $b ) );
|
897 |
} );
|
898 |
|
899 |
-
$submenu[ '
|
900 |
}
|
901 |
}
|
902 |
|
@@ -909,8 +911,8 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
909 |
public static function add_menu_class_in_yith_plugin( $menu ) {
|
910 |
global $submenu;
|
911 |
|
912 |
-
if ( !empty( $submenu[ '
|
913 |
-
$item_count = count( $submenu[ '
|
914 |
$columns = absint( $item_count / 20 ) + 1;
|
915 |
$columns = max( 1, min( $columns, 3 ) );
|
916 |
$columns = apply_filters( 'yith_plugin_fw_yith_plugins_menu_columns', $columns, $item_count );
|
@@ -918,7 +920,7 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
918 |
if ( $columns > 1 ) {
|
919 |
$class = "yith-plugin-fw-menu-$columns-columns";
|
920 |
foreach ( $menu as $order => $top ) {
|
921 |
-
if ( '
|
922 |
$c = $menu[ $order ][ 4 ];
|
923 |
$menu[ $order ][ 4 ] = add_cssclass( $class, $c );
|
924 |
break;
|
18 |
*
|
19 |
* Setting Page to Manage Plugins
|
20 |
*
|
21 |
+
* @class YIT_Plugin_Panel
|
22 |
* @package Yithemes
|
23 |
* @since 1.0
|
24 |
* @author Your Inspiration Themes
|
77 |
);
|
78 |
|
79 |
$args = apply_filters( 'yit_plugin_fw_panel_option_args', wp_parse_args( $args, $default_args ) );
|
80 |
+
if ( isset( $args[ 'parent_page' ] ) && 'yit_plugin_panel' === $args[ 'parent_page' ] )
|
81 |
+
$args[ 'parent_page' ] = 'yith_plugin_panel';
|
82 |
|
83 |
$this->settings = $args;
|
84 |
$this->_tabs_path_files = $this->get_tabs_path_files();
|
107 |
/**
|
108 |
* Init actions once to prevent multiple actions
|
109 |
*
|
110 |
+
* @since 3.0.0
|
111 |
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
112 |
*/
|
113 |
protected static function _init_actions() {
|
128 |
*
|
129 |
* @param $admin_body_classes
|
130 |
*
|
131 |
+
* @since 3.0.0
|
132 |
* @author Leanza Francesco <leanzafrancesco@gmail.com>
|
133 |
*
|
134 |
* @return string
|
151 |
public function add_menu_page() {
|
152 |
global $admin_page_hooks;
|
153 |
|
154 |
+
if ( !isset( $admin_page_hooks[ 'yith_plugin_panel' ] ) ) {
|
155 |
$position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
|
156 |
$capability = apply_filters( 'yit_plugin_panel_menu_page_capability', 'manage_options' );
|
157 |
$show = apply_filters( 'yit_plugin_panel_menu_page_show', true );
|
158 |
|
159 |
// YITH Plugins text must not be translated
|
160 |
+
!!$show && add_menu_page( 'yith_plugin_panel', 'YITH Plugins', $capability, 'yith_plugin_panel', null, YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png', $position );
|
161 |
}
|
162 |
}
|
163 |
|
172 |
*/
|
173 |
public function remove_duplicate_submenu_page() {
|
174 |
/* === Duplicate Items Hack === */
|
175 |
+
remove_submenu_page( 'yith_plugin_panel', 'yith_plugin_panel' );
|
176 |
}
|
177 |
|
178 |
/**
|
327 |
public function add_premium_version_upgrade_to_menu() {
|
328 |
global $submenu;
|
329 |
|
330 |
+
if ( apply_filters( 'yit_show_upgrade_to_premium_version', isset( $submenu[ 'yith_plugin_panel' ] ) && !isset( $submenu[ 'yith_plugin_panel' ][ 'how_to' ] ) ) ) {
|
331 |
+
$submenu[ 'yith_plugin_panel' ][ 'how_to' ] = array(
|
332 |
sprintf( '%s%s%s', '<span id="yith-how-to-premium">', __( 'How to install premium version', 'yith-plugin-fw' ), '</span>' ),
|
333 |
'install_plugins',
|
334 |
'//support.yithemes.com/hc/en-us/articles/217840988',
|
891 |
*/
|
892 |
public static function sort_plugins() {
|
893 |
global $submenu;
|
894 |
+
if ( !empty( $submenu[ 'yith_plugin_panel' ] ) ) {
|
895 |
+
$sorted_plugins = $submenu[ 'yith_plugin_panel' ];
|
896 |
|
897 |
usort( $sorted_plugins, function ( $a, $b ) {
|
898 |
return strcmp( current( $a ), current( $b ) );
|
899 |
} );
|
900 |
|
901 |
+
$submenu[ 'yith_plugin_panel' ] = $sorted_plugins;
|
902 |
}
|
903 |
}
|
904 |
|
911 |
public static function add_menu_class_in_yith_plugin( $menu ) {
|
912 |
global $submenu;
|
913 |
|
914 |
+
if ( !empty( $submenu[ 'yith_plugin_panel' ] ) ) {
|
915 |
+
$item_count = count( $submenu[ 'yith_plugin_panel' ] );
|
916 |
$columns = absint( $item_count / 20 ) + 1;
|
917 |
$columns = max( 1, min( $columns, 3 ) );
|
918 |
$columns = apply_filters( 'yith_plugin_fw_yith_plugins_menu_columns', $columns, $item_count );
|
920 |
if ( $columns > 1 ) {
|
921 |
$class = "yith-plugin-fw-menu-$columns-columns";
|
922 |
foreach ( $menu as $order => $top ) {
|
923 |
+
if ( 'yith_plugin_panel' === $top[ 2 ] ) {
|
924 |
$c = $menu[ $order ][ 4 ];
|
925 |
$menu[ $order ][ 4 ] = add_cssclass( $class, $c );
|
926 |
break;
|
plugin-fw/lib/yit-plugin-subpanel.php
CHANGED
@@ -96,13 +96,13 @@ if ( !class_exists( 'YIT_Plugin_SubPanel' ) ) {
|
|
96 |
$logo = $admin_logo;
|
97 |
}
|
98 |
|
99 |
-
if ( !isset( $admin_page_hooks[ '
|
100 |
$position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
|
101 |
-
add_menu_page( '
|
102 |
}
|
103 |
|
104 |
-
add_submenu_page( '
|
105 |
-
remove_submenu_page( '
|
106 |
|
107 |
}
|
108 |
|
96 |
$logo = $admin_logo;
|
97 |
}
|
98 |
|
99 |
+
if ( !isset( $admin_page_hooks[ 'yith_plugin_panel' ] ) ) {
|
100 |
$position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
|
101 |
+
add_menu_page( 'yith_plugin_panel', 'YITH Plugins', 'nosuchcapability', 'yith_plugin_panel', null, $logo, $position );
|
102 |
}
|
103 |
|
104 |
+
add_submenu_page( 'yith_plugin_panel', $this->settings[ 'label' ], $this->settings[ 'label' ], 'manage_options', $this->settings[ 'page' ], array( $this, 'yit_panel' ) );
|
105 |
+
remove_submenu_page( 'yith_plugin_panel', 'yith_plugin_panel' );
|
106 |
|
107 |
}
|
108 |
|
plugin-fw/licence/assets/js/yit-licence.js
CHANGED
@@ -8,189 +8,193 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
(function ($) {
|
12 |
|
13 |
/* === Licence API === */
|
14 |
|
15 |
-
var licence_activation = function (button) {
|
16 |
-
button.on('click', function (e, button) {
|
17 |
e.preventDefault();
|
18 |
|
19 |
-
var t
|
20 |
-
form_id
|
21 |
-
form
|
22 |
-
data
|
23 |
-
message
|
24 |
-
message_wrapper
|
25 |
-
email
|
26 |
-
licence_key
|
27 |
-
email_val
|
28 |
-
licence_key_val
|
29 |
-
error
|
30 |
-
error_fields
|
31 |
-
product_row
|
32 |
-
licence_activation
|
33 |
-
spinner
|
34 |
|
35 |
/* Init Input Fields */
|
36 |
message.empty();
|
37 |
-
message_wrapper.removeClass('visible')
|
38 |
-
email.removeClass('require');
|
39 |
-
licence_key.removeClass('require');
|
40 |
-
product_row.removeClass('error');
|
41 |
-
spinner.addClass('show');
|
42 |
-
t.add(licence_activation).prop("disabled", true).addClass('clicked');
|
43 |
-
|
44 |
-
if (''
|
45 |
error = true;
|
46 |
error_fields[ error_fields.length ] = licence_message.email;
|
47 |
-
email.addClass('require');
|
48 |
}
|
49 |
|
50 |
-
if (''
|
51 |
error = true;
|
52 |
error_fields[ error_fields.length ] = licence_message.license_key;
|
53 |
-
licence_key.addClass('require');
|
54 |
}
|
55 |
|
56 |
-
if (false
|
57 |
-
jQuery.ajax({
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
|
|
80 |
} else {
|
81 |
-
if (error_fields.length == 1) {
|
82 |
-
message.text(licence_message.error.replace('%field%', error_fields[0]));
|
83 |
-
message_wrapper.addClass('visible');
|
84 |
-
product_row.addClass('error');
|
85 |
} else {
|
86 |
var message_text = licence_message.errors;
|
87 |
-
for (var i = 0; i < error_fields.length; i++) {
|
88 |
-
message_text = message_text.replace('%field_' + ( i + 1) + '%', error_fields[i]);
|
89 |
-
message_wrapper.addClass('visible');
|
90 |
}
|
91 |
-
message.text(message_text);
|
92 |
-
message_wrapper.addClass('visible');
|
93 |
-
product_row.addClass('error');
|
94 |
}
|
95 |
|
96 |
-
spinner.removeClass('show');
|
97 |
-
t.add(licence_activation).prop("disabled", false).removeClass('clicked');
|
98 |
}
|
99 |
-
});
|
100 |
};
|
101 |
|
102 |
-
var licence_update = function (button) {
|
103 |
-
button.on('click', function (e) {
|
104 |
e.preventDefault();
|
105 |
|
106 |
-
var t
|
107 |
-
form = $('#licence-check-update'),
|
108 |
data = form.serialize();
|
109 |
|
110 |
-
t.prop("disabled", true).addClass('clicked');
|
111 |
-
form.find('div.spinner').addClass('show');
|
112 |
-
|
113 |
-
jQuery.ajax({
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
});
|
123 |
};
|
124 |
|
125 |
-
var licence_deactivate = function (button) {
|
126 |
-
button.on('click', function (e) {
|
127 |
e.preventDefault();
|
128 |
|
129 |
var check = script_info.is_debug == true ? true : confirm( licence_message.are_you_sure );
|
130 |
|
131 |
-
if( check == true ){
|
132 |
-
var t
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
t.add(renew).add(deactive).prop("disabled", true).addClass('clicked');
|
143 |
-
$('#activated-products').find('.spinner').addClass('show');
|
144 |
-
|
145 |
-
jQuery.ajax({
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
}
|
177 |
-
});
|
178 |
};
|
179 |
|
180 |
var licence_api = function () {
|
181 |
-
var button
|
182 |
-
check
|
183 |
-
deactivated
|
184 |
|
185 |
-
licence_activation(button);
|
186 |
-
licence_update(check);
|
187 |
-
licence_deactivate(deactivated);
|
188 |
};
|
189 |
|
190 |
licence_api();
|
191 |
|
192 |
-
$('body').on('click', '.yit-changelog-button', function (e) {
|
193 |
-
$('#TB_window').remove();
|
194 |
-
});
|
195 |
|
196 |
-
})(jQuery);
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
( function ( $ ) {
|
12 |
|
13 |
/* === Licence API === */
|
14 |
|
15 |
+
var licence_activation = function ( button ) {
|
16 |
+
button.on( 'click', function ( e, button ) {
|
17 |
e.preventDefault();
|
18 |
|
19 |
+
var t = $( this ),
|
20 |
+
form_id = t.data( 'formid' ),
|
21 |
+
form = $( '#' + form_id ),
|
22 |
+
data = form.serialize(),
|
23 |
+
message = $( form ).find( '.message' ),
|
24 |
+
message_wrapper = $( form ).find( '.message-wrapper' ),
|
25 |
+
email = form.find( '.user-email' ),
|
26 |
+
licence_key = form.find( '.licence-key' ),
|
27 |
+
email_val = form.find( '.user-email' ).val(),
|
28 |
+
licence_key_val = form.find( '.licence-key' ).val(),
|
29 |
+
error = false,
|
30 |
+
error_fields = new Array(),
|
31 |
+
product_row = form.find( '.product-row' ),
|
32 |
+
licence_activation = $( '.licence-activation' ),
|
33 |
+
spinner = $( '#products-to-active' ).find( '.spinner' );
|
34 |
|
35 |
/* Init Input Fields */
|
36 |
message.empty();
|
37 |
+
message_wrapper.removeClass( 'visible' );
|
38 |
+
email.removeClass( 'require' );
|
39 |
+
licence_key.removeClass( 'require' );
|
40 |
+
product_row.removeClass( 'error' );
|
41 |
+
spinner.addClass( 'show' );
|
42 |
+
t.add( licence_activation ).prop( "disabled", true ).addClass( 'clicked' );
|
43 |
+
|
44 |
+
if ( '' === email_val ) {
|
45 |
error = true;
|
46 |
error_fields[ error_fields.length ] = licence_message.email;
|
47 |
+
email.addClass( 'require' );
|
48 |
}
|
49 |
|
50 |
+
if ( '' === licence_key_val ) {
|
51 |
error = true;
|
52 |
error_fields[ error_fields.length ] = licence_message.license_key;
|
53 |
+
licence_key.addClass( 'require' );
|
54 |
}
|
55 |
|
56 |
+
if ( false === error ) {
|
57 |
+
jQuery.ajax( {
|
58 |
+
type : 'POST',
|
59 |
+
url : ajaxurl,
|
60 |
+
data : data,
|
61 |
+
success: function ( response ) {
|
62 |
+
|
63 |
+
spinner.removeClass( 'show' );
|
64 |
+
t.add( licence_activation ).prop( "disabled", false ).removeClass( 'clicked' );
|
65 |
+
|
66 |
+
if ( true === response.activated ) {
|
67 |
+
$( '.product-licence-activation' ).empty().replaceWith( response.template );
|
68 |
+
licence_api();
|
69 |
+
} else if ( false !== response && typeof response.error !== 'undefined' ) {
|
70 |
+
message.text( response.error );
|
71 |
+
message_wrapper.addClass( 'visible' );
|
72 |
+
product_row.addClass( 'error' );
|
73 |
+
} else {
|
74 |
+
message.text( licence_message.server );
|
75 |
+
message_wrapper.addClass( 'visible' );
|
76 |
+
product_row.addClass( 'error' );
|
77 |
+
}
|
78 |
+
|
79 |
+
if ( typeof response.debug !== 'undefined' ) {
|
80 |
+
console.log( response.debug );
|
81 |
+
}
|
82 |
+
}
|
83 |
+
} );
|
84 |
} else {
|
85 |
+
if ( error_fields.length == 1 ) {
|
86 |
+
message.text( licence_message.error.replace( '%field%', error_fields[ 0 ] ) );
|
87 |
+
message_wrapper.addClass( 'visible' );
|
88 |
+
product_row.addClass( 'error' );
|
89 |
} else {
|
90 |
var message_text = licence_message.errors;
|
91 |
+
for ( var i = 0; i < error_fields.length; i++ ) {
|
92 |
+
message_text = message_text.replace( '%field_' + ( i + 1 ) + '%', error_fields[ i ] );
|
93 |
+
message_wrapper.addClass( 'visible' );
|
94 |
}
|
95 |
+
message.text( message_text );
|
96 |
+
message_wrapper.addClass( 'visible' );
|
97 |
+
product_row.addClass( 'error' );
|
98 |
}
|
99 |
|
100 |
+
spinner.removeClass( 'show' );
|
101 |
+
t.add( licence_activation ).prop( "disabled", false ).removeClass( 'clicked' );
|
102 |
}
|
103 |
+
} );
|
104 |
};
|
105 |
|
106 |
+
var licence_update = function ( button ) {
|
107 |
+
button.on( 'click', function ( e ) {
|
108 |
e.preventDefault();
|
109 |
|
110 |
+
var t = $( this ),
|
111 |
+
form = $( '#licence-check-update' ),
|
112 |
data = form.serialize();
|
113 |
|
114 |
+
t.prop( "disabled", true ).addClass( 'clicked' );
|
115 |
+
form.find( 'div.spinner' ).addClass( 'show' );
|
116 |
+
|
117 |
+
jQuery.ajax( {
|
118 |
+
type : 'POST',
|
119 |
+
url : ajaxurl,
|
120 |
+
data : data,
|
121 |
+
success: function ( response ) {
|
122 |
+
$( '.product-licence-activation' ).empty().replaceWith( response.template );
|
123 |
+
licence_api();
|
124 |
+
}
|
125 |
+
} );
|
126 |
+
} );
|
127 |
};
|
128 |
|
129 |
+
var licence_deactivate = function ( button ) {
|
130 |
+
button.on( 'click', function ( e ) {
|
131 |
e.preventDefault();
|
132 |
|
133 |
var check = script_info.is_debug == true ? true : confirm( licence_message.are_you_sure );
|
134 |
|
135 |
+
if ( check == true ) {
|
136 |
+
var t = $( this ),
|
137 |
+
licence_key = t.data( 'licence-key' ),
|
138 |
+
licence_email = t.data( 'licence-email' ),
|
139 |
+
product_init = t.data( 'product-init' ),
|
140 |
+
action = t.data( 'action' ),
|
141 |
+
renew = $( '.licence-renew' ),
|
142 |
+
deactive = $( '.licence-deactive' ),
|
143 |
+
message = $( '#yith-licence-notice' ),
|
144 |
+
activated_table = $( '.activated-table' );
|
145 |
+
|
146 |
+
t.add( renew ).add( deactive ).prop( "disabled", true ).addClass( 'clicked' );
|
147 |
+
$( '#activated-products' ).find( '.spinner' ).addClass( 'show' );
|
148 |
+
|
149 |
+
jQuery.ajax( {
|
150 |
+
type : 'POST',
|
151 |
+
url : ajaxurl,
|
152 |
+
data : {
|
153 |
+
action : action,
|
154 |
+
licence_key : licence_key,
|
155 |
+
email : licence_email,
|
156 |
+
product_init: product_init
|
157 |
+
},
|
158 |
+
success: function ( response ) {
|
159 |
+
message.css( 'maxWidth', activated_table.width() );
|
160 |
+
if ( false == response.activated && typeof response.error == 'undefined' ) {
|
161 |
+
$( '.product-licence-activation' ).empty().replaceWith( response.template );
|
162 |
+
licence_api();
|
163 |
+
}
|
164 |
+
|
165 |
+
if ( false == response.activated && typeof response.error != 'undefined' ) {
|
166 |
+
message.find( 'p.yith-licence-notice-message' ).html( response.error );
|
167 |
+
message.removeClass( 'notice-success' ).addClass( 'notice-error visible' );
|
168 |
+
t.add( renew ).add( deactive ).add( renew ).prop( "disabled", false ).removeClass( 'clicked' );
|
169 |
+
$( '#activated-products' ).find( '.spinner' ).removeClass( 'show' );
|
170 |
+
}
|
171 |
+
|
172 |
+
else if ( false == response ) {
|
173 |
+
message.find( 'p.yith-licence-notice-message' ).html( licence_message.server );
|
174 |
+
message.removeClass( 'notice-success' ).addClass( 'notice-error visible' );
|
175 |
+
t.add( renew ).add( deactive ).add( renew ).prop( "disabled", false ).removeClass( 'clicked' );
|
176 |
+
$( '#activated-products' ).find( '.spinner' ).removeClass( 'show' );
|
177 |
+
}
|
178 |
+
}
|
179 |
+
} );
|
180 |
}
|
181 |
+
} );
|
182 |
};
|
183 |
|
184 |
var licence_api = function () {
|
185 |
+
var button = $( '.licence-activation' ),
|
186 |
+
check = $( '.licence-check' ),
|
187 |
+
deactivated = $( '.licence-deactive' );
|
188 |
|
189 |
+
licence_activation( button );
|
190 |
+
licence_update( check );
|
191 |
+
licence_deactivate( deactivated );
|
192 |
};
|
193 |
|
194 |
licence_api();
|
195 |
|
196 |
+
$( 'body' ).on( 'click', '.yit-changelog-button', function ( e ) {
|
197 |
+
$( '#TB_window' ).remove();
|
198 |
+
} );
|
199 |
|
200 |
+
} )( jQuery );
|
plugin-fw/licence/assets/js/yit-licence.min.js
CHANGED
@@ -1,7 +1,10 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
1 |
+
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,d,b){a instanceof String&&(a=String(a));for(var e=a.length,f=0;f<e;f++){var k=a[f];if(d.call(b,k,f,a))return{i:f,v:k}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,d,b){a!=Array.prototype&&a!=Object.prototype&&(a[d]=b.value)};
|
2 |
+
$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,d,b,e){if(d){b=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var f=a[e];f in b||(b[f]={});b=b[f]}a=a[a.length-1];e=b[a];d=d(e);d!=e&&null!=d&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:d})}};
|
3 |
+
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6","es3");
|
4 |
+
(function(a){var d=function(b){b.on("click",function(g,c){g.preventDefault();var b=a(this);g=b.data("formid");c=a("#"+g);var d=c.serialize(),e=a(c).find(".message"),h=a(c).find(".message-wrapper"),k=c.find(".user-email"),l=c.find(".licence-key"),m=c.find(".user-email").val(),t=c.find(".licence-key").val(),n=!1;g=[];var p=c.find(".product-row"),q=a(".licence-activation"),r=a("#products-to-active").find(".spinner");e.empty();h.removeClass("visible");k.removeClass("require");l.removeClass("require");
|
5 |
+
p.removeClass("error");r.addClass("show");b.add(q).prop("disabled",!0).addClass("clicked");""===m&&(n=!0,g[g.length]=licence_message.email,k.addClass("require"));""===t&&(n=!0,g[g.length]=licence_message.license_key,l.addClass("require"));if(!1===n)jQuery.ajax({type:"POST",url:ajaxurl,data:d,success:function(c){r.removeClass("show");b.add(q).prop("disabled",!1).removeClass("clicked");!0===c.activated?(a(".product-licence-activation").empty().replaceWith(c.template),f()):(!1!==c&&"undefined"!==typeof c.error?
|
6 |
+
e.text(c.error):e.text(licence_message.server),h.addClass("visible"),p.addClass("error"));"undefined"!==typeof c.debug&&console.log(c.debug)}});else{if(1==g.length)e.text(licence_message.error.replace("%field%",g[0]));else{c=licence_message.errors;for(d=0;d<g.length;d++)c=c.replace("%field_"+(d+1)+"%",g[d]),h.addClass("visible");e.text(c)}h.addClass("visible");p.addClass("error");r.removeClass("show");b.add(q).prop("disabled",!1).removeClass("clicked")}})},b=function(b){b.on("click",function(b){b.preventDefault();
|
7 |
+
b=a(this);var c=a("#licence-check-update"),d=c.serialize();b.prop("disabled",!0).addClass("clicked");c.find("div.spinner").addClass("show");jQuery.ajax({type:"POST",url:ajaxurl,data:d,success:function(c){a(".product-licence-activation").empty().replaceWith(c.template);f()}})})},e=function(b){b.on("click",function(b){b.preventDefault();if(1==(1==script_info.is_debug?!0:confirm(licence_message.are_you_sure))){var c=a(this);b=c.data("licence-key");var d=c.data("licence-email"),e=c.data("product-init"),
|
8 |
+
g=c.data("action"),h=a(".licence-renew"),k=a(".licence-deactive"),l=a("#yith-licence-notice"),m=a(".activated-table");c.add(h).add(k).prop("disabled",!0).addClass("clicked");a("#activated-products").find(".spinner").addClass("show");jQuery.ajax({type:"POST",url:ajaxurl,data:{action:g,licence_key:b,email:d,product_init:e},success:function(b){l.css("maxWidth",m.width());0==b.activated&&"undefined"==typeof b.error&&(a(".product-licence-activation").empty().replaceWith(b.template),f());0==b.activated&&
|
9 |
+
"undefined"!=typeof b.error?(l.find("p.yith-licence-notice-message").html(b.error),l.removeClass("notice-success").addClass("notice-error visible"),c.add(h).add(k).add(h).prop("disabled",!1).removeClass("clicked"),a("#activated-products").find(".spinner").removeClass("show")):0==b&&(l.find("p.yith-licence-notice-message").html(licence_message.server),l.removeClass("notice-success").addClass("notice-error visible"),c.add(h).add(k).add(h).prop("disabled",!1).removeClass("clicked"),a("#activated-products").find(".spinner").removeClass("show"))}})}})},
|
10 |
+
f=function(){var f=a(".licence-activation"),g=a(".licence-check"),c=a(".licence-deactive");d(f);b(g);e(c)};f();a("body").on("click",".yit-changelog-button",function(b){a("#TB_window").remove()})})(jQuery);
|
plugin-fw/licence/lib/yit-licence.php
CHANGED
@@ -171,15 +171,14 @@ if ( !class_exists( 'YIT_Licence' ) ) {
|
|
171 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
172 |
*/
|
173 |
public function admin_enqueue_scripts() {
|
174 |
-
|
175 |
/**
|
176 |
* Support to YIT Framework < 2.0
|
177 |
*/
|
178 |
-
$filename = function_exists( 'yit_load_js_file' ) ? yit_load_js_file( 'yit-licence.js' ) : 'yit-licence.js';
|
179 |
$script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
|
180 |
$style_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
|
181 |
|
182 |
-
wp_register_script( 'yit-licence', $script_path . '/licence/assets/js/' . $
|
183 |
wp_register_style( 'yit-theme-licence', $style_path . '/licence/assets/css/yit-licence.css' );
|
184 |
|
185 |
/* Localize Scripts */
|
@@ -211,7 +210,7 @@ if ( !class_exists( 'YIT_Licence' ) ) {
|
|
211 |
* Send a request to API server to activate plugins
|
212 |
*
|
213 |
* @return void
|
214 |
-
* @use
|
215 |
*
|
216 |
* @since 1.0
|
217 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
@@ -265,6 +264,14 @@ if ( !class_exists( 'YIT_Licence' ) ) {
|
|
265 |
$body[ 'template' ] = $this->show_activation_panel( $this->get_response_code_message( 200 ) );
|
266 |
}
|
267 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
wp_send_json( $body );
|
269 |
}
|
270 |
|
@@ -274,7 +281,7 @@ if ( !class_exists( 'YIT_Licence' ) ) {
|
|
274 |
* Send a request to API server to activate plugins
|
275 |
*
|
276 |
* @return void
|
277 |
-
* @use
|
278 |
*
|
279 |
* @since 1.0
|
280 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
@@ -446,9 +453,9 @@ if ( !class_exists( 'YIT_Licence' ) ) {
|
|
446 |
* Check for licence update
|
447 |
*
|
448 |
* @return void
|
449 |
-
* @since
|
450 |
*
|
451 |
-
* @use
|
452 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
453 |
*/
|
454 |
public function check_all() {
|
@@ -463,7 +470,7 @@ if ( !class_exists( 'YIT_Licence' ) ) {
|
|
463 |
* Send a request to API server to check activate plugins and update the informations
|
464 |
*
|
465 |
* @return void
|
466 |
-
* @use
|
467 |
*
|
468 |
* @since 1.0
|
469 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
171 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
172 |
*/
|
173 |
public function admin_enqueue_scripts() {
|
174 |
+
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
175 |
/**
|
176 |
* Support to YIT Framework < 2.0
|
177 |
*/
|
|
|
178 |
$script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
|
179 |
$style_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
|
180 |
|
181 |
+
wp_register_script( 'yit-licence', $script_path . '/licence/assets/js/yit-licence' . $suffix . '.js', array( 'jquery' ), '1.0.0', true );
|
182 |
wp_register_style( 'yit-theme-licence', $style_path . '/licence/assets/css/yit-licence.css' );
|
183 |
|
184 |
/* Localize Scripts */
|
210 |
* Send a request to API server to activate plugins
|
211 |
*
|
212 |
* @return void
|
213 |
+
* @use wp_send_json
|
214 |
*
|
215 |
* @since 1.0
|
216 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
264 |
$body[ 'template' ] = $this->show_activation_panel( $this->get_response_code_message( 200 ) );
|
265 |
}
|
266 |
|
267 |
+
if ( !empty( $_REQUEST[ 'debug' ] ) ) {
|
268 |
+
$body = is_array( $body ) ? $body : array();
|
269 |
+
$body[ 'debug' ] = array( 'response' => $response );
|
270 |
+
if ( 'print_r' === $_REQUEST[ 'debug' ] ) {
|
271 |
+
$body[ 'debug' ] = print_r( $body[ 'debug' ], true );
|
272 |
+
}
|
273 |
+
}
|
274 |
+
|
275 |
wp_send_json( $body );
|
276 |
}
|
277 |
|
281 |
* Send a request to API server to activate plugins
|
282 |
*
|
283 |
* @return void
|
284 |
+
* @use wp_send_json
|
285 |
*
|
286 |
* @since 1.0
|
287 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
453 |
* Check for licence update
|
454 |
*
|
455 |
* @return void
|
456 |
+
* @since 2.5
|
457 |
*
|
458 |
+
* @use YIT_Theme_Licence->check()
|
459 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
460 |
*/
|
461 |
public function check_all() {
|
470 |
* Send a request to API server to check activate plugins and update the informations
|
471 |
*
|
472 |
* @return void
|
473 |
+
* @use YIT_Theme_Licence->check()
|
474 |
*
|
475 |
* @since 1.0
|
476 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
plugin-fw/licence/lib/yit-plugin-licence.php
CHANGED
@@ -63,7 +63,7 @@ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
|
|
63 |
}
|
64 |
|
65 |
$this->_settings = array(
|
66 |
-
'parent_page' => '
|
67 |
'page_title' => __( 'License Activation', 'yith-plugin-fw' ),
|
68 |
'menu_title' => __( 'License Activation', 'yith-plugin-fw' ),
|
69 |
'capability' => 'manage_options',
|
63 |
}
|
64 |
|
65 |
$this->_settings = array(
|
66 |
+
'parent_page' => 'yith_plugin_panel',
|
67 |
'page_title' => __( 'License Activation', 'yith-plugin-fw' ),
|
68 |
'menu_title' => __( 'License Activation', 'yith-plugin-fw' ),
|
69 |
'capability' => 'manage_options',
|
plugin-fw/licence/templates/panel/activation/activation-panel.php
CHANGED
@@ -8,15 +8,16 @@
|
|
8 |
* http://www.gnu.org/licenses/gpl-3.0.txt
|
9 |
*/
|
10 |
|
11 |
-
$to_active_products
|
12 |
-
$activated_products
|
13 |
-
$no_active_products
|
14 |
-
$expired_products
|
15 |
-
$banned_products
|
16 |
-
$notice
|
17 |
-
$notice_class
|
18 |
-
$to_activate_check
|
19 |
-
$num_members_products_activate
|
|
|
20 |
?>
|
21 |
|
22 |
<div class="yit-container product-licence-activation">
|
@@ -25,8 +26,8 @@ $num_members_products_activate = $this->get_number_of_membership_products();
|
|
25 |
<div class="licence-check-section">
|
26 |
<form method="post" id="licence-check-update" action="<?php echo admin_url( 'admin-ajax.php' ) ?>">
|
27 |
<span class="licence-label" style="display: block;"><?php _e( 'Have you updated your licenses? Have you asked for an extension? Update information concerning your products.', 'yith-plugin-fw' ); ?></span>
|
28 |
-
<input type="hidden" name="action" value="yith_update_licence_information-<?php echo $this->get_product_type(); ?>"
|
29 |
-
<input type="submit" name="submit" value="<?php _e( 'Update license information', 'yith-plugin-fw' ) ?>" class="button-licence licence-check"
|
30 |
<div class="spinner"></div>
|
31 |
</form>
|
32 |
</div>
|
@@ -37,32 +38,35 @@ $num_members_products_activate = $this->get_number_of_membership_products();
|
|
37 |
|
38 |
<!-- To Active Products -->
|
39 |
|
40 |
-
<?php if( !
|
41 |
<h3 id="products-to-active" class="to-active">
|
42 |
<?php echo _n( 'Product to activate', 'Products to activate', $to_activate_check, 'yith-plugin-fw' ) ?>
|
43 |
<span class="spinner"></span>
|
44 |
</h3>
|
45 |
<div class="to-active-wrapper">
|
46 |
-
<?php foreach( $to_active_products as $init => $info ) : ?>
|
47 |
-
<form class="to-active-form" method="post" id="<?php echo $info['product_id'] ?>" action="<?php echo admin_url( 'admin-ajax.php' ) ?>">
|
|
|
|
|
|
|
48 |
<table class="to-active-table">
|
49 |
<tbody>
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
</tbody>
|
67 |
</table>
|
68 |
<div class="message-wrapper">
|
@@ -75,164 +79,164 @@ $num_members_products_activate = $this->get_number_of_membership_products();
|
|
75 |
|
76 |
<!-- Activated Products -->
|
77 |
|
78 |
-
<?php if( !
|
79 |
<h3 id="activated-products">
|
80 |
<?php _e( 'Activated', 'yith-plugin-fw' ) ?>
|
81 |
<span class="spinner"></span>
|
82 |
</h3>
|
83 |
<table class="activated-table">
|
84 |
<thead>
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
<?php endif; ?>
|
|
|
91 |
|
92 |
-
|
93 |
-
|
94 |
-
<?php if( $this->show_extra_info ) : ?>
|
95 |
-
<th><?php _e( 'Remaining', 'yith-plugin-fw' ) ?></th>
|
96 |
-
<?php if( $num_members_products_activate ) : ?>
|
97 |
-
<th><?php _e( 'Club Subscription', 'yith-plugin-fw' ) ?></th>
|
98 |
-
<?php endif; ?>
|
99 |
-
<?php endif; ?>
|
100 |
-
|
101 |
-
<th><?php _e( 'License Actions', 'yith-plugin-fw' ) ?></th>
|
102 |
-
</tr>
|
103 |
</thead>
|
104 |
<tbody>
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
|
|
|
|
|
|
|
|
|
|
109 |
</td>
|
|
|
|
|
|
|
|
|
110 |
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
</td>
|
115 |
-
<td class="product-licence-key">
|
116 |
-
<?php echo $info['licence']['licence_key'] ?>
|
117 |
-
</td>
|
118 |
-
<?php endif; ?>
|
119 |
|
120 |
-
|
121 |
-
|
|
|
122 |
</td>
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
<?php printf( __( '%1s out of %2s', 'yith-plugin-fw' ), $info['licence']['activation_remaining'], $info['licence']['activation_limit'] ); ?>
|
127 |
</td>
|
128 |
-
<?php if( $num_members_products_activate ) : ?>
|
129 |
-
<td class="product-licence-membership">
|
130 |
-
<span class="dashicons dashicons-<?php echo $info['licence']['is_membership'] ? 'yes' : 'no-alt' ?>"></span>
|
131 |
-
</td>
|
132 |
-
<?php endif; ?>
|
133 |
<?php endif; ?>
|
|
|
134 |
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
|
|
|
|
|
|
|
|
|
|
143 |
</a>
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
</a>
|
149 |
-
<?php endif; ?>
|
150 |
-
</td>
|
151 |
-
</tr>
|
152 |
-
<?php endforeach; ?>
|
153 |
</tbody>
|
154 |
</table>
|
155 |
-
<?php endif
|
156 |
|
157 |
-
|
158 |
|
159 |
-
<?php if( !
|
160 |
<h3><?php _e( 'Banned', 'yith-plugin-fw' ) ?></h3>
|
161 |
<table class="expired-table">
|
162 |
<thead>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
<tr>
|
164 |
-
<
|
165 |
-
|
166 |
-
|
167 |
-
|
|
|
|
|
168 |
<?php endif; ?>
|
169 |
</tr>
|
170 |
-
|
171 |
-
<tbody>
|
172 |
-
<?php foreach( $banned_products as $init => $info ) : ?>
|
173 |
-
<tr>
|
174 |
-
<td class="product-name">
|
175 |
-
<?php echo $this->display_product_name( $info['Name'] ) ?>
|
176 |
-
</td>
|
177 |
-
<?php if( $this->show_extra_info ) : ?>
|
178 |
-
<td class="product-licence-email"><?php echo $info['licence']['email'] ?></td>
|
179 |
-
<td class="product-licence-key"><?php echo $info['licence']['licence_key'] ?></td>
|
180 |
-
<?php endif; ?>
|
181 |
-
</tr>
|
182 |
-
<?php endforeach; ?>
|
183 |
</tbody>
|
184 |
</table>
|
185 |
-
<?php endif
|
186 |
|
187 |
<!-- Expired Products -->
|
188 |
|
189 |
-
<?php if( !
|
190 |
<h3><?php _e( 'Expired', 'yith-plugin-fw' ) ?></h3>
|
191 |
<table class="expired-table">
|
192 |
<thead>
|
193 |
-
|
194 |
-
|
195 |
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
|
201 |
-
|
202 |
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
</thead>
|
208 |
<tbody>
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
|
220 |
-
|
221 |
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
</tbody>
|
236 |
</table>
|
237 |
-
<?php endif
|
238 |
</div>
|
8 |
* http://www.gnu.org/licenses/gpl-3.0.txt
|
9 |
*/
|
10 |
|
11 |
+
$to_active_products = $this->get_to_active_products();
|
12 |
+
$activated_products = $this->get_activated_products();
|
13 |
+
$no_active_products = $this->get_no_active_licence_key();
|
14 |
+
$expired_products = isset( $no_active_products[ '106' ] ) ? $no_active_products[ '106' ] : array();
|
15 |
+
$banned_products = isset( $no_active_products[ '107' ] ) ? $no_active_products[ '107' ] : array();
|
16 |
+
$notice = isset( $notice ) ? $notice : '';
|
17 |
+
$notice_class = !empty( $notice ) ? 'notice notice-success visible' : 'notice notice-success';
|
18 |
+
$to_activate_check = $this instanceof YIT_Theme_Licence ? 1 : 2;
|
19 |
+
$num_members_products_activate = $this->get_number_of_membership_products();
|
20 |
+
$debug = isset( $_REQUEST[ 'yith-license-debug' ] ) ? $_REQUEST[ 'yith-license-debug' ] : false;
|
21 |
?>
|
22 |
|
23 |
<div class="yit-container product-licence-activation">
|
26 |
<div class="licence-check-section">
|
27 |
<form method="post" id="licence-check-update" action="<?php echo admin_url( 'admin-ajax.php' ) ?>">
|
28 |
<span class="licence-label" style="display: block;"><?php _e( 'Have you updated your licenses? Have you asked for an extension? Update information concerning your products.', 'yith-plugin-fw' ); ?></span>
|
29 |
+
<input type="hidden" name="action" value="yith_update_licence_information-<?php echo $this->get_product_type(); ?>"/>
|
30 |
+
<input type="submit" name="submit" value="<?php _e( 'Update license information', 'yith-plugin-fw' ) ?>" class="button-licence licence-check"/>
|
31 |
<div class="spinner"></div>
|
32 |
</form>
|
33 |
</div>
|
38 |
|
39 |
<!-- To Active Products -->
|
40 |
|
41 |
+
<?php if ( !empty( $to_active_products ) ) : ?>
|
42 |
<h3 id="products-to-active" class="to-active">
|
43 |
<?php echo _n( 'Product to activate', 'Products to activate', $to_activate_check, 'yith-plugin-fw' ) ?>
|
44 |
<span class="spinner"></span>
|
45 |
</h3>
|
46 |
<div class="to-active-wrapper">
|
47 |
+
<?php foreach ( $to_active_products as $init => $info ) : ?>
|
48 |
+
<form class="to-active-form" method="post" id="<?php echo $info[ 'product_id' ] ?>" action="<?php echo admin_url( 'admin-ajax.php' ) ?>">
|
49 |
+
<?php if ( $debug ): ?>
|
50 |
+
<input type="hidden" name="debug" value="<?php echo $debug ?>"/>
|
51 |
+
<?php endif ?>
|
52 |
<table class="to-active-table">
|
53 |
<tbody>
|
54 |
+
<tr class="product-row">
|
55 |
+
<td class="product-name">
|
56 |
+
<?php echo $this->display_product_name( $info[ 'Name' ] ) ?>
|
57 |
+
</td>
|
58 |
+
<td>
|
59 |
+
<input type="email" name="email" placeholder="Your email on Yithemes.com" value="" class="user-email"/>
|
60 |
+
</td>
|
61 |
+
<td>
|
62 |
+
<input type="text" name="licence_key" placeholder="License Key" value="" class="licence-key"/>
|
63 |
+
</td>
|
64 |
+
<td class="activate-button">
|
65 |
+
<input type="submit" name="submit" value="<?php _e( 'Activate', 'yith-plugin-fw' ) ?>" class="button-licence licence-activation" data-formid="<?php echo $info[ 'product_id' ] ?>"/>
|
66 |
+
</td>
|
67 |
+
</tr>
|
68 |
+
<input type="hidden" name="action" value="yith_activate-<?php echo $this->get_product_type(); ?>"/>
|
69 |
+
<input type="hidden" name="product_init" value="<?php echo $init ?>"/>
|
70 |
</tbody>
|
71 |
</table>
|
72 |
<div class="message-wrapper">
|
79 |
|
80 |
<!-- Activated Products -->
|
81 |
|
82 |
+
<?php if ( !empty( $activated_products ) ) : ?>
|
83 |
<h3 id="activated-products">
|
84 |
<?php _e( 'Activated', 'yith-plugin-fw' ) ?>
|
85 |
<span class="spinner"></span>
|
86 |
</h3>
|
87 |
<table class="activated-table">
|
88 |
<thead>
|
89 |
+
<tr>
|
90 |
+
<th><?php _e( 'Product Name', 'yith-plugin-fw' ) ?></th>
|
91 |
+
<?php if ( $this->show_extra_info ) : ?>
|
92 |
+
<th><?php _e( 'Email', 'yith-plugin-fw' ) ?></th>
|
93 |
+
<th><?php _e( 'License Key', 'yith-plugin-fw' ) ?></th>
|
94 |
+
<?php endif; ?>
|
95 |
+
|
96 |
+
<th><?php _e( 'Expires', 'yith-plugin-fw' ) ?></th>
|
97 |
+
|
98 |
+
<?php if ( $this->show_extra_info ) : ?>
|
99 |
+
<th><?php _e( 'Remaining', 'yith-plugin-fw' ) ?></th>
|
100 |
+
<?php if ( $num_members_products_activate ) : ?>
|
101 |
+
<th><?php _e( 'Club Subscription', 'yith-plugin-fw' ) ?></th>
|
102 |
<?php endif; ?>
|
103 |
+
<?php endif; ?>
|
104 |
|
105 |
+
<th><?php _e( 'License Actions', 'yith-plugin-fw' ) ?></th>
|
106 |
+
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
</thead>
|
108 |
<tbody>
|
109 |
+
<?php foreach ( $activated_products as $init => $info ) : ?>
|
110 |
+
<tr>
|
111 |
+
<td class="product-name">
|
112 |
+
<?php echo $this->display_product_name( $info[ 'Name' ] ) ?>
|
113 |
+
</td>
|
114 |
+
|
115 |
+
<?php if ( $this->show_extra_info ) : ?>
|
116 |
+
<td class="product-licence-email">
|
117 |
+
<?php echo $info[ 'licence' ][ 'email' ] ?>
|
118 |
</td>
|
119 |
+
<td class="product-licence-key">
|
120 |
+
<?php echo $info[ 'licence' ][ 'licence_key' ] ?>
|
121 |
+
</td>
|
122 |
+
<?php endif; ?>
|
123 |
|
124 |
+
<td class="product-licence-expires">
|
125 |
+
<?php echo date( "F j, Y", $info[ 'licence' ][ 'licence_expires' ] ); ?>
|
126 |
+
</td>
|
|
|
|
|
|
|
|
|
|
|
127 |
|
128 |
+
<?php if ( $this->show_extra_info ) : ?>
|
129 |
+
<td class="product-licence-remaining">
|
130 |
+
<?php printf( __( '%1s out of %2s', 'yith-plugin-fw' ), $info[ 'licence' ][ 'activation_remaining' ], $info[ 'licence' ][ 'activation_limit' ] ); ?>
|
131 |
</td>
|
132 |
+
<?php if ( $num_members_products_activate ) : ?>
|
133 |
+
<td class="product-licence-membership">
|
134 |
+
<span class="dashicons dashicons-<?php echo $info[ 'licence' ][ 'is_membership' ] ? 'yes' : 'no-alt' ?>"></span>
|
|
|
135 |
</td>
|
|
|
|
|
|
|
|
|
|
|
136 |
<?php endif; ?>
|
137 |
+
<?php endif; ?>
|
138 |
|
139 |
+
<td>
|
140 |
+
<a class="button-licence licence-deactive"
|
141 |
+
href="#"
|
142 |
+
data-licence-email="<?php echo $info[ 'licence' ][ 'email' ] ?>"
|
143 |
+
data-licence-key="<?php echo $info[ 'licence' ][ 'licence_key' ] ?>"
|
144 |
+
data-product-init="<?php echo $init ?>"
|
145 |
+
data-action="yith_deactivate-<?php echo $this->get_product_type(); ?>">
|
146 |
+
<?php _e( 'Deactivate', 'yith-plugin-fw' ) ?>
|
147 |
+
</a>
|
148 |
+
|
149 |
+
<?php if ( !$info[ 'licence' ][ 'is_membership' ] && $this->show_renew_button ) : ?>
|
150 |
+
<a class="button-licence licence-renew" href="<?php echo esc_url( $this->get_renewing_uri( $info[ 'licence' ][ 'licence_key' ] ) ) ?>" target="_blank">
|
151 |
+
<?php _e( 'Renew', 'yith-plugin-fw' ) ?>
|
152 |
</a>
|
153 |
+
<?php endif; ?>
|
154 |
+
</td>
|
155 |
+
</tr>
|
156 |
+
<?php endforeach; ?>
|
|
|
|
|
|
|
|
|
|
|
157 |
</tbody>
|
158 |
</table>
|
159 |
+
<?php endif; ?>
|
160 |
|
161 |
+
<!-- Banned Products -->
|
162 |
|
163 |
+
<?php if ( !empty( $banned_products ) ) : ?>
|
164 |
<h3><?php _e( 'Banned', 'yith-plugin-fw' ) ?></h3>
|
165 |
<table class="expired-table">
|
166 |
<thead>
|
167 |
+
<tr>
|
168 |
+
<th><?php _e( 'Product Name', 'yith-plugin-fw' ) ?></th>
|
169 |
+
<?php if ( $this->show_extra_info ) : ?>
|
170 |
+
<th><?php _e( 'Email', 'yith-plugin-fw' ) ?></th>
|
171 |
+
<th><?php _e( 'License Key', 'yith-plugin-fw' ) ?></th>
|
172 |
+
<?php endif; ?>
|
173 |
+
</tr>
|
174 |
+
</thead>
|
175 |
+
<tbody>
|
176 |
+
<?php foreach ( $banned_products as $init => $info ) : ?>
|
177 |
<tr>
|
178 |
+
<td class="product-name">
|
179 |
+
<?php echo $this->display_product_name( $info[ 'Name' ] ) ?>
|
180 |
+
</td>
|
181 |
+
<?php if ( $this->show_extra_info ) : ?>
|
182 |
+
<td class="product-licence-email"><?php echo $info[ 'licence' ][ 'email' ] ?></td>
|
183 |
+
<td class="product-licence-key"><?php echo $info[ 'licence' ][ 'licence_key' ] ?></td>
|
184 |
<?php endif; ?>
|
185 |
</tr>
|
186 |
+
<?php endforeach; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
</tbody>
|
188 |
</table>
|
189 |
+
<?php endif; ?>
|
190 |
|
191 |
<!-- Expired Products -->
|
192 |
|
193 |
+
<?php if ( !empty( $expired_products ) ) : ?>
|
194 |
<h3><?php _e( 'Expired', 'yith-plugin-fw' ) ?></h3>
|
195 |
<table class="expired-table">
|
196 |
<thead>
|
197 |
+
<tr>
|
198 |
+
<th><?php _e( 'Product Name', 'yith-plugin-fw' ) ?></th>
|
199 |
|
200 |
+
<?php if ( $this->show_extra_info ) : ?>
|
201 |
+
<th><?php _e( 'Email', 'yith-plugin-fw' ) ?></th>
|
202 |
+
<th><?php _e( 'License Key', 'yith-plugin-fw' ) ?></th>
|
203 |
+
<?php endif; ?>
|
204 |
|
205 |
+
<th><?php _e( 'Expires', 'yith-plugin-fw' ) ?></th>
|
206 |
|
207 |
+
<?php if ( $this->show_renew_button ) : ?>
|
208 |
+
<th><?php _e( 'Renew', 'yith-plugin-fw' ) ?></th>
|
209 |
+
<?php endif; ?>
|
210 |
+
</tr>
|
211 |
</thead>
|
212 |
<tbody>
|
213 |
+
<?php foreach ( $expired_products as $init => $info ) : ?>
|
214 |
+
<tr>
|
215 |
+
<td class="product-name">
|
216 |
+
<?php echo $this->display_product_name( $info[ 'Name' ] ) ?>
|
217 |
+
</td>
|
218 |
|
219 |
+
<?php if ( $this->show_extra_info ) : ?>
|
220 |
+
<td class="product-licence-email"><?php echo $info[ 'licence' ][ 'email' ] ?></td>
|
221 |
+
<td class="product-licence-key"><?php echo $info[ 'licence' ][ 'licence_key' ] ?></td>
|
222 |
+
<?php endif; ?>
|
223 |
|
224 |
+
<td class="product-licence-expires"><?php echo date( "F j, Y", $info[ 'licence' ][ 'licence_expires' ] ); ?></td>
|
225 |
|
226 |
+
<?php if ( $this->show_renew_button ) : ?>
|
227 |
+
<td>
|
228 |
+
<a class="button-licence licence-renew" href="<?php echo $this->get_renewing_uri( $info[ 'licence' ][ 'licence_key' ] ) ?>" target="_blank">
|
229 |
+
<?php if ( $info[ 'licence' ][ 'is_membership' ] ) : ?>
|
230 |
+
<?php _e( 'Order again', 'yith-plugin-fw' ) ?>
|
231 |
+
<?php else : ?>
|
232 |
+
<?php __( 'Renew license', 'yith-plugin-fw' ) ?>
|
233 |
+
<?php endif; ?>
|
234 |
+
</a>
|
235 |
+
</td>
|
236 |
+
<?php endif; ?>
|
237 |
+
</tr>
|
238 |
+
<?php endforeach; ?>
|
239 |
</tbody>
|
240 |
</table>
|
241 |
+
<?php endif; ?>
|
242 |
</div>
|
templates/admin/premium.php
CHANGED
@@ -154,29 +154,38 @@
|
|
154 |
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/01-bg.png) no-repeat #fff; background-position: 85% 75%
|
155 |
}
|
156 |
.section.two{
|
157 |
-
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/02-bg.png) no-repeat #
|
158 |
}
|
159 |
.section.three{
|
160 |
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/03-bg.png) no-repeat #fff; background-position: 85% 75%
|
161 |
}
|
162 |
.section.four{
|
163 |
-
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/04-bg.png) no-repeat #
|
164 |
}
|
165 |
.section.five{
|
166 |
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/05-bg.png) no-repeat #fff; background-position: 85% 75%
|
167 |
}
|
168 |
.section.six{
|
169 |
-
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/06-bg.png) no-repeat #
|
170 |
}
|
171 |
.section.seven{
|
172 |
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/07-bg.png) no-repeat #fff; background-position: 85% 75%
|
173 |
}
|
174 |
.section.eight{
|
175 |
-
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/08-bg.png) no-repeat #
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
}
|
177 |
.section.eleven{
|
178 |
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/11-bg.png) no-repeat #fff; background-position: 85% 75%
|
179 |
}
|
|
|
|
|
|
|
180 |
|
181 |
@media (max-width: 768px) {
|
182 |
.section{margin: 0}
|
@@ -350,7 +359,7 @@
|
|
350 |
</div>
|
351 |
</div>
|
352 |
</div>
|
353 |
-
<div class="
|
354 |
<div class="landing-container">
|
355 |
<div class="col-2">
|
356 |
<div class="section-title">
|
@@ -366,7 +375,7 @@
|
|
366 |
</div>
|
367 |
</div>
|
368 |
</div>
|
369 |
-
<div class="
|
370 |
<div class="landing-container">
|
371 |
<div class="col-1">
|
372 |
<img src="<?php echo YITH_WOOCOMPARE_URL ?>assets/images/09.png" alt="Related products" />
|
@@ -382,7 +391,7 @@
|
|
382 |
</div>
|
383 |
</div>
|
384 |
</div>
|
385 |
-
<div class="
|
386 |
<div class="landing-container">
|
387 |
<div class="col-2">
|
388 |
<div class="section-title">
|
@@ -406,7 +415,7 @@
|
|
406 |
<div class="col-2">
|
407 |
<div class="section-title">
|
408 |
<img src="<?php echo YITH_WOOCOMPARE_URL?>assets/images/11-icon.png" alt="icon 11" />
|
409 |
-
<h2><?php _e('
|
410 |
</div>
|
411 |
<p>
|
412 |
<?php echo sprintf( __('Thanks to YITH WooCommerce Comapre Widget users could verify at any time the complete list of products added to the compare tab and avoid to open the popup to check its existence. ','yith-woocommerce-compare'),'<b>','</b>'); ?>
|
@@ -414,6 +423,22 @@
|
|
414 |
</div>
|
415 |
</div>
|
416 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
417 |
<div class="section section-cta section-odd">
|
418 |
<div class="landing-container">
|
419 |
<div class="premium-cta">
|
154 |
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/01-bg.png) no-repeat #fff; background-position: 85% 75%
|
155 |
}
|
156 |
.section.two{
|
157 |
+
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/02-bg.png) no-repeat #f1f1f1; background-position: 15% 75%
|
158 |
}
|
159 |
.section.three{
|
160 |
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/03-bg.png) no-repeat #fff; background-position: 85% 75%
|
161 |
}
|
162 |
.section.four{
|
163 |
+
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/04-bg.png) no-repeat #f1f1f1; background-position: 15% 75%
|
164 |
}
|
165 |
.section.five{
|
166 |
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/05-bg.png) no-repeat #fff; background-position: 85% 75%
|
167 |
}
|
168 |
.section.six{
|
169 |
+
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/06-bg.png) no-repeat #f1f1f1; background-position: 15% 75%
|
170 |
}
|
171 |
.section.seven{
|
172 |
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/07-bg.png) no-repeat #fff; background-position: 85% 75%
|
173 |
}
|
174 |
.section.eight{
|
175 |
+
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/08-bg.png) no-repeat #f1f1f1; background-position: 15% 75%
|
176 |
+
}
|
177 |
+
.section.nine{
|
178 |
+
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/09-bg.png) no-repeat #fff; background-position: 15% 75%
|
179 |
+
}
|
180 |
+
.section.ten{
|
181 |
+
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/10-bg.png) no-repeat #f1f1f1; background-position: 15% 75%
|
182 |
}
|
183 |
.section.eleven{
|
184 |
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/11-bg.png) no-repeat #fff; background-position: 85% 75%
|
185 |
}
|
186 |
+
.section.twelve{
|
187 |
+
background: url(<?php echo YITH_WOOCOMPARE_URL ?>assets/images/12-bg.png) no-repeat #f1f1f1; background-position: 15% 75%
|
188 |
+
}
|
189 |
|
190 |
@media (max-width: 768px) {
|
191 |
.section{margin: 0}
|
359 |
</div>
|
360 |
</div>
|
361 |
</div>
|
362 |
+
<div class="eight section section-odd clear">
|
363 |
<div class="landing-container">
|
364 |
<div class="col-2">
|
365 |
<div class="section-title">
|
375 |
</div>
|
376 |
</div>
|
377 |
</div>
|
378 |
+
<div class="nine section section-even clear">
|
379 |
<div class="landing-container">
|
380 |
<div class="col-1">
|
381 |
<img src="<?php echo YITH_WOOCOMPARE_URL ?>assets/images/09.png" alt="Related products" />
|
391 |
</div>
|
392 |
</div>
|
393 |
</div>
|
394 |
+
<div class="ten section section-odd clear">
|
395 |
<div class="landing-container">
|
396 |
<div class="col-2">
|
397 |
<div class="section-title">
|
415 |
<div class="col-2">
|
416 |
<div class="section-title">
|
417 |
<img src="<?php echo YITH_WOOCOMPARE_URL?>assets/images/11-icon.png" alt="icon 11" />
|
418 |
+
<h2><?php _e('Compare list - widget','yith-woocommerce-compare');?></h2>
|
419 |
</div>
|
420 |
<p>
|
421 |
<?php echo sprintf( __('Thanks to YITH WooCommerce Comapre Widget users could verify at any time the complete list of products added to the compare tab and avoid to open the popup to check its existence. ','yith-woocommerce-compare'),'<b>','</b>'); ?>
|
423 |
</div>
|
424 |
</div>
|
425 |
</div>
|
426 |
+
<div class="twelve section section-odd clear">
|
427 |
+
<div class="landing-container">
|
428 |
+
<div class="col-2">
|
429 |
+
<div class="section-title">
|
430 |
+
<img src="<?php echo YITH_WOOCOMPARE_URL ?>assets/images/12-icon.png" alt="icon 12" />
|
431 |
+
<h2><?php _e('Compare counter - widget and shortcode','yith-woocommerce-compare');?></h2>
|
432 |
+
</div>
|
433 |
+
<p>
|
434 |
+
<?php echo sprintf( __( 'Moreover, if you want to give your users the chance to see in a glance how many products they have added to the Compare list, feel free to use the widget or the shortcode included. And their Compare list is always no more than one click away.','yith-woocommerce-compare' ),'<b>','</b>' ) ?>
|
435 |
+
</p>
|
436 |
+
</div>
|
437 |
+
<div class="col-1">
|
438 |
+
<img src="<?php echo YITH_WOOCOMPARE_URL ?>assets/images/12.png" alt="Social networks" />
|
439 |
+
</div>
|
440 |
+
</div>
|
441 |
+
</div>
|
442 |
<div class="section section-cta section-odd">
|
443 |
<div class="landing-container">
|
444 |
<div class="premium-cta">
|