YITH WooCommerce Zoom Magnifier - Version 1.2.1

Version Description

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Zoom Magnifier
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2.0 to 1.2.1

README.txt CHANGED
@@ -3,8 +3,8 @@
3
  Contributors: yithemes
4
  Tags: zoom, magnifier, woocommerce, product image, themes, yit, e-commerce, shop, thumbnail, thumbnail slider, zoom image, carousel, image carousel
5
  Requires at least: 3.5.1
6
- Tested up to: 4.2
7
- Stable tag: 1.2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -59,7 +59,11 @@ The size of the Zoom Image is automatically setted. If you want to change these
59
 
60
  == Changelog ==
61
 
62
- = Version 1.2.0 - RELEASED: APR 22, 2015 ==
 
 
 
 
63
 
64
  * Fix : security issue (https://make.wordpress.org/plugins/2015/04/20/fixing-add_query_arg-and-remove_query_arg-usage/)
65
  * Tweak : support up to Wordpress 4.2
3
  Contributors: yithemes
4
  Tags: zoom, magnifier, woocommerce, product image, themes, yit, e-commerce, shop, thumbnail, thumbnail slider, zoom image, carousel, image carousel
5
  Requires at least: 3.5.1
6
+ Tested up to: 4.2.1
7
+ Stable tag: 1.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
59
 
60
  == Changelog ==
61
 
62
+ = Version 1.2.1 - RELEASED: MAY 04, 2015 =
63
+
64
+ * Fixed: removed z-index that made the zoom area hiding other elements in certain themes.
65
+
66
+ = Version 1.2.0 - RELEASED: APR 22, 2015 =
67
 
68
  * Fix : security issue (https://make.wordpress.org/plugins/2015/04/20/fixing-add_query_arg-and-remove_query_arg-usage/)
69
  * Tweak : support up to Wordpress 4.2
assets/css/yith_magnifier.css CHANGED
@@ -1,6 +1,5 @@
1
  .yith_magnifier_zoom_wrap {
2
  top: 0;
3
- z-index: 9999;
4
  position: relative;
5
  }
6
 
1
  .yith_magnifier_zoom_wrap {
2
  top: 0;
 
3
  position: relative;
4
  }
5
 
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
6
- * Version: 1.2.0
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: ywzm
@@ -11,7 +11,7 @@
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
- * @version 1.2.0
15
  */
16
  /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
@@ -65,7 +65,7 @@ if ( ! defined( 'YITH_YWZM_FREE_INIT' ) ) {
65
  }
66
 
67
  if ( ! defined( 'YITH_YWZM_VERSION' ) ) {
68
- define( 'YITH_YWZM_VERSION', '1.2.0' );
69
  }
70
 
71
  if ( ! defined( 'YITH_YWZM_FILE' ) ) {
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
6
+ * Version: 1.2.1
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: ywzm
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
+ * @version 1.2.1
15
  */
16
  /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
65
  }
66
 
67
  if ( ! defined( 'YITH_YWZM_VERSION' ) ) {
68
+ define( 'YITH_YWZM_VERSION', '1.2.1' );
69
  }
70
 
71
  if ( ! defined( 'YITH_YWZM_FILE' ) ) {
plugin-fw/assets/js/yit-plugin-panel.js CHANGED
@@ -121,29 +121,78 @@
121
  }
122
  }).change();
123
 
124
- $(document).on('click', '.plugin-option .upload_button', function (e) {
125
- var send_attachment_bkp = wp.media.editor.send.attachment;
126
- var button = $(this);
127
- var id = button.attr('id').replace('-button', '');
128
- _custom_media = true;
129
- wp.media.editor.send.attachment = function (props, attachment) {
130
- if (_custom_media) {
131
- if ($("#" + id).is('input[type=text]')) {
132
- $("#" + id).val(attachment.url);
133
- } else {
134
- $("#" + id + '_custom').val(attachment.url);
135
- }
136
-
137
- } else {
138
- return _orig_send_attachment.apply(this, [props, attachment]);
139
- }
140
- ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  }
142
 
143
- wp.media.editor.open(button);
144
- return false;
145
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
 
 
 
 
 
 
 
 
 
 
 
 
147
  }
148
 
149
  $('.plugin-option .add_media').on('click', function () {
121
  }
122
  }).change();
123
 
124
+ //$(document).on('click', '.plugin-option .upload_button', function (e) {
125
+ // var send_attachment_bkp = wp.media.editor.send.attachment;
126
+ // var button = $(this);
127
+ // var id = button.attr('id').replace('-button', '');
128
+ // _custom_media = true;
129
+ // wp.media.editor.send.attachment = function (props, attachment) {
130
+ // if (_custom_media) {
131
+ // if ($("#" + id).is('input[type=text]')) {
132
+ // $("#" + id).val(attachment.url);
133
+ // } else {
134
+ // $("#" + id + '_custom').val(attachment.url);
135
+ // }
136
+ //
137
+ // } else {
138
+ // return _orig_send_attachment.apply(this, [props, attachment]);
139
+ // }
140
+ // ;
141
+ // }
142
+ //
143
+ // wp.media.editor.open(button);
144
+ // return false;
145
+ //});
146
+
147
+ $( document ).on( 'click', '.plugin-option .upload_button', function(e) {
148
+ e.preventDefault();
149
+
150
+ var t = $(this),
151
+ custom_uploader,
152
+ id = t.attr('id').replace(/-button$/, '');
153
+
154
+ //If the uploader object has already been created, reopen the dialog
155
+ if (custom_uploader) {
156
+ custom_uploader.open();
157
+ return;
158
  }
159
 
160
+ var custom_uploader_states = [
161
+ // Main states.
162
+ new wp.media.controller.Library({
163
+ library: wp.media.query(),
164
+ multiple: false,
165
+ title: 'Choose Image',
166
+ priority: 20,
167
+ filterable: 'uploaded'
168
+ })
169
+ ];
170
+
171
+ // Create the media frame.
172
+ custom_uploader = wp.media.frames.downloadable_file = wp.media({
173
+ // Set the title of the modal.
174
+ title: 'Choose Image',
175
+ library: {
176
+ type: ''
177
+ },
178
+ button: {
179
+ text: 'Choose Image'
180
+ },
181
+ multiple: false,
182
+ states: custom_uploader_states
183
+ });
184
 
185
+
186
+ //When a file is selected, grab the URL and set it as the text field's value
187
+ custom_uploader.on( 'select' , function() {
188
+ var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
189
+
190
+ $("#" + id).val( attachment.url );
191
+ });
192
+
193
+ //Open the uploader dialog
194
+ custom_uploader.open();
195
+ });
196
  }
197
 
198
  $('.plugin-option .add_media').on('click', function () {
plugin-fw/assets/js/yit-plugin-panel.min.js CHANGED
@@ -1,9 +1,10 @@
1
- (function(a){var k=function(){var b="";a(this).attr("multiple")?(a(this).children("option:selected").each(function(c,e){0!=c&&(b+=", ");b+=a(e).text()}),""==b&&a(this).children().children("option:selected").each(function(c,e){0!=c&&(b+=", ");b+=a(e).text()})):(b=a(this).children("option:selected").text(),""==b&&(b=a(this).children().children("option:selected").text()));0>=a(this).parent().find("span").length&&a(this).before("<span></span>");a(this).parent().children("span").replaceWith("<span>"+b+
2
- "</span>")};a(".plugin-option .select_wrapper select").not(".chosen").each(k).change(k);a(".plugin-option .select_wrapper").click(function(b){b.stopPropagation();a(this).find("select[multiple]").not(".chosen").toggle()});a(".plugin-option .select_wrapper select[multiple]").not(".chosen").click(function(a){a.stopPropagation()});a(window).click(function(){a(".plugin-option .select_wrapper select[multiple]").not(".chosen").hide()});a(".plugin-option .chosen .select_wrapper select").chosen();a(".plugin-option .on_off_container span").on("click",
3
- function(){var b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});a(".plugin-option .slider_container .ui-slider-horizontal").each(function(){var b=a(this).data("val"),c=a(this).data("min"),e=a(this).data("max"),d=a(this).data("step"),l=a(this).data("labels");a(this).slider({value:b,min:c,max:e,range:"min",step:d,slide:function(b,c){a(this).find("input").val(c.value);
4
- a(this).siblings(".feedback").find("strong").text(c.value+l)}})});if("undefined"!==typeof wp&&"undefined"!==typeof wp.media){var f=!0,m=wp.media.editor.send.attachment;a(".plugin-option .upload_img_url").change(function(){var b=a(this).val(),c=a(this).parent().siblings(".upload_img_preview");/(http|ftp|https):\/\/[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)/.test(b)?c.html('<img src="'+b+'" style="max-width:600px; max-height:300px;" />'):c.html("")}).change();a(document).on("click",".plugin-option .upload_button",
5
- function(b){b=a(this);var c=b.attr("id").replace("-button","");f=!0;wp.media.editor.send.attachment=function(b,d){if(f)a("#"+c).is("input[type=text]")?a("#"+c).val(d.url):a("#"+c+"_custom").val(d.url);else return m.apply(this,[b,d])};wp.media.editor.open(b);return!1})}a(".plugin-option .add_media").on("click",function(){f=!1});a("[data-field]").each(function(){var b=a(this),c="#"+b.data("field"),e="#"+b.data("dep"),d=b.data("value");a(e).on("change",function(){var b=e,g=d.toString(),f=!0;if("string"==
6
- typeof b){":radio"==b.substr(0,6)&&(b+=":checked");for(var g=g.split(","),h=0;h<g.length;h++)if(a(b).val()!=g[h])f=!1;else{f=!0;break}}f?a(c+"-container").closest("tr").show():a(c+"-container").closest("tr").hide()}).change()});a(".rm_connectedlist").each(function(){var b=a(this).find("ul"),c=a(this).find(":hidden");b.sortable({connectWith:b,update:function(e,d){var f={};b.each(function(){var b={};a(this).children().each(function(){b[a(this).data("option")]=a(this).text()});f[a(this).data("list")]=
7
- b});c.val(JSON.stringify(f).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()});a(document).ready(function(){a(".yith-video-link").click(function(b){b.preventDefault();b=a(this).data("video-id");a("."+b).dialog({dialogClass:"wp-dialog yit-dialog yit-video-dialog",modal:!0,closeOnEscape:!0,width:"auto",resizable:!1,draggable:!1,create:function(b,e){a(this).css("maxWidth","853px")},open:function(b,e){a(".ui-widget-overlay").bind("click",function(){a(this).siblings(".ui-dialog").find(".ui-dialog-content").dialog("close")})}});
8
- a(".ui-dialog :button").blur()})});a(document).ready(function(){a(".codemirror").each(function(b,c){var e=CodeMirror.fromTextArea(c,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});a(c).data("codemirrorInstance",e)})});a(document).ready(function(){a(".google-analytic-generate").click(function(){var b=a("#"+a(this).data("textarea")).data("codemirrorInstance"),c=a("#"+a(this).data("input")).val(),e=a(this).data("basename"),d;d="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\nm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n";
9
- d+="})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n";d+="ga('create', '"+c+"', '"+e+"');\n";d+="ga('send', 'pageview');\n";b.replaceRange(d,b.getCursor("start"),b.getCursor("end"))})})})(jQuery);
 
1
+ (function(a){var l=function(){var b="";a(this).attr("multiple")?(a(this).children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()}),""==b&&a(this).children().children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()})):(b=a(this).children("option:selected").text(),""==b&&(b=a(this).children().children("option:selected").text()));0>=a(this).parent().find("span").length&&a(this).before("<span></span>");a(this).parent().children("span").replaceWith("<span>"+b+
2
+ "</span>")};a(".plugin-option .select_wrapper select").not(".chosen").each(l).change(l);a(".plugin-option .select_wrapper").click(function(b){b.stopPropagation();a(this).find("select[multiple]").not(".chosen").toggle()});a(".plugin-option .select_wrapper select[multiple]").not(".chosen").click(function(a){a.stopPropagation()});a(window).click(function(){a(".plugin-option .select_wrapper select[multiple]").not(".chosen").hide()});a(".plugin-option .chosen .select_wrapper select").chosen();a(".plugin-option .on_off_container span").on("click",
3
+ function(){var b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});a(".plugin-option .slider_container .ui-slider-horizontal").each(function(){var b=a(this).data("val"),c=a(this).data("min"),d=a(this).data("max"),e=a(this).data("step"),f=a(this).data("labels");a(this).slider({value:b,min:c,max:d,range:"min",step:e,slide:function(b,c){a(this).find("input").val(c.value);
4
+ a(this).siblings(".feedback").find("strong").text(c.value+f)}})});"undefined"!==typeof wp&&"undefined"!==typeof wp.media&&(a(".plugin-option .upload_img_url").change(function(){var b=a(this).val(),c=a(this).parent().siblings(".upload_img_preview");/(http|ftp|https):\/\/[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)/.test(b)?c.html('<img src="'+b+'" style="max-width:600px; max-height:300px;" />'):c.html("")}).change(),a(document).on("click",".plugin-option .upload_button",function(b){b.preventDefault();
5
+ var c,d=a(this).attr("id").replace(/-button$/,"");c||(b=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})],c=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:b}),c.on("select",function(){var b=c.state().get("selection").first().toJSON();a("#"+d).val(b.url)}));c.open()}));a(".plugin-option .add_media").on("click",function(){});a("[data-field]").each(function(){var b=
6
+ a(this),c="#"+b.data("field"),d="#"+b.data("dep"),e=b.data("value");a(d).on("change",function(){var b=d,g=e.toString(),h=!0;if("string"==typeof b){":radio"==b.substr(0,6)&&(b+=":checked");for(var g=g.split(","),k=0;k<g.length;k++)if(a(b).val()!=g[k])h=!1;else{h=!0;break}}h?a(c+"-container").closest("tr").show():a(c+"-container").closest("tr").hide()}).change()});a(".rm_connectedlist").each(function(){var b=a(this).find("ul"),c=a(this).find(":hidden");b.sortable({connectWith:b,update:function(d,e){var f=
7
+ {};b.each(function(){var b={};a(this).children().each(function(){b[a(this).data("option")]=a(this).text()});f[a(this).data("list")]=b});c.val(JSON.stringify(f).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()});a(document).ready(function(){a(".yith-video-link").click(function(b){b.preventDefault();b=a(this).data("video-id");a("."+b).dialog({dialogClass:"wp-dialog yit-dialog yit-video-dialog",modal:!0,closeOnEscape:!0,width:"auto",resizable:!1,draggable:!1,create:function(b,
8
+ d){a(this).css("maxWidth","853px")},open:function(b,d){a(".ui-widget-overlay").bind("click",function(){a(this).siblings(".ui-dialog").find(".ui-dialog-content").dialog("close")})}});a(".ui-dialog :button").blur()})});a(document).ready(function(){a(".codemirror").each(function(b,c){var d=CodeMirror.fromTextArea(c,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});a(c).data("codemirrorInstance",d)})});a(document).ready(function(){a(".google-analytic-generate").click(function(){var b=a("#"+
9
+ a(this).data("textarea")).data("codemirrorInstance"),c=a("#"+a(this).data("input")).val(),d=a(this).data("basename"),e;e="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\nm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n";e+="})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n";e+="ga('create', '"+c+"', '"+d+"');\n";e+="ga('send', 'pageview');\n";
10
+ b.replaceRange(e,b.getCursor("start"),b.getCursor("end"))})})})(jQuery);
plugin-fw/assets/js/yit-wp-pointer.js CHANGED
@@ -23,7 +23,7 @@ jQuery(document).ready( function($) {
23
  pointerClass: 'yit-wp-pointer',
24
  content : options.content,
25
  position: options.position,
26
- open : function () { console.log( 'here' );
27
  selected_plugin_row.toggleClass( 'yit-pointer-selected-row' );
28
  top_level_menu.addClass( 'yit-pointer' );
29
  },
23
  pointerClass: 'yit-wp-pointer',
24
  content : options.content,
25
  position: options.position,
26
+ open : function () {
27
  selected_plugin_row.toggleClass( 'yit-pointer-selected-row' );
28
  top_level_menu.addClass( 'yit-pointer' );
29
  },
plugin-fw/lib/yit-metabox.php CHANGED
@@ -30,7 +30,7 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
30
  * 'fields' => array(
31
  * 'meta_checkbox' => array(
32
  * 'label' => __( 'Show title', 'yit' ),
33
- * 'desc' => __( 'Show title of the page or not.', 'yit' ),
34
  * 'type' => 'checkbox',
35
  * 'private' => false,
36
  * 'std' => '1'),
30
  * 'fields' => array(
31
  * 'meta_checkbox' => array(
32
  * 'label' => __( 'Show title', 'yit' ),
33
+ * 'desc' => __( 'Choose whether to show title of the page or not.', 'yit' ),
34
  * 'type' => 'checkbox',
35
  * 'private' => false,
36
  * 'std' => '1'),
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -717,7 +717,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
717
  include $type;
718
  }
719
  else {
720
- do_action( "yit_panel_{$option['type']}", $option, $db_value );
721
  }
722
  }
723
  }
717
  include $type;
718
  }
719
  else {
720
+ do_action( "yit_panel_{$option['type']}", $option, $db_value, $custom_attributes );
721
  }
722
  }
723
  }
plugin-fw/lib/yit-upgrade.php CHANGED
@@ -59,6 +59,10 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
59
  if( is_network_admin() ){
60
  add_action( 'admin_enqueue_scripts', array( $this, 'network_admin_enqueue_scripts' ) );
61
  }
 
 
 
 
62
  }
63
 
64
  /**
@@ -362,6 +366,7 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
362
  $obj->new_version = (string)$plugin_remote_info->latest;
363
  $obj->changelog = (string)$plugin_remote_info->changelog;
364
  $obj->package = $package;
 
365
  $transient->response[$init] = $obj;
366
  }
367
 
59
  if( is_network_admin() ){
60
  add_action( 'admin_enqueue_scripts', array( $this, 'network_admin_enqueue_scripts' ) );
61
  }
62
+
63
+ if( defined( 'YIT_LICENCE_DEBUG' ) && YIT_LICENCE_DEBUG ){
64
+ $this->_package_url = 'http://dev.yithemes.com';
65
+ }
66
  }
67
 
68
  /**
366
  $obj->new_version = (string)$plugin_remote_info->latest;
367
  $obj->changelog = (string)$plugin_remote_info->changelog;
368
  $obj->package = $package;
369
+ $obj->plugin = $init;
370
  $transient->response[$init] = $obj;
371
  }
372
 
plugin-fw/lib/yit-video.php CHANGED
@@ -59,7 +59,8 @@ if ( ! class_exists( 'YIT_Video' ) ) {
59
 
60
  if( ! $echo ) ob_start();
61
 
62
- $id = preg_replace( '/[&|&amp;]feature=([\w\-]*)/', '', $id ); ?>
 
63
 
64
  <div class="post_video youtube">
65
  <iframe wmode="transparent" width="<?php echo $width; ?>" height="<?php echo $height; ?>" src="https://www.youtube.com/embed/<?php echo $id; ?>?wmode=transparent" frameborder="0" allowfullscreen></iframe>
@@ -98,7 +99,8 @@ if ( ! class_exists( 'YIT_Video' ) ) {
98
 
99
  if( ! $echo ) ob_start();
100
 
101
- $id = preg_replace( '/[&|&amp;]feature=([\w\-]*)/', '', $id ) ?>
 
102
 
103
  <div class="post_video vimeo">
104
  <iframe wmode="transparent" src="http://player.vimeo.com/video/<?php echo $id; ?>?title=0&amp;byline=0&amp;portrait=0" width="<?php echo $width; ?>" height="<?php echo $height; ?>" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
@@ -124,16 +126,20 @@ if ( ! class_exists( 'YIT_Video' ) ) {
124
  if ( ! isset( $parsed['host'] ) ) {
125
  return false;
126
  }
127
- switch ( $parsed['host'] ) {
128
 
 
 
 
129
  case 'www.youtube.com' :
130
  case 'youtu.be' :
 
131
  $id = self::youtube_id_by_url( $url );
132
  return "youtube:$id";
133
 
 
134
  case 'vimeo.com' :
135
- preg_match( '/http:\/\/(\w+.)?vimeo\.com\/(.*)/', $url, $matches );
136
- $id = $matches[2];
137
  return "vimeo:$id";
138
 
139
  default :
@@ -154,7 +160,7 @@ if ( ! class_exists( 'YIT_Video' ) ) {
154
  * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
155
  */
156
  protected static function youtube_id_by_url( $url ) {
157
- if ( preg_match( '/http:\/\/youtu.be/', $url, $matches) ) {
158
  $url = parse_url($url, PHP_URL_PATH);
159
  $url = str_replace( '/', '', $url);
160
  return $url;
@@ -164,12 +170,12 @@ if ( ! class_exists( 'YIT_Video' ) ) {
164
  $url = str_replace( 'v=', '', $arr['query'] );
165
  return $url;
166
 
167
- } elseif ( preg_match( '/http:\/\/www.youtube.com\/v/', $url, $matches) ) {
168
  $arr = parse_url($url);
169
  $url = str_replace( '/v/', '', $arr['path'] );
170
  return $url;
171
 
172
- } elseif ( preg_match( '/http:\/\/www.youtube.com\/embed/', $url, $matches) ) {
173
  $arr = parse_url($url);
174
  $url = str_replace( '/embed/', '', $arr['path'] );
175
  return $url;
59
 
60
  if( ! $echo ) ob_start();
61
 
62
+ $id = preg_replace( '/[&|&amp;]feature=([\w\-]*)/', '', $id );
63
+ $id = preg_replace( '/(youtube|vimeo):/', '', $id ); ?>
64
 
65
  <div class="post_video youtube">
66
  <iframe wmode="transparent" width="<?php echo $width; ?>" height="<?php echo $height; ?>" src="https://www.youtube.com/embed/<?php echo $id; ?>?wmode=transparent" frameborder="0" allowfullscreen></iframe>
99
 
100
  if( ! $echo ) ob_start();
101
 
102
+ $id = preg_replace( '/[&|&amp;]feature=([\w\-]*)/', '', $id );
103
+ $id = preg_replace( '/(youtube|vimeo):/', '', $id ); ?>
104
 
105
  <div class="post_video vimeo">
106
  <iframe wmode="transparent" src="http://player.vimeo.com/video/<?php echo $id; ?>?title=0&amp;byline=0&amp;portrait=0" width="<?php echo $width; ?>" height="<?php echo $height; ?>" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
126
  if ( ! isset( $parsed['host'] ) ) {
127
  return false;
128
  }
 
129
 
130
+
131
+ switch ( $parsed['host'] ) {
132
+ case 'youtube.com' :
133
  case 'www.youtube.com' :
134
  case 'youtu.be' :
135
+ case 'www.youtu.be' :
136
  $id = self::youtube_id_by_url( $url );
137
  return "youtube:$id";
138
 
139
+ case 'www.vimeo.com' :
140
  case 'vimeo.com' :
141
+ preg_match( '/http(s)?:\/\/(\w+.)?vimeo\.com\/(.*)?(\/[0-9]+)/', $url, $matches );
142
+ $id = trim( $matches[4], '/' );
143
  return "vimeo:$id";
144
 
145
  default :
160
  * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
161
  */
162
  protected static function youtube_id_by_url( $url ) {
163
+ if ( preg_match( '/http(s)?:\/\/youtu.be/', $url, $matches) ) {
164
  $url = parse_url($url, PHP_URL_PATH);
165
  $url = str_replace( '/', '', $url);
166
  return $url;
170
  $url = str_replace( 'v=', '', $arr['query'] );
171
  return $url;
172
 
173
+ } elseif ( preg_match( '/http(s)?:\/\/(\w+.)?youtube.com\/v/', $url, $matches) ) {
174
  $arr = parse_url($url);
175
  $url = str_replace( '/v/', '', $arr['path'] );
176
  return $url;
177
 
178
+ } elseif ( preg_match( '/http(s)?:\/\/(\w+.)?youtube.com\/embed/', $url, $matches) ) {
179
  $arr = parse_url($url);
180
  $url = str_replace( '/embed/', '', $arr['path'] );
181
  return $url;
plugin-fw/licence/lib/yit-licence.php CHANGED
@@ -62,7 +62,12 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
62
  * @since 1.0
63
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
64
  */
65
- abstract public function __construct();
 
 
 
 
 
66
 
67
  /**
68
  * Premium products registration
@@ -135,9 +140,9 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
135
  /**
136
  * Support to YIT Framework < 2.0
137
  */
138
- $filename = function_exists( 'yit_load_js_file' ) ? yit_load_js_file( 'yit-licence.js' ) : 'yit-licence.js';
139
- $script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
140
- $style_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
141
 
142
  wp_enqueue_script( 'yit-licence', $script_path . '/licence/assets/js/' . $filename, array( 'jquery' ), '1.0.0', true );
143
  wp_enqueue_style( 'yit-theme-licence', $style_path . '/licence/assets/css/yit-licence.css' );
@@ -213,6 +218,9 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
213
 
214
  update_option( $this->_licence_option, $options );
215
 
 
 
 
216
  /* === Licence Activation Template === */
217
  $body['template'] = $this->show_activation_panel();
218
  }
@@ -315,6 +323,9 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
315
 
316
  /* === Update Plugin Licence Information === */
317
  update_option( $this->_licence_option, $licence );
 
 
 
318
  }
319
  return $status;
320
  }
@@ -336,7 +347,7 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
336
  }
337
 
338
  /* === Regenerate Update Plugins Transient === */
339
- //YIT_Upgrade()->force_regenerate_update_transient();
340
 
341
  do_action( 'yit_licence_after_check' );
342
 
62
  * @since 1.0
63
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
64
  */
65
+ public function __construct(){
66
+
67
+ if( defined( 'YIT_LICENCE_DEBUG' ) && YIT_LICENCE_DEBUG ){
68
+ $this->_api_uri = 'http://dev.yithemes.com';
69
+ }
70
+ }
71
 
72
  /**
73
  * Premium products registration
140
  /**
141
  * Support to YIT Framework < 2.0
142
  */
143
+ $filename = function_exists( 'yit_load_js_file' ) ? yit_load_js_file( 'yit-licence.js' ) : 'yit-licence.js';
144
+ $script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
145
+ $style_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
146
 
147
  wp_enqueue_script( 'yit-licence', $script_path . '/licence/assets/js/' . $filename, array( 'jquery' ), '1.0.0', true );
148
  wp_enqueue_style( 'yit-theme-licence', $style_path . '/licence/assets/css/yit-licence.css' );
218
 
219
  update_option( $this->_licence_option, $options );
220
 
221
+ /* === Update Plugin Licence Information === */
222
+ YIT_Upgrade()->force_regenerate_update_transient();
223
+
224
  /* === Licence Activation Template === */
225
  $body['template'] = $this->show_activation_panel();
226
  }
323
 
324
  /* === Update Plugin Licence Information === */
325
  update_option( $this->_licence_option, $licence );
326
+
327
+ /* === Update Plugin Licence Information === */
328
+ YIT_Upgrade()->force_regenerate_update_transient();
329
  }
330
  return $status;
331
  }
347
  }
348
 
349
  /* === Regenerate Update Plugins Transient === */
350
+ YIT_Upgrade()->force_regenerate_update_transient();
351
 
352
  do_action( 'yit_licence_after_check' );
353
 
plugin-fw/licence/lib/yit-plugin-licence.php CHANGED
@@ -57,6 +57,7 @@ if ( ! class_exists( 'YIT_Plugin_Licence' ) ) {
57
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
58
  */
59
  public function __construct() {
 
60
 
61
  $this->_settings = array(
62
  'parent_page' => 'yit_plugin_panel',
57
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
58
  */
59
  public function __construct() {
60
+ parent::__construct();
61
 
62
  $this->_settings = array(
63
  'parent_page' => 'yit_plugin_panel',
plugin-fw/licence/lib/yit-theme-licence.php CHANGED
@@ -57,6 +57,7 @@ if ( ! class_exists( 'YIT_Theme_Licence' ) ) {
57
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
58
  */
59
  public function __construct() {
 
60
 
61
  $this->_settings = array(
62
  'parent_page' => 'yit_product_panel',
57
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
58
  */
59
  public function __construct() {
60
+ parent::__construct();
61
 
62
  $this->_settings = array(
63
  'parent_page' => 'yit_product_panel',
plugin-fw/templates/metaboxes/types/contactform.php CHANGED
@@ -54,7 +54,7 @@ $options["icon"] = YIT_Plugin_Common::get_awesome_icons();
54
  /* End select Font Awesome */
55
  ?>
56
  <div id="<?php echo $id ?>-container" <?php if ( isset($deps) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
57
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
58
 
59
  <p class="field-row">
60
  <a href="" class="button-secondary add-items"><?php _e( 'Add field', 'yit' ) ?></a>
54
  /* End select Font Awesome */
55
  ?>
56
  <div id="<?php echo $id ?>-container" <?php if ( isset($deps) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
57
+ <?php if( isset( $label ) ):?><label for="<?php echo $id ?>"><?php echo $label ?></label><?php endif;?>
58
 
59
  <p class="field-row">
60
  <a href="" class="button-secondary add-items"><?php _e( 'Add field', 'yit' ) ?></a>