Imagify Image Optimizer - Version 1.8.1.1

Version Description

  • 2018/07/31 =
  • Bug Fix: an open_basedir error that prevented some users to use the custom folders browser.
  • Bug Fix: an error that prevented to create the backup folder (and other things) on multisite.
Download this release

Release Info

Developer wp_media
Plugin Icon 128x128 Imagify Image Optimizer
Version 1.8.1.1
Comparing to
See all releases

Code changes from version 1.8.0.1 to 1.8.1.1

Files changed (123) hide show
  1. assets/css/admin.css +5 -4
  2. assets/css/admin.min.css +1 -1
  3. assets/css/files-list.css +0 -0
  4. assets/css/files-list.min.css +0 -0
  5. assets/css/pricing-modal.css +7 -3
  6. assets/css/pricing-modal.min.css +1 -1
  7. assets/images/big-blue-check.png +0 -0
  8. assets/images/icon-alert.svg +0 -0
  9. assets/images/icon-arrow-choice.png +0 -0
  10. assets/images/icon-arrow-choice.svg +0 -0
  11. assets/images/icon-doc-image.svg +0 -0
  12. assets/images/icon-external.svg +0 -0
  13. assets/images/icon-level.svg +0 -0
  14. assets/images/icon-load.svg +0 -0
  15. assets/images/icon-lock.png +0 -0
  16. assets/images/icon-lock.svg +0 -0
  17. assets/images/icon-pack.png +0 -0
  18. assets/images/icon-pack.svg +0 -0
  19. assets/images/icon-time.svg +0 -0
  20. assets/images/imagify-logo.png +0 -0
  21. assets/images/imagify-menu-bar.jpg +0 -0
  22. assets/images/lazyload.png +0 -0
  23. assets/images/logo-wprocket.png +0 -0
  24. assets/images/logo-wprocket.svg +0 -0
  25. assets/images/logo-wprocket@2x.png +0 -0
  26. assets/images/pic-ericwaltr.jpg +0 -0
  27. assets/images/pic-srhdesign.jpg +0 -0
  28. assets/images/spinner.gif +0 -0
  29. assets/images/upload-image.png +0 -0
  30. assets/js/admin.js +1 -1
  31. assets/js/admin.min.js +1 -1
  32. assets/js/bulk.js +2 -1
  33. assets/js/bulk.min.js +1 -1
  34. assets/js/chart.js +0 -0
  35. assets/js/chart.min.js +0 -0
  36. assets/js/files-list.js +0 -0
  37. assets/js/files-list.min.js +0 -0
  38. assets/js/formdata-polyfill.js +0 -0
  39. assets/js/formdata-polyfill.min.js +0 -0
  40. assets/js/imagify-gulp.js +0 -0
  41. assets/js/imagify-gulp.min.js +0 -0
  42. assets/js/imagify-wp-retina-2x.js +0 -0
  43. assets/js/imagify-wp-retina-2x.min.js +0 -0
  44. assets/js/options.js +39 -46
  45. assets/js/options.min.js +1 -1
  46. assets/js/pricing-modal.js +231 -72
  47. assets/js/pricing-modal.min.js +1 -1
  48. imagify.php +66 -25
  49. inc/3rd-party/3rd-party.php +12 -12
  50. inc/3rd-party/amazon-s3-and-cloudfront/inc/classes/class-imagify-as3cf-attachment.php +1 -1
  51. inc/3rd-party/amazon-s3-and-cloudfront/inc/classes/class-imagify-as3cf.php +0 -0
  52. inc/3rd-party/hosting/siteground.php +0 -0
  53. inc/3rd-party/hosting/wpengine.php +0 -0
  54. inc/3rd-party/nextgen-gallery/inc/admin/ajax.php +0 -0
  55. inc/3rd-party/nextgen-gallery/inc/admin/bulk.php +0 -0
  56. inc/3rd-party/nextgen-gallery/inc/admin/enqueue.php +0 -0
  57. inc/3rd-party/nextgen-gallery/inc/admin/gallery.php +0 -0
  58. inc/3rd-party/nextgen-gallery/inc/admin/heartbeat.php +0 -0
  59. inc/3rd-party/nextgen-gallery/inc/admin/menu.php +0 -0
  60. inc/3rd-party/nextgen-gallery/inc/classes/class-imagify-ngg-attachment.php +5 -2
  61. inc/3rd-party/nextgen-gallery/inc/classes/class-imagify-ngg-db.php +0 -0
  62. inc/3rd-party/nextgen-gallery/inc/classes/class-imagify-ngg-dynamic-thumbnails-background-process.php +2 -12
  63. inc/3rd-party/nextgen-gallery/inc/common/attachments.php +0 -0
  64. inc/3rd-party/nextgen-gallery/inc/functions/admin-stats.php +0 -0
  65. inc/3rd-party/nextgen-gallery/inc/functions/attachments.php +0 -0
  66. inc/3rd-party/nextgen-gallery/inc/functions/common.php +0 -0
  67. inc/3rd-party/nextgen-gallery/nextgen-gallery.php +11 -11
  68. inc/3rd-party/regenerate-thumbnails/inc/classes/class-imagify-regenerate-thumbnails.php +0 -0
  69. inc/3rd-party/wp-retina-2x/inc/classes/class-imagify-wp-retina-2x-core.php +0 -0
  70. inc/3rd-party/wp-retina-2x/inc/classes/class-imagify-wp-retina-2x.php +0 -0
  71. inc/3rd-party/wp-rocket.php +0 -0
  72. inc/admin/custom-folders.php +0 -0
  73. inc/admin/meta-boxes.php +1 -1
  74. inc/admin/upgrader.php +37 -6
  75. inc/admin/upload.php +5 -5
  76. inc/classes/class-imagify-abstract-attachment.php +16 -11
  77. inc/classes/class-imagify-abstract-background-process.php +139 -0
  78. inc/classes/class-imagify-abstract-cron.php +1 -1
  79. inc/classes/class-imagify-abstract-db.php +3 -3
  80. inc/classes/class-imagify-abstract-options.php +0 -0
  81. inc/classes/class-imagify-admin-ajax-post.php +29 -30
  82. inc/classes/class-imagify-assets.php +0 -1
  83. inc/classes/class-imagify-attachment.php +7 -2
  84. inc/classes/class-imagify-cron-library-size.php +0 -0
  85. inc/classes/class-imagify-cron-rating.php +0 -0
  86. inc/classes/class-imagify-cron-sync-files.php +0 -0
  87. inc/classes/class-imagify-custom-folders.php +14 -13
  88. inc/classes/class-imagify-data.php +0 -0
  89. inc/classes/class-imagify-db.php +0 -0
  90. inc/classes/class-imagify-file-attachment.php +0 -0
  91. inc/classes/class-imagify-files-db.php +0 -0
  92. inc/classes/class-imagify-files-iterator.php +10 -2
  93. inc/classes/class-imagify-files-list-table.php +12 -9
  94. inc/classes/class-imagify-files-recursive-iterator.php +7 -1
  95. inc/classes/class-imagify-files-scan.php +8 -6
  96. inc/classes/class-imagify-files-stats.php +0 -0
  97. inc/classes/class-imagify-filesystem.php +145 -19
  98. inc/classes/class-imagify-folders-db.php +0 -0
  99. inc/classes/class-imagify-notices.php +1 -1
  100. inc/classes/class-imagify-options.php +0 -0
  101. inc/classes/class-imagify-requirements.php +13 -7
  102. inc/classes/class-imagify-settings.php +9 -5
  103. inc/classes/class-imagify-views.php +87 -1
  104. inc/classes/class-imagify.php +5 -0
  105. inc/classes/class-wp-async-request.php +2 -0
  106. inc/classes/class-wp-background-process.php +4 -2
  107. inc/functions/admin-stats.php +5 -2
  108. inc/functions/admin-ui.php +0 -0
  109. inc/functions/admin.php +2 -2
  110. inc/functions/common.php +32 -31
  111. inc/functions/compat-spl-autoload.php +1 -1
  112. inc/functions/compat.php +0 -109
  113. inc/functions/deprecated.php +1 -1
  114. inc/functions/formatting.php +9 -2
  115. readme.txt +14 -3
  116. views/modal-payment.php +12 -10
  117. views/notice-almost-over-quota.php +5 -8
  118. views/page-bulk.php +9 -27
  119. views/page-settings.php +2 -2
  120. views/part-bulk-optimization-header.php +1 -1
  121. views/part-bulk-optimization-infos.php +3 -3
  122. views/part-settings-custom-folders.php +2 -2
  123. views/part-settings-row-custom-folder.php +1 -1
assets/css/admin.css CHANGED
@@ -1028,12 +1028,12 @@ p.imagify-section-title.imagify-section-title {
1028
  vertical-align: middle;
1029
  }
1030
  .column-imagify_optimized_file > * {
1031
- max-width: 235px;
1032
  margin: 0 auto;
1033
  }
1034
  @media (min-width: 1151px) and (max-width: 1800px) {
1035
  .column-imagify_optimized_file.column-imagify_optimized_file {
1036
- width: 235px;
1037
  }
1038
  }
1039
  @media (min-width: 783px) and (max-width: 1150px) {
@@ -1097,14 +1097,15 @@ li.imagify-data-item {
1097
  ul.imagify-datas-list .imagify-data-item span.data,
1098
  ul.imagify-datas-list .imagify-data-item strong {
1099
  float: left;
1100
- width: 50%;
1101
  -webkit-box-sizing: border-box;
1102
  -moz-box-sizing: border-box;
1103
  box-sizing: border-box;
1104
  }
1105
  ul.imagify-datas-list .imagify-data-item span.data {
1106
- text-align: left;
1107
  padding-right: 5px;
 
1108
  }
1109
  .compat-field-imagify .imagify-datas-list .imagify-data-item .data {
1110
  width: 130px;
1028
  vertical-align: middle;
1029
  }
1030
  .column-imagify_optimized_file > * {
1031
+ max-width: 21em;
1032
  margin: 0 auto;
1033
  }
1034
  @media (min-width: 1151px) and (max-width: 1800px) {
1035
  .column-imagify_optimized_file.column-imagify_optimized_file {
1036
+ width: 21em;
1037
  }
1038
  }
1039
  @media (min-width: 783px) and (max-width: 1150px) {
1097
  ul.imagify-datas-list .imagify-data-item span.data,
1098
  ul.imagify-datas-list .imagify-data-item strong {
1099
  float: left;
1100
+ width: 38%;
1101
  -webkit-box-sizing: border-box;
1102
  -moz-box-sizing: border-box;
1103
  box-sizing: border-box;
1104
  }
1105
  ul.imagify-datas-list .imagify-data-item span.data {
1106
+ width: 62%;
1107
  padding-right: 5px;
1108
+ text-align: left;
1109
  }
1110
  .compat-field-imagify .imagify-datas-list .imagify-data-item .data {
1111
  width: 130px;
assets/css/admin.min.css CHANGED
@@ -1 +1 @@
1
- .imagify-count-list li,.imagify-flex{display:-webkit-box;display:-ms-flexbox}.imagify-oh,body.imagify-modal-is-open{overflow:hidden}.imagify-flex{display:flex}.imagify-vcenter{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.imagify-noshrink{-ms-flex-negative:0;flex-shrink:0}.imagify-nogrow{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0}.imagify-wauto{width:auto}.imagify-hauto{height:auto}.imagify-full-width{width:100%}.imagify-start{float:left}.imagify-end{float:right}.imagify-txt-start.imagify-txt-start.imagify-txt-start{text-align:left}.imagify-txt-center.imagify-txt-center.imagify-txt-center{text-align:center}.imagify-txt-end.imagify-txt-end.imagify-txt-end{text-align:right}.imagify-mt0.imagify-mt0{margin-top:0}.imagify-mt1.imagify-mt1{margin-top:1em}.imagify-mt2.imagify-mt2{margin-top:2em}.imagify-mt3.imagify-mt3{margin-top:3em}.imagify-mb0.imagify-mb0{margin-bottom:0}.imagify-mb1.imagify-mb1{margin-bottom:1em}.imagify-mr1.imagify-mr1{margin-right:1em}.imagify-ml2.imagify-ml2{margin-left:2em}.imagify-mr2.imagify-mr2{margin-right:2em}.imagify-pl0.imagify-pl0.imagify-pl0{padding-left:0}.imagify-pb0.imagify-pb0{padding-bottom:0}.imagify-pr1.imagify-pr1{padding-right:1em}.imagify-pr2.imagify-pr2{padding-right:2em}.imagify-clear{clear:both}.imagify-clearfix:after,.imagify-inline-options:after,.imagify-settings-main-content:after,.imagify-settings-section:after{content:"";display:table;width:100%;clear:both}.imagify-setting-optim-level .imagify-inline-options:after{display:none}.imagify-divider{height:1px;margin:20px 0;background:#D2D3D6}.imagify-pipe{display:inline-block;margin:0 .75em;vertical-align:middle;height:15px;width:1px;background:#979797}.imagify-cell,.imagify-cell.va-top,.va-top .imagify-cell{vertical-align:top}.imagify-h3-like.imagify-h3-like.imagify-h3-like{margin-bottom:0;font-size:19px;font-weight:500;color:#1F2332}.imagify-h4-like.imagify-h4-like.imagify-h4-like{font-size:14px;font-weight:700;color:#2E3243}.imagify-count.imagify-count{counter-reset:num}.imagify-count .imagify-count-title{font-weight:700}.imagify-default-settings{color:#73818c;font-weight:400}.imagify-count .imagify-count-title:before{counter-increment:num 1;content:counter(num) ". "}.imagify-count-list{counter-reset:listcount}.imagify-count-list li{display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.imagify-count-list li+li{margin-top:.5em}.imagify-count-list li:before{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-preferred-size:24px;flex-basis:24px;-ms-flex-negative:0;flex-shrink:0;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-right:16px;border:2px solid #40b1d0;width:24px;height:24px;counter-increment:listcount 1;content:counter(listcount);color:#40b1d0;border-radius:50%}.imagify-table{display:table;width:100%}.imagify-cell{display:table-cell;padding:10px}.imagify-bulk-submit .imagify-cell{padding-top:0}.imagify-spinner{display:inline-block;width:20px;height:20px;margin-right:5px;vertical-align:middle;background:url(../images/spinner.gif) 0 0/20px 20px no-repeat rgba(0,0,0,0);opacity:.7}.spinner.imagify-hidden{width:0;margin:4px 0 0}.imagify-primary.imagify-primary.imagify-primary{color:#40b1d0}.imagify-secondary.imagify-secondary.imagify-secondary,.imagify-valid{color:#8BC34A}.misc-pub-section.misc-pub-imagify h4{font-size:14px;margin-top:5px;margin-bottom:0}.imagify-chart{position:relative;top:1px;display:inline-block;vertical-align:middle}.imagify-chart-container{position:relative;display:inline-block;margin-right:5px}.imagify-chart-container canvas{display:block}.imagify-settings .button,.imagify-settings a,.imagify-settings input,.imagify-welcome .button,.imagify-welcome a,.imagify-weolcome input{-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.imagify-settings a{color:#40b1d0}.imagify-settings,.imagify-settings p,.imagify-settings th{color:#5F758E}.imagify-button-primary.imagify-button-primary,.imagify-button-secondary.imagify-button-secondary,.imagify-button.imagify-button,.imagify-notice .button,.imagify-settings .button,.imagify-welcome .button{height:auto;padding:11px 22px;border:0;font-size:14px;font-weight:600;text-transform:uppercase;letter-spacing:.01em;word-spacing:.01em;-webkit-box-shadow:0 3px 0 rgba(0,0,0,.15);box-shadow:0 3px 0 rgba(0,0,0,.15);border-radius:3px;cursor:pointer;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.button-primary.button-mini{padding:2px 10px}.imagify-settings .button.button-mini-flat{padding:3px 6px 5px;font-size:12px;-webkit-box-shadow:none!important;box-shadow:none!important;line-height:1.2}.imagify-settings .button.button-mini-flat:focus,.imagify-settings .button.button-mini-flat:hover{-webkit-box-shadow:none!important;box-shadow:none!important}.imagify-button-ghost.imagify-button-ghost,.imagify-title .button-ghost.button-ghost{padding:2px 9px;border:1px solid #40B1D0;font-size:12px;font-weight:400;color:#40B1D0;background:0 0;-webkit-box-shadow:none;box-shadow:none}.imagify-button-ghost.imagify-button-ghost:focus,.imagify-button-ghost.imagify-button-ghost:hover,.imagify-title .button-ghost.button-ghost:focus,.imagify-title .button-ghost.button-ghost:hover{border-color:transparent;color:#000;background:#40B1D0}.imagify-button-ghost.imagify-button-ghost:focus,.imagify-button-ghost.imagify-button-ghost:hover{color:#FFF}.imagify-button-medium.imagify-button-medium{text-transform:uppercase;letter-spacing:.1em;padding:3px 10px;font-weight:700}.imagify-button-medium.imagify-button-ghost{border-width:2px}[class*=imagify-] .button .dashicons{margin-right:5px;vertical-align:middle}.imagify-button-primary.imagify-button-primary,.imagify-settings .button-primary.button-primary,.imagify-welcome .button-primary.button-primary{background:#40B1D0;color:#FFF;-webkit-box-shadow:0 3px 0 rgba(51,142,166,1);box-shadow:0 3px 0 rgba(51,142,166,1);text-shadow:0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799!important}.imagify-button-secondary.imagify-button-secondary{background:#8BC34A;color:#FFF;-webkit-box-shadow:0 3px 0 #6F9C3B;box-shadow:0 3px 0 #6F9C3B;text-shadow:0 -1px 1px #6F9C3B,1px 0 1px #6F9C3B,0 1px 1px #6F9C3B!important}.imagify-button-primary.imagify-button-primary:focus,.imagify-button-primary.imagify-button-primary:hover,.imagify-settings .button-primary:focus,.imagify-settings .button-primary:hover,.imagify-welcome .button-primary:focus,.imagify-welcome .button-primary:hover{background:#338ea6;-webkit-box-shadow:0 3px 0 #1f7a92;box-shadow:0 3px 0 #1f7a92}.imagify-button-secondary.imagify-button-secondary:focus,.imagify-button-secondary.imagify-button-secondary:hover{background:#6F9C3B;color:#FFF}.imagify-button-light.imagify-button-light{background:#FFF;color:#4a4a4a;-webkit-box-shadow:0 2px 0 rgba(0,0,0,.2);box-shadow:0 2px 0 rgba(0,0,0,.2)}.imagify-block-secondary .imagify-button-light.imagify-button-light{color:#6F9C3B}.imagify-button-light.imagify-button-light:focus,.imagify-button-light.imagify-button-light:hover{color:#FFF;background:rgba(0,0,0,.2)}.button.imagify-button-clean,.imagify-button-clean{padding:0;background:0 0;-webkit-box-shadow:none;box-shadow:none}.imagify-button-clean .dashicons-plus{width:32px;height:25px}.imagify-button-clean .dashicons-plus:before{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:25px;height:22px;margin-left:2px;padding-top:3px;font-size:17px;background:#40B1D0;color:#FFF;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.button.imagify-button-clean:active,.button.imagify-button-clean:focus,.button.imagify-button-clean:hover,.button.imagify-button-clean[disabled]{background:0 0!important;color:#343A49;-webkit-box-shadow:none;box-shadow:none}.button.imagify-button-clean:focus .dashicons-plus:before,.button.imagify-button-clean:hover .dashicons-plus:before{background:#343A49}button.imagify-link-like{border:0;padding:0;color:inherit;text-decoration:underline;font-size:13px;-webkit-box-shadow:none;box-shadow:none;background:0 0;cursor:pointer}.imagify-section-positive .imagify-button-light{color:#709A41}.imagify-button.imagify-button-big{font-size:15px;padding:11px 30px}.imagify-button-big .dashicons{font-size:1.45em;margin-right:6px;margin-left:-4px}.imagify-button-primary.imagify-button-primary .dashicons,.imagify-button-secondary.imagify-button-secondary .dashicons,.imagify-button.imagify-button .dashicons,.imagify-notice .button .dashicons,.imagify-settings .button .dashicons,.imagify-welcome .button .dashicons{vertical-align:middle}[class*=imagify-] .button-text{display:inline-block;vertical-align:middle}.media-frame-content .imagify-button-primary,.wp_attachment_image .imagify-button-primary{padding:0 10px 1px;margin:0 5px 2px 0;font-size:13px;line-height:26px;-webkit-box-shadow:0 3px 0 rgba(51,142,166,1);box-shadow:0 3px 0 rgba(51,142,166,1)}.wp_attachment_image .imagify-button-primary{float:left}.imagify-title.imagify-title{position:relative;padding:10px 30px;font-size:23px;background:#1F2332;color:#FFF}.imagify-welcome .imagify-logo{opacity:1}.imagify-welcome .imagify-title{display:-webkit-box;display:-ms-flexbox;display:flex;padding:20px 30px}.imagify-settings .imagify-title{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.imagify-settings .imagify-logo-block{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-negative:0;flex-shrink:0;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;padding:0;margin-right:35px;color:inherit}.imagify-logo-block sup{color:#1F2332}.imagify-settings .imagify-title+.imagify-notice{margin:0;border-right:1px solid #D9D9D9;padding-top:15px;padding-bottom:15px}.imagify-title .title-text{font-size:28px;font-weight:700;color:#FFF}.imagify-lb-icon{padding-right:18px}.imagify-lb-text img{margin-bottom:.15em}.imagify-lb-text{font-size:23px;font-weight:700;color:#FFF}.imagify-logo{display:block;vertical-align:top;opacity:.4}.imagify-section,.imagify-settings div.submit,.imagify-sub-header,.imagify-sub-title.imagify-sub-title{margin:0;padding:20px;background:#F2F5F7}.imagify-section-positive,.imagify-sub-title.imagify-sub-title{padding-left:40px}.imagify-section-positive{background:#8cc152;color:#FFF}.imagify-section-positive p{color:#FFF}.imagify-section-gray{background:#D9E4EB}.imagify-section-gray .imagify-count-title{color:#4a4a4a}.imagify-section p:first-child{margin-top:0}.imagify-section p:last-child{margin-bottom:0}.imagify-settings .imagify-documentation-link-box{display:-webkit-box;display:-ms-flexbox;display:flex;padding:12px 13px 14px;border:1px solid #40b1d0;color:#E5EBEF;border-radius:3px}.imagify-documentation-link-icon{width:23px;height:31px;font-size:2.6em;margin-right:15px;line-height:1.3}.imagify-documentation-link-box span{font-size:12px}.imagify-documentation-link-box a{font-weight:700}@media (max-width:1120px){.imagify-settings .imagify-title{-ms-flex-wrap:wrap;flex-wrap:wrap}}.imagify-settings-section{padding:10px 20px}.imagify-account-info-col .imagify-settings-section{padding-right:0}.imagify-settings-main-content,.imagify-welcome .imagify-settings-section{border:1px solid #D9D9D9;border-top-width:0;background:#FFF}.imagify-settings-main-content{padding-bottom:20px}.imagify-settings-main-content p{font-size:14px}.imagify-settings-main-content+.imagify-settings-main-content{margin-top:20px;border-top-width:1px}.imagify-br{line-height:2}p.imagify-section-title.imagify-section-title{font-size:20px;margin-top:-.3em;margin-bottom:-.6em}.imagify-rate-us.imagify-rate-us{text-align:right;margin:-1em -2.4em -1em 0;color:#FFF}.imagify-rate-us a{color:#40B1D0}.imagify-rate-us .stars{display:inline-block;margin:2px 0 0 10px;text-decoration:none;letter-spacing:.2em;vertical-align:-1px}.imagify-rate-us .stars .dashicons:before{font-size:18px}.imagify-rate-us a:focus,.imagify-rate-us a:hover{color:#FEE102}@media (max-width:1220px){.imagify-rate-us.imagify-rate-us{position:static;margin-bottom:0;text-align:left}.imagify-rate-us.imagify-rate-us br{display:none}.imagify-rate-us .stars{display:block;margin-left:0}}.imagify-important{color:#F5A623}.imagify-settings .imagify-success,.imagify-success{color:#8BC34A}.imagify-info,.imagify-info a{color:#7A8996;font-size:12px}.imagify-info{position:relative;display:inline-block;padding-left:25px}.imagify-info .dashicons{position:absolute;left:0;top:0;color:#40B1D0}.imagify-checkbox.imagify-checkbox:checked,.imagify-checkbox.imagify-checkbox:not(:checked),.imagify-settings.imagify-settings [type=checkbox]:checked,.imagify-settings.imagify-settings [type=checkbox]:not(:checked){position:absolute;opacity:.01}.imagify-checkbox.imagify-checkbox:checked:focus,.imagify-checkbox.imagify-checkbox:not(:checked):focus,.imagify-settings.imagify-settings [type=checkbox]:checked:focus,.imagify-settings.imagify-settings [type=checkbox]:not(:checked):focus{-webkit-box-shadow:none!important;box-shadow:none!important;outline:0!important;border:0!important}.imagify-checkbox.imagify-checkbox:checked+label,.imagify-checkbox.imagify-checkbox:not(:checked)+label,.imagify-settings [type=checkbox]:checked+label,.imagify-settings [type=checkbox]:not(:checked)+label{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:24px;padding-left:40px;cursor:pointer;font-size:14px;font-weight:700;color:#2E3243}.imagify-checkbox.imagify-checkbox:checked+label:before,.imagify-checkbox.imagify-checkbox:not(:checked)+label:before,.imagify-settings [type=checkbox]:checked+label:before,.imagify-settings [type=checkbox]:not(:checked)+label:before{content:'';position:absolute;left:0;top:0;width:22px;height:22px;border:2px solid #8BA6B4;background:#FFF;border-radius:3px}.imagify-checkbox.imagify-checkbox:checked+label:after,.imagify-checkbox.imagify-checkbox:not(:checked)+label:after,.imagify-settings [type=checkbox]:checked+label:after,.imagify-settings [type=checkbox]:not(:checked)+label:after{content:"✓";position:absolute;font-size:1.4em;top:-2px;left:4.5px;color:#8BA6B4;font-weight:400;-webkit-transition:all .2s;-o-transition:all .2s;transition:all .2s}.imagify-checkbox.imagify-checkbox[disabled]:checked+label:before,.imagify-checkbox.imagify-checkbox[disabled]:not(:checked)+label:before,.imagify-settings [type=checkbox][disabled]:checked+label:before,.imagify-settings [type=checkbox][disabled]:not(:checked)+label:before{border-color:#ccc;background:#ddd}.imagify-checkbox.imagify-checkbox:not(:checked)+label:after,.imagify-settings [type=checkbox]:not(:checked)+label:after{opacity:0;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.imagify-checkbox.imagify-checkbox:checked+label:after,.imagify-settings [type=checkbox]:checked+label:after{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.medium.imagify-checkbox:checked+label:before,.medium.imagify-checkbox:not(:checked)+label:before{width:22px;height:22px;border-width:1.5px;border-radius:2px;margin-top:0}.medium.imagify-checkbox:checked+label:after,.medium.imagify-checkbox:not(:checked)+label:after{font-size:1.1em;left:-17px;top:3px}.imagify-settings .mini[type=checkbox]:checked+label:before,.imagify-settings .mini[type=checkbox]:not(:checked)+label:before,.mini.imagify-checkbox:checked+label:before,.mini.imagify-checkbox:not(:checked)+label:before{width:15px;height:15px;border-width:1px;border-radius:2px;margin-top:0}.imagify-settings .mini[type=checkbox]:checked+label:after,.imagify-settings .mini[type=checkbox]:not(:checked)+label:after,.mini.imagify-checkbox:checked+label:after,.mini.imagify-checkbox:not(:checked)+label:after{font-size:.9em;left:-21px;top:-.5px}.imagify-checkbox.imagify-checkbox:checked:focus+label:before,.imagify-checkbox.imagify-checkbox:not(:checked):focus+label:before,.imagify-settings [type=checkbox]:checked:focus+label:before,.imagify-settings [type=checkbox]:not(:checked):focus+label:before{border-style:dotted;border-color:#40b1d0}.imagify-check-group{padding-left:2px;margin-bottom:0}.imagify-check-group.imagify-is-scrollable{max-height:15em;overflow-y:auto;padding:8px;margin:1.5em 0 0 -8px;background:#F4F7F9;border:1px solid #D2D3D6;border-radius:3px}.imagify-is-scrollable legend+p{margin-top:0}.imagify-is-scrollable [type=checkbox]:checked+label:before,.imagify-is-scrollable [type=checkbox]:not(:checked)+label:before{background:#F4F7F9}.imagify-settings .imagify-check-group.imagify-check-group label{color:#338EA6;font-weight:500}.imagify-inline-options{position:relative;display:table;width:100%;max-width:600px;border-collapse:collapse}.imagify-inline-options input[type=radio]:checked,.imagify-inline-options input[type=radio]:not(:checked){position:absolute;left:5px;top:5px;display:none}.imagify-inline-options input[type=radio]:checked+label,.imagify-inline-options input[type=radio]:not(:checked)+label{position:relative;display:table-cell;padding:13px 10px;text-align:center;font-weight:600;font-size:16px;text-transform:uppercase;letter-spacing:.1em;color:#FFF;background:#2E3243;-webkit-box-shadow:0 -3px 0 rgba(0,0,0,.1) inset;box-shadow:0 -3px 0 rgba(0,0,0,.1) inset;z-index:2;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.imagify-inline-options input[type=radio]:checked+label:first-of-type,.imagify-inline-options input[type=radio]:not(:checked)+label:first-of-type{border-radius:3px 0 0 3px}.imagify-inline-options input[type=radio]:checked+label:last-of-type,.imagify-inline-options input[type=radio]:not(:checked)+label:last-of-type{border-radius:0 3px 3px 0}.imagify-inline-options input[type=radio]:checked+label{background:#8BC34A}.imagify-inline-options .imagify-info{margin-top:15px}.imagify-account-info-col,.imagify-col.imagify-col.imagify-account-info-col{width:380px;max-width:100%;padding:0 20px 0 0}.imagify-col.imagify-col.imagify-shared-with-account-col,.imagify-shared-with-account-col{width:calc(100% - 380px);padding:0}.imagify-account-info-col .imagify-options-title{padding:24px 26px;color:#FFF;background:#1F2332}.imagify-block-secondary{padding:26px 26px 35px;border:1px solid #75A345;background:#8BC34A;border-radius:3px;color:#FFF}.imagify-account-info-col .imagify-block-secondary.imagify-block-secondary h3,.imagify-block-secondary.imagify-block-secondary p{color:inherit}.imagify-account-info-col .imagify-col-content h3:first-child{margin-top:0}.imagify-account-info-col .imagify-col-content h3{font-size:19px}.imagify-account-info-col .imagify-col-content p{margin:1.5em 0}.imagify-account-info-col .imagify-col-content p:first-child{margin-top:0}.imagify-user-plan-label{float:right;margin-top:-4px;padding:2px 10px;border:2px solid #40B1D0;font-size:14px;text-transform:uppercase;letter-spacing:.02em;color:#40B1D0;border-radius:3px}.imagify-modal .h2,.imagify-modal .h3{letter-spacing:.075em;text-align:center;font-weight:400}.imagify-user-plan-label:empty{display:none}.imagify-columns{overflow:hidden;padding:15px 0;counter-reset:cols}.imagify-columns [class^=col-]{float:left;-webkit-box-sizing:border-box;box-sizing:border-box}.imagify-columns .col-1-3{width:33.333%;padding-left:28px}.imagify-columns .col-2-3{width:66.666%;padding-left:28px}.imagify-columns .col-1-2{width:50%;padding:0 20px}@media (max-width:830px){.imagify-columns [class^=col-]{float:none;margin-bottom:1.5em}.imagify-columns .col-1-2,.imagify-columns .col-1-3{width:auto;padding:0 28px;clear:both;padding-top:1em}}.column-imagify_optimized_file.column-imagify_optimized_file{width:300px;text-align:center;vertical-align:middle}.column-imagify_optimized_file>*{max-width:235px;margin:0 auto}@media (min-width:1151px) and (max-width:1800px){.column-imagify_optimized_file.column-imagify_optimized_file{width:235px}}@media (min-width:783px) and (max-width:1150px){.column-imagify_optimized_file.column-imagify_optimized_file{width:13em}table.media .column-title .has-media-icon~.row-actions.row-actions{margin-left:0}}@media (max-width:782px){table.media .column-imagify_optimized_file.column-imagify_optimized_file{text-align:left}table.media .imagify-datas-actions-links,table.media .imagify-datas-more-action{text-align:center}table.media .column-imagify_optimized_file .imagify-datas-actions-links a,table.media .column-imagify_optimized_file>*{max-width:100%;margin-left:0}}@media (min-width:783px) and (max-width:1150px),(max-width:360px){table.media .imagify-hide-if-small{position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip:rect(0 0 0 0);border:0;word-wrap:normal!important}}.compat-field-imagify .label{vertical-align:top}.compat-field-imagify ul.imagify-datas-list{margin-top:7px;font-size:11px}ul.imagify-datas-list.imagify-datas-list{margin:0 auto;color:#555;font-size:10px}ul.imagify-datas-list .big{font-size:12px;color:#40B1D0}.imagify-data-item{overflow:hidden}li.imagify-data-item{clear:both;margin-bottom:2px}ul.imagify-datas-list .imagify-data-item span.data,ul.imagify-datas-list .imagify-data-item strong{float:left;width:50%;-webkit-box-sizing:border-box;box-sizing:border-box}ul.imagify-datas-list .imagify-data-item span.data{text-align:left;padding-right:5px}.compat-field-imagify .imagify-datas-list .imagify-data-item .data{width:130px;text-align:left;font-weight:700}ul.imagify-datas-list .imagify-data-item strong{text-align:left;padding-left:5px}.media-sidebar .imagify-datas-list .imagify-data-item .data{width:auto;float:none}.media-sidebar .imagify-datas-list .imagify-data-item strong{display:inline-block;width:auto;float:none}.media-sidebar .imagify-datas-list .imagify-data-item .imagify-chart{float:left}.imagify-datas-more-action.imagify-datas-more-action{margin:.4em auto;background:-webkit-gradient(linear,left top,left bottom,from(transparent),color-stop(49%,transparent),color-stop(50%,rgba(0,0,0,.075)),color-stop(58%,rgba(0,0,0,.075)),color-stop(58%,transparent),to(transparent));background:-o-linear-gradient(top,transparent,transparent 49%,rgba(0,0,0,.075) 50%,rgba(0,0,0,.075) 58%,transparent 58%,transparent);background:linear-gradient(to bottom,transparent,transparent 49%,rgba(0,0,0,.075) 50%,rgba(0,0,0,.075) 58%,transparent 58%,transparent)}.imagify-datas-more-action a{display:inline-block;padding:0 5px;background:#40B1D0;color:#FFF;text-transform:uppercase;font-size:9px;font-weight:700;line-height:1.9;text-decoration:none}.imagify-datas-more-action a.is-open{background:#555}.imagify-datas-more-action a.is-open .dashicons{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.imagify-datas-more-action a .dashicons{font-size:14px;vertical-align:middle;line-height:.8}.imagify-datas-more-action a .dashicons:before{vertical-align:middle;line-height:20px}.imagify-datas-more-action .the-text{display:inline-block;vertical-align:middle;height:auto;line-height:inherit}ul.imagify-datas-details.imagify-datas-details{margin:.7em auto}.imagify-datas-details strong{color:#40B1D0}.imagify-datas-details .original{color:#555}.imagify-datas-actions-links{overflow:hidden;border-top:2px solid transparent;padding-top:5px;font-size:8px}.nggform .imagify-datas-actions-links{position:relative;z-index:2}.nggform .row-actions{z-index:1}.imagify-datas-actions-links a{position:relative;display:inline-block;padding-left:17px;text-decoration:none;font-weight:600}.compat-field-imagify .imagify-datas-actions-links{max-width:300px}.misc-pub-imagify .imagify-datas-actions-links{border-top:2px solid #f2f2f2;padding-bottom:5px}.column-imagify_optimized_file .imagify-datas-actions-links a{margin:0 .7em;padding-left:15px}.compat-field-imagify .imagify-datas-actions-links a,.misc-pub-imagify .imagify-datas-actions-links a{font-size:10px;float:left;width:50%}.media-sidebar .compat-field-imagify .imagify-datas-actions-links a,.submitbox .misc-pub-imagify .imagify-datas-actions-links a{display:block;width:auto;float:none}.imagify-datas-actions-links a:only-child{float:none;width:auto}.imagify-datas-details.is-open+.imagify-datas-actions-links{border-top-color:rgba(0,0,0,.075)}.imagify-datas-actions-links .dashicons{position:absolute;left:0;top:4px;width:12px;margin-right:2px;font-size:11px}.imagify-account,.imagify-account-link{padding-right:15px}.imagify-meteo-icon{display:inline-block;height:38px;vertical-align:middle;margin-right:10px}.imagify-user-plan{color:#40b1d0}.imagify-meteo-title.imagify-meteo-title{color:#FFF;font-size:17px}.imagify-space-left>p{color:#FFF}[class^=imagify-bar-]{position:relative;height:8px;width:100%;background:#60758D;color:#FFF;font-size:10px}.imagify-progress{height:8px;-webkit-transition:width .3s;-o-transition:width .3s;transition:width .3s}.imagify-bar-positive .imagify-progress{background:#8CC152}.imagify-bar-positive .imagify-barnb{color:#8CC152}.imagify-bar-primary .imagify-progress{background:#40B1D0}.imagify-bar-primary .imagify-barnb{color:#40B1D0}.imagify-bar-negative .imagify-progress{background:#D2D3D6}.imagify-bar-negative .imagify-barnb{color:#7A8996}.imagify-bar-neutral .imagify-progress{background:#F5A623}.imagify-space-left .imagify-bar-negative .imagify-progress{background:#C51162}.imagify-btn-ghost{display:inline-block;height:auto;padding:7px 10px;border:1px solid #FFF;text-align:center;background:0 0;color:#FFF;border-radius:3px;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.imagify-btn-ghost:focus,.imagify-btn-ghost:hover{background:#FFF;color:#888}.imagify-error{background:#D0021B;color:#FFF}.imagify-settings-section .imagify-error{display:inline-block;padding:7px 10px;margin:10px 0 0 45px;border-radius:3px}.imagify-settings-section .imagify-error code{font-weight:400}.imagify-settings-section .imagify-error.hidden{display:none}.imagify-warning{background:#f5a623;color:#FFF;text-shadow:0 0 2px rgba(0,0,0,.2)}.imagify-modal{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.js .imagify-modal{display:none;position:fixed;top:0;right:0;bottom:0;left:0;background-color:#1F2332;background-color:rgba(31,35,50,.95);z-index:99999}.imagify-modal-content{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:800px;max-width:95%;max-height:90vw;overflow:auto;padding:20px 25px;margin:1em auto;background:#FFF;-webkit-box-shadow:1px 1px 4px rgba(0,0,0,.7);box-shadow:1px 1px 4px rgba(0,0,0,.7);border-radius:3px}#imagify-visual-comparison .imagify-modal-content,.imagify-visual-comparison .imagify-modal-content{max-width:1400px;background:0 0;padding:5px;-webkit-box-shadow:none;box-shadow:none;border-radius:0}.imagify-modal .h2{margin:.5em 0;color:#8ba6b4;font-size:24px}.imagify-modal .h3{color:#40b1d0;font-size:18px}.imagify-modal .close-btn{display:none;visibility:hidden;position:absolute;right:20px;top:20px;font-size:1.2em;border:0;background:0 0;border-radius:0;cursor:pointer}.imagify-modal .close-btn i{margin-left:-2px}.imagify-modal .close-btn:focus,.imagify-modal .close-btn:hover{color:#40b1d0}.js .imagify-modal .close-btn{display:block;visibility:visible}.imagify-visual-comparison .close-btn,.wp_attachment_image #imagify-visual-comparison .close-btn{top:0}.imagify-visual-comparison .imagify-modal-content,.wp_attachment_image #imagify-visual-comparison .imagify-modal-content{padding-top:40px}.imagify-col{float:left;width:50%;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-preferred-size:50%;flex-basis:50%;padding-right:20px}.imagify-col+.imagify-col{padding-right:0;padding-left:20px}.imagify-col:target{-webkit-animation:hello 1s 3 linear backwards;animation:hello 1s 3 linear backwards}@-webkit-keyframes hello{0%,100%{background:#FFF}50%{background:#F4F7F9}}@keyframes hello{0%,100%{background:#FFF}50%{background:#F4F7F9}}
1
+ .imagify-count-list li,.imagify-flex{display:-webkit-box;display:-ms-flexbox}.imagify-oh,body.imagify-modal-is-open{overflow:hidden}.imagify-flex{display:flex}.imagify-vcenter{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.imagify-noshrink{-ms-flex-negative:0;flex-shrink:0}.imagify-nogrow{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0}.imagify-wauto{width:auto}.imagify-hauto{height:auto}.imagify-full-width{width:100%}.imagify-start{float:left}.imagify-end{float:right}.imagify-txt-start.imagify-txt-start.imagify-txt-start{text-align:left}.imagify-txt-center.imagify-txt-center.imagify-txt-center{text-align:center}.imagify-txt-end.imagify-txt-end.imagify-txt-end{text-align:right}.imagify-mt0.imagify-mt0{margin-top:0}.imagify-mt1.imagify-mt1{margin-top:1em}.imagify-mt2.imagify-mt2{margin-top:2em}.imagify-mt3.imagify-mt3{margin-top:3em}.imagify-mb0.imagify-mb0{margin-bottom:0}.imagify-mb1.imagify-mb1{margin-bottom:1em}.imagify-mr1.imagify-mr1{margin-right:1em}.imagify-ml2.imagify-ml2{margin-left:2em}.imagify-mr2.imagify-mr2{margin-right:2em}.imagify-pl0.imagify-pl0.imagify-pl0{padding-left:0}.imagify-pb0.imagify-pb0{padding-bottom:0}.imagify-pr1.imagify-pr1{padding-right:1em}.imagify-pr2.imagify-pr2{padding-right:2em}.imagify-clear{clear:both}.imagify-clearfix:after,.imagify-inline-options:after,.imagify-settings-main-content:after,.imagify-settings-section:after{content:"";display:table;width:100%;clear:both}.imagify-setting-optim-level .imagify-inline-options:after{display:none}.imagify-divider{height:1px;margin:20px 0;background:#D2D3D6}.imagify-pipe{display:inline-block;margin:0 .75em;vertical-align:middle;height:15px;width:1px;background:#979797}.imagify-cell,.imagify-cell.va-top,.va-top .imagify-cell{vertical-align:top}.imagify-h3-like.imagify-h3-like.imagify-h3-like{margin-bottom:0;font-size:19px;font-weight:500;color:#1F2332}.imagify-h4-like.imagify-h4-like.imagify-h4-like{font-size:14px;font-weight:700;color:#2E3243}.imagify-count.imagify-count{counter-reset:num}.imagify-count .imagify-count-title{font-weight:700}.imagify-default-settings{color:#73818c;font-weight:400}.imagify-count .imagify-count-title:before{counter-increment:num 1;content:counter(num) ". "}.imagify-count-list{counter-reset:listcount}.imagify-count-list li{display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.imagify-count-list li+li{margin-top:.5em}.imagify-count-list li:before{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-preferred-size:24px;flex-basis:24px;-ms-flex-negative:0;flex-shrink:0;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-right:16px;border:2px solid #40b1d0;width:24px;height:24px;counter-increment:listcount 1;content:counter(listcount);color:#40b1d0;border-radius:50%}.imagify-table{display:table;width:100%}.imagify-cell{display:table-cell;padding:10px}.imagify-bulk-submit .imagify-cell{padding-top:0}.imagify-spinner{display:inline-block;width:20px;height:20px;margin-right:5px;vertical-align:middle;background:url(../images/spinner.gif) 0 0/20px 20px no-repeat rgba(0,0,0,0);opacity:.7}.spinner.imagify-hidden{width:0;margin:4px 0 0}.imagify-primary.imagify-primary.imagify-primary{color:#40b1d0}.imagify-secondary.imagify-secondary.imagify-secondary,.imagify-valid{color:#8BC34A}.misc-pub-section.misc-pub-imagify h4{font-size:14px;margin-top:5px;margin-bottom:0}.imagify-chart{position:relative;top:1px;display:inline-block;vertical-align:middle}.imagify-chart-container{position:relative;display:inline-block;margin-right:5px}.imagify-chart-container canvas{display:block}.imagify-settings .button,.imagify-settings a,.imagify-settings input,.imagify-welcome .button,.imagify-welcome a,.imagify-weolcome input{-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.imagify-settings a{color:#40b1d0}.imagify-settings,.imagify-settings p,.imagify-settings th{color:#5F758E}.imagify-button-primary.imagify-button-primary,.imagify-button-secondary.imagify-button-secondary,.imagify-button.imagify-button,.imagify-notice .button,.imagify-settings .button,.imagify-welcome .button{height:auto;padding:11px 22px;border:0;font-size:14px;font-weight:600;text-transform:uppercase;letter-spacing:.01em;word-spacing:.01em;-webkit-box-shadow:0 3px 0 rgba(0,0,0,.15);box-shadow:0 3px 0 rgba(0,0,0,.15);border-radius:3px;cursor:pointer;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.button-primary.button-mini{padding:2px 10px}.imagify-settings .button.button-mini-flat{padding:3px 6px 5px;font-size:12px;-webkit-box-shadow:none!important;box-shadow:none!important;line-height:1.2}.imagify-settings .button.button-mini-flat:focus,.imagify-settings .button.button-mini-flat:hover{-webkit-box-shadow:none!important;box-shadow:none!important}.imagify-button-ghost.imagify-button-ghost,.imagify-title .button-ghost.button-ghost{padding:2px 9px;border:1px solid #40B1D0;font-size:12px;font-weight:400;color:#40B1D0;background:0 0;-webkit-box-shadow:none;box-shadow:none}.imagify-button-ghost.imagify-button-ghost:focus,.imagify-button-ghost.imagify-button-ghost:hover,.imagify-title .button-ghost.button-ghost:focus,.imagify-title .button-ghost.button-ghost:hover{border-color:transparent;color:#000;background:#40B1D0}.imagify-button-ghost.imagify-button-ghost:focus,.imagify-button-ghost.imagify-button-ghost:hover{color:#FFF}.imagify-button-medium.imagify-button-medium{text-transform:uppercase;letter-spacing:.1em;padding:3px 10px;font-weight:700}.imagify-button-medium.imagify-button-ghost{border-width:2px}[class*=imagify-] .button .dashicons{margin-right:5px;vertical-align:middle}.imagify-button-primary.imagify-button-primary,.imagify-settings .button-primary.button-primary,.imagify-welcome .button-primary.button-primary{background:#40B1D0;color:#FFF;-webkit-box-shadow:0 3px 0 rgba(51,142,166,1);box-shadow:0 3px 0 rgba(51,142,166,1);text-shadow:0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799!important}.imagify-button-secondary.imagify-button-secondary{background:#8BC34A;color:#FFF;-webkit-box-shadow:0 3px 0 #6F9C3B;box-shadow:0 3px 0 #6F9C3B;text-shadow:0 -1px 1px #6F9C3B,1px 0 1px #6F9C3B,0 1px 1px #6F9C3B!important}.imagify-button-primary.imagify-button-primary:focus,.imagify-button-primary.imagify-button-primary:hover,.imagify-settings .button-primary:focus,.imagify-settings .button-primary:hover,.imagify-welcome .button-primary:focus,.imagify-welcome .button-primary:hover{background:#338ea6;-webkit-box-shadow:0 3px 0 #1f7a92;box-shadow:0 3px 0 #1f7a92}.imagify-button-secondary.imagify-button-secondary:focus,.imagify-button-secondary.imagify-button-secondary:hover{background:#6F9C3B;color:#FFF}.imagify-button-light.imagify-button-light{background:#FFF;color:#4a4a4a;-webkit-box-shadow:0 2px 0 rgba(0,0,0,.2);box-shadow:0 2px 0 rgba(0,0,0,.2)}.imagify-block-secondary .imagify-button-light.imagify-button-light{color:#6F9C3B}.imagify-button-light.imagify-button-light:focus,.imagify-button-light.imagify-button-light:hover{color:#FFF;background:rgba(0,0,0,.2)}.button.imagify-button-clean,.imagify-button-clean{padding:0;background:0 0;-webkit-box-shadow:none;box-shadow:none}.imagify-button-clean .dashicons-plus{width:32px;height:25px}.imagify-button-clean .dashicons-plus:before{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:25px;height:22px;margin-left:2px;padding-top:3px;font-size:17px;background:#40B1D0;color:#FFF;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.button.imagify-button-clean:active,.button.imagify-button-clean:focus,.button.imagify-button-clean:hover,.button.imagify-button-clean[disabled]{background:0 0!important;color:#343A49;-webkit-box-shadow:none;box-shadow:none}.button.imagify-button-clean:focus .dashicons-plus:before,.button.imagify-button-clean:hover .dashicons-plus:before{background:#343A49}button.imagify-link-like{border:0;padding:0;color:inherit;text-decoration:underline;font-size:13px;-webkit-box-shadow:none;box-shadow:none;background:0 0;cursor:pointer}.imagify-section-positive .imagify-button-light{color:#709A41}.imagify-button.imagify-button-big{font-size:15px;padding:11px 30px}.imagify-button-big .dashicons{font-size:1.45em;margin-right:6px;margin-left:-4px}.imagify-button-primary.imagify-button-primary .dashicons,.imagify-button-secondary.imagify-button-secondary .dashicons,.imagify-button.imagify-button .dashicons,.imagify-notice .button .dashicons,.imagify-settings .button .dashicons,.imagify-welcome .button .dashicons{vertical-align:middle}[class*=imagify-] .button-text{display:inline-block;vertical-align:middle}.media-frame-content .imagify-button-primary,.wp_attachment_image .imagify-button-primary{padding:0 10px 1px;margin:0 5px 2px 0;font-size:13px;line-height:26px;-webkit-box-shadow:0 3px 0 rgba(51,142,166,1);box-shadow:0 3px 0 rgba(51,142,166,1)}.wp_attachment_image .imagify-button-primary{float:left}.imagify-title.imagify-title{position:relative;padding:10px 30px;font-size:23px;background:#1F2332;color:#FFF}.imagify-welcome .imagify-logo{opacity:1}.imagify-welcome .imagify-title{display:-webkit-box;display:-ms-flexbox;display:flex;padding:20px 30px}.imagify-settings .imagify-title{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.imagify-settings .imagify-logo-block{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-negative:0;flex-shrink:0;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;padding:0;margin-right:35px;color:inherit}.imagify-logo-block sup{color:#1F2332}.imagify-settings .imagify-title+.imagify-notice{margin:0;border-right:1px solid #D9D9D9;padding-top:15px;padding-bottom:15px}.imagify-title .title-text{font-size:28px;font-weight:700;color:#FFF}.imagify-lb-icon{padding-right:18px}.imagify-lb-text img{margin-bottom:.15em}.imagify-lb-text{font-size:23px;font-weight:700;color:#FFF}.imagify-logo{display:block;vertical-align:top;opacity:.4}.imagify-section,.imagify-settings div.submit,.imagify-sub-header,.imagify-sub-title.imagify-sub-title{margin:0;padding:20px;background:#F2F5F7}.imagify-section-positive,.imagify-sub-title.imagify-sub-title{padding-left:40px}.imagify-section-positive{background:#8cc152;color:#FFF}.imagify-section-positive p{color:#FFF}.imagify-section-gray{background:#D9E4EB}.imagify-section-gray .imagify-count-title{color:#4a4a4a}.imagify-section p:first-child{margin-top:0}.imagify-section p:last-child{margin-bottom:0}.imagify-settings .imagify-documentation-link-box{display:-webkit-box;display:-ms-flexbox;display:flex;padding:12px 13px 14px;border:1px solid #40b1d0;color:#E5EBEF;border-radius:3px}.imagify-documentation-link-icon{width:23px;height:31px;font-size:2.6em;margin-right:15px;line-height:1.3}.imagify-documentation-link-box span{font-size:12px}.imagify-documentation-link-box a{font-weight:700}@media (max-width:1120px){.imagify-settings .imagify-title{-ms-flex-wrap:wrap;flex-wrap:wrap}}.imagify-settings-section{padding:10px 20px}.imagify-account-info-col .imagify-settings-section{padding-right:0}.imagify-settings-main-content,.imagify-welcome .imagify-settings-section{border:1px solid #D9D9D9;border-top-width:0;background:#FFF}.imagify-settings-main-content{padding-bottom:20px}.imagify-settings-main-content p{font-size:14px}.imagify-settings-main-content+.imagify-settings-main-content{margin-top:20px;border-top-width:1px}.imagify-br{line-height:2}p.imagify-section-title.imagify-section-title{font-size:20px;margin-top:-.3em;margin-bottom:-.6em}.imagify-rate-us.imagify-rate-us{text-align:right;margin:-1em -2.4em -1em 0;color:#FFF}.imagify-rate-us a{color:#40B1D0}.imagify-rate-us .stars{display:inline-block;margin:2px 0 0 10px;text-decoration:none;letter-spacing:.2em;vertical-align:-1px}.imagify-rate-us .stars .dashicons:before{font-size:18px}.imagify-rate-us a:focus,.imagify-rate-us a:hover{color:#FEE102}@media (max-width:1220px){.imagify-rate-us.imagify-rate-us{position:static;margin-bottom:0;text-align:left}.imagify-rate-us.imagify-rate-us br{display:none}.imagify-rate-us .stars{display:block;margin-left:0}}.imagify-important{color:#F5A623}.imagify-settings .imagify-success,.imagify-success{color:#8BC34A}.imagify-info,.imagify-info a{color:#7A8996;font-size:12px}.imagify-info{position:relative;display:inline-block;padding-left:25px}.imagify-info .dashicons{position:absolute;left:0;top:0;color:#40B1D0}.imagify-checkbox.imagify-checkbox:checked,.imagify-checkbox.imagify-checkbox:not(:checked),.imagify-settings.imagify-settings [type=checkbox]:checked,.imagify-settings.imagify-settings [type=checkbox]:not(:checked){position:absolute;opacity:.01}.imagify-checkbox.imagify-checkbox:checked:focus,.imagify-checkbox.imagify-checkbox:not(:checked):focus,.imagify-settings.imagify-settings [type=checkbox]:checked:focus,.imagify-settings.imagify-settings [type=checkbox]:not(:checked):focus{-webkit-box-shadow:none!important;box-shadow:none!important;outline:0!important;border:0!important}.imagify-checkbox.imagify-checkbox:checked+label,.imagify-checkbox.imagify-checkbox:not(:checked)+label,.imagify-settings [type=checkbox]:checked+label,.imagify-settings [type=checkbox]:not(:checked)+label{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:24px;padding-left:40px;cursor:pointer;font-size:14px;font-weight:700;color:#2E3243}.imagify-checkbox.imagify-checkbox:checked+label:before,.imagify-checkbox.imagify-checkbox:not(:checked)+label:before,.imagify-settings [type=checkbox]:checked+label:before,.imagify-settings [type=checkbox]:not(:checked)+label:before{content:'';position:absolute;left:0;top:0;width:22px;height:22px;border:2px solid #8BA6B4;background:#FFF;border-radius:3px}.imagify-checkbox.imagify-checkbox:checked+label:after,.imagify-checkbox.imagify-checkbox:not(:checked)+label:after,.imagify-settings [type=checkbox]:checked+label:after,.imagify-settings [type=checkbox]:not(:checked)+label:after{content:"✓";position:absolute;font-size:1.4em;top:-2px;left:4.5px;color:#8BA6B4;font-weight:400;-webkit-transition:all .2s;-o-transition:all .2s;transition:all .2s}.imagify-checkbox.imagify-checkbox[disabled]:checked+label:before,.imagify-checkbox.imagify-checkbox[disabled]:not(:checked)+label:before,.imagify-settings [type=checkbox][disabled]:checked+label:before,.imagify-settings [type=checkbox][disabled]:not(:checked)+label:before{border-color:#ccc;background:#ddd}.imagify-checkbox.imagify-checkbox:not(:checked)+label:after,.imagify-settings [type=checkbox]:not(:checked)+label:after{opacity:0;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.imagify-checkbox.imagify-checkbox:checked+label:after,.imagify-settings [type=checkbox]:checked+label:after{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.medium.imagify-checkbox:checked+label:before,.medium.imagify-checkbox:not(:checked)+label:before{width:22px;height:22px;border-width:1.5px;border-radius:2px;margin-top:0}.medium.imagify-checkbox:checked+label:after,.medium.imagify-checkbox:not(:checked)+label:after{font-size:1.1em;left:-17px;top:3px}.imagify-settings .mini[type=checkbox]:checked+label:before,.imagify-settings .mini[type=checkbox]:not(:checked)+label:before,.mini.imagify-checkbox:checked+label:before,.mini.imagify-checkbox:not(:checked)+label:before{width:15px;height:15px;border-width:1px;border-radius:2px;margin-top:0}.imagify-settings .mini[type=checkbox]:checked+label:after,.imagify-settings .mini[type=checkbox]:not(:checked)+label:after,.mini.imagify-checkbox:checked+label:after,.mini.imagify-checkbox:not(:checked)+label:after{font-size:.9em;left:-21px;top:-.5px}.imagify-checkbox.imagify-checkbox:checked:focus+label:before,.imagify-checkbox.imagify-checkbox:not(:checked):focus+label:before,.imagify-settings [type=checkbox]:checked:focus+label:before,.imagify-settings [type=checkbox]:not(:checked):focus+label:before{border-style:dotted;border-color:#40b1d0}.imagify-check-group{padding-left:2px;margin-bottom:0}.imagify-check-group.imagify-is-scrollable{max-height:15em;overflow-y:auto;padding:8px;margin:1.5em 0 0 -8px;background:#F4F7F9;border:1px solid #D2D3D6;border-radius:3px}.imagify-is-scrollable legend+p{margin-top:0}.imagify-is-scrollable [type=checkbox]:checked+label:before,.imagify-is-scrollable [type=checkbox]:not(:checked)+label:before{background:#F4F7F9}.imagify-settings .imagify-check-group.imagify-check-group label{color:#338EA6;font-weight:500}.imagify-inline-options{position:relative;display:table;width:100%;max-width:600px;border-collapse:collapse}.imagify-inline-options input[type=radio]:checked,.imagify-inline-options input[type=radio]:not(:checked){position:absolute;left:5px;top:5px;display:none}.imagify-inline-options input[type=radio]:checked+label,.imagify-inline-options input[type=radio]:not(:checked)+label{position:relative;display:table-cell;padding:13px 10px;text-align:center;font-weight:600;font-size:16px;text-transform:uppercase;letter-spacing:.1em;color:#FFF;background:#2E3243;-webkit-box-shadow:0 -3px 0 rgba(0,0,0,.1) inset;box-shadow:0 -3px 0 rgba(0,0,0,.1) inset;z-index:2;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.imagify-inline-options input[type=radio]:checked+label:first-of-type,.imagify-inline-options input[type=radio]:not(:checked)+label:first-of-type{border-radius:3px 0 0 3px}.imagify-inline-options input[type=radio]:checked+label:last-of-type,.imagify-inline-options input[type=radio]:not(:checked)+label:last-of-type{border-radius:0 3px 3px 0}.imagify-inline-options input[type=radio]:checked+label{background:#8BC34A}.imagify-inline-options .imagify-info{margin-top:15px}.imagify-account-info-col,.imagify-col.imagify-col.imagify-account-info-col{width:380px;max-width:100%;padding:0 20px 0 0}.imagify-col.imagify-col.imagify-shared-with-account-col,.imagify-shared-with-account-col{width:calc(100% - 380px);padding:0}.imagify-account-info-col .imagify-options-title{padding:24px 26px;color:#FFF;background:#1F2332}.imagify-block-secondary{padding:26px 26px 35px;border:1px solid #75A345;background:#8BC34A;border-radius:3px;color:#FFF}.imagify-account-info-col .imagify-block-secondary.imagify-block-secondary h3,.imagify-block-secondary.imagify-block-secondary p{color:inherit}.imagify-account-info-col .imagify-col-content h3:first-child{margin-top:0}.imagify-account-info-col .imagify-col-content h3{font-size:19px}.imagify-account-info-col .imagify-col-content p{margin:1.5em 0}.imagify-account-info-col .imagify-col-content p:first-child{margin-top:0}.imagify-user-plan-label{float:right;margin-top:-4px;padding:2px 10px;border:2px solid #40B1D0;font-size:14px;text-transform:uppercase;letter-spacing:.02em;color:#40B1D0;border-radius:3px}.imagify-modal .h2,.imagify-modal .h3{letter-spacing:.075em;text-align:center;font-weight:400}.imagify-user-plan-label:empty{display:none}.imagify-columns{overflow:hidden;padding:15px 0;counter-reset:cols}.imagify-columns [class^=col-]{float:left;-webkit-box-sizing:border-box;box-sizing:border-box}.imagify-columns .col-1-3{width:33.333%;padding-left:28px}.imagify-columns .col-2-3{width:66.666%;padding-left:28px}.imagify-columns .col-1-2{width:50%;padding:0 20px}@media (max-width:830px){.imagify-columns [class^=col-]{float:none;margin-bottom:1.5em}.imagify-columns .col-1-2,.imagify-columns .col-1-3{width:auto;padding:0 28px;clear:both;padding-top:1em}}.column-imagify_optimized_file.column-imagify_optimized_file{width:300px;text-align:center;vertical-align:middle}.column-imagify_optimized_file>*{max-width:21em;margin:0 auto}@media (min-width:1151px) and (max-width:1800px){.column-imagify_optimized_file.column-imagify_optimized_file{width:21em}}@media (min-width:783px) and (max-width:1150px){.column-imagify_optimized_file.column-imagify_optimized_file{width:13em}table.media .column-title .has-media-icon~.row-actions.row-actions{margin-left:0}}@media (max-width:782px){table.media .column-imagify_optimized_file.column-imagify_optimized_file{text-align:left}table.media .imagify-datas-actions-links,table.media .imagify-datas-more-action{text-align:center}table.media .column-imagify_optimized_file .imagify-datas-actions-links a,table.media .column-imagify_optimized_file>*{max-width:100%;margin-left:0}}@media (min-width:783px) and (max-width:1150px),(max-width:360px){table.media .imagify-hide-if-small{position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip:rect(0 0 0 0);border:0;word-wrap:normal!important}}.compat-field-imagify .label{vertical-align:top}.compat-field-imagify ul.imagify-datas-list{margin-top:7px;font-size:11px}ul.imagify-datas-list.imagify-datas-list{margin:0 auto;color:#555;font-size:10px}ul.imagify-datas-list .big{font-size:12px;color:#40B1D0}.imagify-data-item{overflow:hidden}li.imagify-data-item{clear:both;margin-bottom:2px}ul.imagify-datas-list .imagify-data-item span.data,ul.imagify-datas-list .imagify-data-item strong{float:left;width:38%;-webkit-box-sizing:border-box;box-sizing:border-box}ul.imagify-datas-list .imagify-data-item span.data{width:62%;padding-right:5px;text-align:left}.compat-field-imagify .imagify-datas-list .imagify-data-item .data{width:130px;text-align:left;font-weight:700}ul.imagify-datas-list .imagify-data-item strong{text-align:left;padding-left:5px}.media-sidebar .imagify-datas-list .imagify-data-item .data{width:auto;float:none}.media-sidebar .imagify-datas-list .imagify-data-item strong{display:inline-block;width:auto;float:none}.media-sidebar .imagify-datas-list .imagify-data-item .imagify-chart{float:left}.imagify-datas-more-action.imagify-datas-more-action{margin:.4em auto;background:-webkit-gradient(linear,left top,left bottom,from(transparent),color-stop(49%,transparent),color-stop(50%,rgba(0,0,0,.075)),color-stop(58%,rgba(0,0,0,.075)),color-stop(58%,transparent),to(transparent));background:-o-linear-gradient(top,transparent,transparent 49%,rgba(0,0,0,.075) 50%,rgba(0,0,0,.075) 58%,transparent 58%,transparent);background:linear-gradient(to bottom,transparent,transparent 49%,rgba(0,0,0,.075) 50%,rgba(0,0,0,.075) 58%,transparent 58%,transparent)}.imagify-datas-more-action a{display:inline-block;padding:0 5px;background:#40B1D0;color:#FFF;text-transform:uppercase;font-size:9px;font-weight:700;line-height:1.9;text-decoration:none}.imagify-datas-more-action a.is-open{background:#555}.imagify-datas-more-action a.is-open .dashicons{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.imagify-datas-more-action a .dashicons{font-size:14px;vertical-align:middle;line-height:.8}.imagify-datas-more-action a .dashicons:before{vertical-align:middle;line-height:20px}.imagify-datas-more-action .the-text{display:inline-block;vertical-align:middle;height:auto;line-height:inherit}ul.imagify-datas-details.imagify-datas-details{margin:.7em auto}.imagify-datas-details strong{color:#40B1D0}.imagify-datas-details .original{color:#555}.imagify-datas-actions-links{overflow:hidden;border-top:2px solid transparent;padding-top:5px;font-size:8px}.nggform .imagify-datas-actions-links{position:relative;z-index:2}.nggform .row-actions{z-index:1}.imagify-datas-actions-links a{position:relative;display:inline-block;padding-left:17px;text-decoration:none;font-weight:600}.compat-field-imagify .imagify-datas-actions-links{max-width:300px}.misc-pub-imagify .imagify-datas-actions-links{border-top:2px solid #f2f2f2;padding-bottom:5px}.column-imagify_optimized_file .imagify-datas-actions-links a{margin:0 .7em;padding-left:15px}.compat-field-imagify .imagify-datas-actions-links a,.misc-pub-imagify .imagify-datas-actions-links a{font-size:10px;float:left;width:50%}.media-sidebar .compat-field-imagify .imagify-datas-actions-links a,.submitbox .misc-pub-imagify .imagify-datas-actions-links a{display:block;width:auto;float:none}.imagify-datas-actions-links a:only-child{float:none;width:auto}.imagify-datas-details.is-open+.imagify-datas-actions-links{border-top-color:rgba(0,0,0,.075)}.imagify-datas-actions-links .dashicons{position:absolute;left:0;top:4px;width:12px;margin-right:2px;font-size:11px}.imagify-account,.imagify-account-link{padding-right:15px}.imagify-meteo-icon{display:inline-block;height:38px;vertical-align:middle;margin-right:10px}.imagify-user-plan{color:#40b1d0}.imagify-meteo-title.imagify-meteo-title{color:#FFF;font-size:17px}.imagify-space-left>p{color:#FFF}[class^=imagify-bar-]{position:relative;height:8px;width:100%;background:#60758D;color:#FFF;font-size:10px}.imagify-progress{height:8px;-webkit-transition:width .3s;-o-transition:width .3s;transition:width .3s}.imagify-bar-positive .imagify-progress{background:#8CC152}.imagify-bar-positive .imagify-barnb{color:#8CC152}.imagify-bar-primary .imagify-progress{background:#40B1D0}.imagify-bar-primary .imagify-barnb{color:#40B1D0}.imagify-bar-negative .imagify-progress{background:#D2D3D6}.imagify-bar-negative .imagify-barnb{color:#7A8996}.imagify-bar-neutral .imagify-progress{background:#F5A623}.imagify-space-left .imagify-bar-negative .imagify-progress{background:#C51162}.imagify-btn-ghost{display:inline-block;height:auto;padding:7px 10px;border:1px solid #FFF;text-align:center;background:0 0;color:#FFF;border-radius:3px;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.imagify-btn-ghost:focus,.imagify-btn-ghost:hover{background:#FFF;color:#888}.imagify-error{background:#D0021B;color:#FFF}.imagify-settings-section .imagify-error{display:inline-block;padding:7px 10px;margin:10px 0 0 45px;border-radius:3px}.imagify-settings-section .imagify-error code{font-weight:400}.imagify-settings-section .imagify-error.hidden{display:none}.imagify-warning{background:#f5a623;color:#FFF;text-shadow:0 0 2px rgba(0,0,0,.2)}.imagify-modal{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.js .imagify-modal{display:none;position:fixed;top:0;right:0;bottom:0;left:0;background-color:#1F2332;background-color:rgba(31,35,50,.95);z-index:99999}.imagify-modal-content{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:800px;max-width:95%;max-height:90vw;overflow:auto;padding:20px 25px;margin:1em auto;background:#FFF;-webkit-box-shadow:1px 1px 4px rgba(0,0,0,.7);box-shadow:1px 1px 4px rgba(0,0,0,.7);border-radius:3px}#imagify-visual-comparison .imagify-modal-content,.imagify-visual-comparison .imagify-modal-content{max-width:1400px;background:0 0;padding:5px;-webkit-box-shadow:none;box-shadow:none;border-radius:0}.imagify-modal .h2{margin:.5em 0;color:#8ba6b4;font-size:24px}.imagify-modal .h3{color:#40b1d0;font-size:18px}.imagify-modal .close-btn{display:none;visibility:hidden;position:absolute;right:20px;top:20px;font-size:1.2em;border:0;background:0 0;border-radius:0;cursor:pointer}.imagify-modal .close-btn i{margin-left:-2px}.imagify-modal .close-btn:focus,.imagify-modal .close-btn:hover{color:#40b1d0}.js .imagify-modal .close-btn{display:block;visibility:visible}.imagify-visual-comparison .close-btn,.wp_attachment_image #imagify-visual-comparison .close-btn{top:0}.imagify-visual-comparison .imagify-modal-content,.wp_attachment_image #imagify-visual-comparison .imagify-modal-content{padding-top:40px}.imagify-col{float:left;width:50%;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-preferred-size:50%;flex-basis:50%;padding-right:20px}.imagify-col+.imagify-col{padding-right:0;padding-left:20px}.imagify-col:target{-webkit-animation:hello 1s 3 linear backwards;animation:hello 1s 3 linear backwards}@-webkit-keyframes hello{0%,100%{background:#FFF}50%{background:#F4F7F9}}@keyframes hello{0%,100%{background:#FFF}50%{background:#F4F7F9}}
assets/css/files-list.css CHANGED
File without changes
assets/css/files-list.min.css CHANGED
File without changes
assets/css/pricing-modal.css CHANGED
@@ -525,6 +525,10 @@ span.imagify-price-by {
525
  border-color: #FFF;
526
  background: #40B1D0;
527
  }
 
 
 
 
528
  .imagify-offer-selected .imagify-offer-by {
529
  color: #2E3243;
530
  }
@@ -954,7 +958,7 @@ div.imagify-col-price {
954
  -ms-flex-positive: 1;
955
  flex-grow: 1;
956
  }
957
- p.imagify-modal-sidebar-title {
958
  margin-top: 5px;
959
  padding-right: 40px;
960
  font-size: 18px;
@@ -1000,7 +1004,7 @@ p.imagify-modal-sidebar-title {
1000
  font-size: 10px;
1001
  color: #7A8996;
1002
  }
1003
- .imagify-modal-testimony-content p {
1004
  font-size: 13px;
1005
  font-style: italic;
1006
  line-height: 1.7;
@@ -1143,4 +1147,4 @@ p.imagify-modal-sidebar-title {
1143
  color: #40b1d0;
1144
  float: right;
1145
  font-weight: bold;
1146
- }
525
  border-color: #FFF;
526
  background: #40B1D0;
527
  }
528
+ .imagify-offer-selected .imagify-checkbox.imagify-checkbox:not(:checked) + label:after,
529
+ .imagify-offer-selected .imagify-checkbox.imagify-checkbox:checked + label:after {
530
+ color: #FFF;
531
+ }
532
  .imagify-offer-selected .imagify-offer-by {
533
  color: #2E3243;
534
  }
958
  -ms-flex-positive: 1;
959
  flex-grow: 1;
960
  }
961
+ p.imagify-modal-sidebar-title.imagify-modal-sidebar-title {
962
  margin-top: 5px;
963
  padding-right: 40px;
964
  font-size: 18px;
1004
  font-size: 10px;
1005
  color: #7A8996;
1006
  }
1007
+ .imagify-modal-testimony-content.imagify-modal-testimony-content p {
1008
  font-size: 13px;
1009
  font-style: italic;
1010
  line-height: 1.7;
1147
  color: #40b1d0;
1148
  float: right;
1149
  font-weight: bold;
1150
+ }
assets/css/pricing-modal.min.css CHANGED
@@ -1 +1 @@
1
- .imagify-2-free:after,.imagify-cols:after,.imagify-price-discount:before{content:""}.imagify-border-styled,.imagify-flex-table,.imagify-modal-cols,.imagify-offer-header,.imagify-payment-modal .imagify-modal-content,.imagify-tabs{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.imagify-analyzing .imagify-numbers-calc,.imagify-modal-content.imagify-iframe-viewing .imagify-modal-sidebar,.imagify-modal-content.imagify-success-viewing .imagify-modal-sidebar,.imagify-modal-section .imagify-loader,.imagify-modal-section.imagify-analyzing .imagify-modal-cols,.imagify-numbers-notcalc{display:none}.imagify-border-styled,.imagify-modal-cols{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.imagify-payment-modal{text-align:center;color:#7A8996}.imagify-payment-modal *{-webkit-box-sizing:border-box;box-sizing:border-box}.imagify-modal-loader{position:absolute;top:0;left:0;right:0;bottom:0;background:url(../images/loader-balls.svg) center no-repeat #fff;z-index:10}.imagify-payment-modal .imagify-modal-content{width:980px;max-width:100%;min-width:925px;padding:0}.imagify-modal-content.imagify-iframe-viewing{width:980px;height:672px;overflow:hidden}.imagify-iframe-viewing #imagify-payment-process-view{width:980px;height:668px}.imagify-payment-modal .imagify-modal-main{width:70%}.imagify-iframe-viewing .imagify-modal-main{width:auto}.imagify-payment-modal .imagify-modal-content.imagify-success-viewing{min-width:auto;width:450px;min-height:300px}.imagify-success-viewing .imagify-modal-main{width:100%}.imagify-payment-modal .imagify-modal-sidebar{width:30%;padding:15px 20px;background:#1F2332;color:#FFF}.imagify-modal-section{padding:0 25px}.imagify-modal-section.section-gray{margin:0 0 1em;padding:10px 25px 15px;background:#F6F7FB}.imagify-tabs-contents .section-gray{padding:8px 25px 10px}.imagify-modal-section .imagify-modal-title:first-child{margin-top:1em;margin-bottom:1.5em}.imagify-modal-section.section-gray .imagify-modal-title{margin-top:.5em;margin-bottom:.5em}.imagify-modal-title{font-size:1.8em}.imagify-analyzing .imagify-numbers-notcalc,.imagify-modal-section.imagify-analyzing .imagify-loader{display:block}.imagify-modal-section .imagify-loader{margin:2em auto}.imagify-border-styled{width:200px;margin:0 auto;color:#8BC34A;font-weight:700;font-size:.925em}.imagify-big-number,.imagify-payment-modal strong{font-weight:700;color:#4A4A4A}.imagify-border-styled:after,.imagify-border-styled:before{content:"";height:1px;background:rgba(0,0,0,.1);-ms-flex-preferred-size:40px;flex-basis:40px}.imagify-border-styled:before{margin-right:5px}.imagify-border-styled:after{margin-left:5px}.imagify-big-number{font-size:3.7em;margin:-3px 0;line-height:1}.imagify-popin-message{padding:5px 15px;text-align:left}.imagify-popin-message.imagify-error p{color:#FFF}.imagify-small-options{width:300px;margin:1em auto .5em;background:#338EA6;border-radius:4px}.imagify-small-options input[type=radio]:checked+label,.imagify-small-options input[type=radio]:not(:checked)+label{padding:8px 10px;font-size:13px;color:#FFF;-webkit-box-shadow:none;box-shadow:none;border-left:0}.imagify-small-options input[type=radio]:not(:checked)+label{background:#338EA6;color:rgba(255,255,255,.4)}.imagify-small-options input[type=radio]:checked+label{background:#40B1D0}.imagify-cols:after{display:table;clear:both}.js .imagify-iframe-viewing .close-btn{display:none}.imagify-modal .imagify-cols{padding:0 20px}.imagify-payment-modal .imagify-iconed{margin:1.5em 5em 1.5em 0}.imagify-iconed{position:relative;text-align:left;padding-left:42px;margin-right:15px;font-weight:500}.imagify-iconed .dashicons,.imagify-iconed .icon{position:absolute;font-size:2em;left:0;top:2px;color:#40B1D0}.imagify-payment-modal .close-btn{top:10px;right:10px;width:24px;height:24px;padding:2px 0 0 4.5px;color:#FFF;background:#40B1D0;border-radius:50%;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.imagify-payment-modal .close-btn i{margin-left:-3.5px;margin-top:-.5px}.imagify-payment-modal .close-btn:hover{background:#F6F7FB}.imagify-offer-line{margin-top:1.5em}.imagify-offer-line+.imagify-offer-line{margin-top:.75em}.imagify-offer-header{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 0 0 15px;border-radius:4px 4px 0 0;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.imagify-offer-header.imagify-offer-header.imagify-offer-header .imagify-inline-options label:last-child{border-radius:0 4px 0 0}.imagify-offer-header .imagify-inline-options{width:auto}.imagify-offer-title{font-weight:700;margin:0}.imagify-offer-header,.imagify-offer-header .imagify-inline-options input[type=radio]:not(:checked)+label{background:#E5EBEF}.imagify-offer-onetime .imagify-offer-header{padding-top:8px;padding-bottom:8px}.imagify-offer-onetimes>div{padding-top:15px;padding-bottom:15px}.imagify-offer-header .imagify-inline-options input[type=radio]:checked+label,.imagify-offer-header .imagify-inline-options input[type=radio]:not(:checked)+label{position:relative;padding:7px 30px;font-size:1em;letter-spacing:.05em;color:inherit;-webkit-box-shadow:0 0 0;box-shadow:0 0 0;border-radius:0}.imagify-offer-header .imagify-inline-options input[type=radio]:checked+label{background:#F6F7FB}.imagify-2-free{position:absolute;bottom:100%;left:0;right:0;padding:2px 10px;margin-bottom:8px;font-size:.8em;letter-spacing:0;text-transform:none;text-align:center;color:#FFF;background:#10121A;border-radius:2px}.imagify-2-free:after{position:absolute;left:50%;bottom:-3px;margin-left:-3px;border-top:3px solid #10121A;border-left:3px solid transparent;border-right:3px solid transparent}.imagify-2-free.imagify-b-right{bottom:auto;left:100%;right:-100%;margin-bottom:0;margin-left:8px}.imagify-2-free.imagify-b-right:after{left:-3px;bottom:auto;top:50%;margin-top:-3px;margin-left:0;border-right:3px solid #10121A;border-top:3px solid transparent;border-bottom:3px solid transparent;border-left:0}.imagify-2-free.imagify-b-bottom{bottom:-100%;left:0;right:0;margin-top:8px}.imagify-2-free.imagify-b-bottom:after{top:-3px;bottom:auto;border-bottom:3px solid #10121A;border-left:3px solid transparent;border-right:3px solid transparent;border-top:0}.imagify-offer-content{text-align:left;background:#F6F7FB;border-radius:0 0 4px 4px;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.imagify-offer-onetime .imagify-offer-content{padding:10px 0}div.imagify-col-checkbox{position:relative;width:25.5%;padding-top:10px;padding-bottom:7px}.imagify-col-checkbox label{display:block;padding-left:55px!important}.imagify-col-checkbox .imagify-checkbox.imagify-checkbox:checked,.imagify-col-checkbox .imagify-checkbox.imagify-checkbox:not(:checked){position:absolute;top:50%;left:6px;margin:-8px 0 0}.imagify-col-checkbox .imagify-checkbox.imagify-checkbox:checked+label:before,.imagify-col-checkbox .imagify-checkbox.imagify-checkbox:not(:checked)+label:before{margin:0;top:-2px;left:6px;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.imagify-offer-by,.imagify-offer-size{-webkit-transition:all .275s;-o-transition:all .275s}.imagify-col-checkbox .imagify-checkbox.imagify-checkbox:checked+label:after,.imagify-col-checkbox .imagify-checkbox.imagify-checkbox:not(:checked)+label:after{top:1px;left:13px}.imagify-offer-size{font-size:30px;color:#2E3243;font-weight:700;transition:all .275s}.imagify-offer-by{font-size:10px;transition:all .275s}.imagify-approx{display:none;font-size:11px;line-height:1.2;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}div.imagify-col-price{width:35%}.imagify-flex-table .imagify-price-block{padding-left:0;padding-right:0}.imagify-offer-monthlies .imagify-price-block,.imagify-offer-monthly .imagify-flex-table .imagify-price-block{padding-top:0}.imagify-flex-table .imagify-price-complement{padding-right:0;font-size:10px;font-weight:700}.imagify-price-block,.imagify-price-discount{white-space:nowrap}.imagify-price-block span,.imagify-price-discount span{display:inline-block;vertical-align:middle}.imagify-price-discount.imagify-price-discount{position:relative;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;padding-top:15px;font-weight:700;width:70px}.imagify-price-discount:before{position:absolute;top:25px;width:62%;height:2px;background:#2E3243;-webkit-transform:rotate(-15deg);-ms-transform:rotate(-15deg);transform:rotate(-15deg)}.imagify-offer-onetimes .imagify-price-discount:before{width:100%}.imagify-price-discount-dollar{color:#2E3243}.imagify-price-discount-number{color:#8BA6B4}.imagify-offer-selected .imagify-price-discount-number{color:#FFF}span.imagify-dollars{color:#1F2332;font-size:18px;font-weight:700;vertical-align:-2px}.imagify-offer-onetime .imagify-col-price{padding-top:0}.imagify-offer-onetime .imagify-dollars{vertical-align:-1px}.imagify-price-big,.imagify-price-mini{color:#40B1D0;font-weight:700}.imagify-price-big{font-size:36px}span.imagify-price-mini{font-size:18px;vertical-align:2px}span.imagify-price-by{font-size:10px;color:#1F2332;vertical-align:-13px;text-indent:-27px}.imagify-col-other-actions{width:18.5%;text-align:right}.imagify-col-other-actions a{font-size:11px}.imagify-offer-selected,.imagify-offer-selected .imagify-col-other-actions a,.imagify-offer-selected .imagify-offer-size,.imagify-offer-selected .imagify-offer-title,.imagify-offer-selected .imagify-price-big,.imagify-offer-selected .imagify-price-complement,.imagify-offer-selected .imagify-price-mini{color:#FFF}.imagify-offer-selected .imagify-offer-header,.imagify-offer-selected .imagify-offer-header .imagify-inline-options input[type=radio]:not(:checked)+label{background:#338EA6}.imagify-offer-selected .imagify-offer-content,.imagify-offer-selected .imagify-offer-header .imagify-inline-options input[type=radio]:checked+label{background:#40B1D0}.imagify-offer-selected .imagify-checkbox.imagify-checkbox:checked+label:before,.imagify-offer-selected .imagify-checkbox.imagify-checkbox:not(:checked)+label:before{border-color:#FFF;background:#40B1D0}.imagify-offer-selected .imagify-offer-by{color:#2E3243}.imagify-enough-free .imagify-not-enough-title,.imagify-enough-title{display:none}.imagify-enough-free .imagify-enough-title{display:block}.imagify-submit-line{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:2em 0;text-align:left}.imagify-coupon-section{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.imagify-coupon-section p{margin:0;line-height:1.3}.imagify-coupon-text{width:200px;max-width:100%;padding-right:15px}.imagify-coupon-loader{display:none}.imagify-coupon-text.checking{text-align:right}.imagify-coupon-text.checking .imagify-coupon-loader{display:inline}.imagify-coupon-text.checking label{display:none}.imagify-coupon-input{position:relative}.imagify-coupon-input input{position:relative;z-index:1}[id=imagify-coupon-validate].button-secondary{position:absolute;top:1px;right:3px;bottom:2px;-webkit-box-shadow:none;box-shadow:none;padding:4px 10px;z-index:0;-webkit-transition:-webkit-transform .275s;-o-transition:transform .275s;transition:transform .275s;transition:transform .275s,-webkit-transform .275s}.imagify-canbe-validate [id=imagify-coupon-validate]{-webkit-transform:translateX(45px);-ms-transform:translateX(45px);transform:translateX(45px)}.imagify-modal-section+.imagify-modal-promotion{margin-top:-1em}.imagify-modal-promotion{position:relative;overflow:hidden;display:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:15px 25px;background:#604D90;text-shadow:0 0 3px rgba(0,0,0,.3)}.imagify-modal-promotion.active{display:-webkit-box;display:-ms-flexbox;display:flex}[id=imagify-pricing-tab-onetime] .imagify-modal-promotion{margin-bottom:4em}.imagify-modal-promotion:before{content:"\f488";position:absolute;top:28px;left:8%;font-family:dashicons;font-size:90px;color:#8476A9;text-shadow:none}.imagify-modal-promotion p{position:relative;margin:.2em 0;color:#FFF}.imagify-promo-title{-ms-flex-preferred-size:100%;flex-basis:100%;text-transform:uppercase;font-size:20px;font-weight:700;letter-spacing:.125em}.imagify-until-date{-ms-flex-preferred-size:200px;flex-basis:200px;text-align:right}.imagify-until-date strong{color:#FFF}.imagify-submit-line button{font-size:16px}input.imagify-coupon-code{padding:10px;border:2px solid #7A8996;font-size:.875em;font-weight:700;border-radius:3px}.validated.imagify-coupon-section .imagify-coupon-text,.validated.imagify-coupon-section strong{color:#8BC34A}.validated.imagify-coupon-section .imagify-coupon-code{color:#8BC34A;border-color:#8BC34A}.invalid.imagify-coupon-section .imagify-coupon-text,.invalid.imagify-coupon-section strong{color:#d0021b}.invalid.imagify-coupon-section .imagify-coupon-code{color:#d0021b;border-color:#d0021b}.imagify-footer-lines{width:500px;max-width:100%;margin:2em auto 2.5em;font-size:.85em;line-height:1.5}.imagify-year-selected .imagify-switch-my .imagify-yearly{display:block}.imagify-month-selected .imagify-switch-my .imagify-yearly,.imagify-year-selected .imagify-switch-my .imagify-monthly{display:none}.imagify-month-selected .imagify-switch-my .imagify-monthly{display:block}.imagify-flex-table{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.imagify-flex-table>*{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;padding:7px 15px}div.imagify-col-details{width:22%;padding-left:25px}.imagify-col-details p{margin:0}.imagify-pricing-table{margin:0 20px}.imagify-pricing-table .imagify-offer-line{padding:.6em 0;border:2px solid #E8EEF0;text-align:left;border-radius:3px}.imagify-pricing-table .imagify-offer-line:first-child{margin-top:.75em}.imagify-pricing-table .imagify-offer-line.imagify-offer-selected:first-child{margin-top:1.75em}.imagify-pricing-table .imagify-offer-line+.imagify-offer-line{margin-top:-2px}.imagify-pricing-table .imagify-col-other-actions{width:20.5%}.imagify-pricing-table .imagify-approx{margin-left:0;line-height:.5;margin-bottom:1em}.imagify-pricing-table .imagify-offer-selected{-webkit-transform:scale(1.03);-ms-transform:scale(1.03);transform:scale(1.03);background:#40B1D0;border-width:0}.imagify-pricing-table .imagify-offer-selected .imagify-approx{color:#FFF}.imagify-pricing-table .imagify-button-secondary{padding:3px 20px;-webkit-box-shadow:none;box-shadow:none;text-transform:uppercase;font-size:12px;letter-spacing:.025em}.imagify-offer-selected.imagify-offer-selected .imagify-button-secondary{border:2px solid #FFF;background:#40B1D0;-webkit-box-shadow:none;box-shadow:none;text-shadow:none!important}.imagify-offer-selected.imagify-offer-selected .imagify-button-secondary:focus,.imagify-offer-selected.imagify-offer-selected .imagify-button-secondary:hover{background:#FFF;color:#40B1D0}.imagify-col .imagify-special-needs{margin-left:25px}.imagify-special-needs strong{font-size:25px;font-weight:700;color:#40B1D0}.imagify-special-needs span{display:block;font-size:12px;margin-top:-.5em}div.imagify-col-price{position:relative}.imagify-recommend{display:none;position:absolute;left:-20px;bottom:100%;padding:0;margin-bottom:8px;color:#1F2332;font-weight:700;font-style:italic}.imagify-offer-selected .imagify-recommend,.imagify-tab-content.imagify-current{display:block}[class*=imagify-onetime-] .imagify-recommend{left:65px;margin-bottom:20px}.imagify-recommend:before{content:"";position:absolute;top:7px;left:-35px;width:29px;height:30px;background:url(../images/icon-arrow-choice.png) 0 no-repeat;background-size:contain}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (-o-min-device-pixel-ratio:2/1),only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){.imagify-recommend:before{background-image:url(../images/icon-arrow-choice.svg)}}.imagify-offer-line[class*=imagify-onetime-]{padding:0;margin:.3em 0 0}.imagify-offer-line.imagify-offer-line[class*=imagify-onetime-]:first-child{margin-top:2em}.imagify-offer-line[class*=imagify-onetime-]+.imagify-offer-line{margin-top:.5em}.imagify-offer-selected.imagify-offer-line[class*=imagify-onetime-]{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);border-width:2px}.imagify-offer-line[class*=imagify-onetime-] .imagify-col-details{position:relative;overflow:hidden;width:21%;background:#1F2332;color:#FFF}.imagify-offer-selected.imagify-offer-line[class*=imagify-onetime-] .imagify-col-details{background:#338EA6}.imagify-offer-line[class*=imagify-onetime-] .imagify-col-details:before{content:"";position:absolute;bottom:0;right:25px;width:75px;height:54px;background:url(../images/icon-pack.png)}.imagify-offer-line[class*=imagify-onetime-] .imagify-col-other-actions{width:30%}.imagify-offer-line[class*=imagify-onetime-] .imagify-approx,.imagify-offer-line[class*=imagify-onetime-] .imagify-offer-size{color:#FFF}.imagify-offer-line[class*=imagify-onetime-] .imagify-offer-size{font-size:24px}.imagify-offer-line[class*=imagify-onetime-] .imagify-approx{font-size:12px}.imagify-offer-line[class*=imagify-onetime-] .imagify-price-block{padding-left:10px}.imagify-offer-line[class*=imagify-onetime-] .imagify-dollars{vertical-align:middle}.imagify-offer-line[class*=imagify-onetime-] .imagify-price-big{vertical-align:-5px}.imagify-offer-line[class*=imagify-onetime-] .imagify-price-mini{vertical-align:7px}.imagify-tabs{margin-bottom:0;list-style:none;background:#E5EBEF}.imagify-modal-content .imagify-tabs{margin:1em 0 0}.imagify-tab{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;width:50%;margin:0;font-size:23px}.imagify-tab a{display:block;padding:15px 10px;color:inherit;text-decoration:none}.imagify-tab a:focus{-webkit-box-shadow:none;box-shadow:none;outline:0;color:#40B1D8}.imagify-tab.imagify-current a{background:#F6F7FB}.imagify-tab-content{display:none}.imagify-tab-content .imagify-modal-section:first-child{margin-top:0}.imagify-modal-sidebar-content,.imagify-payment-modal .imagify-modal-sidebar{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.imagify-modal-sidebar-content{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}p.imagify-modal-sidebar-title{margin-top:5px;padding-right:40px;font-size:18px;color:#FFF}.imagify-modal-testimony{margin-top:1em}.imagify-modal-testimony+.imagify-modal-testimony{margin-top:2em}@media (max-height:620px){.imagify-modal-testimony+.imagify-modal-testimony{display:none}}.imagify-modal-testimony-person{display:table;width:100%}.imagify-modal-testimony-person>*{display:table-cell;vertical-align:middle}.imagify-modal-avatar{width:114px;line-height:0}.imagify-modal-avatar img{border:2px solid #FFF;border-radius:50%;width:96px;height:96px}.imagify-modal-identity a{text-decoration:none;font-weight:700}.imagify-modal-identity a:first-child{font-size:13px}.imagify-modal-identity a:first-child+a{display:block;font-size:10px;color:#7A8996}.imagify-modal-testimony-content p{font-size:13px;font-style:italic;line-height:1.7;color:#7A8996}.imagify-modal-sidebar-trust{margin-top:auto;padding-top:1.5em}.imagify-modal-sidebar-trust p{margin:0;font-weight:700;font-size:12px;line-height:1.7}.imagify-modal-sidebar-trust p img{margin-right:3px;vertical-align:-2px}.imagify-modal-sidebar-trust p+p{font-size:11px}.imagify-cart{text-align:left}.imagify-cart .imagify-cart-list{border-top:1px solid rgba(122,137,150,.2);border-bottom:1px solid rgba(122,137,150,.2)}.imagify-cart .imagify-cart-label{margin-bottom:.5em;font-size:10px;color:#2E3243}.imagify-cart-list p{margin:0;font-weight:700}.imagify-cart-item{margin:.4em 0}.imagify-cart .imagify-cart-suggestion{margin-top:-.3em}.imagify-cart-suggestion a,.imagify-cl-description p{font-size:10px}.imagify-remove-from-cart{border:0;padding:0;width:14px;height:14px;line-height:13px;border-radius:50%;background:#40B1D0;cursor:pointer;-webkit-transition:background .3s;-o-transition:background .3s;transition:background .3s}.imagify-remove-from-cart i:before{position:relative;top:-6px;left:-3px;font-size:13px;color:#FFF}.imagify-remove-from-cart:focus,.imagify-remove-from-cart:hover{background:#D0021B}.imagify-cart .imagify-cl-remove{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;width:45px}.imagify-cart .imagify-cl-name{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;width:200px}.imagify-cart .imagify-cl-description{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;padding-top:10px}.imagify-cart .imagify-cl-price{text-align:right}#imagify-payment-iframe{width:980px;height:672px;background:url(../images/loader-balls.svg) 50% 50% no-repeat #f6f7fb}.imagify-success-view{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:100%}.imagify-success-view p{font-weight:700;font-size:16px}.imagify-cart-emptied-item{margin:.3em auto;padding:6px 20px;background:#E6EBEF;border-radius:20px}.imagify-cart-emptied-item.imagify-cart-emptied-item p{font-weight:700}.imagify-cart-emptied-item a{color:#40b1d0;float:right;font-weight:700}
1
+ .imagify-2-free:after,.imagify-cols:after,.imagify-price-discount:before{content:""}.imagify-border-styled,.imagify-flex-table,.imagify-modal-cols,.imagify-offer-header,.imagify-payment-modal .imagify-modal-content,.imagify-tabs{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.imagify-analyzing .imagify-numbers-calc,.imagify-modal-content.imagify-iframe-viewing .imagify-modal-sidebar,.imagify-modal-content.imagify-success-viewing .imagify-modal-sidebar,.imagify-modal-section .imagify-loader,.imagify-modal-section.imagify-analyzing .imagify-modal-cols,.imagify-numbers-notcalc{display:none}.imagify-border-styled,.imagify-modal-cols{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.imagify-payment-modal{text-align:center;color:#7A8996}.imagify-payment-modal *{-webkit-box-sizing:border-box;box-sizing:border-box}.imagify-modal-loader{position:absolute;top:0;left:0;right:0;bottom:0;background:url(../images/loader-balls.svg) center no-repeat #fff;z-index:10}.imagify-payment-modal .imagify-modal-content{width:980px;max-width:100%;min-width:925px;padding:0}.imagify-modal-content.imagify-iframe-viewing{width:980px;height:672px;overflow:hidden}.imagify-iframe-viewing #imagify-payment-process-view{width:980px;height:668px}.imagify-payment-modal .imagify-modal-main{width:70%}.imagify-iframe-viewing .imagify-modal-main{width:auto}.imagify-payment-modal .imagify-modal-content.imagify-success-viewing{min-width:auto;width:450px;min-height:300px}.imagify-success-viewing .imagify-modal-main{width:100%}.imagify-payment-modal .imagify-modal-sidebar{width:30%;padding:15px 20px;background:#1F2332;color:#FFF}.imagify-modal-section{padding:0 25px}.imagify-modal-section.section-gray{margin:0 0 1em;padding:10px 25px 15px;background:#F6F7FB}.imagify-tabs-contents .section-gray{padding:8px 25px 10px}.imagify-modal-section .imagify-modal-title:first-child{margin-top:1em;margin-bottom:1.5em}.imagify-modal-section.section-gray .imagify-modal-title{margin-top:.5em;margin-bottom:.5em}.imagify-modal-title{font-size:1.8em}.imagify-analyzing .imagify-numbers-notcalc,.imagify-modal-section.imagify-analyzing .imagify-loader{display:block}.imagify-modal-section .imagify-loader{margin:2em auto}.imagify-border-styled{width:200px;margin:0 auto;color:#8BC34A;font-weight:700;font-size:.925em}.imagify-big-number,.imagify-payment-modal strong{font-weight:700;color:#4A4A4A}.imagify-border-styled:after,.imagify-border-styled:before{content:"";height:1px;background:rgba(0,0,0,.1);-ms-flex-preferred-size:40px;flex-basis:40px}.imagify-border-styled:before{margin-right:5px}.imagify-border-styled:after{margin-left:5px}.imagify-big-number{font-size:3.7em;margin:-3px 0;line-height:1}.imagify-popin-message{padding:5px 15px;text-align:left}.imagify-popin-message.imagify-error p{color:#FFF}.imagify-small-options{width:300px;margin:1em auto .5em;background:#338EA6;border-radius:4px}.imagify-small-options input[type=radio]:checked+label,.imagify-small-options input[type=radio]:not(:checked)+label{padding:8px 10px;font-size:13px;color:#FFF;-webkit-box-shadow:none;box-shadow:none;border-left:0}.imagify-small-options input[type=radio]:not(:checked)+label{background:#338EA6;color:rgba(255,255,255,.4)}.imagify-small-options input[type=radio]:checked+label{background:#40B1D0}.imagify-cols:after{display:table;clear:both}.js .imagify-iframe-viewing .close-btn{display:none}.imagify-modal .imagify-cols{padding:0 20px}.imagify-payment-modal .imagify-iconed{margin:1.5em 5em 1.5em 0}.imagify-iconed{position:relative;text-align:left;padding-left:42px;margin-right:15px;font-weight:500}.imagify-iconed .dashicons,.imagify-iconed .icon{position:absolute;font-size:2em;left:0;top:2px;color:#40B1D0}.imagify-payment-modal .close-btn{top:10px;right:10px;width:24px;height:24px;padding:2px 0 0 4.5px;color:#FFF;background:#40B1D0;border-radius:50%;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.imagify-payment-modal .close-btn i{margin-left:-3.5px;margin-top:-.5px}.imagify-payment-modal .close-btn:hover{background:#F6F7FB}.imagify-offer-line{margin-top:1.5em}.imagify-offer-line+.imagify-offer-line{margin-top:.75em}.imagify-offer-header{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 0 0 15px;border-radius:4px 4px 0 0;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.imagify-offer-header.imagify-offer-header.imagify-offer-header .imagify-inline-options label:last-child{border-radius:0 4px 0 0}.imagify-offer-header .imagify-inline-options{width:auto}.imagify-offer-title{font-weight:700;margin:0}.imagify-offer-header,.imagify-offer-header .imagify-inline-options input[type=radio]:not(:checked)+label{background:#E5EBEF}.imagify-offer-onetime .imagify-offer-header{padding-top:8px;padding-bottom:8px}.imagify-offer-onetimes>div{padding-top:15px;padding-bottom:15px}.imagify-offer-header .imagify-inline-options input[type=radio]:checked+label,.imagify-offer-header .imagify-inline-options input[type=radio]:not(:checked)+label{position:relative;padding:7px 30px;font-size:1em;letter-spacing:.05em;color:inherit;-webkit-box-shadow:0 0 0;box-shadow:0 0 0;border-radius:0}.imagify-offer-header .imagify-inline-options input[type=radio]:checked+label{background:#F6F7FB}.imagify-2-free{position:absolute;bottom:100%;left:0;right:0;padding:2px 10px;margin-bottom:8px;font-size:.8em;letter-spacing:0;text-transform:none;text-align:center;color:#FFF;background:#10121A;border-radius:2px}.imagify-2-free:after{position:absolute;left:50%;bottom:-3px;margin-left:-3px;border-top:3px solid #10121A;border-left:3px solid transparent;border-right:3px solid transparent}.imagify-2-free.imagify-b-right{bottom:auto;left:100%;right:-100%;margin-bottom:0;margin-left:8px}.imagify-2-free.imagify-b-right:after{left:-3px;bottom:auto;top:50%;margin-top:-3px;margin-left:0;border-right:3px solid #10121A;border-top:3px solid transparent;border-bottom:3px solid transparent;border-left:0}.imagify-2-free.imagify-b-bottom{bottom:-100%;left:0;right:0;margin-top:8px}.imagify-2-free.imagify-b-bottom:after{top:-3px;bottom:auto;border-bottom:3px solid #10121A;border-left:3px solid transparent;border-right:3px solid transparent;border-top:0}.imagify-offer-content{text-align:left;background:#F6F7FB;border-radius:0 0 4px 4px;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.imagify-offer-onetime .imagify-offer-content{padding:10px 0}div.imagify-col-checkbox{position:relative;width:25.5%;padding-top:10px;padding-bottom:7px}.imagify-col-checkbox label{display:block;padding-left:55px!important}.imagify-col-checkbox .imagify-checkbox.imagify-checkbox:checked,.imagify-col-checkbox .imagify-checkbox.imagify-checkbox:not(:checked){position:absolute;top:50%;left:6px;margin:-8px 0 0}.imagify-col-checkbox .imagify-checkbox.imagify-checkbox:checked+label:before,.imagify-col-checkbox .imagify-checkbox.imagify-checkbox:not(:checked)+label:before{margin:0;top:-2px;left:6px;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}.imagify-offer-by,.imagify-offer-size{-webkit-transition:all .275s;-o-transition:all .275s}.imagify-col-checkbox .imagify-checkbox.imagify-checkbox:checked+label:after,.imagify-col-checkbox .imagify-checkbox.imagify-checkbox:not(:checked)+label:after{top:1px;left:13px}.imagify-offer-size{font-size:30px;color:#2E3243;font-weight:700;transition:all .275s}.imagify-offer-by{font-size:10px;transition:all .275s}.imagify-approx{display:none;font-size:11px;line-height:1.2;-webkit-transition:all .275s;-o-transition:all .275s;transition:all .275s}div.imagify-col-price{width:35%}.imagify-flex-table .imagify-price-block{padding-left:0;padding-right:0}.imagify-offer-monthlies .imagify-price-block,.imagify-offer-monthly .imagify-flex-table .imagify-price-block{padding-top:0}.imagify-flex-table .imagify-price-complement{padding-right:0;font-size:10px;font-weight:700}.imagify-price-block,.imagify-price-discount{white-space:nowrap}.imagify-price-block span,.imagify-price-discount span{display:inline-block;vertical-align:middle}.imagify-price-discount.imagify-price-discount{position:relative;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;padding-top:15px;font-weight:700;width:70px}.imagify-price-discount:before{position:absolute;top:25px;width:62%;height:2px;background:#2E3243;-webkit-transform:rotate(-15deg);-ms-transform:rotate(-15deg);transform:rotate(-15deg)}.imagify-offer-onetimes .imagify-price-discount:before{width:100%}.imagify-price-discount-dollar{color:#2E3243}.imagify-price-discount-number{color:#8BA6B4}.imagify-offer-selected .imagify-price-discount-number{color:#FFF}span.imagify-dollars{color:#1F2332;font-size:18px;font-weight:700;vertical-align:-2px}.imagify-offer-onetime .imagify-col-price{padding-top:0}.imagify-offer-onetime .imagify-dollars{vertical-align:-1px}.imagify-price-big,.imagify-price-mini{color:#40B1D0;font-weight:700}.imagify-price-big{font-size:36px}span.imagify-price-mini{font-size:18px;vertical-align:2px}span.imagify-price-by{font-size:10px;color:#1F2332;vertical-align:-13px;text-indent:-27px}.imagify-offer-selected,.imagify-offer-selected .imagify-checkbox.imagify-checkbox:checked+label:after,.imagify-offer-selected .imagify-checkbox.imagify-checkbox:not(:checked)+label:after,.imagify-offer-selected .imagify-col-other-actions a,.imagify-offer-selected .imagify-offer-size,.imagify-offer-selected .imagify-offer-title,.imagify-offer-selected .imagify-price-big,.imagify-offer-selected .imagify-price-complement,.imagify-offer-selected .imagify-price-mini{color:#FFF}.imagify-col-other-actions{width:18.5%;text-align:right}.imagify-col-other-actions a{font-size:11px}.imagify-offer-selected .imagify-offer-header,.imagify-offer-selected .imagify-offer-header .imagify-inline-options input[type=radio]:not(:checked)+label{background:#338EA6}.imagify-offer-selected .imagify-offer-content,.imagify-offer-selected .imagify-offer-header .imagify-inline-options input[type=radio]:checked+label{background:#40B1D0}.imagify-offer-selected .imagify-checkbox.imagify-checkbox:checked+label:before,.imagify-offer-selected .imagify-checkbox.imagify-checkbox:not(:checked)+label:before{border-color:#FFF;background:#40B1D0}.imagify-offer-selected .imagify-offer-by{color:#2E3243}.imagify-enough-free .imagify-not-enough-title,.imagify-enough-title{display:none}.imagify-enough-free .imagify-enough-title{display:block}.imagify-submit-line{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:2em 0;text-align:left}.imagify-coupon-section{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.imagify-coupon-section p{margin:0;line-height:1.3}.imagify-coupon-text{width:200px;max-width:100%;padding-right:15px}.imagify-coupon-loader{display:none}.imagify-coupon-text.checking{text-align:right}.imagify-coupon-text.checking .imagify-coupon-loader{display:inline}.imagify-coupon-text.checking label{display:none}.imagify-coupon-input{position:relative}.imagify-coupon-input input{position:relative;z-index:1}[id=imagify-coupon-validate].button-secondary{position:absolute;top:1px;right:3px;bottom:2px;-webkit-box-shadow:none;box-shadow:none;padding:4px 10px;z-index:0;-webkit-transition:-webkit-transform .275s;-o-transition:transform .275s;transition:transform .275s;transition:transform .275s,-webkit-transform .275s}.imagify-canbe-validate [id=imagify-coupon-validate]{-webkit-transform:translateX(45px);-ms-transform:translateX(45px);transform:translateX(45px)}.imagify-modal-section+.imagify-modal-promotion{margin-top:-1em}.imagify-modal-promotion{position:relative;overflow:hidden;display:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:15px 25px;background:#604D90;text-shadow:0 0 3px rgba(0,0,0,.3)}.imagify-modal-promotion.active{display:-webkit-box;display:-ms-flexbox;display:flex}[id=imagify-pricing-tab-onetime] .imagify-modal-promotion{margin-bottom:4em}.imagify-modal-promotion:before{content:"\f488";position:absolute;top:28px;left:8%;font-family:dashicons;font-size:90px;color:#8476A9;text-shadow:none}.imagify-modal-promotion p{position:relative;margin:.2em 0;color:#FFF}.imagify-promo-title{-ms-flex-preferred-size:100%;flex-basis:100%;text-transform:uppercase;font-size:20px;font-weight:700;letter-spacing:.125em}.imagify-until-date{-ms-flex-preferred-size:200px;flex-basis:200px;text-align:right}.imagify-until-date strong{color:#FFF}.imagify-submit-line button{font-size:16px}input.imagify-coupon-code{padding:10px;border:2px solid #7A8996;font-size:.875em;font-weight:700;border-radius:3px}.validated.imagify-coupon-section .imagify-coupon-text,.validated.imagify-coupon-section strong{color:#8BC34A}.validated.imagify-coupon-section .imagify-coupon-code{color:#8BC34A;border-color:#8BC34A}.invalid.imagify-coupon-section .imagify-coupon-text,.invalid.imagify-coupon-section strong{color:#d0021b}.invalid.imagify-coupon-section .imagify-coupon-code{color:#d0021b;border-color:#d0021b}.imagify-footer-lines{width:500px;max-width:100%;margin:2em auto 2.5em;font-size:.85em;line-height:1.5}.imagify-year-selected .imagify-switch-my .imagify-yearly{display:block}.imagify-month-selected .imagify-switch-my .imagify-yearly,.imagify-year-selected .imagify-switch-my .imagify-monthly{display:none}.imagify-month-selected .imagify-switch-my .imagify-monthly{display:block}.imagify-flex-table{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.imagify-flex-table>*{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;padding:7px 15px}div.imagify-col-details{width:22%;padding-left:25px}.imagify-col-details p{margin:0}.imagify-pricing-table{margin:0 20px}.imagify-pricing-table .imagify-offer-line{padding:.6em 0;border:2px solid #E8EEF0;text-align:left;border-radius:3px}.imagify-pricing-table .imagify-offer-line:first-child{margin-top:.75em}.imagify-pricing-table .imagify-offer-line.imagify-offer-selected:first-child{margin-top:1.75em}.imagify-pricing-table .imagify-offer-line+.imagify-offer-line{margin-top:-2px}.imagify-pricing-table .imagify-col-other-actions{width:20.5%}.imagify-pricing-table .imagify-approx{margin-left:0;line-height:.5;margin-bottom:1em}.imagify-pricing-table .imagify-offer-selected{-webkit-transform:scale(1.03);-ms-transform:scale(1.03);transform:scale(1.03);background:#40B1D0;border-width:0}.imagify-pricing-table .imagify-offer-selected .imagify-approx{color:#FFF}.imagify-pricing-table .imagify-button-secondary{padding:3px 20px;-webkit-box-shadow:none;box-shadow:none;text-transform:uppercase;font-size:12px;letter-spacing:.025em}.imagify-offer-selected.imagify-offer-selected .imagify-button-secondary{border:2px solid #FFF;background:#40B1D0;-webkit-box-shadow:none;box-shadow:none;text-shadow:none!important}.imagify-offer-selected.imagify-offer-selected .imagify-button-secondary:focus,.imagify-offer-selected.imagify-offer-selected .imagify-button-secondary:hover{background:#FFF;color:#40B1D0}.imagify-col .imagify-special-needs{margin-left:25px}.imagify-special-needs strong{font-size:25px;font-weight:700;color:#40B1D0}.imagify-special-needs span{display:block;font-size:12px;margin-top:-.5em}div.imagify-col-price{position:relative}.imagify-recommend{display:none;position:absolute;left:-20px;bottom:100%;padding:0;margin-bottom:8px;color:#1F2332;font-weight:700;font-style:italic}.imagify-offer-selected .imagify-recommend,.imagify-tab-content.imagify-current{display:block}[class*=imagify-onetime-] .imagify-recommend{left:65px;margin-bottom:20px}.imagify-recommend:before{content:"";position:absolute;top:7px;left:-35px;width:29px;height:30px;background:url(../images/icon-arrow-choice.png) 0 no-repeat;background-size:contain}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (-o-min-device-pixel-ratio:2/1),only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){.imagify-recommend:before{background-image:url(../images/icon-arrow-choice.svg)}}.imagify-offer-line[class*=imagify-onetime-]{padding:0;margin:.3em 0 0}.imagify-offer-line.imagify-offer-line[class*=imagify-onetime-]:first-child{margin-top:2em}.imagify-offer-line[class*=imagify-onetime-]+.imagify-offer-line{margin-top:.5em}.imagify-offer-selected.imagify-offer-line[class*=imagify-onetime-]{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);border-width:2px}.imagify-offer-line[class*=imagify-onetime-] .imagify-col-details{position:relative;overflow:hidden;width:21%;background:#1F2332;color:#FFF}.imagify-offer-selected.imagify-offer-line[class*=imagify-onetime-] .imagify-col-details{background:#338EA6}.imagify-offer-line[class*=imagify-onetime-] .imagify-col-details:before{content:"";position:absolute;bottom:0;right:25px;width:75px;height:54px;background:url(../images/icon-pack.png)}.imagify-offer-line[class*=imagify-onetime-] .imagify-col-other-actions{width:30%}.imagify-offer-line[class*=imagify-onetime-] .imagify-approx,.imagify-offer-line[class*=imagify-onetime-] .imagify-offer-size{color:#FFF}.imagify-offer-line[class*=imagify-onetime-] .imagify-offer-size{font-size:24px}.imagify-offer-line[class*=imagify-onetime-] .imagify-approx{font-size:12px}.imagify-offer-line[class*=imagify-onetime-] .imagify-price-block{padding-left:10px}.imagify-offer-line[class*=imagify-onetime-] .imagify-dollars{vertical-align:middle}.imagify-offer-line[class*=imagify-onetime-] .imagify-price-big{vertical-align:-5px}.imagify-offer-line[class*=imagify-onetime-] .imagify-price-mini{vertical-align:7px}.imagify-tabs{margin-bottom:0;list-style:none;background:#E5EBEF}.imagify-modal-content .imagify-tabs{margin:1em 0 0}.imagify-tab{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;width:50%;margin:0;font-size:23px}.imagify-tab a{display:block;padding:15px 10px;color:inherit;text-decoration:none}.imagify-tab a:focus{-webkit-box-shadow:none;box-shadow:none;outline:0;color:#40B1D8}.imagify-tab.imagify-current a{background:#F6F7FB}.imagify-tab-content{display:none}.imagify-tab-content .imagify-modal-section:first-child{margin-top:0}.imagify-modal-sidebar-content,.imagify-payment-modal .imagify-modal-sidebar{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.imagify-modal-sidebar-content{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}p.imagify-modal-sidebar-title.imagify-modal-sidebar-title{margin-top:5px;padding-right:40px;font-size:18px;color:#FFF}.imagify-modal-testimony{margin-top:1em}.imagify-modal-testimony+.imagify-modal-testimony{margin-top:2em}@media (max-height:620px){.imagify-modal-testimony+.imagify-modal-testimony{display:none}}.imagify-modal-testimony-person{display:table;width:100%}.imagify-modal-testimony-person>*{display:table-cell;vertical-align:middle}.imagify-modal-avatar{width:114px;line-height:0}.imagify-modal-avatar img{border:2px solid #FFF;border-radius:50%;width:96px;height:96px}.imagify-modal-identity a{text-decoration:none;font-weight:700}.imagify-modal-identity a:first-child{font-size:13px}.imagify-modal-identity a:first-child+a{display:block;font-size:10px;color:#7A8996}.imagify-modal-testimony-content.imagify-modal-testimony-content p{font-size:13px;font-style:italic;line-height:1.7;color:#7A8996}.imagify-modal-sidebar-trust{margin-top:auto;padding-top:1.5em}.imagify-modal-sidebar-trust p{margin:0;font-weight:700;font-size:12px;line-height:1.7}.imagify-modal-sidebar-trust p img{margin-right:3px;vertical-align:-2px}.imagify-modal-sidebar-trust p+p{font-size:11px}.imagify-cart{text-align:left}.imagify-cart .imagify-cart-list{border-top:1px solid rgba(122,137,150,.2);border-bottom:1px solid rgba(122,137,150,.2)}.imagify-cart .imagify-cart-label{margin-bottom:.5em;font-size:10px;color:#2E3243}.imagify-cart-list p{margin:0;font-weight:700}.imagify-cart-item{margin:.4em 0}.imagify-cart .imagify-cart-suggestion{margin-top:-.3em}.imagify-cart-suggestion a,.imagify-cl-description p{font-size:10px}.imagify-remove-from-cart{border:0;padding:0;width:14px;height:14px;line-height:13px;border-radius:50%;background:#40B1D0;cursor:pointer;-webkit-transition:background .3s;-o-transition:background .3s;transition:background .3s}.imagify-remove-from-cart i:before{position:relative;top:-6px;left:-3px;font-size:13px;color:#FFF}.imagify-remove-from-cart:focus,.imagify-remove-from-cart:hover{background:#D0021B}.imagify-cart .imagify-cl-remove{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;width:45px}.imagify-cart .imagify-cl-name{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;width:200px}.imagify-cart .imagify-cl-description{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;padding-top:10px}.imagify-cart .imagify-cl-price{text-align:right}#imagify-payment-iframe{width:980px;height:672px;background:url(../images/loader-balls.svg) 50% 50% no-repeat #f6f7fb}.imagify-success-view{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:100%}.imagify-success-view p{font-weight:700;font-size:16px}.imagify-cart-emptied-item{margin:.3em auto;padding:6px 20px;background:#E6EBEF;border-radius:20px}.imagify-cart-emptied-item.imagify-cart-emptied-item p{font-weight:700}.imagify-cart-emptied-item a{color:#40b1d0;float:right;font-weight:700}
assets/images/big-blue-check.png CHANGED
File without changes
assets/images/icon-alert.svg CHANGED
File without changes
assets/images/icon-arrow-choice.png CHANGED
File without changes
assets/images/icon-arrow-choice.svg CHANGED
File without changes
assets/images/icon-doc-image.svg CHANGED
File without changes
assets/images/icon-external.svg CHANGED
File without changes
assets/images/icon-level.svg CHANGED
File without changes
assets/images/icon-load.svg CHANGED
File without changes
assets/images/icon-lock.png CHANGED
File without changes
assets/images/icon-lock.svg CHANGED
File without changes
assets/images/icon-pack.png CHANGED
File without changes
assets/images/icon-pack.svg CHANGED
File without changes
assets/images/icon-time.svg CHANGED
File without changes
assets/images/imagify-logo.png CHANGED
File without changes
assets/images/imagify-menu-bar.jpg CHANGED
File without changes
assets/images/lazyload.png CHANGED
File without changes
assets/images/logo-wprocket.png CHANGED
File without changes
assets/images/logo-wprocket.svg CHANGED
File without changes
assets/images/logo-wprocket@2x.png CHANGED
File without changes
assets/images/pic-ericwaltr.jpg CHANGED
File without changes
assets/images/pic-srhdesign.jpg CHANGED
File without changes
assets/images/spinner.gif CHANGED
File without changes
assets/images/upload-image.png CHANGED
File without changes
assets/js/admin.js CHANGED
@@ -38,7 +38,7 @@ jQuery.extend( window.imagify, {
38
  };
39
 
40
  return function() {
41
- compiled = compiled || _.template( jQuery( '#tmpl-' + id ).html(), options );
42
  data = data || {};
43
  return compiled( data );
44
  };
38
  };
39
 
40
  return function() {
41
+ compiled = compiled || _.template( jQuery( '#tmpl-' + id ).html(), null, options );
42
  data = data || {};
43
  return compiled( data );
44
  };
assets/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- window.imagify=window.imagify||{},jQuery.extend(window.imagify,{concat:ajaxurl.indexOf("?")>0?"&":"?",log:function(a){void 0!==console&&console.log(a)},info:function(a){void 0!==console&&console.info(a)},openModal:function(a){var b=a.data("target")||a.attr("href");jQuery(b).css("display","flex").hide().fadeIn(400).attr({"aria-hidden":"false",tabindex:"0"}).focus().removeAttr("tabindex").addClass("modal-is-open"),jQuery("body").addClass("imagify-modal-is-open")},template:function(a){return void 0===_?"":_.memoize(function(b){var c,d={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^}]+?)\}\}(?!\})/g,variable:"data"};return function(){return c=c||_.template(jQuery("#tmpl-"+a).html(),d),b=b||{},c(b)}})},humanSize:function(a){var b,c=["B","kB","MB"];return 0===a?"0 kB":(b=parseInt(Math.floor(Math.log(a)/Math.log(1024)),10),(a/Math.pow(1024,b)).toFixed(2)+" "+c[b])}}),function(a,b,c,d){a(".imagify-modal").attr("aria-hidden","true"),a(b).on("click.imagify",".imagify-modal-trigger",function(b){b.preventDefault(),c.imagify.openModal(a(this))}).on("click.imagify",".imagify-modal .close-btn",function(){a(this).closest(".imagify-modal").fadeOut(400).attr("aria-hidden","true").removeClass("modal-is-open").trigger("modalClosed.imagify"),a("body").removeClass("imagify-modal-is-open")}).on("blur.imagify",".imagify-modal .close-btn",function(){var b=a(this).closest(".imagify-modal");"false"===b.attr("aria-hidden")&&b.attr("tabindex","0").focus().removeAttr("tabindex")}).on("click.imagify",".imagify-modal",function(b){a(b.target).filter(".modal-is-open").find(".close-btn").trigger("click.imagify")}).on("keydown.imagify",function(b){27===b.keyCode&&a(".imagify-modal.modal-is-open").length>0&&(b.preventDefault(),a(".imagify-modal.modal-is-open").find(".close-btn").trigger("click.imagify"))})}(jQuery,document,window);
1
+ window.imagify=window.imagify||{},jQuery.extend(window.imagify,{concat:ajaxurl.indexOf("?")>0?"&":"?",log:function(a){void 0!==console&&console.log(a)},info:function(a){void 0!==console&&console.info(a)},openModal:function(a){var b=a.data("target")||a.attr("href");jQuery(b).css("display","flex").hide().fadeIn(400).attr({"aria-hidden":"false",tabindex:"0"}).focus().removeAttr("tabindex").addClass("modal-is-open"),jQuery("body").addClass("imagify-modal-is-open")},template:function(a){return void 0===_?"":_.memoize(function(b){var c,d={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^}]+?)\}\}(?!\})/g,variable:"data"};return function(){return c=c||_.template(jQuery("#tmpl-"+a).html(),null,d),b=b||{},c(b)}})},humanSize:function(a){var b,c=["B","kB","MB"];return 0===a?"0 kB":(b=parseInt(Math.floor(Math.log(a)/Math.log(1024)),10),(a/Math.pow(1024,b)).toFixed(2)+" "+c[b])}}),function(a,b,c,d){a(".imagify-modal").attr("aria-hidden","true"),a(b).on("click.imagify",".imagify-modal-trigger",function(b){b.preventDefault(),c.imagify.openModal(a(this))}).on("click.imagify",".imagify-modal .close-btn",function(){a(this).closest(".imagify-modal").fadeOut(400).attr("aria-hidden","true").removeClass("modal-is-open").trigger("modalClosed.imagify"),a("body").removeClass("imagify-modal-is-open")}).on("blur.imagify",".imagify-modal .close-btn",function(){var b=a(this).closest(".imagify-modal");"false"===b.attr("aria-hidden")&&b.attr("tabindex","0").focus().removeAttr("tabindex")}).on("click.imagify",".imagify-modal",function(b){a(b.target).filter(".modal-is-open").find(".close-btn").trigger("click.imagify")}).on("keydown.imagify",function(b){27===b.keyCode&&a(".imagify-modal.modal-is-open").length>0&&(b.preventDefault(),a(".imagify-modal.modal-is-open").find(".close-btn").trigger("click.imagify"))})}(jQuery,document,window);
assets/js/bulk.js CHANGED
@@ -693,8 +693,9 @@
693
  * User account.
694
  */
695
  data.unconsumed_quota = data.unconsumed_quota.toFixed( 1 ); // A mystery where a float rounded on php side is not rounded here anymore. JavaScript is fun, it always surprises you in a manner you didn't expect.
 
696
  $( '.imagify-unconsumed-percent' ).html( data.unconsumed_quota + '%' );
697
- $( '.imagify-unconsumed-bar' ).css( 'width', data.unconsumed_quota + '%' );
698
 
699
  /**
700
  * Global chart.
693
  * User account.
694
  */
695
  data.unconsumed_quota = data.unconsumed_quota.toFixed( 1 ); // A mystery where a float rounded on php side is not rounded here anymore. JavaScript is fun, it always surprises you in a manner you didn't expect.
696
+ $( '.imagify-meteo-icon' ).html( data.quota_icon );
697
  $( '.imagify-unconsumed-percent' ).html( data.unconsumed_quota + '%' );
698
+ $( '.imagify-unconsumed-bar' ).css( 'width', data.unconsumed_quota + '%' ).parent().attr( 'class', data.quota_class );
699
 
700
  /**
701
  * Global chart.
assets/js/bulk.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,b){var c=a.propHooks.checked;a.propHooks.checked={set:function(b,d,e){var f;return f=void 0===c?b[e]=d:c(b,d,e),a(b).trigger("change.imagify"),f}},a.fn.imagifyHide=function(b,c){return b&&b>0?this.hide(b,function(){a(this).addClass("hidden").css("display",""),void 0!==c&&c()}):(this.addClass("hidden"),void 0!==c&&c()),this.attr("aria-hidden","true")},a.fn.imagifyShow=function(b,c){return void 0!==c&&c(),b&&b>0?this.show(b,function(){a(this).removeClass("hidden").css("display","")}):this.removeClass("hidden"),this.attr("aria-hidden","false")}}(jQuery),function(a,b,c,d){c.imagify.bulk={charts:{overview:{canvas:!1,donut:!1,data:{labels:[imagifyBulk.labels.overviewChartLabels.unoptimized,imagifyBulk.labels.overviewChartLabels.optimized,imagifyBulk.labels.overviewChartLabels.error],datasets:[{data:[],backgroundColor:["#10121A","#46B1CE","#C51162"],borderWidth:0}]}},files:{donuts:{}},share:{canvas:!1,donut:!1}},queue:[],status:{},displayedWaitMessage:!1,hasMultipleRows:!0,processIsStopped:!1,globalGain:0,globalOriginalSize:0,globalOptimizedSize:0,folderTypes:[],init:function(){this.drawOverviewChart(),this.hasMultipleRows=a('.imagify-bulk-table [name="group[]"]').length>1,a(".imagify-level-selector-button").on("click.imagify",this.openLevelSelectorFromButton),a(".imagify-level-selector-list input").on("change.imagify init.imagify",this.syncLevelSelectorFromRadio).filter(":checked").trigger("init.imagify"),a(b).on("keypress.imagify click.imagify",this.closeLevelSelectors),a('.imagify-bulk-table [name="group[]"]').on("change.imagify init.imagify",this.toggleOptimizationButton).trigger("init.imagify"),a(".imagify-show-table-details").on("click.imagify open.imagify close.imagify",this.toggleOptimizationDetails),a("#imagify-bulk-action").on("click.imagify",this.maybeLaunchAllProcesses),a(".imagify-share-networks a").on("click.imagify",this.share),a(c).on("processQueue.imagify",this.processQueue).on("optimizeFiles.imagify",this.optimizeFiles).on("queueEmpty.imagify",this.queueEmpty),imagifyBulk.ajaxActions.getStats&&a('.imagify-bulk-table [data-group-id="library"][data-context="wp"]').length&&(imagifyBulk.heartbeatId=!1),imagifyBulk.heartbeatId&&a(b).on("heartbeat-send",this.addHeartbeat).on("heartbeat-tick",this.processHeartbeat),a(b).on("heartbeat-send",this.addRequirementsHeartbeat).on("heartbeat-tick",this.processRequirementsHeartbeat)},drawOverviewChart:function(d){var e,f;if(this.charts.overview.canvas||(this.charts.overview.canvas=b.getElementById("imagify-overview-chart"),this.charts.overview.canvas)){if(d=d&&a.isArray(d)?d:[],this.charts.overview.donut)return void(d.length&&(0===d.reduce(function(a,b){return a+b},0)&&(d[0]=1),this.charts.overview.donut.data.datasets[0].data=d,this.charts.overview.donut.update()));this.charts.overview.data.datasets[0].data=[parseInt(this.charts.overview.canvas.getAttribute("data-unoptimized"),10),parseInt(this.charts.overview.canvas.getAttribute("data-optimized"),10),parseInt(this.charts.overview.canvas.getAttribute("data-errors"),10)],e=a.extend({},this.charts.overview.data),d.length&&(e.datasets[0].data=d),0===e.datasets[0].data.reduce(function(a,b){return a+b},0)&&(e.datasets[0].data[0]=1),this.charts.overview.donut=new c.imagify.Chart(this.charts.overview.canvas,{type:"doughnut",data:e,options:{legend:{display:!1},events:[],animation:{easing:"easeOutBounce"},tooltips:{displayColors:!1,callbacks:{label:function(a,b){return b.datasets[a.datasetIndex].data[a.index]}}},responsive:!1,cutoutPercentage:85}}),f='<ul class="imagify-doughnut-legend">',a.each(e.labels,function(a,b){f+='<li><span style="background-color:'+e.datasets[0].backgroundColor[a]+'"></span>'+b+"</li>"}),f+="</ul>",b.getElementById("imagify-overview-chart-legend").innerHTML=f}},drawFileChart:function(b){var d=this.charts.files.donuts;b.each(function(){var b=parseInt(a(this).closest(".imagify-chart").next(".imagipercent").text().replace("%",""),10);if(void 0!==d[this.id])return d[this.id].data.datasets[0].data[0]=b,d[this.id].data.datasets[0].data[1]=100-b,void d[this.id].update();d[this.id]=new c.imagify.Chart(this,{type:"doughnut",data:{datasets:[{data:[b,100-b],backgroundColor:["#00B3D3","#D8D8D8"],borderColor:"#fff",borderWidth:1}]},options:{legend:{display:!1},events:[],animation:{easing:"easeOutBounce"},tooltips:{enabled:!1},responsive:!1}})}),this.charts.files.donuts=d},drawShareChart:function(){var d;if(this.charts.share.canvas||(this.charts.share.canvas=b.getElementById("imagify-ac-chart"),this.charts.share.canvas)){if(d=parseInt(a(this.charts.share.canvas).closest(".imagify-ac-chart").attr("data-percent"),10),this.charts.share.donut)return this.charts.share.donut.data.datasets[0].data[0]=d,this.charts.share.donut.data.datasets[0].data[1]=100-d,void this.charts.share.donut.update();this.charts.share.donut=new c.imagify.Chart(this.charts.share.canvas,{type:"doughnut",data:{datasets:[{data:[d,100-d],backgroundColor:["#40B1D0","#FFFFFF"],borderWidth:0}]},options:{legend:{display:!1},events:[],animation:{easing:"easeOutBounce"},tooltips:{enabled:!1},responsive:!1,cutoutPercentage:70}})}},getAjaxUrl:function(a,b){var d=b.groupId.replace(/[\s_-](\S)/g,function(a,b){return b.toUpperCase()});return a=a.replace("%GROUP_ID%",d),a=imagifyBulk.ajaxActions[a],ajaxurl+c.imagify.concat+"_wpnonce="+imagifyBulk.ajaxNonce+"&optimization_level="+b.level+"&action="+a+"&folder_type="+b.groupId},getFolderTypes:function(){return c.imagify.bulk.folderTypes.length||a(".imagify-row-folder-type").each(function(){var b=a(this),d=b.data("group-id");"library"===d&&(d+="|"+b.data("context")),c.imagify.bulk.folderTypes.push(d)}),c.imagify.bulk.folderTypes},getConfirmMessage:function(){return imagifyBulk.labels.processing},closeLevelSelector:function(a,b){if(a&&a.length)return void 0!==b&&b>0?void c.setTimeout(function(){c.imagify.bulk.closeLevelSelector(a)},b):void a.attr("aria-hidden","true")},stopProcess:function(b,d){this.processIsStopped=!0,c.imagify.bulk.status[d.groupId]={isError:!0,id:b},a(c).trigger("queueEmpty.imagify")},hasBlockingError:function(b){return b=void 0!==b&&b,imagifyBulk.curlMissing?(b&&c.imagify.bulk.displayError({html:imagifyBulk.labels.curlMissing}),!0):imagifyBulk.editorMissing?(b&&c.imagify.bulk.displayError({html:imagifyBulk.labels.editorMissing}),!0):imagifyBulk.extHttpBlocked?(b&&c.imagify.bulk.displayError({html:imagifyBulk.labels.extHttpBlocked}),!0):imagifyBulk.apiDown?(b&&c.imagify.bulk.displayError({html:imagifyBulk.labels.apiDown}),!0):imagifyBulk.keyIsValid?!!imagifyBulk.isOverQuota&&(b&&c.imagify.bulk.displayError({title:imagifyBulk.labels.overQuotaTitle,html:a("#tmpl-imagify-overquota-alert").html(),type:"info",customClass:"imagify-swal-has-subtitle imagify-swal-error-header",showConfirmButton:!1}),!0):(b&&c.imagify.bulk.displayError({title:imagifyBulk.labels.invalidAPIKeyTitle,type:"info"}),!0)},displayError:function(b,c,d){var e={title:"",html:"",type:"error",customClass:"",width:620,padding:0,showCloseButton:!0,showConfirmButton:!0};a.isPlainObject(b)?d=a.extend({},e,b):(d=d||{},d=a.extend({},e,{title:b||"",html:c||""},d)),d.title=d.title||imagifyBulk.labels.error,d.customClass+=" imagify-sweet-alert",swal(d).catch(swal.noop)},displayErrorInRow:function(b,c){var d,e;return b=a(b()),d=b.find(".imagify-cell-status ~ td"),e=d.length,c=c||"",d.remove(),b.find(".imagify-cell-status").after('<td colspan="'+e+'">'+c+"</td>"),b},displayFolderRow:function(a,b){var d,e,f,g;return"resting"===a?(b.next(".imagify-row-waiting, .imagify-row-working").remove(),void b.imagifyShow()):(d=b.next(".imagify-row-waiting, .imagify-row-working"),"waiting"===a?(f="#d2d3d6",g=imagifyBulk.labels.waitingOtimizationsText):(f="#40b1d0",g=imagifyBulk.labels.imagesOptimizedText.replace("%s","<span>0</span>")),d.length?(d.hasClass("imagify-row-"+a)||(d.attr("class","imagify-row-"+a),d.find(".imagify-cell-checkbox svg").attr("fill",f),d.children(".imagify-cell-images-optimized").html(g)),b.imagifyHide(),void d.imagifyShow()):(d=b.clone().attr({class:"imagify-row-"+a,"aria-hidden":"false"}),e=c.imagify.template("imagify-spinner"),d.children(".imagify-cell-checkbox").html(e()).find("svg").attr("fill",f),d.children(".imagify-cell-title").html('<span class="imagify-cell-label">'+d.children(".imagify-cell-title").text()+"</span>"),d.children(".imagify-cell-images-optimized").html(g),d.children(".imagify-cell-errors, .imagify-cell-optimized, .imagify-cell-original, .imagify-cell-level").text(""),void b.imagifyHide().after(d)))},displayShareBox:function(){var b,d,e,f,g=imagifyBulk.labels.textToShare;if(!this.globalGain||this.queue.length)return this.globalGain=0,this.globalOriginalSize=0,void(this.globalOptimizedSize=0);b=(100-this.globalOptimizedSize/this.globalOriginalSize*100).toFixed(2),d=c.imagify.humanSize(this.globalGain,1),e=c.imagify.humanSize(this.globalOriginalSize,1),g=g.replace("%1$s",d),g=g.replace("%2$s",e),g=encodeURIComponent(g),f=a(".imagify-row-complete"),f.find(".imagify-ac-rt-total-gain").html(d),f.find(".imagify-ac-rt-total-original").html(e),f.find(".imagify-ac-chart").attr("data-percent",b),f.find(".imagify-sn-twitter").attr("href",imagifyBulk.labels.twitterShareURL+"&amp;text="+g),this.drawShareChart(),f.addClass("done").imagifyShow(),a("html, body").animate({scrollTop:f.offset().top},200),this.globalGain=0,this.globalOriginalSize=0,this.globalOptimizedSize=0},updateStats:function(b){var d;b&&a.isPlainObject(b)&&(c.imagify.bulk.charts.overview.donut.data&&(d=c.imagify.bulk.charts.overview.donut.data.datasets[0].data,b.unoptimized_attachments===d[0]&&b.optimized_attachments===d[1]&&b.errors_attachments===d[2])||(b.unconsumed_quota=b.unconsumed_quota.toFixed(1),a(".imagify-unconsumed-percent").html(b.unconsumed_quota+"%"),a(".imagify-unconsumed-bar").css("width",b.unconsumed_quota+"%"),a("#imagify-overview-chart-percent").html(b.optimized_attachments_percent+"<span>%</span>"),a(".imagify-total-percent").html(b.optimized_attachments_percent+"%"),c.imagify.bulk.drawOverviewChart([b.unoptimized_attachments,b.optimized_attachments,b.errors_attachments]),a("#imagify-total-optimized-attachments").html(b.already_optimized_attachments),a("#imagify-original-bar").find(".imagify-barnb").html(b.original_human),a("#imagify-optimized-bar").css("width",100-b.optimized_percent+"%").find(".imagify-barnb").html(b.optimized_human),a("#imagify-total-optimized-attachments-pct").html(b.optimized_percent+"%")))},openLevelSelectorFromButton:function(b){var c=a("#"+a(this).attr("aria-controls"));b.stopPropagation(),a(".imagify-level-selector-list").not(c).attr("aria-hidden","true"),c.attr("aria-hidden","false").find(":checked").trigger("focus.imagify")},syncLevelSelectorFromRadio:function(){var b=a(this).closest(".imagify-level-choice");b.addClass("imagify-current-level").attr("aria-current","true").siblings(".imagify-level-choice").removeClass("imagify-current-level").attr("aria-current","false"),b.closest(".imagify-level-selector").find(".imagify-current-level-info").html(b.find("label").html())},closeLevelSelectors:function(b){"keypress"===b.type&&27!==b.keyCode&&13!==b.keyCode||c.imagify.bulk.closeLevelSelector(a('.imagify-level-selector-list[aria-hidden="false"]'))},toggleOptimizationButton:function(){if(!c.imagify.bulk.hasMultipleRows&&!this.checked)return void a(this).prop("checked",!0);a('.imagify-bulk-table [name="group[]"]:checked').length?a("#imagify-bulk-action").removeAttr("disabled"):a("#imagify-bulk-action").attr("disabled","disabled")},toggleOptimizationDetails:function(b){var c,d=a(this),e=d.closest(".imagify-bulk-table").find(".imagify-bulk-table-details");c="open"===b.type||"close"!==b.type&&e.hasClass("hidden"),c?(d.html(d.data("label-hide")+'<span class="dashicons dashicons-no-alt"></span>'),e.imagifyShow()):(d.html(d.data("label-show")+'<span class="dashicons dashicons-menu"></span>'),e.imagifyHide())},maybeLaunchAllProcesses:function(){var b;a(this).attr("disabled")||a('.imagify-bulk-table [name="group[]"]:checked').length&&(c.imagify.bulk.hasBlockingError(!0)||(b=a("#tmpl-imagify-bulk-infos"),b.length?swal({title:imagifyBulk.labels.bulkInfoTitle,html:b.html(),type:"",customClass:"imagify-sweet-alert imagify-swal-has-subtitle imagify-before-bulk-infos",showCancelButton:!0,padding:0,width:554,confirmButtonText:imagifyBulk.labels.confirmBulk,cancelButtonText:imagifySwal.labels.cancelButtonText,reverseButtons:!0}).then(function(){var d=a('.imagify-bulk-table [name="group[]"]:checked').first().closest(".imagify-row-folder-type"),e=d.data("group-id"),f=d.data("context");a.get(ajaxurl+c.imagify.concat+"_wpnonce="+imagifyBulk.ajaxNonce+"&action="+imagifyBulk.ajaxActions.bulkInfoSeen+"&folder_type="+e+"&context="+f),b.remove(),c.imagify.bulk.launchAllProcesses()}).catch(swal.noop):c.imagify.bulk.launchAllProcesses()))},launchAllProcesses:function(){var b=a(c),d=a("#imagify-bulk-action"),e=!0;d.attr("disabled","disabled").find(".dashicons").addClass("rotate"),b.on("beforeunload",this.getConfirmMessage),a(".imagify-row-complete").imagifyHide(200,function(){a(this).removeClass("done")}),a(".imagify-show-table-details").trigger("close.imagify"),this.queue=[],this.status={},this.displayedWaitMessage=!1,this.processIsStopped=!1,this.globalGain=0,this.globalOriginalSize=0,this.globalOptimizedSize=0,a('.imagify-bulk-table [name="group[]"]:checked').each(function(){var b=a(this),d=b.closest(".imagify-row-folder-type"),f=d.data("group-id"),g=d.data("context"),h=d.find('.imagify-cell-level [name="level['+f+']"]:checked').val();if(c.imagify.bulk.queue.push({groupId:f,context:g,level:void 0===h?-1:parseInt(h,10)}),c.imagify.bulk.status[f]={isError:!1,id:"waiting"},e)return e=!1,!0;c.imagify.bulk.displayFolderRow("waiting",d)}),b.trigger("processQueue.imagify")},processQueue:function(){var b,d;if(!c.imagify.bulk.processIsStopped){if(!c.imagify.bulk.queue.length)return void a(c).trigger("queueEmpty.imagify");c.imagify.bulk.displayedWaitMessage||(swal({title:imagifyBulk.labels.waitTitle,html:imagifyBulk.labels.waitText,showConfirmButton:!1,padding:0,imageUrl:imagifyBulk.waitImageUrl,customClass:"imagify-sweet-alert"}).catch(swal.noop),c.imagify.bulk.displayedWaitMessage=!0),d=c.imagify.bulk.queue.shift(),b=a("#cb-select-"+d.groupId).closest(".imagify-row-folder-type"),c.imagify.bulk.status[d.groupId].id="fetching",c.imagify.bulk.displayFolderRow("working",b),a.get(c.imagify.bulk.getAjaxUrl("%GROUP_ID%Fetch",d)).done(function(e){if(!c.imagify.bulk.processIsStopped)if(swal.close(),e.success&&(a.isArray(e.data)||a.isPlainObject(e.data))){if(!a.isEmptyObject(e.data))return void a(c).trigger("optimizeFiles.imagify",[d,e.data]);if(c.imagify.bulk.status[d.groupId].id="no-images",!c.imagify.bulk.processIsStopped){if(c.imagify.bulk.hasMultipleRows&&a("#cb-select-"+d.groupId).prop("checked",!1),!c.imagify.bulk.queue.length)return void a(c).trigger("queueEmpty.imagify");c.imagify.bulk.displayFolderRow("resting",b),a(c).trigger("processQueue.imagify")}}else c.imagify.bulk.stopProcess(e.data.message,d)}).fail(function(){c.imagify.bulk.stopProcess("get-unoptimized-images",d)})}},optimizeFiles:function(b,d,e){var f,g,h=a("#cb-select-"+d.groupId).closest(".imagify-row-folder-type"),i=h.next(".imagify-row-working"),j=i.find(".imagify-cell-images-optimized span"),k=parseInt(j.text(),10),l=i.find(".imagify-cell-errors span"),m=parseInt(l.text(),10),n=h.closest(".imagify-bulk-table"),o=n.find(".imagify-row-progress"),p=o.find(".bar"),q={groupId:d.groupId,id:0,thumbnail:"",filename:"",status:"",icon:"",label:"",thumbnails:"",original_size_human:"",new_size_human:"",chartSuffix:"",percent_human:"",overall_saving_human:""};c.imagify.bulk.processIsStopped||(c.imagify.bulk.status[d.groupId].id="optimizing",n.find(".imagify-bulk-table-details thead").html(a("#tmpl-imagify-file-header-"+d.groupId).html()),g=n.find(".imagify-bulk-table-details tbody").text(""),p.css("width","0%").find(".percent").text("0%"),o.slideDown().attr("aria-hidden","false"),f=new ImagifyGulp({buffer_size:imagifyBulk.bufferSizes[d.context]||1,lib:c.imagify.bulk.getAjaxUrl("%GROUP_ID%Optimize",d),images:e,context:d.context}),f.before(function(b){var e=c.imagify.template("imagify-file-row-"+d.groupId);g.prepend(e(a.extend({},q,{status:"compressing",icon:"admin-generic rotate",label:imagifyBulk.labels.optimizing,chartSuffix:b.image_id},b)))}),f.each(function(b){var e=c.imagify.template("imagify-file-row-"+d.groupId),g=a("#"+d.groupId+"-"+b.image);return p.css("width",b.progress+"%").find(".percent").html(b.progress+"%"),b.success?(g.replaceWith(e(a.extend({},q,{status:"complete",icon:"yes",label:imagifyBulk.labels.complete,chartSuffix:b.image},b))),c.imagify.bulk.drawFileChart(a("#"+d.groupId+"-"+b.image).find(".imagify-cell-percentage canvas")),k+=1,void j.text(k)):"already-optimized"===b.error_code?(g.replaceWith(c.imagify.bulk.displayErrorInRow(e(a.extend({},q,{status:"complete",icon:"yes",label:imagifyBulk.labels.alreadyOptimized,chartSuffix:b.image},b)),b.error)),k+=1,void j.text(k)):(g.replaceWith(c.imagify.bulk.displayErrorInRow(e(a.extend({},q,{status:"error",icon:"dismiss",label:imagifyBulk.labels.error,chartSuffix:b.image},b)),b.error||b)),l.length?(m+=1,l.text(m)):(m=1,l=i.find(".imagify-cell-errors").html(imagifyBulk.labels.imagesErrorText.replace("%s","<span>1</span>")).find("span")),void("over-quota"===b.error_code&&(f.stopProcess(),c.imagify.bulk.stopProcess(b.error_code,d))))}),f.done(function(b){c.imagify.bulk.hasMultipleRows&&a("#cb-select-"+d.groupId).prop("checked",!1),b.global_original_size&&(c.imagify.bulk.globalGain+=parseInt(b.global_gain,10),c.imagify.bulk.globalOriginalSize+=parseInt(b.global_original_size,10),c.imagify.bulk.globalOptimizedSize+=parseInt(b.global_optimized_size,10)),c.imagify.bulk.processIsStopped||(c.imagify.bulk.status[d.groupId].isError||(c.imagify.bulk.status[d.groupId].id="done"),h.addClass("updating"),a.get(c.imagify.bulk.getAjaxUrl("getFolderData",d)).done(function(b){b.success&&a.each(b.data,function(a,b){h.children(".imagify-cell-"+a).html(b)}),c.imagify.bulk.displayFolderRow("resting",h)}).always(function(){h.removeClass("updating"),c.imagify.bulk.queue.length?a(c).trigger("processQueue.imagify"):a(c).trigger("queueEmpty.imagify")}))}),f.run())},queueEmpty:function(){var b=a(".imagify-bulk-table"),d={},e=!1,f=!0;c.imagify.bulk.displayShareBox(),c.imagify.bulk.queue=[],imagifyBulk.heartbeatId||a.get(ajaxurl,{_wpnonce:imagifyBulk.ajaxNonce,action:imagifyBulk.ajaxActions.getStats,types:c.imagify.bulk.getFolderTypes()}).done(function(a){a.success&&c.imagify.bulk.updateStats(a.data)}),a.isEmptyObject(c.imagify.bulk.status)||(a.each(c.imagify.bulk.status,function(a,b){return b.isError?(e=b.id,f=!1,!1):"no-images"!==b.id?(f=!1,!1):void 0}),e?("invalid-api-key"===e?d={title:imagifyBulk.labels.invalidAPIKeyTitle,type:"info"}:"over-quota"===e?d={title:imagifyBulk.labels.overQuotaTitle,html:a("#tmpl-imagify-overquota-alert").html(),type:"info",customClass:"imagify-swal-has-subtitle imagify-swal-error-header",showConfirmButton:!1}:"get-unoptimized-images"!==e&&"consumed-all-data"!==e||(d={title:imagifyBulk.labels.getUnoptimizedImagesErrorTitle,html:imagifyBulk.labels.getUnoptimizedImagesErrorText,type:"info"}),c.imagify.bulk.displayError(d)):f&&c.imagify.bulk.displayError({title:imagifyBulk.labels.noAttachmentToOptimizeTitle,html:imagifyBulk.labels.noAttachmentToOptimizeText,type:"info"})),c.imagify.bulk.status={},a(c).off("beforeunload",c.imagify.bulk.getConfirmMessage),c.imagify.bulk.displayFolderRow("resting",b.find(".imagify-row-folder-type").not(".updating")),b.find(".imagify-row-progress").slideUp().attr("aria-hidden","true").find(".bar").removeAttr("style").find(".percent").text("0%"),a('.imagify-bulk-table [name="group[]"]:checked').length?a("#imagify-bulk-action").removeAttr("disabled").find(".dashicons").removeClass("rotate"):a("#imagify-bulk-action").find(".dashicons").removeClass("rotate")},addHeartbeat:function(a,b){b.imagify_ids=b.imagify_ids||{},b.imagify_ids[imagifyBulk.heartbeatId]=1,b.imagify_types=c.imagify.bulk.getFolderTypes()},processHeartbeat:function(a,b){b.imagify_bulk_data&&c.imagify.bulk.updateStats(b.imagify_bulk_data)},addRequirementsHeartbeat:function(a,b){b.imagify_ids=b.imagify_ids||{},b.imagify_ids[imagifyBulk.reqsHeartbeatId]=1},processRequirementsHeartbeat:function(a,b){b.imagify_bulk_requirements&&(b=b.imagify_bulk_requirements,imagifyBulk.curlMissing=b.curl_missing,imagifyBulk.editorMissing=b.editor_missing,imagifyBulk.extHttpBlocked=b.external_http_blocked,imagifyBulk.apiDown=b.api_down,imagifyBulk.keyIsValid=b.key_is_valid,imagifyBulk.isOverQuota=b.is_over_quota)},share:function(a){var d,e;a.preventDefault(),c.innerWidth?(d=(c.innerWidth-700)/2,e=(c.innerHeight-290)/2):(d=(b.body.clientWidth-700)/2,e=(b.body.clientHeight-290)/2),c.open(this.href,"","status=no, scrollbars=no, menubar=no, top="+e+", left="+d+", width=700, height=290")}},c.imagify.bulk.init()}(jQuery,document,window);
1
+ !function(a,b){var c=a.propHooks.checked;a.propHooks.checked={set:function(b,d,e){var f;return f=void 0===c?b[e]=d:c(b,d,e),a(b).trigger("change.imagify"),f}},a.fn.imagifyHide=function(b,c){return b&&b>0?this.hide(b,function(){a(this).addClass("hidden").css("display",""),void 0!==c&&c()}):(this.addClass("hidden"),void 0!==c&&c()),this.attr("aria-hidden","true")},a.fn.imagifyShow=function(b,c){return void 0!==c&&c(),b&&b>0?this.show(b,function(){a(this).removeClass("hidden").css("display","")}):this.removeClass("hidden"),this.attr("aria-hidden","false")}}(jQuery),function(a,b,c,d){c.imagify.bulk={charts:{overview:{canvas:!1,donut:!1,data:{labels:[imagifyBulk.labels.overviewChartLabels.unoptimized,imagifyBulk.labels.overviewChartLabels.optimized,imagifyBulk.labels.overviewChartLabels.error],datasets:[{data:[],backgroundColor:["#10121A","#46B1CE","#C51162"],borderWidth:0}]}},files:{donuts:{}},share:{canvas:!1,donut:!1}},queue:[],status:{},displayedWaitMessage:!1,hasMultipleRows:!0,processIsStopped:!1,globalGain:0,globalOriginalSize:0,globalOptimizedSize:0,folderTypes:[],init:function(){this.drawOverviewChart(),this.hasMultipleRows=a('.imagify-bulk-table [name="group[]"]').length>1,a(".imagify-level-selector-button").on("click.imagify",this.openLevelSelectorFromButton),a(".imagify-level-selector-list input").on("change.imagify init.imagify",this.syncLevelSelectorFromRadio).filter(":checked").trigger("init.imagify"),a(b).on("keypress.imagify click.imagify",this.closeLevelSelectors),a('.imagify-bulk-table [name="group[]"]').on("change.imagify init.imagify",this.toggleOptimizationButton).trigger("init.imagify"),a(".imagify-show-table-details").on("click.imagify open.imagify close.imagify",this.toggleOptimizationDetails),a("#imagify-bulk-action").on("click.imagify",this.maybeLaunchAllProcesses),a(".imagify-share-networks a").on("click.imagify",this.share),a(c).on("processQueue.imagify",this.processQueue).on("optimizeFiles.imagify",this.optimizeFiles).on("queueEmpty.imagify",this.queueEmpty),imagifyBulk.ajaxActions.getStats&&a('.imagify-bulk-table [data-group-id="library"][data-context="wp"]').length&&(imagifyBulk.heartbeatId=!1),imagifyBulk.heartbeatId&&a(b).on("heartbeat-send",this.addHeartbeat).on("heartbeat-tick",this.processHeartbeat),a(b).on("heartbeat-send",this.addRequirementsHeartbeat).on("heartbeat-tick",this.processRequirementsHeartbeat)},drawOverviewChart:function(d){var e,f;if(this.charts.overview.canvas||(this.charts.overview.canvas=b.getElementById("imagify-overview-chart"),this.charts.overview.canvas)){if(d=d&&a.isArray(d)?d:[],this.charts.overview.donut)return void(d.length&&(0===d.reduce(function(a,b){return a+b},0)&&(d[0]=1),this.charts.overview.donut.data.datasets[0].data=d,this.charts.overview.donut.update()));this.charts.overview.data.datasets[0].data=[parseInt(this.charts.overview.canvas.getAttribute("data-unoptimized"),10),parseInt(this.charts.overview.canvas.getAttribute("data-optimized"),10),parseInt(this.charts.overview.canvas.getAttribute("data-errors"),10)],e=a.extend({},this.charts.overview.data),d.length&&(e.datasets[0].data=d),0===e.datasets[0].data.reduce(function(a,b){return a+b},0)&&(e.datasets[0].data[0]=1),this.charts.overview.donut=new c.imagify.Chart(this.charts.overview.canvas,{type:"doughnut",data:e,options:{legend:{display:!1},events:[],animation:{easing:"easeOutBounce"},tooltips:{displayColors:!1,callbacks:{label:function(a,b){return b.datasets[a.datasetIndex].data[a.index]}}},responsive:!1,cutoutPercentage:85}}),f='<ul class="imagify-doughnut-legend">',a.each(e.labels,function(a,b){f+='<li><span style="background-color:'+e.datasets[0].backgroundColor[a]+'"></span>'+b+"</li>"}),f+="</ul>",b.getElementById("imagify-overview-chart-legend").innerHTML=f}},drawFileChart:function(b){var d=this.charts.files.donuts;b.each(function(){var b=parseInt(a(this).closest(".imagify-chart").next(".imagipercent").text().replace("%",""),10);if(void 0!==d[this.id])return d[this.id].data.datasets[0].data[0]=b,d[this.id].data.datasets[0].data[1]=100-b,void d[this.id].update();d[this.id]=new c.imagify.Chart(this,{type:"doughnut",data:{datasets:[{data:[b,100-b],backgroundColor:["#00B3D3","#D8D8D8"],borderColor:"#fff",borderWidth:1}]},options:{legend:{display:!1},events:[],animation:{easing:"easeOutBounce"},tooltips:{enabled:!1},responsive:!1}})}),this.charts.files.donuts=d},drawShareChart:function(){var d;if(this.charts.share.canvas||(this.charts.share.canvas=b.getElementById("imagify-ac-chart"),this.charts.share.canvas)){if(d=parseInt(a(this.charts.share.canvas).closest(".imagify-ac-chart").attr("data-percent"),10),this.charts.share.donut)return this.charts.share.donut.data.datasets[0].data[0]=d,this.charts.share.donut.data.datasets[0].data[1]=100-d,void this.charts.share.donut.update();this.charts.share.donut=new c.imagify.Chart(this.charts.share.canvas,{type:"doughnut",data:{datasets:[{data:[d,100-d],backgroundColor:["#40B1D0","#FFFFFF"],borderWidth:0}]},options:{legend:{display:!1},events:[],animation:{easing:"easeOutBounce"},tooltips:{enabled:!1},responsive:!1,cutoutPercentage:70}})}},getAjaxUrl:function(a,b){var d=b.groupId.replace(/[\s_-](\S)/g,function(a,b){return b.toUpperCase()});return a=a.replace("%GROUP_ID%",d),a=imagifyBulk.ajaxActions[a],ajaxurl+c.imagify.concat+"_wpnonce="+imagifyBulk.ajaxNonce+"&optimization_level="+b.level+"&action="+a+"&folder_type="+b.groupId},getFolderTypes:function(){return c.imagify.bulk.folderTypes.length||a(".imagify-row-folder-type").each(function(){var b=a(this),d=b.data("group-id");"library"===d&&(d+="|"+b.data("context")),c.imagify.bulk.folderTypes.push(d)}),c.imagify.bulk.folderTypes},getConfirmMessage:function(){return imagifyBulk.labels.processing},closeLevelSelector:function(a,b){if(a&&a.length)return void 0!==b&&b>0?void c.setTimeout(function(){c.imagify.bulk.closeLevelSelector(a)},b):void a.attr("aria-hidden","true")},stopProcess:function(b,d){this.processIsStopped=!0,c.imagify.bulk.status[d.groupId]={isError:!0,id:b},a(c).trigger("queueEmpty.imagify")},hasBlockingError:function(b){return b=void 0!==b&&b,imagifyBulk.curlMissing?(b&&c.imagify.bulk.displayError({html:imagifyBulk.labels.curlMissing}),!0):imagifyBulk.editorMissing?(b&&c.imagify.bulk.displayError({html:imagifyBulk.labels.editorMissing}),!0):imagifyBulk.extHttpBlocked?(b&&c.imagify.bulk.displayError({html:imagifyBulk.labels.extHttpBlocked}),!0):imagifyBulk.apiDown?(b&&c.imagify.bulk.displayError({html:imagifyBulk.labels.apiDown}),!0):imagifyBulk.keyIsValid?!!imagifyBulk.isOverQuota&&(b&&c.imagify.bulk.displayError({title:imagifyBulk.labels.overQuotaTitle,html:a("#tmpl-imagify-overquota-alert").html(),type:"info",customClass:"imagify-swal-has-subtitle imagify-swal-error-header",showConfirmButton:!1}),!0):(b&&c.imagify.bulk.displayError({title:imagifyBulk.labels.invalidAPIKeyTitle,type:"info"}),!0)},displayError:function(b,c,d){var e={title:"",html:"",type:"error",customClass:"",width:620,padding:0,showCloseButton:!0,showConfirmButton:!0};a.isPlainObject(b)?d=a.extend({},e,b):(d=d||{},d=a.extend({},e,{title:b||"",html:c||""},d)),d.title=d.title||imagifyBulk.labels.error,d.customClass+=" imagify-sweet-alert",swal(d).catch(swal.noop)},displayErrorInRow:function(b,c){var d,e;return b=a(b()),d=b.find(".imagify-cell-status ~ td"),e=d.length,c=c||"",d.remove(),b.find(".imagify-cell-status").after('<td colspan="'+e+'">'+c+"</td>"),b},displayFolderRow:function(a,b){var d,e,f,g;return"resting"===a?(b.next(".imagify-row-waiting, .imagify-row-working").remove(),void b.imagifyShow()):(d=b.next(".imagify-row-waiting, .imagify-row-working"),"waiting"===a?(f="#d2d3d6",g=imagifyBulk.labels.waitingOtimizationsText):(f="#40b1d0",g=imagifyBulk.labels.imagesOptimizedText.replace("%s","<span>0</span>")),d.length?(d.hasClass("imagify-row-"+a)||(d.attr("class","imagify-row-"+a),d.find(".imagify-cell-checkbox svg").attr("fill",f),d.children(".imagify-cell-images-optimized").html(g)),b.imagifyHide(),void d.imagifyShow()):(d=b.clone().attr({class:"imagify-row-"+a,"aria-hidden":"false"}),e=c.imagify.template("imagify-spinner"),d.children(".imagify-cell-checkbox").html(e()).find("svg").attr("fill",f),d.children(".imagify-cell-title").html('<span class="imagify-cell-label">'+d.children(".imagify-cell-title").text()+"</span>"),d.children(".imagify-cell-images-optimized").html(g),d.children(".imagify-cell-errors, .imagify-cell-optimized, .imagify-cell-original, .imagify-cell-level").text(""),void b.imagifyHide().after(d)))},displayShareBox:function(){var b,d,e,f,g=imagifyBulk.labels.textToShare;if(!this.globalGain||this.queue.length)return this.globalGain=0,this.globalOriginalSize=0,void(this.globalOptimizedSize=0);b=(100-this.globalOptimizedSize/this.globalOriginalSize*100).toFixed(2),d=c.imagify.humanSize(this.globalGain,1),e=c.imagify.humanSize(this.globalOriginalSize,1),g=g.replace("%1$s",d),g=g.replace("%2$s",e),g=encodeURIComponent(g),f=a(".imagify-row-complete"),f.find(".imagify-ac-rt-total-gain").html(d),f.find(".imagify-ac-rt-total-original").html(e),f.find(".imagify-ac-chart").attr("data-percent",b),f.find(".imagify-sn-twitter").attr("href",imagifyBulk.labels.twitterShareURL+"&amp;text="+g),this.drawShareChart(),f.addClass("done").imagifyShow(),a("html, body").animate({scrollTop:f.offset().top},200),this.globalGain=0,this.globalOriginalSize=0,this.globalOptimizedSize=0},updateStats:function(b){var d;b&&a.isPlainObject(b)&&(c.imagify.bulk.charts.overview.donut.data&&(d=c.imagify.bulk.charts.overview.donut.data.datasets[0].data,b.unoptimized_attachments===d[0]&&b.optimized_attachments===d[1]&&b.errors_attachments===d[2])||(b.unconsumed_quota=b.unconsumed_quota.toFixed(1),a(".imagify-meteo-icon").html(b.quota_icon),a(".imagify-unconsumed-percent").html(b.unconsumed_quota+"%"),a(".imagify-unconsumed-bar").css("width",b.unconsumed_quota+"%").parent().attr("class",b.quota_class),a("#imagify-overview-chart-percent").html(b.optimized_attachments_percent+"<span>%</span>"),a(".imagify-total-percent").html(b.optimized_attachments_percent+"%"),c.imagify.bulk.drawOverviewChart([b.unoptimized_attachments,b.optimized_attachments,b.errors_attachments]),a("#imagify-total-optimized-attachments").html(b.already_optimized_attachments),a("#imagify-original-bar").find(".imagify-barnb").html(b.original_human),a("#imagify-optimized-bar").css("width",100-b.optimized_percent+"%").find(".imagify-barnb").html(b.optimized_human),a("#imagify-total-optimized-attachments-pct").html(b.optimized_percent+"%")))},openLevelSelectorFromButton:function(b){var c=a("#"+a(this).attr("aria-controls"));b.stopPropagation(),a(".imagify-level-selector-list").not(c).attr("aria-hidden","true"),c.attr("aria-hidden","false").find(":checked").trigger("focus.imagify")},syncLevelSelectorFromRadio:function(){var b=a(this).closest(".imagify-level-choice");b.addClass("imagify-current-level").attr("aria-current","true").siblings(".imagify-level-choice").removeClass("imagify-current-level").attr("aria-current","false"),b.closest(".imagify-level-selector").find(".imagify-current-level-info").html(b.find("label").html())},closeLevelSelectors:function(b){"keypress"===b.type&&27!==b.keyCode&&13!==b.keyCode||c.imagify.bulk.closeLevelSelector(a('.imagify-level-selector-list[aria-hidden="false"]'))},toggleOptimizationButton:function(){if(!c.imagify.bulk.hasMultipleRows&&!this.checked)return void a(this).prop("checked",!0);a('.imagify-bulk-table [name="group[]"]:checked').length?a("#imagify-bulk-action").removeAttr("disabled"):a("#imagify-bulk-action").attr("disabled","disabled")},toggleOptimizationDetails:function(b){var c,d=a(this),e=d.closest(".imagify-bulk-table").find(".imagify-bulk-table-details");c="open"===b.type||"close"!==b.type&&e.hasClass("hidden"),c?(d.html(d.data("label-hide")+'<span class="dashicons dashicons-no-alt"></span>'),e.imagifyShow()):(d.html(d.data("label-show")+'<span class="dashicons dashicons-menu"></span>'),e.imagifyHide())},maybeLaunchAllProcesses:function(){var b;a(this).attr("disabled")||a('.imagify-bulk-table [name="group[]"]:checked').length&&(c.imagify.bulk.hasBlockingError(!0)||(b=a("#tmpl-imagify-bulk-infos"),b.length?swal({title:imagifyBulk.labels.bulkInfoTitle,html:b.html(),type:"",customClass:"imagify-sweet-alert imagify-swal-has-subtitle imagify-before-bulk-infos",showCancelButton:!0,padding:0,width:554,confirmButtonText:imagifyBulk.labels.confirmBulk,cancelButtonText:imagifySwal.labels.cancelButtonText,reverseButtons:!0}).then(function(){var d=a('.imagify-bulk-table [name="group[]"]:checked').first().closest(".imagify-row-folder-type"),e=d.data("group-id"),f=d.data("context");a.get(ajaxurl+c.imagify.concat+"_wpnonce="+imagifyBulk.ajaxNonce+"&action="+imagifyBulk.ajaxActions.bulkInfoSeen+"&folder_type="+e+"&context="+f),b.remove(),c.imagify.bulk.launchAllProcesses()}).catch(swal.noop):c.imagify.bulk.launchAllProcesses()))},launchAllProcesses:function(){var b=a(c),d=a("#imagify-bulk-action"),e=!0;d.attr("disabled","disabled").find(".dashicons").addClass("rotate"),b.on("beforeunload",this.getConfirmMessage),a(".imagify-row-complete").imagifyHide(200,function(){a(this).removeClass("done")}),a(".imagify-show-table-details").trigger("close.imagify"),this.queue=[],this.status={},this.displayedWaitMessage=!1,this.processIsStopped=!1,this.globalGain=0,this.globalOriginalSize=0,this.globalOptimizedSize=0,a('.imagify-bulk-table [name="group[]"]:checked').each(function(){var b=a(this),d=b.closest(".imagify-row-folder-type"),f=d.data("group-id"),g=d.data("context"),h=d.find('.imagify-cell-level [name="level['+f+']"]:checked').val();if(c.imagify.bulk.queue.push({groupId:f,context:g,level:void 0===h?-1:parseInt(h,10)}),c.imagify.bulk.status[f]={isError:!1,id:"waiting"},e)return e=!1,!0;c.imagify.bulk.displayFolderRow("waiting",d)}),b.trigger("processQueue.imagify")},processQueue:function(){var b,d;if(!c.imagify.bulk.processIsStopped){if(!c.imagify.bulk.queue.length)return void a(c).trigger("queueEmpty.imagify");c.imagify.bulk.displayedWaitMessage||(swal({title:imagifyBulk.labels.waitTitle,html:imagifyBulk.labels.waitText,showConfirmButton:!1,padding:0,imageUrl:imagifyBulk.waitImageUrl,customClass:"imagify-sweet-alert"}).catch(swal.noop),c.imagify.bulk.displayedWaitMessage=!0),d=c.imagify.bulk.queue.shift(),b=a("#cb-select-"+d.groupId).closest(".imagify-row-folder-type"),c.imagify.bulk.status[d.groupId].id="fetching",c.imagify.bulk.displayFolderRow("working",b),a.get(c.imagify.bulk.getAjaxUrl("%GROUP_ID%Fetch",d)).done(function(e){if(!c.imagify.bulk.processIsStopped)if(swal.close(),e.success&&(a.isArray(e.data)||a.isPlainObject(e.data))){if(!a.isEmptyObject(e.data))return void a(c).trigger("optimizeFiles.imagify",[d,e.data]);if(c.imagify.bulk.status[d.groupId].id="no-images",!c.imagify.bulk.processIsStopped){if(c.imagify.bulk.hasMultipleRows&&a("#cb-select-"+d.groupId).prop("checked",!1),!c.imagify.bulk.queue.length)return void a(c).trigger("queueEmpty.imagify");c.imagify.bulk.displayFolderRow("resting",b),a(c).trigger("processQueue.imagify")}}else c.imagify.bulk.stopProcess(e.data.message,d)}).fail(function(){c.imagify.bulk.stopProcess("get-unoptimized-images",d)})}},optimizeFiles:function(b,d,e){var f,g,h=a("#cb-select-"+d.groupId).closest(".imagify-row-folder-type"),i=h.next(".imagify-row-working"),j=i.find(".imagify-cell-images-optimized span"),k=parseInt(j.text(),10),l=i.find(".imagify-cell-errors span"),m=parseInt(l.text(),10),n=h.closest(".imagify-bulk-table"),o=n.find(".imagify-row-progress"),p=o.find(".bar"),q={groupId:d.groupId,id:0,thumbnail:"",filename:"",status:"",icon:"",label:"",thumbnails:"",original_size_human:"",new_size_human:"",chartSuffix:"",percent_human:"",overall_saving_human:""};c.imagify.bulk.processIsStopped||(c.imagify.bulk.status[d.groupId].id="optimizing",n.find(".imagify-bulk-table-details thead").html(a("#tmpl-imagify-file-header-"+d.groupId).html()),g=n.find(".imagify-bulk-table-details tbody").text(""),p.css("width","0%").find(".percent").text("0%"),o.slideDown().attr("aria-hidden","false"),f=new ImagifyGulp({buffer_size:imagifyBulk.bufferSizes[d.context]||1,lib:c.imagify.bulk.getAjaxUrl("%GROUP_ID%Optimize",d),images:e,context:d.context}),f.before(function(b){var e=c.imagify.template("imagify-file-row-"+d.groupId);g.prepend(e(a.extend({},q,{status:"compressing",icon:"admin-generic rotate",label:imagifyBulk.labels.optimizing,chartSuffix:b.image_id},b)))}),f.each(function(b){var e=c.imagify.template("imagify-file-row-"+d.groupId),g=a("#"+d.groupId+"-"+b.image);return p.css("width",b.progress+"%").find(".percent").html(b.progress+"%"),b.success?(g.replaceWith(e(a.extend({},q,{status:"complete",icon:"yes",label:imagifyBulk.labels.complete,chartSuffix:b.image},b))),c.imagify.bulk.drawFileChart(a("#"+d.groupId+"-"+b.image).find(".imagify-cell-percentage canvas")),k+=1,void j.text(k)):"already-optimized"===b.error_code?(g.replaceWith(c.imagify.bulk.displayErrorInRow(e(a.extend({},q,{status:"complete",icon:"yes",label:imagifyBulk.labels.alreadyOptimized,chartSuffix:b.image},b)),b.error)),k+=1,void j.text(k)):(g.replaceWith(c.imagify.bulk.displayErrorInRow(e(a.extend({},q,{status:"error",icon:"dismiss",label:imagifyBulk.labels.error,chartSuffix:b.image},b)),b.error||b)),l.length?(m+=1,l.text(m)):(m=1,l=i.find(".imagify-cell-errors").html(imagifyBulk.labels.imagesErrorText.replace("%s","<span>1</span>")).find("span")),void("over-quota"===b.error_code&&(f.stopProcess(),c.imagify.bulk.stopProcess(b.error_code,d))))}),f.done(function(b){c.imagify.bulk.hasMultipleRows&&a("#cb-select-"+d.groupId).prop("checked",!1),b.global_original_size&&(c.imagify.bulk.globalGain+=parseInt(b.global_gain,10),c.imagify.bulk.globalOriginalSize+=parseInt(b.global_original_size,10),c.imagify.bulk.globalOptimizedSize+=parseInt(b.global_optimized_size,10)),c.imagify.bulk.processIsStopped||(c.imagify.bulk.status[d.groupId].isError||(c.imagify.bulk.status[d.groupId].id="done"),h.addClass("updating"),a.get(c.imagify.bulk.getAjaxUrl("getFolderData",d)).done(function(b){b.success&&a.each(b.data,function(a,b){h.children(".imagify-cell-"+a).html(b)}),c.imagify.bulk.displayFolderRow("resting",h)}).always(function(){h.removeClass("updating"),c.imagify.bulk.queue.length?a(c).trigger("processQueue.imagify"):a(c).trigger("queueEmpty.imagify")}))}),f.run())},queueEmpty:function(){var b=a(".imagify-bulk-table"),d={},e=!1,f=!0;c.imagify.bulk.displayShareBox(),c.imagify.bulk.queue=[],imagifyBulk.heartbeatId||a.get(ajaxurl,{_wpnonce:imagifyBulk.ajaxNonce,action:imagifyBulk.ajaxActions.getStats,types:c.imagify.bulk.getFolderTypes()}).done(function(a){a.success&&c.imagify.bulk.updateStats(a.data)}),a.isEmptyObject(c.imagify.bulk.status)||(a.each(c.imagify.bulk.status,function(a,b){return b.isError?(e=b.id,f=!1,!1):"no-images"!==b.id?(f=!1,!1):void 0}),e?("invalid-api-key"===e?d={title:imagifyBulk.labels.invalidAPIKeyTitle,type:"info"}:"over-quota"===e?d={title:imagifyBulk.labels.overQuotaTitle,html:a("#tmpl-imagify-overquota-alert").html(),type:"info",customClass:"imagify-swal-has-subtitle imagify-swal-error-header",showConfirmButton:!1}:"get-unoptimized-images"!==e&&"consumed-all-data"!==e||(d={title:imagifyBulk.labels.getUnoptimizedImagesErrorTitle,html:imagifyBulk.labels.getUnoptimizedImagesErrorText,type:"info"}),c.imagify.bulk.displayError(d)):f&&c.imagify.bulk.displayError({title:imagifyBulk.labels.noAttachmentToOptimizeTitle,html:imagifyBulk.labels.noAttachmentToOptimizeText,type:"info"})),c.imagify.bulk.status={},a(c).off("beforeunload",c.imagify.bulk.getConfirmMessage),c.imagify.bulk.displayFolderRow("resting",b.find(".imagify-row-folder-type").not(".updating")),b.find(".imagify-row-progress").slideUp().attr("aria-hidden","true").find(".bar").removeAttr("style").find(".percent").text("0%"),a('.imagify-bulk-table [name="group[]"]:checked').length?a("#imagify-bulk-action").removeAttr("disabled").find(".dashicons").removeClass("rotate"):a("#imagify-bulk-action").find(".dashicons").removeClass("rotate")},addHeartbeat:function(a,b){b.imagify_ids=b.imagify_ids||{},b.imagify_ids[imagifyBulk.heartbeatId]=1,b.imagify_types=c.imagify.bulk.getFolderTypes()},processHeartbeat:function(a,b){b.imagify_bulk_data&&c.imagify.bulk.updateStats(b.imagify_bulk_data)},addRequirementsHeartbeat:function(a,b){b.imagify_ids=b.imagify_ids||{},b.imagify_ids[imagifyBulk.reqsHeartbeatId]=1},processRequirementsHeartbeat:function(a,b){b.imagify_bulk_requirements&&(b=b.imagify_bulk_requirements,imagifyBulk.curlMissing=b.curl_missing,imagifyBulk.editorMissing=b.editor_missing,imagifyBulk.extHttpBlocked=b.external_http_blocked,imagifyBulk.apiDown=b.api_down,imagifyBulk.keyIsValid=b.key_is_valid,imagifyBulk.isOverQuota=b.is_over_quota)},share:function(a){var d,e;a.preventDefault(),c.innerWidth?(d=(c.innerWidth-700)/2,e=(c.innerHeight-290)/2):(d=(b.body.clientWidth-700)/2,e=(b.body.clientHeight-290)/2),c.open(this.href,"","status=no, scrollbars=no, menubar=no, top="+e+", left="+d+", width=700, height=290")}},c.imagify.bulk.init()}(jQuery,document,window);
assets/js/chart.js CHANGED
File without changes
assets/js/chart.min.js CHANGED
File without changes
assets/js/files-list.js CHANGED
File without changes
assets/js/files-list.min.js CHANGED
File without changes
assets/js/formdata-polyfill.js CHANGED
File without changes
assets/js/formdata-polyfill.min.js CHANGED
File without changes
assets/js/imagify-gulp.js CHANGED
File without changes
assets/js/imagify-gulp.min.js CHANGED
File without changes
assets/js/imagify-wp-retina-2x.js CHANGED
File without changes
assets/js/imagify-wp-retina-2x.min.js CHANGED
File without changes
assets/js/options.js CHANGED
@@ -259,47 +259,44 @@
259
  selected.push( this.value );
260
  } );
261
 
262
- $.post( {
263
- url: imagifyOptions.getFilesTree,
264
- dataType: 'json',
265
- data: {
266
- folder: '/',
267
- selected: selected
268
- }
269
- } ).done( function( response ) {
270
- if ( ! response.success ) {
271
- swal( {
272
- title: imagifyOptions.labels.error,
273
- html: response.data || '',
274
- type: 'error',
275
- padding: 0,
276
- customClass: 'imagify-sweet-alert'
277
- } );
278
- return;
279
- }
280
-
281
- swal( {
282
- title: imagifyOptions.labels.filesTreeTitle,
283
- html: '<div class="imagify-swal-subtitle">' + imagifyOptions.labels.filesTreeSubTitle + '</div><div class="imagify-swal-content"><p class="imagify-folders-information"><i class="dashicons dashicons-info" aria-hidden="true"></i>' + imagifyOptions.labels.cleaningInfo + '</p><ul id="imagify-folders-tree" class="imagify-folders-tree">' + response.data + '</ul></div>',
284
- type: '',
285
- customClass: 'imagify-sweet-alert imagify-swal-has-subtitle imagify-folders-selection',
286
- showCancelButton: true,
287
- padding: 0,
288
- confirmButtonText: imagifyOptions.labels.confirmFilesTreeBtn,
289
- cancelButtonText: imagifySwal.labels.cancelButtonText,
290
- reverseButtons: true
291
- } ).then( function() {
292
- var values = $( '#imagify-folders-tree input' ).serializeArray(); // Don't do `$( '#imagify-folders-tree' ).find( 'input' )`, it won't work.
293
-
294
- if ( ! values.length ) {
295
  return;
296
  }
297
 
298
- $.each( values, function( i, v ) {
299
- imagifyInsertFolderRow( v.value );
300
- } );
301
- } ).catch( swal.noop );
302
- } )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  .fail( function() {
304
  swal( {
305
  title: imagifyOptions.labels.error,
@@ -341,14 +338,10 @@
341
  selected.push( this.value );
342
  } );
343
 
344
- $.post( {
345
- url: imagifyOptions.getFilesTree,
346
- dataType: 'json',
347
- data: {
348
- folder: $button.data( 'folder' ),
349
- selected: selected
350
- }
351
- } )
352
  .done( function( response ) {
353
  if ( ! response.success ) {
354
  swal( {
259
  selected.push( this.value );
260
  } );
261
 
262
+ $.post( imagifyOptions.getFilesTree, {
263
+ folder: '/',
264
+ selected: selected
265
+ }, null, 'json' )
266
+ .done( function( response ) {
267
+ if ( ! response.success ) {
268
+ swal( {
269
+ title: imagifyOptions.labels.error,
270
+ html: response.data || '',
271
+ type: 'error',
272
+ padding: 0,
273
+ customClass: 'imagify-sweet-alert'
274
+ } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
275
  return;
276
  }
277
 
278
+ swal( {
279
+ title: imagifyOptions.labels.filesTreeTitle,
280
+ html: '<div class="imagify-swal-subtitle">' + imagifyOptions.labels.filesTreeSubTitle + '</div><div class="imagify-swal-content"><p class="imagify-folders-information"><i class="dashicons dashicons-info" aria-hidden="true"></i>' + imagifyOptions.labels.cleaningInfo + '</p><ul id="imagify-folders-tree" class="imagify-folders-tree">' + response.data + '</ul></div>',
281
+ type: '',
282
+ customClass: 'imagify-sweet-alert imagify-swal-has-subtitle imagify-folders-selection',
283
+ showCancelButton: true,
284
+ padding: 0,
285
+ confirmButtonText: imagifyOptions.labels.confirmFilesTreeBtn,
286
+ cancelButtonText: imagifySwal.labels.cancelButtonText,
287
+ reverseButtons: true
288
+ } ).then( function() {
289
+ var values = $( '#imagify-folders-tree input' ).serializeArray(); // Don't do `$( '#imagify-folders-tree' ).find( 'input' )`, it won't work.
290
+
291
+ if ( ! values.length ) {
292
+ return;
293
+ }
294
+
295
+ $.each( values, function( i, v ) {
296
+ imagifyInsertFolderRow( v.value );
297
+ } );
298
+ } ).catch( swal.noop );
299
+ } )
300
  .fail( function() {
301
  swal( {
302
  title: imagifyOptions.labels.error,
338
  selected.push( this.value );
339
  } );
340
 
341
+ $.post( imagifyOptions.getFilesTree, {
342
+ folder: $button.data( 'folder' ),
343
+ selected: selected
344
+ }, null, 'json' )
 
 
 
 
345
  .done( function( response ) {
346
  if ( ! response.success ) {
347
  swal( {
assets/js/options.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,b,c,d){var e=!1,f=!1;a("#imagify-settings #api_key").on("blur",function(){var b=a(this),d=b.val();return""!==a.trim(d)&&(a("#check_api_key").val()===d?(a("#imagify-check-api-container").html('<span class="dashicons dashicons-yes"></span> '+imagifyOptions.labels.ValidApiKeyText),!1):(!0===e?f.abort():(a("#imagify-check-api-container").remove(),b.after('<span id="imagify-check-api-container"><span class="imagify-spinner"></span>'+imagifyOptions.labels.waitApiKeyCheckText+"</span>")),e=!0,void(f=a.get(ajaxurl+c.imagify.concat+"action=imagify_check_api_key_validity&api_key="+b.val()+"&imagifycheckapikeynonce="+a("#imagifycheckapikeynonce").val()).done(function(b){b.success?(a("#imagify-check-api-container").remove(),swal({title:imagifyOptions.labels.ApiKeyCheckSuccessTitle,html:imagifyOptions.labels.ApiKeyCheckSuccessText,type:"success",padding:0,customClass:"imagify-sweet-alert"}).then(function(){location.reload()})):a("#imagify-check-api-container").html('<span class="dashicons dashicons-no"></span> '+b.data),e=!1}))))}),a(".imagify-options-line").css("cursor","pointer").on("click",function(b){if("INPUT"!==b.target.nodeName)return a('input[aria-describedby="'+a(this).attr("id")+'"]').trigger("click"),!1}),a(".imagify-settings th span").on("click",function(){var b=a(this).parent().next("td").find("input:checkbox");1===b.length&&b.trigger("click")}),a(".imagify-options-line").find("input").on("change focus",function(){var b=a(this).closest(".imagify-options-line").prev("label").prev("input");b[0].checked||b.prop("checked",!0)}),a(".imagify-settings-section").find("#imagify_backup").on("change",function(){var b=a(this),c=b.siblings("#backup-dir-is-writable"),d={action:"imagify_check_backup_dir_is_writable",_wpnonce:c.data("nonce")};if(b.is(":checked"))return void a.getJSON(ajaxurl,d).done(function(b){a.isPlainObject(b)&&b.success&&(b.data.is_writable?c.addClass("hidden"):c.removeClass("hidden"))});swal({title:imagifyOptions.labels.noBackupTitle,html:imagifyOptions.labels.noBackupText,type:"warning",customClass:"imagify-sweet-alert",padding:0,showCancelButton:!0,cancelButtonText:imagifySwal.labels.cancelButtonText,reverseButtons:!0}).then(function(){c.addClass("hidden")},function(){b.prop("checked",!0)})})}(jQuery,document,window),function(a,b,c,d){a.imagifyUser&&c.getJSON(ajaxurl,a.imagifyUser).done(function(a){c.isPlainObject(a)&&a.success&&(a.data.id=null,a.data.plan_id=null,a.data.is=[],c.each(a.data,function(b,d){var e=".imagify-user-"+b.replace(/_/g,"-");0===b.indexOf("is_")?d&&a.data.is.push(e):"is"!==b&&c(e).text(d)}),a.data.is.push("best-plan"),c(a.data.is.join(",")).removeClass("hidden"))})}(window,document,jQuery),function(a,b,c,d){function e(b){var d,e,f,g,h,i=!1,j=null;b&&(f=c("#imagify-custom-folders-selected"),g=f.find(".imagify-custom-folder-line"),h=g.find('[value="'+b+'"]'),h.length||(b=b.split("#///#"),d=b[1].replace(/\/+$/,"").toLowerCase(),e=a.imagify.template("imagify-custom-folder"),g.each(function(){var a=c(this),h=a.data("path").replace(/\/+$/,"").toLowerCase();return""!==h&&0===d.indexOf(h)?(i=!0,!1):d<h?(a.before(e({value:b[0],label:b[1]})),g=f.find(".imagify-custom-folder-line"),i=!0,!1):void 0}),i||(f.append(e({value:b[0],label:b[1]})),g=f.find(".imagify-custom-folder-line")),""!==d&&g.each(function(){var a=c(this),b=a.data("path").toLowerCase();null!==j&&0===b.indexOf(j)?a.find(".imagify-custom-folders-remove").trigger("click.imagify"):j=b}),f.next(".hidden").removeClass("hidden")))}imagifyOptions.getFilesTree&&(c("#imagify-add-custom-folder").on("click.imagify",function(){var a,b=c(this),d=[];b.attr("disabled")||(b.attr("disabled","disabled").next("img").attr("aria-hidden","false"),a=c("#imagify-custom-folders-selected"),a.find("input").each(function(){d.push(this.value)}),c.post({url:imagifyOptions.getFilesTree,dataType:"json",data:{folder:"/",selected:d}}).done(function(a){if(!a.success)return void swal({title:imagifyOptions.labels.error,html:a.data||"",type:"error",padding:0,customClass:"imagify-sweet-alert"});swal({title:imagifyOptions.labels.filesTreeTitle,html:'<div class="imagify-swal-subtitle">'+imagifyOptions.labels.filesTreeSubTitle+'</div><div class="imagify-swal-content"><p class="imagify-folders-information"><i class="dashicons dashicons-info" aria-hidden="true"></i>'+imagifyOptions.labels.cleaningInfo+'</p><ul id="imagify-folders-tree" class="imagify-folders-tree">'+a.data+"</ul></div>",type:"",customClass:"imagify-sweet-alert imagify-swal-has-subtitle imagify-folders-selection",showCancelButton:!0,padding:0,confirmButtonText:imagifyOptions.labels.confirmFilesTreeBtn,cancelButtonText:imagifySwal.labels.cancelButtonText,reverseButtons:!0}).then(function(){var a=c("#imagify-folders-tree input").serializeArray();a.length&&c.each(a,function(a,b){e(b.value)})}).catch(swal.noop)}).fail(function(){swal({title:imagifyOptions.labels.error,type:"error",customClass:"imagify-sweet-alert",padding:0})}).always(function(){b.removeAttr("disabled").next("img").attr("aria-hidden","true")}))}),c(b).on("click.imagify","#imagify-folders-tree [data-folder]",function(){var a=c(this),b=a.nextAll(".imagify-folders-sub-tree"),d=[];if(!a.attr("disabled")&&!a.siblings(":checkbox").is(":checked")){if(a.attr("disabled","disabled"),b.length)return a.hasClass("imagify-is-open")?(b.addClass("hidden"),a.removeClass(" imagify-is-open")):(b.removeClass("hidden"),a.addClass(" imagify-is-open")),void a.removeAttr("disabled");c("#imagify-custom-folders-selected").find("input").each(function(){d.push(this.value)}),c.post({url:imagifyOptions.getFilesTree,dataType:"json",data:{folder:a.data("folder"),selected:d}}).done(function(b){if(!b.success)return void swal({title:imagifyOptions.labels.error,html:b.data||"",type:"error",padding:0,customClass:"imagify-sweet-alert"});a.addClass("imagify-is-open").parent().append('<ul class="imagify-folders-sub-tree">'+b.data+"</ul>")}).fail(function(){swal({title:imagifyOptions.labels.error,type:"error",padding:0,customClass:"imagify-sweet-alert"})}).always(function(){a.removeAttr("disabled")})}}),c("#imagify-custom-folders").on("click.imagify",".imagify-custom-folders-remove",function(){var b=c(this).closest(".imagify-custom-folder-line").addClass("imagify-will-remove");a.setTimeout(function(){b.remove(),c("#imagify-custom-folders-selected").siblings(".imagify-success.hidden").removeClass("hidden")},750)}),c("#imagify-add-themes-to-custom-folder").on("click.imagify",function(){var a=c(this);e(a.data("theme")),e(a.data("theme-parent")),a.replaceWith("<p>"+imagifyOptions.labels.themesAdded+"</p>")}))}(window,document,jQuery),function(a,b,c,d){var e=c.propHooks.checked;c.propHooks.checked={set:function(a,b,d){var f;return f=void 0===e?a[d]=b:e(a,b,d),c(a).trigger("change.imagify"),f}},c(".imagify-select-all").on("click.imagify",function(){var a=c(this),b=a.data("action"),d=a.closest(".imagify-select-all-buttons"),e=d.prev(".imagify-check-group"),f="imagify-is-inactive";if(a.hasClass(f))return!1;d.find(".imagify-select-all").removeClass(f).attr("aria-disabled","false"),a.addClass(f).attr("aria-disabled","true"),e.find(".imagify-row-check").prop("checked",function(){return!c(this).is(":hidden,:disabled")&&"select"===b})}),c(".imagify-check-group .imagify-row-check").on("change.imagify",function(){var a=c(this).closest(".imagify-check-group"),b=a.find(".imagify-row-check"),d=b.filter(":visible:enabled").length,e=b.filter(":visible:enabled:checked").length,f=a.next(".imagify-select-all-buttons"),g="imagify-is-inactive";0===e&&f.find('[data-action="unselect"]').addClass(g).attr("aria-disabled","true"),e===d&&f.find('[data-action="select"]').addClass(g).attr("aria-disabled","true"),e!==d&&e>0&&f.find(".imagify-select-all").removeClass(g).attr("aria-disabled","false")})}(window,document,jQuery);
1
+ !function(a,b,c,d){var e=!1,f=!1;a("#imagify-settings #api_key").on("blur",function(){var b=a(this),d=b.val();return""!==a.trim(d)&&(a("#check_api_key").val()===d?(a("#imagify-check-api-container").html('<span class="dashicons dashicons-yes"></span> '+imagifyOptions.labels.ValidApiKeyText),!1):(!0===e?f.abort():(a("#imagify-check-api-container").remove(),b.after('<span id="imagify-check-api-container"><span class="imagify-spinner"></span>'+imagifyOptions.labels.waitApiKeyCheckText+"</span>")),e=!0,void(f=a.get(ajaxurl+c.imagify.concat+"action=imagify_check_api_key_validity&api_key="+b.val()+"&imagifycheckapikeynonce="+a("#imagifycheckapikeynonce").val()).done(function(b){b.success?(a("#imagify-check-api-container").remove(),swal({title:imagifyOptions.labels.ApiKeyCheckSuccessTitle,html:imagifyOptions.labels.ApiKeyCheckSuccessText,type:"success",padding:0,customClass:"imagify-sweet-alert"}).then(function(){location.reload()})):a("#imagify-check-api-container").html('<span class="dashicons dashicons-no"></span> '+b.data),e=!1}))))}),a(".imagify-options-line").css("cursor","pointer").on("click",function(b){if("INPUT"!==b.target.nodeName)return a('input[aria-describedby="'+a(this).attr("id")+'"]').trigger("click"),!1}),a(".imagify-settings th span").on("click",function(){var b=a(this).parent().next("td").find("input:checkbox");1===b.length&&b.trigger("click")}),a(".imagify-options-line").find("input").on("change focus",function(){var b=a(this).closest(".imagify-options-line").prev("label").prev("input");b[0].checked||b.prop("checked",!0)}),a(".imagify-settings-section").find("#imagify_backup").on("change",function(){var b=a(this),c=b.siblings("#backup-dir-is-writable"),d={action:"imagify_check_backup_dir_is_writable",_wpnonce:c.data("nonce")};if(b.is(":checked"))return void a.getJSON(ajaxurl,d).done(function(b){a.isPlainObject(b)&&b.success&&(b.data.is_writable?c.addClass("hidden"):c.removeClass("hidden"))});swal({title:imagifyOptions.labels.noBackupTitle,html:imagifyOptions.labels.noBackupText,type:"warning",customClass:"imagify-sweet-alert",padding:0,showCancelButton:!0,cancelButtonText:imagifySwal.labels.cancelButtonText,reverseButtons:!0}).then(function(){c.addClass("hidden")},function(){b.prop("checked",!0)})})}(jQuery,document,window),function(a,b,c,d){a.imagifyUser&&c.getJSON(ajaxurl,a.imagifyUser).done(function(a){c.isPlainObject(a)&&a.success&&(a.data.id=null,a.data.plan_id=null,a.data.is=[],c.each(a.data,function(b,d){var e=".imagify-user-"+b.replace(/_/g,"-");0===b.indexOf("is_")?d&&a.data.is.push(e):"is"!==b&&c(e).text(d)}),a.data.is.push("best-plan"),c(a.data.is.join(",")).removeClass("hidden"))})}(window,document,jQuery),function(a,b,c,d){function e(b){var d,e,f,g,h,i=!1,j=null;b&&(f=c("#imagify-custom-folders-selected"),g=f.find(".imagify-custom-folder-line"),h=g.find('[value="'+b+'"]'),h.length||(b=b.split("#///#"),d=b[1].replace(/\/+$/,"").toLowerCase(),e=a.imagify.template("imagify-custom-folder"),g.each(function(){var a=c(this),h=a.data("path").replace(/\/+$/,"").toLowerCase();return""!==h&&0===d.indexOf(h)?(i=!0,!1):d<h?(a.before(e({value:b[0],label:b[1]})),g=f.find(".imagify-custom-folder-line"),i=!0,!1):void 0}),i||(f.append(e({value:b[0],label:b[1]})),g=f.find(".imagify-custom-folder-line")),""!==d&&g.each(function(){var a=c(this),b=a.data("path").toLowerCase();null!==j&&0===b.indexOf(j)?a.find(".imagify-custom-folders-remove").trigger("click.imagify"):j=b}),f.next(".hidden").removeClass("hidden")))}imagifyOptions.getFilesTree&&(c("#imagify-add-custom-folder").on("click.imagify",function(){var a,b=c(this),d=[];b.attr("disabled")||(b.attr("disabled","disabled").next("img").attr("aria-hidden","false"),a=c("#imagify-custom-folders-selected"),a.find("input").each(function(){d.push(this.value)}),c.post(imagifyOptions.getFilesTree,{folder:"/",selected:d},null,"json").done(function(a){if(!a.success)return void swal({title:imagifyOptions.labels.error,html:a.data||"",type:"error",padding:0,customClass:"imagify-sweet-alert"});swal({title:imagifyOptions.labels.filesTreeTitle,html:'<div class="imagify-swal-subtitle">'+imagifyOptions.labels.filesTreeSubTitle+'</div><div class="imagify-swal-content"><p class="imagify-folders-information"><i class="dashicons dashicons-info" aria-hidden="true"></i>'+imagifyOptions.labels.cleaningInfo+'</p><ul id="imagify-folders-tree" class="imagify-folders-tree">'+a.data+"</ul></div>",type:"",customClass:"imagify-sweet-alert imagify-swal-has-subtitle imagify-folders-selection",showCancelButton:!0,padding:0,confirmButtonText:imagifyOptions.labels.confirmFilesTreeBtn,cancelButtonText:imagifySwal.labels.cancelButtonText,reverseButtons:!0}).then(function(){var a=c("#imagify-folders-tree input").serializeArray();a.length&&c.each(a,function(a,b){e(b.value)})}).catch(swal.noop)}).fail(function(){swal({title:imagifyOptions.labels.error,type:"error",customClass:"imagify-sweet-alert",padding:0})}).always(function(){b.removeAttr("disabled").next("img").attr("aria-hidden","true")}))}),c(b).on("click.imagify","#imagify-folders-tree [data-folder]",function(){var a=c(this),b=a.nextAll(".imagify-folders-sub-tree"),d=[];if(!a.attr("disabled")&&!a.siblings(":checkbox").is(":checked")){if(a.attr("disabled","disabled"),b.length)return a.hasClass("imagify-is-open")?(b.addClass("hidden"),a.removeClass(" imagify-is-open")):(b.removeClass("hidden"),a.addClass(" imagify-is-open")),void a.removeAttr("disabled");c("#imagify-custom-folders-selected").find("input").each(function(){d.push(this.value)}),c.post(imagifyOptions.getFilesTree,{folder:a.data("folder"),selected:d},null,"json").done(function(b){if(!b.success)return void swal({title:imagifyOptions.labels.error,html:b.data||"",type:"error",padding:0,customClass:"imagify-sweet-alert"});a.addClass("imagify-is-open").parent().append('<ul class="imagify-folders-sub-tree">'+b.data+"</ul>")}).fail(function(){swal({title:imagifyOptions.labels.error,type:"error",padding:0,customClass:"imagify-sweet-alert"})}).always(function(){a.removeAttr("disabled")})}}),c("#imagify-custom-folders").on("click.imagify",".imagify-custom-folders-remove",function(){var b=c(this).closest(".imagify-custom-folder-line").addClass("imagify-will-remove");a.setTimeout(function(){b.remove(),c("#imagify-custom-folders-selected").siblings(".imagify-success.hidden").removeClass("hidden")},750)}),c("#imagify-add-themes-to-custom-folder").on("click.imagify",function(){var a=c(this);e(a.data("theme")),e(a.data("theme-parent")),a.replaceWith("<p>"+imagifyOptions.labels.themesAdded+"</p>")}))}(window,document,jQuery),function(a,b,c,d){var e=c.propHooks.checked;c.propHooks.checked={set:function(a,b,d){var f;return f=void 0===e?a[d]=b:e(a,b,d),c(a).trigger("change.imagify"),f}},c(".imagify-select-all").on("click.imagify",function(){var a=c(this),b=a.data("action"),d=a.closest(".imagify-select-all-buttons"),e=d.prev(".imagify-check-group"),f="imagify-is-inactive";if(a.hasClass(f))return!1;d.find(".imagify-select-all").removeClass(f).attr("aria-disabled","false"),a.addClass(f).attr("aria-disabled","true"),e.find(".imagify-row-check").prop("checked",function(){return!c(this).is(":hidden,:disabled")&&"select"===b})}),c(".imagify-check-group .imagify-row-check").on("change.imagify",function(){var a=c(this).closest(".imagify-check-group"),b=a.find(".imagify-row-check"),d=b.filter(":visible:enabled").length,e=b.filter(":visible:enabled:checked").length,f=a.next(".imagify-select-all-buttons"),g="imagify-is-inactive";0===e&&f.find('[data-action="unselect"]').addClass(g).attr("aria-disabled","true"),e===d&&f.find('[data-action="select"]').addClass(g).attr("aria-disabled","true"),e!==d&&e>0&&f.find(".imagify-select-all").removeClass(g).attr("aria-disabled","false")})}(window,document,jQuery);
assets/js/pricing-modal.js CHANGED
@@ -152,7 +152,7 @@
152
  quo = datas.quota, // 1000 (MB) - 5000 images (monthly/onetime)
153
  cos = datas.cost, // 3.49 (onetime)
154
  name = ( quo >= 1000 ? quo / 1000 + ' GB' : quo + ' MB' ),
155
- pcs = type === 'monthly' ? { monthly: mon, yearly: Math.round( ann / 12 * 100 ) / 100 } : cos,
156
  pcsd = pcs, // Used if discount is active.
157
  percent, $datas_c, datas_content;
158
 
@@ -163,7 +163,7 @@
163
  }
164
 
165
  if ( typeof classes !== 'undefined' ) {
166
- $offer.addClass( 'imagify-' + type + '-' + lab + classes);
167
  }
168
 
169
  // Name.
@@ -323,18 +323,15 @@
323
 
324
  // Get the discount informations.
325
  $.post( ajaxurl, prices_rq_discount, function( discount_response ) {
326
- var images_datas, prices_datas, promo_datas, monthlies, onetimes,
327
- mo_user_cons, ot_user_cons,
 
 
 
328
  $mo_tpl, $ot_tpl,
329
  ot_clone, mo_clone,
330
- ot_html = '',
331
- mo_html = '',
332
- ot_suggested = false,
333
- mo_suggested = false,
334
  $estim_block, $offers_block,
335
- $banners, date_end, promo, discount,
336
- prev_offers, nb_to_remove, $total_offers,
337
- i, j;
338
 
339
  if ( ! discount_response.success ) {
340
  // TODO: replace modal content by any information.
@@ -345,32 +342,46 @@
345
  images_datas = imgs_response.data;
346
  prices_datas = prices_response.data;
347
  promo_datas = discount_response.data;
348
- monthlies = prices_datas.monthlies;
349
- onetimes = prices_datas.onetimes;
350
- mo_user_cons = Math.round( images_datas.average_month_size.raw / 1000000 ); // 1000000 in MB,
351
- ot_user_cons = Math.round( images_datas.total_library_size.raw / 1000000 ); // in MB,
 
 
 
 
352
  $mo_tpl = $( '#imagify-offer-monthly-template' );
353
  $ot_tpl = $( '#imagify-offer-onetime-template' );
354
  ot_clone = $ot_tpl.html();
355
  mo_clone = $mo_tpl.html();
356
  $estim_block = $( '.imagify-estimation-block' );
357
 
 
 
 
 
 
 
 
 
 
358
  // Refresh Analyzing block.
359
  $estim_block.removeClass( 'imagify-analyzing' );
360
  $estim_block.find( '.average-month-size' ).text( images_datas.average_month_size.human );
361
  $estim_block.find( '.total-library-size' ).text( images_datas.total_library_size.human );
362
 
363
- // Switch offers title is < 25mb.
364
- if ( mo_user_cons < 25 && ot_user_cons < 25 ) {
365
  $( '.imagify-pre-checkout-offers .imagify-modal-title' ).addClass( 'imagify-enough-free' );
366
- $( '.imagify-offer-selected' ).removeClass( 'imagify-offer-selected' ).find( '.imagify-checkbox' ).removeAttr( 'checked' );
367
  } else {
368
  $( '.imagify-enough-free' ).removeClass( 'imagify-enough-free' );
369
- $( '.imagify-offer-selected' ).addClass( 'imagify-offer-selected' ).find( '.imagify-checkbox' ).attr( 'checked', 'checked' );
370
  }
371
 
 
 
 
372
  // Don't create prices table if something went wrong during request.
373
- if ( null === monthlies || null === onetimes ) {
374
  $offers_block = $( '.imagify-pre-checkout-offers' );
375
 
376
  // Hide main content.
@@ -408,92 +419,71 @@
408
  imagifyModal.checkCoupon();
409
  }
410
 
 
 
 
 
 
411
  /**
412
  * Below lines will build Plan and Onetime offers lists.
413
- * It will also pre-select a Plan and Onetime in both of views: pre-checkout and pricing tables.
414
  */
415
 
416
  // Now, do the MONTHLIES Markup.
417
- $.each( monthlies, function( index, value ) {
418
  var $tpl, $offer,
419
  classes = '';
420
 
421
- // If it's free, don't show it.
422
- if ( 'free' === value.label ) {
423
- return true; // Continue-like (but $.each is not a loop... so).
424
- }
425
-
426
- $tpl = $( mo_clone ).clone();
427
-
428
  // If offer is too big (far) than estimated needs, don't show the offer.
429
- if ( false !== mo_suggested && ( index - mo_suggested ) > 2 ) {
430
  return true;
431
  }
432
 
433
- // Parent classes.
434
- if ( ( mo_user_cons < value.quota && false === mo_suggested ) ) {
435
- classes = ' imagify-offer-selected';
436
- mo_suggested = index;
437
 
438
- // Add this offer as pre-selected item in pre-checkout view.
439
- $offer = $( '.imagify-pre-checkout-offers' ).find( '.imagify-offer-monthly' );
 
 
 
 
440
 
441
  // Populate the Pre-checkout view depending on user_cons.
442
  imagifyModal.populateOffer( $offer, value, 'monthly' );
443
  }
444
 
445
  // Populate each offer.
 
446
  $tpl = imagifyModal.populateOffer( $tpl, value, 'monthly', classes );
447
 
448
  // Complete Monthlies HTML.
449
  mo_html += $tpl[0].outerHTML;
450
  } );
451
 
452
- // Deal with the case of too much small offers (before recommanded one).
453
- prev_offers = $( mo_html ).filter( '.imagify-offer-selected' ).prevAll();
454
-
455
- // If we have more than 1 previous offer.
456
- if ( prev_offers.length > 1 ) {
457
- nb_to_remove = prev_offers.length - 1;
458
- $total_offers = $( mo_html );
459
-
460
- // Remove too far previous offer.
461
- for ( i = 0; i < nb_to_remove; i++ ) {
462
- delete $total_offers[ i ];
463
- }
464
-
465
- // Rebuild mo_html with removed items.
466
- mo_html = '';
467
- for ( j = 0; j < $total_offers.length; j++) {
468
- mo_html += $( '<div/>' ).append( $total_offers[ j ] ).html();
469
- }
470
- }
471
-
472
  // Do the ONETIMES Markup.
473
- $.each( onetimes, function( index, value ) {
474
- var $tpl = $( ot_clone ).clone(),
475
- $offer = $( '.imagify-pre-checkout-offers' ).find( '.imagify-offer-onetime' ),
476
- classes = '',
477
- tvalue;
478
 
479
  // Parent classes.
480
- if ( ( ot_user_cons < value.quota && ot_suggested === false ) ) {
481
- classes = ' imagify-offer-selected';
482
- ot_suggested = true;
 
 
 
 
 
 
483
 
484
  // Populate the Pre-checkout view depending on user_cons.
485
  imagifyModal.populateOffer( $offer, value, 'onetime' );
486
  }
487
 
488
- // If too big, populate with the biggest offer available.
489
- // TODO: create custom offers at this point.
490
- if ( ( onetimes.length - 1 ) === index && false === ot_suggested ) {
491
- // populate the Pre-checkout view depending on user_cons
492
- tvalue = onetimes[ onetimes.length - 1 ];
493
- imagifyModal.populateOffer( $offer, tvalue, 'onetime' );
494
- }
495
-
496
  // Populate each offer.
 
497
  $tpl = imagifyModal.populateOffer( $tpl, value, 'onetime', classes );
498
 
499
  // complete Onetimes HTML
@@ -525,6 +515,175 @@
525
  } ); // End $.post.
526
  },
527
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
528
  /**
529
  * @uses imagifyModal.populatePayBtn()
530
  */
152
  quo = datas.quota, // 1000 (MB) - 5000 images (monthly/onetime)
153
  cos = datas.cost, // 3.49 (onetime)
154
  name = ( quo >= 1000 ? quo / 1000 + ' GB' : quo + ' MB' ),
155
+ pcs = 'monthly' === type ? { monthly: mon, yearly: Math.round( ann / 12 * 100 ) / 100 } : cos,
156
  pcsd = pcs, // Used if discount is active.
157
  percent, $datas_c, datas_content;
158
 
163
  }
164
 
165
  if ( typeof classes !== 'undefined' ) {
166
+ $offer.addClass( 'imagify-' + type + '-' + lab + classes );
167
  }
168
 
169
  // Name.
323
 
324
  // Get the discount informations.
325
  $.post( ajaxurl, prices_rq_discount, function( discount_response ) {
326
+ var images_datas, prices_datas, promo_datas,
327
+ offers, consumption, suggested,
328
+ freeQuota = 25,
329
+ ot_html = '',
330
+ mo_html = '',
331
  $mo_tpl, $ot_tpl,
332
  ot_clone, mo_clone,
 
 
 
 
333
  $estim_block, $offers_block,
334
+ $banners, date_end, promo, discount;
 
 
335
 
336
  if ( ! discount_response.success ) {
337
  // TODO: replace modal content by any information.
342
  images_datas = imgs_response.data;
343
  prices_datas = prices_response.data;
344
  promo_datas = discount_response.data;
345
+ offers = {
346
+ mo: prices_datas.monthlies,
347
+ ot: prices_datas.onetimes
348
+ };
349
+ consumption = {
350
+ month: images_datas.average_month_size.raw / Math.pow( 1024, 2 ), // Bytes to MB.
351
+ total: images_datas.total_library_size.raw / Math.pow( 1024, 2 ) // Bytes to MB.
352
+ };
353
  $mo_tpl = $( '#imagify-offer-monthly-template' );
354
  $ot_tpl = $( '#imagify-offer-onetime-template' );
355
  ot_clone = $ot_tpl.html();
356
  mo_clone = $mo_tpl.html();
357
  $estim_block = $( '.imagify-estimation-block' );
358
 
359
+ // Remove the monthly free plan from the offers.
360
+ $.each( offers.mo, function( index, value ) {
361
+ if ( 'free' === value.label ) {
362
+ freeQuota = value.quota;
363
+ offers.mo.splice( index, 1 );
364
+ return false;
365
+ }
366
+ } );
367
+
368
  // Refresh Analyzing block.
369
  $estim_block.removeClass( 'imagify-analyzing' );
370
  $estim_block.find( '.average-month-size' ).text( images_datas.average_month_size.human );
371
  $estim_block.find( '.total-library-size' ).text( images_datas.total_library_size.human );
372
 
373
+ // Switch offers title if < 25mb.
374
+ if ( consumption.total + consumption.month < freeQuota ) {
375
  $( '.imagify-pre-checkout-offers .imagify-modal-title' ).addClass( 'imagify-enough-free' );
 
376
  } else {
377
  $( '.imagify-enough-free' ).removeClass( 'imagify-enough-free' );
 
378
  }
379
 
380
+ // Reset offer selection.
381
+ $( '.imagify-offer-selected' ).removeClass( 'imagify-offer-selected' ).find( '.imagify-checkbox' ).prop( 'checked', false );
382
+
383
  // Don't create prices table if something went wrong during request.
384
+ if ( null === offers.mo || null === offers.ot ) {
385
  $offers_block = $( '.imagify-pre-checkout-offers' );
386
 
387
  // Hide main content.
419
  imagifyModal.checkCoupon();
420
  }
421
 
422
+ /**
423
+ * Find which plan(s) should be pre-selected.
424
+ */
425
+ suggested = imagifyModal.getSuggestedOffers( offers, consumption, freeQuota );
426
+
427
  /**
428
  * Below lines will build Plan and Onetime offers lists.
429
+ * It will also pre-select a Plan and/or Onetime in both of views: pre-checkout and pricing tables.
430
  */
431
 
432
  // Now, do the MONTHLIES Markup.
433
+ $.each( offers.mo, function( index, value ) {
434
  var $tpl, $offer,
435
  classes = '';
436
 
 
 
 
 
 
 
 
437
  // If offer is too big (far) than estimated needs, don't show the offer.
438
+ if ( ( index - suggested.mo.index ) > 2 ) {
439
  return true;
440
  }
441
 
442
+ if ( index === suggested.mo.index ) {
443
+ // It's the one to display.
444
+ $offer = $( '.imagify-pre-checkout-offers .imagify-offer-monthly' );
 
445
 
446
+ if ( suggested.mo.selected ) {
447
+ classes = ' imagify-offer-selected';
448
+
449
+ // Add this offer as pre-selected item in pre-checkout view.
450
+ $offer.addClass( 'imagify-offer-selected' ).find( '.imagify-checkbox' ).prop( 'checked', true );
451
+ }
452
 
453
  // Populate the Pre-checkout view depending on user_cons.
454
  imagifyModal.populateOffer( $offer, value, 'monthly' );
455
  }
456
 
457
  // Populate each offer.
458
+ $tpl = $( mo_clone ).clone();
459
  $tpl = imagifyModal.populateOffer( $tpl, value, 'monthly', classes );
460
 
461
  // Complete Monthlies HTML.
462
  mo_html += $tpl[0].outerHTML;
463
  } );
464
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
465
  // Do the ONETIMES Markup.
466
+ $.each( offers.ot, function( index, value ) {
467
+ var $tpl, $offer,
468
+ classes = '';
 
 
469
 
470
  // Parent classes.
471
+ if ( index === suggested.ot.index ) {
472
+ $offer = $( '.imagify-pre-checkout-offers .imagify-offer-onetime' );
473
+
474
+ if ( suggested.ot.selected ) {
475
+ classes = ' imagify-offer-selected';
476
+
477
+ // Add this offer as pre-selected item in pre-checkout view.
478
+ $offer.addClass( 'imagify-offer-selected' ).find( '.imagify-checkbox' ).prop( 'checked', true );
479
+ }
480
 
481
  // Populate the Pre-checkout view depending on user_cons.
482
  imagifyModal.populateOffer( $offer, value, 'onetime' );
483
  }
484
 
 
 
 
 
 
 
 
 
485
  // Populate each offer.
486
+ $tpl = $( ot_clone ).clone();
487
  $tpl = imagifyModal.populateOffer( $tpl, value, 'onetime', classes );
488
 
489
  // complete Onetimes HTML
515
  } ); // End $.post.
516
  },
517
 
518
+ /**
519
+ * Tell which offer(s) should be pre-selected.
520
+ *
521
+ * @param object offers {
522
+ * An object build like this:
523
+ *
524
+ * @type array mo Monthly offers. The most important data being 'quota' (MBytes).
525
+ * @type array ot One-Time offers. The most important data being 'quota' (MBytes).
526
+ * }
527
+ * @param object consumption {
528
+ * An object build like this:
529
+ *
530
+ * @type array month Average image size uploaded each month on the site (MBytes).
531
+ * @type array total Total image size in the library (MBytes).
532
+ * }
533
+ * @param int freeQuota Quota of the free monthly offer (MBytes). Currently 25.
534
+ * @return object {
535
+ * An object build like this:
536
+ *
537
+ * @type object mo An object containing the index of the suggested monthly offer, and if it should be selected.
538
+ * @type object ot An object containing the index of the suggested one-time offer, and if it should be selected.
539
+ * }
540
+ */
541
+ getSuggestedOffers: function( offers, consumption, freeQuota ) {
542
+ var tmpMB = consumption.total + consumption.month,
543
+ suggested = {
544
+ mo: false,
545
+ ot: false
546
+ };
547
+
548
+ if ( consumption.month <= freeQuota ) {
549
+ /**
550
+ * The free plan is enough (but we still may need a One-Time plan).
551
+ */
552
+ suggested.mo = {
553
+ index: 0,
554
+ selected: 0
555
+ };
556
+
557
+ tmpMB -= freeQuota;
558
+ } else {
559
+ /**
560
+ * Paid monthly plan.
561
+ */
562
+ $.each( offers.mo, function( index, value ) {
563
+ if ( value.quota < consumption.month ) {
564
+ // This plan is not big enough for the user needs.
565
+ return true;
566
+ }
567
+
568
+ // Suggested monthly plan.
569
+ suggested.mo = {
570
+ index: index,
571
+ selected: 1
572
+ };
573
+ return false;
574
+ } );
575
+
576
+ if ( false === suggested.mo ) {
577
+ /**
578
+ * If nothing is selected, that means no plan is big enough for the user's monthly consumption.
579
+ * In that case we fallback to the biggest available.
580
+ */
581
+ suggested.mo = {
582
+ index: offers.mo.length - 1,
583
+ selected: 1
584
+ };
585
+ }
586
+
587
+ // Remaining MB.
588
+ tmpMB -= offers.mo[ suggested.mo.index ].quota;
589
+ }
590
+
591
+ if ( tmpMB <= 0 ) {
592
+ /**
593
+ * The monthly plan is big enough to optimize all the images that already are in the library.
594
+ * We'll display a One-Time plan that is able to optimize the whole library, in case the user doesn't want a monthly plan, but it won't be pre-selected.
595
+ */
596
+ $.each( offers.ot, function( index, value ) {
597
+ if ( value.quota < consumption.total ) {
598
+ // This plan is not big enough for the user needs.
599
+ return true;
600
+ }
601
+
602
+ // Suggested monthly plan.
603
+ suggested.ot = {
604
+ index: index,
605
+ selected: 0
606
+ };
607
+ return false;
608
+ } );
609
+
610
+ if ( false === suggested.ot ) {
611
+ suggested.ot = {
612
+ index: offers.ot.length - 1,
613
+ selected: 0
614
+ };
615
+ }
616
+
617
+ return suggested;
618
+ }
619
+
620
+ /**
621
+ * The monthly plan is not big enough to optimize all the images that already are in the library.
622
+ * We need to select a One-Time plan.
623
+ */
624
+ $.each( offers.ot, function( index, value ) {
625
+ if ( value.quota < tmpMB ) {
626
+ // This plan is not big enough for the user needs.
627
+ return true;
628
+ }
629
+
630
+ // Suggested one-time plan.
631
+ suggested.ot = {
632
+ index: index,
633
+ selected: 1
634
+ };
635
+ return false;
636
+ } );
637
+
638
+ if ( false !== suggested.ot ) {
639
+ // OK, we have all we need.
640
+ return suggested;
641
+ }
642
+
643
+ /**
644
+ * If nothing is selected, that means no OT plan is big enough for the user.
645
+ * In that case we fallback to the biggest available, and we need to increase the monthly plan.
646
+ */
647
+ suggested.ot = {
648
+ index: offers.ot.length - 1,
649
+ selected: 1
650
+ };
651
+
652
+ // Reset monthly plan.
653
+ suggested.mo = false;
654
+
655
+ // Reset the remaining MB and substract the OT plan quota.
656
+ tmpMB = consumption.total + consumption.month - offers.ot[ suggested.ot.index ].quota;
657
+
658
+ // Search for a new monthly plan.
659
+ $.each( offers.mo, function( index, value ) {
660
+ if ( value.quota < tmpMB ) {
661
+ // This plan is not big enough for the user needs.
662
+ return true;
663
+ }
664
+
665
+ // Suggested monthly plan.
666
+ suggested.mo = {
667
+ index: index,
668
+ selected: 1
669
+ };
670
+ return false;
671
+ } );
672
+
673
+ if ( false === suggested.mo ) {
674
+ /**
675
+ * If nothing is selected, that means no monthly plan is big enough for the user's monthly consumption.
676
+ * In that case we fallback to the biggest available.
677
+ */
678
+ suggested.mo = {
679
+ index: offers.mo.length - 1,
680
+ selected: 1
681
+ };
682
+ }
683
+
684
+ return suggested;
685
+ },
686
+
687
  /**
688
  * @uses imagifyModal.populatePayBtn()
689
  */
assets/js/pricing-modal.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,b,c,d){a(b).on("click.imagify",".imagify-tab",function(b){var c,d=a(this);b.preventDefault(),d.hasClass("imagify-current")||(c=d.find("a").attr("href")||"#"+d.find("a").attr("aria-controls"),d.closest(".imagify-tabs").next(".imagify-tabs-contents").find(".imagify-tab-content").hide().attr("aria-hidden","true"),a(c).fadeIn(275).attr("aria-hidden","false"),d.closest(".imagify-tabs").find(".imagify-tab").removeClass("imagify-current").attr("aria-selected","false"),d.addClass("imagify-current").attr("aria-selected","true"))})}(jQuery,document,window),function(a,b,c,d){var e={};a("#imagify-pricing-modal").length&&(e={$modal:a("#imagify-pricing-modal"),$checkboxes:a(".imagify-offer-line .imagify-checkbox"),$radios:a(".imagify-payment-modal .imagify-radio-line input"),$preView:a("#imagify-pre-checkout-view"),$plansView:a("#imagify-plans-selection-view").hide(),$paymentView:a("#imagify-payment-process-view").hide(),$successView:a("#imagify-success-view").hide(),$anotherBtn:a(".imagify-choose-another-plan"),speedFadeIn:300,getHtmlPrice:function(a,b){var c,d,e,f,g;return b||(b=null),"object"!=typeof a?(a+="",a=a.split("."),a[1]=1===a[1].length?a[1]+"0":(""+a[1]).substring(0,2),g='<span class="imagify-price-big">'+a[0]+"</span> ",g+='<span class="imagify-price-mini">.'+a[1]+"</span>"):(c=a.monthly+"",d=a.yearly+"",e=c.split("."),f=d.split("."),g='<span class="imagify-switch-my">',g+='<span aria-hidden="'+("monthly"===b?"false":"true")+'" class="imagify-monthly">',g+='<span class="imagify-price-big">'+e[0]+"</span> ",g+='<span class="imagify-price-mini">.'+(1===e[1].length?e[1]+"0":(""+e[1]).substring(0,2))+"</span>",g+="</span> ",g+='<span aria-hidden="'+("yearly"===b?"false":"true")+'" class="imagify-yearly">',g+='<span class="imagify-price-big">'+f[0]+"</span> ",g+='<span class="imagify-price-mini">.'+(1===f[1].length?f[1]+"0":(""+f[1]).substring(0,2))+"</span>",g+="</span>",g+="</span>")},getHtmlDiscountPrice:function(a,b){var c,d,e="";return b||(b=null),"object"==typeof a?(c=a.monthly+"",d=a.yearly+"",e+='<span class="imagify-price-discount">',e+='<span class="imagify-price-discount-dollar">$</span>',e+='<span class="imagify-switch-my">',e+='<span aria-hidden="'+("monthly"===b?"false":"true")+'" class="imagify-monthly">',e+='<span class="imagify-price-discount-number">'+c+"</span>",e+="</span>",e+='<span aria-hidden="'+("yearly"===b?"false":"true")+'" class="imagify-yearly">',e+='<span class="imagify-price-discount-number">'+d+"</span>",e+="</span>",e+="</span>",e+="</span>"):(a+="",e+='<span class="imagify-price-discount">',e+='<span class="imagify-price-discount-dollar">$</span>',e+='<span class="imagify-price-discount-number">'+a+"</span>",e+="</span>"),e},populateOffer:function(a,b,d,f){var g,h,i,j=c.imagify_discount_datas,k=b.additional_gb,l=b.annual_cost,m=b.id,n=b.label,o=b.monthly_cost,p=b.quota,q=b.cost,r=p>=1e3?p/1e3+" GB":p+" MB",s="monthly"===d?{monthly:o,yearly:Math.round(l/12*100)/100}:q,t=s;return j.is_active&&"percentage"===j.coupon_type&&"monthly"===d&&(g=(100-j.coupon_value)/100,s="monthly"===d?{monthly:o*g,yearly:Math.round(l*g/12*100)/100}:q*g),void 0!==f&&a.addClass("imagify-"+d+"-"+n+f),a.find(".imagify-offer-size").text(r),a.find(".imagify-number-block").html(e.getHtmlPrice(s,"monthly")),j.is_active&&"percentage"===j.coupon_type&&"monthly"===d&&(a.find(".imagify-price-block").prev(".imagify-price-discount").remove(),a.find(".imagify-price-block").before(e.getHtmlDiscountPrice(t,"monthly"))),a.find(".imagify-approx-nb").text(5*p),"monthly"===d&&a.find(".imagify-price-add-data").text("$"+k),h=a.find(".imagify-payment-btn-select-plan").length?a.find(".imagify-payment-btn-select-plan"):a,i="monthly"===d?'{"'+n+'":{"id":'+m+',"name":"'+r+'","data":'+p+',"dataf":"'+r+'","imgs":'+5*p+',"prices":{"monthly":'+s.monthly+',"yearly":'+s.yearly+',"add":'+k+"}}}":'{"ot'+n+'":{"id":'+m+',"name":"'+r+'","data":'+p+',"dataf":"'+r+'","imgs":'+5*p+',"price":'+s+"}}",h.attr("data-offer",i),a},populatePayBtn: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,f=0;a(".imagify-offer-monthly").hasClass("imagify-offer-selected")&&(e=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")&&(f=c[Object.keys(c)[0]].price),d=parseFloat(f+e).toFixed(2),"0.00"===d||0===d?a("#imagify-modal-checkout-btn").attr("disabled","disabled").addClass("imagify-button-disabled"):a("#imagify-modal-checkout-btn").removeAttr("disabled").removeClass("imagify-button-disabled")},checkCoupon:function(){var b,c,d,e,f=a("#imagify-coupon-code").val();""!==f&&(b=a(".imagify-coupon-text"),c=b.find("label"),d=a(".imagify-coupon-section"),e=a("#imagify-get-pricing-modal").data("nonce"),b.addClass("checking"),a.post(ajaxurl,{action:"imagify_check_coupon",coupon:f,imagifynonce:e},function(a){var e;b.removeClass("checking"),a.success?a.data.success?(e="percentage"===a.data.coupon_type?a.data.value+"%":"$"+a.data.value,d.removeClass("invalid").addClass("validated"),c.html(imagifyPricingModal.labels.successCouponAPI),c.find(".imagify-coupon-offer").text(e),c.find(".imagify-coupon-word").text(f)):(d.removeClass("validated").addClass("invalid"),c.text(a.data.detail)):(d.removeClass("validated").addClass("invalid"),c.text(imagifyPricingModal.labels.errorCouponAPI))}))},getPricing:function(b){var d=b.data("nonce"),f={action:"imagify_get_prices",imagifynonce:d},g={action:"imagify_get_images_counts",imagifynonce:d},h={action:"imagify_get_discount",imagifynonce:d};e.$modal.find(".imagify-modal-loader").hide().show(),a.post(ajaxurl,f,function(b){if(!b.success)return void e.populatePayBtn();a.post(ajaxurl,g,function(d){d.success&&a.post(ajaxurl,h,function(f){var g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C="",D="",E=!1,F=!1;if(f.success){if(g=d.data,h=b.data,i=f.data,j=h.monthlies,k=h.onetimes,l=Math.round(g.average_month_size.raw/1e6),m=Math.round(g.total_library_size.raw/1e6),n=a("#imagify-offer-monthly-template"),o=a("#imagify-offer-onetime-template"),p=o.html(),q=n.html(),r=a(".imagify-estimation-block"),r.removeClass("imagify-analyzing"),r.find(".average-month-size").text(g.average_month_size.human),r.find(".total-library-size").text(g.total_library_size.human),l<25&&m<25?(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")),null===j||null===k)return s=a(".imagify-pre-checkout-offers"),s.hide().attr("aria-hidden",!0),s.closest(".imagify-modal-views").find(".imagify-popin-message").remove(),s.after('<div class="imagify-popin-message imagify-error"><p>'+imagifyPricingModal.labels.errorPriceAPI+"</p></div>"),void e.$modal.find(".imagify-modal-loader").fadeOut(300);if(c.imagify_discount_datas=i,i.is_active&&(t=a(".imagify-modal-promotion"),u=i.date_end.split("T")[0],v=i.coupon_value,w="percentage"===i.coupon_type?v+"%":"$"+v,a("#imagify-coupon-code").val(i.label).attr("readonly",!0),t.addClass("active").attr("aria-hidden","false"),t.find(".imagify-promotion-number").text(w),t.find(".imagify-promotion-date").text(u),e.checkCoupon()),a.each(j,function(b,c){var d,f,g="";return"free"===c.label||(d=a(q).clone(),!1!==F&&b-F>2||(l<c.quota&&!1===F&&(g=" imagify-offer-selected",F=b,f=a(".imagify-pre-checkout-offers").find(".imagify-offer-monthly"),e.populateOffer(f,c,"monthly")),d=e.populateOffer(d,c,"monthly",g),void(D+=d[0].outerHTML)))}),x=a(D).filter(".imagify-offer-selected").prevAll(),x.length>1){for(y=x.length-1,z=a(D),A=0;A<y;A++)delete z[A];for(D="",B=0;B<z.length;B++)D+=a("<div/>").append(z[B]).html()}a.each(k,function(b,c){var d,f=a(p).clone(),g=a(".imagify-pre-checkout-offers").find(".imagify-offer-onetime"),h="";m<c.quota&&!1===E&&(h=" imagify-offer-selected",E=!0,e.populateOffer(g,c,"onetime")),k.length-1===b&&!1===E&&(d=k[k.length-1],e.populateOffer(g,d,"onetime")),f=e.populateOffer(f,c,"onetime",h),C+=f[0].outerHTML}),n.parent().find(".imagify-offer-line")&&n.parent().find(".imagify-offer-line").remove(),n.before(D),o.parent().find(".imagify-offer-line")&&o.parent().find(".imagify-offer-line").remove(),o.before(C),e.$modal.find(".imagify-modal-loader").fadeOut(300)}})}),e.populatePayBtn()})},checkCheckbox:function(b){b.each(function(){var b=a(this);b.is(":checked")?b.closest(".imagify-offer-line").addClass("imagify-offer-selected"):b.closest(".imagify-offer-line").removeClass("imagify-offer-selected")}),e.populatePayBtn()},checkRadio:function(b){return b.each(function(){var b,c,d=a(this);b=d.parent(".imagify-cart-list-switcher").length?d.closest(".imagify-cart"):d.parent(".imagify-small-options").length?d.parent(".imagify-small-options").next(".imagify-pricing-table"):d.closest(".imagify-offer-line"),c=b.find(".imagify-switch-my"),"yearly"===d.val()?(b.addClass("imagify-year-selected").removeClass("imagify-month-selected"),c.find(".imagify-monthly").attr("aria-hidden","true"),c.find(".imagify-yearly").attr("aria-hidden","false")):(b.addClass("imagify-month-selected").removeClass("imagify-year-selected"),c.find(".imagify-monthly").attr("aria-hidden","false"),c.find(".imagify-yearly").attr("aria-hidden","true"))}),e.populatePayBtn(),b},populateBtnPrice:setInterval(function(){e.populatePayBtn()},1e3),getPeriod:function(){return a(".imagify-offer-monthly").hasClass("imagify-month-selected")?"monthly":"yearly"},getApiKey:function(){return a("#imagify-payment-iframe").data("imagify-api")},switchToView:function(a,b){var c=a.attr("id"),d=e.$modal.children(".imagify-modal-content");a.siblings(".imagify-modal-views").hide().attr("aria-hidden","true"),b&&b.tab&&a.find('a[href="#'+b.tab+'"]').trigger("click.imagify"),"imagify-payment-process-view"===c?d.addClass("imagify-iframe-viewing"):d.removeClass("imagify-iframe-viewing"),"imagify-success-view"===c?(d.addClass("imagify-success-viewing"),e.$modal.attr("aria-labelledby","imagify-success-view")):(d.removeClass("imagify-success-viewing"),e.$modal.removeAttr("aria-labelledby")),a.fadeIn(e.speedFadeIn).attr("aria-hidden","false")},iframeSetSrc:function(b){var d,f,g,h,i,j,k,l=a("#imagify-payment-iframe"),m=l.attr("src"),n=l.data("src"),o=0,p=0;if("string"==typeof b&&""!==m)return k="monthly"===b?"yearly":"monthly",m=m.replace(k,b),void l.attr("src",m);if("object"==typeof b){if(b.monthly&&(o=b.monthly[Object.keys(b.monthly)[0]].id),b.onetime&&(p=b.onetime[Object.keys(b.onetime)[0]].id,p=p+""=="999"?b.onetime[Object.keys(b.onetime)[0]].data:p),!b.period)return void c.imagify.info("No period defined");e.getApiKey(),d=p,f="yearly"===b.period?o:0,g="monthly"===b.period?o:0,h=a("#imagify-coupon-code").val(),i=""===h?"none":h,parseFloat(a(".imagify-global-amount").text()).toFixed(2),n=n+d+"/"+g+"/"+f+"/"+i+"/",j=l.remove().attr("src",n),e.$paymentView.html(j)}},paymentClose:function(){a(".imagify-iframe-viewing .close-btn").trigger("click.imagify"),a(".imagify-iframe-viewing").removeClass("imagify-iframe-viewing")},paymentBack:function(){e.switchToView(e.$preView)},paymentSuccess:function(){e.switchToView(e.$successView)},checkPluginMessage:function(a){var b=a.origin||a.originalEvent.origin;if("https://app.imagify.io"===b||"http://dapp.imagify.io"===b)switch(a.data){case"cancel":e.paymentClose();break;case"back":e.paymentBack();break;case"success":e.paymentSuccess()}}},e.checkCheckbox(e.$checkboxes),e.checkRadio(e.$radios.filter(":checked")),e.checkCoupon(),e.$checkboxes.on("change.imagify",function(){e.checkCheckbox(a(this))}),e.$radios.on("change.imagify",function(){e.checkRadio(a(this))}),a("#imagify-get-pricing-modal").on("click.imagify-ajax",function(){e.getPricing(a(this))}),a(b).on("modalClosed.imagify",".imagify-payment-modal",function(){a(this).find(".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("#imagify-coupon-code").on("blur.imagify",function(){a(this).attr("readonly")||e.checkCoupon()}).on("keydown.imagify",function(b){var c=a(this);if(!c.attr("readonly"))return 13===b.keyCode||32===b.keyCode?(e.checkCoupon(),!1):void(c.val().length>=3?c.closest(".imagify-coupon-input").addClass("imagify-canbe-validate"):c.closest(".imagify-coupon-input").removeClass("imagify-canbe-validate"))}),a("#imagify-coupon-validate").on("click.imagify",function(){e.checkCoupon(),a(this).closest(".imagify-canbe-validate").removeClass("imagify-canbe-validate")}),e.$anotherBtn.on("click.imagify",function(b){var c=a(this).data("imagify-choose"),d="imagify-pricing-tab-"+("plan"===c?"monthly":"onetime");b.preventDefault(),e.switchToView(e.$plansView,{tab:d})}),e.$modal.on("click.imagify",".imagify-payment-btn-select-plan",function(b){var c=a(this),d=c.closest(".imagify-offer-line"),f=c.data("offer"),g=c.attr("data-offer"),h="imagify-pricing-tab-monthly"!==c.closest(".imagify-tab-content").attr("id"),i=h?e.$preView.find(".imagify-offer-onetime"):e.$preView.find(".imagify-offer-monthly"),j=h?null:c.closest(".imagify-pricing-table").hasClass("imagify-month-selected")?"monthly":"yearly",k=h?e.getHtmlPrice(f[Object.keys(f)[0]].price):e.getHtmlPrice(f[Object.keys(f)[0]].prices,j),l=h?"":'<span class="imagify-price-by">'+d.find(".imagify-price-by").text()+"</span>",m=d.find(".imagify-price-discount").html(),n=d.find(".imagify-approx-nb").text(),o=d.find(".imagify-offer-size").text();b.preventDefault(),e.switchToView(e.$preView),i.find(".imagify-number-block").html(k+l),i.find(".imagify-price-discount").html(m),i.find(".imagify-approx-nb").text(n),i.find(".imagify-offer-size").text(o),i.attr("data-offer",g),h||(i.find(".imagify-price-add-data").text(d.find(".imagify-price-add-data").text()),"monthly"===j?i.find("#imagify-subscription-monthly").trigger("click.imagify"):i.find("#imagify-subscription-yearly").trigger("click.imagify"),i.find(".imagify-inline-options").find("input:radio:checked").trigger("change.imagify")),e.populatePayBtn()}),a("#imagify-modal-checkout-btn").on("click.imagify",function(b){var c,d,f;b.preventDefault(),a(this).hasClass("imagify-button-disabled")||(c=a(".imagify-offer-monthly"),d=a(".imagify-offer-onetime"),f={},c.hasClass("imagify-offer-selected")&&(f.monthly=JSON.parse(c.attr("data-offer"))),d.hasClass("imagify-offer-selected")&&(f.onetime=JSON.parse(d.attr("data-offer"))),e.switchToView(e.$paymentView),f.period=e.getPeriod(),e.iframeSetSrc(f))}),a(".imagify-back-to-plans").on("click.imagify",function(b){var c=a(this),d=c.closest(".imagify-cart-item").hasClass("imagify-cart-item-onetime");b.preventDefault(),d?a(".imagify-offer-onetime").find(".imagify-choose-another-plan").trigger("click.imagify"):a(".imagify-offer-monthly").find(".imagify-choose-another-plan").trigger("click.imagify")}),c.addEventListener("message",e.checkPluginMessage,!0))}(jQuery,document,window);
1
+ !function(a,b,c,d){a(b).on("click.imagify",".imagify-tab",function(b){var c,d=a(this);b.preventDefault(),d.hasClass("imagify-current")||(c=d.find("a").attr("href")||"#"+d.find("a").attr("aria-controls"),d.closest(".imagify-tabs").next(".imagify-tabs-contents").find(".imagify-tab-content").hide().attr("aria-hidden","true"),a(c).fadeIn(275).attr("aria-hidden","false"),d.closest(".imagify-tabs").find(".imagify-tab").removeClass("imagify-current").attr("aria-selected","false"),d.addClass("imagify-current").attr("aria-selected","true"))})}(jQuery,document,window),function(a,b,c,d){var e={};a("#imagify-pricing-modal").length&&(e={$modal:a("#imagify-pricing-modal"),$checkboxes:a(".imagify-offer-line .imagify-checkbox"),$radios:a(".imagify-payment-modal .imagify-radio-line input"),$preView:a("#imagify-pre-checkout-view"),$plansView:a("#imagify-plans-selection-view").hide(),$paymentView:a("#imagify-payment-process-view").hide(),$successView:a("#imagify-success-view").hide(),$anotherBtn:a(".imagify-choose-another-plan"),speedFadeIn:300,getHtmlPrice:function(a,b){var c,d,e,f,g;return b||(b=null),"object"!=typeof a?(a+="",a=a.split("."),a[1]=1===a[1].length?a[1]+"0":(""+a[1]).substring(0,2),g='<span class="imagify-price-big">'+a[0]+"</span> ",g+='<span class="imagify-price-mini">.'+a[1]+"</span>"):(c=a.monthly+"",d=a.yearly+"",e=c.split("."),f=d.split("."),g='<span class="imagify-switch-my">',g+='<span aria-hidden="'+("monthly"===b?"false":"true")+'" class="imagify-monthly">',g+='<span class="imagify-price-big">'+e[0]+"</span> ",g+='<span class="imagify-price-mini">.'+(1===e[1].length?e[1]+"0":(""+e[1]).substring(0,2))+"</span>",g+="</span> ",g+='<span aria-hidden="'+("yearly"===b?"false":"true")+'" class="imagify-yearly">',g+='<span class="imagify-price-big">'+f[0]+"</span> ",g+='<span class="imagify-price-mini">.'+(1===f[1].length?f[1]+"0":(""+f[1]).substring(0,2))+"</span>",g+="</span>",g+="</span>")},getHtmlDiscountPrice:function(a,b){var c,d,e="";return b||(b=null),"object"==typeof a?(c=a.monthly+"",d=a.yearly+"",e+='<span class="imagify-price-discount">',e+='<span class="imagify-price-discount-dollar">$</span>',e+='<span class="imagify-switch-my">',e+='<span aria-hidden="'+("monthly"===b?"false":"true")+'" class="imagify-monthly">',e+='<span class="imagify-price-discount-number">'+c+"</span>",e+="</span>",e+='<span aria-hidden="'+("yearly"===b?"false":"true")+'" class="imagify-yearly">',e+='<span class="imagify-price-discount-number">'+d+"</span>",e+="</span>",e+="</span>",e+="</span>"):(a+="",e+='<span class="imagify-price-discount">',e+='<span class="imagify-price-discount-dollar">$</span>',e+='<span class="imagify-price-discount-number">'+a+"</span>",e+="</span>"),e},populateOffer:function(a,b,d,f){var g,h,i,j=c.imagify_discount_datas,k=b.additional_gb,l=b.annual_cost,m=b.id,n=b.label,o=b.monthly_cost,p=b.quota,q=b.cost,r=p>=1e3?p/1e3+" GB":p+" MB",s="monthly"===d?{monthly:o,yearly:Math.round(l/12*100)/100}:q,t=s;return j.is_active&&"percentage"===j.coupon_type&&"monthly"===d&&(g=(100-j.coupon_value)/100,s="monthly"===d?{monthly:o*g,yearly:Math.round(l*g/12*100)/100}:q*g),void 0!==f&&a.addClass("imagify-"+d+"-"+n+f),a.find(".imagify-offer-size").text(r),a.find(".imagify-number-block").html(e.getHtmlPrice(s,"monthly")),j.is_active&&"percentage"===j.coupon_type&&"monthly"===d&&(a.find(".imagify-price-block").prev(".imagify-price-discount").remove(),a.find(".imagify-price-block").before(e.getHtmlDiscountPrice(t,"monthly"))),a.find(".imagify-approx-nb").text(5*p),"monthly"===d&&a.find(".imagify-price-add-data").text("$"+k),h=a.find(".imagify-payment-btn-select-plan").length?a.find(".imagify-payment-btn-select-plan"):a,i="monthly"===d?'{"'+n+'":{"id":'+m+',"name":"'+r+'","data":'+p+',"dataf":"'+r+'","imgs":'+5*p+',"prices":{"monthly":'+s.monthly+',"yearly":'+s.yearly+',"add":'+k+"}}}":'{"ot'+n+'":{"id":'+m+',"name":"'+r+'","data":'+p+',"dataf":"'+r+'","imgs":'+5*p+',"price":'+s+"}}",h.attr("data-offer",i),a},populatePayBtn: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,f=0;a(".imagify-offer-monthly").hasClass("imagify-offer-selected")&&(e=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")&&(f=c[Object.keys(c)[0]].price),d=parseFloat(f+e).toFixed(2),"0.00"===d||0===d?a("#imagify-modal-checkout-btn").attr("disabled","disabled").addClass("imagify-button-disabled"):a("#imagify-modal-checkout-btn").removeAttr("disabled").removeClass("imagify-button-disabled")},checkCoupon:function(){var b,c,d,e,f=a("#imagify-coupon-code").val();""!==f&&(b=a(".imagify-coupon-text"),c=b.find("label"),d=a(".imagify-coupon-section"),e=a("#imagify-get-pricing-modal").data("nonce"),b.addClass("checking"),a.post(ajaxurl,{action:"imagify_check_coupon",coupon:f,imagifynonce:e},function(a){var e;b.removeClass("checking"),a.success?a.data.success?(e="percentage"===a.data.coupon_type?a.data.value+"%":"$"+a.data.value,d.removeClass("invalid").addClass("validated"),c.html(imagifyPricingModal.labels.successCouponAPI),c.find(".imagify-coupon-offer").text(e),c.find(".imagify-coupon-word").text(f)):(d.removeClass("validated").addClass("invalid"),c.text(a.data.detail)):(d.removeClass("validated").addClass("invalid"),c.text(imagifyPricingModal.labels.errorCouponAPI))}))},getPricing:function(b){var d=b.data("nonce"),f={action:"imagify_get_prices",imagifynonce:d},g={action:"imagify_get_images_counts",imagifynonce:d},h={action:"imagify_get_discount",imagifynonce:d};e.$modal.find(".imagify-modal-loader").hide().show(),a.post(ajaxurl,f,function(b){if(!b.success)return void e.populatePayBtn();a.post(ajaxurl,g,function(d){d.success&&a.post(ajaxurl,h,function(f){var g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w=25,x="",y="";if(f.success){if(g=d.data,h=b.data,i=f.data,j={mo:h.monthlies,ot:h.onetimes},k={month:g.average_month_size.raw/Math.pow(1024,2),total:g.total_library_size.raw/Math.pow(1024,2)},m=a("#imagify-offer-monthly-template"),n=a("#imagify-offer-onetime-template"),o=n.html(),p=m.html(),q=a(".imagify-estimation-block"),a.each(j.mo,function(a,b){if("free"===b.label)return w=b.quota,j.mo.splice(a,1),!1}),q.removeClass("imagify-analyzing"),q.find(".average-month-size").text(g.average_month_size.human),q.find(".total-library-size").text(g.total_library_size.human),k.total+k.month<w?a(".imagify-pre-checkout-offers .imagify-modal-title").addClass("imagify-enough-free"):a(".imagify-enough-free").removeClass("imagify-enough-free"),a(".imagify-offer-selected").removeClass("imagify-offer-selected").find(".imagify-checkbox").prop("checked",!1),null===j.mo||null===j.ot)return r=a(".imagify-pre-checkout-offers"),r.hide().attr("aria-hidden",!0),r.closest(".imagify-modal-views").find(".imagify-popin-message").remove(),r.after('<div class="imagify-popin-message imagify-error"><p>'+imagifyPricingModal.labels.errorPriceAPI+"</p></div>"),void e.$modal.find(".imagify-modal-loader").fadeOut(300);c.imagify_discount_datas=i,i.is_active&&(s=a(".imagify-modal-promotion"),t=i.date_end.split("T")[0],u=i.coupon_value,v="percentage"===i.coupon_type?u+"%":"$"+u,a("#imagify-coupon-code").val(i.label).attr("readonly",!0),s.addClass("active").attr("aria-hidden","false"),s.find(".imagify-promotion-number").text(v),s.find(".imagify-promotion-date").text(t),e.checkCoupon()),l=e.getSuggestedOffers(j,k,w),a.each(j.mo,function(b,c){var d,f,g="";if(b-l.mo.index>2)return!0;b===l.mo.index&&(f=a(".imagify-pre-checkout-offers .imagify-offer-monthly"),l.mo.selected&&(g=" imagify-offer-selected",f.addClass("imagify-offer-selected").find(".imagify-checkbox").prop("checked",!0)),e.populateOffer(f,c,"monthly")),d=a(p).clone(),d=e.populateOffer(d,c,"monthly",g),y+=d[0].outerHTML}),a.each(j.ot,function(b,c){var d,f,g="";b===l.ot.index&&(f=a(".imagify-pre-checkout-offers .imagify-offer-onetime"),l.ot.selected&&(g=" imagify-offer-selected",f.addClass("imagify-offer-selected").find(".imagify-checkbox").prop("checked",!0)),e.populateOffer(f,c,"onetime")),d=a(o).clone(),d=e.populateOffer(d,c,"onetime",g),x+=d[0].outerHTML}),m.parent().find(".imagify-offer-line")&&m.parent().find(".imagify-offer-line").remove(),m.before(y),n.parent().find(".imagify-offer-line")&&n.parent().find(".imagify-offer-line").remove(),n.before(x),e.$modal.find(".imagify-modal-loader").fadeOut(300)}})}),e.populatePayBtn()})},getSuggestedOffers:function(b,c,d){var e=c.total+c.month,f={mo:!1,ot:!1};return c.month<=d?(f.mo={index:0,selected:0},e-=d):(a.each(b.mo,function(a,b){return b.quota<c.month||(f.mo={index:a,selected:1},!1)}),!1===f.mo&&(f.mo={index:b.mo.length-1,selected:1}),e-=b.mo[f.mo.index].quota),e<=0?(a.each(b.ot,function(a,b){return b.quota<c.total||(f.ot={index:a,selected:0},!1)}),!1===f.ot&&(f.ot={index:b.ot.length-1,selected:0}),f):(a.each(b.ot,function(a,b){return b.quota<e||(f.ot={index:a,selected:1},!1)}),!1!==f.ot?f:(f.ot={index:b.ot.length-1,selected:1},f.mo=!1,e=c.total+c.month-b.ot[f.ot.index].quota,a.each(b.mo,function(a,b){return b.quota<e||(f.mo={index:a,selected:1},!1)}),!1===f.mo&&(f.mo={index:b.mo.length-1,selected:1}),f))},checkCheckbox:function(b){b.each(function(){var b=a(this);b.is(":checked")?b.closest(".imagify-offer-line").addClass("imagify-offer-selected"):b.closest(".imagify-offer-line").removeClass("imagify-offer-selected")}),e.populatePayBtn()},checkRadio:function(b){return b.each(function(){var b,c,d=a(this);b=d.parent(".imagify-cart-list-switcher").length?d.closest(".imagify-cart"):d.parent(".imagify-small-options").length?d.parent(".imagify-small-options").next(".imagify-pricing-table"):d.closest(".imagify-offer-line"),c=b.find(".imagify-switch-my"),"yearly"===d.val()?(b.addClass("imagify-year-selected").removeClass("imagify-month-selected"),c.find(".imagify-monthly").attr("aria-hidden","true"),c.find(".imagify-yearly").attr("aria-hidden","false")):(b.addClass("imagify-month-selected").removeClass("imagify-year-selected"),c.find(".imagify-monthly").attr("aria-hidden","false"),c.find(".imagify-yearly").attr("aria-hidden","true"))}),e.populatePayBtn(),b},populateBtnPrice:setInterval(function(){e.populatePayBtn()},1e3),getPeriod:function(){return a(".imagify-offer-monthly").hasClass("imagify-month-selected")?"monthly":"yearly"},getApiKey:function(){return a("#imagify-payment-iframe").data("imagify-api")},switchToView:function(a,b){var c=a.attr("id"),d=e.$modal.children(".imagify-modal-content");a.siblings(".imagify-modal-views").hide().attr("aria-hidden","true"),b&&b.tab&&a.find('a[href="#'+b.tab+'"]').trigger("click.imagify"),"imagify-payment-process-view"===c?d.addClass("imagify-iframe-viewing"):d.removeClass("imagify-iframe-viewing"),"imagify-success-view"===c?(d.addClass("imagify-success-viewing"),e.$modal.attr("aria-labelledby","imagify-success-view")):(d.removeClass("imagify-success-viewing"),e.$modal.removeAttr("aria-labelledby")),a.fadeIn(e.speedFadeIn).attr("aria-hidden","false")},iframeSetSrc:function(b){var d,f,g,h,i,j,k,l=a("#imagify-payment-iframe"),m=l.attr("src"),n=l.data("src"),o=0,p=0;if("string"==typeof b&&""!==m)return k="monthly"===b?"yearly":"monthly",m=m.replace(k,b),void l.attr("src",m);if("object"==typeof b){if(b.monthly&&(o=b.monthly[Object.keys(b.monthly)[0]].id),b.onetime&&(p=b.onetime[Object.keys(b.onetime)[0]].id,p=p+""=="999"?b.onetime[Object.keys(b.onetime)[0]].data:p),!b.period)return void c.imagify.info("No period defined");e.getApiKey(),d=p,f="yearly"===b.period?o:0,g="monthly"===b.period?o:0,h=a("#imagify-coupon-code").val(),i=""===h?"none":h,parseFloat(a(".imagify-global-amount").text()).toFixed(2),n=n+d+"/"+g+"/"+f+"/"+i+"/",j=l.remove().attr("src",n),e.$paymentView.html(j)}},paymentClose:function(){a(".imagify-iframe-viewing .close-btn").trigger("click.imagify"),a(".imagify-iframe-viewing").removeClass("imagify-iframe-viewing")},paymentBack:function(){e.switchToView(e.$preView)},paymentSuccess:function(){e.switchToView(e.$successView)},checkPluginMessage:function(a){var b=a.origin||a.originalEvent.origin;if("https://app.imagify.io"===b||"http://dapp.imagify.io"===b)switch(a.data){case"cancel":e.paymentClose();break;case"back":e.paymentBack();break;case"success":e.paymentSuccess()}}},e.checkCheckbox(e.$checkboxes),e.checkRadio(e.$radios.filter(":checked")),e.checkCoupon(),e.$checkboxes.on("change.imagify",function(){e.checkCheckbox(a(this))}),e.$radios.on("change.imagify",function(){e.checkRadio(a(this))}),a("#imagify-get-pricing-modal").on("click.imagify-ajax",function(){e.getPricing(a(this))}),a(b).on("modalClosed.imagify",".imagify-payment-modal",function(){a(this).find(".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("#imagify-coupon-code").on("blur.imagify",function(){a(this).attr("readonly")||e.checkCoupon()}).on("keydown.imagify",function(b){var c=a(this);if(!c.attr("readonly"))return 13===b.keyCode||32===b.keyCode?(e.checkCoupon(),!1):void(c.val().length>=3?c.closest(".imagify-coupon-input").addClass("imagify-canbe-validate"):c.closest(".imagify-coupon-input").removeClass("imagify-canbe-validate"))}),a("#imagify-coupon-validate").on("click.imagify",function(){e.checkCoupon(),a(this).closest(".imagify-canbe-validate").removeClass("imagify-canbe-validate")}),e.$anotherBtn.on("click.imagify",function(b){var c=a(this).data("imagify-choose"),d="imagify-pricing-tab-"+("plan"===c?"monthly":"onetime");b.preventDefault(),e.switchToView(e.$plansView,{tab:d})}),e.$modal.on("click.imagify",".imagify-payment-btn-select-plan",function(b){var c=a(this),d=c.closest(".imagify-offer-line"),f=c.data("offer"),g=c.attr("data-offer"),h="imagify-pricing-tab-monthly"!==c.closest(".imagify-tab-content").attr("id"),i=h?e.$preView.find(".imagify-offer-onetime"):e.$preView.find(".imagify-offer-monthly"),j=h?null:c.closest(".imagify-pricing-table").hasClass("imagify-month-selected")?"monthly":"yearly",k=h?e.getHtmlPrice(f[Object.keys(f)[0]].price):e.getHtmlPrice(f[Object.keys(f)[0]].prices,j),l=h?"":'<span class="imagify-price-by">'+d.find(".imagify-price-by").text()+"</span>",m=d.find(".imagify-price-discount").html(),n=d.find(".imagify-approx-nb").text(),o=d.find(".imagify-offer-size").text();b.preventDefault(),e.switchToView(e.$preView),i.find(".imagify-number-block").html(k+l),i.find(".imagify-price-discount").html(m),i.find(".imagify-approx-nb").text(n),i.find(".imagify-offer-size").text(o),i.attr("data-offer",g),h||(i.find(".imagify-price-add-data").text(d.find(".imagify-price-add-data").text()),"monthly"===j?i.find("#imagify-subscription-monthly").trigger("click.imagify"):i.find("#imagify-subscription-yearly").trigger("click.imagify"),i.find(".imagify-inline-options").find("input:radio:checked").trigger("change.imagify")),e.populatePayBtn()}),a("#imagify-modal-checkout-btn").on("click.imagify",function(b){var c,d,f;b.preventDefault(),a(this).hasClass("imagify-button-disabled")||(c=a(".imagify-offer-monthly"),d=a(".imagify-offer-onetime"),f={},c.hasClass("imagify-offer-selected")&&(f.monthly=JSON.parse(c.attr("data-offer"))),d.hasClass("imagify-offer-selected")&&(f.onetime=JSON.parse(d.attr("data-offer"))),e.switchToView(e.$paymentView),f.period=e.getPeriod(),e.iframeSetSrc(f))}),a(".imagify-back-to-plans").on("click.imagify",function(b){var c=a(this),d=c.closest(".imagify-cart-item").hasClass("imagify-cart-item-onetime");b.preventDefault(),d?a(".imagify-offer-onetime").find(".imagify-choose-another-plan").trigger("click.imagify"):a(".imagify-offer-monthly").find(".imagify-choose-another-plan").trigger("click.imagify")}),c.addEventListener("message",e.checkPluginMessage,!0))}(jQuery,document,window);
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 bandwidth using Imagify, the new most advanced image optimization tool.
6
- * Version: 1.8.0.1
7
  * Author: WP Media
8
  * Author URI: https://wp-media.me/
9
  * Licence: GPLv2
@@ -17,7 +17,8 @@
17
  defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
18
 
19
  // Imagify defines.
20
- define( 'IMAGIFY_VERSION' , '1.8.0.1' );
 
21
  define( 'IMAGIFY_SLUG' , 'imagify' );
22
  define( 'IMAGIFY_FILE' , __FILE__ );
23
  define( 'IMAGIFY_PATH' , realpath( plugin_dir_path( IMAGIFY_FILE ) ) . '/' );
@@ -44,35 +45,43 @@ add_action( 'plugins_loaded', '_imagify_init' );
44
  * @since 1.0
45
  */
46
  function _imagify_init() {
 
 
47
  // Load translations.
48
  load_plugin_textdomain( 'imagify', false, dirname( plugin_basename( IMAGIFY_FILE ) ) . '/languages/' );
49
 
 
 
 
 
 
 
50
  // Nothing to do if autosave.
51
  if ( defined( 'DOING_AUTOSAVE' ) ) {
52
  return;
53
  }
54
 
55
- require( IMAGIFY_FUNCTIONS_PATH . 'compat.php' );
56
- require( IMAGIFY_FUNCTIONS_PATH . 'deprecated.php' );
57
- require( IMAGIFY_FUNCTIONS_PATH . 'common.php' );
58
 
59
  // Register classes.
60
  spl_autoload_register( 'imagify_autoload' );
61
 
62
- require( IMAGIFY_FUNCTIONS_PATH . 'options.php' );
63
- require( IMAGIFY_FUNCTIONS_PATH . 'formatting.php' );
64
- require( IMAGIFY_FUNCTIONS_PATH . 'admin.php' );
65
- require( IMAGIFY_FUNCTIONS_PATH . 'api.php' );
66
- require( IMAGIFY_FUNCTIONS_PATH . 'attachments.php' );
67
- require( IMAGIFY_FUNCTIONS_PATH . 'process.php' );
68
- require( IMAGIFY_FUNCTIONS_PATH . 'admin-ui.php' );
69
- require( IMAGIFY_FUNCTIONS_PATH . 'admin-stats.php' );
70
- require( IMAGIFY_FUNCTIONS_PATH . 'i18n.php' );
71
- require( IMAGIFY_FUNCTIONS_PATH . 'partners.php' );
72
- require( IMAGIFY_COMMON_PATH . 'attachments.php' );
73
- require( IMAGIFY_COMMON_PATH . 'admin-bar.php' );
74
- require( IMAGIFY_COMMON_PATH . 'partners.php' );
75
- require( IMAGIFY_3RD_PARTY_PATH . '3rd-party.php' );
76
 
77
  Imagify_Options::get_instance()->init();
78
  Imagify_Data::get_instance()->init();
@@ -83,12 +92,12 @@ function _imagify_init() {
83
  Imagify_Cron_Sync_Files::get_instance()->init();
84
 
85
  if ( is_admin() ) {
86
- require( IMAGIFY_ADMIN_PATH . 'upgrader.php' );
87
- require( IMAGIFY_ADMIN_PATH . 'heartbeat.php' );
88
- require( IMAGIFY_ADMIN_PATH . 'upload.php' );
89
- require( IMAGIFY_ADMIN_PATH . 'media.php' );
90
- require( IMAGIFY_ADMIN_PATH . 'meta-boxes.php' );
91
- require( IMAGIFY_ADMIN_PATH . 'custom-folders.php' );
92
 
93
  Imagify_Notices::get_instance()->init();
94
  Imagify_Admin_Ajax_Post::get_instance()->init();
@@ -107,3 +116,35 @@ function _imagify_init() {
107
  */
108
  do_action( 'imagify_loaded' );
109
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 bandwidth using Imagify, the new most advanced image optimization tool.
6
+ * Version: 1.8.1.1
7
  * Author: WP Media
8
  * Author URI: https://wp-media.me/
9
  * Licence: GPLv2
17
  defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
18
 
19
  // Imagify defines.
20
+ define( 'IMAGIFY_VERSION' , '1.8.1.1' );
21
+ define( 'IMAGIFY_WP_MIN' , '4.0' );
22
  define( 'IMAGIFY_SLUG' , 'imagify' );
23
  define( 'IMAGIFY_FILE' , __FILE__ );
24
  define( 'IMAGIFY_PATH' , realpath( plugin_dir_path( IMAGIFY_FILE ) ) . '/' );
45
  * @since 1.0
46
  */
47
  function _imagify_init() {
48
+ global $wp_version;
49
+
50
  // Load translations.
51
  load_plugin_textdomain( 'imagify', false, dirname( plugin_basename( IMAGIFY_FILE ) ) . '/languages/' );
52
 
53
+ // Check WordPress version.
54
+ if ( version_compare( $wp_version, IMAGIFY_WP_MIN ) < 0 ) {
55
+ add_action( 'all_admin_notices', 'imagify_wp_version_notice' );
56
+ return;
57
+ }
58
+
59
  // Nothing to do if autosave.
60
  if ( defined( 'DOING_AUTOSAVE' ) ) {
61
  return;
62
  }
63
 
64
+ require IMAGIFY_FUNCTIONS_PATH . 'compat.php';
65
+ require IMAGIFY_FUNCTIONS_PATH . 'deprecated.php';
66
+ require IMAGIFY_FUNCTIONS_PATH . 'common.php';
67
 
68
  // Register classes.
69
  spl_autoload_register( 'imagify_autoload' );
70
 
71
+ require IMAGIFY_FUNCTIONS_PATH . 'options.php';
72
+ require IMAGIFY_FUNCTIONS_PATH . 'formatting.php';
73
+ require IMAGIFY_FUNCTIONS_PATH . 'admin.php';
74
+ require IMAGIFY_FUNCTIONS_PATH . 'api.php';
75
+ require IMAGIFY_FUNCTIONS_PATH . 'attachments.php';
76
+ require IMAGIFY_FUNCTIONS_PATH . 'process.php';
77
+ require IMAGIFY_FUNCTIONS_PATH . 'admin-ui.php';
78
+ require IMAGIFY_FUNCTIONS_PATH . 'admin-stats.php';
79
+ require IMAGIFY_FUNCTIONS_PATH . 'i18n.php';
80
+ require IMAGIFY_FUNCTIONS_PATH . 'partners.php';
81
+ require IMAGIFY_COMMON_PATH . 'attachments.php';
82
+ require IMAGIFY_COMMON_PATH . 'admin-bar.php';
83
+ require IMAGIFY_COMMON_PATH . 'partners.php';
84
+ require IMAGIFY_3RD_PARTY_PATH . '3rd-party.php';
85
 
86
  Imagify_Options::get_instance()->init();
87
  Imagify_Data::get_instance()->init();
92
  Imagify_Cron_Sync_Files::get_instance()->init();
93
 
94
  if ( is_admin() ) {
95
+ require IMAGIFY_ADMIN_PATH . 'upgrader.php';
96
+ require IMAGIFY_ADMIN_PATH . 'heartbeat.php';
97
+ require IMAGIFY_ADMIN_PATH . 'upload.php';
98
+ require IMAGIFY_ADMIN_PATH . 'media.php';
99
+ require IMAGIFY_ADMIN_PATH . 'meta-boxes.php';
100
+ require IMAGIFY_ADMIN_PATH . 'custom-folders.php';
101
 
102
  Imagify_Notices::get_instance()->init();
103
  Imagify_Admin_Ajax_Post::get_instance()->init();
116
  */
117
  do_action( 'imagify_loaded' );
118
  }
119
+
120
+
121
+ /**
122
+ * Display an admin notice informing that the current WP version is lower than the required one.
123
+ *
124
+ * @since 1.8.1
125
+ * @author Grégory Viguier
126
+ */
127
+ function imagify_wp_version_notice() {
128
+ global $wp_version;
129
+
130
+ if ( is_multisite() ) {
131
+ if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
132
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
133
+ }
134
+
135
+ $is_active = is_plugin_active_for_network( plugin_basename( IMAGIFY_FILE ) );
136
+ $capacity = $is_active ? 'manage_network_options' : 'manage_options';
137
+ } else {
138
+ $capacity = 'manage_options';
139
+ }
140
+
141
+ if ( ! current_user_can( $capacity ) ) {
142
+ return;
143
+ }
144
+
145
+ echo '<div class="error notice"><p>';
146
+ echo '<strong>' . __( 'Notice:', 'imagify' ) . '</strong> ';
147
+ /* translators: 1 is this plugin name, 2 is the required WP version, 3 is the current WP version. */
148
+ printf( __( '%1$s requires WordPress %2$s minimum, your website is actually running version %3$s.', 'imagify' ), '<strong>Imagify</strong>', '<code>' . IMAGIFY_WP_MIN . '</code>', '<code>' . $wp_version . '</code>' );
149
+ echo '</p></div>';
150
+ }
inc/3rd-party/3rd-party.php CHANGED
@@ -4,19 +4,19 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
4
  /**
5
  * Plugins.
6
  */
7
- require( IMAGIFY_3RD_PARTY_PATH . 'amazon-s3-and-cloudfront/amazon-s3-and-cloudfront.php' );
8
- require( IMAGIFY_3RD_PARTY_PATH . 'enable-media-replace/enable-media-replace.php' );
9
- require( IMAGIFY_3RD_PARTY_PATH . 'formidable-pro/formidable-pro.php' );
10
- require( IMAGIFY_3RD_PARTY_PATH . 'nextgen-gallery/nextgen-gallery.php' );
11
- require( IMAGIFY_3RD_PARTY_PATH . 'regenerate-thumbnails/regenerate-thumbnails.php' );
12
- require( IMAGIFY_3RD_PARTY_PATH . 'wp-retina-2x/wp-retina-2x.php' );
13
- require( IMAGIFY_3RD_PARTY_PATH . 'screets-lc.php' );
14
- require( IMAGIFY_3RD_PARTY_PATH . 'wp-real-media-library.php' );
15
- require( IMAGIFY_3RD_PARTY_PATH . 'wp-rocket.php' );
16
- require( IMAGIFY_3RD_PARTY_PATH . 'yoast-seo.php' );
17
 
18
  /**
19
  * Hosting.
20
  */
21
- require( IMAGIFY_3RD_PARTY_PATH . 'hosting/siteground.php' );
22
- require( IMAGIFY_3RD_PARTY_PATH . 'hosting/wpengine.php' );
4
  /**
5
  * Plugins.
6
  */
7
+ require IMAGIFY_3RD_PARTY_PATH . 'amazon-s3-and-cloudfront/amazon-s3-and-cloudfront.php';
8
+ require IMAGIFY_3RD_PARTY_PATH . 'enable-media-replace/enable-media-replace.php';
9
+ require IMAGIFY_3RD_PARTY_PATH . 'formidable-pro/formidable-pro.php';
10
+ require IMAGIFY_3RD_PARTY_PATH . 'nextgen-gallery/nextgen-gallery.php';
11
+ require IMAGIFY_3RD_PARTY_PATH . 'regenerate-thumbnails/regenerate-thumbnails.php';
12
+ require IMAGIFY_3RD_PARTY_PATH . 'wp-retina-2x/wp-retina-2x.php';
13
+ require IMAGIFY_3RD_PARTY_PATH . 'screets-lc.php';
14
+ require IMAGIFY_3RD_PARTY_PATH . 'wp-real-media-library.php';
15
+ require IMAGIFY_3RD_PARTY_PATH . 'wp-rocket.php';
16
+ require IMAGIFY_3RD_PARTY_PATH . 'yoast-seo.php';
17
 
18
  /**
19
  * Hosting.
20
  */
21
+ require IMAGIFY_3RD_PARTY_PATH . 'hosting/siteground.php';
22
+ require IMAGIFY_3RD_PARTY_PATH . 'hosting/wpengine.php';
inc/3rd-party/amazon-s3-and-cloudfront/inc/classes/class-imagify-as3cf-attachment.php CHANGED
@@ -560,7 +560,7 @@ class Imagify_AS3CF_Attachment extends Imagify_Attachment {
560
  }
561
 
562
  if ( ! function_exists( 'wp_generate_attachment_metadata' ) ) {
563
- require_once( ABSPATH . 'wp-admin/includes/image.php' );
564
  }
565
 
566
  // Generate new thumbnails and new metadata.
560
  }
561
 
562
  if ( ! function_exists( 'wp_generate_attachment_metadata' ) ) {
563
+ require_once ABSPATH . 'wp-admin/includes/image.php';
564
  }
565
 
566
  // Generate new thumbnails and new metadata.
inc/3rd-party/amazon-s3-and-cloudfront/inc/classes/class-imagify-as3cf.php CHANGED
File without changes
inc/3rd-party/hosting/siteground.php CHANGED
File without changes
inc/3rd-party/hosting/wpengine.php CHANGED
File without changes
inc/3rd-party/nextgen-gallery/inc/admin/ajax.php CHANGED
File without changes
inc/3rd-party/nextgen-gallery/inc/admin/bulk.php CHANGED
File without changes
inc/3rd-party/nextgen-gallery/inc/admin/enqueue.php CHANGED
File without changes
inc/3rd-party/nextgen-gallery/inc/admin/gallery.php CHANGED
File without changes
inc/3rd-party/nextgen-gallery/inc/admin/heartbeat.php CHANGED
File without changes
inc/3rd-party/nextgen-gallery/inc/admin/menu.php CHANGED
File without changes
inc/3rd-party/nextgen-gallery/inc/classes/class-imagify-ngg-attachment.php CHANGED
@@ -252,7 +252,10 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
252
  }
253
 
254
  if ( ! $this->is_valid() ) {
255
- $this->file_type = (object) array( 'ext' => '', 'type' => '' );
 
 
 
256
  return $this->file_type;
257
  }
258
 
@@ -841,7 +844,7 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
841
  $thumbnails_data = array();
842
 
843
  // 4- Common meta data.
844
- require_once( NGGALLERY_ABSPATH . '/lib/meta.php' );
845
  $meta_obj = new nggMeta( $image_data );
846
  $common_data = $meta_obj->get_common_meta();
847
 
252
  }
253
 
254
  if ( ! $this->is_valid() ) {
255
+ $this->file_type = (object) array(
256
+ 'ext' => '',
257
+ 'type' => '',
258
+ );
259
  return $this->file_type;
260
  }
261
 
844
  $thumbnails_data = array();
845
 
846
  // 4- Common meta data.
847
+ require_once NGGALLERY_ABSPATH . '/lib/meta.php';
848
  $meta_obj = new nggMeta( $image_data );
849
  $common_data = $meta_obj->get_common_meta();
850
 
inc/3rd-party/nextgen-gallery/inc/classes/class-imagify-ngg-db.php CHANGED
File without changes
inc/3rd-party/nextgen-gallery/inc/classes/class-imagify-ngg-dynamic-thumbnails-background-process.php CHANGED
@@ -7,7 +7,7 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
7
  * @since 1.8
8
  * @author Grégory Viguier
9
  */
10
- class Imagify_NGG_Dynamic_Thumbnails_Background_Process extends WP_Background_Process {
11
 
12
  /**
13
  * Class version.
@@ -16,17 +16,7 @@ class Imagify_NGG_Dynamic_Thumbnails_Background_Process extends WP_Background_Pr
16
  * @since 1.8
17
  * @author Grégory Viguier
18
  */
19
- const VERSION = '1.0';
20
-
21
- /**
22
- * Prefix used to build the global process identifier.
23
- *
24
- * @var string
25
- * @since 1.8
26
- * @access protected
27
- * @author Grégory Viguier
28
- */
29
- protected $prefix = 'imagify';
30
 
31
  /**
32
  * Action.
7
  * @since 1.8
8
  * @author Grégory Viguier
9
  */
10
+ class Imagify_NGG_Dynamic_Thumbnails_Background_Process extends Imagify_Abstract_Background_Process {
11
 
12
  /**
13
  * Class version.
16
  * @since 1.8
17
  * @author Grégory Viguier
18
  */
19
+ const VERSION = '1.1';
 
 
 
 
 
 
 
 
 
 
20
 
21
  /**
22
  * Action.
inc/3rd-party/nextgen-gallery/inc/common/attachments.php CHANGED
File without changes
inc/3rd-party/nextgen-gallery/inc/functions/admin-stats.php CHANGED
File without changes
inc/3rd-party/nextgen-gallery/inc/functions/attachments.php CHANGED
File without changes
inc/3rd-party/nextgen-gallery/inc/functions/common.php CHANGED
File without changes
inc/3rd-party/nextgen-gallery/nextgen-gallery.php CHANGED
@@ -12,20 +12,20 @@ define( 'IMAGIFY_NGG_ADMIN_PATH' , realpath( IMAGIFY_NGG_INC_PATH . 'admin' )
12
  define( 'IMAGIFY_NGG_COMMON_PATH' , realpath( IMAGIFY_NGG_INC_PATH . 'common' ) . '/' );
13
  define( 'IMAGIFY_NGG_FUNCTIONS_PATH', realpath( IMAGIFY_NGG_INC_PATH . 'functions' ) . '/' );
14
 
15
- require( IMAGIFY_NGG_FUNCTIONS_PATH . 'admin-stats.php' );
16
- require( IMAGIFY_NGG_FUNCTIONS_PATH . 'attachments.php' );
17
- require( IMAGIFY_NGG_FUNCTIONS_PATH . 'common.php' );
18
- require( IMAGIFY_NGG_COMMON_PATH . 'attachments.php' );
19
 
20
  Imagify_NGG::get_instance()->init();
21
  Imagify_NGG_DB::get_instance()->init();
22
- Imagify_NGG_Dynamic_Thumbnails_Background_Process::get_instance();
23
 
24
  if ( is_admin() ) {
25
- require( IMAGIFY_NGG_ADMIN_PATH . 'enqueue.php' );
26
- require( IMAGIFY_NGG_ADMIN_PATH . 'ajax.php' );
27
- require( IMAGIFY_NGG_ADMIN_PATH . 'menu.php' );
28
- require( IMAGIFY_NGG_ADMIN_PATH . 'gallery.php' );
29
- require( IMAGIFY_NGG_ADMIN_PATH . 'bulk.php' );
30
- require( IMAGIFY_NGG_ADMIN_PATH . 'heartbeat.php' );
31
  }
12
  define( 'IMAGIFY_NGG_COMMON_PATH' , realpath( IMAGIFY_NGG_INC_PATH . 'common' ) . '/' );
13
  define( 'IMAGIFY_NGG_FUNCTIONS_PATH', realpath( IMAGIFY_NGG_INC_PATH . 'functions' ) . '/' );
14
 
15
+ require IMAGIFY_NGG_FUNCTIONS_PATH . 'admin-stats.php';
16
+ require IMAGIFY_NGG_FUNCTIONS_PATH . 'attachments.php';
17
+ require IMAGIFY_NGG_FUNCTIONS_PATH . 'common.php';
18
+ require IMAGIFY_NGG_COMMON_PATH . 'attachments.php';
19
 
20
  Imagify_NGG::get_instance()->init();
21
  Imagify_NGG_DB::get_instance()->init();
22
+ Imagify_NGG_Dynamic_Thumbnails_Background_Process::get_instance()->init();
23
 
24
  if ( is_admin() ) {
25
+ require IMAGIFY_NGG_ADMIN_PATH . 'enqueue.php';
26
+ require IMAGIFY_NGG_ADMIN_PATH . 'ajax.php';
27
+ require IMAGIFY_NGG_ADMIN_PATH . 'menu.php';
28
+ require IMAGIFY_NGG_ADMIN_PATH . 'gallery.php';
29
+ require IMAGIFY_NGG_ADMIN_PATH . 'bulk.php';
30
+ require IMAGIFY_NGG_ADMIN_PATH . 'heartbeat.php';
31
  }
inc/3rd-party/regenerate-thumbnails/inc/classes/class-imagify-regenerate-thumbnails.php CHANGED
File without changes
inc/3rd-party/wp-retina-2x/inc/classes/class-imagify-wp-retina-2x-core.php CHANGED
File without changes
inc/3rd-party/wp-retina-2x/inc/classes/class-imagify-wp-retina-2x.php CHANGED
File without changes
inc/3rd-party/wp-rocket.php CHANGED
File without changes
inc/admin/custom-folders.php CHANGED
File without changes
inc/admin/meta-boxes.php CHANGED
@@ -33,7 +33,7 @@ function _imagify_attachment_submitbox_misc_actions() {
33
  echo '<a href="' . esc_url( get_imagify_admin_url() ) . '">' . __( 'Check your Settings', 'imagify' ) . '</a>';
34
  echo '</div>';
35
 
36
- } elseif ( $attachment->is_optimized() || $attachment->has_error() ) {
37
 
38
  echo '<div class="misc-pub-section misc-pub-imagify"><h4>' . __( 'Imagify', 'imagify' ) . '</h4></div>';
39
  echo get_imagify_attachment_optimization_text( $attachment );
33
  echo '<a href="' . esc_url( get_imagify_admin_url() ) . '">' . __( 'Check your Settings', 'imagify' ) . '</a>';
34
  echo '</div>';
35
 
36
+ } elseif ( $attachment->is_optimized() || $attachment->is_already_optimized() || $attachment->has_error() ) {
37
 
38
  echo '<div class="misc-pub-section misc-pub-imagify"><h4>' . __( 'Imagify', 'imagify' ) . '</h4></div>';
39
  echo get_imagify_attachment_optimization_text( $attachment );
inc/admin/upgrader.php CHANGED
@@ -253,7 +253,7 @@ function _imagify_new_upgrade( $network_version, $site_version ) {
253
  // 1.4.5
254
  if ( version_compare( $site_version, '1.4.5' ) < 0 ) {
255
  // Delete all transients used for async optimization.
256
- $wpdb->query( 'DELETE from ' . $wpdb->options . ' WHERE option_name LIKE "_transient_imagify-async-in-progress-%"' );
257
  }
258
 
259
  // 1.7
@@ -269,6 +269,22 @@ function _imagify_new_upgrade( $network_version, $site_version ) {
269
  // Rename the option that stores the NGG table version. Since the table is also updated in 1.7, let's simply delete the option.
270
  delete_option( $wpdb->prefix . 'ngg_imagify_data_db_version' );
271
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  }
273
 
274
  add_action( 'upgrader_process_complete', 'imagify_maybe_reset_opcache', 20, 2 );
@@ -290,7 +306,6 @@ add_action( 'upgrader_process_complete', 'imagify_maybe_reset_opcache', 20, 2 );
290
  */
291
  function imagify_maybe_reset_opcache( $wp_upgrader, $hook_extra ) {
292
  static $imagify_path;
293
- static $can_reset;
294
 
295
  if ( ! isset( $hook_extra['action'], $hook_extra['type'], $hook_extra['plugins'] ) ) {
296
  return;
@@ -310,21 +325,37 @@ function imagify_maybe_reset_opcache( $wp_upgrader, $hook_extra ) {
310
  return;
311
  }
312
 
313
- if ( ! isset( $can_reset ) ) {
314
- $can_reset = true;
315
 
 
 
 
 
 
 
 
 
 
 
316
  if ( ! function_exists( 'opcache_reset' ) ) {
317
  $can_reset = false;
 
318
  }
319
 
320
  $restrict_api = ini_get( 'opcache.restrict_api' );
321
 
322
  if ( $restrict_api && strpos( __FILE__, $restrict_api ) !== 0 ) {
323
  $can_reset = false;
 
324
  }
 
 
325
  }
326
 
327
- if ( $can_reset ) {
328
- opcache_reset();
329
  }
 
 
330
  }
253
  // 1.4.5
254
  if ( version_compare( $site_version, '1.4.5' ) < 0 ) {
255
  // Delete all transients used for async optimization.
256
+ $wpdb->query( $wpdb->prepare( "DELETE from $wpdb->options WHERE option_name LIKE %s", Imagify_DB::esc_like( '_transient_imagify-async-in-progress-' ) . '%' ) );
257
  }
258
 
259
  // 1.7
269
  // Rename the option that stores the NGG table version. Since the table is also updated in 1.7, let's simply delete the option.
270
  delete_option( $wpdb->prefix . 'ngg_imagify_data_db_version' );
271
  }
272
+
273
+ // 1.8.1
274
+ if ( version_compare( $site_version, '1.8.1' ) < 0 ) {
275
+ // Custom folders: replace `{{ABSPATH}}/` by `{{ROOT}}/`.
276
+ $filesystem = imagify_get_filesystem();
277
+ $replacement = '{{ROOT}}/';
278
+
279
+ if ( $filesystem->has_wp_its_own_directory() ) {
280
+ $replacement .= str_replace( $filesystem->get_site_root(), '', $filesystem->get_abspath() );
281
+ }
282
+
283
+ $replacement = Imagify_DB::esc_like( $replacement );
284
+
285
+ $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->base_prefix}imagify_files SET path = REPLACE( path, '{{ABSPATH}}/', %s ) WHERE path LIKE %s", $replacement, '{{ABSPATH}}/%' ) );
286
+ $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->base_prefix}imagify_folders SET path = REPLACE( path, '{{ABSPATH}}/', %s ) WHERE path LIKE %s", $replacement, '{{ABSPATH}}/%' ) );
287
+ }
288
  }
289
 
290
  add_action( 'upgrader_process_complete', 'imagify_maybe_reset_opcache', 20, 2 );
306
  */
307
  function imagify_maybe_reset_opcache( $wp_upgrader, $hook_extra ) {
308
  static $imagify_path;
 
309
 
310
  if ( ! isset( $hook_extra['action'], $hook_extra['type'], $hook_extra['plugins'] ) ) {
311
  return;
325
  return;
326
  }
327
 
328
+ imagify_reset_opcache();
329
+ }
330
 
331
+ /**
332
+ * Reset PHP opcache.
333
+ *
334
+ * @since 1.8.1
335
+ * @author Grégory Viguier
336
+ */
337
+ function imagify_reset_opcache() {
338
+ static $can_reset;
339
+
340
+ if ( ! isset( $can_reset ) ) {
341
  if ( ! function_exists( 'opcache_reset' ) ) {
342
  $can_reset = false;
343
+ return;
344
  }
345
 
346
  $restrict_api = ini_get( 'opcache.restrict_api' );
347
 
348
  if ( $restrict_api && strpos( __FILE__, $restrict_api ) !== 0 ) {
349
  $can_reset = false;
350
+ return;
351
  }
352
+
353
+ $can_reset = true;
354
  }
355
 
356
+ if ( ! $can_reset ) {
357
+ return;
358
  }
359
+
360
+ opcache_reset();
361
  }
inc/admin/upload.php CHANGED
@@ -56,14 +56,14 @@ function _imagify_attachments_filter_dropdown() {
56
  $errors = imagify_count_error_attachments();
57
  $status = isset( $_GET['imagify-status'] ) ? $_GET['imagify-status'] : 0; // WPCS: CSRF ok.
58
  $options = array(
59
- 'optimized' => _x( 'Optimized', 'Media Files','imagify' ),
60
- 'unoptimized' => _x( 'Unoptimized', 'Media Files','imagify' ),
61
- 'errors' => _x( 'Errors', 'Media Files','imagify' ),
62
  );
63
 
64
- echo '<label class="screen-reader-text" for="filter-by-optimization-status">' . __( 'Filter by status','imagify' ) . '</label>';
65
  echo '<select id="filter-by-optimization-status" name="imagify-status">';
66
- echo '<option value="0" selected="selected">' . __( 'All Media Files','imagify' ) . '</option>';
67
 
68
  foreach ( $options as $value => $label ) {
69
  echo '<option value="' . $value . '" ' . selected( $status, $value, false ) . '>' . $label . ' (' . ${$value} . ')</option>';
56
  $errors = imagify_count_error_attachments();
57
  $status = isset( $_GET['imagify-status'] ) ? $_GET['imagify-status'] : 0; // WPCS: CSRF ok.
58
  $options = array(
59
+ 'optimized' => _x( 'Optimized', 'Media Files', 'imagify' ),
60
+ 'unoptimized' => _x( 'Unoptimized', 'Media Files', 'imagify' ),
61
+ 'errors' => _x( 'Errors', 'Media Files', 'imagify' ),
62
  );
63
 
64
+ echo '<label class="screen-reader-text" for="filter-by-optimization-status">' . __( 'Filter by status', 'imagify' ) . '</label>';
65
  echo '<select id="filter-by-optimization-status" name="imagify-status">';
66
+ echo '<option value="0" selected="selected">' . __( 'All Media Files', 'imagify' ) . '</option>';
67
 
68
  foreach ( $options as $value => $label ) {
69
  echo '<option value="' . $value . '" ' . selected( $status, $value, false ) . '>' . $label . ' (' . ${$value} . ')</option>';
inc/classes/class-imagify-abstract-attachment.php CHANGED
@@ -452,14 +452,20 @@ abstract class Imagify_Abstract_Attachment extends Imagify_Abstract_Attachment_D
452
  }
453
 
454
  if ( ! $this->is_valid() ) {
455
- $this->file_type = (object) array( 'ext' => '', 'type' => '' );
 
 
 
456
  return $this->file_type;
457
  }
458
 
459
  $path = $this->get_original_path();
460
 
461
  if ( ! $path ) {
462
- $this->file_type = (object) array( 'ext' => '', 'type' => '' );
 
 
 
463
  return $this->file_type;
464
  }
465
 
@@ -859,7 +865,7 @@ abstract class Imagify_Abstract_Attachment extends Imagify_Abstract_Attachment_D
859
  *
860
  * @return array Data for the registered thumbnail sizes.
861
  */
862
- static public function get_registered_sizes() {
863
  static $registered_sizes;
864
 
865
  if ( ! isset( $registered_sizes ) ) {
@@ -1024,17 +1030,13 @@ abstract class Imagify_Abstract_Attachment extends Imagify_Abstract_Attachment_D
1024
  return '';
1025
  }
1026
 
1027
- // Prevent removal of the exif/meta data when resizing (only works with Imagick).
1028
- add_filter( 'image_strip_meta', '__return_false' );
1029
-
1030
- $new_sizes = wp_constrain_dimensions( $attachment_sizes['width'], $attachment_sizes['height'], $max_width );
1031
-
1032
  $editor = $this->get_editor( $attachment_path );
1033
 
1034
  if ( is_wp_error( $editor ) ) {
1035
  return $editor;
1036
  }
1037
 
 
1038
  $image_type = strtolower( (string) $this->filesystem->path_info( $attachment_path, 'extension' ) );
1039
 
1040
  // Try to correct for auto-rotation if the info is available.
@@ -1054,8 +1056,14 @@ abstract class Imagify_Abstract_Attachment extends Imagify_Abstract_Attachment_D
1054
  }
1055
  }
1056
 
 
 
 
1057
  $resized = $editor->resize( $new_sizes[0], $new_sizes[1], false );
1058
 
 
 
 
1059
  if ( is_wp_error( $resized ) ) {
1060
  return $resized;
1061
  }
@@ -1067,9 +1075,6 @@ abstract class Imagify_Abstract_Attachment extends Imagify_Abstract_Attachment_D
1067
  return $resized_image_saved;
1068
  }
1069
 
1070
- // Remove the filter when we're done to prevent any conflict.
1071
- remove_filter( 'image_strip_meta', '__return_false' );
1072
-
1073
  return $resized_image_path;
1074
  }
1075
 
452
  }
453
 
454
  if ( ! $this->is_valid() ) {
455
+ $this->file_type = (object) array(
456
+ 'ext' => '',
457
+ 'type' => '',
458
+ );
459
  return $this->file_type;
460
  }
461
 
462
  $path = $this->get_original_path();
463
 
464
  if ( ! $path ) {
465
+ $this->file_type = (object) array(
466
+ 'ext' => '',
467
+ 'type' => '',
468
+ );
469
  return $this->file_type;
470
  }
471
 
865
  *
866
  * @return array Data for the registered thumbnail sizes.
867
  */
868
+ public static function get_registered_sizes() {
869
  static $registered_sizes;
870
 
871
  if ( ! isset( $registered_sizes ) ) {
1030
  return '';
1031
  }
1032
 
 
 
 
 
 
1033
  $editor = $this->get_editor( $attachment_path );
1034
 
1035
  if ( is_wp_error( $editor ) ) {
1036
  return $editor;
1037
  }
1038
 
1039
+ $new_sizes = wp_constrain_dimensions( $attachment_sizes['width'], $attachment_sizes['height'], $max_width );
1040
  $image_type = strtolower( (string) $this->filesystem->path_info( $attachment_path, 'extension' ) );
1041
 
1042
  // Try to correct for auto-rotation if the info is available.
1056
  }
1057
  }
1058
 
1059
+ // Prevent removal of the exif data when resizing (only works with Imagick).
1060
+ add_filter( 'image_strip_meta', '__return_false', 789 );
1061
+
1062
  $resized = $editor->resize( $new_sizes[0], $new_sizes[1], false );
1063
 
1064
+ // Remove the filter when we're done to prevent any conflict.
1065
+ remove_filter( 'image_strip_meta', '__return_false', 789 );
1066
+
1067
  if ( is_wp_error( $resized ) ) {
1068
  return $resized;
1069
  }
1075
  return $resized_image_saved;
1076
  }
1077
 
 
 
 
1078
  return $resized_image_path;
1079
  }
1080
 
inc/classes/class-imagify-abstract-background-process.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
3
+
4
+ /**
5
+ * Class handling background processes.
6
+ *
7
+ * @since 1.8.1
8
+ * @author Grégory Viguier
9
+ */
10
+ abstract class Imagify_Abstract_Background_Process extends WP_Background_Process {
11
+
12
+ /**
13
+ * Class version.
14
+ *
15
+ * @var string
16
+ * @since 1.8.1
17
+ * @author Grégory Viguier
18
+ */
19
+ const VERSION = '1.0';
20
+
21
+ /**
22
+ * Prefix used to build the global process identifier.
23
+ *
24
+ * @var string
25
+ * @since 1.8.1
26
+ * @access protected
27
+ * @author Grégory Viguier
28
+ */
29
+ protected $prefix = 'imagify';
30
+
31
+ /**
32
+ * The single instance of the class.
33
+ *
34
+ * @var object
35
+ * @since 1.8.1
36
+ * @access protected
37
+ * @author Grégory Viguier
38
+ */
39
+ protected static $_instance;
40
+
41
+
42
+ /**
43
+ * Get the main Instance.
44
+ *
45
+ * @since 1.8.1
46
+ * @access public
47
+ * @author Grégory Viguier
48
+ *
49
+ * @return object Main instance.
50
+ */
51
+ public static function get_instance() {
52
+ if ( ! isset( self::$_instance ) ) {
53
+ self::$_instance = new self();
54
+ }
55
+
56
+ return self::$_instance;
57
+ }
58
+
59
+ /**
60
+ * Init: launch a hook that will clear the scheduled events and empty the queue when the plugin is disabled.
61
+ * This is only a precaution in case something went wrong.
62
+ *
63
+ * @since 1.8.1
64
+ * @author Grégory Viguier
65
+ */
66
+ public function init() {
67
+ if ( did_action( self::get_deactivation_hook_name() ) ) {
68
+ $this->cancel_process();
69
+ } else {
70
+ add_action( self::get_deactivation_hook_name(), array( $this, 'cancel_process' ) );
71
+ }
72
+ }
73
+
74
+
75
+ /** ----------------------------------------------------------------------------------------- */
76
+ /** COMPAT ================================================================================== */
77
+ /** ----------------------------------------------------------------------------------------- */
78
+
79
+ /**
80
+ * Cancel Process.
81
+ * Stop processing queue items, clear cronjob and delete batch.
82
+ * This is a copy of the parent's method, in case an older version of WP_Background_Process is loaded instead of this one (an old version without this method).
83
+ *
84
+ * @since 1.8.1
85
+ * @access public
86
+ * @author Grégory Viguier
87
+ */
88
+ public function cancel_process() {
89
+ if ( method_exists( $this, 'cancel_process' ) ) {
90
+ parent::cancel_process();
91
+ return;
92
+ }
93
+
94
+ if ( ! $this->is_queue_empty() ) {
95
+ $batch = $this->get_batch();
96
+
97
+ $this->delete( $batch->key );
98
+
99
+ wp_clear_scheduled_hook( $this->get_event_name() );
100
+ }
101
+ }
102
+
103
+
104
+ /** ----------------------------------------------------------------------------------------- */
105
+ /** TOOLS =================================================================================== */
106
+ /** ----------------------------------------------------------------------------------------- */
107
+
108
+ /**
109
+ * Get the cron name.
110
+ *
111
+ * @since 1.8.1
112
+ * @access public
113
+ * @author Grégory Viguier
114
+ *
115
+ * @return string
116
+ */
117
+ public function get_event_name() {
118
+ return $this->cron_hook_identifier;
119
+ }
120
+
121
+ /**
122
+ * Get the cron name.
123
+ *
124
+ * @since 1.8.1
125
+ * @access public
126
+ * @author Grégory Viguier
127
+ *
128
+ * @return string
129
+ */
130
+ public static function get_deactivation_hook_name() {
131
+ static $deactivation_hook;
132
+
133
+ if ( ! isset( $deactivation_hook ) ) {
134
+ $deactivation_hook = 'deactivate_' . plugin_basename( IMAGIFY_FILE );
135
+ }
136
+
137
+ return $deactivation_hook;
138
+ }
139
+ }
inc/classes/class-imagify-abstract-cron.php CHANGED
@@ -267,7 +267,7 @@ abstract class Imagify_Abstract_Cron {
267
  *
268
  * @return int Timestamp.
269
  */
270
- static public function get_next_timestamp( $event_time = '00:00' ) {
271
  $current_time_int = (int) date( 'Gis' );
272
  $event_time_int = (int) str_replace( ':', '', $event_time . '00' );
273
  $event_time = explode( ':', $event_time );
267
  *
268
  * @return int Timestamp.
269
  */
270
+ public static function get_next_timestamp( $event_time = '00:00' ) {
271
  $current_time_int = (int) date( 'Gis' );
272
  $event_time_int = (int) str_replace( ':', '', $event_time . '00' );
273
  $event_time = explode( ':', $event_time );
inc/classes/class-imagify-abstract-db.php CHANGED
@@ -256,7 +256,7 @@ abstract class Imagify_Abstract_DB extends Imagify_Abstract_DB_Deprecated {
256
  $placeholder = $this->get_placeholder( $column_where );
257
  $column_where = esc_sql( $column_where );
258
 
259
- $result = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $column_where = $placeholder LIMIT 1;", $column_value ), ARRAY_A ); // WPCS: unprepared SQL ok.
260
 
261
  return (array) $this->cast_row( $result );
262
  }
@@ -323,7 +323,7 @@ abstract class Imagify_Abstract_DB extends Imagify_Abstract_DB_Deprecated {
323
  $column = esc_sql( $column_select );
324
  $column_where = esc_sql( $column_where );
325
 
326
- $result = $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $column_where = $placeholder LIMIT 1;", $column_value ) ); // WPCS: unprepared SQL ok.
327
 
328
  return $this->cast( $result, $column_select );
329
  }
@@ -499,7 +499,7 @@ abstract class Imagify_Abstract_DB extends Imagify_Abstract_DB_Deprecated {
499
 
500
  $placeholder = $this->get_placeholder( $this->primary_key );
501
 
502
- return (bool) $wpdb->query( $wpdb->prepare( "DELETE FROM $this->table_name WHERE $this->primary_key = $placeholder", $row_id ) ); // WPCS: unprepared SQL ok.
503
  }
504
 
505
 
256
  $placeholder = $this->get_placeholder( $column_where );
257
  $column_where = esc_sql( $column_where );
258
 
259
+ $result = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $column_where = $placeholder LIMIT 1;", $column_value ), ARRAY_A ); // WPCS: unprepared SQL ok, PreparedSQLPlaceholders replacement count ok.
260
 
261
  return (array) $this->cast_row( $result );
262
  }
323
  $column = esc_sql( $column_select );
324
  $column_where = esc_sql( $column_where );
325
 
326
+ $result = $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $column_where = $placeholder LIMIT 1;", $column_value ) ); // WPCS: unprepared SQL ok, PreparedSQLPlaceholders replacement count ok.
327
 
328
  return $this->cast( $result, $column_select );
329
  }
499
 
500
  $placeholder = $this->get_placeholder( $this->primary_key );
501
 
502
+ return (bool) $wpdb->query( $wpdb->prepare( "DELETE FROM $this->table_name WHERE $this->primary_key = $placeholder", $row_id ) ); // WPCS: unprepared SQL ok, PreparedSQLPlaceholders replacement count ok.
503
  }
504
 
505
 
inc/classes/class-imagify-abstract-options.php CHANGED
File without changes
inc/classes/class-imagify-admin-ajax-post.php CHANGED
@@ -16,7 +16,7 @@ class Imagify_Admin_Ajax_Post {
16
  * @since 1.6.11
17
  * @author Grégory Viguier
18
  */
19
- const VERSION = '1.0.4';
20
 
21
  /**
22
  * Actions to be triggered on admin ajax and admin post.
@@ -287,7 +287,10 @@ class Imagify_Admin_Ajax_Post {
287
  imagify_maybe_redirect();
288
 
289
  // Return the optimization button.
290
- $output = get_imagify_admin_url( 'manual-upload', array( 'attachment_id' => $attachment->id, 'context' => $context ) );
 
 
 
291
  $output = '<a id="imagify-upload-' . $attachment->id . '" href="' . esc_url( $output ) . '" class="button-primary button-imagify-manual-upload" data-waiting-label="' . esc_attr__( 'Optimizing...', 'imagify' ) . '">' . __( 'Optimize', 'imagify' ) . '</a>';
292
  wp_send_json_success( $output );
293
  }
@@ -377,7 +380,7 @@ class Imagify_Admin_Ajax_Post {
377
  imagify_check_nonce( 'imagify-bulk-upload' );
378
  imagify_check_user_capacity( 'optimize-file' );
379
 
380
- $file_id = (int) filter_input( INPUT_POST, 'image', FILTER_SANITIZE_NUMBER_INT );
381
  $context = imagify_sanitize_context( filter_input( INPUT_POST, 'context', FILTER_SANITIZE_STRING ) );
382
  $context = ! $context || 'wp' === strtolower( $context ) ? 'File' : $context;
383
 
@@ -553,7 +556,7 @@ class Imagify_Admin_Ajax_Post {
553
  imagify_check_nonce( 'imagify_scan_custom_folders' );
554
  imagify_check_user_capacity( 'optimize-file' );
555
 
556
- $folder = (int) filter_input( INPUT_GET, 'folder', FILTER_SANITIZE_NUMBER_INT );
557
 
558
  if ( $folder > 0 ) {
559
  // A specific custom folder (selected or not).
@@ -711,7 +714,7 @@ class Imagify_Admin_Ajax_Post {
711
  AND (
712
  mt1.meta_value = 'error'
713
  OR
714
- mt2.meta_value != '%d'
715
  OR
716
  mt2.post_id IS NULL
717
  )
@@ -1120,21 +1123,11 @@ class Imagify_Admin_Ajax_Post {
1120
  imagify_check_user_capacity();
1121
 
1122
  $user = new Imagify_User();
1123
- $unconsumed_quota = $user->get_percent_unconsumed_quota();
1124
- $meteo_icon = '<img src="' . IMAGIFY_ASSETS_IMG_URL . 'sun.svg" width="37" height="38" alt="" />';
1125
- $bar_class = 'positive';
1126
  $message = '';
1127
 
1128
- if ( $unconsumed_quota >= 21 && $unconsumed_quota <= 50 ) {
1129
- $bar_class = 'neutral';
1130
- $meteo_icon = '<img src="' . IMAGIFY_ASSETS_IMG_URL . 'cloudy-sun.svg" width="37" height="38" alt="" />';
1131
- }
1132
- elseif ( $unconsumed_quota <= 20 ) {
1133
- $bar_class = 'negative';
1134
- $meteo_icon = '<img src="' . IMAGIFY_ASSETS_IMG_URL . 'stormy.svg" width="38" height="36" alt="" />';
1135
- }
1136
-
1137
- if ( $unconsumed_quota <= 20 && $unconsumed_quota > 0 ) {
1138
  $message = '<div class="imagify-error">';
1139
  $message .= '<p><i class="dashicons dashicons-warning" aria-hidden="true"></i><strong>' . __( 'Oops, It\'s almost over!', 'imagify' ) . '</strong></p>';
1140
  /* translators: %s is a line break. */
@@ -1149,7 +1142,7 @@ class Imagify_Admin_Ajax_Post {
1149
  $message .= '<p>' . sprintf(
1150
  /* translators: 1 is a data quota, 2 is a date. */
1151
  __( 'You have consumed all your credit for this month. You will have <strong>%1$s back on %2$s</strong>.', 'imagify' ),
1152
- imagify_size_format( $user->quota * 1048576 ),
1153
  date_i18n( get_option( 'date_format' ), strtotime( $user->next_date_update ) )
1154
  ) . '</p>';
1155
  $message .= '<p class="center txt-center text-center"><a class="btn imagify-btn-ghost" href="' . esc_url( imagify_get_external_url( 'subscription' ) ) . '" target="_blank">' . __( 'Upgrade My Subscription', 'imagify' ) . '</a></p>';
@@ -1161,7 +1154,7 @@ class Imagify_Admin_Ajax_Post {
1161
  $quota_section .= '<div class="imagify-abq-row">';
1162
 
1163
  if ( 1 === $user->plan_id ) {
1164
- $quota_section .= '<div class="imagify-meteo-icon">' . $meteo_icon . '</div>';
1165
  }
1166
 
1167
  $quota_section .= '<div class="imagify-account">';
@@ -1175,9 +1168,9 @@ class Imagify_Admin_Ajax_Post {
1175
  $quota_section .= '<div class="imagify-space-left">';
1176
  /* translators: %s is a data quota. */
1177
  $quota_section .= '<p>' . sprintf( __( 'You have %s space credit left', 'imagify' ), '<span class="imagify-unconsumed-percent">' . $unconsumed_quota . '%</span>' ) . '</p>';
1178
- $quota_section .= '<div class="imagify-bar-' . $bar_class . '">';
1179
  $quota_section .= '<div style="width: ' . $unconsumed_quota . '%;" class="imagify-unconsumed-bar imagify-progress"></div>';
1180
- $quota_section .= '</div>'; // .imagify-bar-{$bar_class}
1181
  $quota_section .= '</div>'; // .imagify-space-left
1182
  $quota_section .= '</div>'; // .imagify-abq-row
1183
  }
@@ -1281,8 +1274,14 @@ class Imagify_Admin_Ajax_Post {
1281
  ) );
1282
 
1283
  wp_send_json_success( array(
1284
- 'total_library_size' => array( 'raw' => $raw_total_size_in_library, 'human' => imagify_size_format( $raw_total_size_in_library ) ),
1285
- 'average_month_size' => array( 'raw' => $raw_average_per_month, 'human' => imagify_size_format( $raw_average_per_month ) ),
 
 
 
 
 
 
1286
  ) );
1287
  }
1288
 
@@ -1355,7 +1354,7 @@ class Imagify_Admin_Ajax_Post {
1355
  }
1356
 
1357
  $folder = trailingslashit( sanitize_text_field( $_POST['folder'] ) );
1358
- $folder = realpath( $this->filesystem->get_abspath() . ltrim( $folder, '/' ) );
1359
 
1360
  if ( ! $folder ) {
1361
  imagify_die( __( 'This folder doesn\'t exist.', 'imagify' ) );
@@ -1376,13 +1375,13 @@ class Imagify_Admin_Ajax_Post {
1376
  $views = Imagify_Views::get_instance();
1377
  $output = '';
1378
 
1379
- if ( $this->filesystem->is_abspath( $folder ) ) {
1380
  $output .= $views->get_template( 'part-settings-files-tree-row', array(
1381
  'relative_path' => '/',
1382
  // Value #///# Label.
1383
- 'checkbox_value' => '{{ABSPATH}}/#///#' . esc_attr__( 'Site\'s root', 'imagify' ),
1384
  'checkbox_id' => 'ABSPATH',
1385
- 'checkbox_selected' => isset( $selected['{{ABSPATH}}/'] ),
1386
  'label' => __( 'Site\'s root', 'imagify' ),
1387
  'no_button' => true,
1388
  ) );
@@ -1418,7 +1417,7 @@ class Imagify_Admin_Ajax_Post {
1418
  }
1419
 
1420
  if ( ! $output ) {
1421
- $output .= '<li class="imagify-empty-folder"><em>' . __( 'Empty folder', 'imagify' ) . '</em></li>';
1422
  }
1423
 
1424
  wp_send_json_success( $output );
@@ -1515,7 +1514,7 @@ class Imagify_Admin_Ajax_Post {
1515
  * @return object A Imagify_File_Attachment object.
1516
  */
1517
  protected function get_file_to_optimize( $identifier ) {
1518
- $file_id = (int) filter_input( INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT );
1519
 
1520
  if ( ! $file_id ) {
1521
  imagify_die( __( 'Invalid request', 'imagify' ) );
16
  * @since 1.6.11
17
  * @author Grégory Viguier
18
  */
19
+ const VERSION = '1.0.6';
20
 
21
  /**
22
  * Actions to be triggered on admin ajax and admin post.
287
  imagify_maybe_redirect();
288
 
289
  // Return the optimization button.
290
+ $output = get_imagify_admin_url( 'manual-upload', array(
291
+ 'attachment_id' => $attachment->id,
292
+ 'context' => $context,
293
+ ) );
294
  $output = '<a id="imagify-upload-' . $attachment->id . '" href="' . esc_url( $output ) . '" class="button-primary button-imagify-manual-upload" data-waiting-label="' . esc_attr__( 'Optimizing...', 'imagify' ) . '">' . __( 'Optimize', 'imagify' ) . '</a>';
295
  wp_send_json_success( $output );
296
  }
380
  imagify_check_nonce( 'imagify-bulk-upload' );
381
  imagify_check_user_capacity( 'optimize-file' );
382
 
383
+ $file_id = filter_input( INPUT_POST, 'image', FILTER_VALIDATE_INT );
384
  $context = imagify_sanitize_context( filter_input( INPUT_POST, 'context', FILTER_SANITIZE_STRING ) );
385
  $context = ! $context || 'wp' === strtolower( $context ) ? 'File' : $context;
386
 
556
  imagify_check_nonce( 'imagify_scan_custom_folders' );
557
  imagify_check_user_capacity( 'optimize-file' );
558
 
559
+ $folder = filter_input( INPUT_GET, 'folder', FILTER_VALIDATE_INT );
560
 
561
  if ( $folder > 0 ) {
562
  // A specific custom folder (selected or not).
714
  AND (
715
  mt1.meta_value = 'error'
716
  OR
717
+ mt2.meta_value != %d
718
  OR
719
  mt2.post_id IS NULL
720
  )
1123
  imagify_check_user_capacity();
1124
 
1125
  $user = new Imagify_User();
1126
+ $views = Imagify_Views::get_instance();
1127
+ $unconsumed_quota = $views->get_quota_percent();
 
1128
  $message = '';
1129
 
1130
+ if ( $unconsumed_quota <= 20 ) {
 
 
 
 
 
 
 
 
 
1131
  $message = '<div class="imagify-error">';
1132
  $message .= '<p><i class="dashicons dashicons-warning" aria-hidden="true"></i><strong>' . __( 'Oops, It\'s almost over!', 'imagify' ) . '</strong></p>';
1133
  /* translators: %s is a line break. */
1142
  $message .= '<p>' . sprintf(
1143
  /* translators: 1 is a data quota, 2 is a date. */
1144
  __( 'You have consumed all your credit for this month. You will have <strong>%1$s back on %2$s</strong>.', 'imagify' ),
1145
+ imagify_size_format( $user->quota * pow( 1024, 2 ) ),
1146
  date_i18n( get_option( 'date_format' ), strtotime( $user->next_date_update ) )
1147
  ) . '</p>';
1148
  $message .= '<p class="center txt-center text-center"><a class="btn imagify-btn-ghost" href="' . esc_url( imagify_get_external_url( 'subscription' ) ) . '" target="_blank">' . __( 'Upgrade My Subscription', 'imagify' ) . '</a></p>';
1154
  $quota_section .= '<div class="imagify-abq-row">';
1155
 
1156
  if ( 1 === $user->plan_id ) {
1157
+ $quota_section .= '<div class="imagify-meteo-icon">' . $views->get_quota_icon() . '</div>';
1158
  }
1159
 
1160
  $quota_section .= '<div class="imagify-account">';
1168
  $quota_section .= '<div class="imagify-space-left">';
1169
  /* translators: %s is a data quota. */
1170
  $quota_section .= '<p>' . sprintf( __( 'You have %s space credit left', 'imagify' ), '<span class="imagify-unconsumed-percent">' . $unconsumed_quota . '%</span>' ) . '</p>';
1171
+ $quota_section .= '<div class="' . $views->get_quota_class() . '">';
1172
  $quota_section .= '<div style="width: ' . $unconsumed_quota . '%;" class="imagify-unconsumed-bar imagify-progress"></div>';
1173
+ $quota_section .= '</div>'; // .imagify-bar-{negative|neutral|positive}
1174
  $quota_section .= '</div>'; // .imagify-space-left
1175
  $quota_section .= '</div>'; // .imagify-abq-row
1176
  }
1274
  ) );
1275
 
1276
  wp_send_json_success( array(
1277
+ 'total_library_size' => array(
1278
+ 'raw' => $raw_total_size_in_library,
1279
+ 'human' => imagify_size_format( $raw_total_size_in_library ),
1280
+ ),
1281
+ 'average_month_size' => array(
1282
+ 'raw' => $raw_average_per_month,
1283
+ 'human' => imagify_size_format( $raw_average_per_month ),
1284
+ ),
1285
  ) );
1286
  }
1287
 
1354
  }
1355
 
1356
  $folder = trailingslashit( sanitize_text_field( $_POST['folder'] ) );
1357
+ $folder = realpath( $this->filesystem->get_site_root() . ltrim( $folder, '/' ) );
1358
 
1359
  if ( ! $folder ) {
1360
  imagify_die( __( 'This folder doesn\'t exist.', 'imagify' ) );
1375
  $views = Imagify_Views::get_instance();
1376
  $output = '';
1377
 
1378
+ if ( $this->filesystem->is_site_root( $folder ) ) {
1379
  $output .= $views->get_template( 'part-settings-files-tree-row', array(
1380
  'relative_path' => '/',
1381
  // Value #///# Label.
1382
+ 'checkbox_value' => '{{ROOT}}/#///#' . esc_attr__( 'Site\'s root', 'imagify' ),
1383
  'checkbox_id' => 'ABSPATH',
1384
+ 'checkbox_selected' => isset( $selected['{{ROOT}}/'] ),
1385
  'label' => __( 'Site\'s root', 'imagify' ),
1386
  'no_button' => true,
1387
  ) );
1417
  }
1418
 
1419
  if ( ! $output ) {
1420
+ $output .= '<li class="imagify-empty-folder"><em>' . __( 'No optimizable files', 'imagify' ) . '</em></li>';
1421
  }
1422
 
1423
  wp_send_json_success( $output );
1514
  * @return object A Imagify_File_Attachment object.
1515
  */
1516
  protected function get_file_to_optimize( $identifier ) {
1517
+ $file_id = filter_input( INPUT_GET, 'id', FILTER_VALIDATE_INT );
1518
 
1519
  if ( ! $file_id ) {
1520
  imagify_die( __( 'Invalid request', 'imagify' ) );
inc/classes/class-imagify-assets.php CHANGED
@@ -619,7 +619,6 @@ class Imagify_Assets {
619
  $handles = (array) $handles;
620
 
621
  foreach ( $handles as $handle ) {
622
- $this->enqueue_style( $handle );
623
  $this->enqueue_script( $handle );
624
  }
625
 
619
  $handles = (array) $handles;
620
 
621
  foreach ( $handles as $handle ) {
 
622
  $this->enqueue_script( $handle );
623
  }
624
 
inc/classes/class-imagify-attachment.php CHANGED
@@ -557,7 +557,12 @@ class Imagify_Attachment extends Imagify_Abstract_Attachment {
557
  /* translators: %d is a number of thumbnails. */
558
  $error_message = _n( '%d thumbnail failed to be created', '%d thumbnails failed to be created', $failed_count, 'imagify' );
559
  $error_message = sprintf( $error_message, $failed_count );
560
- $errors->add( 'image_resize_error', $error_message, array( 'nbr_failed' => $failed_count, 'sizes_failed' => $failed_sizes, 'sizes_succeeded' => $result_sizes ) );
 
 
 
 
 
561
  }
562
 
563
  if ( ! $result_sizes ) {
@@ -768,7 +773,7 @@ class Imagify_Attachment extends Imagify_Abstract_Attachment {
768
 
769
  if ( $this->is_image() ) {
770
  if ( ! function_exists( 'wp_generate_attachment_metadata' ) ) {
771
- require_once( ABSPATH . 'wp-admin/includes/image.php' );
772
  }
773
 
774
  remove_filter( 'wp_generate_attachment_metadata', '_imagify_optimize_attachment', IMAGIFY_INT_MAX );
557
  /* translators: %d is a number of thumbnails. */
558
  $error_message = _n( '%d thumbnail failed to be created', '%d thumbnails failed to be created', $failed_count, 'imagify' );
559
  $error_message = sprintf( $error_message, $failed_count );
560
+
561
+ $errors->add( 'image_resize_error', $error_message, array(
562
+ 'nbr_failed' => $failed_count,
563
+ 'sizes_failed' => $failed_sizes,
564
+ 'sizes_succeeded' => $result_sizes,
565
+ ) );
566
  }
567
 
568
  if ( ! $result_sizes ) {
773
 
774
  if ( $this->is_image() ) {
775
  if ( ! function_exists( 'wp_generate_attachment_metadata' ) ) {
776
+ require_once ABSPATH . 'wp-admin/includes/image.php';
777
  }
778
 
779
  remove_filter( 'wp_generate_attachment_metadata', '_imagify_optimize_attachment', IMAGIFY_INT_MAX );
inc/classes/class-imagify-cron-library-size.php CHANGED
File without changes
inc/classes/class-imagify-cron-rating.php CHANGED
File without changes
inc/classes/class-imagify-cron-sync-files.php CHANGED
File without changes
inc/classes/class-imagify-custom-folders.php CHANGED
@@ -14,7 +14,7 @@ class Imagify_Custom_Folders {
14
  *
15
  * @var string
16
  */
17
- const VERSION = '1.0.2';
18
 
19
 
20
  /** ----------------------------------------------------------------------------------------- */
@@ -38,7 +38,7 @@ class Imagify_Custom_Folders {
38
  }
39
 
40
  $filesystem = imagify_get_filesystem();
41
- $backup_dir = $filesystem->get_abspath() . 'imagify-backup/';
42
 
43
  /**
44
  * Filter the backup directory path (custom folders).
@@ -79,14 +79,14 @@ class Imagify_Custom_Folders {
79
  */
80
  public static function get_file_backup_path( $file_path ) {
81
  $file_path = wp_normalize_path( (string) $file_path );
82
- $abspath = imagify_get_filesystem()->get_abspath();
83
  $backup_dir = self::get_backup_dir_path();
84
 
85
  if ( ! $file_path ) {
86
  return false;
87
  }
88
 
89
- return str_replace( $abspath, $backup_dir, $file_path );
90
  }
91
 
92
 
@@ -402,7 +402,7 @@ class Imagify_Custom_Folders {
402
  * Array(
403
  * [7] => Array(
404
  * [folder_id] => 7
405
- * [path] => {{ABSPATH}}/custom-path/
406
  * [active] => 1
407
  * [folder_path] => /absolute/path/to/custom-path/
408
  * )
@@ -478,7 +478,7 @@ class Imagify_Custom_Folders {
478
  * [_2] => Array(
479
  * [file_id] => 2
480
  * [folder_id] => 7
481
- * [path] => {{ABSPATH}}/custom-path/image-1.jpg
482
  * [optimization_level] => null
483
  * [status] => null
484
  * [file_path] => /absolute/path/to/custom-path/image-1.jpg
@@ -486,7 +486,7 @@ class Imagify_Custom_Folders {
486
  * [_3] => Array(
487
  * [file_id] => 3
488
  * [folder_id] => 7
489
- * [path] => {{ABSPATH}}/custom-path/image-2.jpg
490
  * [optimization_level] => 2
491
  * [status] => success
492
  * [file_path] => /absolute/path/to/custom-path/image-2.jpg
@@ -1017,14 +1017,15 @@ class Imagify_Custom_Folders {
1017
  }
1018
 
1019
  $active_folder_ids = array();
1020
- $has_abspath = false;
1021
 
1022
  foreach ( $active_folders as $i => $active_folder ) {
1023
  $active_folders[ $i ] = $folders_db->cast_row( $active_folder );
1024
  $active_folder_ids[] = $active_folders[ $i ][ $folders_key ];
1025
 
1026
- if ( '{{ABSPATH}}/' === $active_folders[ $i ]['path'] ) {
1027
- $has_abspath = true;
 
1028
  }
1029
  }
1030
 
@@ -1044,7 +1045,7 @@ class Imagify_Custom_Folders {
1044
  $inactive_file = $files_db->cast_row( $inactive_file );
1045
  $inactive_file['full_path'] = Imagify_Files_Scan::remove_placeholder( $inactive_file['path'] );
1046
 
1047
- if ( $has_abspath ) {
1048
  $inactive_file['dirname'] = $filesystem->dir_path( $inactive_file['full_path'] );
1049
  }
1050
 
@@ -1060,7 +1061,7 @@ class Imagify_Custom_Folders {
1060
  $file_ids_by_folder[ $folder_id ] = array();
1061
  }
1062
 
1063
- if ( '{{ABSPATH}}/' === $active_folder['path'] ) {
1064
  // For the site's root: only direct childs.
1065
  if ( $inactive_file['dirname'] === $active_folder['full_path'] ) {
1066
  // This file is in the site's root folder.
@@ -1199,7 +1200,7 @@ class Imagify_Custom_Folders {
1199
  sort( $placeholders );
1200
 
1201
  foreach ( $placeholders as $i => $placeholder_path ) {
1202
- if ( '{{ABSPATH}}/' === $placeholder_path ) {
1203
  continue;
1204
  }
1205
 
14
  *
15
  * @var string
16
  */
17
+ const VERSION = '1.0.3';
18
 
19
 
20
  /** ----------------------------------------------------------------------------------------- */
38
  }
39
 
40
  $filesystem = imagify_get_filesystem();
41
+ $backup_dir = $filesystem->get_site_root() . 'imagify-backup/';
42
 
43
  /**
44
  * Filter the backup directory path (custom folders).
79
  */
80
  public static function get_file_backup_path( $file_path ) {
81
  $file_path = wp_normalize_path( (string) $file_path );
82
+ $site_root = imagify_get_filesystem()->get_site_root();
83
  $backup_dir = self::get_backup_dir_path();
84
 
85
  if ( ! $file_path ) {
86
  return false;
87
  }
88
 
89
+ return str_replace( $site_root, $backup_dir, $file_path );
90
  }
91
 
92
 
402
  * Array(
403
  * [7] => Array(
404
  * [folder_id] => 7
405
+ * [path] => {{ROOT}}/custom-path/
406
  * [active] => 1
407
  * [folder_path] => /absolute/path/to/custom-path/
408
  * )
478
  * [_2] => Array(
479
  * [file_id] => 2
480
  * [folder_id] => 7
481
+ * [path] => {{ROOT}}/custom-path/image-1.jpg
482
  * [optimization_level] => null
483
  * [status] => null
484
  * [file_path] => /absolute/path/to/custom-path/image-1.jpg
486
  * [_3] => Array(
487
  * [file_id] => 3
488
  * [folder_id] => 7
489
+ * [path] => {{ROOT}}/custom-path/image-2.jpg
490
  * [optimization_level] => 2
491
  * [status] => success
492
  * [file_path] => /absolute/path/to/custom-path/image-2.jpg
1017
  }
1018
 
1019
  $active_folder_ids = array();
1020
+ $has_site_root = false;
1021
 
1022
  foreach ( $active_folders as $i => $active_folder ) {
1023
  $active_folders[ $i ] = $folders_db->cast_row( $active_folder );
1024
  $active_folder_ids[] = $active_folders[ $i ][ $folders_key ];
1025
 
1026
+ if ( '{{ROOT}}/' === $active_folders[ $i ]['path'] ) {
1027
+ $has_site_root = true;
1028
+ break;
1029
  }
1030
  }
1031
 
1045
  $inactive_file = $files_db->cast_row( $inactive_file );
1046
  $inactive_file['full_path'] = Imagify_Files_Scan::remove_placeholder( $inactive_file['path'] );
1047
 
1048
+ if ( $has_site_root ) {
1049
  $inactive_file['dirname'] = $filesystem->dir_path( $inactive_file['full_path'] );
1050
  }
1051
 
1061
  $file_ids_by_folder[ $folder_id ] = array();
1062
  }
1063
 
1064
+ if ( '{{ROOT}}/' === $active_folder['path'] ) {
1065
  // For the site's root: only direct childs.
1066
  if ( $inactive_file['dirname'] === $active_folder['full_path'] ) {
1067
  // This file is in the site's root folder.
1200
  sort( $placeholders );
1201
 
1202
  foreach ( $placeholders as $i => $placeholder_path ) {
1203
+ if ( '{{ROOT}}/' === $placeholder_path ) {
1204
  continue;
1205
  }
1206
 
inc/classes/class-imagify-data.php CHANGED
File without changes
inc/classes/class-imagify-db.php CHANGED
File without changes
inc/classes/class-imagify-file-attachment.php CHANGED
File without changes
inc/classes/class-imagify-files-db.php CHANGED
File without changes
inc/classes/class-imagify-files-iterator.php CHANGED
@@ -65,10 +65,18 @@ class Imagify_Files_Iterator extends FilterIterator {
65
  public function accept() {
66
  static $extensions, $has_extension_method;
67
 
68
- // Forbidden file/folder paths and names.
69
- $is_dir = $this->isDir();
70
  $file_path = $this->current()->getPathname();
71
 
 
 
 
 
 
 
 
 
 
 
72
  if ( $is_dir ) {
73
  $file_path = trailingslashit( $file_path );
74
  }
65
  public function accept() {
66
  static $extensions, $has_extension_method;
67
 
 
 
68
  $file_path = $this->current()->getPathname();
69
 
70
+ // Prevent triggering an open_basedir restriction error.
71
+ $file_name = $this->filesystem->file_name( $file_path );
72
+
73
+ if ( '.' === $file_name || '..' === $file_name ) {
74
+ return false;
75
+ }
76
+
77
+ // Forbidden file/folder paths and names.
78
+ $is_dir = $this->isDir();
79
+
80
  if ( $is_dir ) {
81
  $file_path = trailingslashit( $file_path );
82
  }
inc/classes/class-imagify-files-list-table.php CHANGED
@@ -17,7 +17,7 @@ class Imagify_Files_List_Table extends WP_List_Table {
17
  * @since 1.7
18
  * @author Grégory Viguier
19
  */
20
- const VERSION = '1.0.1';
21
 
22
  /**
23
  * Class version.
@@ -309,7 +309,7 @@ class Imagify_Files_List_Table extends WP_List_Table {
309
  $counts = $wpdb->get_results( "SELECT folder_id, COUNT( $files_key_esc ) AS count FROM $files_table GROUP BY folder_id", OBJECT_K ); // WPCS: unprepared SQL ok.
310
 
311
  foreach ( $folders as $folder ) {
312
- if ( '{{ABSPATH}}/' === $folder->path ) {
313
  $root_id = $folder->folder_id;
314
  $folder_filters[ $folder->folder_id ] = '/';
315
  } else {
@@ -353,9 +353,9 @@ class Imagify_Files_List_Table extends WP_List_Table {
353
 
354
  $status_filters = array(
355
  '' => __( 'All Media Files', 'imagify' ),
356
- 'optimized' => _x( 'Optimized', 'Media Files','imagify' ) . ' (' . $status_filters['optimized'] . ')',
357
- 'unoptimized' => _x( 'Unoptimized', 'Media Files','imagify' ) . ' (' . $status_filters['unoptimized'] . ')',
358
- 'errors' => _x( 'Errors', 'Media Files','imagify' ) . ' (' . $status_filters['errors'] . ')',
359
  );
360
 
361
  // Get submitted values.
@@ -363,7 +363,10 @@ class Imagify_Files_List_Table extends WP_List_Table {
363
  $status_filter = self::get_status_filter();
364
 
365
  // Display the filters.
366
- $this->screen->render_screen_reader_content( 'heading_views' );
 
 
 
367
  ?>
368
  <div class="wp-filter">
369
  <div class="filter-items">
@@ -566,7 +569,7 @@ class Imagify_Files_List_Table extends WP_List_Table {
566
  $format = '<a href="' . esc_url( add_query_arg( 'folder-filter', $item->folder_id, get_imagify_admin_url( 'files-list' ) ) ) . '">%s</a>';
567
  }
568
 
569
- if ( '{{ABSPATH}}/' === $item->folder_path ) {
570
  // It's the site's root.
571
  printf( $format, __( 'Site\'s root', 'imagify' ) );
572
  } else {
@@ -1010,7 +1013,7 @@ class Imagify_Files_List_Table extends WP_List_Table {
1010
  static $filter;
1011
 
1012
  if ( ! isset( $filter ) ) {
1013
- $filter = (int) filter_input( INPUT_GET, 'folder-filter', FILTER_SANITIZE_NUMBER_INT );
1014
  $filter = max( 0, $filter );
1015
  }
1016
 
@@ -1036,7 +1039,7 @@ class Imagify_Files_List_Table extends WP_List_Table {
1036
  $values = array(
1037
  'optimized' => 1,
1038
  'unoptimized' => 1,
1039
- 'errors' => 1,
1040
  );
1041
  $filter = trim( filter_input( INPUT_GET, 'status-filter', FILTER_SANITIZE_STRING ) );
1042
  $filter = isset( $values[ $filter ] ) ? $filter : '';
17
  * @since 1.7
18
  * @author Grégory Viguier
19
  */
20
+ const VERSION = '1.0.2';
21
 
22
  /**
23
  * Class version.
309
  $counts = $wpdb->get_results( "SELECT folder_id, COUNT( $files_key_esc ) AS count FROM $files_table GROUP BY folder_id", OBJECT_K ); // WPCS: unprepared SQL ok.
310
 
311
  foreach ( $folders as $folder ) {
312
+ if ( '{{ROOT}}/' === $folder->path ) {
313
  $root_id = $folder->folder_id;
314
  $folder_filters[ $folder->folder_id ] = '/';
315
  } else {
353
 
354
  $status_filters = array(
355
  '' => __( 'All Media Files', 'imagify' ),
356
+ 'optimized' => _x( 'Optimized', 'Media Files', 'imagify' ) . ' (' . $status_filters['optimized'] . ')',
357
+ 'unoptimized' => _x( 'Unoptimized', 'Media Files', 'imagify' ) . ' (' . $status_filters['unoptimized'] . ')',
358
+ 'errors' => _x( 'Errors', 'Media Files', 'imagify' ) . ' (' . $status_filters['errors'] . ')',
359
  );
360
 
361
  // Get submitted values.
363
  $status_filter = self::get_status_filter();
364
 
365
  // Display the filters.
366
+ if ( method_exists( $this->screen, 'render_screen_reader_content' ) ) {
367
+ // Introduced in WP 4.4.
368
+ $this->screen->render_screen_reader_content( 'heading_views' );
369
+ }
370
  ?>
371
  <div class="wp-filter">
372
  <div class="filter-items">
569
  $format = '<a href="' . esc_url( add_query_arg( 'folder-filter', $item->folder_id, get_imagify_admin_url( 'files-list' ) ) ) . '">%s</a>';
570
  }
571
 
572
+ if ( '{{ROOT}}/' === $item->folder_path ) {
573
  // It's the site's root.
574
  printf( $format, __( 'Site\'s root', 'imagify' ) );
575
  } else {
1013
  static $filter;
1014
 
1015
  if ( ! isset( $filter ) ) {
1016
+ $filter = filter_input( INPUT_GET, 'folder-filter', FILTER_VALIDATE_INT );
1017
  $filter = max( 0, $filter );
1018
  }
1019
 
1039
  $values = array(
1040
  'optimized' => 1,
1041
  'unoptimized' => 1,
1042
+ 'errors' => 1,
1043
  );
1044
  $filter = trim( filter_input( INPUT_GET, 'status-filter', FILTER_SANITIZE_STRING ) );
1045
  $filter = isset( $values[ $filter ] ) ? $filter : '';
inc/classes/class-imagify-files-recursive-iterator.php CHANGED
@@ -55,9 +55,15 @@ class Imagify_Files_Recursive_Iterator extends RecursiveFilterIterator {
55
  public function accept() {
56
  static $extensions, $has_extension_method;
57
 
58
- // Forbidden file/folder paths and names.
59
  $file_path = $this->current()->getPathname();
60
 
 
 
 
 
 
 
 
61
  if ( $this->current()->isDir() ) {
62
  $file_path = trailingslashit( $file_path );
63
  }
55
  public function accept() {
56
  static $extensions, $has_extension_method;
57
 
 
58
  $file_path = $this->current()->getPathname();
59
 
60
+ // Prevent triggering an open_basedir restriction error.
61
+ $file_name = $this->filesystem->file_name( $file_path );
62
+
63
+ if ( '.' === $file_name || '..' === $file_name ) {
64
+ return false;
65
+ }
66
+
67
  if ( $this->current()->isDir() ) {
68
  $file_path = trailingslashit( $file_path );
69
  }
inc/classes/class-imagify-files-scan.php CHANGED
@@ -16,7 +16,7 @@ class Imagify_Files_Scan {
16
  * @since 1.7
17
  * @author Grégory Viguier
18
  */
19
- const VERSION = '1.1';
20
 
21
  /**
22
  * Get files (optimizable by Imagify) recursively from a specific folder.
@@ -51,7 +51,7 @@ class Imagify_Files_Scan {
51
  }
52
 
53
  // Finally we made all our validations.
54
- if ( $filesystem->is_abspath( $folder ) ) {
55
  // For the site's root, we don't look in sub-folders.
56
  $dir = new DirectoryIterator( $folder );
57
  $dir = new Imagify_Files_Iterator( $dir, false );
@@ -169,10 +169,11 @@ class Imagify_Files_Scan {
169
  }
170
 
171
  $filesystem = imagify_get_filesystem();
 
172
  $abspath = $filesystem->get_abspath();
173
  $folders = array(
174
  // Server.
175
- $abspath . 'cgi-bin', // `cgi-bin`
176
  // WordPress.
177
  $abspath . 'wp-admin', // `wp-admin`
178
  $abspath . WPINC, // `wp-includes`
@@ -451,7 +452,7 @@ class Imagify_Files_Scan {
451
  '{{THEMES}}/' => WP_CONTENT_DIR . '/themes',
452
  '{{UPLOADS}}/' => $filesystem->get_main_upload_basedir(),
453
  '{{CONTENT}}/' => WP_CONTENT_DIR,
454
- '{{ABSPATH}}/' => ABSPATH,
455
  );
456
  $replacements = array_map( array( $filesystem, 'normalize_dir_path' ), $replacements );
457
 
@@ -474,13 +475,14 @@ class Imagify_Files_Scan {
474
  return $replacements;
475
  }
476
 
 
477
  $replacements = array(
478
  '{{PLUGINS}}/' => plugins_url( '/' ),
479
  '{{MU_PLUGINS}}/' => plugins_url( '/', WPMU_PLUGIN_DIR . '/.' ),
480
  '{{THEMES}}/' => content_url( 'themes/' ),
481
- '{{UPLOADS}}/' => imagify_get_filesystem()->get_main_upload_baseurl(),
482
  '{{CONTENT}}/' => content_url( '/' ),
483
- '{{ABSPATH}}/' => site_url( '/' ),
484
  );
485
 
486
  return $replacements;
16
  * @since 1.7
17
  * @author Grégory Viguier
18
  */
19
+ const VERSION = '1.1.1';
20
 
21
  /**
22
  * Get files (optimizable by Imagify) recursively from a specific folder.
51
  }
52
 
53
  // Finally we made all our validations.
54
+ if ( $filesystem->is_site_root( $folder ) ) {
55
  // For the site's root, we don't look in sub-folders.
56
  $dir = new DirectoryIterator( $folder );
57
  $dir = new Imagify_Files_Iterator( $dir, false );
169
  }
170
 
171
  $filesystem = imagify_get_filesystem();
172
+ $site_root = $filesystem->get_site_root();
173
  $abspath = $filesystem->get_abspath();
174
  $folders = array(
175
  // Server.
176
+ $site_root . 'cgi-bin', // `cgi-bin`
177
  // WordPress.
178
  $abspath . 'wp-admin', // `wp-admin`
179
  $abspath . WPINC, // `wp-includes`
452
  '{{THEMES}}/' => WP_CONTENT_DIR . '/themes',
453
  '{{UPLOADS}}/' => $filesystem->get_main_upload_basedir(),
454
  '{{CONTENT}}/' => WP_CONTENT_DIR,
455
+ '{{ROOT}}/' => $filesystem->get_site_root(),
456
  );
457
  $replacements = array_map( array( $filesystem, 'normalize_dir_path' ), $replacements );
458
 
475
  return $replacements;
476
  }
477
 
478
+ $filesystem = imagify_get_filesystem();
479
  $replacements = array(
480
  '{{PLUGINS}}/' => plugins_url( '/' ),
481
  '{{MU_PLUGINS}}/' => plugins_url( '/', WPMU_PLUGIN_DIR . '/.' ),
482
  '{{THEMES}}/' => content_url( 'themes/' ),
483
+ '{{UPLOADS}}/' => $filesystem->get_main_upload_baseurl(),
484
  '{{CONTENT}}/' => content_url( '/' ),
485
+ '{{ROOT}}/' => $filesystem->get_site_root_url(),
486
  );
487
 
488
  return $replacements;
inc/classes/class-imagify-files-stats.php CHANGED
File without changes
inc/classes/class-imagify-filesystem.php CHANGED
@@ -17,7 +17,7 @@ class Imagify_Filesystem extends WP_Filesystem_Direct {
17
  *
18
  * @var string
19
  */
20
- const VERSION = '1.1';
21
 
22
  /**
23
  * Delimiter used for regex patterns.
@@ -209,15 +209,15 @@ class Imagify_Filesystem extends WP_Filesystem_Direct {
209
  return $this->is_dir( $path ) && $this->is_writable( $path );
210
  }
211
 
212
- $abspath = $this->get_abspath();
213
 
214
- if ( strpos( $path, $abspath ) !== 0 ) {
215
  return false;
216
  }
217
 
218
- $bits = str_replace( $abspath, '', $path );
219
  $bits = explode( '/', $bits );
220
- $path = untrailingslashit( $abspath );
221
 
222
  foreach ( $bits as $bit ) {
223
  $path .= '/' . $bit;
@@ -337,7 +337,7 @@ class Imagify_Filesystem extends WP_Filesystem_Direct {
337
  * @return bool
338
  */
339
  public function is_symlinked( $file_path ) {
340
- static $abspath;
341
  static $plugin_paths = array();
342
  global $wp_plugin_paths;
343
 
@@ -351,13 +351,13 @@ class Imagify_Filesystem extends WP_Filesystem_Direct {
351
  return false;
352
  }
353
 
354
- if ( ! isset( $abspath ) ) {
355
- $abspath = $this->normalize_path_for_comparison( $this->get_abspath() );
356
  }
357
 
358
  $lower_file_path = $this->normalize_path_for_comparison( $real_path );
359
 
360
- if ( strpos( $lower_file_path, $abspath ) !== 0 ) {
361
  return true;
362
  }
363
 
@@ -604,19 +604,14 @@ class Imagify_Filesystem extends WP_Filesystem_Direct {
604
  * @return string|bool A relative path. Can return the absolute path or false in case of a failure.
605
  */
606
  public function make_path_relative( $file_path, $base = '' ) {
607
- static $abspath;
608
  global $wp_plugin_paths;
609
 
610
  if ( ! $file_path ) {
611
  return false;
612
  }
613
 
614
- if ( ! isset( $abspath ) ) {
615
- $abspath = wp_normalize_path( ABSPATH );
616
- }
617
-
618
  $file_path = wp_normalize_path( $file_path );
619
- $base = $base ? $this->normalize_dir_path( $base ) : $abspath;
620
  $pos = strpos( $file_path, $base );
621
 
622
  if ( false === $pos && $wp_plugin_paths && is_array( $wp_plugin_paths ) ) {
@@ -675,6 +670,20 @@ class Imagify_Filesystem extends WP_Filesystem_Direct {
675
  /** SOME WELL KNOWN PATHS AND URLS ========================================================== */
676
  /** ----------------------------------------------------------------------------------------- */
677
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
678
  /**
679
  * The path to the server's root is not always '/', it can also be '//' or 'C://'.
680
  * I am get_root.
@@ -692,7 +701,7 @@ class Imagify_Filesystem extends WP_Filesystem_Direct {
692
  return $groot;
693
  }
694
 
695
- $groot = preg_replace( '@^((?:.:)?/+).*@', '$1', $this->get_abspath() );
696
 
697
  return $groot;
698
  }
@@ -713,7 +722,124 @@ class Imagify_Filesystem extends WP_Filesystem_Direct {
713
  }
714
 
715
  /**
716
- * Get a clean value of ABSPATH that can be used in string replacements.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
717
  *
718
  * @since 1.7.1
719
  * @access public
@@ -740,7 +866,7 @@ class Imagify_Filesystem extends WP_Filesystem_Direct {
740
 
741
  } elseif ( false === $pos && class_exists( 'ReflectionClass' ) ) {
742
  // Imagify is symlinked (dude, you look for trouble).
743
- $reflector = new ReflectionClass( 'Requests' );
744
  $test_file = $reflector->getFileName();
745
  $pos = strpos( $test_file, $abspath );
746
 
@@ -760,7 +886,7 @@ class Imagify_Filesystem extends WP_Filesystem_Direct {
760
  }
761
 
762
  /**
763
- * Tell if a path is the site's root (ABSPATH).
764
  *
765
  * @since 1.7.1
766
  * @access public
17
  *
18
  * @var string
19
  */
20
+ const VERSION = '1.2';
21
 
22
  /**
23
  * Delimiter used for regex patterns.
209
  return $this->is_dir( $path ) && $this->is_writable( $path );
210
  }
211
 
212
+ $site_root = $this->get_site_root();
213
 
214
+ if ( strpos( $path, $site_root ) !== 0 ) {
215
  return false;
216
  }
217
 
218
+ $bits = str_replace( $site_root, '', $path );
219
  $bits = explode( '/', $bits );
220
+ $path = untrailingslashit( $site_root );
221
 
222
  foreach ( $bits as $bit ) {
223
  $path .= '/' . $bit;
337
  * @return bool
338
  */
339
  public function is_symlinked( $file_path ) {
340
+ static $site_root;
341
  static $plugin_paths = array();
342
  global $wp_plugin_paths;
343
 
351
  return false;
352
  }
353
 
354
+ if ( ! isset( $site_root ) ) {
355
+ $site_root = $this->normalize_path_for_comparison( $this->get_site_root() );
356
  }
357
 
358
  $lower_file_path = $this->normalize_path_for_comparison( $real_path );
359
 
360
+ if ( strpos( $lower_file_path, $site_root ) !== 0 ) {
361
  return true;
362
  }
363
 
604
  * @return string|bool A relative path. Can return the absolute path or false in case of a failure.
605
  */
606
  public function make_path_relative( $file_path, $base = '' ) {
 
607
  global $wp_plugin_paths;
608
 
609
  if ( ! $file_path ) {
610
  return false;
611
  }
612
 
 
 
 
 
613
  $file_path = wp_normalize_path( $file_path );
614
+ $base = $base ? $this->normalize_dir_path( $base ) : $this->get_site_root();
615
  $pos = strpos( $file_path, $base );
616
 
617
  if ( false === $pos && $wp_plugin_paths && is_array( $wp_plugin_paths ) ) {
670
  /** SOME WELL KNOWN PATHS AND URLS ========================================================== */
671
  /** ----------------------------------------------------------------------------------------- */
672
 
673
+ /**
674
+ * Tell if WordPress is installed in its own directory: aka WP's path !== site's path.
675
+ *
676
+ * @since 1.8.1
677
+ * @access public
678
+ * @see https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
679
+ * @author Grégory Viguier
680
+ *
681
+ * @return string
682
+ */
683
+ public function has_wp_its_own_directory() {
684
+ return $this->get_abspath() !== $this->get_site_root();
685
+ }
686
+
687
  /**
688
  * The path to the server's root is not always '/', it can also be '//' or 'C://'.
689
  * I am get_root.
701
  return $groot;
702
  }
703
 
704
+ $groot = preg_replace( '@^((?:.:)?/+).*@', '$1', $this->get_site_root() );
705
 
706
  return $groot;
707
  }
722
  }
723
 
724
  /**
725
+ * Get the path to the site's root.
726
+ * This is an improved version of get_home_path() that *should* work in almost every cases.
727
+ * Because creating a constant like ABSPATH was too simple.
728
+ *
729
+ * @since 1.8.1
730
+ * @access public
731
+ * @see get_home_path()
732
+ * @author Grégory Viguier
733
+ *
734
+ * @return string
735
+ */
736
+ public function get_site_root() {
737
+ static $root_path;
738
+
739
+ if ( isset( $root_path ) ) {
740
+ return $root_path;
741
+ }
742
+
743
+ /**
744
+ * Filter the path to the site's root.
745
+ *
746
+ * @since 1.8.1
747
+ * @author Grégory Viguier
748
+ *
749
+ * @param string $root_path Path to the site's root. Default is null.
750
+ */
751
+ $root_path = apply_filters( 'imagify_site_root', null );
752
+
753
+ if ( is_string( $root_path ) ) {
754
+ return $root_path;
755
+ }
756
+
757
+ $home = set_url_scheme( untrailingslashit( get_option( 'home' ) ), 'http' );
758
+ $siteurl = set_url_scheme( untrailingslashit( get_option( 'siteurl' ) ), 'http' );
759
+
760
+ if ( ! empty( $home ) && 0 !== strcasecmp( $home, $siteurl ) ) {
761
+ $wp_path_rel_to_home = str_ireplace( $home, '', $siteurl ); /* $siteurl - $home */
762
+ $pos = strripos( str_replace( '\\', '/', ABSPATH ), trailingslashit( $wp_path_rel_to_home ) );
763
+ $root_path = substr( ABSPATH, 0, $pos );
764
+ $root_path = trailingslashit( str_replace( '\\', '/', $root_path ) );
765
+ return $root_path;
766
+ }
767
+
768
+ if ( ! defined( 'PATH_CURRENT_SITE' ) || ! is_multisite() || is_main_site() ) {
769
+ $root_path = str_replace( '\\', '/', ABSPATH );
770
+ return $root_path;
771
+ }
772
+
773
+ /**
774
+ * For a multisite in its own directory, get_home_path() returns the expected path only for the main site.
775
+ *
776
+ * Friend, each time an attempt is made to improve this method, and especially this part, please increment the following counter.
777
+ * Improvement attempts: 2.
778
+ */
779
+ $document_root = trailingslashit( str_replace( '\\', '/', wp_unslash( $_SERVER['DOCUMENT_ROOT'] ) ) );
780
+ $path_current_site = trim( str_replace( '\\', '/', PATH_CURRENT_SITE ), '/' );
781
+ $root_path = trailingslashit( $document_root . $path_current_site );
782
+
783
+ return $root_path;
784
+ }
785
+
786
+ /**
787
+ * Get the URL of the site's root. It corresponds to the main site's home page URL.
788
+ *
789
+ * @since 1.8.1
790
+ * @access public
791
+ * @author Grégory Viguier
792
+ *
793
+ * @return string
794
+ */
795
+ public function get_site_root_url() {
796
+ static $root_url;
797
+
798
+ if ( isset( $root_url ) ) {
799
+ return $root_url;
800
+ }
801
+
802
+ if ( ! is_multisite() || is_main_site() ) {
803
+ $root_url = home_url( '/' );
804
+ return $root_url;
805
+ }
806
+
807
+ $current_network = false;
808
+
809
+ if ( function_exists( 'get_network' ) ) {
810
+ $current_network = get_network();
811
+ } elseif ( function_exists( 'get_current_site' ) ) {
812
+ $current_network = get_current_site();
813
+ }
814
+
815
+ if ( ! $current_network ) {
816
+ $root_url = home_url( '/' );
817
+ return $root_url;
818
+ }
819
+
820
+ $root_url = is_ssl() ? 'https' : 'http';
821
+ $root_url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $root_url );
822
+ $root_url = trailingslashit( $root_url );
823
+
824
+ return $root_url;
825
+ }
826
+
827
+ /**
828
+ * Tell if a path is the site's root.
829
+ *
830
+ * @since 1.8.1
831
+ * @access public
832
+ * @author Grégory Viguier
833
+ *
834
+ * @param string $path The path.
835
+ * @return bool
836
+ */
837
+ public function is_site_root( $path ) {
838
+ return $this->normalize_dir_path( $path ) === $this->get_site_root();
839
+ }
840
+
841
+ /**
842
+ * Get a clean value of ABSPATH.
843
  *
844
  * @since 1.7.1
845
  * @access public
866
 
867
  } elseif ( false === $pos && class_exists( 'ReflectionClass' ) ) {
868
  // Imagify is symlinked (dude, you look for trouble).
869
+ $reflector = new ReflectionClass( 'WP' );
870
  $test_file = $reflector->getFileName();
871
  $pos = strpos( $test_file, $abspath );
872
 
886
  }
887
 
888
  /**
889
+ * Tell if a path is WP's root (ABSPATH).
890
  *
891
  * @since 1.7.1
892
  * @access public
inc/classes/class-imagify-folders-db.php CHANGED
File without changes
inc/classes/class-imagify-notices.php CHANGED
@@ -271,7 +271,7 @@ class Imagify_Notices extends Imagify_Notices_Deprecated {
271
  public function renew_almost_over_quota_notice() {
272
  global $wpdb;
273
 
274
- $results = $wpdb->get_results( $wpdb->prepare( "SELECT umeta_id, user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value LIKE '%almost-over-quota%'", self::DISMISS_META_NAME ) );
275
 
276
  if ( ! $results ) {
277
  return;
271
  public function renew_almost_over_quota_notice() {
272
  global $wpdb;
273
 
274
+ $results = $wpdb->get_results( $wpdb->prepare( "SELECT umeta_id, user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value LIKE %s", self::DISMISS_META_NAME, '%almost-over-quota%' ) );
275
 
276
  if ( ! $results ) {
277
  return;
inc/classes/class-imagify-options.php CHANGED
File without changes
inc/classes/class-imagify-requirements.php CHANGED
@@ -268,7 +268,11 @@ class Imagify_Requirements {
268
  * @return bool
269
  */
270
  public static function is_api_key_valid( $reset_cache = false ) {
271
- if ( ! $reset_cache && isset( self::$supports['api_key_valid'] ) ) {
 
 
 
 
272
  return self::$supports['api_key_valid'];
273
  }
274
 
@@ -277,7 +281,7 @@ class Imagify_Requirements {
277
  return self::$supports['api_key_valid'];
278
  }
279
 
280
- if ( ! $reset_cache && get_site_transient( 'imagify_check_licence_1' ) ) {
281
  self::$supports['api_key_valid'] = true;
282
  return self::$supports['api_key_valid'];
283
  }
@@ -332,11 +336,13 @@ class Imagify_Requirements {
332
  public static function reset_cache( $cache_key ) {
333
  unset( self::$supports[ $cache_key ] );
334
 
335
- if ( 'api_up' === $cache_key ) {
336
- delete_site_transient( 'imagify_check_api_version' );
337
- }
338
- elseif ( 'api_key_valid' === $cache_key ) {
339
- delete_site_transient( 'imagify_check_licence_1' );
 
 
340
  }
341
  }
342
  }
268
  * @return bool
269
  */
270
  public static function is_api_key_valid( $reset_cache = false ) {
271
+ if ( $reset_cache ) {
272
+ self::reset_cache( 'api_key_valid' );
273
+ }
274
+
275
+ if ( isset( self::$supports['api_key_valid'] ) ) {
276
  return self::$supports['api_key_valid'];
277
  }
278
 
281
  return self::$supports['api_key_valid'];
282
  }
283
 
284
+ if ( get_site_transient( 'imagify_check_licence_1' ) ) {
285
  self::$supports['api_key_valid'] = true;
286
  return self::$supports['api_key_valid'];
287
  }
336
  public static function reset_cache( $cache_key ) {
337
  unset( self::$supports[ $cache_key ] );
338
 
339
+ $transients = array(
340
+ 'api_up' => 'imagify_check_api_version',
341
+ 'api_key_valid' => 'imagify_check_licence_1',
342
+ );
343
+
344
+ if ( isset( $transients[ $cache_key ] ) && get_site_transient( $transients[ $cache_key ] ) ) {
345
+ delete_site_transient( $transients[ $cache_key ] );
346
  }
347
  }
348
  }
inc/classes/class-imagify-settings.php CHANGED
@@ -361,15 +361,18 @@ class Imagify_Settings {
361
  * @param mixed $value The new option value.
362
  */
363
  public function after_save_options( $old_value, $value ) {
364
- if ( ! $value || isset( $old_value['api_key'], $value['api_key'] ) && $old_value['api_key'] === $value['api_key'] ) {
 
 
 
365
  return;
366
  }
367
 
368
- if ( is_wp_error( get_imagify_user() ) ) {
369
- Imagify_Notices::renew_notice( 'wrong-api-key' );
370
- delete_site_transient( 'imagify_check_licence_1' );
371
- } else {
372
  Imagify_Notices::dismiss_notice( 'wrong-api-key' );
 
 
373
  }
374
  }
375
 
@@ -385,6 +388,7 @@ class Imagify_Settings {
385
  return;
386
  }
387
 
 
388
  $capability = apply_filters( 'option_page_capability_' . $this->settings_group, 'manage_network_options' );
389
 
390
  if ( ! current_user_can( $capability ) ) {
361
  * @param mixed $value The new option value.
362
  */
363
  public function after_save_options( $old_value, $value ) {
364
+ $old_key = isset( $old_value['api_key'] ) ? $old_value['api_key'] : '';
365
+ $new_key = isset( $value['api_key'] ) ? $value['api_key'] : '';
366
+
367
+ if ( $old_key === $new_key ) {
368
  return;
369
  }
370
 
371
+ // Handle API key validation cache and notices.
372
+ if ( Imagify_Requirements::is_api_key_valid( true ) ) {
 
 
373
  Imagify_Notices::dismiss_notice( 'wrong-api-key' );
374
+ } else {
375
+ Imagify_Notices::renew_notice( 'wrong-api-key' );
376
  }
377
  }
378
 
388
  return;
389
  }
390
 
391
+ /** This filter is documented in /wp-admin/options.php. */
392
  $capability = apply_filters( 'option_page_capability_' . $this->settings_group, 'manage_network_options' );
393
 
394
  if ( ! current_user_can( $capability ) ) {
inc/classes/class-imagify-views.php CHANGED
@@ -15,7 +15,7 @@ class Imagify_Views {
15
  * @var string
16
  * @since 1.7
17
  */
18
- const VERSION = '1.0.1';
19
 
20
  /**
21
  * Slug used for the settings page URL.
@@ -414,6 +414,92 @@ class Imagify_Views {
414
  }
415
 
416
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
417
  /** ----------------------------------------------------------------------------------------- */
418
  /** GENERIC TEMPLATE TOOLS ================================================================== */
419
  /** ----------------------------------------------------------------------------------------- */
15
  * @var string
16
  * @since 1.7
17
  */
18
+ const VERSION = '1.1';
19
 
20
  /**
21
  * Slug used for the settings page URL.
414
  }
415
 
416
 
417
+ /** ----------------------------------------------------------------------------------------- */
418
+ /** QUOTA =================================================================================== */
419
+ /** ----------------------------------------------------------------------------------------- */
420
+
421
+ /**
422
+ * Get the remaining quota in percent.
423
+ *
424
+ * @since 1.8.1
425
+ * @author Grégory Viguier
426
+ * @access public
427
+ *
428
+ * @return int
429
+ */
430
+ public function get_quota_percent() {
431
+ static $quota;
432
+
433
+ if ( isset( $quota ) ) {
434
+ return $quota;
435
+ }
436
+
437
+ $user = new Imagify_User();
438
+ $quota = $user->get_percent_unconsumed_quota();
439
+
440
+ return $quota;
441
+ }
442
+
443
+ /**
444
+ * Get the HTML class used for the quota (to change the color when out of quota for example).
445
+ *
446
+ * @since 1.8.1
447
+ * @author Grégory Viguier
448
+ * @access public
449
+ *
450
+ * @return string
451
+ */
452
+ public function get_quota_class() {
453
+ static $class;
454
+
455
+ if ( isset( $class ) ) {
456
+ return $class;
457
+ }
458
+
459
+ $quota = $this->get_quota_percent();
460
+ $class = 'imagify-bar-';
461
+
462
+ if ( $quota <= 20 ) {
463
+ $class .= 'negative';
464
+ } elseif ( $quota <= 50 ) {
465
+ $class .= 'neutral';
466
+ } else {
467
+ $class .= 'positive';
468
+ }
469
+
470
+ return $class;
471
+ }
472
+
473
+ /**
474
+ * Get the HTML tag used for the quota (the weather-like icon).
475
+ *
476
+ * @since 1.8.1
477
+ * @author Grégory Viguier
478
+ * @access public
479
+ *
480
+ * @return string
481
+ */
482
+ public function get_quota_icon() {
483
+ static $icon;
484
+
485
+ if ( isset( $icon ) ) {
486
+ return $icon;
487
+ }
488
+
489
+ $quota = $this->get_quota_percent();
490
+
491
+ if ( $quota <= 20 ) {
492
+ $icon = '<img src="' . IMAGIFY_ASSETS_IMG_URL . 'stormy.svg" width="64" height="63" alt="" />';
493
+ } elseif ( $quota <= 50 ) {
494
+ $icon = '<img src="' . IMAGIFY_ASSETS_IMG_URL . 'cloudy-sun.svg" width="63" height="64" alt="" />';
495
+ } else {
496
+ $icon = '<img src="' . IMAGIFY_ASSETS_IMG_URL . 'sun.svg" width="63" height="64" alt="" />';
497
+ }
498
+
499
+ return $icon;
500
+ }
501
+
502
+
503
  /** ----------------------------------------------------------------------------------------- */
504
  /** GENERIC TEMPLATE TOOLS ================================================================== */
505
  /** ----------------------------------------------------------------------------------------- */
inc/classes/class-imagify.php CHANGED
@@ -532,6 +532,11 @@ class Imagify extends Imagify_Deprecated {
532
  private function handle_response( $response, $http_code, $error = '' ) {
533
  $response = json_decode( $response );
534
 
 
 
 
 
 
535
  if ( 200 !== $http_code && ! empty( $response->code ) ) {
536
  if ( ! empty( $response->detail ) ) {
537
  return new WP_Error( $http_code, $response->detail );
532
  private function handle_response( $response, $http_code, $error = '' ) {
533
  $response = json_decode( $response );
534
 
535
+ if ( 401 === $http_code ) {
536
+ // Reset the API validity cache if the API key is not valid.
537
+ Imagify_Requirements::reset_cache( 'api_key_valid' );
538
+ }
539
+
540
  if ( 200 !== $http_code && ! empty( $response->code ) ) {
541
  if ( ! empty( $response->detail ) ) {
542
  return new WP_Error( $http_code, $response->detail );
inc/classes/class-wp-async-request.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
  /**
3
  * WP Async Request
4
  *
1
  <?php
2
+ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
3
+
4
  /**
5
  * WP Async Request
6
  *
inc/classes/class-wp-background-process.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
  /**
3
  * WP Background Process
4
  *
@@ -195,7 +197,7 @@ if ( ! class_exists( 'WP_Background_Process' ) ) {
195
  $column = 'meta_key';
196
  }
197
 
198
- $key = Imagify_DB::esc_like( $this->identifier . '_batch_' ) . '%';
199
 
200
  $count = $wpdb->get_var( $wpdb->prepare( "
201
  SELECT COUNT(*)
@@ -270,7 +272,7 @@ if ( ! class_exists( 'WP_Background_Process' ) ) {
270
  $value_column = 'meta_value';
271
  }
272
 
273
- $key = Imagify_DB::esc_like( $this->identifier . '_batch_' ) . '%';
274
 
275
  $query = $wpdb->get_row( $wpdb->prepare( "
276
  SELECT *
1
  <?php
2
+ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
3
+
4
  /**
5
  * WP Background Process
6
  *
197
  $column = 'meta_key';
198
  }
199
 
200
+ $key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%';
201
 
202
  $count = $wpdb->get_var( $wpdb->prepare( "
203
  SELECT COUNT(*)
272
  $value_column = 'meta_value';
273
  }
274
 
275
+ $key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%';
276
 
277
  $query = $wpdb->get_row( $wpdb->prepare( "
278
  SELECT *
inc/functions/admin-stats.php CHANGED
@@ -742,8 +742,11 @@ function imagify_get_bulk_stats( $types, $args = array() ) {
742
  */
743
  if ( $args['fullset'] ) {
744
  // User account.
745
- $user = new Imagify_User();
746
- $data['unconsumed_quota'] = is_wp_error( $user ) ? 0 : $user->get_percent_unconsumed_quota();
 
 
 
747
  }
748
 
749
  /**
742
  */
743
  if ( $args['fullset'] ) {
744
  // User account.
745
+ $views = Imagify_Views::get_instance();
746
+
747
+ $data['unconsumed_quota'] = $views->get_quota_percent();
748
+ $data['quota_class'] = $views->get_quota_class();
749
+ $data['quota_icon'] = $views->get_quota_icon();
750
  }
751
 
752
  /**
inc/functions/admin-ui.php CHANGED
File without changes
inc/functions/admin.php CHANGED
@@ -21,7 +21,7 @@ function imagify_is_active_for_network() {
21
  }
22
 
23
  if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
24
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
25
  }
26
 
27
  $is = is_plugin_active_for_network( plugin_basename( IMAGIFY_FILE ) );
@@ -467,7 +467,7 @@ function imagify_cache_user() {
467
  }
468
  }
469
 
470
- $data->quota_formatted = imagify_size_format( $user->quota * 1048576 );
471
  $data->next_date_update_formatted = date_i18n( get_option( 'date_format' ), strtotime( $user->next_date_update ) );
472
 
473
  if ( imagify_is_active_for_network() ) {
21
  }
22
 
23
  if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
24
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
25
  }
26
 
27
  $is = is_plugin_active_for_network( plugin_basename( IMAGIFY_FILE ) );
467
  }
468
  }
469
 
470
+ $data->quota_formatted = imagify_size_format( $user->quota * pow( 1024, 2 ) );
471
  $data->next_date_update_formatted = date_i18n( get_option( 'date_format' ), strtotime( $user->next_date_update ) );
472
 
473
  if ( imagify_is_active_for_network() ) {
inc/functions/common.php CHANGED
@@ -183,37 +183,38 @@ function imagify_sanitize_context( $context ) {
183
  function imagify_autoload( $class ) {
184
  // Generic classes.
185
  $classes = array(
186
- 'Imagify_Abstract_Attachment' => 1,
187
- 'Imagify_Abstract_Cron' => 1,
188
- 'Imagify_Abstract_DB' => 1,
189
- 'Imagify_Abstract_Options' => 1,
190
- 'Imagify_Admin_Ajax_Post' => 1,
191
- 'Imagify_Assets' => 1,
192
- 'Imagify_Attachment' => 1,
193
- 'Imagify_Cron_Library_Size' => 1,
194
- 'Imagify_Cron_Rating' => 1,
195
- 'Imagify_Cron_Sync_Files' => 1,
196
- 'Imagify_Custom_Folders' => 1,
197
- 'Imagify_Data' => 1,
198
- 'Imagify_DB' => 1,
199
- 'Imagify_File_Attachment' => 1,
200
- 'Imagify_Files_DB' => 1,
201
- 'Imagify_Files_Iterator' => 1,
202
- 'Imagify_Files_List_Table' => 1,
203
- 'Imagify_Files_Recursive_Iterator' => 1,
204
- 'Imagify_Files_Scan' => 1,
205
- 'Imagify_Files_Stats' => 1,
206
- 'Imagify_Filesystem' => 1,
207
- 'Imagify_Folders_DB' => 1,
208
- 'Imagify_Notices' => 1,
209
- 'Imagify_Options' => 1,
210
- 'Imagify_Requirements' => 1,
211
- 'Imagify_Settings' => 1,
212
- 'Imagify_User' => 1,
213
- 'Imagify_Views' => 1,
214
- 'Imagify' => 1,
215
- 'WP_Async_Request' => 1,
216
- 'WP_Background_Process' => 1,
 
217
  );
218
 
219
  if ( isset( $classes[ $class ] ) ) {
183
  function imagify_autoload( $class ) {
184
  // Generic classes.
185
  $classes = array(
186
+ 'Imagify_Abstract_Attachment' => 1,
187
+ 'Imagify_Abstract_Background_Process' => 1,
188
+ 'Imagify_Abstract_Cron' => 1,
189
+ 'Imagify_Abstract_DB' => 1,
190
+ 'Imagify_Abstract_Options' => 1,
191
+ 'Imagify_Admin_Ajax_Post' => 1,
192
+ 'Imagify_Assets' => 1,
193
+ 'Imagify_Attachment' => 1,
194
+ 'Imagify_Cron_Library_Size' => 1,
195
+ 'Imagify_Cron_Rating' => 1,
196
+ 'Imagify_Cron_Sync_Files' => 1,
197
+ 'Imagify_Custom_Folders' => 1,
198
+ 'Imagify_Data' => 1,
199
+ 'Imagify_DB' => 1,
200
+ 'Imagify_File_Attachment' => 1,
201
+ 'Imagify_Files_DB' => 1,
202
+ 'Imagify_Files_Iterator' => 1,
203
+ 'Imagify_Files_List_Table' => 1,
204
+ 'Imagify_Files_Recursive_Iterator' => 1,
205
+ 'Imagify_Files_Scan' => 1,
206
+ 'Imagify_Files_Stats' => 1,
207
+ 'Imagify_Filesystem' => 1,
208
+ 'Imagify_Folders_DB' => 1,
209
+ 'Imagify_Notices' => 1,
210
+ 'Imagify_Options' => 1,
211
+ 'Imagify_Requirements' => 1,
212
+ 'Imagify_Settings' => 1,
213
+ 'Imagify_User' => 1,
214
+ 'Imagify_Views' => 1,
215
+ 'Imagify' => 1,
216
+ 'WP_Async_Request' => 1,
217
+ 'WP_Background_Process' => 1,
218
  );
219
 
220
  if ( isset( $classes[ $class ] ) ) {
inc/functions/compat-spl-autoload.php CHANGED
@@ -6,7 +6,7 @@
6
  * See https://core.trac.wordpress.org/ticket/41134
7
  */
8
 
9
- defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
10
 
11
  if ( ! function_exists( 'spl_autoload_register' ) ) :
12
  $_wp_spl_autoloaders = array();
6
  * See https://core.trac.wordpress.org/ticket/41134
7
  */
8
 
9
+ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
10
 
11
  if ( ! function_exists( 'spl_autoload_register' ) ) :
12
  $_wp_spl_autoloaders = array();
inc/functions/compat.php CHANGED
@@ -57,40 +57,6 @@ if ( ! function_exists( 'array_replace' ) ) :
57
  }
58
  endif;
59
 
60
- if ( ! function_exists( 'hash_equals' ) ) :
61
- /**
62
- * Timing attack safe string comparison
63
- *
64
- * Compares two strings using the same time whether they're equal or not.
65
- *
66
- * This function was added in PHP 5.6.
67
- *
68
- * Note: It can leak the length of a string when arguments of differing length are supplied.
69
- *
70
- * @since 1.7
71
- * @since PHP 5.6.0
72
- * @since WP 3.9.2
73
- *
74
- * @param string $a Expected string.
75
- * @param string $b Actual, user supplied, string.
76
- * @return bool Whether strings are equal.
77
- */
78
- function hash_equals( $a, $b ) {
79
- $a_length = strlen( $a );
80
- if ( strlen( $b ) !== $a_length ) {
81
- return false;
82
- }
83
- $result = 0;
84
-
85
- // Do not attempt to "optimize" this.
86
- for ( $i = 0; $i < $a_length; $i++ ) {
87
- $result |= ord( $a[ $i ] ) ^ ord( $b[ $i ] );
88
- }
89
-
90
- return 0 === $result;
91
- }
92
- endif;
93
-
94
  // SPL can be disabled on PHP 5.2.
95
  if ( ! function_exists( 'spl_autoload_register' ) ) :
96
  require_once IMAGIFY_FUNCTIONS_PATH . 'compat-spl-autoload.php';
@@ -300,47 +266,6 @@ if ( ! function_exists( '_wp_json_convert_string' ) ) :
300
  }
301
  endif;
302
 
303
- if ( ! function_exists( 'wp_normalize_path' ) ) :
304
- /**
305
- * Normalize a filesystem path.
306
- *
307
- * On windows systems, replaces backslashes with forward slashes
308
- * and forces upper-case drive letters.
309
- * Allows for two leading slashes for Windows network shares, but
310
- * ensures that all other duplicate slashes are reduced to a single.
311
- *
312
- * @since 1.6.7
313
- * @since WP 3.9.0
314
- * @since WP 4.4.0 Ensures upper-case drive letters on Windows systems.
315
- * @since WP 4.5.0 Allows for Windows network shares.
316
- * @since WP 5.0 Allows for PHP file wrappers.
317
- *
318
- * @param string $path Path to normalize.
319
- * @return string Normalized path.
320
- */
321
- function wp_normalize_path( $path ) {
322
- $wrapper = '';
323
-
324
- if ( wp_is_stream( $path ) ) {
325
- list( $wrapper, $path ) = explode( '://', $path, 2 );
326
- $wrapper .= '://';
327
- }
328
-
329
- // Standardise all paths to use /.
330
- $path = str_replace( '\\', '/', $path );
331
-
332
- // Replace multiple slashes down to a singular, allowing for network shares having two slashes.
333
- $path = preg_replace( '|(?<=.)/+|', '/', $path );
334
-
335
- // Windows paths should uppercase the drive letter.
336
- if ( ':' === substr( $path, 1, 1 ) ) {
337
- $path = ucfirst( $path );
338
- }
339
-
340
- return $wrapper . $path;
341
- }
342
- endif;
343
-
344
  if ( ! function_exists( 'wp_parse_url' ) ) :
345
  /**
346
  * A wrapper for PHP's parse_url() function that handles consistency in the return
@@ -488,40 +413,6 @@ if ( ! function_exists( 'wp_get_additional_image_sizes' ) ) :
488
  }
489
  endif;
490
 
491
- if ( ! function_exists( 'doing_filter' ) ) :
492
- /**
493
- * Retrieve the name of a filter currently being processed.
494
- *
495
- * The function current_filter() only returns the most recent filter or action
496
- * being executed. did_action() returns true once the action is initially
497
- * processed.
498
- *
499
- * This function allows detection for any filter currently being
500
- * executed (despite not being the most recent filter to fire, in the case of
501
- * hooks called from hook callbacks) to be verified.
502
- *
503
- * @since 1.6.11
504
- * @since WP 3.9.0
505
- *
506
- * @see current_filter()
507
- * @see did_action()
508
- * @global array $wp_current_filter Current filter.
509
- *
510
- * @param null|string $filter Optional. Filter to check. Defaults to null, which
511
- * checks if any filter is currently being run.
512
- * @return bool Whether the filter is currently in the stack.
513
- */
514
- function doing_filter( $filter = null ) {
515
- global $wp_current_filter;
516
-
517
- if ( null === $filter ) {
518
- return ! empty( $wp_current_filter );
519
- }
520
-
521
- return in_array( $filter, $wp_current_filter, true );
522
- }
523
- endif;
524
-
525
  if ( ! function_exists( 'wp_scripts' ) ) :
526
  /**
527
  * Initialize $wp_scripts if it has not been set.
57
  }
58
  endif;
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  // SPL can be disabled on PHP 5.2.
61
  if ( ! function_exists( 'spl_autoload_register' ) ) :
62
  require_once IMAGIFY_FUNCTIONS_PATH . 'compat-spl-autoload.php';
266
  }
267
  endif;
268
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  if ( ! function_exists( 'wp_parse_url' ) ) :
270
  /**
271
  * A wrapper for PHP's parse_url() function that handles consistency in the return
413
  }
414
  endif;
415
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
416
  if ( ! function_exists( 'wp_scripts' ) ) :
417
  /**
418
  * Initialize $wp_scripts if it has not been set.
inc/functions/deprecated.php CHANGED
@@ -402,7 +402,7 @@ if ( function_exists( 'emr_delete_current_files' ) ) :
402
 
403
  _deprecated_function( __FUNCTION__ . '()', '1.6.9', 'imagify_enable_media_replace()->optimize()' );
404
 
405
- $attachment_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid='%s';", $guid ) );
406
 
407
  if ( ! $attachment_id ) {
408
  return;
402
 
403
  _deprecated_function( __FUNCTION__ . '()', '1.6.9', 'imagify_enable_media_replace()->optimize()' );
404
 
405
+ $attachment_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid = %s;", $guid ) );
406
 
407
  if ( ! $attachment_id ) {
408
  return;
inc/functions/formatting.php CHANGED
@@ -38,13 +38,20 @@ function imagify_round_half_five( $number ) {
38
  * This is a clone of size_format(), but with a non-breaking space.
39
  *
40
  * @since 1.7
 
41
  * @author Grégory Viguier
42
  *
43
  * @param int|string $bytes Number of bytes. Note max integer size for integers.
44
- * @param int $decimals Optional. Precision of number of decimal places. Default 0.
 
45
  * @return string|false False on failure. Number string on success.
46
  */
47
- function imagify_size_format( $bytes, $decimals = 0 ) {
 
 
 
 
 
48
  $bytes = @size_format( $bytes, $decimals );
49
  return str_replace( ' ', ' ', $bytes );
50
  }
38
  * This is a clone of size_format(), but with a non-breaking space.
39
  *
40
  * @since 1.7
41
+ * @since 1.8.1 Automatic $decimals.
42
  * @author Grégory Viguier
43
  *
44
  * @param int|string $bytes Number of bytes. Note max integer size for integers.
45
+ * @param int $decimals Optional. Precision of number of decimal places.
46
+ * If negative or not an integer, $decimals value is "automatic": 0 if $bytes <= 1GB, or 1 if > 1GB.
47
  * @return string|false False on failure. Number string on success.
48
  */
49
+ function imagify_size_format( $bytes, $decimals = -1 ) {
50
+
51
+ if ( $decimals < 0 || ! is_int( $decimals ) ) {
52
+ $decimals = $bytes > pow( 1024, 3 ) ? 1 : 0;
53
+ }
54
+
55
  $bytes = @size_format( $bytes, $decimals );
56
  return str_replace( ' ', ' ', $bytes );
57
  }
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Imagify Image Optimizer ===
2
  Contributors: wp_media, GregLone
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.9.6
6
- Stable tag: 1.8.0.1
7
 
8
  Dramatically reduce image file sizes without losing quality, make your website load faster, boost your SEO and save money on your bandwidth.
9
 
@@ -138,6 +138,17 @@ When the plugin is disabled, your existing images remain optimized. Backups of t
138
  4. Other Media Page
139
 
140
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
141
  = 1.8.0.1 - 2018/06/19 =
142
  * Bug Fix: issue on some sites displaying a "no php extension available".
143
 
1
  === Imagify Image Optimizer ===
2
  Contributors: wp_media, GregLone
3
  Tags: compress image, images, performance, optimization, photos, upload, resize, gif, png, jpg, reduce image size, retina
4
+ Requires at least: 4.0.0
5
+ Tested up to: 4.9.7
6
+ Stable tag: 1.8.1.1
7
 
8
  Dramatically reduce image file sizes without losing quality, make your website load faster, boost your SEO and save money on your bandwidth.
9
 
138
  4. Other Media Page
139
 
140
  == Changelog ==
141
+ = 1.8.1.1 - 2018/07/31 =
142
+ * Bug Fix: an open_basedir error that prevented some users to use the custom folders browser.
143
+ * Bug Fix: an error that prevented to create the backup folder (and other things) on multisite.
144
+
145
+ = 1.8.1 - 2018/07/18 =
146
+ * Imagify now requires WordPress 4.0 at least! This value may increase in the future, like required php version.
147
+ * Bug Fix: improved support of sites having the "wp-content" folder outside WordPress folder.
148
+ * Bug Fix: improved the plan recommendation tool: better choices, and pre-select only what is needed.
149
+ * Bug fix: fixed a wrong color on a quota bar.
150
+ * Lots of various small fixes and code improvements.
151
+
152
  = 1.8.0.1 - 2018/06/19 =
153
  * Bug Fix: issue on some sites displaying a "no php extension available".
154
 
views/modal-payment.php CHANGED
@@ -1,19 +1,19 @@
1
  <?php
2
  defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
3
-
4
  ?>
5
  <div id="imagify-pricing-modal" class="imagify-modal imagify-payment-modal hide-if-no-js" aria-hidden="false" role="dialog">
6
  <div class="imagify-modal-content">
7
  <div class="imagify-modal-main">
8
- <div class="imagify-modal-views imagify-pre-checkout-view" id="imagify-pre-checkout-view" aria-hidden="false">
9
 
10
- <?php
11
- $attachments_number = imagify_count_attachments() + Imagify_Files_Stats::count_all_files();
12
- $total_size = Imagify_Data::get_instance()->get( 'total_size_images_library' );
13
- $per_month = Imagify_Data::get_instance()->get( 'average_size_images_per_month' );
14
- ?>
 
 
15
 
16
- <div class="imagify-modal-section section-gray imagify-estimation-block<?php echo false === $total_size ? ' imagify-analyzing' : ''; ?>">
17
  <p class="imagify-modal-title">
18
  <span class="imagify-numbers-calc"><?php esc_html_e( 'We analysed your images', 'imagify' ); ?></span>
19
  <span class="imagify-numbers-notcalc"><?php esc_html_e( 'We are analysing your images', 'imagify' ); ?></span>
@@ -26,6 +26,8 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
26
  <p>
27
  <span class="imagify-border-styled">
28
  <?php
 
 
29
  printf(
30
  /* translators: %s is a formatted number (don't use %d). */
31
  _n( 'You have %s original image', 'You have %s original images', $attachments_number, 'imagify' ),
@@ -42,7 +44,7 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
42
  printf(
43
  /* translators: %s is a formatted file size. */
44
  esc_html__( 'You currently have %s of images in your library and folders.', 'imagify' ),
45
- '<strong class="imagify-dark total-library-size">' . ( is_float( $total_size ) ? imagify_size_format( $total_size ) : '' ) . '</strong>'
46
  );
47
  ?>
48
  </p>
@@ -52,7 +54,7 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
52
  printf(
53
  /* translators: %s is a formatted file size. */
54
  esc_html__( 'You upload around %s of images per month.', 'imagify' ),
55
- '<strong class="imagify-dark average-month-size">' . ( is_float( $per_month ) ? imagify_size_format( $per_month ) : '' ) . '</strong>'
56
  );
57
  ?>
58
  </p>
1
  <?php
2
  defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
 
3
  ?>
4
  <div id="imagify-pricing-modal" class="imagify-modal imagify-payment-modal hide-if-no-js" aria-hidden="false" role="dialog">
5
  <div class="imagify-modal-content">
6
  <div class="imagify-modal-main">
 
7
 
8
+ <?php
9
+ /**
10
+ * FIRST MODAL VIEW.
11
+ */
12
+ ?>
13
+
14
+ <div class="imagify-modal-views imagify-pre-checkout-view" id="imagify-pre-checkout-view" aria-hidden="false">
15
 
16
+ <div class="imagify-modal-section section-gray imagify-estimation-block imagify-analyzing">
17
  <p class="imagify-modal-title">
18
  <span class="imagify-numbers-calc"><?php esc_html_e( 'We analysed your images', 'imagify' ); ?></span>
19
  <span class="imagify-numbers-notcalc"><?php esc_html_e( 'We are analysing your images', 'imagify' ); ?></span>
26
  <p>
27
  <span class="imagify-border-styled">
28
  <?php
29
+ $attachments_number = imagify_count_attachments() + Imagify_Files_Stats::count_all_files();
30
+
31
  printf(
32
  /* translators: %s is a formatted number (don't use %d). */
33
  _n( 'You have %s original image', 'You have %s original images', $attachments_number, 'imagify' ),
44
  printf(
45
  /* translators: %s is a formatted file size. */
46
  esc_html__( 'You currently have %s of images in your library and folders.', 'imagify' ),
47
+ '<strong class="imagify-dark total-library-size">0</strong>'
48
  );
49
  ?>
50
  </p>
54
  printf(
55
  /* translators: %s is a formatted file size. */
56
  esc_html__( 'You upload around %s of images per month.', 'imagify' ),
57
+ '<strong class="imagify-dark average-month-size">0</strong>'
58
  );
59
  ?>
60
  </p>
views/notice-almost-over-quota.php CHANGED
@@ -5,27 +5,24 @@ $this->print_template( 'notice-header', array(
5
  'classes' => array( 'imagify-flex-notice-content', 'error' ),
6
  ) );
7
 
8
- $user = new Imagify_User();
9
- $unconsumed_quota = $user->get_percent_unconsumed_quota();
10
- $meteo_icon = '<img src="' . IMAGIFY_ASSETS_IMG_URL . 'stormy.svg" width="64" height="63" alt="" />';
11
- $bar_class = 'negative';
12
  ?>
13
  <div class="imagify-notice-quota">
14
  <div class="imagify-flex imagify-vcenter">
15
- <span class="imagify-meteo-icon imagify-noshrink"><?php echo $meteo_icon; ?></span>
16
  <div class="imagify-space-left">
17
  <p>
18
  <?php
19
  printf(
20
  /* translators: %s is a data quota. */
21
  esc_html__( 'You have %s space credit left' , 'imagify' ),
22
- '<span class="imagify-unconsumed-percent">' . $unconsumed_quota . '%</span>'
23
  );
24
  ?>
25
  </p>
26
 
27
- <div class="imagify-bar-<?php echo $bar_class; ?>">
28
- <div class="imagify-unconsumed-bar imagify-progress" style="width: <?php echo $unconsumed_quota . '%'; ?>;"></div>
29
  </div>
30
  </div>
31
  </div>
5
  'classes' => array( 'imagify-flex-notice-content', 'error' ),
6
  ) );
7
 
8
+ $views = Imagify_Views::get_instance();
 
 
 
9
  ?>
10
  <div class="imagify-notice-quota">
11
  <div class="imagify-flex imagify-vcenter">
12
+ <span class="imagify-meteo-icon imagify-noshrink"><?php echo $views->get_quota_icon(); ?></span>
13
  <div class="imagify-space-left">
14
  <p>
15
  <?php
16
  printf(
17
  /* translators: %s is a data quota. */
18
  esc_html__( 'You have %s space credit left' , 'imagify' ),
19
+ '<span class="imagify-unconsumed-percent">' . $views->get_quota_percent() . '%</span>'
20
  );
21
  ?>
22
  </p>
23
 
24
+ <div class="<?php echo $views->get_quota_class(); ?>">
25
+ <div class="imagify-unconsumed-bar imagify-progress" style="width: <?php echo $views->get_quota_percent() . '%'; ?>;"></div>
26
  </div>
27
  </div>
28
  </div>
views/page-bulk.php CHANGED
@@ -104,23 +104,8 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
104
 
105
  <?php if ( $user && 1 === $user->plan_id ) { ?>
106
  <div class="imagify-col-content">
107
- <?php
108
- $unconsumed_quota = $user->get_percent_unconsumed_quota();
109
- $meteo_icon = '<img src="' . IMAGIFY_ASSETS_IMG_URL . 'sun.svg" width="63" height="64" alt="" />';
110
- $bar_class = 'positive';
111
- $is_display_bubble = false;
112
-
113
- if ( $unconsumed_quota >= 21 && $unconsumed_quota <= 50 ) {
114
- $bar_class = 'neutral';
115
- $meteo_icon = '<img src="' . IMAGIFY_ASSETS_IMG_URL . 'cloudy-sun.svg" width="63" height="64" alt="" />';
116
- } elseif ( $unconsumed_quota <= 20 ) {
117
- $bar_class = 'negative';
118
- $is_display_bubble = true;
119
- $meteo_icon = '<img src="' . IMAGIFY_ASSETS_IMG_URL . 'stormy.svg" width="64" height="63" alt="" />';
120
- }
121
- ?>
122
  <div class="imagify-flex imagify-vcenter">
123
- <span class="imagify-meteo-icon imagify-noshrink"><?php echo $meteo_icon; ?></span>
124
  <div class="imagify-space-left imagify-full-width">
125
 
126
  <p>
@@ -128,13 +113,13 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
128
  printf(
129
  /* translators: %s is a data quota. */
130
  __( 'You have %s space credit left' , 'imagify' ),
131
- '<span class="imagify-unconsumed-percent">' . $unconsumed_quota . '%</span>'
132
  );
133
  ?>
134
  </p>
135
 
136
- <div class="imagify-bar-<?php echo $bar_class; ?>">
137
- <div class="imagify-unconsumed-bar imagify-progress" style="width: <?php echo $unconsumed_quota . '%'; ?>;"></div>
138
  </div>
139
  </div>
140
  </div>
@@ -149,9 +134,9 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
149
  <div class="imagify-block-secondary">
150
  <p class="imagify-section-title imagify-h3-like">
151
  <?php
152
- if ( ! $unconsumed_quota ) {
153
  esc_html_e( 'Oops, It\'s Over!', 'imagify' );
154
- } elseif ( $unconsumed_quota <= 20 ) {
155
  esc_html_e( 'Oops, It\'s almost over!', 'imagify' );
156
  } else {
157
  esc_html_e( 'You\'re new to Imagify?', 'imagify' );
@@ -224,16 +209,13 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
224
  <?php
225
 
226
  if ( ! $display_infos ) {
227
- if ( ! isset( $unconsumed_quota ) ) {
228
- $user = $user ? $user : new Imagify_User();
229
- $unconsumed_quota = $user->get_percent_unconsumed_quota();
230
- }
231
  ?>
232
  <script type="text/html" id="tmpl-imagify-bulk-infos">
233
  <?php
234
  $this->print_template( 'part-bulk-optimization-infos', array(
235
- 'quota' => $unconsumed_quota,
236
- 'library' => ! empty( $data['groups']['library'] ),
 
237
  ) );
238
  ?>
239
  </script>
104
 
105
  <?php if ( $user && 1 === $user->plan_id ) { ?>
106
  <div class="imagify-col-content">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  <div class="imagify-flex imagify-vcenter">
108
+ <span class="imagify-meteo-icon imagify-noshrink"><?php echo $this->get_quota_icon(); ?></span>
109
  <div class="imagify-space-left imagify-full-width">
110
 
111
  <p>
113
  printf(
114
  /* translators: %s is a data quota. */
115
  __( 'You have %s space credit left' , 'imagify' ),
116
+ '<span class="imagify-unconsumed-percent">' . $this->get_quota_percent() . '%</span>'
117
  );
118
  ?>
119
  </p>
120
 
121
+ <div class="<?php echo $this->get_quota_class(); ?>">
122
+ <div class="imagify-unconsumed-bar imagify-progress" style="width: <?php echo $this->get_quota_percent() . '%'; ?>;"></div>
123
  </div>
124
  </div>
125
  </div>
134
  <div class="imagify-block-secondary">
135
  <p class="imagify-section-title imagify-h3-like">
136
  <?php
137
+ if ( ! $this->get_quota_percent() ) {
138
  esc_html_e( 'Oops, It\'s Over!', 'imagify' );
139
+ } elseif ( $this->get_quota_percent() <= 20 ) {
140
  esc_html_e( 'Oops, It\'s almost over!', 'imagify' );
141
  } else {
142
  esc_html_e( 'You\'re new to Imagify?', 'imagify' );
209
  <?php
210
 
211
  if ( ! $display_infos ) {
 
 
 
 
212
  ?>
213
  <script type="text/html" id="tmpl-imagify-bulk-infos">
214
  <?php
215
  $this->print_template( 'part-bulk-optimization-infos', array(
216
+ 'quota' => $data['unconsumed_quota'],
217
+ 'quota_class' => $data['quota_class'],
218
+ 'library' => ! empty( $data['groups']['library'] ),
219
  ) );
220
  ?>
221
  </script>
views/page-settings.php CHANGED
@@ -132,7 +132,7 @@ $wrapper_class = isset( $notices[ $notice ] ) || defined( 'WP_ROCKET_VERSION' )
132
 
133
  <div class="imagify-settings-main-content<?php echo $hidden_class; ?>">
134
 
135
- <div class="imagify-settings-section clear">
136
  <h2 class="imagify-options-title"><?php _e( 'Optimization', 'imagify' ); ?></h2>
137
  <?php
138
  $this->print_template( 'part-settings-library' );
@@ -142,7 +142,7 @@ $wrapper_class = isset( $notices[ $notice ] ) || defined( 'WP_ROCKET_VERSION' )
142
  </div>
143
 
144
  <div class="imagify-settings-main-content imagify-pb0<?php echo $hidden_class; ?>">
145
- <div class="imagify-settings-section clear">
146
  <div class="imagify-col">
147
  <h2 class="imagify-options-title"><?php _e( 'Display Options', 'imagify' ); ?></h2>
148
 
132
 
133
  <div class="imagify-settings-main-content<?php echo $hidden_class; ?>">
134
 
135
+ <div class="imagify-settings-section imagify-clear">
136
  <h2 class="imagify-options-title"><?php _e( 'Optimization', 'imagify' ); ?></h2>
137
  <?php
138
  $this->print_template( 'part-settings-library' );
142
  </div>
143
 
144
  <div class="imagify-settings-main-content imagify-pb0<?php echo $hidden_class; ?>">
145
+ <div class="imagify-settings-section imagify-clear">
146
  <div class="imagify-col">
147
  <h2 class="imagify-options-title"><?php _e( 'Display Options', 'imagify' ); ?></h2>
148
 
views/part-bulk-optimization-header.php CHANGED
@@ -3,7 +3,7 @@
3
  <h1 class="screen-reader-text"><?php _e( 'Bulk Optimization', 'imagify' ); ?> – Imagify <?php echo IMAGIFY_VERSION; ?></h1>
4
 
5
  <div class="imagify-title">
6
-
7
  <p class="imagify-logo-block">
8
  <span class="imagify-lb-icon">
9
  <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="#40B1D0"/></g></svg>
3
  <h1 class="screen-reader-text"><?php _e( 'Bulk Optimization', 'imagify' ); ?> – Imagify <?php echo IMAGIFY_VERSION; ?></h1>
4
 
5
  <div class="imagify-title">
6
+
7
  <p class="imagify-logo-block">
8
  <span class="imagify-lb-icon">
9
  <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="#40B1D0"/></g></svg>
views/part-bulk-optimization-infos.php CHANGED
@@ -9,13 +9,13 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
9
  printf(
10
  /* translators: %s is a data quota. */
11
  esc_html__( 'You have %s space credit left' , 'imagify' ),
12
- '<span class="imagify-unconsumed-percent">' . $data['quota'] . '%</span>'
13
  );
14
  ?>
15
  </p>
16
 
17
- <div class="imagify-bar-negative">
18
- <div class="imagify-unconsumed-bar imagify-progress" style="width: <?php echo $data['quota'] . '%'; ?>;"></div>
19
  </div>
20
  </div>
21
  </div>
9
  printf(
10
  /* translators: %s is a data quota. */
11
  esc_html__( 'You have %s space credit left' , 'imagify' ),
12
+ '<span class="imagify-unconsumed-percent">' . esc_html( $data['quota'] ) . '%</span>'
13
  );
14
  ?>
15
  </p>
16
 
17
+ <div class="<?php echo sanitize_html_class( $data['quota_class'] ); ?>">
18
+ <div class="imagify-unconsumed-bar imagify-progress" style="width: <?php echo esc_attr( $data['quota'] ) . '%'; ?>;"></div>
19
  </div>
20
  </div>
21
  </div>
views/part-settings-custom-folders.php CHANGED
@@ -22,8 +22,8 @@ if ( $custom_folders ) {
22
  natcasesort( $custom_folders );
23
  $custom_folders = array_map( 'trailingslashit', $custom_folders );
24
 
25
- if ( isset( $custom_folders['{{ABSPATH}}/'] ) ) {
26
- $custom_folders['{{ABSPATH}}/'] = __( 'Site\'s root', 'imagify' );
27
  }
28
  }
29
 
22
  natcasesort( $custom_folders );
23
  $custom_folders = array_map( 'trailingslashit', $custom_folders );
24
 
25
+ if ( isset( $custom_folders['{{ROOT}}/'] ) ) {
26
+ $custom_folders['{{ROOT}}/'] = __( 'Site\'s root', 'imagify' );
27
  }
28
  }
29
 
views/part-settings-row-custom-folder.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
3
  ?>
4
- <p class="imagify-custom-folder-line" data-path="<?php echo '{{ABSPATH}}/' === $data['value'] ? '/' : esc_attr( $data['label'] ); ?>">
5
  <input type="hidden" name="imagify_settings[custom_folders][]" value="<?php echo esc_attr( $data['value'] ); ?>" />
6
  <?php echo esc_html( $data['label'] ); ?>
7
  <button type="button" class="imagify-custom-folders-remove"><span class="imagify-custom-folders-remove-text"><?php _ex( 'Remove', 'custom folder', 'imagify' ); ?></span><i class="dashicons dashicons-no-alt" aria-hidden="true"></i></button>
1
  <?php
2
  defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
3
  ?>
4
+ <p class="imagify-custom-folder-line" data-path="<?php echo '{{ROOT}}/' === $data['value'] ? '/' : esc_attr( $data['label'] ); ?>">
5
  <input type="hidden" name="imagify_settings[custom_folders][]" value="<?php echo esc_attr( $data['value'] ); ?>" />
6
  <?php echo esc_html( $data['label'] ); ?>
7
  <button type="button" class="imagify-custom-folders-remove"><span class="imagify-custom-folders-remove-text"><?php _ex( 'Remove', 'custom folder', 'imagify' ); ?></span><i class="dashicons dashicons-no-alt" aria-hidden="true"></i></button>