YITH WooCommerce Compare - Version 2.3.0

Version Description

Released on Feb 2, 2018

  • New: Support to WooCommerce 3.3.0.
  • New: Support to WordPress 4.9.2.
  • Update: Plugin Core.
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Compare
Version 2.3.0
Comparing to
See all releases

Code changes from version 2.2.3 to 2.3.0

README.txt CHANGED
@@ -3,13 +3,13 @@
3
  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.1
7
- Stable tag: 2.2.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  YITH WooCommerce Compare allows you to compare more products of your shop in one complete table.
12
- WooCommerce Compatible up to 3.2
13
 
14
  == Description ==
15
 
@@ -66,6 +66,12 @@ yith-woocommerce-compare-<WORDPRESS LOCALE >.mo
66
 
67
  == Changelog ==
68
 
 
 
 
 
 
 
69
  = 2.2.3 = Released on Dec 21, 2017
70
 
71
  * New: Support to WooCommerce 3.2.6.
@@ -269,11 +275,8 @@ Full documentation is available [here](http://yithemes.com/docs-plugins/yith-woo
269
 
270
  == Upgrade notice ==
271
 
272
- = 2.2.3 = Released on Dec 21, 2017
273
 
274
- * New: Support to WooCommerce 3.2.6.
275
- * New: Support to WordPress 4.9.1.
276
- * New: Product SKU field in compare table.
277
  * Update: Plugin Core.
278
- * Update: Language Files.
279
- * Dev: New filter yith_woocompare_standard_fields_array to filter standard compare fields.
3
  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.2
7
+ Stable tag: 2.3.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  YITH WooCommerce Compare allows you to compare more products of your shop in one complete table.
12
+ WooCommerce Compatible up to 3.3
13
 
14
  == Description ==
15
 
66
 
67
  == Changelog ==
68
 
69
+ = 2.3.0 = Released on Feb 2, 2018
70
+
71
+ * New: Support to WooCommerce 3.3.0.
72
+ * New: Support to WordPress 4.9.2.
73
+ * Update: Plugin Core.
74
+
75
  = 2.2.3 = Released on Dec 21, 2017
76
 
77
  * New: Support to WooCommerce 3.2.6.
275
 
276
  == Upgrade notice ==
277
 
278
+ = 2.3.0 = Released on Feb 2, 2018
279
 
280
+ * New: Support to WooCommerce 3.3.0.
281
+ * New: Support to WordPress 4.9.2.
 
282
  * Update: Plugin Core.
 
 
init.php CHANGED
@@ -3,17 +3,17 @@
3
  * Plugin Name: YITH WooCommerce Compare
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-compare/
5
  * Description: YITH WooCommerce Compare allows you to compare more products with WooCommerce plugin, through product attributes.
6
- * Version: 2.2.3
7
  * Author: YITHEMES
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-compare
10
  * Domain Path: /languages/
11
  * WC requires at least: 2.5.0
12
- * WC tested up to: 3.2.6
13
  *
14
  * @author Yithemes
15
  * @package YITH WooCommerce Compare
16
- * @version 2.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.2.3' );
62
  }
63
  if ( ! defined( 'YITH_WOOCOMPARE_FREE_INIT' ) ) {
64
  define( 'YITH_WOOCOMPARE_FREE_INIT', plugin_basename( __FILE__ ) );
3
  * Plugin Name: YITH WooCommerce Compare
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-compare/
5
  * Description: YITH WooCommerce Compare allows you to compare more products with WooCommerce plugin, through product attributes.
6
+ * Version: 2.3.0
7
  * Author: YITHEMES
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-compare
10
  * Domain Path: /languages/
11
  * WC requires at least: 2.5.0
12
+ * WC tested up to: 3.3.0
13
  *
14
  * @author Yithemes
15
  * @package YITH WooCommerce Compare
16
+ * @version 2.3.0
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.0' );
62
  }
63
  if ( ! defined( 'YITH_WOOCOMPARE_FREE_INIT' ) ) {
64
  define( 'YITH_WOOCOMPARE_FREE_INIT', plugin_basename( __FILE__ ) );
plugin-fw/assets/css/yith-fields.css CHANGED
@@ -27,7 +27,7 @@
27
  }
28
 
29
  .the-metabox .yith-plugin-fw-title-field-wrapper h3.title {
30
- float : left;
31
  }
32
 
33
  .yith-plugin-fw input[type=email],
@@ -180,37 +180,37 @@ ul.yit-icons-manager-list li.active {
180
  }
181
 
182
  .yith-plugin-fw-onoff-container input + span {
183
- cursor : pointer;
184
- text-indent : -9999px;
185
- display : block;
186
- width: 36px;
187
- height: 20px;
188
- background: #a4a4a4;
189
- border-radius: 24px;
190
- position: relative;
191
- transition: all 0.3s;
192
- }
193
-
194
- .yith-plugin-fw-onoff-container input + span:before{
195
- content: '';
196
- background: #fff;
197
- width:16px;
198
- height: 16px;
199
- border-radius: 50%;
200
- position: absolute;
201
- top:2px;
202
- left:2px;
203
- transition: all 0.3s;
204
  }
205
 
206
  .yith-plugin-fw-onoff-container input:checked + span,
207
  .yith-plugin-fw-onoff-container input.onoffchecked + span {
208
- background: #0073aa;
209
  }
210
 
211
  .yith-plugin-fw-onoff-container input:checked + span:before,
212
  .yith-plugin-fw-onoff-container input.onoffchecked + span:before {
213
- left:18px;
214
  }
215
 
216
  /* ------- Preview ------- */
@@ -319,7 +319,13 @@ ul.yit-icons-manager-list li.active {
319
 
320
  /* ------- Textarea ------- */
321
  .yith-plugin-fw-textarea-editor-field-wrapper {
322
- clear : both;
 
 
 
 
 
 
323
  }
324
 
325
  /* ------- Buttons ------- */
27
  }
28
 
29
  .the-metabox .yith-plugin-fw-title-field-wrapper h3.title {
30
+ float : left;
31
  }
32
 
33
  .yith-plugin-fw input[type=email],
180
  }
181
 
182
  .yith-plugin-fw-onoff-container input + span {
183
+ cursor : pointer;
184
+ text-indent : -9999px;
185
+ display : block;
186
+ width : 36px;
187
+ height : 20px;
188
+ background : #a4a4a4;
189
+ border-radius : 24px;
190
+ position : relative;
191
+ transition : all 0.3s;
192
+ }
193
+
194
+ .yith-plugin-fw-onoff-container input + span:before {
195
+ content : '';
196
+ background : #fff;
197
+ width : 16px;
198
+ height : 16px;
199
+ border-radius : 50%;
200
+ position : absolute;
201
+ top : 2px;
202
+ left : 2px;
203
+ transition : all 0.3s;
204
  }
205
 
206
  .yith-plugin-fw-onoff-container input:checked + span,
207
  .yith-plugin-fw-onoff-container input.onoffchecked + span {
208
+ background : #0073aa;
209
  }
210
 
211
  .yith-plugin-fw-onoff-container input:checked + span:before,
212
  .yith-plugin-fw-onoff-container input.onoffchecked + span:before {
213
+ left : 18px;
214
  }
215
 
216
  /* ------- Preview ------- */
319
 
320
  /* ------- Textarea ------- */
321
  .yith-plugin-fw-textarea-editor-field-wrapper {
322
+ max-width : 1000px;
323
+ clear : both;
324
+ }
325
+
326
+ .yith-plugin-fw-textarea-editor-field-wrapper textarea.wp-editor-area,
327
+ .woocommerce table.form-table .yith-plugin-fw-textarea-editor-field-wrapper textarea.wp-editor-area{
328
+ width : 100%;
329
  }
330
 
331
  /* ------- Buttons ------- */
plugin-fw/init.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 3.0.2
5
  * Author: Yithemes
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
- * @version 3.0.2
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
+ * Version: 3.0.11
5
  * Author: Yithemes
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
+ * @version 3.0.11
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
plugin-fw/lib/yit-debug.php CHANGED
@@ -10,21 +10,21 @@
10
 
11
  !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
12
 
13
- if ( !class_exists( 'YIT_Debug' ) ) {
14
  /**
15
- * YIT_Debug
16
  *
17
  * manages debug
18
  *
19
- * @class YIT_Debug
20
  * @package Yithemes
21
  * @since 1.0.0
22
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
23
  *
24
  */
25
- class YIT_Debug {
26
 
27
- /** @var YIT_Debug */
28
  private static $_instance;
29
 
30
  public static function get_instance() {
@@ -234,7 +234,8 @@ if ( !class_exists( 'YIT_Debug' ) ) {
234
  * @return string
235
  */
236
  public function get_plugin_framework_info() {
237
- $plugin_fw_version = get_file_data( trailingslashit( YIT_CORE_PLUGIN_PATH ) . 'init.php', array( 'Version' => 'Version' ) )[ 'Version' ];
 
238
  $plugin_fw_loaded_by = basename( dirname( YIT_CORE_PLUGIN_PATH ) );
239
 
240
  return "$plugin_fw_version (by $plugin_fw_loaded_by)";
@@ -261,8 +262,10 @@ if ( !class_exists( 'YIT_Debug' ) ) {
261
  }
262
  }
263
  }
264
- function YIT_Debug() {
265
- return YIT_Debug::get_instance();
266
- }
 
267
 
268
- YIT_Debug();
 
10
 
11
  !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
12
 
13
+ if ( !class_exists( 'YITH_Debug' ) ) {
14
  /**
15
+ * YITH_Debug
16
  *
17
  * manages debug
18
  *
19
+ * @class YITH_Debug
20
  * @package Yithemes
21
  * @since 1.0.0
22
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
23
  *
24
  */
25
+ class YITH_Debug {
26
 
27
+ /** @var YITH_Debug */
28
  private static $_instance;
29
 
30
  public static function get_instance() {
234
  * @return string
235
  */
236
  public function get_plugin_framework_info() {
237
+ $plugin_fw_data = get_file_data( trailingslashit( YIT_CORE_PLUGIN_PATH ) . 'init.php', array( 'Version' => 'Version' ) );
238
+ $plugin_fw_version = $plugin_fw_data[ 'Version' ];
239
  $plugin_fw_loaded_by = basename( dirname( YIT_CORE_PLUGIN_PATH ) );
240
 
241
  return "$plugin_fw_version (by $plugin_fw_loaded_by)";
262
  }
263
  }
264
  }
265
+ if ( !function_exists( 'YITH_Debug' ) ) {
266
+ function YITH_Debug() {
267
+ return YITH_Debug::get_instance();
268
+ }
269
 
270
+ YITH_Debug();
271
+ }
plugin-fw/lib/yit-plugin-panel-wc.php CHANGED
@@ -520,6 +520,10 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
520
  if ( isset( $option[ 'yith-type' ] ) && in_array( $option[ 'yith-type' ], array( 'checkbox', 'onoff' ) ) ) {
521
  $value = yith_plugin_fw_is_true( $raw_value ) ? 'yes' : 'no';
522
  }
 
 
 
 
523
  }
524
 
525
  return $value;
520
  if ( isset( $option[ 'yith-type' ] ) && in_array( $option[ 'yith-type' ], array( 'checkbox', 'onoff' ) ) ) {
521
  $value = yith_plugin_fw_is_true( $raw_value ) ? 'yes' : 'no';
522
  }
523
+
524
+ if ( isset( $option[ 'yith-type' ] ) && in_array( $option[ 'yith-type' ], array( 'textarea-editor', 'textarea-codemirror' ) ) ) {
525
+ $value = $raw_value;
526
+ }
527
  }
528
 
529
  return $value;
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -150,9 +150,12 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
150
  global $admin_page_hooks;
151
 
152
  if ( !isset( $admin_page_hooks[ 'yit_plugin_panel' ] ) ) {
153
- $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
 
 
 
154
  // YITH Plugins text must not be translated
155
- apply_filters( 'yit_plugin_panel_menu_page_capability', current_user_can( 'manage_options' ) ) && add_menu_page( 'yit_plugin_panel', 'YITH Plugins', 'manage_options', 'yit_plugin_panel', null, YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png', $position );
156
  }
157
  }
158
 
@@ -268,7 +271,7 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
268
  } else {
269
  if ( isset( $option[ 'id' ] ) ) {
270
  $value = isset( $input[ $option[ 'id' ] ] ) ? $input[ $option[ 'id' ] ] : false;
271
- if ( isset( $option[ 'type' ] ) && in_array( $option[ 'yith-type' ], array( 'checkbox', 'onoff' ) ) ) {
272
  $value = yith_plugin_fw_is_true( $value ) ? 'yes' : 'no';
273
  }
274
  $valid_input[ $option[ 'id' ] ] = $value;
@@ -317,7 +320,7 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
317
  public function add_premium_version_upgrade_to_menu() {
318
  global $submenu;
319
 
320
- if ( apply_filters( 'yit_show_upgrade_to_premium_version', !isset( $submenu[ 'yit_plugin_panel' ][ 'how_to' ] ) ) ) {
321
  $submenu[ 'yit_plugin_panel' ][ 'how_to' ] = array(
322
  sprintf( '%s%s%s', '<span id="yith-how-to-premium">', __( 'How to install premium version', 'yith-plugin-fw' ), '</span>' ),
323
  'install_plugins',
150
  global $admin_page_hooks;
151
 
152
  if ( !isset( $admin_page_hooks[ 'yit_plugin_panel' ] ) ) {
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( 'yit_plugin_panel', 'YITH Plugins', $capability, 'yit_plugin_panel', null, YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png', $position );
159
  }
160
  }
161
 
271
  } else {
272
  if ( isset( $option[ 'id' ] ) ) {
273
  $value = isset( $input[ $option[ 'id' ] ] ) ? $input[ $option[ 'id' ] ] : false;
274
+ if ( isset( $option[ 'type' ] ) && in_array( $option[ 'type' ], array( 'checkbox', 'onoff' ) ) ) {
275
  $value = yith_plugin_fw_is_true( $value ) ? 'yes' : 'no';
276
  }
277
  $valid_input[ $option[ 'id' ] ] = $value;
320
  public function add_premium_version_upgrade_to_menu() {
321
  global $submenu;
322
 
323
+ if ( apply_filters( 'yit_show_upgrade_to_premium_version', isset( $submenu[ 'yit_plugin_panel' ] ) && !isset( $submenu[ 'yit_plugin_panel' ][ 'how_to' ] ) ) ) {
324
  $submenu[ 'yit_plugin_panel' ][ 'how_to' ] = array(
325
  sprintf( '%s%s%s', '<span id="yith-how-to-premium">', __( 'How to install premium version', 'yith-plugin-fw' ), '</span>' ),
326
  'install_plugins',
plugin-fw/lib/yit-plugin-subpanel.php CHANGED
@@ -8,11 +8,11 @@
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
- if ( ! defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
- if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
16
  /**
17
  * YIT Plugin Panel
18
  *
@@ -23,7 +23,6 @@ if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
23
  * @since 1.0
24
  * @author Your Inspiration Themes
25
  */
26
-
27
  class YIT_Plugin_SubPanel extends YIT_Plugin_Panel {
28
 
29
  /**
@@ -50,10 +49,10 @@ if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
50
  */
51
 
52
  public function __construct( $args = array() ) {
53
- if ( ! empty( $args ) ) {
54
- $this->settings = $args;
55
- $this->settings['parent'] = $this->settings['page'];
56
- $this->_tabs_path_files = $this->get_tabs_path_files();
57
 
58
  add_action( 'admin_init', array( $this, 'register_settings' ) );
59
  add_action( 'admin_menu', array( &$this, 'add_setting_page' ) );
@@ -74,11 +73,10 @@ if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
74
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
75
  */
76
  public function register_settings() {
77
- register_setting( 'yit_' . $this->settings['page'] . '_options', 'yit_' . $this->settings['page'] . '_options', array( &$this, 'options_validate' ) );
78
  }
79
 
80
 
81
-
82
  /**
83
  * Add Setting SubPage
84
  *
@@ -98,12 +96,12 @@ if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
98
  $logo = $admin_logo;
99
  }
100
 
101
- if( ! isset( $admin_page_hooks['yit_plugin_panel'] ) ) {
102
  $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
103
- add_menu_page( 'yit_plugin_panel', 'YITH Plugins', 'nosuchcapability', 'yit_plugin_panel', NULL, $logo, $position );
104
  }
105
 
106
- add_submenu_page( 'yit_plugin_panel', $this->settings['label'], $this->settings['label'], 'manage_options', $this->settings['page'], array( $this, 'yit_panel' ) );
107
  remove_submenu_page( 'yit_plugin_panel', 'yit_plugin_panel' );
108
 
109
  }
@@ -118,46 +116,59 @@ if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
118
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
119
  */
120
  public function yit_panel() {
121
-
122
  $tabs = '';
123
  $current_tab = $this->get_current_tab();
 
 
124
 
125
  // tabs
126
- foreach ( $this->settings['admin-tabs'] as $tab => $tab_value ) {
127
  $active_class = ( $current_tab == $tab ) ? ' nav-tab-active' : '';
128
- $tabs .= '<a class="nav-tab' . $active_class . '" href="?page=' . $this->settings['page'] . '&tab=' . $tab . '">' . $tab_value . '</a>';
129
  }
130
  ?>
131
- <div id="icon-themes" class="icon32"><br /></div>
132
  <h2 class="nav-tab-wrapper">
133
  <?php echo $tabs ?>
134
  </h2>
 
 
 
 
135
 
136
- <div id="wrap" class="plugin-option">
 
 
 
 
 
 
 
137
  <?php $this->message(); ?>
138
- <h2><?php echo $this->get_tab_title() ?></h2>
139
-
140
- <?php if ( $this->is_show_form() ) : ?>
141
- <form method="post" action="options.php">
142
- <?php do_settings_sections( 'yit' ); ?>
 
 
 
 
 
 
 
 
 
 
 
143
  <p>&nbsp;</p>
144
- <?php settings_fields( 'yit_' . $this->settings['page'] . '_options' ); ?>
145
- <input type="hidden" name="<?php echo $this->get_name_field( 'current_tab' ) ?>" value="<?php echo esc_attr( $current_tab ) ?>" />
146
- <input type="submit" class="button-primary" value="<?php _e( 'Save Changes', 'yith-plugin-fw' ) ?>" style="float:left;margin-right:10px;" />
147
- </form>
148
- <form method="post">
149
- <?php $warning = __( 'If you continue with this action, you will reset all the options in this page.', 'yith-plugin-fw' ) ?>
150
- <input type="hidden" name="yit-action" value="reset" />
151
- <input type="submit" name="yit-reset" class="button-secondary" value="<?php _e( 'Reset to default', 'yith-plugin-fw' ) ?>" onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');" />
152
- </form>
153
- <p>&nbsp;</p>
154
- <?php endif ?>
155
  </div>
156
- <?php
157
  }
158
 
159
 
160
-
161
  }
162
 
163
  }
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
+ if ( !defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
+ if ( !class_exists( 'YIT_Plugin_SubPanel' ) ) {
16
  /**
17
  * YIT Plugin Panel
18
  *
23
  * @since 1.0
24
  * @author Your Inspiration Themes
25
  */
 
26
  class YIT_Plugin_SubPanel extends YIT_Plugin_Panel {
27
 
28
  /**
49
  */
50
 
51
  public function __construct( $args = array() ) {
52
+ if ( !empty( $args ) ) {
53
+ $this->settings = $args;
54
+ $this->settings[ 'parent' ] = $this->settings[ 'page' ];
55
+ $this->_tabs_path_files = $this->get_tabs_path_files();
56
 
57
  add_action( 'admin_init', array( $this, 'register_settings' ) );
58
  add_action( 'admin_menu', array( &$this, 'add_setting_page' ) );
73
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
74
  */
75
  public function register_settings() {
76
+ register_setting( 'yit_' . $this->settings[ 'page' ] . '_options', 'yit_' . $this->settings[ 'page' ] . '_options', array( &$this, 'options_validate' ) );
77
  }
78
 
79
 
 
80
  /**
81
  * Add Setting SubPage
82
  *
96
  $logo = $admin_logo;
97
  }
98
 
99
+ if ( !isset( $admin_page_hooks[ 'yit_plugin_panel' ] ) ) {
100
  $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
101
+ add_menu_page( 'yit_plugin_panel', 'YITH Plugins', 'nosuchcapability', 'yit_plugin_panel', null, $logo, $position );
102
  }
103
 
104
+ add_submenu_page( 'yit_plugin_panel', $this->settings[ 'label' ], $this->settings[ 'label' ], 'manage_options', $this->settings[ 'page' ], array( $this, 'yit_panel' ) );
105
  remove_submenu_page( 'yit_plugin_panel', 'yit_plugin_panel' );
106
 
107
  }
116
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
117
  */
118
  public function yit_panel() {
 
119
  $tabs = '';
120
  $current_tab = $this->get_current_tab();
121
+ $yit_options = $this->get_main_array_options();
122
+
123
 
124
  // tabs
125
+ foreach ( $this->settings[ 'admin-tabs' ] as $tab => $tab_value ) {
126
  $active_class = ( $current_tab == $tab ) ? ' nav-tab-active' : '';
127
+ $tabs .= '<a class="nav-tab' . $active_class . '" href="?page=' . $this->settings[ 'page' ] . '&tab=' . $tab . '">' . $tab_value . '</a>';
128
  }
129
  ?>
130
+ <div id="icon-themes" class="icon32"><br/></div>
131
  <h2 class="nav-tab-wrapper">
132
  <?php echo $tabs ?>
133
  </h2>
134
+ <?php
135
+ $custom_tab_action = $this->is_custom_tab( $yit_options, $current_tab );
136
+ if ( $custom_tab_action ) {
137
+ $this->print_custom_tab( $custom_tab_action );
138
 
139
+ return;
140
+ }
141
+ ?>
142
+ <?php $this->print_video_box(); ?>
143
+ <?php
144
+ $panel_content_class = apply_filters( 'yit_admin_panel_content_class', 'yit-admin-panel-content-wrap' );
145
+ ?>
146
+ <div id="wrap" class="yith-plugin-fw plugin-option yit-admin-panel-container">
147
  <?php $this->message(); ?>
148
+ <div class="<?php echo $panel_content_class; ?>">
149
+ <h2><?php echo $this->get_tab_title() ?></h2>
150
+ <?php if ( $this->is_show_form() ) : ?>
151
+ <form id="yith-plugin-fw-panel" method="post" action="options.php">
152
+ <?php do_settings_sections( 'yit' ); ?>
153
+ <p>&nbsp;</p>
154
+ <?php settings_fields( 'yit_' . $this->settings[ 'parent' ] . '_options' ); ?>
155
+ <input type="hidden" name="<?php echo $this->get_name_field( 'current_tab' ) ?>" value="<?php echo esc_attr( $current_tab ) ?>"/>
156
+ <input type="submit" class="button-primary" value="<?php _e( 'Save Changes', 'yith-plugin-fw' ) ?>" style="float:left;margin-right:10px;"/>
157
+ </form>
158
+ <form method="post">
159
+ <?php $warning = __( 'If you continue with this action, you will reset all options in this page.', 'yith-plugin-fw' ) ?>
160
+ <input type="hidden" name="yit-action" value="reset"/>
161
+ <input type="submit" name="yit-reset" class="button-secondary" value="<?php _e( 'Reset to default', 'yith-plugin-fw' ) ?>"
162
+ onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');"/>
163
+ </form>
164
  <p>&nbsp;</p>
165
+ <?php endif ?>
166
+ </div>
 
 
 
 
 
 
 
 
 
167
  </div>
168
+ <?php
169
  }
170
 
171
 
 
172
  }
173
 
174
  }
plugin-fw/lib/yit-upgrade.php CHANGED
@@ -169,7 +169,7 @@ if ( !class_exists( 'YIT_Upgrade' ) ) {
169
  public function admin_enqueue_scripts() {
170
  global $pagenow;
171
  if ( 'plugins.php' === $pagenow )
172
- yit_enqueue_style( 'yit-upgrader', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrader.css' );
173
  }
174
 
175
  /**
@@ -195,7 +195,8 @@ if ( !class_exists( 'YIT_Upgrade' ) ) {
195
  } else {
196
  //Bulk action upgrade
197
  $action_url = parse_url( $upgrader->skin->options[ 'url' ] );
198
- parse_str( rawurldecode( htmlspecialchars_decode( $action_url[ 'query' ] ) ) );
 
199
  $plugins = explode( ',', $plugins );
200
  foreach ( $plugins as $plugin_init ) {
201
  $to_upgrade = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_init );
169
  public function admin_enqueue_scripts() {
170
  global $pagenow;
171
  if ( 'plugins.php' === $pagenow )
172
+ wp_enqueue_style( 'yit-upgrader', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrader.css' );
173
  }
174
 
175
  /**
195
  } else {
196
  //Bulk action upgrade
197
  $action_url = parse_url( $upgrader->skin->options[ 'url' ] );
198
+ parse_str( rawurldecode( htmlspecialchars_decode( $action_url[ 'query' ] ) ), $output );
199
+ $plugins = isset( $output[ 'plugins' ] ) ? $output[ 'plugins' ] : '';
200
  $plugins = explode( ',', $plugins );
201
  foreach ( $plugins as $plugin_init ) {
202
  $to_upgrade = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_init );
plugin-fw/licence/lib/yit-plugin-licence.php CHANGED
@@ -86,7 +86,8 @@ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
86
  * @since 3.0.0
87
  */
88
  public function activate_license_notice() {
89
- if ( apply_filters( 'yith_plugin_fw_show_activate_license_notice', !isset( $_GET[ 'page' ] ) || 'yith_plugins_activation' !== $_GET[ 'page' ] ) ) {
 
90
  $products_to_activate = $this->get_to_active_products();
91
  if ( !!$products_to_activate ) {
92
  $product_names = array();
@@ -144,11 +145,11 @@ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
144
  */
145
  public function add_submenu_page() {
146
  add_submenu_page(
147
- $this->_settings['parent_page'],
148
- $this->_settings['page_title'],
149
- $this->_settings['menu_title'],
150
- $this->_settings['capability'],
151
- $this->_settings['page'],
152
  array( $this, 'show_activation_panel' )
153
  );
154
  }
@@ -157,8 +158,8 @@ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
157
  * Premium plugin registration
158
  *
159
  * @param $plugin_init | string | The plugin init file
160
- * @param $secret_key | string | The product secret key
161
- * @param $product_id | string | The plugin slug (product_id)
162
  *
163
  * @return void
164
  *
@@ -170,10 +171,10 @@ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
170
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
171
  }
172
 
173
- $plugins = get_plugins();
174
- $plugins[$plugin_init]['secret_key'] = $secret_key;
175
- $plugins[$plugin_init]['product_id'] = $product_id;
176
- $this->_products[$plugin_init] = $plugins[$plugin_init];
177
  }
178
 
179
  public function get_product_type() {
86
  * @since 3.0.0
87
  */
88
  public function activate_license_notice() {
89
+ $show_license_notice = current_user_can( 'update_plugins' ) && ( !isset( $_GET[ 'page' ] ) || 'yith_plugins_activation' !== $_GET[ 'page' ] );
90
+ if ( apply_filters( 'yith_plugin_fw_show_activate_license_notice', $show_license_notice ) ) {
91
  $products_to_activate = $this->get_to_active_products();
92
  if ( !!$products_to_activate ) {
93
  $product_names = array();
145
  */
146
  public function add_submenu_page() {
147
  add_submenu_page(
148
+ $this->_settings[ 'parent_page' ],
149
+ $this->_settings[ 'page_title' ],
150
+ $this->_settings[ 'menu_title' ],
151
+ $this->_settings[ 'capability' ],
152
+ $this->_settings[ 'page' ],
153
  array( $this, 'show_activation_panel' )
154
  );
155
  }
158
  * Premium plugin registration
159
  *
160
  * @param $plugin_init | string | The plugin init file
161
+ * @param $secret_key | string | The product secret key
162
+ * @param $product_id | string | The plugin slug (product_id)
163
  *
164
  * @return void
165
  *
171
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
172
  }
173
 
174
+ $plugins = get_plugins();
175
+ $plugins[ $plugin_init ][ 'secret_key' ] = $secret_key;
176
+ $plugins[ $plugin_init ][ 'product_id' ] = $product_id;
177
+ $this->_products[ $plugin_init ] = $plugins[ $plugin_init ];
178
  }
179
 
180
  public function get_product_type() {
plugin-fw/templates/metaboxes/types/icon-list.php CHANGED
@@ -11,7 +11,7 @@
11
  /**
12
  * Awesome Icon Admin View
13
  *
14
- * @package Yithemes
15
  * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
16
  * @since 1.0.0
17
  */
@@ -19,119 +19,119 @@
19
  extract( $args );
20
 
21
 
22
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
23
 
24
- $current_options = wp_parse_args( $args['value'], $args['std'] );
25
- $current_icon = YIT_Icon()->get_icon_data( $current_options['icon'] );
26
- $std_icon = YIT_Icon()->get_icon_data( $std['icon'] );
27
 
28
- $options['icon'] = YIT_Plugin_Common::get_icon_list();
29
 
30
  ?>
31
 
32
 
33
-
34
  <div id="<?php echo $id ?>-container" class="select_icon rm_option rm_input rm_text" <?php echo yith_field_deps_data( $args ); ?>>
35
  <div id="<?php echo $id ?>-container" <?php echo yith_field_deps_data( $args ); ?>>
36
 
37
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
38
 
39
- <div class="option">
40
- <div class="select_wrapper icon_list_type clearfix">
41
- <select name="<?php echo $name ?>[select]" id="<?php echo $id ?>[select]" <?php if ( isset( $std['select'] ) ) : ?>data-std="<?php echo $std['select']; ?>"<?php endif; ?>>
42
- <?php foreach ( $options['select'] as $val => $option ) : ?>
43
- <option value="<?php echo $val ?>" <?php selected( $current_options['select'], $val ); ?> ><?php echo $option ?></option>
44
- <?php endforeach; ?>
45
- </select>
46
- </div>
47
 
48
 
49
- <div class="icon-manager-wrapper">
50
- <div class="icon-manager-text">
51
- <div class="icon-preview" <?php echo $current_icon ?>></div>
52
- <input type="text" id="<?php echo $id ?>[icon]" class="icon-text" name="<?php echo $name ?>[icon]" value="<?php echo $current_options['icon']; ?>" />
53
- </div>
54
 
55
 
56
- <div class="icon-manager">
57
- <ul class="icon-list-wrapper">
58
- <?php foreach ( $options['icon'] as $font => $icons ):
59
- foreach ( $icons as $key => $icon ): ?>
60
- <li data-font="<?php echo $font ?>" data-icon="<?php echo ( strpos( $key , '\\') === 0 ) ? '&#x'.substr( $key , 1 ) : $key ?>" data-key="<?php echo $key ?>" data-name="<?php echo $icon ?>"></li>
61
- <?php
62
- endforeach;
63
- endforeach; ?>
64
- </ul>
 
65
  </div>
66
- </div>
67
 
68
 
69
- <div class="input_wrapper custom_icon_wrapper upload" style="clear:both;">
70
- <input type="text" name="<?php echo $name ?>[custom]" id="<?php echo $id ?>[custom]" value="<?php echo $current_options['custom'] ?>" class="yith-plugin-fw-upload-img-url upload_custom_icon" />
71
- <input type="button" value="<?php _e( 'Upload', 'yith-plugin-fw' ) ?>" id="<?php echo $id; ?>-custom-button" class="yith-plugin-fw-upload-button button" />
72
 
73
- <div class="yith-plugin-fw-upload-img-preview" style="margin-top:10px;">
74
- <?php
75
- $file = $current_options['custom'];
76
- if ( preg_match( '/(jpg|jpeg|png|gif|ico)$/', $file ) ) {
77
- echo __('Image preview', 'yith-plugin-fw') . ': ' . "<img src=\"" . YIT_CORE_ASSETS_URL . "/images/sleep.png\" data-src=\"$file\" />";
78
- }
79
- ?>
 
80
  </div>
81
- </div>
82
 
83
- </div>
84
 
85
- <div class="clear"></div>
86
 
87
 
88
- <div class="description">
89
- <?php echo $desc ?>
90
- <?php if( $std['select'] == 'custom' ) : ?>
91
- <?php printf( __( '(Default: %s <img src="%s"/>)', 'yith-plugin-fw' ), $options['select']['custom'], $std['custom'] ) ?>
92
- <?php else: ?>
93
- <?php printf( __( '(Default: <i %s></i> )', 'yith-plugin-fw' ), $std_icon ) ?>
94
- <?php endif; ?>
95
- </div>
96
 
97
- <div class="clear"></div>
98
 
 
99
  </div>
100
 
101
  <script>
102
 
103
- jQuery(document).ready( function($){
104
 
105
- $('.select_wrapper.icon_list_type').on('change', function(){
106
 
107
- var t = $(this);
108
- var parents = $('#' + t.parents('div.select_icon').attr('id'));
109
- var option = $('option:selected', this).val();
110
- var to_show = option == 'none' ? '' : option == 'icon' ? '.icon-manager-wrapper' : '.custom_icon_wrapper';
111
 
112
- parents.find('.option > div:not(.icon_list_type)').removeClass('show').addClass('hidden');
113
  parents.find( to_show ).removeClass( 'hidden' ).addClass( 'show' );
114
- });
115
 
116
- $('.select_wrapper.icon_list_type').trigger('change');
117
 
118
- var $icon_list = $('.select_icon').find('ul.icon-list-wrapper'),
119
- $preview = $('.icon-preview'),
120
- $element_list = $icon_list.find('li'),
121
- $icon_text = $('.icon-text');
122
 
123
- $element_list.on("click", function () {
124
- var $t = $(this);
125
- $element_list.removeClass('active');
126
- $t.addClass('active');
127
- $preview.attr('data-font', $t.data('font'));
128
- $preview.attr('data-icon', $t.data('icon'));
129
- $preview.attr('data-name', $t.data('name'));
130
- $preview.attr('data-key', $t.data('key'));
131
 
132
- $icon_text.val($t.data('font') + ':' + $t.data('name'));
133
 
134
- });
135
- });
136
 
137
  </script>
11
  /**
12
  * Awesome Icon Admin View
13
  *
14
+ * @package Yithemes
15
  * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
16
  * @since 1.0.0
17
  */
19
  extract( $args );
20
 
21
 
22
+ if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
23
 
24
+ $current_options = wp_parse_args( $args[ 'value' ], $args[ 'std' ] );
25
+ $current_icon = YIT_Icon()->get_icon_data( $current_options[ 'icon' ] );
26
+ $std_icon = YIT_Icon()->get_icon_data( $std[ 'icon' ] );
27
 
28
+ $options[ 'icon' ] = YIT_Plugin_Common::get_icon_list();
29
 
30
  ?>
31
 
32
 
 
33
  <div id="<?php echo $id ?>-container" class="select_icon rm_option rm_input rm_text" <?php echo yith_field_deps_data( $args ); ?>>
34
  <div id="<?php echo $id ?>-container" <?php echo yith_field_deps_data( $args ); ?>>
35
 
36
+ <label for="<?php echo $id ?>"><?php echo $label ?></label>
37
 
38
+ <div class="option">
39
+ <div class="select_wrapper icon_list_type clearfix">
40
+ <select name="<?php echo $name ?>[select]" id="<?php echo $id ?>[select]" <?php if ( isset( $std[ 'select' ] ) ) : ?>data-std="<?php echo $std[ 'select' ]; ?>"<?php endif; ?>>
41
+ <?php foreach ( $options[ 'select' ] as $val => $option ) : ?>
42
+ <option value="<?php echo $val ?>" <?php selected( $current_options[ 'select' ], $val ); ?> ><?php echo $option ?></option>
43
+ <?php endforeach; ?>
44
+ </select>
45
+ </div>
46
 
47
 
48
+ <div class="icon-manager-wrapper">
49
+ <div class="icon-manager-text">
50
+ <div class="icon-preview" <?php echo $current_icon ?>></div>
51
+ <input type="text" id="<?php echo $id ?>[icon]" class="icon-text" name="<?php echo $name ?>[icon]" value="<?php echo $current_options[ 'icon' ]; ?>"/>
52
+ </div>
53
 
54
 
55
+ <div class="icon-manager">
56
+ <ul class="icon-list-wrapper">
57
+ <?php foreach ( $options[ 'icon' ] as $font => $icons ):
58
+ foreach ( $icons as $key => $icon ): ?>
59
+ <li data-font="<?php echo $font ?>" data-icon="<?php echo ( strpos( $key, '\\' ) === 0 ) ? '&#x' . substr( $key, 1 ) : $key ?>" data-key="<?php echo $key ?>" data-name="<?php echo $icon ?>"></li>
60
+ <?php
61
+ endforeach;
62
+ endforeach; ?>
63
+ </ul>
64
+ </div>
65
  </div>
 
66
 
67
 
68
+ <div class="input_wrapper custom_icon_wrapper upload" style="clear:both;">
69
+ <input type="text" name="<?php echo $name ?>[custom]" id="<?php echo $id ?>[custom]" value="<?php echo $current_options[ 'custom' ] ?>" class="yith-plugin-fw-upload-img-url upload_custom_icon"/>
70
+ <input type="button" value="<?php _e( 'Upload', 'yith-plugin-fw' ) ?>" id="<?php echo $id; ?>-custom-button" class="yith-plugin-fw-upload-button button"/>
71
 
72
+ <div class="yith-plugin-fw-upload-img-preview" style="margin-top:10px;">
73
+ <?php
74
+ $file = $current_options[ 'custom' ];
75
+ if ( preg_match( '/(jpg|jpeg|png|gif|ico)$/', $file ) ) {
76
+ echo __( 'Image preview', 'yith-plugin-fw' ) . ': ' . "<img src=\"" . YIT_CORE_ASSETS_URL . "/images/sleep.png\" data-src=\"$file\" />";
77
+ }
78
+ ?>
79
+ </div>
80
  </div>
 
81
 
82
+ </div>
83
 
84
+ <div class="clear"></div>
85
 
86
 
87
+ <div class="description">
88
+ <?php echo $desc ?>
89
+ <?php if ( $std[ 'select' ] == 'custom' ) : ?>
90
+ <?php printf( __( '(Default: %s <img src="%s"/>)', 'yith-plugin-fw' ), $options[ 'select' ][ 'custom' ], $std[ 'custom' ] ) ?>
91
+ <?php else: ?>
92
+ <?php printf( __( '(Default: <i %s></i> )', 'yith-plugin-fw' ), $std_icon ) ?>
93
+ <?php endif; ?>
94
+ </div>
95
 
96
+ <div class="clear"></div>
97
 
98
+ </div>
99
  </div>
100
 
101
  <script>
102
 
103
+ jQuery( document ).ready( function ( $ ) {
104
 
105
+ $( '.select_wrapper.icon_list_type' ).on( 'change', function () {
106
 
107
+ var t = $( this );
108
+ var parents = $( '#' + t.parents( 'div.select_icon' ).attr( 'id' ) );
109
+ var option = $( 'option:selected', this ).val();
110
+ var to_show = option == 'none' ? '' : option == 'icon' ? '.icon-manager-wrapper' : '.custom_icon_wrapper';
111
 
112
+ parents.find( '.option > div:not(.icon_list_type)' ).removeClass( 'show' ).addClass( 'hidden' );
113
  parents.find( to_show ).removeClass( 'hidden' ).addClass( 'show' );
114
+ } );
115
 
116
+ $( '.select_wrapper.icon_list_type' ).trigger( 'change' );
117
 
118
+ var $icon_list = $( '.select_icon' ).find( 'ul.icon-list-wrapper' ),
119
+ $preview = $( '.icon-preview' ),
120
+ $element_list = $icon_list.find( 'li' ),
121
+ $icon_text = $( '.icon-text' );
122
 
123
+ $element_list.on( "click", function () {
124
+ var $t = $( this );
125
+ $element_list.removeClass( 'active' );
126
+ $t.addClass( 'active' );
127
+ $preview.attr( 'data-font', $t.data( 'font' ) );
128
+ $preview.attr( 'data-icon', $t.data( 'icon' ) );
129
+ $preview.attr( 'data-name', $t.data( 'name' ) );
130
+ $preview.attr( 'data-key', $t.data( 'key' ) );
131
 
132
+ $icon_text.val( $t.data( 'font' ) + ':' + $t.data( 'name' ) );
133
 
134
+ } );
135
+ } );
136
 
137
  </script>