Version Description
- Bug Fix
- Better offer suggestion when your medias library is bigger than 3GB
Download this release
Release Info
Developer | wp_media |
Plugin | Imagify Image Optimizer |
Version | 1.6.1 |
Comparing to | |
See all releases |
Code changes from version 1.6 to 1.6.1
- assets/js/admin.js +10 -4
- assets/js/admin.min.js +20 -20
- imagify.php +2 -2
- inc/admin/ui/bulk.php +1 -1
- inc/functions/admin-ui.php +2 -2
- readme.txt +5 -1
assets/js/admin.js
CHANGED
@@ -443,7 +443,8 @@ jQuery(function($){
|
|
443 |
|
444 |
// Do the ONETIMES Markup
|
445 |
$.each( onetimes, function( index, value ) {
|
446 |
-
var $tpl
|
|
|
447 |
|
448 |
// parent classes
|
449 |
classes = '';
|
@@ -451,12 +452,17 @@ jQuery(function($){
|
|
451 |
classes = ' imagify-offer-selected';
|
452 |
ot_suggested = true;
|
453 |
|
454 |
-
// add this offer as pre-selected item in pre-checkout view
|
455 |
-
var $offer = $( '.imagify-pre-checkout-offers' ).find( '.imagify-offer-onetime' );
|
456 |
-
|
457 |
// populate the Pre-checkout view depending on user_cons
|
458 |
imagify_populate_offer( $offer, value, 'onetime' );
|
459 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
460 |
|
461 |
// populate each offer
|
462 |
$tpl = imagify_populate_offer( $tpl, value, 'onetime', classes );
|
443 |
|
444 |
// Do the ONETIMES Markup
|
445 |
$.each( onetimes, function( index, value ) {
|
446 |
+
var $tpl = $( ot_clone ).clone(),
|
447 |
+
$offer = $( '.imagify-pre-checkout-offers' ).find( '.imagify-offer-onetime' );
|
448 |
|
449 |
// parent classes
|
450 |
classes = '';
|
452 |
classes = ' imagify-offer-selected';
|
453 |
ot_suggested = true;
|
454 |
|
|
|
|
|
|
|
455 |
// populate the Pre-checkout view depending on user_cons
|
456 |
imagify_populate_offer( $offer, value, 'onetime' );
|
457 |
}
|
458 |
+
|
459 |
+
// if too big, populate with the biggest offer available
|
460 |
+
// TODO: create custom offers at this point
|
461 |
+
if ( index === onetimes.length-1 && ot_suggested === false ) {
|
462 |
+
// populate the Pre-checkout view depending on user_cons
|
463 |
+
var tvalue = onetimes[ onetimes.length - 1 ];
|
464 |
+
imagify_populate_offer( $offer, tvalue, 'onetime' );
|
465 |
+
}
|
466 |
|
467 |
// populate each offer
|
468 |
$tpl = imagify_populate_offer( $tpl, value, 'onetime', classes );
|
assets/js/admin.min.js
CHANGED
@@ -1,33 +1,33 @@
|
|
1 |
-
jQuery(function(a){var
|
2 |
-
inputValidator:function(b){return new Promise(function(c,e){""!=a.trim(b)&&b?c():e(imagifyAdmin.labels.signupErrorEmptyEmail)})},preConfirm:function(b){return new Promise(function(c,e){setTimeout(function(){a.get(ajaxurl+
|
3 |
a("#imagify-save-api-key").click(function(b){b.preventDefault();swal({title:imagifyAdmin.labels.saveApiKeyTitle,html:imagifyAdmin.labels.saveApiKeyText,confirmButtonText:imagifyAdmin.labels.saveApiKeyConfirmButtonText,input:"text",allowOutsideClick:!0,showLoaderOnConfirm:!0,customClass:"imagify-sweet-alert imagify-sweet-alert-signup",inputValidator:function(b){return new Promise(function(c,e){""!=a.trim(b)&&b?c():e(imagifyAdmin.labels.ApiKeyErrorEmpty)})},preConfirm:function(b){return new Promise(function(c,
|
4 |
-
e){a.get(ajaxurl+
|
5 |
b.fadeTo(100,0,function(){a(this).slideUp(100,function(){a(this).remove()})});a.get(c.replace("admin-post.php","admin-ajax.php"))});a(".imagify-modal").attr("aria-hidden","true");a(".imagify-modal-trigger").on("click.imagify",function(){var b=a(this),b=b.data("target")||b.attr("href");a(b).css("display","flex").hide().fadeIn(400).attr("aria-hidden","false").attr("tabindex","0").focus().removeAttr("tabindex").addClass("modal-is-open");a("body").addClass("imagify-modal-is-open");return!1});a(document).on("click.imagify",
|
6 |
".imagify-modal .close-btn",function(){a(this).closest(".imagify-modal").fadeOut(400).attr("aria-hidden","true").removeClass("modal-is-open");a(this).closest(".imagify-modal").hasClass("imagify-payment-modal")&&(a(this).closest(".imagify-modal-content").removeClass("imagify-success-viewing imagify-iframe-viewing"),setTimeout(function(){a(".imagify-modal-views").hide();a("#imagify-pre-checkout-view").show()},300));a("body").removeClass("imagify-modal-is-open")}).on("blur.imagify",".imagify-modal .close-btn",
|
7 |
-
function(){var b=a(this).closest(".imagify-modal");"false"===b.attr("aria-hidden")&&b.attr("tabindex","0").focus().removeAttr("tabindex")});a(document).on("click.imagify",".imagify-modal",function(b){a(b.target).filter(".modal-is-open").find(".close-btn").trigger("click.imagify")});a(window).on("keydown.imagify",function(b){if(27==b.keyCode&&0<a(".imagify-modal.modal-is-open").length)return b.preventDefault(),a(".imagify-modal.modal-is-open").find(".close-btn").trigger("click.imagify"),!1});var
|
8 |
-
!1;a("#wp-admin-bar-imagify").hover(function(){if(!0!==
|
9 |
"",e=(a.monthly+"").split("."),b=b.split(".");output+='<span class="imagify-switch-my"><span aria-hidden="'+("monthly"===c?"false":"true")+'" class="imagify-monthly"><span class="imagify-price-big">'+e[0]+'</span> <span class="imagify-price-mini">.'+(1===e[1].length?e[1]+"0":e[1])+'</span></span> <span aria-hidden="'+("yearly"===c?"false":"true")+'" class="imagify-yearly"><span class="imagify-price-big">'+b[0]+'</span> <span class="imagify-price-mini">.'+(1===b[1].length?b[1]+"0":b[1])+"</span></span></span>"}else e=
|
10 |
-
(a+"").split("."),output+='<span class="imagify-price-big">'+e[0]+'</span> <span class="imagify-price-mini">.'+(1===e[1].length?e[1]+"0":e[1])+"</span>";return output},l=function(a,c,d,e){var b=c.additional_gb,f=c.annual_cost,z=c.id,
|
11 |
-
"monthly"));a.find(".imagify-approx-nb").text(5*k);"monthly"===d&&a.find(".imagify-price-add-data").text("$"+b);(a.find(".imagify-payment-btn-select-plan").length?a.find(".imagify-payment-btn-select-plan"):a).attr("data-offer","monthly"===d?'{"'+
|
12 |
n=function(){var b=JSON.parse(a(".imagify-offer-monthly").attr("data-offer")),c=JSON.parse(a(".imagify-offer-onetime").attr("data-offer")),d=0,e=0;a(".imagify-offer-monthly").hasClass("imagify-offer-selected")&&(d=a("#imagify-subscription-monthly").filter(":checked").length?b[Object.keys(b)[0]].prices.monthly:12*b[Object.keys(b)[0]].prices.yearly);a(".imagify-offer-onetime").hasClass("imagify-offer-selected")&&(e=c[Object.keys(c)[0]].price);b=parseFloat(e+d).toFixed(2);a(".imagify-global-amount").text(b);
|
13 |
-
"0.00"==b||0===b?a("#imagify-modal-checkout-btn").attr("disabled","disabled").addClass("imagify-button-disabled"):a("#imagify-modal-checkout-btn").removeAttr("disabled").removeClass("imagify-button-disabled")},F=function(b){b=b.data("nonce");var c={action:"imagify_get_prices",imagifynonce:b},d={action:"imagify_get_images_counts",imagifynonce:b};
|
14 |
prices_datas.monthlies;onetimes=prices_datas.onetimes;mo_user_cons=c.average_month_size.raw/1E6;ot_user_cons=c.total_library_size.raw/1E6;$mo_tpl=a("#imagify-offer-monthly-template");$ot_tpl=a("#imagify-offer-onetime-template");ot_clone=$ot_tpl.html();mo_clone=$mo_tpl.html();mo_html=ot_html="";mo_suggested=ot_suggested=!1;$estim_block=a(".imagify-estimation-block");$estim_block.removeClass("imagify-analyzing");$estim_block.find(".average-month-size").text(c.average_month_size.human);$estim_block.find(".total-library-size").text(c.total_library_size.human);
|
15 |
25>mo_user_cons&&25>ot_user_cons?(a(".imagify-pre-checkout-offers .imagify-modal-title").addClass(".imagify-enough-free"),a(".imagify-offer-selected").removeClass("imagify-offer-selected").find(".imagify-checkbox").removeAttr("checked")):(a(".imagify-enough-free").removeClass(".imagify-enough-free"),a(".imagify-offer-selected").addClass("imagify-offer-selected").find(".imagify-checkbox").attr("checked","checked"));if(null===monthlies||null===onetimes)c=a(".imagify-pre-checkout-offers"),c.hide().attr("aria-hidden",
|
16 |
!0),c.closest(".imagify-modal-views").find(".imagify-popin-message").remove(),c.after('<div class="imagify-popin-message imagify-error"><p>'+imagifyAdmin.labels.errorPriceAPI+"</p></div>");else{a.each(monthlies,function(b,c){if("free"===c.label)return!0;var d=a(mo_clone).clone();if(!1!==mo_suggested&&2<b-mo_suggested)return!0;classes="";if(mo_user_cons<c.quota&&!1===mo_suggested){classes=" imagify-offer-selected";mo_suggested=b;var e=a(".imagify-pre-checkout-offers").find(".imagify-offer-monthly");
|
17 |
-
l(e,c,"monthly")}d=l(d,c,"monthly",classes);mo_html+=d[0].outerHTML});c=a(mo_html).filter(".imagify-offer-selected").prevAll();if(1<c.length){c=c.length-1;var d=a(mo_html);for(i=0;i<c;i++)delete d[i];mo_html="";for(j=0;j<d.length;j++)mo_html+=a("<div/>").append(d[j]).html()}a.each(onetimes,function(b,c){var d=a(ot_clone).clone();classes="";
|
18 |
-
l(e,c,"onetime")
|
19 |
-
a(this).closest(".imagify-offer-line").removeClass("imagify-offer-selected")});n()},B=function(b){b.each(function(){var b=a(this),d;d=b.parent(".imagify-cart-list-switcher").length?b.closest(".imagify-cart"):b.parent(".imagify-small-options").length?b.parent(".imagify-small-options").next(".imagify-pricing-table"):b.closest(".imagify-offer-line");var e=d.find(".imagify-switch-my");"yearly"===b.val()?(d.addClass("imagify-year-selected").removeClass("imagify-month-selected"),
|
20 |
-
"true"),e.find(".imagify-yearly").attr("aria-hidden","false")):(d.addClass("imagify-month-selected").removeClass("imagify-year-selected"),e.find(".imagify-monthly").attr("aria-hidden","false"),e.find(".imagify-yearly").attr("aria-hidden","true"))});n();return b},
|
21 |
-
coupon:b,imagifynonce:g},function(a){c.removeClass("checking");"false"===a.success?(d.text(imagifyAdmin.labels.errorCouponAPI),e.removeClass("validated").addClass("invalid")):a.data.success?(a="percentage"===a.data.coupon_type?a.data.value+"%":"$"+a.data.value,e.removeClass("invalid").addClass("validated"),d.html(imagifyAdmin.labels.successCouponAPI),d.find(".imagify-coupon-offer").text(a),d.find(".imagify-coupon-word").text(b)):(e.removeClass("validated").addClass("invalid"),
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
d=b.data("offer"),e=b.attr("data-offer"),g="imagify-pricing-tab-monthly"===b.closest(".imagify-tab-content").attr("id")?!1:!0,f=g?p.find(".imagify-offer-onetime"):p.find(".imagify-offer-monthly"),b=g?null:b.closest(".imagify-pricing-table").hasClass("imagify-month-selected")?"monthly":"yearly",d=g?
|
26 |
-
"</span>";
|
27 |
n();return!1});a("#imagify-modal-checkout-btn").on("click.imagify",function(){if(!a(this).hasClass("imagify-button-disabled")){var b=a(".imagify-offer-monthly"),c=a(".imagify-offer-onetime"),d={};b.hasClass("imagify-year-selected");b.hasClass("imagify-offer-selected")?(d.monthly=JSON.parse(b.attr("data-offer")),a(".imagify-cart-list-my-choice").show(),prices=d.monthly[Object.keys(d.monthly)[0]].prices,save_price=Math.round(1200*(prices.monthly-prices.yearly))/100,a(".imagify-nb-save-per-year").text("$"+
|
28 |
save_price)):a(".imagify-cart-list-my-choice").hide();c.hasClass("imagify-offer-selected")&&(d.onetime=JSON.parse(c.attr("data-offer")));p.hide().attr("aria-hidden","true");h.fadeIn(300).attr("aria-hidden","false").closest(".imagify-modal-content").addClass("imagify-iframe-viewing");d.period=a(".imagify-offer-monthly").hasClass("imagify-month-selected")?"monthly":"yearly";var b=a("#imagify-payment-iframe"),e=b.attr("src"),c=b.data("src"),g=0,f=0;"object"===typeof d?(d.monthly&&(g=d.monthly[Object.keys(d.monthly)[0]].id),
|
29 |
d.onetime&&(f=d.onetime[Object.keys(d.onetime)[0]].id,f=999==f?d.onetime[Object.keys(d.onetime)[0]].data:f),d.period?(a("#imagify-payment-iframe").data("imagify-api"),e=f,f="yearly"===d.period?g:0,d="monthly"===d.period?g:0,g=a("#imagify-coupon-code").val(),g=""===g?"none":g,parseFloat(a(".imagify-global-amount").text()).toFixed(2),c=c+e+"/"+d+"/"+f+"/"+g+"/",$iframeClone=b.clone(),b.remove(),$iframeClone.attr("src",c),h.html($iframeClone)):D.info("No period defined")):"string"===typeof d&&""!==e&&
|
30 |
(tofind="monthly"===d?"yearly":"monthly",e=e.replace(tofind,d),b.attr("src",e));return!1}});a(".imagify-back-to-plans").on("click.imagify",function(){a(this).closest(".imagify-cart-item").hasClass("imagify-cart-item-onetime")?a(".imagify-offer-onetime").find(".imagify-choose-another-plan").trigger("click.imagify"):a(".imagify-offer-monthly").find(".imagify-choose-another-plan").trigger("click.imagify");return!1});window.addEventListener("message",function(b){var c=b.origin||b.originalEvent.origin;
|
31 |
-
if("https://app.imagify.io"===c||"http://dapp.imagify.io"===c)switch(b.data){case "cancel":a(".imagify-iframe-viewing .close-btn").trigger("click.imagify");a(".imagify-iframe-viewing").removeClass("imagify-iframe-viewing");break;case "back":a(".imagify-iframe-viewing").removeClass("imagify-iframe-viewing");h.hide();p.fadeIn(200);break;case "success":a(".imagify-iframe-viewing").removeClass("imagify-iframe-viewing"),h.hide(),
|
32 |
-
"imagify-success-view"),
|
33 |
"false");b.addClass("imagify-current").attr("aria-selected","true")}return!1})});
|
1 |
+
jQuery(function(a){var u=0<ajaxurl.indexOf("?")?"&":"?",D={log:function(a){"undefined"!==console&&console.log(a)},info:function(a){"undefined"!==console&&console.info(a)}};a("#imagify-signup").click(function(b){b.preventDefault();swal({title:imagifyAdmin.labels.signupTitle,html:imagifyAdmin.labels.signupText,confirmButtonText:imagifyAdmin.labels.signupConfirmButtonText,input:"email",closeOnConfirm:!1,allowOutsideClick:!0,showLoaderOnConfirm:!0,customClass:"imagify-sweet-alert imagify-sweet-alert-signup",
|
2 |
+
inputValidator:function(b){return new Promise(function(c,e){""!=a.trim(b)&&b?c():e(imagifyAdmin.labels.signupErrorEmptyEmail)})},preConfirm:function(b){return new Promise(function(c,e){setTimeout(function(){a.get(ajaxurl+u+"action=imagify_signup&email="+b+"&imagifysignupnonce="+a("#imagifysignupnonce").val()).done(function(a){a.success?c():e(a.data)})},2E3)})}}).then(function(a){swal({title:imagifyAdmin.labels.signupSuccessTitle,html:imagifyAdmin.labels.signupSuccessText,type:"success",customClass:"imagify-sweet-alert"})})});
|
3 |
a("#imagify-save-api-key").click(function(b){b.preventDefault();swal({title:imagifyAdmin.labels.saveApiKeyTitle,html:imagifyAdmin.labels.saveApiKeyText,confirmButtonText:imagifyAdmin.labels.saveApiKeyConfirmButtonText,input:"text",allowOutsideClick:!0,showLoaderOnConfirm:!0,customClass:"imagify-sweet-alert imagify-sweet-alert-signup",inputValidator:function(b){return new Promise(function(c,e){""!=a.trim(b)&&b?c():e(imagifyAdmin.labels.ApiKeyErrorEmpty)})},preConfirm:function(b){return new Promise(function(c,
|
4 |
+
e){a.get(ajaxurl+u+"action=imagify_check_api_key_validity&api_key="+b+"&imagifycheckapikeynonce="+a("#imagifycheckapikeynonce").val()).done(function(a){a.success?c():e(a.data)})})}}).then(function(a){swal({title:imagifyAdmin.labels.ApiKeyCheckSuccessTitle,html:imagifyAdmin.labels.ApiKeyCheckSuccessText,type:"success",customClass:"imagify-sweet-alert"})})});a(".imagify-notice-dismiss").click(function(b){b.preventDefault();var c=a(this);b=c.parents(".imagify-welcome, .imagify-notice");c=c.attr("href");
|
5 |
b.fadeTo(100,0,function(){a(this).slideUp(100,function(){a(this).remove()})});a.get(c.replace("admin-post.php","admin-ajax.php"))});a(".imagify-modal").attr("aria-hidden","true");a(".imagify-modal-trigger").on("click.imagify",function(){var b=a(this),b=b.data("target")||b.attr("href");a(b).css("display","flex").hide().fadeIn(400).attr("aria-hidden","false").attr("tabindex","0").focus().removeAttr("tabindex").addClass("modal-is-open");a("body").addClass("imagify-modal-is-open");return!1});a(document).on("click.imagify",
|
6 |
".imagify-modal .close-btn",function(){a(this).closest(".imagify-modal").fadeOut(400).attr("aria-hidden","true").removeClass("modal-is-open");a(this).closest(".imagify-modal").hasClass("imagify-payment-modal")&&(a(this).closest(".imagify-modal-content").removeClass("imagify-success-viewing imagify-iframe-viewing"),setTimeout(function(){a(".imagify-modal-views").hide();a("#imagify-pre-checkout-view").show()},300));a("body").removeClass("imagify-modal-is-open")}).on("blur.imagify",".imagify-modal .close-btn",
|
7 |
+
function(){var b=a(this).closest(".imagify-modal");"false"===b.attr("aria-hidden")&&b.attr("tabindex","0").focus().removeAttr("tabindex")});a(document).on("click.imagify",".imagify-modal",function(b){a(b.target).filter(".modal-is-open").find(".close-btn").trigger("click.imagify")});a(window).on("keydown.imagify",function(b){if(27==b.keyCode&&0<a(".imagify-modal.modal-is-open").length)return b.preventDefault(),a(".imagify-modal.modal-is-open").find(".close-btn").trigger("click.imagify"),!1});var v=
|
8 |
+
!1;a("#wp-admin-bar-imagify").hover(function(){if(!0!==v){v=!0;var b=a("#wp-admin-bar-imagify-profile-content");b.is(":empty")&&a.get(ajaxurl+u+"action=imagify_get_admin_bar_profile&imagifygetadminbarprofilenonce="+a("#imagifygetadminbarprofilenonce").val()).done(function(c){b.html(c.data);a("#wp-admin-bar-imagify-profile-loading").remove();v=!1})}});if(a("#imagify-pricing-modal").length){var w=a("#imagify-pricing-modal"),x=function(a,c){c||(c=null);output="";if("object"===typeof a){var b=a.yearly+
|
9 |
"",e=(a.monthly+"").split("."),b=b.split(".");output+='<span class="imagify-switch-my"><span aria-hidden="'+("monthly"===c?"false":"true")+'" class="imagify-monthly"><span class="imagify-price-big">'+e[0]+'</span> <span class="imagify-price-mini">.'+(1===e[1].length?e[1]+"0":e[1])+'</span></span> <span aria-hidden="'+("yearly"===c?"false":"true")+'" class="imagify-yearly"><span class="imagify-price-big">'+b[0]+'</span> <span class="imagify-price-mini">.'+(1===b[1].length?b[1]+"0":b[1])+"</span></span></span>"}else e=
|
10 |
+
(a+"").split("."),output+='<span class="imagify-price-big">'+e[0]+'</span> <span class="imagify-price-mini">.'+(1===e[1].length?e[1]+"0":e[1])+"</span>";return output},l=function(a,c,d,e){var b=c.additional_gb,f=c.annual_cost,z=c.id,y=c.label,E=c.monthly_cost,k=c.quota,h=c.cost;c=1E3<=k?k/1E3+" GB":k+" MB";f="monthly"===d?{monthly:E,yearly:Math.round(f/12*100)/100}:h;"undefined"!==typeof e&&a.addClass("imagify-"+d+"-"+y+e);a.find(".imagify-offer-size").text(c);a.find(".imagify-number-block").html(x(f,
|
11 |
+
"monthly"));a.find(".imagify-approx-nb").text(5*k);"monthly"===d&&a.find(".imagify-price-add-data").text("$"+b);(a.find(".imagify-payment-btn-select-plan").length?a.find(".imagify-payment-btn-select-plan"):a).attr("data-offer","monthly"===d?'{"'+y+'":{"id":'+z+',"name":"'+c+'","data":'+k+',"dataf":"'+c+'","imgs":'+5*k+',"prices":{"monthly":'+f.monthly+',"yearly":'+f.yearly+',"add":'+b+"}}}":'{"ot'+y+'":{"id":'+z+',"name":"'+c+'","data":'+k+',"dataf":"'+c+'","imgs":'+5*k+',"price":'+f+"}}");return a},
|
12 |
n=function(){var b=JSON.parse(a(".imagify-offer-monthly").attr("data-offer")),c=JSON.parse(a(".imagify-offer-onetime").attr("data-offer")),d=0,e=0;a(".imagify-offer-monthly").hasClass("imagify-offer-selected")&&(d=a("#imagify-subscription-monthly").filter(":checked").length?b[Object.keys(b)[0]].prices.monthly:12*b[Object.keys(b)[0]].prices.yearly);a(".imagify-offer-onetime").hasClass("imagify-offer-selected")&&(e=c[Object.keys(c)[0]].price);b=parseFloat(e+d).toFixed(2);a(".imagify-global-amount").text(b);
|
13 |
+
"0.00"==b||0===b?a("#imagify-modal-checkout-btn").attr("disabled","disabled").addClass("imagify-button-disabled"):a("#imagify-modal-checkout-btn").removeAttr("disabled").removeClass("imagify-button-disabled")},F=function(b){b=b.data("nonce");var c={action:"imagify_get_prices",imagifynonce:b},d={action:"imagify_get_images_counts",imagifynonce:b};w.find(".imagify-modal-loader").hide().show();a.post(ajaxurl,c,function(b){b.success&&a.post(ajaxurl,d,function(c){c=c.data;prices_datas=b.data;monthlies=
|
14 |
prices_datas.monthlies;onetimes=prices_datas.onetimes;mo_user_cons=c.average_month_size.raw/1E6;ot_user_cons=c.total_library_size.raw/1E6;$mo_tpl=a("#imagify-offer-monthly-template");$ot_tpl=a("#imagify-offer-onetime-template");ot_clone=$ot_tpl.html();mo_clone=$mo_tpl.html();mo_html=ot_html="";mo_suggested=ot_suggested=!1;$estim_block=a(".imagify-estimation-block");$estim_block.removeClass("imagify-analyzing");$estim_block.find(".average-month-size").text(c.average_month_size.human);$estim_block.find(".total-library-size").text(c.total_library_size.human);
|
15 |
25>mo_user_cons&&25>ot_user_cons?(a(".imagify-pre-checkout-offers .imagify-modal-title").addClass(".imagify-enough-free"),a(".imagify-offer-selected").removeClass("imagify-offer-selected").find(".imagify-checkbox").removeAttr("checked")):(a(".imagify-enough-free").removeClass(".imagify-enough-free"),a(".imagify-offer-selected").addClass("imagify-offer-selected").find(".imagify-checkbox").attr("checked","checked"));if(null===monthlies||null===onetimes)c=a(".imagify-pre-checkout-offers"),c.hide().attr("aria-hidden",
|
16 |
!0),c.closest(".imagify-modal-views").find(".imagify-popin-message").remove(),c.after('<div class="imagify-popin-message imagify-error"><p>'+imagifyAdmin.labels.errorPriceAPI+"</p></div>");else{a.each(monthlies,function(b,c){if("free"===c.label)return!0;var d=a(mo_clone).clone();if(!1!==mo_suggested&&2<b-mo_suggested)return!0;classes="";if(mo_user_cons<c.quota&&!1===mo_suggested){classes=" imagify-offer-selected";mo_suggested=b;var e=a(".imagify-pre-checkout-offers").find(".imagify-offer-monthly");
|
17 |
+
l(e,c,"monthly")}d=l(d,c,"monthly",classes);mo_html+=d[0].outerHTML});c=a(mo_html).filter(".imagify-offer-selected").prevAll();if(1<c.length){c=c.length-1;var d=a(mo_html);for(i=0;i<c;i++)delete d[i];mo_html="";for(j=0;j<d.length;j++)mo_html+=a("<div/>").append(d[j]).html()}a.each(onetimes,function(b,c){var d=a(ot_clone).clone(),e=a(".imagify-pre-checkout-offers").find(".imagify-offer-onetime");classes="";ot_user_cons<c.quota&&!1===ot_suggested&&(classes=" imagify-offer-selected",ot_suggested=!0,
|
18 |
+
l(e,c,"onetime"));b===onetimes.length-1&&!1===ot_suggested&&l(e,onetimes[onetimes.length-1],"onetime");d=l(d,c,"onetime",classes);ot_html+=d[0].outerHTML});$mo_tpl.parent().find(".imagify-offer-line")&&$mo_tpl.parent().find(".imagify-offer-line").remove();$mo_tpl.before(mo_html);$ot_tpl.parent().find(".imagify-offer-line")&&$ot_tpl.parent().find(".imagify-offer-line").remove();$ot_tpl.before(ot_html)}w.find(".imagify-modal-loader").fadeOut(300)});n()})},A=function(b){b.each(function(){a(this).is(":checked")?
|
19 |
+
a(this).closest(".imagify-offer-line").addClass("imagify-offer-selected"):a(this).closest(".imagify-offer-line").removeClass("imagify-offer-selected")});n()},B=function(b){b.each(function(){var b=a(this),d;d=b.parent(".imagify-cart-list-switcher").length?b.closest(".imagify-cart"):b.parent(".imagify-small-options").length?b.parent(".imagify-small-options").next(".imagify-pricing-table"):b.closest(".imagify-offer-line");var e=d.find(".imagify-switch-my");"yearly"===b.val()?(d.addClass("imagify-year-selected").removeClass("imagify-month-selected"),
|
20 |
+
e.find(".imagify-monthly").attr("aria-hidden","true"),e.find(".imagify-yearly").attr("aria-hidden","false")):(d.addClass("imagify-month-selected").removeClass("imagify-year-selected"),e.find(".imagify-monthly").attr("aria-hidden","false"),e.find(".imagify-yearly").attr("aria-hidden","true"))});n();return b},m=function(){var b=a("#imagify-coupon-code").val();if(""!==b){var c=a(".imagify-coupon-text"),d=c.find("label"),e=a(".imagify-coupon-section"),g=a("#imagify-get-pricing-modal").data("nonce");c.addClass("checking");
|
21 |
+
a.post(ajaxurl,{action:"imagify_check_coupon",coupon:b,imagifynonce:g},function(a){c.removeClass("checking");"false"===a.success?(d.text(imagifyAdmin.labels.errorCouponAPI),e.removeClass("validated").addClass("invalid")):a.data.success?(a="percentage"===a.data.coupon_type?a.data.value+"%":"$"+a.data.value,e.removeClass("invalid").addClass("validated"),d.html(imagifyAdmin.labels.successCouponAPI),d.find(".imagify-coupon-offer").text(a),d.find(".imagify-coupon-word").text(b)):(e.removeClass("validated").addClass("invalid"),
|
22 |
+
d.text(a.data.detail))})}},q=a(".imagify-offer-line").find(".imagify-checkbox"),C=a(".imagify-payment-modal").find(".imagify-radio-line").find("input");A(q);B(C.filter(":checked"));m();setInterval(function(){n()},1E3);q.on("change.imagify",function(){A(a(this))});C.on("change.imagify",function(){B(a(this))});a("#imagify-get-pricing-modal").on("click.imagify-ajax",function(){F(a(this))});var r=a("#imagify-plans-selection-view"),h=a("#imagify-payment-process-view"),p=a("#imagify-pre-checkout-view"),
|
23 |
+
t=a("#imagify-success-view"),q=a(".imagify-choose-another-plan");a("#imagify-coupon-code").on("blur.imagify",function(){m()}).on("keydown.imagify",function(b){if(13===b.keyCode||32===b.keyCode)return m(),!1;3<=a(this).val().length?a(this).closest(".imagify-coupon-input").addClass("imagify-canbe-validate"):a(this).closest(".imagify-coupon-input").removeClass("imagify-canbe-validate")});a("#imagify-coupon-validate").on("click.imagify",function(){m();a(this).closest(".imagify-canbe-validate").removeClass("imagify-canbe-validate")});
|
24 |
+
r.hide();h.hide();t.hide();q.on("click.imagify",function(){var b=a(this),c=b.data("imagify-choose");b.closest(".imagify-modal-views").hide().attr("aria-hidden","true");h.hide().attr("aria-hidden","true");r.fadeIn(300).attr("aria-hidden","false");var d=setInterval(function(){r.find('a[href="#imagify-pricing-tab-'+("plan"==c?"monthly":"onetime")+'"]').trigger("click.imagify");clearInterval(d);d=null},60);return!1});w.on("click.imagify",".imagify-payment-btn-select-plan",function(){var b=a(this),c=b.closest(".imagify-offer-line"),
|
25 |
+
d=b.data("offer"),e=b.attr("data-offer"),g="imagify-pricing-tab-monthly"===b.closest(".imagify-tab-content").attr("id")?!1:!0,f=g?p.find(".imagify-offer-onetime"):p.find(".imagify-offer-monthly"),b=g?null:b.closest(".imagify-pricing-table").hasClass("imagify-month-selected")?"monthly":"yearly",d=g?x(d[Object.keys(d)[0]].price):x(d[Object.keys(d)[0]].prices,b),h=c.find(".imagify-approx-nb").text(),l=c.find(".imagify-offer-size").text(),m=g?"":'<span class="imagify-price-by">'+c.find(".imagify-price-by").text()+
|
26 |
+
"</span>";r.hide().attr("aria-hidden","true");p.fadeIn(300).attr("aria-hidden","false");f.find(".imagify-number-block").html(d+m);f.find(".imagify-approx-nb").text(h);f.find(".imagify-offer-size").text(l);f.attr("data-offer",e);g||(f.find(".imagify-price-add-data").text(c.find(".imagify-price-add-data").text()),"monthly"===b?f.find("#imagify-subscription-monthly").trigger("click.imagify"):f.find("#imagify-subscription-yearly").trigger("click.imagify"),f.find(".imagify-inline-options").find("input:radio:checked").trigger("change.imagify"));
|
27 |
n();return!1});a("#imagify-modal-checkout-btn").on("click.imagify",function(){if(!a(this).hasClass("imagify-button-disabled")){var b=a(".imagify-offer-monthly"),c=a(".imagify-offer-onetime"),d={};b.hasClass("imagify-year-selected");b.hasClass("imagify-offer-selected")?(d.monthly=JSON.parse(b.attr("data-offer")),a(".imagify-cart-list-my-choice").show(),prices=d.monthly[Object.keys(d.monthly)[0]].prices,save_price=Math.round(1200*(prices.monthly-prices.yearly))/100,a(".imagify-nb-save-per-year").text("$"+
|
28 |
save_price)):a(".imagify-cart-list-my-choice").hide();c.hasClass("imagify-offer-selected")&&(d.onetime=JSON.parse(c.attr("data-offer")));p.hide().attr("aria-hidden","true");h.fadeIn(300).attr("aria-hidden","false").closest(".imagify-modal-content").addClass("imagify-iframe-viewing");d.period=a(".imagify-offer-monthly").hasClass("imagify-month-selected")?"monthly":"yearly";var b=a("#imagify-payment-iframe"),e=b.attr("src"),c=b.data("src"),g=0,f=0;"object"===typeof d?(d.monthly&&(g=d.monthly[Object.keys(d.monthly)[0]].id),
|
29 |
d.onetime&&(f=d.onetime[Object.keys(d.onetime)[0]].id,f=999==f?d.onetime[Object.keys(d.onetime)[0]].data:f),d.period?(a("#imagify-payment-iframe").data("imagify-api"),e=f,f="yearly"===d.period?g:0,d="monthly"===d.period?g:0,g=a("#imagify-coupon-code").val(),g=""===g?"none":g,parseFloat(a(".imagify-global-amount").text()).toFixed(2),c=c+e+"/"+d+"/"+f+"/"+g+"/",$iframeClone=b.clone(),b.remove(),$iframeClone.attr("src",c),h.html($iframeClone)):D.info("No period defined")):"string"===typeof d&&""!==e&&
|
30 |
(tofind="monthly"===d?"yearly":"monthly",e=e.replace(tofind,d),b.attr("src",e));return!1}});a(".imagify-back-to-plans").on("click.imagify",function(){a(this).closest(".imagify-cart-item").hasClass("imagify-cart-item-onetime")?a(".imagify-offer-onetime").find(".imagify-choose-another-plan").trigger("click.imagify"):a(".imagify-offer-monthly").find(".imagify-choose-another-plan").trigger("click.imagify");return!1});window.addEventListener("message",function(b){var c=b.origin||b.originalEvent.origin;
|
31 |
+
if("https://app.imagify.io"===c||"http://dapp.imagify.io"===c)switch(b.data){case "cancel":a(".imagify-iframe-viewing .close-btn").trigger("click.imagify");a(".imagify-iframe-viewing").removeClass("imagify-iframe-viewing");break;case "back":a(".imagify-iframe-viewing").removeClass("imagify-iframe-viewing");h.hide();p.fadeIn(200);break;case "success":a(".imagify-iframe-viewing").removeClass("imagify-iframe-viewing"),h.hide(),t.closest(".imagify-modal-content").addClass("imagify-success-viewing"),t.closest(".imagify-modal").attr("aria-labelledby",
|
32 |
+
"imagify-success-view"),t.fadeIn(200)}},!0)}if(a(".imagify-tabs").length)a(".imagify-tab").on("click.imagify",function(){var b=a(this);if(!b.hasClass("imagify-current")){var c=b.find("a").attr("href")||"#"+b.find("a").attr("aria-controls");b.closest(".imagify-tabs").next(".imagify-tabs-contents").find(".imagify-tab-content").hide().attr("aria-hidden","true");a(c).fadeIn(275).attr("aria-hidden","false");b.closest(".imagify-tabs").find(".imagify-tab").removeClass("imagify-current").attr("aria-selected",
|
33 |
"false");b.addClass("imagify-current").attr("aria-selected","true")}return!1})});
|
imagify.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Imagify
|
4 |
Plugin URI: https://wordpress.org/plugins/imagify/
|
5 |
Description: Dramaticaly reduce image file sizes without losing quality, make your website load faster, boost your SEO and save money on your bandwith using Imagify, the new most advanced image optimization tool.
|
6 |
-
Version: 1.6
|
7 |
Author: WP Media
|
8 |
Author URI: http://wp-media.me
|
9 |
Licence: GPLv2
|
@@ -17,7 +17,7 @@ Copyright 2016 WP Media
|
|
17 |
defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' );
|
18 |
|
19 |
// Imagify defines
|
20 |
-
define( 'IMAGIFY_VERSION' , '1.6' );
|
21 |
define( 'IMAGIFY_SLUG' , 'imagify' );
|
22 |
define( 'IMAGIFY_SETTINGS_SLUG' , IMAGIFY_SLUG . '_settings' );
|
23 |
define( 'IMAGIFY_WEB_MAIN' , 'https://imagify.io' );
|
3 |
Plugin Name: Imagify
|
4 |
Plugin URI: https://wordpress.org/plugins/imagify/
|
5 |
Description: Dramaticaly reduce image file sizes without losing quality, make your website load faster, boost your SEO and save money on your bandwith using Imagify, the new most advanced image optimization tool.
|
6 |
+
Version: 1.6.1
|
7 |
Author: WP Media
|
8 |
Author URI: http://wp-media.me
|
9 |
Licence: GPLv2
|
17 |
defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' );
|
18 |
|
19 |
// Imagify defines
|
20 |
+
define( 'IMAGIFY_VERSION' , '1.6.1' );
|
21 |
define( 'IMAGIFY_SLUG' , 'imagify' );
|
22 |
define( 'IMAGIFY_SETTINGS_SLUG' , IMAGIFY_SLUG . '_settings' );
|
23 |
define( 'IMAGIFY_WEB_MAIN' , 'https://imagify.io' );
|
inc/admin/ui/bulk.php
CHANGED
@@ -73,7 +73,7 @@ function _imagify_display_bulk_page() {
|
|
73 |
<img width="225" height="26" alt="Imagify" src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>imagify-logo.png" class="imagify-logo" />
|
74 |
</div>
|
75 |
|
76 |
-
<?php
|
77 |
|
78 |
<div class="imagify-sub-title">
|
79 |
<svg class="icon icon-bulk" viewBox="0 0 38 36" width="38" height="36" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m233.09 177.21l-5.52 10.248c-.08.145-.018.272-.023.388-.074.193-.033.4-.033.619v21.615c0 .952.601 1.429 1.552 1.429h33.897c.952 0 1.962-.478 1.962-1.429v-21.615c0-.487-.323-.925-.649-1.24l-5.623-9.976c-.405-.726-1.202-1.179-2.034-1.182l-21.486-.068c-.849 0-1.64.464-2.043 1.211m30.424 32.869c0 .173-.378.018-.551.018h-33.897c-.172 0-.14.155-.14-.018v-21.576l33.961-.281c.066.008.186.09.263.128.054.027.205.049.258.073.002.014.106.027.106.041v21.615m-6.153-32.11l4.91 8.835h-14.992v-9.354l9.306.045c.322.001.619.192.776.474m-11.494-.523v9.358h-16.306l4.773-8.892c.155-.289.456-.484.787-.484l10.746.018m7.06 17.12c0 .39-.316.706-.706.706h-12.706c-.39 0-.706-.316-.706-.706 0-.39.316-.706.706-.706h12.706c.39 0 .706.316.706.706" transform="translate(-227-176)" fill="#7a8996"/></g></svg>
|
73 |
<img width="225" height="26" alt="Imagify" src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>imagify-logo.png" class="imagify-logo" />
|
74 |
</div>
|
75 |
|
76 |
+
<?php echo get_imagify_new_to_imagify(); ?>
|
77 |
|
78 |
<div class="imagify-sub-title">
|
79 |
<svg class="icon icon-bulk" viewBox="0 0 38 36" width="38" height="36" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m233.09 177.21l-5.52 10.248c-.08.145-.018.272-.023.388-.074.193-.033.4-.033.619v21.615c0 .952.601 1.429 1.552 1.429h33.897c.952 0 1.962-.478 1.962-1.429v-21.615c0-.487-.323-.925-.649-1.24l-5.623-9.976c-.405-.726-1.202-1.179-2.034-1.182l-21.486-.068c-.849 0-1.64.464-2.043 1.211m30.424 32.869c0 .173-.378.018-.551.018h-33.897c-.172 0-.14.155-.14-.018v-21.576l33.961-.281c.066.008.186.09.263.128.054.027.205.049.258.073.002.014.106.027.106.041v21.615m-6.153-32.11l4.91 8.835h-14.992v-9.354l9.306.045c.322.001.619.192.776.474m-11.494-.523v9.358h-16.306l4.773-8.892c.155-.289.456-.484.787-.484l10.746.018m7.06 17.12c0 .39-.316.706-.706.706h-12.706c-.39 0-.706-.316-.706-.706 0-.39.316-.706.706-.706h12.706c.39 0 .706.316.706.706" transform="translate(-227-176)" fill="#7a8996"/></g></svg>
|
inc/functions/admin-ui.php
CHANGED
@@ -400,8 +400,8 @@ additionnal Gb', 'imagify' ), '<span class="imagify-price-add-data"></span>' );
|
|
400 |
<span class="imagify-price-block">
|
401 |
<span class="imagify-dollars">$</span>
|
402 |
<span class="imagify-number-block">
|
403 |
-
<span class="imagify-price-big"
|
404 |
-
<span class="imagify-price-mini"
|
405 |
</span>
|
406 |
</span>
|
407 |
</div>
|
400 |
<span class="imagify-price-block">
|
401 |
<span class="imagify-dollars">$</span>
|
402 |
<span class="imagify-number-block">
|
403 |
+
<span class="imagify-price-big"></span>
|
404 |
+
<span class="imagify-price-mini"></span>
|
405 |
</span>
|
406 |
</span>
|
407 |
</div>
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: wp_media
|
|
3 |
Tags: compress image, images, performance, optimization, photos, upload, resize, gif, png, jpg, reduce image size, retina
|
4 |
Requires at least: 3.7.0
|
5 |
Tested up to: 4.6.1
|
6 |
-
Stable tag: 1.6
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -135,6 +135,10 @@ When the plugin is disabled, your existing images remain optimized. Backups of t
|
|
135 |
3. Media Page
|
136 |
|
137 |
== Changelog ==
|
|
|
|
|
|
|
|
|
138 |
= 1.6 =
|
139 |
* NEW Features:
|
140 |
* Knowing how many MB/GB you need to optimize your existing and future images is complicated. We love to make things easiers, so Imagify will do it and advise you the best plan.
|
3 |
Tags: compress image, images, performance, optimization, photos, upload, resize, gif, png, jpg, reduce image size, retina
|
4 |
Requires at least: 3.7.0
|
5 |
Tested up to: 4.6.1
|
6 |
+
Stable tag: 1.6.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
135 |
3. Media Page
|
136 |
|
137 |
== Changelog ==
|
138 |
+
= 1.6.1 =
|
139 |
+
* Bug Fix
|
140 |
+
* Better offer suggestion when your medias library is bigger than 3GB
|
141 |
+
|
142 |
= 1.6 =
|
143 |
* NEW Features:
|
144 |
* Knowing how many MB/GB you need to optimize your existing and future images is complicated. We love to make things easiers, so Imagify will do it and advise you the best plan.
|