YITH Essential Kit for WooCommerce #1 - Version 2.0.4

Version Description

  • Update: YITH Plugin Framework
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH Essential Kit for WooCommerce #1
Version 2.0.4
Comparing to
See all releases

Code changes from version 2.0.3 to 2.0.4

README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: woocommerce,yith woocommerce colors and labels variations,yith woocommerce zoom magnifier,yith woocommerce wishlist,yith woocommerce ajax product filter,yith woocommerce ajax search,yith woocommerce catalog mode,yith woocommerce advanced reviews, yith woocommerce badges management,yith woocommerce cart messages,yith woocommerce review reminder,yith woocommerce quick view,yith woocommerce mailchimp,yith woocommerce stripe,yith woocommerce request a quote,yith woocommerce tab manager,yith woocommerce multi vendor
5
  Requires at least: 3.5.1
6
  Tested up to: 5.1
7
- Stable tag: 2.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -151,6 +151,10 @@ YITH Essential Kit for WooCommerce #1 will add a new submenu called "YITH Essent
151
 
152
  == Changelog ==
153
 
 
 
 
 
154
  = 2.0.3 =
155
  * Update: YITH Plugin Framework
156
  * Update: Removed YITH EU Vat module (no longer supported, it still works if you have it installed)
4
  Tags: woocommerce,yith woocommerce colors and labels variations,yith woocommerce zoom magnifier,yith woocommerce wishlist,yith woocommerce ajax product filter,yith woocommerce ajax search,yith woocommerce catalog mode,yith woocommerce advanced reviews, yith woocommerce badges management,yith woocommerce cart messages,yith woocommerce review reminder,yith woocommerce quick view,yith woocommerce mailchimp,yith woocommerce stripe,yith woocommerce request a quote,yith woocommerce tab manager,yith woocommerce multi vendor
5
  Requires at least: 3.5.1
6
  Tested up to: 5.1
7
+ Stable tag: 2.0.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
151
 
152
  == Changelog ==
153
 
154
+ = 2.0.4 =
155
+
156
+ * Update: YITH Plugin Framework
157
+
158
  = 2.0.3 =
159
  * Update: YITH Plugin Framework
160
  * Update: Removed YITH EU Vat module (no longer supported, it still works if you have it installed)
init.php CHANGED
@@ -7,12 +7,12 @@
7
  * Domain Path: /languages/
8
  * Author: YITH
9
  * Author URI: https://yithemes.com/
10
- * Version: 2.0.3
11
  * WC requires at least: 2.5.0
12
  * WC tested up to: 3.5
13
  * @author YITHEMES
14
  * @package YITH Essential Kit for Woocommerce #1
15
- * @version 2.0.3
16
  */
17
 
18
  if ( ! defined( 'ABSPATH' ) ) {
7
  * Domain Path: /languages/
8
  * Author: YITH
9
  * Author URI: https://yithemes.com/
10
+ * Version: 2.0.4
11
  * WC requires at least: 2.5.0
12
  * WC tested up to: 3.5
13
  * @author YITHEMES
14
  * @package YITH Essential Kit for Woocommerce #1
15
+ * @version 2.0.4
16
  */
17
 
18
  if ( ! defined( 'ABSPATH' ) ) {
plugin-fw/assets/css/admin.css CHANGED
@@ -53,6 +53,27 @@
53
  display: block;
54
  }
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  /*-----------------------
57
  YITH Plugins Columns
58
  ------------------------*/
53
  display: block;
54
  }
55
 
56
+ /*-----------------------
57
+ YITH FEEDS
58
+ ------------------------*/
59
+
60
+ .yith-feeds-logo{
61
+ display: table-cell;
62
+ background: #005b7c;
63
+ padding: 5px;
64
+ border-radius: 50%;
65
+ margin-right: 10px;
66
+ vertical-align: text-bottom;
67
+ width: 18px;
68
+ height: auto;
69
+ vertical-align: middle;
70
+ }
71
+
72
+ .yith-feeds-plugin-name{
73
+ display: table-cell;
74
+ vertical-align: middle;
75
+ }
76
+
77
  /*-----------------------
78
  YITH Plugins Columns
79
  ------------------------*/
plugin-fw/assets/css/yit-upgrader.css CHANGED
@@ -15,4 +15,8 @@
15
  overflow-y : auto;
16
  z-index : 999;
17
  background: #fcfcfc;
 
 
 
 
18
  }
15
  overflow-y : auto;
16
  z-index : 999;
17
  background: #fcfcfc;
18
+ }
19
+
20
+ .yith-updating:before{
21
+ animation: rotation 2s infinite linear;
22
  }
plugin-fw/assets/js/multisite-updater.js CHANGED
@@ -74,7 +74,7 @@
74
  }
75
 
76
  if( version_compare( plugin[ headers ].Version, plugin[ headers ].Latest, '>' ) ){
77
- html = html + localize.strings.version_issue
78
  }
79
 
80
  html = html +
74
  }
75
 
76
  if( version_compare( plugin[ headers ].Version, plugin[ headers ].Latest, '>' ) ){
77
+ html = html + localize.strings.version_issue.replace( '%plugin_name%', name )
78
  }
79
 
80
  html = html +
plugin-fw/assets/js/multisite-updater.min.js CHANGED
@@ -1,4 +1 @@
1
- (function(f){function n(c,d,f){this.php_js=this.php_js||{};this.php_js.ENV=this.php_js.ENV||{};var a=0,h=0,b=0,e={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1};a=function(a){a=(""+a).replace(/[_\-+]/g,".");a=a.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,".");return a.length?a.split("."):[-8]};numVersion=function(a){return a?isNaN(a)?e[a]||-7:parseInt(a,10):0};c=a(c);d=a(d);h=Math.max(c.length,d.length);for(a=0;a<h;a++)if(c[a]!=d[a])if(c[a]=numVersion(c[a]),d[a]=numVersion(d[a]),
2
- c[a]<d[a]){b=-1;break}else if(c[a]>d[a]){b=1;break}if(!f)return b;switch(f){case ">":case "gt":return 0<b;case ">=":case "ge":return 0<=b;case "<=":case "le":return 0>=b;case "==":case "=":case "eq":return 0===b;case "<>":case "!=":case "ne":return 0!==b;case "":case "<":case "lt":return 0>b;default:return null}}var l=f("#menu-plugins"),g=l.find(".update-plugins").find(".update-count").text(),p=plugins.registered,q=plugins.activated;if(0==g||""==g)g=0,l.find(".wp-menu-name").append('<span class="update-plugins"><span class="plugin-count"></span></span>');
3
- (function(c,d,g,a){for(var h in c){var b=c[h],e;for(e in b)if("slug"!=e&&!n(b[e].Version,b[e].Latest,"=")){g=parseInt(g)+1;f(".plugin-count").empty().html(g);var m=""+b[e].Name,l='*[data-slug="'+m.replace(RegExp(" ","g"),"-").trim().toLowerCase()+'"]';f(l).addClass("update");var k='<tr class="plugin-update-tr"><td colspan="3" class="plugin-update colspanchange"><div class="update-message notice inline notice-warning notice-alt">'+a.strings.new_version.replace("%plugin_name%",m)+'<a class="thickbox open-plugin-details-modal" href="'+
4
- a.details_url[h]+'">'+a.strings.latest.replace("%latest%",b[e].Latest)+"</a>";k="undefined"==typeof d[h]?k+" <em>"+a.strings.unavailable+"</em>"+a.strings.activate.replace("%activate_link%",a.licence_activation_url).replace("%plugin_name%",m):k+'. <a href="'+a.update_url[h]+'">'+a.strings.update_now+"</a>";n(b[e].Version,b[e].Latest,">")&&(k+=a.strings.version_issue);k+="</div></td></tr>";f(k).insertAfter(l)}}})(p,q,g,plugins);f("body").on("click",".yit-changelog-button",function(){f("#TB_window").remove()})})(jQuery);
1
+ !function(e){var a=e("#menu-plugins"),n=a.find(".update-plugins").find(".update-count").text(),t=plugins.registered,s=plugins.activated;if(0==n||""==n){n=0,a.find(".wp-menu-name").append('<span class="update-plugins"><span class="plugin-count"></span></span>')}function i(e,a,n){this.php_js=this.php_js||{},this.php_js.ENV=this.php_js.ENV||{};var t,s=0,i=0,r={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},l=function(e){return(e=(e=(""+e).replace(/[_\-+]/g,".")).replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,".")).length?e.split("."):[-8]};for(numVersion=function(e){return e?isNaN(e)?r[e]||-7:parseInt(e,10):0},e=l(e),a=l(a),t=Math.max(e.length,a.length),s=0;s<t;s++)if(e[s]!=a[s]){if(e[s]=numVersion(e[s]),a[s]=numVersion(a[s]),e[s]<a[s]){i=-1;break}if(e[s]>a[s]){i=1;break}}if(!n)return i;switch(n){case">":case"gt":return i>0;case">=":case"ge":return i>=0;case"<=":case"le":return i<=0;case"==":case"=":case"eq":return 0===i;case"<>":case"!=":case"ne":return 0!==i;case"":case"<":case"lt":return i<0;default:return null}}!function(a,n,t,s){for(var r in a){var l=a[r];for(var p in l)if("slug"!=p&&!i(l[p].Version,l[p].Latest,"=")){t=parseInt(t)+1,e(".plugin-count").empty().html(t);var u=new RegExp(" ","g"),c=l[p],g=""+c.Name,o=g.replace(u,"-").trim(),d='*[data-slug="'+o.toLowerCase()+'"]';e(d).addClass("update");var f='<tr class="plugin-update-tr"><td colspan="3" class="plugin-update colspanchange"><div class="update-message notice inline notice-warning notice-alt">'+s.strings.new_version.replace("%plugin_name%",g)+'<a class="thickbox open-plugin-details-modal" href="'+s.details_url[r]+'">'+s.strings.latest.replace("%latest%",l[p].Latest)+"</a>";f=void 0===n[r]?f+" <em>"+s.strings.unavailable+"</em>"+s.strings.activate.replace("%activate_link%",s.licence_activation_url).replace("%plugin_name%",g):f+'. <a href="'+s.update_url[r]+'">'+s.strings.update_now+"</a>",i(l[p].Version,l[p].Latest,">")&&(f+=s.strings.version_issue.replace("%plugin_name%",g)),e(f+="</div></td></tr>").insertAfter(d)}}}(t,s,n,plugins),e("body").on("click",".yit-changelog-button",function(){e("#TB_window").remove()})}(jQuery);
 
 
 
plugin-fw/assets/js/yith-dashboard.js ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+ // bind a button or a link to open the dialog
3
+ $('.yith-last-changelog').click(function(e) {
4
+ e.preventDefault();
5
+ var inlineId = $( this ).data( 'changelogid' ),
6
+ inlineModal = $('#' + inlineId),
7
+ plugininfo = $( this ).data( 'plugininfo' ),
8
+ b = {},
9
+ close_function = function() { $( this ).dialog( "close" ); };
10
+
11
+ b[yith_dashboard.buttons.close] = close_function;
12
+
13
+ // initalise the dialog
14
+ inlineModal.dialog({
15
+ title: plugininfo,
16
+ dialogClass: 'wp-dialog',
17
+ autoOpen: false,
18
+ draggable: false,
19
+ width: 'auto',
20
+ modal: true,
21
+ resizable: false,
22
+ closeOnEscape: true,
23
+ position: {
24
+ my: "center",
25
+ at: "center",
26
+ of: window
27
+ },
28
+ buttons: b,
29
+ show: {
30
+ effect: "blind",
31
+ duration: 1000
32
+ },
33
+ open: function () {
34
+ // close dialog by clicking the overlay behind it
35
+ $('.ui-widget-overlay').bind('click', function(){
36
+ inlineModal.dialog('close');
37
+ })
38
+ },
39
+ create: function () {
40
+ // style fix for WordPress admin
41
+ $('.ui-dialog-titlebar-close').addClass('ui-button');
42
+ },
43
+ });
44
+
45
+ inlineModal.dialog('open');
46
+ });
47
+ })(jQuery);
plugin-fw/assets/js/yith-dashboard.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ (function(a){a(".yith-last-changelog").click(function(b){b.preventDefault();b=a(this).data("changelogid");var c=a("#"+b);b=a(this).data("plugininfo");var d={};d[yith_dashboard.buttons.close]=function(){a(this).dialog("close")};c.dialog({title:b,dialogClass:"wp-dialog",autoOpen:!1,draggable:!1,width:"auto",modal:!0,resizable:!1,closeOnEscape:!0,position:{my:"center",at:"center",of:window},buttons:d,show:{effect:"blind",duration:1E3},open:function(){a(".ui-widget-overlay").bind("click",function(){c.dialog("close")})},
2
+ create:function(){a(".ui-dialog-titlebar-close").addClass("ui-button")}});c.dialog("open")})})(jQuery);
plugin-fw/assets/js/yith-update-plugins.js ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * This file belongs to the YIT Framework.
3
+ *
4
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
+ * that is bundled with this package in the file LICENSE.txt.
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.gnu.org/licenses/gpl-3.0.txt
8
+ */
9
+ (function ( $ ) {
10
+ $(document).on( 'click', 'a.yith-update-link', function(event){
11
+ var t = $(this),
12
+ p_wrapper = t.parent('p');
13
+
14
+ event.preventDefault();
15
+ $.ajax({
16
+ type: 'POST',
17
+ url: yith_plugin_fw.ajaxurl,
18
+ data: {
19
+ 'action': "update-plugin",
20
+ 'plugin': t.data('plugin'),
21
+ 'slug': t.data('slug'),
22
+ 'name': t.data('name'),
23
+ '_ajax_nonce': yith_plugin_fw.ajax_nonce
24
+ },
25
+ beforeSend: function(){
26
+ p_wrapper.text( yith_plugin_fw.l10n.updating.replace( '%s', t.data('name') ) );
27
+ p_wrapper.addClass( 'yith-updating' );
28
+ },
29
+ success: function (response) {
30
+ p_wrapper.removeClass( 'yith-updating' ).addClass( 'yith-updated' );
31
+ var notice_wrapper = p_wrapper.parent('div');
32
+ notice_wrapper.removeClass( 'notice-warning' ),
33
+ result_text = '';
34
+
35
+ if( response.success === true ){
36
+ notice_wrapper.addClass('notice-success updated-message').removeClass( 'update-message' );
37
+ result_text = yith_plugin_fw.l10n.updated;
38
+ }
39
+
40
+ else {
41
+ notice_wrapper.addClass('notice-error');
42
+ result_text = yith_plugin_fw.l10n.failed;
43
+ }
44
+
45
+ p_wrapper.text( result_text.replace( '%s', t.data('name') ) );
46
+ }
47
+ });
48
+ });
49
+ })( jQuery );
plugin-fw/assets/js/yith-update-plugins.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ (function(b){b(document).on("click","a.yith-update-link",function(e){var a=b(this),c=a.parent("p");e.preventDefault();b.ajax({type:"POST",url:yith_plugin_fw.ajaxurl,data:{action:"update-plugin",plugin:a.data("plugin"),slug:a.data("slug"),name:a.data("name"),_ajax_nonce:yith_plugin_fw.ajax_nonce},beforeSend:function(){c.text(yith_plugin_fw.l10n.updating.replace("%s",a.data("name")));c.addClass("yith-updating")},success:function(b){c.removeClass("yith-updating").addClass("yith-updated");var d=c.parent("div");
2
+ d.removeClass("notice-warning");result_text="";!0===b.success?(d.addClass("notice-success updated-message").removeClass("update-message"),result_text=yith_plugin_fw.l10n.updated):(d.addClass("notice-error"),result_text=yith_plugin_fw.l10n.failed);c.text(result_text.replace("%s",a.data("name")))}})})})(jQuery);
plugin-fw/init.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 3.1.20
5
  * Author: YITHEMES
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
- * @version 3.1.20
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
+ * Version: 3.1.29
5
  * Author: YITHEMES
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
+ * @version 3.1.26
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
plugin-fw/lib/promo/yith-promo.php DELETED
@@ -1,188 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if( ! function_exists( 'simplexml_load_string' ) ){
12
- return false;
13
- }
14
-
15
- add_action( 'admin_notices', 'yith_plugin_fw_promo_notices', 15 );
16
- add_action( 'admin_enqueue_scripts', 'yith_plugin_fw_notice_dismiss', 20 );
17
-
18
- if( ! function_exists( 'yith_plugin_fw_promo_notices' ) ){
19
- function yith_plugin_fw_promo_notices(){
20
- $base_url = apply_filters( 'yith_plugin_fw_promo_base_url', 'https://update.yithemes.com/promo/hotlink-ok/' );
21
- $xml = apply_filters( 'yith_plugin_fw_promo_xml_url', $base_url . 'yith-promo.xml' );
22
- $transient = "yith_promo_message";
23
- $remote_data = get_site_transient( $transient );
24
- $regenerate_promo_transient = isset( $_GET['yith_regenerate_promo_transient'] ) && 'yes' == $_GET['yith_regenerate_promo_transient'] ? $_GET['yith_regenerate_promo_transient'] : '';
25
- $promo_data = false;
26
- $create_transient = false;
27
-
28
- if( false === $remote_data || apply_filters( 'yith_plugin_fw_force_regenerate_promo_transient', false ) || 'yes' == $regenerate_promo_transient ){
29
- $remote_data = wp_remote_get( $xml );
30
- $create_transient = true;
31
- }
32
-
33
- if ( ! is_wp_error( $remote_data ) && isset( $remote_data['response']['code'] ) && '200' == $remote_data['response']['code'] ) {
34
- $promo_data = @simplexml_load_string( $remote_data['body'] );
35
-
36
- if( true === $create_transient ){
37
- $is_membership_user = false;
38
- $license = YIT_Plugin_Licence()->get_licence();
39
- $xml_expiry_date = '';
40
-
41
- if( is_array( $license ) && apply_filters( 'yith_plugin_fw_check_for_membership_user', true ) ){
42
- /* === Check is the user have the YITH Club === */
43
- foreach( $license as $plugin => $data ){
44
- if( ! empty( $data['is_membership'] ) ){
45
- $is_membership_user = true;
46
- $xml_expiry_date = $data['licence_expires'];
47
- $remote_data = $promo_data = array();
48
- break;
49
- }
50
- }
51
- }
52
-
53
- if( empty( $is_membership_user ) && ! empty( $promo_data->expiry_date ) ){
54
- $xml_expiry_date = $promo_data->expiry_date;
55
- }
56
-
57
- //Set Site Transient
58
- set_site_transient( $transient, $remote_data, yith_plugin_fw_get_promo_transient_expiry_date( $xml_expiry_date ) );
59
- }
60
-
61
- if ( $promo_data && ! empty( $promo_data->promo ) ) {
62
- $now = strtotime( current_time( 'mysql' ) );
63
-
64
- foreach ($promo_data->promo as $promo ){
65
- $show_promo = true;
66
- /* === Check for Special Promo === */
67
- if ( ! empty( $promo->show_promo_in ) ) {
68
- $show_promo_in = explode( ',', $promo->show_promo_in );
69
- $show_promo_in = array_map( 'trim', $show_promo_in );
70
- if ( ! empty( $show_promo_in ) ) {
71
- $show_promo = false;
72
- foreach ( $show_promo_in as $plugin ) {
73
- if ( defined( $plugin ) ) {
74
- $plugin_slug = constant( $plugin );
75
- $plugin_is_activated = ! empty( $license[ $plugin_slug ]['activated'] );
76
- if ( defined( $plugin ) && ! apply_filters( 'yith_plugin_fw_promo_plugin_is_activated', $plugin_is_activated ) ) {
77
- $show_promo = true;
78
- break;
79
- }
80
- }
81
- }
82
- }
83
- }
84
-
85
- $start_date = isset( $promo->start_date ) ? $promo->start_date : '';
86
- $end_date = isset( $promo->end_date ) ? $promo->end_date : '';
87
-
88
- if( $show_promo && ! empty( $start_date ) && ! empty( $end_date ) ){
89
- $start_date = strtotime( $start_date );
90
- $end_date = strtotime( $end_date );
91
-
92
- if( $end_date >= $start_date && $now >= $start_date && $now <= $end_date ){
93
- //is valid promo
94
- $title = isset( $promo->title ) ? $promo->title : '';
95
- $description = isset( $promo->description ) ? $promo->description : '';
96
- $url = isset( $promo->link->url ) ? $promo->link->url : '';
97
- $url_label = isset( $promo->link->label ) ? $promo->link->label : '';
98
- $image_bg_color = isset( $promo->style->image_bg_color ) ? $promo->style->image_bg_color : '';
99
- $border_color = isset( $promo->style->border_color ) ? $promo->style->border_color : '';
100
- $background_color = isset( $promo->style->background_color ) ? $promo->style->background_color : '';
101
- $promo_id = isset( $promo->promo_id ) ? $promo->promo_id : '';
102
- $banner = isset( $promo->banner ) ? $promo->banner : '';
103
- $style = $link = '';
104
- $show_notice = false;
105
-
106
- if( ! empty( $border_color ) ){
107
- $style .= "border-left-color: {$border_color};";
108
- }
109
-
110
- if( ! empty( $background_color ) ){
111
- $style .= "background-color: {$background_color};";
112
- }
113
-
114
- if( ! empty( $image_bg_color ) ){
115
- $image_bg_color = "background-color: {$image_bg_color};";
116
- }
117
-
118
- if( ! empty( $title ) ) {
119
- $promo_id .= $title;
120
- $title = sprintf( '%s: ', $title );
121
- $show_notice = true;
122
- }
123
-
124
- if( ! empty( $description ) ) {
125
- $promo_id .= $description;
126
- $description = sprintf( '%s', $description );
127
- $show_notice = true;
128
- }
129
-
130
- if( ! empty( $url ) && ! empty( $url_label )) {
131
- $promo_id .= $url . $url_label;
132
- $link = sprintf( '<a href="%s" target="_blank">%s</a>', $url, $url_label );
133
- $show_notice = true;
134
- }
135
-
136
- if( ! empty( $banner ) ){
137
- $banner = sprintf( '<img src="%s" class="yith-promo-banner-image">', $base_url . $banner );
138
-
139
- if( ! empty( $url ) ){
140
- $banner = sprintf( '<a class="yith-promo-banner-image-link" href="%s" target="_blank" style="%s">%s</a>', $url, $image_bg_color, $banner);
141
- }
142
- }
143
-
144
- $unique_promo_id = "yith-notice-" . md5 ( $promo_id );
145
-
146
- if( ! empty( $_COOKIE[ 'hide_' . $unique_promo_id ] ) && 'yes' == $_COOKIE[ 'hide_' . $unique_promo_id ] ){
147
- $show_notice = false;
148
- }
149
-
150
- if ( true === $show_notice ) :
151
- wp_enqueue_script( 'yith-promo' );
152
- ?>
153
- <div id="<?php echo $unique_promo_id; ?>" class="yith-notice-is-dismissible notice notice-yith notice-alt is-dismissible" style="<?php echo $style; ?>" data-expiry= <?php echo $promo->end_date; ?>>
154
- <p>
155
- <?php if( ! empty( $banner ) ) { printf( '%s', $banner ); } ?>
156
- <?php printf( "%s %s %s", $title, $description, $link ); ?>
157
- </p>
158
- </div>
159
- <?php endif;
160
- }
161
- }
162
- }
163
- }
164
- }
165
- }
166
- }
167
-
168
- if( ! function_exists( 'yith_plugin_fw_notice_dismiss' ) ){
169
- function yith_plugin_fw_notice_dismiss(){
170
- $script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
171
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
172
- wp_register_script( 'yith-promo', $script_path . '/assets/js/yith-promo' . $suffix . '.js', array( 'jquery' ), '1.0.0', true );
173
- }
174
- }
175
-
176
- if( ! function_exists( 'yith_plugin_fw_get_promo_transient_expiry_date' ) ){
177
- function yith_plugin_fw_get_promo_transient_expiry_date( $expiry_date ) {
178
- $xml_expiry_date = ! empty( $expiry_date ) ? $expiry_date : '+24 hours';
179
- $current = strtotime( current_time( 'Y-m-d H:i:s' ) );
180
- $expiry_date = strtotime( $xml_expiry_date, $current );
181
-
182
- if( $expiry_date <= $current ){
183
- $expiry_date = strtotime( '+24 hours', $current );
184
- }
185
-
186
- return $expiry_date;
187
- }
188
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/lib/yit-upgrade.php CHANGED
@@ -140,7 +140,7 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
140
 
141
  $error = false;
142
  if ( ! is_wp_error( $remote_xml ) && isset( $remote_xml['response']['code'] ) && '200' == $remote_xml['response']['code'] ) {
143
- $plugin_remote_info = @simplexml_load_string( $remote_xml['body'] );
144
  if ( $plugin_remote_info ) {
145
  $info['Latest'] = (string) $plugin_remote_info->latest;
146
  $info['changelog'] = (string) $plugin_remote_info->changelog;
@@ -198,7 +198,7 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
198
  'unavailable' => __( 'Automatic update is unavailable for this plugin,', 'yith-plugin-fw' ),
199
  'activate' => __( 'please <a href="%activate_link%">activate</a> your copy of %plugin_name%.', 'yith-plugin-fw' ),
200
  'update_now' => __( 'Update now.', 'yith-plugin-fw' ),
201
- 'version_issue' => __( '<br/><b>Please note:</b> You are using a higher version than the latest available one. </em>Please, make sure you\'ve downloaded the latest version of <em>%1$s</em> from the only <a href="https://yithemes.com" target="_blank">YITH official website</a>, specifically, from your <a href="https://yithemes.com/my-account/recent-downloads/" target="_blank">Downloads page</a>. This is the only way to be sure the version you are using is 100% malware-free.', 'yith-plugin-fw' ),
202
  );
203
 
204
  foreach ( $this->_plugins as $init => $info ) {
@@ -214,7 +214,7 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
214
  'details_url' => $details_url,
215
  'strings' => $strings,
216
  );
217
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
218
 
219
  if( defined( 'YIT_CORE_PLUGIN_URL' ) ){
220
  yit_enqueue_script( 'yit-multisite-updater', YIT_CORE_PLUGIN_URL . '/assets/js/multisite-updater' . $suffix . '.js', array( 'jquery' ), false, true );
@@ -226,7 +226,24 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
226
  public function admin_enqueue_scripts() {
227
  global $pagenow;
228
  if ( 'plugins.php' === $pagenow && defined( 'YIT_CORE_PLUGIN_URL' ) ) {
 
229
  wp_enqueue_style( 'yit-upgrader', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrader.css' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  }
231
  }
232
 
@@ -454,7 +471,7 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
454
 
455
  if ( ! is_wp_error( $remote_xml ) && isset( $remote_xml['response']['code'] ) && '200' == $remote_xml['response']['code'] ) {
456
 
457
- $plugin_remote_info = @simplexml_load_string( $remote_xml['body'] );
458
 
459
  if ( $plugin_remote_info ) {
460
  $wrong_current_version_check = version_compare( $plugin['info']['Version'], $plugin_remote_info->latest, '>' );
@@ -514,8 +531,10 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
514
  */
515
  public function plugin_update_row() {
516
 
517
- $current = get_site_transient( 'update_plugins' );
518
- $init = str_replace( 'after_plugin_row_', '', current_filter() );
 
 
519
 
520
  if ( ! isset( $current->response[ $init ] ) ) {
521
  return false;
@@ -537,7 +556,7 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
537
  global $wp_version;
538
  $is_wp_4_6 = version_compare( $wp_version, '4.6', '>=' );
539
 
540
- echo '<tr class="plugin-update-tr active' . ( is_plugin_active( $init ) ? ' active' : '' ) . '"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">';
541
 
542
  echo '<div class="update-message' . ( $is_wp_4_6 ? ' notice inline notice-warning notice-alt' : '' ) . '">';
543
 
@@ -556,7 +575,7 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
556
  }
557
 
558
  else {
559
- printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button open-plugin-details-modal" title="%3$s">View version %4$s details</a> or <a href="%5$s">update now</a>.', 'yith-plugin-fw' ), $this->_plugins[ $init ]['info']['Name'], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ]['info']['Name'] ), $r->new_version, wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $init, 'upgrade-plugin_' . $init ) );
560
  }
561
 
562
  if( version_compare( $this->_plugins[ $init ]['info']['Version'] , $r->new_version, '>' ) ){
140
 
141
  $error = false;
142
  if ( ! is_wp_error( $remote_xml ) && isset( $remote_xml['response']['code'] ) && '200' == $remote_xml['response']['code'] ) {
143
+ $plugin_remote_info = function_exists( 'simplexml_load_string' ) ? @simplexml_load_string( $remote_xml['body'] ) : false;
144
  if ( $plugin_remote_info ) {
145
  $info['Latest'] = (string) $plugin_remote_info->latest;
146
  $info['changelog'] = (string) $plugin_remote_info->changelog;
198
  'unavailable' => __( 'Automatic update is unavailable for this plugin,', 'yith-plugin-fw' ),
199
  'activate' => __( 'please <a href="%activate_link%">activate</a> your copy of %plugin_name%.', 'yith-plugin-fw' ),
200
  'update_now' => __( 'Update now.', 'yith-plugin-fw' ),
201
+ 'version_issue' => __( '<br/><b>Please note:</b> You are using a higher version than the latest available one. </em>Please, make sure you\'ve downloaded the latest version of <em>%plugin_name%</em> from the only <a href="https://yithemes.com" target="_blank">YITH official website</a>, specifically, from your <a href="https://yithemes.com/my-account/recent-downloads/" target="_blank">Downloads page</a>. This is the only way to be sure the version you are using is 100% malware-free.', 'yith-plugin-fw' ),
202
  );
203
 
204
  foreach ( $this->_plugins as $init => $info ) {
214
  'details_url' => $details_url,
215
  'strings' => $strings,
216
  );
217
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
218
 
219
  if( defined( 'YIT_CORE_PLUGIN_URL' ) ){
220
  yit_enqueue_script( 'yit-multisite-updater', YIT_CORE_PLUGIN_URL . '/assets/js/multisite-updater' . $suffix . '.js', array( 'jquery' ), false, true );
226
  public function admin_enqueue_scripts() {
227
  global $pagenow;
228
  if ( 'plugins.php' === $pagenow && defined( 'YIT_CORE_PLUGIN_URL' ) ) {
229
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
230
  wp_enqueue_style( 'yit-upgrader', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrader.css' );
231
+ wp_enqueue_script( 'yith-update-plugins', YIT_CORE_PLUGIN_URL . '/assets/js/yith-update-plugins' . $suffix . '.js', array( 'jquery' ), false, true );
232
+
233
+ $update_plugins_localized = array(
234
+ 'ajax_nonce' => wp_create_nonce( 'updates' ),
235
+ 'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ),
236
+ 'l10n' => array(
237
+ /* translators: %s: Plugin name and version */
238
+ 'updating' => _x( 'Updating %s...', 'plugin-fw', 'yith-plugin-fw' ), // No ellipsis.
239
+ /* translators: %s: Plugin name and version */
240
+ 'updated' => _x( '%s updated!', 'plugin-fw', 'yith-plugin-fw' ),
241
+ /* translators: %s: Plugin name and version */
242
+ 'failed' => _x( '%s update failed', 'plugin-fw', 'yith-plugin-fw' ),
243
+ ),
244
+ );
245
+
246
+ wp_localize_script( 'yith-update-plugins', 'yith_plugin_fw', $update_plugins_localized );
247
  }
248
  }
249
 
471
 
472
  if ( ! is_wp_error( $remote_xml ) && isset( $remote_xml['response']['code'] ) && '200' == $remote_xml['response']['code'] ) {
473
 
474
+ $plugin_remote_info = function_exists( 'simplexml_load_string' ) ? @simplexml_load_string( $remote_xml['body'] ) : false;
475
 
476
  if ( $plugin_remote_info ) {
477
  $wrong_current_version_check = version_compare( $plugin['info']['Version'], $plugin_remote_info->latest, '>' );
531
  */
532
  public function plugin_update_row() {
533
 
534
+ $current = get_site_transient( 'update_plugins' );
535
+ $init = str_replace( 'after_plugin_row_', '', current_filter() );
536
+ $update_now_class = apply_filters( 'yith_plugin_fw_update_now_class', '' );
537
+ $update_now_class = trim( $update_now_class . ' yith-update-link update-link' );
538
 
539
  if ( ! isset( $current->response[ $init ] ) ) {
540
  return false;
556
  global $wp_version;
557
  $is_wp_4_6 = version_compare( $wp_version, '4.6', '>=' );
558
 
559
+ echo '<tr class="plugin-update-tr' . ( is_plugin_active( $init ) ? ' active' : '' ) . '"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">';
560
 
561
  echo '<div class="update-message' . ( $is_wp_4_6 ? ' notice inline notice-warning notice-alt' : '' ) . '">';
562
 
575
  }
576
 
577
  else {
578
+ printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button open-plugin-details-modal" title="%3$s">View version %4$s details</a> or <a href="%5$s" class="%6$s" data-plugin="%7$s" data-slug="%8$s" data-name="%1$s">update now</a>.', 'yith-plugin-fw' ), $this->_plugins[ $init ]['info']['Name'], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ]['info']['Name'] ), $r->new_version, wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $init, 'upgrade-plugin_' . $init ), $update_now_class, $init, $this->_plugins[ $init ]['slug'] );
579
  }
580
 
581
  if( version_compare( $this->_plugins[ $init ]['info']['Version'] , $r->new_version, '>' ) ){
plugin-fw/lib/yith-dashboard.php CHANGED
@@ -26,7 +26,7 @@ if( ! class_exists( 'YITH_Dashboard' ) ){
26
  * @access protected
27
  * @since 1.0.0
28
  */
29
- static protected $_products_feed = 'https://yithemes.com/feed/?post_type=product';
30
  static protected $_blog_feed = 'https://yithemes.com/feed/';
31
 
32
  /**
@@ -37,8 +37,8 @@ if( ! class_exists( 'YITH_Dashboard' ) ){
37
  * @access public
38
  */
39
  public static function dashboard_widget_setup() {
40
- wp_add_dashboard_widget( 'yith_dashboard_products_news', __( 'New YITH products' , 'yith-plugin-fw' ), 'YITH_Dashboard::dashboard_products_news' );
41
- wp_add_dashboard_widget( 'yith_dashboard_blog_news', __( 'News from the YITH Blog' , 'yith-plugin-fw' ), 'YITH_Dashboard::dashboard_blog_news' );
42
  }
43
 
44
 
@@ -50,10 +50,67 @@ if( ! class_exists( 'YITH_Dashboard' ) ){
50
  * @access public
51
  */
52
  public static function dashboard_products_news() {
53
- $args = array( 'show_author' => 0, 'show_date' => 1, 'show_summary' => 1, 'items'=> 3 );
54
- wp_widget_rss_output( static::$_products_feed, $args );
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
 
 
 
 
57
 
58
  /**
59
  * Blog news Widget
@@ -64,11 +121,36 @@ if( ! class_exists( 'YITH_Dashboard' ) ){
64
  */
65
  public static function dashboard_blog_news() {
66
  $args = array( 'show_author' => 0, 'show_date' => 1, 'show_summary' => 1, 'items'=> 3 );
67
- wp_widget_rss_output( static::$_blog_feed, $args );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  }
69
  }
 
70
  if( apply_filters( 'yith_plugin_fw_show_dashboard_widgets', true ) ){
71
  add_action( 'wp_dashboard_setup', 'YITH_Dashboard::dashboard_widget_setup' );
 
72
  }
73
  }
74
 
26
  * @access protected
27
  * @since 1.0.0
28
  */
29
+ static protected $_products_feed = 'https://yithemes.com/latest-updates/feeds/';
30
  static protected $_blog_feed = 'https://yithemes.com/feed/';
31
 
32
  /**
37
  * @access public
38
  */
39
  public static function dashboard_widget_setup() {
40
+ wp_add_dashboard_widget( 'yith_dashboard_products_news', __( 'YITH Latest Updates' , 'yith-plugin-fw' ), 'YITH_Dashboard::dashboard_products_news' );
41
+ wp_add_dashboard_widget( 'yith_dashboard_blog_news', __( 'Latest news from YITH Blog' , 'yith-plugin-fw' ), 'YITH_Dashboard::dashboard_blog_news' );
42
  }
43
 
44
 
50
  * @access public
51
  */
52
  public static function dashboard_products_news() {
53
+ $items = 10;
54
+ $rss = static::$_products_feed;
55
+ if ( is_string( $rss ) ) {
56
+ $rss = fetch_feed( $rss );
57
+ } elseif ( is_array( $rss ) && isset( $rss['url'] ) ) {
58
+ $rss = fetch_feed( $rss['url'] );
59
+ } elseif ( ! is_object( $rss ) ) {
60
+ return;
61
+ }
62
+
63
+ if ( is_wp_error( $rss ) ) {
64
+ if ( is_admin() || current_user_can( 'manage_options' ) ) {
65
+ echo '<p><strong>' . __( 'RSS Error:', 'yith-plugin-fw' ) . '</strong> ' . $rss->get_error_message() . '</p>';
66
+ }
67
+ return;
68
+ }
69
+
70
+ if ( ! $rss->get_item_quantity() ) {
71
+ echo '<ul><li>' . __( 'An error has occurred, which probably means the feed is down. Try again later.', 'yith-plugin-fw' ) . '</li></ul>';
72
+ $rss->__destruct();
73
+ unset( $rss );
74
+ return;
75
+ }
76
+
77
+ $last_updates = $rss->get_items( 0, $items );
78
+ $html_classes = 'rsswidget yith-update-feeds';
79
+ $output = '';
80
+
81
+ if( count( $last_updates ) > 0 ){
82
+ $output = '<ul class="yith-update-feeds">';
83
+ }
84
+
85
+ foreach ( $last_updates as $last_update ) {
86
+ /**
87
+ * @var $last_update \SimplePie_Item
88
+ */
89
+ $output .= '<li class="yith-update-feed">';
90
+ $date = $last_update->get_date( 'U' );
91
+ $date_i18n = ! empty( $date ) ? date_i18n( get_option( 'date_format' ), $date ) : '';
92
+ $html_date = ! empty( $date_i18n ) ? ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date ) . '</span>' : '';
93
+ $output .= sprintf( '<a target="_blank" href="%s" class="%s">%s</a> %s', $last_update->get_permalink(), $html_classes, $last_update->get_title(), $html_date );
94
+ $changelog = $last_update->get_description();
95
+
96
+ if( ! empty( $changelog ) ){
97
+ //add_thickbox();
98
+ $output .= ' - ';
99
+ $output .= sprintf( '<a class="yith-last-changelog" href="#" data-changelogid="%s" data-plugininfo="%s">%s</a>', $last_update->get_id( true ), $last_update->get_title(), _x( 'View Changelog', 'Plugin FW', 'yith-plugin-fw' ) );
100
+ $output .= sprintf( '<div style="display: none;" id="%s"><div style="display: table;"><img class="yith-feeds-logo" src="%s" /><h3 class="yith-feeds-plugin-name"><span style="font-weight: normal;">%s</span> %s</h3></div><p>%s</p></div>', $last_update->get_id( true ), yith_plugin_fw_get_default_logo(), _x( 'Latest update released on', 'Plugin FW', 'yith-plugin-fw' ), $date_i18n, $changelog );
101
+ }
102
+
103
+ $output .= '</li>';
104
+ }
105
+
106
+ if( ! empty( $output ) ){
107
+ $output .= '</ul>';
108
+ }
109
 
110
+ echo $output;
111
+ $rss->__destruct();
112
+ unset( $rss );
113
+ }
114
 
115
  /**
116
  * Blog news Widget
121
  */
122
  public static function dashboard_blog_news() {
123
  $args = array( 'show_author' => 0, 'show_date' => 1, 'show_summary' => 1, 'items'=> 3 );
124
+ $feed = static::$_blog_feed;
125
+ wp_widget_rss_output( $feed, $args );
126
+ }
127
+
128
+ /**
129
+ * Enqueue Styles and Scripts for View Last Changelog widget
130
+ *
131
+ * @return void
132
+ * @since 1.0.0
133
+ * @access public
134
+ */
135
+ public static function enqueue_scripts(){
136
+ if( function_exists( 'get_current_screen' ) && 'dashboard' == get_current_screen()->id ){
137
+ $script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
138
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
139
+ wp_enqueue_script( 'yith-dashboard', $script_path . '/assets/js/yith-dashboard' . $suffix . '.js', array( 'jquery-ui-dialog' ), '1.0.0', true );
140
+ wp_enqueue_style( 'wp-jquery-ui-dialog' );
141
+ $l10n = array(
142
+ 'buttons' => array(
143
+ 'close' => _x( 'Close', 'Button label', 'yith-plugin-fw' )
144
+ )
145
+ );
146
+ wp_localize_script( 'yith-dashboard', 'yith_dashboard', $l10n );
147
+ }
148
  }
149
  }
150
+
151
  if( apply_filters( 'yith_plugin_fw_show_dashboard_widgets', true ) ){
152
  add_action( 'wp_dashboard_setup', 'YITH_Dashboard::dashboard_widget_setup' );
153
+ add_action( 'admin_enqueue_scripts', 'YITH_Dashboard::enqueue_scripts', 20 );
154
  }
155
  }
156
 
plugin-fw/licence/assets/js/yit-licence.js CHANGED
@@ -69,7 +69,7 @@
69
  if ( false === error ) {
70
  jQuery.ajax( {
71
  type : 'POST',
72
- url : ajaxurl,
73
  data : data,
74
  success: function ( response ) {
75
 
69
  if ( false === error ) {
70
  jQuery.ajax( {
71
  type : 'POST',
72
+ url : typeof ajaxurl != 'undefined' ? ajaxurl : yith_ajax.url,
73
  data : data,
74
  success: function ( response ) {
75
 
plugin-fw/licence/assets/js/yit-licence.min.js CHANGED
@@ -1 +1,8 @@
1
- !function(e){var a=function(){var i=e(".licence-activation"),s=e(".licence-check"),d=e(".licence-deactive");i.on("click",function(i,s){i.preventDefault();var d,c=e(this),r=c.data("formid"),l=e("#"+r),u=l.serialize(),F=e(l).find(".message"),t=e(l).find(".message-wrapper"),n=l.find(".user-email"),o=l.find(".licence-key"),p=l.find(".user-email").val(),v=l.find(".licence-key").val(),C=!1,x=new Array,m=l.find(".product-row"),D=e(".licence-activation"),f=e("#products-to-active").find(".spinner");if(F.empty(),t.removeClass("visible"),n.removeClass("require"),o.removeClass("require"),m.removeClass("error"),f.addClass("show"),c.add(D).prop("disabled",!0).addClass("clicked"),""!==p&&(d=p,new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i).test(d))||(C=!0,n.addClass("require"),x[x.length]=licence_message.email),""===v&&(C=!0,x[x.length]=licence_message.license_key,o.addClass("require")),!1===C)jQuery.ajax({type:"POST",url:ajaxurl,data:u,success:function(i){f.removeClass("show"),c.add(D).prop("disabled",!1).removeClass("clicked"),!0===i.activated?(e(".product-licence-activation").empty().replaceWith(i.template),a()):!1!==i&&void 0!==i.error?(F.text(i.error),t.addClass("visible"),m.addClass("error")):(F.text(licence_message.server),t.addClass("visible"),m.addClass("error")),void 0!==i.debug&&console.log(i.debug)}});else{if(1==x.length)F.text(licence_message.error.replace("%field%",x[0])),t.addClass("visible"),m.addClass("error");else{for(var h=licence_message.errors,b=0;b<x.length;b++)h=h.replace("%field_"+(b+1)+"%",x[b]),t.addClass("visible");F.text(h),t.addClass("visible"),m.addClass("error")}f.removeClass("show"),c.add(D).prop("disabled",!1).removeClass("clicked")}}),s.on("click",function(i){i.preventDefault();var s=e(this),d=e("#licence-check-update"),c=d.serialize();s.prop("disabled",!0).addClass("clicked"),d.find("div.spinner").addClass("show"),jQuery.ajax({type:"POST",url:ajaxurl,data:c,success:function(i){e(".product-licence-activation").empty().replaceWith(i.template),a()}})}),d.on("click",function(i){if(i.preventDefault(),1==(1==script_info.is_debug||confirm(licence_message.are_you_sure))){var s=e(this),d=s.data("licence-key"),c=s.data("licence-email"),r=s.data("product-init"),l=s.data("action"),u=e(".licence-renew"),F=e(".licence-deactive"),t=e("#yith-licence-notice"),n=e(".activated-table");s.add(u).add(F).prop("disabled",!0).addClass("clicked"),e("#activated-products").find(".spinner").addClass("show"),jQuery.ajax({type:"POST",url:ajaxurl,data:{action:l,licence_key:d,email:c,product_init:r},success:function(i){t.css("maxWidth",n.width()),0==i?(t.find("p.yith-licence-notice-message").html(licence_message.server),t.removeClass("notice-success").addClass("notice-error visible"),s.add(u).add(F).add(u).prop("disabled",!1).removeClass("clicked"),e("#activated-products").find(".spinner").removeClass("show")):(0==i.activated&&(e(".product-licence-activation").empty().replaceWith(i.template),a()),void 0!==i.error&&(t.find("p.yith-licence-notice-message").html(i.error),t.removeClass("notice-success").addClass("notice-error visible"),s.add(u).add(F).add(u).prop("disabled",!1).removeClass("clicked"),e("#activated-products").find(".spinner").removeClass("show")))}})}})};a(),e("body").on("click",".yit-changelog-button",function(a){e("#TB_window").remove()})}(jQuery);
 
 
 
 
 
 
 
1
+ (function(b){var t=function(c){c.on("click",function(k,e){k.preventDefault();var c=b(this),a=c.data("formid"),d=b("#"+a),f=d.serialize(),h=b(d).find(".message"),g=b(d).find(".message-wrapper"),l=d.find(".user-email"),u=d.find(".licence-key"),v=d.find(".user-email").val(),t=d.find(".licence-key").val(),n=!1;a=[];var p=d.find(".product-row"),q=b(".licence-activation"),r=b("#products-to-active").find(".spinner");h.empty();g.removeClass("visible");l.removeClass("require");u.removeClass("require");p.removeClass("error");
2
+ r.addClass("show");c.add(q).prop("disabled",!0).addClass("clicked");""!==v&&(new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i)).test(v)||
3
+ (n=!0,l.addClass("require"),a[a.length]=licence_message.email);""===t&&(n=!0,a[a.length]=licence_message.license_key,u.addClass("require"));if(!1===n)jQuery.ajax({type:"POST",url:"undefined"!=typeof ajaxurl?ajaxurl:yith_ajax.url,data:f,success:function(a){r.removeClass("show");c.add(q).prop("disabled",!1).removeClass("clicked");!0===a.activated?(b(".product-licence-activation").empty().replaceWith(a.template),m()):(!1!==a&&"undefined"!==typeof a.error?h.text(a.error):h.text(licence_message.server),
4
+ g.addClass("visible"),p.addClass("error"));"undefined"!==typeof a.debug&&console.log(a.debug)}});else{if(1==a.length)h.text(licence_message.error.replace("%field%",a[0]));else{d=licence_message.errors;for(f=0;f<a.length;f++)d=d.replace("%field_"+(f+1)+"%",a[f]),g.addClass("visible");h.text(d)}g.addClass("visible");p.addClass("error");r.removeClass("show");c.add(q).prop("disabled",!1).removeClass("clicked")}})},w=function(c){c.on("click",function(c){c.preventDefault();c=b(this);var e=b("#licence-check-update"),
5
+ k=e.serialize();c.prop("disabled",!0).addClass("clicked");e.find("div.spinner").addClass("show");jQuery.ajax({type:"POST",url:ajaxurl,data:k,success:function(a){b(".product-licence-activation").empty().replaceWith(a.template);m()}})})},x=function(c){c.on("click",function(c){c.preventDefault();if(1==(1==script_info.is_debug?!0:confirm(licence_message.are_you_sure))){var e=b(this);c=e.data("licence-key");var k=e.data("licence-email"),a=e.data("product-init"),d=e.data("action"),f=b(".licence-renew"),
6
+ h=b(".licence-deactive"),g=b("#yith-licence-notice"),l=b(".activated-table");e.add(f).add(h).prop("disabled",!0).addClass("clicked");b("#activated-products").find(".spinner").addClass("show");jQuery.ajax({type:"POST",url:ajaxurl,data:{action:d,licence_key:c,email:k,product_init:a},success:function(a){g.css("maxWidth",l.width());0==a?(g.find("p.yith-licence-notice-message").html(licence_message.server),g.removeClass("notice-success").addClass("notice-error visible"),e.add(f).add(h).add(f).prop("disabled",
7
+ !1).removeClass("clicked"),b("#activated-products").find(".spinner").removeClass("show")):(0==a.activated&&(b(".product-licence-activation").empty().replaceWith(a.template),m()),"undefined"!=typeof a.error&&(g.find("p.yith-licence-notice-message").html(a.error),g.removeClass("notice-success").addClass("notice-error visible"),e.add(f).add(h).add(f).prop("disabled",!1).removeClass("clicked"),b("#activated-products").find(".spinner").removeClass("show")))}})}})},m=function(){var c=b(".licence-activation"),
8
+ k=b(".licence-check"),e=b(".licence-deactive");t(c);w(k);x(e)};m();b("body").on("click",".yit-changelog-button",function(c){b("#TB_window").remove()})})(jQuery);
plugin-fw/licence/lib/yit-licence.php CHANGED
@@ -191,6 +191,11 @@ if ( !class_exists( 'YIT_Licence' ) ) {
191
  )
192
  );
193
 
 
 
 
 
 
194
  /* Enqueue Scripts only in Licence Activation page of plugins and themes */
195
  if ( strpos( get_current_screen()->id, 'yith_plugins_activation' ) !== false || strpos( get_current_screen()->id, 'yit_panel_license' ) !== false ) {
196
  wp_enqueue_script( 'yit-licence' );
191
  )
192
  );
193
 
194
+ wp_localize_script( 'yit-licence', 'yith_ajax', array(
195
+ 'url' => admin_url( 'admin-ajax.php', 'relative' )
196
+ )
197
+ );
198
+
199
  /* Enqueue Scripts only in Licence Activation page of plugins and themes */
200
  if ( strpos( get_current_screen()->id, 'yith_plugins_activation' ) !== false || strpos( get_current_screen()->id, 'yit_panel_license' ) !== false ) {
201
  wp_enqueue_script( 'yit-licence' );
plugin-fw/templates/fields/custom.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
+ * that is bundled with this package in the file LICENSE.txt.
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.gnu.org/licenses/gpl-3.0.txt
8
+ *
9
+ * @var array $field
10
+ */
11
+
12
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
13
+
14
+ if ( isset( $field[ 'action' ] ) ) {
15
+ do_action( $field[ 'action' ], $field );
16
+ }
plugin-fw/yit-plugin.php CHANGED
@@ -40,7 +40,6 @@ include_once( 'lib/yit-debug.php');
40
  include_once( 'lib/yith-dashboard.php' );
41
  include_once( 'lib/privacy/yit-privacy.php' );
42
  include_once( 'lib/privacy/yit-privacy-plugin-abstract.php' );
43
- include_once( 'lib/promo/yith-promo.php' );
44
 
45
  /* === Gutenberg Support === */
46
  if( class_exists( 'WP_Block_Type_Registry' ) ){
@@ -157,11 +156,6 @@ if( ! function_exists( 'yit_plugin_fw_row_meta' ) ){
157
  }
158
  }
159
 
160
- //Add YITH Refer ID
161
- if( ! empty( $url ) && defined( 'YITH_REFER_ID' ) ){
162
- $url = add_query_arg( array( 'refer_id', YITH_REFER_ID ), $url );
163
- }
164
-
165
  if( ! empty( $url ) && ! empty( $label ) ){
166
  $plugin_meta[] = sprintf( '<a href="%s" target="_blank"><span class="%s"></span>%s</a>', $url, $icon, $label );
167
  }
40
  include_once( 'lib/yith-dashboard.php' );
41
  include_once( 'lib/privacy/yit-privacy.php' );
42
  include_once( 'lib/privacy/yit-privacy-plugin-abstract.php' );
 
43
 
44
  /* === Gutenberg Support === */
45
  if( class_exists( 'WP_Block_Type_Registry' ) ){
156
  }
157
  }
158
 
 
 
 
 
 
159
  if( ! empty( $url ) && ! empty( $label ) ){
160
  $plugin_meta[] = sprintf( '<a href="%s" target="_blank"><span class="%s"></span>%s</a>', $url, $icon, $label );
161
  }