Version Description
- 2017/11/07 =
- New: added links to the documentation in Imagify' settings and bulk optimization pages.
- Improvement: better compatibility with NextGen Gallery plugin. Imagify no longer resizes NextGen images nor removes exif, to let NextGen Gallery do its job peacefully.
- Improvement: better compatibility with WP Real Media Library plugin, our modal wasn't working correctly.
- Improvement: better compatibility with plugins that use cookies, like Duo Two-Factor Authentication and Shield Security, to prevent being disconnected.
- Improvement: better compatibility with SireGround. A "security" measure was preventing Imagify to work correctly.
- Improvement: better compatibility with hosts that limit some SQL queries, it prevented our bulk optimization to work.
- Improvement: better compatibility with Heartbeat Control plugin, it prevented our bulk optimization to work.
- Improvement: better compatibility with Formidable Forms Pro plugin, the bulk optimizer was never satisfied.
- Bug Fix: fixed a few bugs when optimizing in NextGen Gallery.
Download this release
Release Info
Developer | wp_media |
Plugin | Imagify Image Optimizer |
Version | 1.6.13 |
Comparing to | |
See all releases |
Code changes from version 1.6.12 to 1.6.13
- assets/css/bulk.css +17 -0
- assets/css/bulk.min.css +1 -1
- assets/css/options.css +27 -0
- assets/css/options.min.css +1 -1
- assets/images/big-blue-check.png +0 -0
- assets/images/icon-arrow-choice.png +0 -0
- assets/images/icon-arrow-choice.svg +0 -0
- assets/images/icon-lock.png +0 -0
- assets/images/icon-lock.svg +0 -0
- assets/images/icon-pack.png +0 -0
- assets/images/icon-pack.svg +0 -0
- assets/images/pic-ericwaltr.jpg +0 -0
- assets/images/pic-srhdesign.jpg +0 -0
- assets/js/imagify-gulp.js +0 -0
- assets/js/imagify-gulp.min.js +0 -0
- imagify.php +2 -2
- inc/3rd-party/3rd-party.php +9 -1
- inc/3rd-party/amazon-s3-and-cloudfront/inc/classes/class-imagify-as3cf-attachment.php +1 -2
- inc/3rd-party/amazon-s3-and-cloudfront/inc/classes/class-imagify-as3cf.php +12 -9
- inc/3rd-party/enable-media-replace/inc/classes/class-imagify-enable-media-replace.php +4 -5
- inc/3rd-party/formidable-pro/formidable-pro.php +8 -0
- inc/3rd-party/formidable-pro/inc/classes/class-imagify-formidable-pro.php +99 -0
- inc/3rd-party/hosting/siteground.php +32 -0
- inc/3rd-party/hosting/wpengine.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/admin/ajax.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/admin/bulk.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/admin/db.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/admin/enqueue.php +1 -5
- inc/3rd-party/nextgen-gallery/inc/admin/gallery.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/admin/heartbeat.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/admin/menu.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/classes/class-imagify-ngg-attachment.php +30 -69
- inc/3rd-party/nextgen-gallery/inc/classes/class-imagify-ngg-db.php +26 -33
- inc/3rd-party/nextgen-gallery/inc/common/attachments.php +36 -19
- inc/3rd-party/nextgen-gallery/inc/functions/admin-stats.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/functions/attachments.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/functions/common.php +18 -0
- inc/3rd-party/wp-real-media-library.php +61 -0
- inc/3rd-party/wp-retina-2x.php +1 -2
- inc/3rd-party/wp-rocket.php +0 -0
- inc/admin/media.php +4 -6
- inc/admin/meta-boxes.php +4 -5
- inc/admin/ui/bulk.php +11 -2
- inc/admin/ui/options.php +7 -2
- inc/admin/upgrader.php +9 -11
- inc/admin/upload.php +1 -2
- inc/classes/class-imagify-abstract-attachment.php +67 -61
- inc/classes/class-imagify-abstract-db.php +43 -49
- inc/classes/class-imagify-admin-ajax-post.php +15 -22
- inc/classes/class-imagify-assets.php +1 -1
- inc/classes/class-imagify-attachment.php +13 -14
- inc/classes/class-imagify-db.php +188 -0
- inc/common/attachments.php +4 -4
- inc/functions/admin-stats.php +12 -19
- inc/functions/admin-ui.php +2 -2
- inc/functions/admin.php +0 -86
- inc/functions/common.php +2 -0
- inc/functions/deprecated.php +72 -6
- inc/functions/formatting.php +16 -0
- inc/functions/process.php +16 -23
- readme.txt +33 -22
assets/css/bulk.css
CHANGED
@@ -223,6 +223,23 @@ body[class*="_imagify-ngg-bulk-optimization"] .media-item .progress .bar {
|
|
223 |
border-radius: 4px;
|
224 |
line-height: 1.6;
|
225 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
.imagify-list-infos .imagify-alt.imagify-alt {
|
227 |
background: #8BA7B5;
|
228 |
color: #FFF;
|
223 |
border-radius: 4px;
|
224 |
line-height: 1.6;
|
225 |
}
|
226 |
+
/* documentation exception */
|
227 |
+
.imagify-documentation-link-box:after,
|
228 |
+
.imagify-documentation-link-box:before {
|
229 |
+
display: none;
|
230 |
+
}
|
231 |
+
.imagify-list-infos .imagify-documentation-link-box {
|
232 |
+
display: flex;
|
233 |
+
align-items: center;
|
234 |
+
padding-left: 12px;
|
235 |
+
border: 1px solid #338EA6;
|
236 |
+
background: #D9E4EC;
|
237 |
+
}
|
238 |
+
.imagify-documentation-icon {
|
239 |
+
width: 15px;
|
240 |
+
height: 20px;
|
241 |
+
margin-right: 15px;
|
242 |
+
}
|
243 |
.imagify-list-infos .imagify-alt.imagify-alt {
|
244 |
background: #8BA7B5;
|
245 |
color: #FFF;
|
assets/css/bulk.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#imagify-overview-chart-legend{overflow:hidden}.imagify-doughnut-legend{margin-top:38px;list-style:none}.imagify-doughnut-legend li{display:block;padding-left:30px;position:relative;margin-bottom:15px;border-radius:5px;padding:3px 8px 2px 31px;font-size:14px;font-weight:600;cursor:default;-webkit-transition:background-color .2s ease-in-out;-o-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.imagify-doughnut-legend li span{display:block;position:absolute;left:0;top:0;width:25px;height:25px;border-radius:50%}.imagify-global-optim-phrase{width:180px;padding-top:20px;font-size:14px;font-weight:700;text-align:center}.imagify-total-percent{color:#46b1ce}.imagify-chart-percent{position:absolute;left:0;right:0;top:50%;margin-top:-14px;text-align:center;font-size:55px;font-weight:700;color:#46B1CE}.imagify-chart-percent span{font-size:20px;vertical-align:super}.media_page_imagify-bulk-optimization .media-item,body[class*="_imagify-ngg-bulk-optimization"] .media-item{margin:0}.media_page_imagify-bulk-optimization .media-item .progress,body[class*="_imagify-ngg-bulk-optimization"] .media-item .progress{float:none;width:100%;margin:0;background:#1F2331;-webkit-box-shadow:0;box-shadow:0;border-radius:0}.media_page_imagify-bulk-optimization .media-item .percent,body[class*="_imagify-ngg-bulk-optimization"] .media-item .percent{width:auto;padding:0 5px;line-height:1.85;font-size:12px}.media_page_imagify-bulk-optimization .media-item .percent,.media_page_imagify-bulk-optimization .media-item .progress,body[class*="_imagify-ngg-bulk-optimization"] .media-item .percent,body[class*="_imagify-ngg-bulk-optimization"] .media-item .progress{text-align:right}.media_page_imagify-bulk-optimization .media-item .progress .bar,body[class*="_imagify-ngg-bulk-optimization"] .media-item .progress .bar{width:1px;height:22px;margin-top:0;background:#46B1CE;border-radius:0;overflow:visible;-webkit-transition:width .5s;-o-transition:width .5s;transition:width .5s}#imagify-bulk-action{padding:11px 20px}.imagify-columns .col-overview.col-overview{padding-left:20px}.imagify-columns .col-informations.col-informations{width:36.6%;padding-right:30px}.imagify-columns .col-statistics.col-statistics{width:30%}.imagify-bulk-submit .imagify-inline-options input[type=radio]:checked+label,.imagify-bulk-submit .imagify-inline-options input[type=radio]:not(:checked)+label{margin-bottom:1.75em}.imagify-title-right{display:table;float:right;margin-top:-10px;-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.imagify-title-right p{margin:0}.imagify-title-right a{font-weight:700;text-decoration:none}.imagify-title-right>div{display:table-cell;vertical-align:middle}.imagify-title-right .dashicons-arrow-down-alt2{vertical-align:-4px;margin-left:2px}@media (max-width:1200px){.imagify-bulk .imagify-title{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.imagify-title-right{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2;margin-top:20px}}.imagify-sep-v{width:1px;background:rgba(255,255,255,.2)}.imagify-credit-left{position:relative;min-width:280px;padding-left:15px}@media (max-width:630px){.imagify-title-right,.imagify-title-right>div{display:block;width:auto}.imagify-title-right>div{margin-top:10px;max-width:100%}.imagify-credit-left{padding-left:0}}.base-transparent{background:0 0}[class^=imagify-bar-].right-outside-number{-webkit-box-sizing:border-box;box-sizing:border-box;padding-right:4.5em}.right-outside-number .imagify-barnb{display:block;margin-right:-4.5em;text-align:right;font-weight:700;line-height:1.5}.imagify-list-infos{max-width:100%;width:415px}.imagify-info-block,.imagify-list-infos li{position:relative;padding:10px;padding-left:42px;background:#D9E4EB;border-radius:4px;line-height:1.6}.imagify-list-infos .imagify-alt.imagify-alt{background:#8BA7B5;color:#FFF;font-weight:700}.imagify-list-infos li+li{margin-top:1em}.imagify-info-block:before,.imagify-list-infos li:before{content:"";position:absolute;left:13px;top:14px;height:16px;width:16px;border:1px solid #46b1ce;border-radius:10px}.imagify-info-block:after,.imagify-list-infos li:after{content:"i";position:absolute;left:20px;top:13px;font-style:italic;color:#46b1ce}.imagify-cell .imagify-info-block{padding-top:0}.imagify-cell .imagify-info-block:after{top:6px}.imagify-cell .imagify-info-block:before{top:7px}.imagify-list-infos .imagify-alt:after,.imagify-list-infos .imagify-alt:before{color:#fff;border-color:#fff}.imagify-sub-title.imagify-sub-title{font-size:23px;background:#FFF;color:#2E3243;border-left:1px solid #D9D9D9;border-right:1px solid #D9D9D9;font-weight:lighter}.imagify-sub-title .icon-bulk{margin-right:10px;vertical-align:middle}.imagify-sub-title .title-text{display:inline-block;line-height:1;vertical-align:middle}.imagify-bulk .imagify-settings-section{border:1px solid #D9D9D9;border-top:0;background:#F2F5F7;color:#4A4A4A}.imagify-bulk .imagify-settings-section h3,.imagify-bulk .imagify-settings-section li,.imagify-bulk .imagify-settings-section p{color:#4A4A4A}.imagify-bulk .imagify-settings-section h3{margin-bottom:2em}.imagify-title .imagify-tooltips{position:absolute;top:100%;left:0}.imagify-tooltips .icon-round{float:left;display:inline-block;width:28px;height:28px;border:1px solid #FFF;margin-right:8px;margin-bottom:8px;font-size:17px;font-style:italic;line-height:29px;font-weight:700;text-align:center;border-radius:50%}.imagify-tooltips .tooltip-content{display:block;position:relative;max-width:250px;padding:7px 15px 8px;background:#2e3242;color:#FFF;font-size:10px;border-radius:3px}.imagify-tooltips.right .tooltip-content{margin-left:12px}.imagify-tooltips.bottom .tooltip-content{margin-top:4px}.imagify-inline-options label .tooltip-content{position:absolute;left:0;right:0;top:100%;text-transform:none;font-size:10px;letter-spacing:0;text-align:center}.imagify-ac-rt-big,.imagistatus{text-transform:uppercase;font-weight:700}.imagify-tooltips .tooltip-content:after{content:"";position:absolute}.imagify-tooltips.right .tooltip-content:after{top:16px;left:-6px;border-right:8px solid #2e3242;border-top:6px solid transparent;border-bottom:6px solid transparent}.imagify-tooltips.bottom .tooltip-content:after{top:-5px;left:50%;margin-left:-3px;border-bottom:6px solid #2e3242;border-left:6px solid transparent;border-right:6px solid transparent}.imagify-space-tooltips .tooltip-content{max-width:280px;margin-top:20px;margin-left:0;padding:5px 15px;font-size:13px;background:#40B1D0;-webkit-box-shadow:0 3px 0 #338EA6;box-shadow:0 3px 0 #338EA6}.imagify-space-tooltips .tooltip-content:after{top:-14px;left:50%;margin-left:-7px;border:0;border-bottom:15px solid #40B1D0;border-left:15px solid transparent;border-right:15px solid transparent}.tooltip-content.tooltip-table{display:table;width:100%}.tooltip-content.tooltip-table>*{display:table-cell;vertical-align:middle}.tooltip-content .cell-icon{width:28px}.tooltip-content .cell-icon .icon{margin-bottom:0}.tooltip-content .cell-text{padding:5px 10px 5px 0;line-height:1.3}.tooltip-content .cell-sep{width:1px;background:rgba(255,255,255,.4)}.tooltip-content .cell-cta{padding-left:10px}.tooltip-content .cell-cta a{display:block;color:#FFF;width:100%;height:100%;white-space:nowrap}.imagify-number-you-optimized .number{display:table-cell;padding-right:15px;font-size:36px;font-weight:700;line-height:1.1;vertical-align:middle;white-space:nowrap}.imagify-number-you-optimized .text{display:table-cell;vertical-align:middle;overflow:hidden;font-size:12px}.imagify-number-you-optimized .text br{display:none}.imagify-number-you-optimized>p{display:table}.imagify-number-you-optimized{padding-bottom:.85em;margin-bottom:1.35em;overflow:hidden;border-bottom:1px solid rgba(0,0,0,.05)}.imagify-bars p{font-weight:700;font-size:12px;margin-bottom:0}.imagify-bars+.imagify-number-you-optimized{border-bottom:0;padding-top:.85em}.imagify-bars+.imagify-number-you-optimized p{color:#46b1ce}.imagify-bulk-table{margin-top:2em;max-height:600px;max-height:60vh;overflow:auto}.imagify-ac-report-text,.imagiuploaded{overflow:hidden}.imagify-bulk-table table{width:100%;border-spacing:0;border-collapse:collapse;border:1px solid #D3D3D3}.imagify-bulk-table td{padding:8px 15px}.imagify-bulk-table thead th,.imagify-bulk-table thead tr{background:#2E3242}.imagify-bulk-table tfoot th,.imagify-bulk-table tfoot tr{background:#73818C}.imagify-bulk-table thead th{padding:14px 15px;text-align:left;color:#F2F5F7;font-weight:700;font-size:14px}.imagify-bulk-table tfoot td{padding:14px 15px;color:#F9FAFA}.imagify-bulk-table tbody td,.imagify-bulk-table tbody tr{background:#FFF}.imagify-bulk-table tbody tr:nth-child(odd),.imagify-bulk-table tbody tr:nth-child(odd) td{background:#F2F5F7}.imagify-bulk-table .imagify-row-progress{display:none}.imagify-bulk-table .imagify-row-progress,.imagify-bulk-table .imagify-row-progress td{height:15px;padding:0}.imagify-bulk-table .imagify-no-uploaded-yet td{height:200px;font-size:17px;letter-spacing:.1em;word-spacing:.12em;vertical-align:middle;text-transform:uppercase;font-weight:700;text-align:center;color:#999;background-color:#FFF}.imagify-row-complete{padding:35px 20px;margin-top:2em;background:#8BC34A;color:#FFF;text-shadow:0 0 2px rgba(0,0,0,.1)}.imagify-row-complete .imagify-ac-chart{margin-top:3px}.imagify-row-complete p{color:#FFF;margin:0}@-webkit-keyframes congrate{0%{opacity:0;-webkit-transform:scale(1)}50%{-webkit-transform:scale(1.05);opacity:1}100%{-webkit-transform:scale(1);opacity:1}}@keyframes congrate{0%{opacity:0;-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.05);transform:scale(1.05);opacity:1}100%{-webkit-transform:scale(1);transform:scale(1);opacity:1}}.imagify-row-complete.done{-webkit-animation:congrate .5s ease-in-out;animation:congrate .5s ease-in-out}.imagify-all-complete{margin:1.5em 0}.imagify-all-complete>div{display:inline-block;vertical-align:middle}.imagify-ac-report{min-width:310px}.imagify-ac-chart{width:46px;height:46px;float:left;margin:0 20px 0 10px}.imagify-ac-report-text p{line-height:1.3}.imagify-ac-rt-big{font-size:24px;letter-spacing:.15em;word-spacing:.15em}.imagify-ac-share{text-align:right}.imagify-ac-share-content{display:inline-block;padding:10px 15px;background:rgba(255,255,255,.2)}.imagify-ac-share-content>*{display:inline-block;vertical-align:middle}.imagify-bulk-table .imagify-ac-share-content p{margin-right:5px}.imagify-share-networks,.imagify-share-networks li{margin:0}.imagify-share-networks li{display:inline-block}.imagify-share-networks a{display:inline-block;vertical-align:-7px;margin:0 5px;text-decoration:none;color:#FFF}.imagify-cell-filename{max-width:200px}.imagify-cell-status{max-width:145px}.imagify-cell-status .dashicons-warning{margin-right:2px}.imagify-cell-thumbnails{max-width:120px}td.imagify-cell-filename{-o-text-overflow:clip;text-overflow:clip;white-space:nowrap;overflow:hidden}.imagify-bulk-table .imagify-cell-thumbnails{text-align:center}.imagify-cell-percentage,.imagify-cell-savings{color:#46B1CE;font-weight:700}.imagify-cell-optimized{font-weight:700}.imagify-bulk-table td.imagify-cell-totaloriginal{padding-right:78px}.imagify-cell-totaloriginal{text-align:right}.imagifilename,.imagiuploaded{display:inline-block;vertical-align:middle}.imagifilename{font-size:12px}.imagiuploaded{width:33px;height:33px;margin-right:5px;margin-left:-8px;background:url(../images/upload-image.png) no-repeat;background-size:cover}.imagiuploaded img{max-widht:100%;height:auto}.imagistatus{color:#8CA6B3}.status-compressing{color:#46B1CE}.status-error{color:#CE0B24}.status-warning{color:#f5a623}.status-complete{color:#8CC152}.dashicons.rotate{-webkit-animation:icon-rotate 2.6s infinite linear;animation:icon-rotate 2.6s infinite linear}.imagify-cell-status .dashicons-admin-generic{-webkit-transform-origin:48.75% 51.75%;-ms-transform-origin:48.75% 51.75%;transform-origin:48.75% 51.75%}@-webkit-keyframes icon-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes icon-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}
|
1 |
+
#imagify-overview-chart-legend{overflow:hidden}.imagify-doughnut-legend{margin-top:38px;list-style:none}.imagify-doughnut-legend li{display:block;padding-left:30px;position:relative;margin-bottom:15px;border-radius:5px;padding:3px 8px 2px 31px;font-size:14px;font-weight:600;cursor:default;-webkit-transition:background-color .2s ease-in-out;-o-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.imagify-doughnut-legend li span{display:block;position:absolute;left:0;top:0;width:25px;height:25px;border-radius:50%}.imagify-global-optim-phrase{width:180px;padding-top:20px;font-size:14px;font-weight:700;text-align:center}.imagify-total-percent{color:#46b1ce}.imagify-chart-percent{position:absolute;left:0;right:0;top:50%;margin-top:-14px;text-align:center;font-size:55px;font-weight:700;color:#46B1CE}.imagify-chart-percent span{font-size:20px;vertical-align:super}.media_page_imagify-bulk-optimization .media-item,body[class*="_imagify-ngg-bulk-optimization"] .media-item{margin:0}.media_page_imagify-bulk-optimization .media-item .progress,body[class*="_imagify-ngg-bulk-optimization"] .media-item .progress{float:none;width:100%;margin:0;background:#1F2331;-webkit-box-shadow:0;box-shadow:0;border-radius:0}.media_page_imagify-bulk-optimization .media-item .percent,body[class*="_imagify-ngg-bulk-optimization"] .media-item .percent{width:auto;padding:0 5px;line-height:1.85;font-size:12px}.media_page_imagify-bulk-optimization .media-item .percent,.media_page_imagify-bulk-optimization .media-item .progress,body[class*="_imagify-ngg-bulk-optimization"] .media-item .percent,body[class*="_imagify-ngg-bulk-optimization"] .media-item .progress{text-align:right}.media_page_imagify-bulk-optimization .media-item .progress .bar,body[class*="_imagify-ngg-bulk-optimization"] .media-item .progress .bar{width:1px;height:22px;margin-top:0;background:#46B1CE;border-radius:0;overflow:visible;-webkit-transition:width .5s;-o-transition:width .5s;transition:width .5s}#imagify-bulk-action{padding:11px 20px}.imagify-columns .col-overview.col-overview{padding-left:20px}.imagify-columns .col-informations.col-informations{width:36.6%;padding-right:30px}.imagify-columns .col-statistics.col-statistics{width:30%}.imagify-bulk-submit .imagify-inline-options input[type=radio]:checked+label,.imagify-bulk-submit .imagify-inline-options input[type=radio]:not(:checked)+label{margin-bottom:1.75em}.imagify-title-right{display:table;float:right;margin-top:-10px;-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.imagify-title-right p{margin:0}.imagify-title-right a{font-weight:700;text-decoration:none}.imagify-title-right>div{display:table-cell;vertical-align:middle}.imagify-title-right .dashicons-arrow-down-alt2{vertical-align:-4px;margin-left:2px}@media (max-width:1200px){.imagify-bulk .imagify-title{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.imagify-title-right{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2;margin-top:20px}}.imagify-sep-v{width:1px;background:rgba(255,255,255,.2)}.imagify-credit-left{position:relative;min-width:280px;padding-left:15px}@media (max-width:630px){.imagify-title-right,.imagify-title-right>div{display:block;width:auto}.imagify-title-right>div{margin-top:10px;max-width:100%}.imagify-credit-left{padding-left:0}}.base-transparent{background:0 0}[class^=imagify-bar-].right-outside-number{-webkit-box-sizing:border-box;box-sizing:border-box;padding-right:4.5em}.right-outside-number .imagify-barnb{display:block;margin-right:-4.5em;text-align:right;font-weight:700;line-height:1.5}.imagify-list-infos{max-width:100%;width:415px}.imagify-info-block,.imagify-list-infos li{position:relative;padding:10px;padding-left:42px;background:#D9E4EB;border-radius:4px;line-height:1.6}.imagify-documentation-link-box:after,.imagify-documentation-link-box:before{display:none}.imagify-list-infos .imagify-documentation-link-box{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:12px;border:1px solid #338EA6;background:#D9E4EC}.imagify-documentation-icon{width:15px;height:20px;margin-right:15px}.imagify-list-infos .imagify-alt.imagify-alt{background:#8BA7B5;color:#FFF;font-weight:700}.imagify-list-infos li+li{margin-top:1em}.imagify-info-block:before,.imagify-list-infos li:before{content:"";position:absolute;left:13px;top:14px;height:16px;width:16px;border:1px solid #46b1ce;border-radius:10px}.imagify-info-block:after,.imagify-list-infos li:after{content:"i";position:absolute;left:20px;top:13px;font-style:italic;color:#46b1ce}.imagify-cell .imagify-info-block{padding-top:0}.imagify-cell .imagify-info-block:after{top:6px}.imagify-cell .imagify-info-block:before{top:7px}.imagify-list-infos .imagify-alt:after,.imagify-list-infos .imagify-alt:before{color:#fff;border-color:#fff}.imagify-sub-title.imagify-sub-title{font-size:23px;background:#FFF;color:#2E3243;border-left:1px solid #D9D9D9;border-right:1px solid #D9D9D9;font-weight:lighter}.imagify-sub-title .icon-bulk{margin-right:10px;vertical-align:middle}.imagify-sub-title .title-text{display:inline-block;line-height:1;vertical-align:middle}.imagify-bulk .imagify-settings-section{border:1px solid #D9D9D9;border-top:0;background:#F2F5F7;color:#4A4A4A}.imagify-bulk .imagify-settings-section h3,.imagify-bulk .imagify-settings-section li,.imagify-bulk .imagify-settings-section p{color:#4A4A4A}.imagify-bulk .imagify-settings-section h3{margin-bottom:2em}.imagify-title .imagify-tooltips{position:absolute;top:100%;left:0}.imagify-tooltips .icon-round{float:left;display:inline-block;width:28px;height:28px;border:1px solid #FFF;margin-right:8px;margin-bottom:8px;font-size:17px;font-style:italic;line-height:29px;font-weight:700;text-align:center;border-radius:50%}.imagify-tooltips .tooltip-content{display:block;position:relative;max-width:250px;padding:7px 15px 8px;background:#2e3242;color:#FFF;font-size:10px;border-radius:3px}.imagify-tooltips.right .tooltip-content{margin-left:12px}.imagify-tooltips.bottom .tooltip-content{margin-top:4px}.imagify-inline-options label .tooltip-content{position:absolute;left:0;right:0;top:100%;text-transform:none;font-size:10px;letter-spacing:0;text-align:center}.imagify-ac-rt-big,.imagistatus{text-transform:uppercase;font-weight:700}.imagify-tooltips .tooltip-content:after{content:"";position:absolute}.imagify-tooltips.right .tooltip-content:after{top:16px;left:-6px;border-right:8px solid #2e3242;border-top:6px solid transparent;border-bottom:6px solid transparent}.imagify-tooltips.bottom .tooltip-content:after{top:-5px;left:50%;margin-left:-3px;border-bottom:6px solid #2e3242;border-left:6px solid transparent;border-right:6px solid transparent}.imagify-space-tooltips .tooltip-content{max-width:280px;margin-top:20px;margin-left:0;padding:5px 15px;font-size:13px;background:#40B1D0;-webkit-box-shadow:0 3px 0 #338EA6;box-shadow:0 3px 0 #338EA6}.imagify-space-tooltips .tooltip-content:after{top:-14px;left:50%;margin-left:-7px;border:0;border-bottom:15px solid #40B1D0;border-left:15px solid transparent;border-right:15px solid transparent}.tooltip-content.tooltip-table{display:table;width:100%}.tooltip-content.tooltip-table>*{display:table-cell;vertical-align:middle}.tooltip-content .cell-icon{width:28px}.tooltip-content .cell-icon .icon{margin-bottom:0}.tooltip-content .cell-text{padding:5px 10px 5px 0;line-height:1.3}.tooltip-content .cell-sep{width:1px;background:rgba(255,255,255,.4)}.tooltip-content .cell-cta{padding-left:10px}.tooltip-content .cell-cta a{display:block;color:#FFF;width:100%;height:100%;white-space:nowrap}.imagify-number-you-optimized .number{display:table-cell;padding-right:15px;font-size:36px;font-weight:700;line-height:1.1;vertical-align:middle;white-space:nowrap}.imagify-number-you-optimized .text{display:table-cell;vertical-align:middle;overflow:hidden;font-size:12px}.imagify-number-you-optimized .text br{display:none}.imagify-number-you-optimized>p{display:table}.imagify-number-you-optimized{padding-bottom:.85em;margin-bottom:1.35em;overflow:hidden;border-bottom:1px solid rgba(0,0,0,.05)}.imagify-bars p{font-weight:700;font-size:12px;margin-bottom:0}.imagify-bars+.imagify-number-you-optimized{border-bottom:0;padding-top:.85em}.imagify-bars+.imagify-number-you-optimized p{color:#46b1ce}.imagify-bulk-table{margin-top:2em;max-height:600px;max-height:60vh;overflow:auto}.imagify-ac-report-text,.imagiuploaded{overflow:hidden}.imagify-bulk-table table{width:100%;border-spacing:0;border-collapse:collapse;border:1px solid #D3D3D3}.imagify-bulk-table td{padding:8px 15px}.imagify-bulk-table thead th,.imagify-bulk-table thead tr{background:#2E3242}.imagify-bulk-table tfoot th,.imagify-bulk-table tfoot tr{background:#73818C}.imagify-bulk-table thead th{padding:14px 15px;text-align:left;color:#F2F5F7;font-weight:700;font-size:14px}.imagify-bulk-table tfoot td{padding:14px 15px;color:#F9FAFA}.imagify-bulk-table tbody td,.imagify-bulk-table tbody tr{background:#FFF}.imagify-bulk-table tbody tr:nth-child(odd),.imagify-bulk-table tbody tr:nth-child(odd) td{background:#F2F5F7}.imagify-bulk-table .imagify-row-progress{display:none}.imagify-bulk-table .imagify-row-progress,.imagify-bulk-table .imagify-row-progress td{height:15px;padding:0}.imagify-bulk-table .imagify-no-uploaded-yet td{height:200px;font-size:17px;letter-spacing:.1em;word-spacing:.12em;vertical-align:middle;text-transform:uppercase;font-weight:700;text-align:center;color:#999;background-color:#FFF}.imagify-row-complete{padding:35px 20px;margin-top:2em;background:#8BC34A;color:#FFF;text-shadow:0 0 2px rgba(0,0,0,.1)}.imagify-row-complete .imagify-ac-chart{margin-top:3px}.imagify-row-complete p{color:#FFF;margin:0}@-webkit-keyframes congrate{0%{opacity:0;-webkit-transform:scale(1)}50%{-webkit-transform:scale(1.05);opacity:1}100%{-webkit-transform:scale(1);opacity:1}}@keyframes congrate{0%{opacity:0;-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.05);transform:scale(1.05);opacity:1}100%{-webkit-transform:scale(1);transform:scale(1);opacity:1}}.imagify-row-complete.done{-webkit-animation:congrate .5s ease-in-out;animation:congrate .5s ease-in-out}.imagify-all-complete{margin:1.5em 0}.imagify-all-complete>div{display:inline-block;vertical-align:middle}.imagify-ac-report{min-width:310px}.imagify-ac-chart{width:46px;height:46px;float:left;margin:0 20px 0 10px}.imagify-ac-report-text p{line-height:1.3}.imagify-ac-rt-big{font-size:24px;letter-spacing:.15em;word-spacing:.15em}.imagify-ac-share{text-align:right}.imagify-ac-share-content{display:inline-block;padding:10px 15px;background:rgba(255,255,255,.2)}.imagify-ac-share-content>*{display:inline-block;vertical-align:middle}.imagify-bulk-table .imagify-ac-share-content p{margin-right:5px}.imagify-share-networks,.imagify-share-networks li{margin:0}.imagify-share-networks li{display:inline-block}.imagify-share-networks a{display:inline-block;vertical-align:-7px;margin:0 5px;text-decoration:none;color:#FFF}.imagify-cell-filename{max-width:200px}.imagify-cell-status{max-width:145px}.imagify-cell-status .dashicons-warning{margin-right:2px}.imagify-cell-thumbnails{max-width:120px}td.imagify-cell-filename{-o-text-overflow:clip;text-overflow:clip;white-space:nowrap;overflow:hidden}.imagify-bulk-table .imagify-cell-thumbnails{text-align:center}.imagify-cell-percentage,.imagify-cell-savings{color:#46B1CE;font-weight:700}.imagify-cell-optimized{font-weight:700}.imagify-bulk-table td.imagify-cell-totaloriginal{padding-right:78px}.imagify-cell-totaloriginal{text-align:right}.imagifilename,.imagiuploaded{display:inline-block;vertical-align:middle}.imagifilename{font-size:12px}.imagiuploaded{width:33px;height:33px;margin-right:5px;margin-left:-8px;background:url(../images/upload-image.png) no-repeat;background-size:cover}.imagiuploaded img{max-widht:100%;height:auto}.imagistatus{color:#8CA6B3}.status-compressing{color:#46B1CE}.status-error{color:#CE0B24}.status-warning{color:#f5a623}.status-complete{color:#8CC152}.dashicons.rotate{-webkit-animation:icon-rotate 2.6s infinite linear;animation:icon-rotate 2.6s infinite linear}.imagify-cell-status .dashicons-admin-generic{-webkit-transform-origin:48.75% 51.75%;-ms-transform-origin:48.75% 51.75%;transform-origin:48.75% 51.75%}@-webkit-keyframes icon-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes icon-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}
|
assets/css/options.css
CHANGED
@@ -126,6 +126,28 @@
|
|
126 |
}
|
127 |
}
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
/* Label & fake labels */
|
130 |
label + .imagify-info,
|
131 |
label + .imagify-options-line,
|
@@ -175,6 +197,11 @@ input[id^="imagify_sizes_"]:checked + label {
|
|
175 |
float: left;
|
176 |
width: 70%;
|
177 |
}
|
|
|
|
|
|
|
|
|
|
|
178 |
.imagify-sidebar {
|
179 |
float: right;
|
180 |
width: 28%;
|
126 |
}
|
127 |
}
|
128 |
|
129 |
+
.imagify-settings .imagify-rate-us {
|
130 |
+
margin-right: 25px;
|
131 |
+
margin-left: auto;
|
132 |
+
}
|
133 |
+
/* Documentation link */
|
134 |
+
.imagify-settings .imagify-documentation-link-box {
|
135 |
+
display: flex;
|
136 |
+
padding: 10px 15px 12px;
|
137 |
+
margin-right: -1em;
|
138 |
+
border: 2px solid #40b1d0;
|
139 |
+
color: #FFF;
|
140 |
+
font-weight: bold;
|
141 |
+
border-radius: 2px;
|
142 |
+
}
|
143 |
+
.imagify-documentation-link-icon {
|
144 |
+
width: 23px;
|
145 |
+
height: 31px;
|
146 |
+
font-size: 2.6em;
|
147 |
+
margin-right: 15px;
|
148 |
+
line-height: 1.3;
|
149 |
+
}
|
150 |
+
|
151 |
/* Label & fake labels */
|
152 |
label + .imagify-info,
|
153 |
label + .imagify-options-line,
|
197 |
float: left;
|
198 |
width: 70%;
|
199 |
}
|
200 |
+
.imagify-have-rocket .imagify-main {
|
201 |
+
float: none;
|
202 |
+
width: 1265px;
|
203 |
+
max-width: 100%;
|
204 |
+
}
|
205 |
.imagify-sidebar {
|
206 |
float: right;
|
207 |
width: 28%;
|
assets/css/options.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#imagify-check-api-container{font-weight:700}#imagify-check-api-container .dashicons{font-size:25px}#imagify-check-api-container .dashicons-no:before{color:#f06e57;vertical-align:-1px}#imagify-check-api-container .dashicons-yes:before{color:#8BC34A;vertical-align:-1px}.imagify-options-title{padding-bottom:.5em;border-bottom:3px solid #F2F2F2;font-size:13px;font-weight:500;text-transform:uppercase;letter-spacing:.025em;color:#40b1d0}@media (max-width:782px){.imagify-settings .form-table th{padding-top:2em;padding-bottom:.5em}}.imagify-settings .form-table td{vertical-align:top}.imagify-settings .form-table th span{cursor:pointer}.imagify-middle th{padding-top:35px}.imagify-settings input[type=text]{color:#4A4A4A;font-weight:600;-webkit-box-shadow:none;box-shadow:none}.imagify-bulk-info{margin:1em 1em 1em 5px;-webkit-transition:margin .3s;-o-transition:margin .3s;transition:margin .3s}@media (max-width:850px){.imagify-bulk-info{margin:1em}}.imagify-bulk-info p{display:inline-block;text-align:left;width:400px;max-width:100%;font-weight:700}@media (min-width:1500px){.imagify-settings div.submit{display:table;width:100%}.imagify-settings div.submit>*{display:table-cell;vertical-align:middle}.imagify-bulk-info{padding:0 25px;text-align:right}}.imagify-settings div.submit.submit{margin-top:2em;padding:40px 0 20px 235px}.imagify-settings p.submit{float:left;margin-top:0}.imagify-settings p.submit .button{margin:0 5px}@media (max-width:850px){.imagify-settings div.submit{padding-left:0}.imagify-settings p.submit{text-align:center}}.imagify-sub-header th{text-align:right}.imagify-sub-header .form-table{margin:0}.imagify-sub-header td,.imagify-sub-header th{padding-top:0;padding-bottom:0}.imagify-sub-header [for=api_key]{padding-top:5px}@media (max-width:1120px){.imagify-settings .imagify-logo-block{margin-right:0}.imagify-settings .imagify-rate-us.imagify-rate-us{margin:1em 0 -1em}}.imagify-visual-label,label+.imagify-info,label+.imagify-options-line{display:inline-block;max-width:70%;margin-left:15px;margin-top:2px!important;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}.imagify-visual-label{vertical-align:-5px}label[for=imagify_sizes_full]+.imagify-info{vertical-align:middle}.imagify-settings.imagify-settings [type=checkbox]:not(:checked)+label .imagify-visual-label,.imagify-settings.imagify-settings [type=checkbox]:not(:checked)+label+.imagify-options-line{opacity:.5}.imagify-settings.imagify-settings [type=checkbox]:checked+label .imagify-visual-label,.imagify-settings.imagify-settings [type=checkbox]:checked+label+.imagify-options-line{opacity:1}.imagify-checkbox-marged{max-width:500px;margin-left:45px}input[id^=imagify_sizes_]:checked+label{font-weight:700}#describe-resize-larger.imagify-options-line input{width:5em}.imagify-menu-bar-img{margin-top:1em}.imagify-main{float:left;width:70%}.imagify-sidebar{float:right;width:28%;max-width:300px}.imagify-sidebar-section{border:1px solid #BBB;background:#FFF}.imagify-sidebar-section+.imagify-sidebar-section{margin-top:2em}@media (max-width:820px){.imagify-main,.imagify-sidebar{float:none;width:auto}.imagify-settings{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.imagify-sidebar{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2;max-width:none;margin-left:0;margin-top:25px}.wp-media-products{text-align:center}.wp-media-products li{display:inline-block;width:100%;max-width:276px}}@media (min-width:1400px){.imagify-main{width:74%}}.imagify-sidebar-content{padding:10px 20px}.imagify-sidebar-title{display:block;padding:20px 15px;border-bottom:1px solid #BBB;font-size:14px;font-weight:700;color:#23282d;background:#F2F5F7}.imagify-sidebar-title img{vertical-align:top;margin-right:5px}.imagify-sidebar .wp-media-products{margin-top:0;margin-bottom:-.5em}.imagify-sidebar .wp-media-products .links{display:block;padding:85px 25px 24px;text-align:center;background-color:#2E3243;background-size:contain;background-repeat:no-repeat;background-position:50% 0;text-decoration:none}.imagify-sidebar .wp-media-products .links p{margin:1.5em auto;color:#FFF}.imagify-sidebar .wp-media-products .wprocket-link{background-image:-o-linear-gradient(top,rgba(59,30,78 ,0),rgba(59,30,78 ,0) 130px,rgba(59 ,30 ,78 ,1) 210px),url(../images/sidebar-wp-rocket.jpg);background-image:linear-gradient(to bottom,rgba(59,30,78 ,0),rgba(59,30,78 ,0) 130px,rgba(59 ,30 ,78 ,1) 210px),url(../images/sidebar-wp-rocket.jpg);background-color:#3B1E4E;background-repeat:repeat-x,no-repeat}.imagify-mark-styled{display:inline-block;padding:1px 2px 1px 4px;line-height:1.3;font-weight:700;background:#F7A933;-webkit-transform-origin:50% 50%;-ms-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-transform:rotateZ(-2deg) rotateX(-10deg) skewX(-2deg) skewY(-3deg);transform:rotateZ(-2deg) rotateX(-10deg) skewX(-2deg) skewY(-3deg);text-shadow:1px 1px 0 rgba(0,0,0,.2)}.imagify-mark-styled span{display:inline-block;-webkit-transform:rotateZ(2deg) rotateX(10deg) skewX(2deg) skewY(3deg);transform:rotateZ(2deg) rotateX(10deg) skewX(2deg) skewY(3deg)}.imagify-discount-code,a.btn-rocket{display:block;font-weight:700;text-shadow:1px 1px 0 rgba(0,0,0,.2)}.imagify-discount-code{margin:.35em 0 .5em;font-size:2em;letter-spacing:.05em;text-align:center}.imagify-big-text{font-size:15px;font-weight:700}.imagify-big-text strong{font-size:20px}a.btn-rocket{font-size:1.15em;padding:12px;background:#F7A933;-webkit-box-shadow:0 3px 0 #D69626;box-shadow:0 3px 0 #D69626;border-radius:3px;color:#FFF;text-transform:uppercase;text-decoration:none}a.btn-rocket:focus,a.btn-rocket:hover{background:#ff8c00;-webkit-box-shadow:0 3px 0 #ff8c00;box-shadow:0 3px 0 #ff8c00}
|
1 |
+
#imagify-check-api-container{font-weight:700}#imagify-check-api-container .dashicons{font-size:25px}#imagify-check-api-container .dashicons-no:before{color:#f06e57;vertical-align:-1px}#imagify-check-api-container .dashicons-yes:before{color:#8BC34A;vertical-align:-1px}.imagify-options-title{padding-bottom:.5em;border-bottom:3px solid #F2F2F2;font-size:13px;font-weight:500;text-transform:uppercase;letter-spacing:.025em;color:#40b1d0}@media (max-width:782px){.imagify-settings .form-table th{padding-top:2em;padding-bottom:.5em}}.imagify-settings .form-table td{vertical-align:top}.imagify-settings .form-table th span{cursor:pointer}.imagify-middle th{padding-top:35px}.imagify-settings input[type=text]{color:#4A4A4A;font-weight:600;-webkit-box-shadow:none;box-shadow:none}.imagify-bulk-info{margin:1em 1em 1em 5px;-webkit-transition:margin .3s;-o-transition:margin .3s;transition:margin .3s}@media (max-width:850px){.imagify-bulk-info{margin:1em}}.imagify-bulk-info p{display:inline-block;text-align:left;width:400px;max-width:100%;font-weight:700}@media (min-width:1500px){.imagify-settings div.submit{display:table;width:100%}.imagify-settings div.submit>*{display:table-cell;vertical-align:middle}.imagify-bulk-info{padding:0 25px;text-align:right}}.imagify-settings div.submit.submit{margin-top:2em;padding:40px 0 20px 235px}.imagify-settings p.submit{float:left;margin-top:0}.imagify-settings p.submit .button{margin:0 5px}@media (max-width:850px){.imagify-settings div.submit{padding-left:0}.imagify-settings p.submit{text-align:center}}.imagify-sub-header th{text-align:right}.imagify-sub-header .form-table{margin:0}.imagify-sub-header td,.imagify-sub-header th{padding-top:0;padding-bottom:0}.imagify-sub-header [for=api_key]{padding-top:5px}@media (max-width:1120px){.imagify-settings .imagify-logo-block{margin-right:0}.imagify-settings .imagify-rate-us.imagify-rate-us{margin:1em 0 -1em}}.imagify-settings .imagify-rate-us{margin-right:25px;margin-left:auto}.imagify-settings .imagify-documentation-link-box{display:-webkit-box;display:-ms-flexbox;display:flex;padding:10px 15px 12px;margin-right:-1em;border:2px solid #40b1d0;color:#FFF;font-weight:700;border-radius:2px}.imagify-documentation-link-icon{width:23px;height:31px;font-size:2.6em;margin-right:15px;line-height:1.3}.imagify-visual-label,label+.imagify-info,label+.imagify-options-line{display:inline-block;max-width:70%;margin-left:15px;margin-top:2px!important;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}.imagify-visual-label{vertical-align:-5px}label[for=imagify_sizes_full]+.imagify-info{vertical-align:middle}.imagify-settings.imagify-settings [type=checkbox]:not(:checked)+label .imagify-visual-label,.imagify-settings.imagify-settings [type=checkbox]:not(:checked)+label+.imagify-options-line{opacity:.5}.imagify-settings.imagify-settings [type=checkbox]:checked+label .imagify-visual-label,.imagify-settings.imagify-settings [type=checkbox]:checked+label+.imagify-options-line{opacity:1}.imagify-checkbox-marged{max-width:500px;margin-left:45px}input[id^=imagify_sizes_]:checked+label{font-weight:700}#describe-resize-larger.imagify-options-line input{width:5em}.imagify-menu-bar-img{margin-top:1em}.imagify-main{float:left;width:70%}.imagify-have-rocket .imagify-main{float:none;width:1265px;max-width:100%}.imagify-sidebar{float:right;width:28%;max-width:300px}.imagify-sidebar-section{border:1px solid #BBB;background:#FFF}.imagify-sidebar-section+.imagify-sidebar-section{margin-top:2em}@media (max-width:820px){.imagify-main,.imagify-sidebar{float:none;width:auto}.imagify-settings{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.imagify-sidebar{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2;max-width:none;margin-left:0;margin-top:25px}.wp-media-products{text-align:center}.wp-media-products li{display:inline-block;width:100%;max-width:276px}}@media (min-width:1400px){.imagify-main{width:74%}}.imagify-sidebar-content{padding:10px 20px}.imagify-sidebar-title{display:block;padding:20px 15px;border-bottom:1px solid #BBB;font-size:14px;font-weight:700;color:#23282d;background:#F2F5F7}.imagify-sidebar-title img{vertical-align:top;margin-right:5px}.imagify-sidebar .wp-media-products{margin-top:0;margin-bottom:-.5em}.imagify-sidebar .wp-media-products .links{display:block;padding:85px 25px 24px;text-align:center;background-color:#2E3243;background-size:contain;background-repeat:no-repeat;background-position:50% 0;text-decoration:none}.imagify-sidebar .wp-media-products .links p{margin:1.5em auto;color:#FFF}.imagify-sidebar .wp-media-products .wprocket-link{background-image:-o-linear-gradient(top,rgba(59,30,78 ,0),rgba(59,30,78 ,0) 130px,rgba(59 ,30 ,78 ,1) 210px),url(../images/sidebar-wp-rocket.jpg);background-image:linear-gradient(to bottom,rgba(59,30,78 ,0),rgba(59,30,78 ,0) 130px,rgba(59 ,30 ,78 ,1) 210px),url(../images/sidebar-wp-rocket.jpg);background-color:#3B1E4E;background-repeat:repeat-x,no-repeat}.imagify-mark-styled{display:inline-block;padding:1px 2px 1px 4px;line-height:1.3;font-weight:700;background:#F7A933;-webkit-transform-origin:50% 50%;-ms-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-transform:rotateZ(-2deg) rotateX(-10deg) skewX(-2deg) skewY(-3deg);transform:rotateZ(-2deg) rotateX(-10deg) skewX(-2deg) skewY(-3deg);text-shadow:1px 1px 0 rgba(0,0,0,.2)}.imagify-mark-styled span{display:inline-block;-webkit-transform:rotateZ(2deg) rotateX(10deg) skewX(2deg) skewY(3deg);transform:rotateZ(2deg) rotateX(10deg) skewX(2deg) skewY(3deg)}.imagify-discount-code,a.btn-rocket{display:block;font-weight:700;text-shadow:1px 1px 0 rgba(0,0,0,.2)}.imagify-discount-code{margin:.35em 0 .5em;font-size:2em;letter-spacing:.05em;text-align:center}.imagify-big-text{font-size:15px;font-weight:700}.imagify-big-text strong{font-size:20px}a.btn-rocket{font-size:1.15em;padding:12px;background:#F7A933;-webkit-box-shadow:0 3px 0 #D69626;box-shadow:0 3px 0 #D69626;border-radius:3px;color:#FFF;text-transform:uppercase;text-decoration:none}a.btn-rocket:focus,a.btn-rocket:hover{background:#ff8c00;-webkit-box-shadow:0 3px 0 #ff8c00;box-shadow:0 3px 0 #ff8c00}
|
assets/images/big-blue-check.png
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-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/pic-ericwaltr.jpg
CHANGED
File without changes
|
assets/images/pic-srhdesign.jpg
CHANGED
File without changes
|
assets/js/imagify-gulp.js
CHANGED
File without changes
|
assets/js/imagify-gulp.min.js
CHANGED
File without changes
|
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.6.
|
7 |
* Author: WP Media
|
8 |
* Author URI: https://wp-media.me/
|
9 |
* Licence: GPLv2
|
@@ -17,7 +17,7 @@
|
|
17 |
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
18 |
|
19 |
// Imagify defines.
|
20 |
-
define( 'IMAGIFY_VERSION' , '1.6.
|
21 |
define( 'IMAGIFY_SLUG' , 'imagify' );
|
22 |
define( 'IMAGIFY_SETTINGS_SLUG' , IMAGIFY_SLUG . '_settings' );
|
23 |
define( 'IMAGIFY_FILE' , __FILE__ );
|
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.6.13
|
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.6.13' );
|
21 |
define( 'IMAGIFY_SLUG' , 'imagify' );
|
22 |
define( 'IMAGIFY_SETTINGS_SLUG' , IMAGIFY_SLUG . '_settings' );
|
23 |
define( 'IMAGIFY_FILE' , __FILE__ );
|
inc/3rd-party/3rd-party.php
CHANGED
@@ -1,13 +1,21 @@
|
|
1 |
<?php
|
2 |
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
3 |
|
|
|
|
|
|
|
4 |
require( IMAGIFY_3RD_PARTY_PATH . 'amazon-s3-and-cloudfront/amazon-s3-and-cloudfront.php' );
|
5 |
require( IMAGIFY_3RD_PARTY_PATH . 'enable-media-replace/enable-media-replace.php' );
|
|
|
6 |
require( IMAGIFY_3RD_PARTY_PATH . 'nextgen-gallery/nextgen-gallery.php' );
|
7 |
require( IMAGIFY_3RD_PARTY_PATH . 'screets-lc.php' );
|
|
|
8 |
require( IMAGIFY_3RD_PARTY_PATH . 'wp-retina-2x.php' );
|
9 |
require( IMAGIFY_3RD_PARTY_PATH . 'wp-rocket.php' );
|
10 |
require( IMAGIFY_3RD_PARTY_PATH . 'yoast-seo.php' );
|
11 |
|
12 |
-
|
|
|
|
|
|
|
13 |
require( IMAGIFY_3RD_PARTY_PATH . 'hosting/wpengine.php' );
|
1 |
<?php
|
2 |
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
3 |
|
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 . 'screets-lc.php' );
|
12 |
+
require( IMAGIFY_3RD_PARTY_PATH . 'wp-real-media-library.php' );
|
13 |
require( IMAGIFY_3RD_PARTY_PATH . 'wp-retina-2x.php' );
|
14 |
require( IMAGIFY_3RD_PARTY_PATH . 'wp-rocket.php' );
|
15 |
require( IMAGIFY_3RD_PARTY_PATH . 'yoast-seo.php' );
|
16 |
|
17 |
+
/**
|
18 |
+
* Hosting.
|
19 |
+
*/
|
20 |
+
require( IMAGIFY_3RD_PARTY_PATH . 'hosting/siteground.php' );
|
21 |
require( IMAGIFY_3RD_PARTY_PATH . 'hosting/wpengine.php' );
|
inc/3rd-party/amazon-s3-and-cloudfront/inc/classes/class-imagify-as3cf-attachment.php
CHANGED
@@ -723,8 +723,7 @@ class Imagify_AS3CF_Attachment extends Imagify_Attachment {
|
|
723 |
* @return bool|null True on success. False on failure. Null if backup is not needed.
|
724 |
*/
|
725 |
protected function maybe_backup( $attachment_path ) {
|
726 |
-
|
727 |
-
_deprecated_function( $class_name . '::' . __FUNCTION__ . '()', '1.6.8', 'imagify_backup_file()' );
|
728 |
|
729 |
$result = imagify_backup_file( $attachment_path );
|
730 |
|
723 |
* @return bool|null True on success. False on failure. Null if backup is not needed.
|
724 |
*/
|
725 |
protected function maybe_backup( $attachment_path ) {
|
726 |
+
_deprecated_function( get_class( $this ) . '::' . __FUNCTION__ . '()', '1.6.8', 'imagify_backup_file()' );
|
|
|
727 |
|
728 |
$result = imagify_backup_file( $attachment_path );
|
729 |
|
inc/3rd-party/amazon-s3-and-cloudfront/inc/classes/class-imagify-as3cf.php
CHANGED
@@ -14,10 +14,10 @@ class Imagify_AS3CF {
|
|
14 |
*
|
15 |
* @var string
|
16 |
*/
|
17 |
-
const VERSION = '1.0';
|
18 |
|
19 |
/**
|
20 |
-
* Context used with
|
21 |
* It matches the class name Imagify_AS3CF_Attachment.
|
22 |
*
|
23 |
* @var string
|
@@ -217,7 +217,7 @@ class Imagify_AS3CF {
|
|
217 |
}
|
218 |
|
219 |
unset( $sql_ids );
|
220 |
-
$s3_data =
|
221 |
|
222 |
// Retrieve the missing files from S3.
|
223 |
$ids = array_flip( $ids );
|
@@ -272,7 +272,7 @@ class Imagify_AS3CF {
|
|
272 |
}
|
273 |
|
274 |
if ( ! isset( $data ) ) {
|
275 |
-
$data =
|
276 |
// Get the filesizes.
|
277 |
's3_filesize' => 'wpos3_filesize_total',
|
278 |
), $image_ids );
|
@@ -359,9 +359,13 @@ class Imagify_AS3CF {
|
|
359 |
}
|
360 |
}
|
361 |
|
362 |
-
if ( ! $is_new_upload
|
363 |
-
|
364 |
-
|
|
|
|
|
|
|
|
|
365 |
}
|
366 |
|
367 |
$data = array();
|
@@ -409,8 +413,7 @@ class Imagify_AS3CF {
|
|
409 |
}
|
410 |
|
411 |
$optimization_level = null;
|
412 |
-
$
|
413 |
-
$attachment = new $class_name( $attachment_id );
|
414 |
|
415 |
// Some specifics for the image editor.
|
416 |
if ( ! empty( $_POST['data']['do'] ) ) {
|
14 |
*
|
15 |
* @var string
|
16 |
*/
|
17 |
+
const VERSION = '1.0.1';
|
18 |
|
19 |
/**
|
20 |
+
* Context used with get_imagify_attachment().
|
21 |
* It matches the class name Imagify_AS3CF_Attachment.
|
22 |
*
|
23 |
* @var string
|
217 |
}
|
218 |
|
219 |
unset( $sql_ids );
|
220 |
+
$s3_data = Imagify_DB::combine_query_results( $ids, $s3_data, true );
|
221 |
|
222 |
// Retrieve the missing files from S3.
|
223 |
$ids = array_flip( $ids );
|
272 |
}
|
273 |
|
274 |
if ( ! isset( $data ) ) {
|
275 |
+
$data = Imagify_DB::get_metas( array(
|
276 |
// Get the filesizes.
|
277 |
's3_filesize' => 'wpos3_filesize_total',
|
278 |
), $image_ids );
|
359 |
}
|
360 |
}
|
361 |
|
362 |
+
if ( ! $is_new_upload ) {
|
363 |
+
$attachment = get_imagify_attachment( self::CONTEXT, $attachment_id, 'as3cf_async_job' );
|
364 |
+
|
365 |
+
if ( ! $attachment->get_data() ) {
|
366 |
+
// It's not a new upload and the attachment is not optimized yet.
|
367 |
+
return $metadata;
|
368 |
+
}
|
369 |
}
|
370 |
|
371 |
$data = array();
|
413 |
}
|
414 |
|
415 |
$optimization_level = null;
|
416 |
+
$attachment = get_imagify_attachment( self::CONTEXT, $attachment_id, 'as3cf_optimize' );
|
|
|
417 |
|
418 |
// Some specifics for the image editor.
|
419 |
if ( ! empty( $_POST['data']['do'] ) ) {
|
inc/3rd-party/enable-media-replace/inc/classes/class-imagify-enable-media-replace.php
CHANGED
@@ -14,7 +14,7 @@ class Imagify_Enable_Media_Replace {
|
|
14 |
*
|
15 |
* @var string
|
16 |
*/
|
17 |
-
const VERSION = '1.0';
|
18 |
|
19 |
/**
|
20 |
* The attachment ID.
|
@@ -98,7 +98,7 @@ class Imagify_Enable_Media_Replace {
|
|
98 |
}
|
99 |
|
100 |
/**
|
101 |
-
* When the user
|
102 |
*
|
103 |
* @since 1.6.9
|
104 |
* @author Grégory Viguier
|
@@ -164,7 +164,7 @@ class Imagify_Enable_Media_Replace {
|
|
164 |
return $return_url;
|
165 |
}
|
166 |
|
167 |
-
$new_backup_path = $attachment->
|
168 |
|
169 |
if ( $new_backup_path === $this->old_backup_path ) {
|
170 |
// We don't want to delete the new backup.
|
@@ -192,8 +192,7 @@ class Imagify_Enable_Media_Replace {
|
|
192 |
return $this->attachment;
|
193 |
}
|
194 |
|
195 |
-
$
|
196 |
-
$this->attachment = new $class_name( $this->attachment_id );
|
197 |
|
198 |
return $this->attachment;
|
199 |
}
|
14 |
*
|
15 |
* @var string
|
16 |
*/
|
17 |
+
const VERSION = '1.0.1';
|
18 |
|
19 |
/**
|
20 |
* The attachment ID.
|
98 |
}
|
99 |
|
100 |
/**
|
101 |
+
* When the user chooses to change the file name, store the old backup file path. This path will be used later to delete the file.
|
102 |
*
|
103 |
* @since 1.6.9
|
104 |
* @author Grégory Viguier
|
164 |
return $return_url;
|
165 |
}
|
166 |
|
167 |
+
$new_backup_path = $attachment->get_raw_backup_path();
|
168 |
|
169 |
if ( $new_backup_path === $this->old_backup_path ) {
|
170 |
// We don't want to delete the new backup.
|
192 |
return $this->attachment;
|
193 |
}
|
194 |
|
195 |
+
$this->attachment = get_imagify_attachment( 'wp', $this->attachment_id, 'enable_media_replace' );
|
|
|
196 |
|
197 |
return $this->attachment;
|
198 |
}
|
inc/3rd-party/formidable-pro/formidable-pro.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
3 |
+
|
4 |
+
if ( class_exists( 'FrmProEddController' ) ) :
|
5 |
+
|
6 |
+
Imagify_Formidable_Pro::get_instance()->init();
|
7 |
+
|
8 |
+
endif;
|
inc/3rd-party/formidable-pro/inc/classes/class-imagify-formidable-pro.php
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Compat class for Formidable Forms Pro plugin.
|
6 |
+
* Each call to `new WP_Query()` made by Imagify must have a `'is_imagify' => true` argument.
|
7 |
+
*
|
8 |
+
* @since 1.6.13
|
9 |
+
* @author Grégory Viguier
|
10 |
+
*/
|
11 |
+
class Imagify_Formidable_Pro {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Class version.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
+
const VERSION = '1.0';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Set to true when the current query comes from Imagify.
|
22 |
+
*
|
23 |
+
* @var int
|
24 |
+
*/
|
25 |
+
protected $is_imagify;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* The single instance of the class.
|
29 |
+
*
|
30 |
+
* @var object
|
31 |
+
*/
|
32 |
+
protected static $_instance;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Get the main instance.
|
36 |
+
*
|
37 |
+
* Ensures only one instance of class is loaded or can be loaded.
|
38 |
+
*
|
39 |
+
* @since 1.6.13
|
40 |
+
* @author Grégory Viguier
|
41 |
+
*
|
42 |
+
* @return object Main instance.
|
43 |
+
*/
|
44 |
+
public static function get_instance() {
|
45 |
+
if ( ! isset( self::$_instance ) ) {
|
46 |
+
self::$_instance = new self();
|
47 |
+
}
|
48 |
+
|
49 |
+
return self::$_instance;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* The class constructor.
|
54 |
+
*
|
55 |
+
* @since 1.6.13
|
56 |
+
* @author Grégory Viguier
|
57 |
+
*/
|
58 |
+
protected function __construct() {}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Launch the hooks.
|
62 |
+
*
|
63 |
+
* @since 1.6.13
|
64 |
+
* @author Grégory Viguier
|
65 |
+
*/
|
66 |
+
public function init() {
|
67 |
+
add_action( 'parse_query', array( $this, 'maybe_remove_media_library_filter' ) );
|
68 |
+
add_action( 'posts_selection', array( $this, 'maybe_put_media_library_filter_back' ) );
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Fires before the 'pre_get_posts' hook.
|
73 |
+
*
|
74 |
+
* @since 1.6.13
|
75 |
+
* @author Grégory Viguier
|
76 |
+
*
|
77 |
+
* @param object $wp_query The WP_Query instance (passed by reference).
|
78 |
+
*/
|
79 |
+
public function maybe_remove_media_library_filter( $wp_query ) {
|
80 |
+
if ( ! empty( $wp_query->query_vars['is_imagify'] ) && class_exists( 'FrmProFileField' ) ) {
|
81 |
+
$this->is_imagify = true;
|
82 |
+
remove_action( 'pre_get_posts', 'FrmProFileField::filter_media_library', 99 );
|
83 |
+
} else {
|
84 |
+
$this->is_imagify = false;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Fires after the 'pre_get_posts' hook.
|
90 |
+
*
|
91 |
+
* @since 1.6.13
|
92 |
+
* @author Grégory Viguier
|
93 |
+
*/
|
94 |
+
public function maybe_put_media_library_filter_back() {
|
95 |
+
if ( $this->is_imagify ) {
|
96 |
+
add_action( 'pre_get_posts', 'FrmProFileField::filter_media_library', 99 );
|
97 |
+
}
|
98 |
+
}
|
99 |
+
}
|
inc/3rd-party/hosting/siteground.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
3 |
+
|
4 |
+
add_filter( 'http_request_args', 'imagify_siteground_change_user_agent', 10, 2 );
|
5 |
+
/**
|
6 |
+
* Filter the arguments used in a HTTP request to change the User Agent for requests "to self".
|
7 |
+
* SiteGround blocks (error 403) HTTP requests with a User-Agent containing the site's domain.
|
8 |
+
* The problem is that, for a given site at https://example.com, WordPress uses the UA `WordPress/4.8.2; https://example.com`.
|
9 |
+
*
|
10 |
+
* @since 1.6.13
|
11 |
+
* @author Grégory Viguier
|
12 |
+
*
|
13 |
+
* @param array $r An array of HTTP request arguments.
|
14 |
+
* @param string $url The request URL.
|
15 |
+
* @return array
|
16 |
+
*/
|
17 |
+
function imagify_siteground_change_user_agent( $r, $url ) {
|
18 |
+
static $user_agent;
|
19 |
+
$site_url = site_url( '/' );
|
20 |
+
|
21 |
+
if ( false === strpos( $url, $site_url ) || false === strpos( $r['user-agent'], $_SERVER['HTTP_HOST'] ) ) {
|
22 |
+
return $r;
|
23 |
+
}
|
24 |
+
|
25 |
+
if ( ! isset( $user_agent ) ) {
|
26 |
+
$user_agent = wp_generate_password( 12, false );
|
27 |
+
}
|
28 |
+
|
29 |
+
$r['user-agent'] = $user_agent;
|
30 |
+
|
31 |
+
return $r;
|
32 |
+
}
|
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/db.php
CHANGED
File without changes
|
inc/3rd-party/nextgen-gallery/inc/admin/enqueue.php
CHANGED
@@ -11,7 +11,6 @@ add_action( 'imagify_assets_enqueued', '_imagify_ngg_admin_print_styles' );
|
|
11 |
* @author Grégory Viguier
|
12 |
*/
|
13 |
function _imagify_ngg_admin_print_styles() {
|
14 |
-
global $admin_page_hooks;
|
15 |
$assets = Imagify_Assets::get_instance();
|
16 |
|
17 |
/**
|
@@ -25,10 +24,7 @@ function _imagify_ngg_admin_print_styles() {
|
|
25 |
/**
|
26 |
* NGG Bulk Optimization.
|
27 |
*/
|
28 |
-
|
29 |
-
$ngg_menu_slug = defined( 'NGGFOLDER' ) ? plugin_basename( NGGFOLDER ) : 'nextgen-gallery';
|
30 |
-
$ngg_menu_slug = isset( $admin_page_hooks[ $ngg_menu_slug ] ) ? $admin_page_hooks[ $ngg_menu_slug ] : 'gallery';
|
31 |
-
$bulk_screen_id = $ngg_menu_slug . '_page_' . IMAGIFY_SLUG . '-ngg-bulk-optimization';
|
32 |
|
33 |
if ( ! imagify_is_screen( $bulk_screen_id ) ) {
|
34 |
return;
|
11 |
* @author Grégory Viguier
|
12 |
*/
|
13 |
function _imagify_ngg_admin_print_styles() {
|
|
|
14 |
$assets = Imagify_Assets::get_instance();
|
15 |
|
16 |
/**
|
24 |
/**
|
25 |
* NGG Bulk Optimization.
|
26 |
*/
|
27 |
+
$bulk_screen_id = imagify_get_ngg_bulk_screen_id();
|
|
|
|
|
|
|
28 |
|
29 |
if ( ! imagify_is_screen( $bulk_screen_id ) ) {
|
30 |
return;
|
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
@@ -4,7 +4,7 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
|
4 |
/**
|
5 |
* Imagify NextGen Gallery attachment class.
|
6 |
*
|
7 |
-
* @since
|
8 |
* @author Jonathan Buttigieg
|
9 |
*/
|
10 |
class Imagify_NGG_Attachment extends Imagify_Attachment {
|
@@ -14,7 +14,7 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
14 |
*
|
15 |
* @var string
|
16 |
*/
|
17 |
-
const VERSION = '1.1.
|
18 |
|
19 |
/**
|
20 |
* The image object.
|
@@ -50,7 +50,7 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
50 |
/**
|
51 |
* The constructor.
|
52 |
*
|
53 |
-
* @since
|
54 |
* @author Jonathan Buttigieg
|
55 |
*
|
56 |
* @param int|object $id An image attachment ID or a NGG object.
|
@@ -77,41 +77,34 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
77 |
}
|
78 |
|
79 |
/**
|
80 |
-
* Get the attachment backup file path.
|
81 |
*
|
82 |
-
* @since 1.
|
83 |
-
* @author
|
84 |
* @access public
|
85 |
*
|
86 |
-
* @return string|
|
87 |
*/
|
88 |
-
public function
|
89 |
-
|
90 |
-
$backup_path = get_imagify_ngg_attachment_backup_path( $file_path );
|
91 |
-
|
92 |
-
if ( $backup_path && file_exists( $backup_path ) ) {
|
93 |
-
return $backup_path;
|
94 |
-
}
|
95 |
-
|
96 |
-
return false;
|
97 |
}
|
98 |
|
99 |
/**
|
100 |
* Get the attachment backup URL.
|
101 |
*
|
102 |
-
* @since
|
103 |
* @author Grégory Viguier
|
104 |
*
|
105 |
* @return string|false
|
106 |
*/
|
107 |
public function get_backup_url() {
|
108 |
-
return site_url( '/' ) . imagify_make_file_path_relative( $this->
|
109 |
}
|
110 |
|
111 |
/**
|
112 |
* Get the attachment SQL data row.
|
113 |
*
|
114 |
-
* @since
|
115 |
* @author Jonathan Buttigieg
|
116 |
*
|
117 |
* @access public
|
@@ -124,7 +117,7 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
124 |
/**
|
125 |
* Get the attachment optimization data.
|
126 |
*
|
127 |
-
* @since
|
128 |
* @author Jonathan Buttigieg
|
129 |
*
|
130 |
* @access public
|
@@ -138,7 +131,7 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
138 |
/**
|
139 |
* Get the attachment optimization level.
|
140 |
*
|
141 |
-
* @since
|
142 |
* @author Jonathan Buttigieg
|
143 |
*
|
144 |
* @access public
|
@@ -152,7 +145,7 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
152 |
/**
|
153 |
* Get the attachment optimization status (success or error).
|
154 |
*
|
155 |
-
* @since
|
156 |
* @author Jonathan Buttigieg
|
157 |
*
|
158 |
* @access public
|
@@ -166,7 +159,7 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
166 |
/**
|
167 |
* Get the original attachment path.
|
168 |
*
|
169 |
-
* @since
|
170 |
* @author Jonathan Buttigieg
|
171 |
*
|
172 |
* @access public
|
@@ -179,7 +172,7 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
179 |
/**
|
180 |
* Get the original attachment URL.
|
181 |
*
|
182 |
-
* @since
|
183 |
* @author Jonathan Buttigieg
|
184 |
*
|
185 |
* @access public
|
@@ -259,9 +252,9 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
259 |
/**
|
260 |
* Fills statistics data with values from $data array.
|
261 |
*
|
262 |
-
* @since
|
263 |
-
* @since
|
264 |
-
* @since
|
265 |
* @author Jonathan Buttigieg
|
266 |
* @access public
|
267 |
*
|
@@ -333,7 +326,7 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
333 |
/**
|
334 |
* Optimize all sizes with Imagify.
|
335 |
*
|
336 |
-
* @since
|
337 |
* @author Jonathan Buttigieg
|
338 |
*
|
339 |
* @access public
|
@@ -360,9 +353,8 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
360 |
}
|
361 |
|
362 |
// Get file path & URL for original image.
|
363 |
-
$attachment_path
|
364 |
-
$attachment_url
|
365 |
-
$attachment_original_size = $this->get_original_size( false );
|
366 |
|
367 |
/**
|
368 |
* Fires before optimizing an attachment.
|
@@ -375,39 +367,13 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
375 |
|
376 |
set_transient( 'imagify-ngg-async-in-progress-' . $this->id, true, 10 * MINUTE_IN_SECONDS );
|
377 |
|
378 |
-
// Get the resize values for the original size.
|
379 |
-
$resized = false;
|
380 |
-
$do_resize = get_imagify_option( 'resize_larger', false );
|
381 |
-
$resize_width = get_imagify_option( 'resize_larger_w' );
|
382 |
-
$attachment_size = @getimagesize( $attachment_path );
|
383 |
-
|
384 |
-
if ( $do_resize && isset( $attachment_size[0] ) && $resize_width < $attachment_size[0] ) {
|
385 |
-
$resized_attachment_path = $this->resize( $attachment_path, $attachment_size, $resize_width );
|
386 |
-
|
387 |
-
if ( ! is_wp_error( $resized_attachment_path ) ) {
|
388 |
-
// TODO (@Greg): Send an error message if the backup fails.
|
389 |
-
imagify_backup_file( $attachment_path, $this->get_backup_path() );
|
390 |
-
|
391 |
-
$filesystem = imagify_get_filesystem();
|
392 |
-
|
393 |
-
$filesystem->move( $resized_attachment_path, $attachment_path, true );
|
394 |
-
imagify_chmod_file( $attachment_path );
|
395 |
-
|
396 |
-
// If resized temp file still exists, delete it.
|
397 |
-
if ( $filesystem->exists( $resized_attachment_path ) ) {
|
398 |
-
$filesystem->delete( $resized_attachment_path );
|
399 |
-
}
|
400 |
-
|
401 |
-
$resized = true;
|
402 |
-
}
|
403 |
-
}
|
404 |
-
|
405 |
// Optimize the original size.
|
406 |
$response = do_imagify( $attachment_path, array(
|
407 |
'optimization_level' => $optimization_level,
|
408 |
'context' => 'NGG',
|
409 |
-
'
|
410 |
-
'original_size' => $
|
|
|
411 |
) );
|
412 |
|
413 |
$data = $this->fill_data( null, $response, $attachment_url );
|
@@ -424,12 +390,6 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
424 |
return;
|
425 |
}
|
426 |
|
427 |
-
// If we resized the original with success, we have to update the attachment metadata.
|
428 |
-
// If not, WordPress keeps the old attachment size.
|
429 |
-
if ( $do_resize && $resized ) {
|
430 |
-
$this->update_metadata_size();
|
431 |
-
}
|
432 |
-
|
433 |
// Optimize thumbnails.
|
434 |
$data = $this->optimize_thumbnails( $optimization_level, $data );
|
435 |
|
@@ -491,7 +451,7 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
491 |
/**
|
492 |
* Optimize all thumbnails of an image.
|
493 |
*
|
494 |
-
* @since
|
495 |
* @author Jonathan Buttigieg
|
496 |
*
|
497 |
* @access public
|
@@ -531,9 +491,10 @@ class Imagify_NGG_Attachment extends Imagify_Attachment {
|
|
531 |
|
532 |
// Optimize the thumbnail size.
|
533 |
$response = do_imagify( $thumbnail_path, array(
|
534 |
-
'backup' => false,
|
535 |
'optimization_level' => $optimization_level,
|
536 |
-
'context' => '
|
|
|
|
|
537 |
) );
|
538 |
|
539 |
$data = $this->fill_data( $data, $response, $thumbnail_url, $size_key );
|
4 |
/**
|
5 |
* Imagify NextGen Gallery attachment class.
|
6 |
*
|
7 |
+
* @since 1.5
|
8 |
* @author Jonathan Buttigieg
|
9 |
*/
|
10 |
class Imagify_NGG_Attachment extends Imagify_Attachment {
|
14 |
*
|
15 |
* @var string
|
16 |
*/
|
17 |
+
const VERSION = '1.1.3';
|
18 |
|
19 |
/**
|
20 |
* The image object.
|
50 |
/**
|
51 |
* The constructor.
|
52 |
*
|
53 |
+
* @since 1.5
|
54 |
* @author Jonathan Buttigieg
|
55 |
*
|
56 |
* @param int|object $id An image attachment ID or a NGG object.
|
77 |
}
|
78 |
|
79 |
/**
|
80 |
+
* Get the attachment backup file path, even if the file doesn't exist.
|
81 |
*
|
82 |
+
* @since 1.6.13
|
83 |
+
* @author Grégory Viguier
|
84 |
* @access public
|
85 |
*
|
86 |
+
* @return string|bool The file path. False on failure.
|
87 |
*/
|
88 |
+
public function get_raw_backup_path() {
|
89 |
+
return get_imagify_ngg_attachment_backup_path( $this->get_original_path() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
}
|
91 |
|
92 |
/**
|
93 |
* Get the attachment backup URL.
|
94 |
*
|
95 |
+
* @since 1.6.8
|
96 |
* @author Grégory Viguier
|
97 |
*
|
98 |
* @return string|false
|
99 |
*/
|
100 |
public function get_backup_url() {
|
101 |
+
return site_url( '/' ) . imagify_make_file_path_relative( $this->get_raw_backup_path() );
|
102 |
}
|
103 |
|
104 |
/**
|
105 |
* Get the attachment SQL data row.
|
106 |
*
|
107 |
+
* @since 1.5
|
108 |
* @author Jonathan Buttigieg
|
109 |
*
|
110 |
* @access public
|
117 |
/**
|
118 |
* Get the attachment optimization data.
|
119 |
*
|
120 |
+
* @since 1.5
|
121 |
* @author Jonathan Buttigieg
|
122 |
*
|
123 |
* @access public
|
131 |
/**
|
132 |
* Get the attachment optimization level.
|
133 |
*
|
134 |
+
* @since 1.5
|
135 |
* @author Jonathan Buttigieg
|
136 |
*
|
137 |
* @access public
|
145 |
/**
|
146 |
* Get the attachment optimization status (success or error).
|
147 |
*
|
148 |
+
* @since 1.5
|
149 |
* @author Jonathan Buttigieg
|
150 |
*
|
151 |
* @access public
|
159 |
/**
|
160 |
* Get the original attachment path.
|
161 |
*
|
162 |
+
* @since 1.5
|
163 |
* @author Jonathan Buttigieg
|
164 |
*
|
165 |
* @access public
|
172 |
/**
|
173 |
* Get the original attachment URL.
|
174 |
*
|
175 |
+
* @since 1.5
|
176 |
* @author Jonathan Buttigieg
|
177 |
*
|
178 |
* @access public
|
252 |
/**
|
253 |
* Fills statistics data with values from $data array.
|
254 |
*
|
255 |
+
* @since 1.5
|
256 |
+
* @since 1.6.5 Not static anymore.
|
257 |
+
* @since 1.6.6 Removed the attachment ID parameter.
|
258 |
* @author Jonathan Buttigieg
|
259 |
* @access public
|
260 |
*
|
326 |
/**
|
327 |
* Optimize all sizes with Imagify.
|
328 |
*
|
329 |
+
* @since 1.5
|
330 |
* @author Jonathan Buttigieg
|
331 |
*
|
332 |
* @access public
|
353 |
}
|
354 |
|
355 |
// Get file path & URL for original image.
|
356 |
+
$attachment_path = $this->get_original_path();
|
357 |
+
$attachment_url = $this->get_original_url();
|
|
|
358 |
|
359 |
/**
|
360 |
* Fires before optimizing an attachment.
|
367 |
|
368 |
set_transient( 'imagify-ngg-async-in-progress-' . $this->id, true, 10 * MINUTE_IN_SECONDS );
|
369 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
370 |
// Optimize the original size.
|
371 |
$response = do_imagify( $attachment_path, array(
|
372 |
'optimization_level' => $optimization_level,
|
373 |
'context' => 'NGG',
|
374 |
+
'keep_exif' => true,
|
375 |
+
'original_size' => $this->get_original_size( false ),
|
376 |
+
'backup_path' => $this->get_raw_backup_path(),
|
377 |
) );
|
378 |
|
379 |
$data = $this->fill_data( null, $response, $attachment_url );
|
390 |
return;
|
391 |
}
|
392 |
|
|
|
|
|
|
|
|
|
|
|
|
|
393 |
// Optimize thumbnails.
|
394 |
$data = $this->optimize_thumbnails( $optimization_level, $data );
|
395 |
|
451 |
/**
|
452 |
* Optimize all thumbnails of an image.
|
453 |
*
|
454 |
+
* @since 1.5
|
455 |
* @author Jonathan Buttigieg
|
456 |
*
|
457 |
* @access public
|
491 |
|
492 |
// Optimize the thumbnail size.
|
493 |
$response = do_imagify( $thumbnail_path, array(
|
|
|
494 |
'optimization_level' => $optimization_level,
|
495 |
+
'context' => 'NGG',
|
496 |
+
'keep_exif' => true,
|
497 |
+
'backup' => false,
|
498 |
) );
|
499 |
|
500 |
$data = $this->fill_data( $data, $response, $thumbnail_url, $size_key );
|
inc/3rd-party/nextgen-gallery/inc/classes/class-imagify-ngg-db.php
CHANGED
@@ -4,7 +4,7 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
|
4 |
/**
|
5 |
* Imagify NextGen Gallery DB class.
|
6 |
*
|
7 |
-
* @since
|
8 |
* @author Jonathan Buttigieg
|
9 |
*/
|
10 |
class Imagify_NGG_DB extends Imagify_Abstract_DB {
|
@@ -14,13 +14,13 @@ class Imagify_NGG_DB extends Imagify_Abstract_DB {
|
|
14 |
*
|
15 |
* @var string
|
16 |
*/
|
17 |
-
const VERSION = '1.0.
|
18 |
|
19 |
/**
|
20 |
* The single instance of the class.
|
21 |
*
|
22 |
-
* @
|
23 |
-
* @
|
24 |
*
|
25 |
* @var object
|
26 |
*/
|
@@ -29,9 +29,9 @@ class Imagify_NGG_DB extends Imagify_Abstract_DB {
|
|
29 |
/**
|
30 |
* Get things started.
|
31 |
*
|
32 |
-
* @
|
33 |
-
* @
|
34 |
-
* @author
|
35 |
*/
|
36 |
protected function __construct() {
|
37 |
global $wpdb;
|
@@ -50,9 +50,9 @@ class Imagify_NGG_DB extends Imagify_Abstract_DB {
|
|
50 |
/**
|
51 |
* Get the main Instance.
|
52 |
*
|
53 |
-
* @
|
54 |
-
* @
|
55 |
-
* @author
|
56 |
*
|
57 |
* @return object Main instance.
|
58 |
*/
|
@@ -67,11 +67,11 @@ class Imagify_NGG_DB extends Imagify_Abstract_DB {
|
|
67 |
/**
|
68 |
* Whitelist of columns.
|
69 |
*
|
70 |
-
* @
|
71 |
-
* @
|
72 |
-
* @author
|
73 |
*
|
74 |
-
* @return
|
75 |
*/
|
76 |
public function get_columns() {
|
77 |
return array(
|
@@ -86,11 +86,11 @@ class Imagify_NGG_DB extends Imagify_Abstract_DB {
|
|
86 |
/**
|
87 |
* Default column values.
|
88 |
*
|
89 |
-
* @
|
90 |
-
* @
|
91 |
-
* @author
|
92 |
*
|
93 |
-
* @return
|
94 |
*/
|
95 |
public function get_column_defaults() {
|
96 |
return array(
|
@@ -104,23 +104,17 @@ class Imagify_NGG_DB extends Imagify_Abstract_DB {
|
|
104 |
/**
|
105 |
* Create the table.
|
106 |
*
|
107 |
-
* @
|
108 |
-
* @
|
109 |
* @author Jonathan Buttigieg
|
110 |
*/
|
111 |
public function create_table() {
|
112 |
global $wpdb;
|
113 |
|
114 |
-
if ( ! empty( $wpdb->charset ) ) {
|
115 |
-
$charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
|
116 |
-
}
|
117 |
-
|
118 |
-
if ( ! empty( $wpdb->collate ) ) {
|
119 |
-
$charset_collate .= " COLLATE $wpdb->collate";
|
120 |
-
}
|
121 |
-
|
122 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
123 |
|
|
|
|
|
124 |
$sql = "CREATE TABLE {$this->table_name} (
|
125 |
data_id int(11) NOT NULL AUTO_INCREMENT,
|
126 |
pid int(11) NOT NULL,
|
@@ -140,15 +134,14 @@ class Imagify_NGG_DB extends Imagify_Abstract_DB {
|
|
140 |
* Ensures only one instance of class is loaded or can be loaded.
|
141 |
* Well, actually it ensures nothing since it's not a full singleton pattern.
|
142 |
*
|
143 |
-
* @
|
144 |
-
* @
|
145 |
-
* @author
|
146 |
*
|
147 |
* @return object Main instance.
|
148 |
*/
|
149 |
public static function instance() {
|
150 |
-
|
151 |
-
_deprecated_function( $class_name . '::' . __FUNCTION__ . '()', '1.6.5', 'Imagify_NGG_DB::get_instance()' );
|
152 |
return self::get_instance();
|
153 |
}
|
154 |
}
|
4 |
/**
|
5 |
* Imagify NextGen Gallery DB class.
|
6 |
*
|
7 |
+
* @since 1.5
|
8 |
* @author Jonathan Buttigieg
|
9 |
*/
|
10 |
class Imagify_NGG_DB extends Imagify_Abstract_DB {
|
14 |
*
|
15 |
* @var string
|
16 |
*/
|
17 |
+
const VERSION = '1.0.2';
|
18 |
|
19 |
/**
|
20 |
* The single instance of the class.
|
21 |
*
|
22 |
+
* @since 1.5
|
23 |
+
* @access protected
|
24 |
*
|
25 |
* @var object
|
26 |
*/
|
29 |
/**
|
30 |
* Get things started.
|
31 |
*
|
32 |
+
* @since 1.5
|
33 |
+
* @access protected
|
34 |
+
* @author Jonathan Buttigieg
|
35 |
*/
|
36 |
protected function __construct() {
|
37 |
global $wpdb;
|
50 |
/**
|
51 |
* Get the main Instance.
|
52 |
*
|
53 |
+
* @since 1.6.5
|
54 |
+
* @access public
|
55 |
+
* @author Grégory Viguier
|
56 |
*
|
57 |
* @return object Main instance.
|
58 |
*/
|
67 |
/**
|
68 |
* Whitelist of columns.
|
69 |
*
|
70 |
+
* @since 1.5
|
71 |
+
* @access public
|
72 |
+
* @author Jonathan Buttigieg
|
73 |
*
|
74 |
+
* @return array
|
75 |
*/
|
76 |
public function get_columns() {
|
77 |
return array(
|
86 |
/**
|
87 |
* Default column values.
|
88 |
*
|
89 |
+
* @since 1.5
|
90 |
+
* @access public
|
91 |
+
* @author Jonathan Buttigieg
|
92 |
*
|
93 |
+
* @return array
|
94 |
*/
|
95 |
public function get_column_defaults() {
|
96 |
return array(
|
104 |
/**
|
105 |
* Create the table.
|
106 |
*
|
107 |
+
* @since 1.5
|
108 |
+
* @access public
|
109 |
* @author Jonathan Buttigieg
|
110 |
*/
|
111 |
public function create_table() {
|
112 |
global $wpdb;
|
113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
115 |
|
116 |
+
$charset_collate = $wpdb->get_charset_collate();
|
117 |
+
|
118 |
$sql = "CREATE TABLE {$this->table_name} (
|
119 |
data_id int(11) NOT NULL AUTO_INCREMENT,
|
120 |
pid int(11) NOT NULL,
|
134 |
* Ensures only one instance of class is loaded or can be loaded.
|
135 |
* Well, actually it ensures nothing since it's not a full singleton pattern.
|
136 |
*
|
137 |
+
* @since 1.5
|
138 |
+
* @access public
|
139 |
+
* @author Jonathan Buttigieg
|
140 |
*
|
141 |
* @return object Main instance.
|
142 |
*/
|
143 |
public static function instance() {
|
144 |
+
_deprecated_function( get_class( $this ) . '::' . __FUNCTION__ . '()', '1.6.5', 'Imagify_NGG_DB::get_instance()' );
|
|
|
145 |
return self::get_instance();
|
146 |
}
|
147 |
}
|
inc/3rd-party/nextgen-gallery/inc/common/attachments.php
CHANGED
@@ -3,7 +3,7 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
|
3 |
|
4 |
add_action( 'ngg_after_new_images_added', '_imagify_ngg_optimize_attachment', IMAGIFY_INT_MAX, 2 );
|
5 |
/**
|
6 |
-
* Auto-optimize when a new attachment is
|
7 |
*
|
8 |
* @since 1.5
|
9 |
* @author Jonathan Buttigieg
|
@@ -17,6 +17,14 @@ function _imagify_ngg_optimize_attachment( $gallery_id, $image_ids ) {
|
|
17 |
return;
|
18 |
}
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
foreach ( $image_ids as $image_id ) {
|
21 |
/**
|
22 |
* Allow to prevent automatic optimization for a specific NGG gallery image.
|
@@ -44,22 +52,9 @@ function _imagify_ngg_optimize_attachment( $gallery_id, $image_ids ) {
|
|
44 |
}
|
45 |
}
|
46 |
|
47 |
-
add_action( 'ngg_delete_picture', '_imagify_ngg_delete_picture' );
|
48 |
-
/**
|
49 |
-
* Delete the Imagify data when an image is deleted.
|
50 |
-
*
|
51 |
-
* @since 1.5
|
52 |
-
* @author Jonathan Buttigieg
|
53 |
-
*
|
54 |
-
* @param int $image_id An image ID.
|
55 |
-
*/
|
56 |
-
function _imagify_ngg_delete_picture( $image_id ) {
|
57 |
-
Imagify_NGG_DB::get_instance()->delete( $image_id );
|
58 |
-
}
|
59 |
-
|
60 |
add_filter( 'ngg_medialibrary_imported_image', '_imagify_ngg_media_library_imported_image_data', 10, 2 );
|
61 |
/**
|
62 |
-
* Import Imagify data from a WordPress image to a new NGG image
|
63 |
*
|
64 |
* @since 1.5
|
65 |
* @author Jonathan Buttigieg
|
@@ -69,13 +64,14 @@ add_filter( 'ngg_medialibrary_imported_image', '_imagify_ngg_media_library_impor
|
|
69 |
* @return object
|
70 |
*/
|
71 |
function _imagify_ngg_media_library_imported_image_data( $image, $attachment ) {
|
72 |
-
$
|
73 |
-
$attachment = new $class_name( $attachment->ID );
|
74 |
|
75 |
-
if ( ! $attachment->
|
|
|
76 |
return $image;
|
77 |
}
|
78 |
|
|
|
79 |
$full_size = $attachment->get_size_data();
|
80 |
|
81 |
Imagify_NGG_DB::get_instance()->update( $image->pid, array(
|
@@ -83,17 +79,38 @@ function _imagify_ngg_media_library_imported_image_data( $image, $attachment ) {
|
|
83 |
'optimization_level' => $attachment->get_optimization_level(),
|
84 |
'status' => $attachment->get_status(),
|
85 |
'data' => maybe_serialize( array(
|
|
|
|
|
|
|
86 |
'stats' => array(
|
87 |
'original_size' => $full_size['original_size'],
|
88 |
'optimized_size' => $full_size['optimized_size'],
|
89 |
'percent' => $full_size['percent'],
|
90 |
),
|
91 |
-
'sizes' => array( 'full' => $full_size ),
|
92 |
) ),
|
93 |
) );
|
94 |
|
95 |
$imagify_image = new Imagify_NGG_Attachment( $image->pid );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
$imagify_image->optimize_thumbnails();
|
97 |
|
98 |
return $image;
|
99 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
add_action( 'ngg_after_new_images_added', '_imagify_ngg_optimize_attachment', IMAGIFY_INT_MAX, 2 );
|
5 |
/**
|
6 |
+
* Auto-optimize when a new attachment is added to the database (NGG plugin's table), except for images imported from the library.
|
7 |
*
|
8 |
* @since 1.5
|
9 |
* @author Jonathan Buttigieg
|
17 |
return;
|
18 |
}
|
19 |
|
20 |
+
if ( ! empty( $_POST['nextgen_upload_image_sec'] ) && ! empty( $_POST['action'] ) && 'import_media_library' === $_POST['action'] && ! empty( $_POST['attachment_ids'] ) && is_array( $_POST['attachment_ids'] ) ) { // WPCS: CSRF ok.
|
21 |
+
/**
|
22 |
+
* The images are imported from the library.
|
23 |
+
* In this case, those images are dealt with in _imagify_ngg_media_library_imported_image_data().
|
24 |
+
*/
|
25 |
+
return;
|
26 |
+
}
|
27 |
+
|
28 |
foreach ( $image_ids as $image_id ) {
|
29 |
/**
|
30 |
* Allow to prevent automatic optimization for a specific NGG gallery image.
|
52 |
}
|
53 |
}
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
add_filter( 'ngg_medialibrary_imported_image', '_imagify_ngg_media_library_imported_image_data', 10, 2 );
|
56 |
/**
|
57 |
+
* Import Imagify data from a WordPress image to a new NGG image, and optimize the thumbnails.
|
58 |
*
|
59 |
* @since 1.5
|
60 |
* @author Jonathan Buttigieg
|
64 |
* @return object
|
65 |
*/
|
66 |
function _imagify_ngg_media_library_imported_image_data( $image, $attachment ) {
|
67 |
+
$attachment = get_imagify_attachment( 'wp', $attachment->ID, 'ngg_medialibrary_imported_image' );
|
|
|
68 |
|
69 |
+
if ( ! $attachment->get_status() ) {
|
70 |
+
// The image is not optimized.
|
71 |
return $image;
|
72 |
}
|
73 |
|
74 |
+
// Copy the attachment data.
|
75 |
$full_size = $attachment->get_size_data();
|
76 |
|
77 |
Imagify_NGG_DB::get_instance()->update( $image->pid, array(
|
79 |
'optimization_level' => $attachment->get_optimization_level(),
|
80 |
'status' => $attachment->get_status(),
|
81 |
'data' => maybe_serialize( array(
|
82 |
+
'sizes' => array(
|
83 |
+
'full' => $full_size,
|
84 |
+
),
|
85 |
'stats' => array(
|
86 |
'original_size' => $full_size['original_size'],
|
87 |
'optimized_size' => $full_size['optimized_size'],
|
88 |
'percent' => $full_size['percent'],
|
89 |
),
|
|
|
90 |
) ),
|
91 |
) );
|
92 |
|
93 |
$imagify_image = new Imagify_NGG_Attachment( $image->pid );
|
94 |
+
|
95 |
+
// Copy the backup file (we don't want to backup the optimized file).
|
96 |
+
$attachment_backup_path = $attachment->get_backup_path();
|
97 |
+
|
98 |
+
if ( $attachment_backup_path ) {
|
99 |
+
$ngg_backup_path = $imagify_image->get_raw_backup_path();
|
100 |
+
|
101 |
+
imagify_get_filesystem()->copy( $attachment_backup_path, $ngg_backup_path, true );
|
102 |
+
imagify_chmod_file( $ngg_backup_path );
|
103 |
+
}
|
104 |
+
|
105 |
+
// Optimize thumbnails.
|
106 |
$imagify_image->optimize_thumbnails();
|
107 |
|
108 |
return $image;
|
109 |
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Delete the Imagify data when an image is deleted.
|
113 |
+
*
|
114 |
+
* @since 1.5
|
115 |
+
*/
|
116 |
+
add_action( 'ngg_delete_picture', array( Imagify_NGG_DB::get_instance(), 'delete' ) );
|
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
@@ -19,3 +19,21 @@ function imagify_get_ngg_capacity( $capacity = 'edit_post', $describer = 'manual
|
|
19 |
|
20 |
return $capacity;
|
21 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
return $capacity;
|
21 |
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Get NGG Bulk Optimization screen ID.
|
25 |
+
* Because WP nonsense, the screen ID depends on the menu title, which is translated. So the screen ID changes depending on the administration locale.
|
26 |
+
*
|
27 |
+
* @since 1.6.13
|
28 |
+
* @author Grégory Viguier
|
29 |
+
*
|
30 |
+
* @return string
|
31 |
+
*/
|
32 |
+
function imagify_get_ngg_bulk_screen_id() {
|
33 |
+
global $admin_page_hooks;
|
34 |
+
|
35 |
+
$ngg_menu_slug = defined( 'NGGFOLDER' ) ? plugin_basename( NGGFOLDER ) : 'nextgen-gallery';
|
36 |
+
$ngg_menu_slug = isset( $admin_page_hooks[ $ngg_menu_slug ] ) ? $admin_page_hooks[ $ngg_menu_slug ] : 'gallery';
|
37 |
+
|
38 |
+
return $ngg_menu_slug . '_page_' . IMAGIFY_SLUG . '-ngg-bulk-optimization';
|
39 |
+
}
|
inc/3rd-party/wp-real-media-library.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
3 |
+
|
4 |
+
if ( defined( 'RML_FILE' ) ) :
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Prevent WP Real Media Library to use its outdated version of SweetAlert where we need ours.
|
8 |
+
*/
|
9 |
+
add_action( 'current_screen', 'imagify_wprml_init' );
|
10 |
+
/**
|
11 |
+
* Dequeue WP Real Media Library's version of SweetAlert when we need ours.
|
12 |
+
*
|
13 |
+
* @since 1.6.13
|
14 |
+
* @author Grégory Viguier
|
15 |
+
*/
|
16 |
+
function imagify_wprml_init() {
|
17 |
+
static $done = false;
|
18 |
+
|
19 |
+
if ( $done ) {
|
20 |
+
return;
|
21 |
+
}
|
22 |
+
$done = true;
|
23 |
+
|
24 |
+
if ( ! class_exists( 'MatthiasWeb\RealMediaLibrary\general\Backend' ) ) {
|
25 |
+
return;
|
26 |
+
}
|
27 |
+
|
28 |
+
$notices = Imagify_Notices::get_instance();
|
29 |
+
|
30 |
+
if ( $notices->has_notices() && ( $notices->display_welcome_steps() || $notices->display_wrong_api_key() ) ) {
|
31 |
+
// We display a notice that uses SweetAlert.
|
32 |
+
imagify_wprml_dequeue();
|
33 |
+
return;
|
34 |
+
}
|
35 |
+
|
36 |
+
if ( imagify_is_screen( 'bulk' ) || imagify_is_screen( 'imagify-settings' ) ) {
|
37 |
+
// We display a page that uses SweetAlert.
|
38 |
+
imagify_wprml_dequeue();
|
39 |
+
return;
|
40 |
+
}
|
41 |
+
|
42 |
+
if ( function_exists( 'imagify_get_ngg_bulk_screen_id' ) && imagify_is_screen( imagify_get_ngg_bulk_screen_id() ) ) {
|
43 |
+
// We display the NGG Bulk Optimization page.
|
44 |
+
imagify_wprml_dequeue();
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Prevent WP Real Media Library to enqueue its version of SweetAlert.
|
50 |
+
*
|
51 |
+
* @since 1.6.13
|
52 |
+
* @author Grégory Viguier
|
53 |
+
*/
|
54 |
+
function imagify_wprml_dequeue() {
|
55 |
+
$instance = MatthiasWeb\RealMediaLibrary\general\Backend::getInstance();
|
56 |
+
|
57 |
+
remove_action( 'admin_enqueue_scripts', array( $instance, 'admin_enqueue_scripts' ), 0 );
|
58 |
+
remove_action( 'admin_footer', array( $instance, 'admin_footer' ) );
|
59 |
+
}
|
60 |
+
|
61 |
+
endif;
|
inc/3rd-party/wp-retina-2x.php
CHANGED
@@ -79,8 +79,7 @@ if ( function_exists( 'wr2x_get_retina' ) ) :
|
|
79 |
'optimization_level' => $optimization_level,
|
80 |
'context' => 'wp-retina',
|
81 |
) );
|
82 |
-
$
|
83 |
-
$attachment = new $class_name( $id );
|
84 |
|
85 |
return $attachment->fill_data( $data, $response, $url, $size_key . '@2x' );
|
86 |
}
|
79 |
'optimization_level' => $optimization_level,
|
80 |
'context' => 'wp-retina',
|
81 |
) );
|
82 |
+
$attachment = get_imagify_attachment( 'wp', $id, 'imagify_fill_thumbnail_data' );
|
|
|
83 |
|
84 |
return $attachment->fill_data( $data, $response, $url, $size_key . '@2x' );
|
85 |
}
|
inc/3rd-party/wp-rocket.php
CHANGED
File without changes
|
inc/admin/media.php
CHANGED
@@ -23,8 +23,7 @@ function _imagify_attachment_fields_to_edit( $form_fields, $post ) {
|
|
23 |
return $form_fields;
|
24 |
}
|
25 |
|
26 |
-
$
|
27 |
-
$attachment = new $class_name( $post->ID );
|
28 |
|
29 |
$form_fields['imagify'] = array(
|
30 |
'label' => 'Imagify',
|
@@ -53,14 +52,13 @@ function _imagify_add_actions_to_media_list_row( $actions, $post ) {
|
|
53 |
return $actions;
|
54 |
}
|
55 |
|
|
|
|
|
56 |
// If this attachment is not an image, do nothing.
|
57 |
-
if ( !
|
58 |
return $actions;
|
59 |
}
|
60 |
|
61 |
-
$class_name = get_imagify_attachment_class_name( 'wp', $post->ID, 'media_row_actions' );
|
62 |
-
$attachment = new $class_name( $post->ID );
|
63 |
-
|
64 |
// If Imagify license not valid, or image is not optimized, do nothing.
|
65 |
if ( ! imagify_valid_key() || ! $attachment->is_optimized() ) {
|
66 |
return $actions;
|
23 |
return $form_fields;
|
24 |
}
|
25 |
|
26 |
+
$attachment = get_imagify_attachment( 'wp', $post->ID, 'attachment_fields_to_edit' );
|
|
|
27 |
|
28 |
$form_fields['imagify'] = array(
|
29 |
'label' => 'Imagify',
|
52 |
return $actions;
|
53 |
}
|
54 |
|
55 |
+
$attachment = get_imagify_attachment( 'wp', $post->ID, 'media_row_actions' );
|
56 |
+
|
57 |
// If this attachment is not an image, do nothing.
|
58 |
+
if ( ! $attachment->is_mime_type_supported() ) {
|
59 |
return $actions;
|
60 |
}
|
61 |
|
|
|
|
|
|
|
62 |
// If Imagify license not valid, or image is not optimized, do nothing.
|
63 |
if ( ! imagify_valid_key() || ! $attachment->is_optimized() ) {
|
64 |
return $actions;
|
inc/admin/meta-boxes.php
CHANGED
@@ -14,17 +14,16 @@ function _imagify_attachment_submitbox_misc_actions() {
|
|
14 |
return;
|
15 |
}
|
16 |
|
17 |
-
|
|
|
|
|
18 |
return;
|
19 |
}
|
20 |
|
21 |
-
if ( !
|
22 |
return;
|
23 |
}
|
24 |
|
25 |
-
$class_name = get_imagify_attachment_class_name( 'wp', $post->ID, 'attachment_submitbox_misc_actions' );
|
26 |
-
$attachment = new $class_name( $post->ID );
|
27 |
-
|
28 |
if ( ! imagify_valid_key() && ! $attachment->is_optimized() ) {
|
29 |
|
30 |
echo '<div class="misc-pub-section misc-pub-imagify"><h4>' . __( 'Imagify', 'imagify' ) . '</h4></div>';
|
14 |
return;
|
15 |
}
|
16 |
|
17 |
+
$attachment = get_imagify_attachment( 'wp', $post->ID, 'attachment_submitbox_misc_actions' );
|
18 |
+
|
19 |
+
if ( ! $attachment->is_mime_type_supported() ) {
|
20 |
return;
|
21 |
}
|
22 |
|
23 |
+
if ( ! $attachment->has_required_metadata() ) {
|
24 |
return;
|
25 |
}
|
26 |
|
|
|
|
|
|
|
27 |
if ( ! imagify_valid_key() && ! $attachment->is_optimized() ) {
|
28 |
|
29 |
echo '<div class="misc-pub-section misc-pub-imagify"><h4>' . __( 'Imagify', 'imagify' ) . '</h4></div>';
|
inc/admin/ui/bulk.php
CHANGED
@@ -138,7 +138,7 @@ function _imagify_display_bulk_page() {
|
|
138 |
<?php
|
139 |
printf(
|
140 |
/* translators: you can use %s to include a line break. */
|
141 |
-
__( 'that\'s the number of images you optimized with Imagify', 'imagify' ),
|
142 |
'<br>'
|
143 |
);
|
144 |
?>
|
@@ -196,7 +196,16 @@ function _imagify_display_bulk_page() {
|
|
196 |
}
|
197 |
?>
|
198 |
</li>
|
199 |
-
<li
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
</ul>
|
201 |
</div><!-- .col-1-2 -->
|
202 |
</div><!-- .imagify-columns -->
|
138 |
<?php
|
139 |
printf(
|
140 |
/* translators: you can use %s to include a line break. */
|
141 |
+
__( 'that\'s the number of original images you optimized with Imagify', 'imagify' ),
|
142 |
'<br>'
|
143 |
);
|
144 |
?>
|
196 |
}
|
197 |
?>
|
198 |
</li>
|
199 |
+
<li>
|
200 |
+
<?php esc_html_e( 'You must keep this page open while the bulk optimization is processing. If you leave you can come back to continue where it left off.', 'imagify' ); ?>
|
201 |
+
</li>
|
202 |
+
<li class="imagify-documentation-link-box">
|
203 |
+
<span class="imagify-documentation-icon"><svg viewBox="0 0 15 20" xmlns="http://www.w3.org/2000/svg"><g fill="#40b1d0" fill-rule="nonzero"><g><path d="m14.583 20h-14.167c-.23 0-.417-.187-.417-.417v-14.167c0-.111.044-.217.122-.295l5-5c.078-.078.184-.122.295-.122h9.167c.23 0 .417.187.417.417v19.17c0 .23-.187.417-.417.417m-13.75-.833h13.333v-18.333h-8.578l-4.756 4.756v13.578"/><path d="m5.417 5.833h-5c-.23 0-.417-.187-.417-.417 0-.23.187-.417.417-.417h4.583v-4.583c0-.23.187-.417.417-.417.23 0 .417.187.417.417v5c0 .23-.187.417-.417.417"/></g><path d="m12.583 7h-9.167c-.23 0-.417-.224-.417-.5 0-.276.187-.5.417-.5h9.167c.23 0 .417.224.417.5 0 .276-.187.5-.417.5"/><path d="m12.583 5h-4.167c-.23 0-.417-.224-.417-.5 0-.276.187-.5.417-.5h4.167c.23 0 .417.224.417.5 0 .276-.187.5-.417.5"/><path d="m12.583 10h-9.167c-.23 0-.417-.224-.417-.5 0-.276.187-.5.417-.5h9.167c.23 0 .417.224.417.5 0 .276-.187.5-.417.5"/><path d="m12.583 13h-9.167c-.23 0-.417-.224-.417-.5 0-.276.187-.5.417-.5h9.167c.23 0 .417.224.417.5 0 .276-.187.5-.417.5"/><path d="m12.583 15h-9.167c-.23 0-.417-.224-.417-.5 0-.276.187-.5.417-.5h9.167c.23 0 .417.224.417.5 0 .276-.187.5-.417.5"/><path d="m12.583 18h-9.167c-.23 0-.417-.224-.417-.5 0-.276.187-.5.417-.5h9.167c.23 0 .417.224.417.5 0 .276-.187.5-.417.5"/></g></svg></span>
|
204 |
+
<span>
|
205 |
+
<?php _e( 'Need help or have questions?', 'imagify' ); ?>
|
206 |
+
<a class="imagify-documentation-link" href="<?php echo esc_url( imagify_get_external_url( 'documentation' ) ); ?>" target="_blank"><?php _e( 'Check our documentation.', 'imagify' ); ?></a>
|
207 |
+
<span>
|
208 |
+
</li>
|
209 |
</ul>
|
210 |
</div><!-- .col-1-2 -->
|
211 |
</div><!-- .imagify-columns -->
|
inc/admin/ui/options.php
CHANGED
@@ -13,7 +13,7 @@ function _imagify_display_options_page() {
|
|
13 |
wp_safe_redirect( get_admin_url( get_current_blog_id(), 'upload.php?page=imagify-bulk-optimization' ) );
|
14 |
}
|
15 |
?>
|
16 |
-
<div class="wrap imagify-settings">
|
17 |
|
18 |
<?php if ( ! defined( 'WP_ROCKET_VERSION' ) ) { ?>
|
19 |
|
@@ -59,7 +59,6 @@ function _imagify_display_options_page() {
|
|
59 |
<?php } // End if(). ?>
|
60 |
|
61 |
<div class="imagify-col imagify-main">
|
62 |
-
<?php $heading_tag = version_compare( $wp_version, '4.3' ) >= 0 ? 'h1' : 'h2'; ?>
|
63 |
<div class="imagify-title">
|
64 |
<div class="imagify-logo-block">
|
65 |
<img width="225" height="26" alt="Imagify" src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>imagify-logo.png" class="imagify-logo" />
|
@@ -82,6 +81,12 @@ function _imagify_display_options_page() {
|
|
82 |
<br>
|
83 |
<a class="stars" href="<?php echo esc_url( imagify_get_external_url( 'rate' ) ); ?>" target="_blank"><?php echo str_repeat( '<span class="dashicons dashicons-star-filled"></span>', 5 ); ?></a>
|
84 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
</div>
|
86 |
<?php $form_action = ( imagify_is_active_for_network() ) ? admin_url( 'admin-post.php' ) : admin_url( 'options.php' ); ?>
|
87 |
<form action="<?php echo $form_action; ?>" id="imagify-settings" method="post">
|
13 |
wp_safe_redirect( get_admin_url( get_current_blog_id(), 'upload.php?page=imagify-bulk-optimization' ) );
|
14 |
}
|
15 |
?>
|
16 |
+
<div class="wrap imagify-settings <?php echo defined( 'WP_ROCKET_VERSION' ) ? 'imagify-have-rocket' : 'imagify-dont-have-rocket'; ?>">
|
17 |
|
18 |
<?php if ( ! defined( 'WP_ROCKET_VERSION' ) ) { ?>
|
19 |
|
59 |
<?php } // End if(). ?>
|
60 |
|
61 |
<div class="imagify-col imagify-main">
|
|
|
62 |
<div class="imagify-title">
|
63 |
<div class="imagify-logo-block">
|
64 |
<img width="225" height="26" alt="Imagify" src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>imagify-logo.png" class="imagify-logo" />
|
81 |
<br>
|
82 |
<a class="stars" href="<?php echo esc_url( imagify_get_external_url( 'rate' ) ); ?>" target="_blank"><?php echo str_repeat( '<span class="dashicons dashicons-star-filled"></span>', 5 ); ?></a>
|
83 |
</p>
|
84 |
+
|
85 |
+
<p class="imagify-documentation-link-box">
|
86 |
+
<span class="imagify-documentation-link-icon" aria-hidden="true"><svg viewBox="0 0 23 31" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="nonzero"><g fill="#40b1d0"><path d="m22.361 31h-21.722c-.353 0-.639-.289-.639-.646v-21.958c0-.172.068-.336.187-.457l7.667-7.75c.12-.12.282-.189.452-.189h14.06c.353 0 .639.289.639.646v29.708c0 .357-.286.646-.639.646m-21.08-1.292h20.444v-28.417h-13.152l-7.292 7.372v21.05"/><path d="m8.306 9.04h-7.667c-.353 0-.639-.289-.639-.646 0-.357.286-.646.639-.646h7.03v-7.104c0-.357.286-.646.639-.646.353 0 .639.289.639.646v7.75c0 .357-.286.646-.639.646"/></g><g fill="#f2f5f7"><path d="m18.375 11h-13.75c-.345 0-.625-.224-.625-.5 0-.276.28-.5.625-.5h13.75c.345 0 .625.224.625.5 0 .276-.28.5-.625.5"/><path d="m19.333 7h-6.667c-.368 0-.667-.224-.667-.5 0-.276.299-.5.667-.5h6.667c.368 0 .667.224.667.5 0 .276-.299.5-.667.5"/><path d="m18.375 15h-13.75c-.345 0-.625-.224-.625-.5 0-.276.28-.5.625-.5h13.75c.345 0 .625.224.625.5 0 .276-.28.5-.625.5"/><path d="m18.375 19h-13.75c-.345 0-.625-.224-.625-.5 0-.276.28-.5.625-.5h13.75c.345 0 .625.224.625.5 0 .276-.28.5-.625.5"/><path d="m18.375 23h-13.75c-.345 0-.625-.224-.625-.5 0-.276.28-.5.625-.5h13.75c.345 0 .625.224.625.5 0 .276-.28.5-.625.5"/><path d="m18.375 27h-13.75c-.345 0-.625-.224-.625-.5 0-.276.28-.5.625-.5h13.75c.345 0 .625.224.625.5 0 .276-.28.5-.625.5"/></g></g></svg></span>
|
87 |
+
<span><?php _e( 'Need help or have questions?', 'imagify' ); ?><br/>
|
88 |
+
<a class="imagify-documentation-link" href="<?php echo esc_url( imagify_get_external_url( 'documentation' ) ); ?>" target="_blank"><?php _e( 'Check our documentation.', 'imagify' ); ?></a></span>
|
89 |
+
</p>
|
90 |
</div>
|
91 |
<?php $form_action = ( imagify_is_active_for_network() ) ? admin_url( 'admin-post.php' ) : admin_url( 'options.php' ); ?>
|
92 |
<form action="<?php echo $form_action; ?>" id="imagify-settings" method="post">
|
inc/admin/upgrader.php
CHANGED
@@ -69,9 +69,10 @@ function _imagify_new_upgrade( $imagify_version, $current_version ) {
|
|
69 |
if ( version_compare( $current_version, '1.2' ) < 0 ) {
|
70 |
// Update all already optimized images status from 'error' to 'already_optimized'.
|
71 |
$query = new WP_Query( array(
|
|
|
72 |
'post_type' => 'attachment',
|
73 |
'post_status' => 'inherit',
|
74 |
-
'post_mime_type' =>
|
75 |
'meta_key' => '_imagify_status',
|
76 |
'meta_value' => 'error',
|
77 |
'posts_per_page' => -1,
|
@@ -82,11 +83,7 @@ function _imagify_new_upgrade( $imagify_version, $current_version ) {
|
|
82 |
|
83 |
if ( $query->posts ) {
|
84 |
foreach ( (array) $query->posts as $id ) {
|
85 |
-
$
|
86 |
-
$attachment = new $class_name( $id );
|
87 |
-
$attachment_error = $attachment->get_optimized_error();
|
88 |
-
$attachment_error = trim( $attachment_error );
|
89 |
-
$attachment_status = get_post_meta( $id, '_imagify_status', true );
|
90 |
|
91 |
if ( false !== strpos( $attachment_error, 'This image is already compressed' ) ) {
|
92 |
update_post_meta( $id, '_imagify_status', 'already_optimized' );
|
@@ -95,8 +92,10 @@ function _imagify_new_upgrade( $imagify_version, $current_version ) {
|
|
95 |
}
|
96 |
|
97 |
// Auto-activate the Admin Bar option.
|
98 |
-
$options
|
|
|
99 |
$options['admin_bar_menu'] = 1;
|
|
|
100 |
update_site_option( IMAGIFY_SETTINGS_SLUG, $options );
|
101 |
}
|
102 |
|
@@ -104,9 +103,10 @@ function _imagify_new_upgrade( $imagify_version, $current_version ) {
|
|
104 |
if ( version_compare( $current_version, '1.3.2' ) < 0 ) {
|
105 |
// Update all already optimized images status from 'error' to 'already_optimized'.
|
106 |
$query = new WP_Query( array(
|
|
|
107 |
'post_type' => 'attachment',
|
108 |
'post_status' => 'inherit',
|
109 |
-
'post_mime_type' =>
|
110 |
'meta_query' => array(
|
111 |
'relation' => 'AND',
|
112 |
array(
|
@@ -126,9 +126,7 @@ function _imagify_new_upgrade( $imagify_version, $current_version ) {
|
|
126 |
|
127 |
if ( $query->posts ) {
|
128 |
foreach ( (array) $query->posts as $id ) {
|
129 |
-
$
|
130 |
-
$attachment = new $class_name( $id );
|
131 |
-
$attachment_stats = $attachment->get_stats_data();
|
132 |
|
133 |
if ( isset( $attachment_stats['aggressive'] ) ) {
|
134 |
update_post_meta( $id, '_imagify_optimization_level', (int) $attachment_stats['aggressive'] );
|
69 |
if ( version_compare( $current_version, '1.2' ) < 0 ) {
|
70 |
// Update all already optimized images status from 'error' to 'already_optimized'.
|
71 |
$query = new WP_Query( array(
|
72 |
+
'is_imagify' => true,
|
73 |
'post_type' => 'attachment',
|
74 |
'post_status' => 'inherit',
|
75 |
+
'post_mime_type' => get_imagify_mime_type(),
|
76 |
'meta_key' => '_imagify_status',
|
77 |
'meta_value' => 'error',
|
78 |
'posts_per_page' => -1,
|
83 |
|
84 |
if ( $query->posts ) {
|
85 |
foreach ( (array) $query->posts as $id ) {
|
86 |
+
$attachment_error = get_imagify_attachment( 'wp', $id, 'imagify_upgrade' )->get_optimized_error();
|
|
|
|
|
|
|
|
|
87 |
|
88 |
if ( false !== strpos( $attachment_error, 'This image is already compressed' ) ) {
|
89 |
update_post_meta( $id, '_imagify_status', 'already_optimized' );
|
92 |
}
|
93 |
|
94 |
// Auto-activate the Admin Bar option.
|
95 |
+
$options = get_site_option( IMAGIFY_SETTINGS_SLUG );
|
96 |
+
$options = is_array( $options ) ? $options : array();
|
97 |
$options['admin_bar_menu'] = 1;
|
98 |
+
|
99 |
update_site_option( IMAGIFY_SETTINGS_SLUG, $options );
|
100 |
}
|
101 |
|
103 |
if ( version_compare( $current_version, '1.3.2' ) < 0 ) {
|
104 |
// Update all already optimized images status from 'error' to 'already_optimized'.
|
105 |
$query = new WP_Query( array(
|
106 |
+
'is_imagify' => true,
|
107 |
'post_type' => 'attachment',
|
108 |
'post_status' => 'inherit',
|
109 |
+
'post_mime_type' => get_imagify_mime_type(),
|
110 |
'meta_query' => array(
|
111 |
'relation' => 'AND',
|
112 |
array(
|
126 |
|
127 |
if ( $query->posts ) {
|
128 |
foreach ( (array) $query->posts as $id ) {
|
129 |
+
$attachment_stats = get_imagify_attachment( 'wp', $id, 'imagify_upgrade' )->get_stats_data();
|
|
|
|
|
130 |
|
131 |
if ( isset( $attachment_stats['aggressive'] ) ) {
|
132 |
update_post_meta( $id, '_imagify_optimization_level', (int) $attachment_stats['aggressive'] );
|
inc/admin/upload.php
CHANGED
@@ -34,8 +34,7 @@ function _imagify_manage_media_custom_column( $column_name, $attachment_id ) {
|
|
34 |
return;
|
35 |
}
|
36 |
|
37 |
-
$
|
38 |
-
$attachment = new $class_name( $attachment_id );
|
39 |
|
40 |
echo get_imagify_media_column_content( $attachment );
|
41 |
}
|
34 |
return;
|
35 |
}
|
36 |
|
37 |
+
$attachment = get_imagify_attachment( 'wp', $attachment_id, 'manage_media_custom_column' );
|
|
|
38 |
|
39 |
echo get_imagify_media_column_content( $attachment );
|
40 |
}
|
inc/classes/class-imagify-abstract-attachment.php
CHANGED
@@ -6,21 +6,20 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
|
6 |
*
|
7 |
* @since 1.0
|
8 |
*/
|
9 |
-
class Imagify_Abstract_Attachment {
|
10 |
|
11 |
/**
|
12 |
* Class version.
|
13 |
*
|
14 |
* @var string
|
15 |
*/
|
16 |
-
const VERSION = '1.
|
17 |
|
18 |
/**
|
19 |
* The attachment ID.
|
20 |
*
|
21 |
-
* @
|
22 |
-
*
|
23 |
-
* @var int
|
24 |
* @access public
|
25 |
*/
|
26 |
public $id = 0;
|
@@ -28,7 +27,8 @@ class Imagify_Abstract_Attachment {
|
|
28 |
/**
|
29 |
* The constructor.
|
30 |
*
|
31 |
-
* @since
|
|
|
32 |
*
|
33 |
* @param int $id The attachment ID.
|
34 |
* @return void
|
@@ -49,6 +49,17 @@ class Imagify_Abstract_Attachment {
|
|
49 |
$this->id = absint( $this->id );
|
50 |
}
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
/**
|
53 |
* Get the attachment backup file path.
|
54 |
*
|
@@ -58,37 +69,41 @@ class Imagify_Abstract_Attachment {
|
|
58 |
* @return string|false The file path. False if it doesn't exist.
|
59 |
*/
|
60 |
public function get_backup_path() {
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
63 |
|
64 |
/**
|
65 |
* Get the attachment backup URL.
|
66 |
*
|
67 |
-
* @since
|
68 |
* @access public
|
69 |
*
|
70 |
* @return string|false
|
71 |
*/
|
72 |
public function get_backup_url() {
|
73 |
-
return get_imagify_attachment_url( $this->
|
74 |
}
|
75 |
|
76 |
/**
|
77 |
* Get the attachment optimization data.
|
78 |
*
|
79 |
-
* @since
|
80 |
* @access public
|
81 |
*
|
82 |
* @return array
|
83 |
*/
|
84 |
-
public function get_data()
|
85 |
-
return array();
|
86 |
-
}
|
87 |
|
88 |
/**
|
89 |
* Get the attachment extension.
|
90 |
*
|
91 |
-
* @since
|
92 |
* @access public
|
93 |
*
|
94 |
* @return string
|
@@ -102,6 +117,7 @@ class Imagify_Abstract_Attachment {
|
|
102 |
* Tell if the current file mime type is supported.
|
103 |
*
|
104 |
* @since 1.6.9
|
|
|
105 |
* @author Grégory Viguier
|
106 |
*
|
107 |
* @return bool
|
@@ -114,6 +130,7 @@ class Imagify_Abstract_Attachment {
|
|
114 |
* Tell if the current attachment has the required WP metadata.
|
115 |
*
|
116 |
* @since 1.6.12
|
|
|
117 |
* @author Grégory Viguier
|
118 |
*
|
119 |
* @return bool
|
@@ -125,7 +142,7 @@ class Imagify_Abstract_Attachment {
|
|
125 |
/**
|
126 |
* Get the attachment error if there is one.
|
127 |
*
|
128 |
-
* @since
|
129 |
* @access public
|
130 |
*
|
131 |
* @return string The message error
|
@@ -134,7 +151,7 @@ class Imagify_Abstract_Attachment {
|
|
134 |
$error = $this->get_size_data( 'full', 'error' );
|
135 |
|
136 |
if ( is_string( $error ) ) {
|
137 |
-
return $error;
|
138 |
}
|
139 |
|
140 |
return false;
|
@@ -143,14 +160,12 @@ class Imagify_Abstract_Attachment {
|
|
143 |
/**
|
144 |
* Get the attachment optimization level.
|
145 |
*
|
146 |
-
* @since
|
147 |
* @access public
|
148 |
*
|
149 |
* @return int
|
150 |
*/
|
151 |
-
public function get_optimization_level()
|
152 |
-
return -1;
|
153 |
-
}
|
154 |
|
155 |
/**
|
156 |
* Delete the 3 metas used by Imagify.
|
@@ -168,7 +183,7 @@ class Imagify_Abstract_Attachment {
|
|
168 |
/**
|
169 |
* Get the attachment optimization level label.
|
170 |
*
|
171 |
-
* @since
|
172 |
* @access public
|
173 |
*
|
174 |
* @return string
|
@@ -194,7 +209,7 @@ class Imagify_Abstract_Attachment {
|
|
194 |
/**
|
195 |
* Count number of optimized sizes.
|
196 |
*
|
197 |
-
* @since
|
198 |
* @access public
|
199 |
*
|
200 |
* @return int
|
@@ -218,31 +233,27 @@ class Imagify_Abstract_Attachment {
|
|
218 |
/**
|
219 |
* Get the attachment optimization status (success or error).
|
220 |
*
|
221 |
-
* @since
|
222 |
* @access public
|
223 |
*
|
224 |
* @return string
|
225 |
*/
|
226 |
-
public function get_status()
|
227 |
-
return '';
|
228 |
-
}
|
229 |
|
230 |
/**
|
231 |
* Get the original attachment path.
|
232 |
*
|
233 |
-
* @since
|
234 |
* @access public
|
235 |
*
|
236 |
* @return string
|
237 |
*/
|
238 |
-
public function get_original_path()
|
239 |
-
return '';
|
240 |
-
}
|
241 |
|
242 |
/**
|
243 |
* Get the original attachment size.
|
244 |
*
|
245 |
-
* @since
|
246 |
* @access public
|
247 |
*
|
248 |
* @param bool $human_format True to display the image human format size (1Mb).
|
@@ -263,19 +274,17 @@ class Imagify_Abstract_Attachment {
|
|
263 |
/**
|
264 |
* Get the original attachment URL.
|
265 |
*
|
266 |
-
* @since
|
267 |
* @access public
|
268 |
*
|
269 |
* @return string
|
270 |
*/
|
271 |
-
public function get_original_url()
|
272 |
-
return '';
|
273 |
-
}
|
274 |
|
275 |
/**
|
276 |
* Get the statistics of a specific size.
|
277 |
*
|
278 |
-
* @since
|
279 |
* @access public
|
280 |
*
|
281 |
* @param string $size The thumbnail slug.
|
@@ -300,7 +309,7 @@ class Imagify_Abstract_Attachment {
|
|
300 |
/**
|
301 |
* Get the global statistics data or a specific one.
|
302 |
*
|
303 |
-
* @since
|
304 |
* @access public
|
305 |
*
|
306 |
* @param string $key The specific data slug.
|
@@ -324,7 +333,7 @@ class Imagify_Abstract_Attachment {
|
|
324 |
/**
|
325 |
* Check if the attachment is already optimized (before Imagify).
|
326 |
*
|
327 |
-
* @since
|
328 |
* @access public
|
329 |
*
|
330 |
* @return bool True if the attachment is optimized.
|
@@ -336,7 +345,7 @@ class Imagify_Abstract_Attachment {
|
|
336 |
/**
|
337 |
* Check if the attachment is optimized.
|
338 |
*
|
339 |
-
* @since
|
340 |
* @access public
|
341 |
*
|
342 |
* @return bool True if the attachment is optimized.
|
@@ -348,7 +357,7 @@ class Imagify_Abstract_Attachment {
|
|
348 |
/**
|
349 |
* Check if the attachment exceeding the limit size (> 5mo).
|
350 |
*
|
351 |
-
* @since
|
352 |
* @access public
|
353 |
*
|
354 |
* @return bool True if the attachment is skipped.
|
@@ -367,7 +376,7 @@ class Imagify_Abstract_Attachment {
|
|
367 |
/**
|
368 |
* Check if the attachment has a backup of the original size.
|
369 |
*
|
370 |
-
* @since
|
371 |
* @access public
|
372 |
*
|
373 |
* @return bool True if the attachment has a backup.
|
@@ -379,7 +388,7 @@ class Imagify_Abstract_Attachment {
|
|
379 |
/**
|
380 |
* Check if the attachment has an error.
|
381 |
*
|
382 |
-
* @since
|
383 |
* @access public
|
384 |
*
|
385 |
* @return bool True if the attachment has an error.
|
@@ -392,17 +401,17 @@ class Imagify_Abstract_Attachment {
|
|
392 |
/**
|
393 |
* Update the metadata size of the attachment
|
394 |
*
|
395 |
-
* @since
|
396 |
* @access public
|
397 |
*
|
398 |
* @return void
|
399 |
*/
|
400 |
-
public function update_metadata_size()
|
401 |
|
402 |
/**
|
403 |
* Delete the backup file.
|
404 |
*
|
405 |
-
* @since
|
406 |
* @access public
|
407 |
*
|
408 |
* @return void
|
@@ -419,6 +428,7 @@ class Imagify_Abstract_Attachment {
|
|
419 |
* Get the registered sizes.
|
420 |
*
|
421 |
* @since 1.6.10
|
|
|
422 |
* @author Grégory Viguier
|
423 |
*
|
424 |
* @return array Data for the registered thumbnail sizes.
|
@@ -437,6 +447,7 @@ class Imagify_Abstract_Attachment {
|
|
437 |
* Get the unoptimized sizes for a specific attachment.
|
438 |
*
|
439 |
* @since 1.6.10
|
|
|
440 |
* @author Grégory Viguier
|
441 |
*
|
442 |
* @return array Data for the unoptimized thumbnail sizes.
|
@@ -509,9 +520,9 @@ class Imagify_Abstract_Attachment {
|
|
509 |
/**
|
510 |
* Fills statistics data with values from $data array.
|
511 |
*
|
512 |
-
* @since
|
513 |
-
* @since
|
514 |
-
* @since
|
515 |
* @access public
|
516 |
*
|
517 |
* @param array $data The statistics data.
|
@@ -520,23 +531,19 @@ class Imagify_Abstract_Attachment {
|
|
520 |
* @param string $size The attachment size key.
|
521 |
* @return bool|array False if the original size has an error or an array contains the data for other result.
|
522 |
*/
|
523 |
-
public function fill_data( $data, $response, $url, $size = 'full' )
|
524 |
-
return array();
|
525 |
-
}
|
526 |
|
527 |
/**
|
528 |
* Optimize all sizes with Imagify.
|
529 |
*
|
530 |
-
* @since
|
531 |
* @access public
|
532 |
*
|
533 |
* @param int $optimization_level The optimization level (2=ultra, 1=aggressive, 0=normal).
|
534 |
* @param array $metadata The attachment meta data.
|
535 |
* @return array $optimized_data The optimization data.
|
536 |
*/
|
537 |
-
public function optimize( $optimization_level = null, $metadata = array() )
|
538 |
-
return array();
|
539 |
-
}
|
540 |
|
541 |
/**
|
542 |
* Optimize missing sizes with Imagify.
|
@@ -548,24 +555,23 @@ class Imagify_Abstract_Attachment {
|
|
548 |
* @param int $optimization_level The optimization level (2=ultra, 1=aggressive, 0=normal).
|
549 |
* @return array|object An array of thumbnail data, size by size. A WP_Error object on failure.
|
550 |
*/
|
551 |
-
public function optimize_missing_thumbnails( $optimization_level = null )
|
552 |
-
return array();
|
553 |
-
}
|
554 |
|
555 |
/**
|
556 |
* Process an attachment restoration from the backup file.
|
557 |
*
|
558 |
-
* @since
|
559 |
* @access public
|
560 |
*
|
561 |
* @return void
|
562 |
*/
|
563 |
-
public function restore()
|
564 |
|
565 |
/**
|
566 |
* Resize an image if bigger than the maximum width defined in the settings.
|
567 |
*
|
568 |
-
* @since
|
|
|
569 |
* @author Remy Perona
|
570 |
*
|
571 |
* @param string $attachment_path Path to the image.
|
6 |
*
|
7 |
* @since 1.0
|
8 |
*/
|
9 |
+
abstract class Imagify_Abstract_Attachment {
|
10 |
|
11 |
/**
|
12 |
* Class version.
|
13 |
*
|
14 |
* @var string
|
15 |
*/
|
16 |
+
const VERSION = '1.2';
|
17 |
|
18 |
/**
|
19 |
* The attachment ID.
|
20 |
*
|
21 |
+
* @var int
|
22 |
+
* @since 1.0
|
|
|
23 |
* @access public
|
24 |
*/
|
25 |
public $id = 0;
|
27 |
/**
|
28 |
* The constructor.
|
29 |
*
|
30 |
+
* @since 1.0
|
31 |
+
* @access public
|
32 |
*
|
33 |
* @param int $id The attachment ID.
|
34 |
* @return void
|
49 |
$this->id = absint( $this->id );
|
50 |
}
|
51 |
|
52 |
+
/**
|
53 |
+
* Get the attachment backup file path, even if the file doesn't exist.
|
54 |
+
*
|
55 |
+
* @since 1.6.13
|
56 |
+
* @access public
|
57 |
+
* @author Grégory Viguier
|
58 |
+
*
|
59 |
+
* @return string|bool The file path. False on failure.
|
60 |
+
*/
|
61 |
+
abstract public function get_raw_backup_path();
|
62 |
+
|
63 |
/**
|
64 |
* Get the attachment backup file path.
|
65 |
*
|
69 |
* @return string|false The file path. False if it doesn't exist.
|
70 |
*/
|
71 |
public function get_backup_path() {
|
72 |
+
$backup_path = $this->get_raw_backup_path();
|
73 |
+
|
74 |
+
if ( $backup_path && file_exists( $backup_path ) ) {
|
75 |
+
return $backup_path;
|
76 |
+
}
|
77 |
+
|
78 |
+
return false;
|
79 |
}
|
80 |
|
81 |
/**
|
82 |
* Get the attachment backup URL.
|
83 |
*
|
84 |
+
* @since 1.4
|
85 |
* @access public
|
86 |
*
|
87 |
* @return string|false
|
88 |
*/
|
89 |
public function get_backup_url() {
|
90 |
+
return get_imagify_attachment_url( $this->get_raw_backup_path() );
|
91 |
}
|
92 |
|
93 |
/**
|
94 |
* Get the attachment optimization data.
|
95 |
*
|
96 |
+
* @since 1.0
|
97 |
* @access public
|
98 |
*
|
99 |
* @return array
|
100 |
*/
|
101 |
+
abstract public function get_data();
|
|
|
|
|
102 |
|
103 |
/**
|
104 |
* Get the attachment extension.
|
105 |
*
|
106 |
+
* @since 1.0
|
107 |
* @access public
|
108 |
*
|
109 |
* @return string
|
117 |
* Tell if the current file mime type is supported.
|
118 |
*
|
119 |
* @since 1.6.9
|
120 |
+
* @access public
|
121 |
* @author Grégory Viguier
|
122 |
*
|
123 |
* @return bool
|
130 |
* Tell if the current attachment has the required WP metadata.
|
131 |
*
|
132 |
* @since 1.6.12
|
133 |
+
* @access public
|
134 |
* @author Grégory Viguier
|
135 |
*
|
136 |
* @return bool
|
142 |
/**
|
143 |
* Get the attachment error if there is one.
|
144 |
*
|
145 |
+
* @since 1.1.5
|
146 |
* @access public
|
147 |
*
|
148 |
* @return string The message error
|
151 |
$error = $this->get_size_data( 'full', 'error' );
|
152 |
|
153 |
if ( is_string( $error ) ) {
|
154 |
+
return trim( $error );
|
155 |
}
|
156 |
|
157 |
return false;
|
160 |
/**
|
161 |
* Get the attachment optimization level.
|
162 |
*
|
163 |
+
* @since 1.0
|
164 |
* @access public
|
165 |
*
|
166 |
* @return int
|
167 |
*/
|
168 |
+
abstract public function get_optimization_level();
|
|
|
|
|
169 |
|
170 |
/**
|
171 |
* Delete the 3 metas used by Imagify.
|
183 |
/**
|
184 |
* Get the attachment optimization level label.
|
185 |
*
|
186 |
+
* @since 1.2
|
187 |
* @access public
|
188 |
*
|
189 |
* @return string
|
209 |
/**
|
210 |
* Count number of optimized sizes.
|
211 |
*
|
212 |
+
* @since 1.0
|
213 |
* @access public
|
214 |
*
|
215 |
* @return int
|
233 |
/**
|
234 |
* Get the attachment optimization status (success or error).
|
235 |
*
|
236 |
+
* @since 1.0
|
237 |
* @access public
|
238 |
*
|
239 |
* @return string
|
240 |
*/
|
241 |
+
abstract public function get_status();
|
|
|
|
|
242 |
|
243 |
/**
|
244 |
* Get the original attachment path.
|
245 |
*
|
246 |
+
* @since 1.0
|
247 |
* @access public
|
248 |
*
|
249 |
* @return string
|
250 |
*/
|
251 |
+
abstract public function get_original_path();
|
|
|
|
|
252 |
|
253 |
/**
|
254 |
* Get the original attachment size.
|
255 |
*
|
256 |
+
* @since 1.0
|
257 |
* @access public
|
258 |
*
|
259 |
* @param bool $human_format True to display the image human format size (1Mb).
|
274 |
/**
|
275 |
* Get the original attachment URL.
|
276 |
*
|
277 |
+
* @since 1.0
|
278 |
* @access public
|
279 |
*
|
280 |
* @return string
|
281 |
*/
|
282 |
+
abstract public function get_original_url();
|
|
|
|
|
283 |
|
284 |
/**
|
285 |
* Get the statistics of a specific size.
|
286 |
*
|
287 |
+
* @since 1.0
|
288 |
* @access public
|
289 |
*
|
290 |
* @param string $size The thumbnail slug.
|
309 |
/**
|
310 |
* Get the global statistics data or a specific one.
|
311 |
*
|
312 |
+
* @since 1.0
|
313 |
* @access public
|
314 |
*
|
315 |
* @param string $key The specific data slug.
|
333 |
/**
|
334 |
* Check if the attachment is already optimized (before Imagify).
|
335 |
*
|
336 |
+
* @since 1.1.6
|
337 |
* @access public
|
338 |
*
|
339 |
* @return bool True if the attachment is optimized.
|
345 |
/**
|
346 |
* Check if the attachment is optimized.
|
347 |
*
|
348 |
+
* @since 1.0
|
349 |
* @access public
|
350 |
*
|
351 |
* @return bool True if the attachment is optimized.
|
357 |
/**
|
358 |
* Check if the attachment exceeding the limit size (> 5mo).
|
359 |
*
|
360 |
+
* @since 1.0
|
361 |
* @access public
|
362 |
*
|
363 |
* @return bool True if the attachment is skipped.
|
376 |
/**
|
377 |
* Check if the attachment has a backup of the original size.
|
378 |
*
|
379 |
+
* @since 1.0
|
380 |
* @access public
|
381 |
*
|
382 |
* @return bool True if the attachment has a backup.
|
388 |
/**
|
389 |
* Check if the attachment has an error.
|
390 |
*
|
391 |
+
* @since 1.0
|
392 |
* @access public
|
393 |
*
|
394 |
* @return bool True if the attachment has an error.
|
401 |
/**
|
402 |
* Update the metadata size of the attachment
|
403 |
*
|
404 |
+
* @since 1.2
|
405 |
* @access public
|
406 |
*
|
407 |
* @return void
|
408 |
*/
|
409 |
+
abstract public function update_metadata_size();
|
410 |
|
411 |
/**
|
412 |
* Delete the backup file.
|
413 |
*
|
414 |
+
* @since 1.0
|
415 |
* @access public
|
416 |
*
|
417 |
* @return void
|
428 |
* Get the registered sizes.
|
429 |
*
|
430 |
* @since 1.6.10
|
431 |
+
* @access public
|
432 |
* @author Grégory Viguier
|
433 |
*
|
434 |
* @return array Data for the registered thumbnail sizes.
|
447 |
* Get the unoptimized sizes for a specific attachment.
|
448 |
*
|
449 |
* @since 1.6.10
|
450 |
+
* @access public
|
451 |
* @author Grégory Viguier
|
452 |
*
|
453 |
* @return array Data for the unoptimized thumbnail sizes.
|
520 |
/**
|
521 |
* Fills statistics data with values from $data array.
|
522 |
*
|
523 |
+
* @since 1.0
|
524 |
+
* @since 1.6.5 Not static anymore.
|
525 |
+
* @since 1.6.6 Removed the attachment ID parameter.
|
526 |
* @access public
|
527 |
*
|
528 |
* @param array $data The statistics data.
|
531 |
* @param string $size The attachment size key.
|
532 |
* @return bool|array False if the original size has an error or an array contains the data for other result.
|
533 |
*/
|
534 |
+
abstract public function fill_data( $data, $response, $url, $size = 'full' );
|
|
|
|
|
535 |
|
536 |
/**
|
537 |
* Optimize all sizes with Imagify.
|
538 |
*
|
539 |
+
* @since 1.0
|
540 |
* @access public
|
541 |
*
|
542 |
* @param int $optimization_level The optimization level (2=ultra, 1=aggressive, 0=normal).
|
543 |
* @param array $metadata The attachment meta data.
|
544 |
* @return array $optimized_data The optimization data.
|
545 |
*/
|
546 |
+
abstract public function optimize( $optimization_level = null, $metadata = array() );
|
|
|
|
|
547 |
|
548 |
/**
|
549 |
* Optimize missing sizes with Imagify.
|
555 |
* @param int $optimization_level The optimization level (2=ultra, 1=aggressive, 0=normal).
|
556 |
* @return array|object An array of thumbnail data, size by size. A WP_Error object on failure.
|
557 |
*/
|
558 |
+
abstract public function optimize_missing_thumbnails( $optimization_level = null );
|
|
|
|
|
559 |
|
560 |
/**
|
561 |
* Process an attachment restoration from the backup file.
|
562 |
*
|
563 |
+
* @since 1.0
|
564 |
* @access public
|
565 |
*
|
566 |
* @return void
|
567 |
*/
|
568 |
+
abstract public function restore();
|
569 |
|
570 |
/**
|
571 |
* Resize an image if bigger than the maximum width defined in the settings.
|
572 |
*
|
573 |
+
* @since 1.5.7
|
574 |
+
* @access public
|
575 |
* @author Remy Perona
|
576 |
*
|
577 |
* @param string $attachment_path Path to the image.
|
inc/classes/class-imagify-abstract-db.php
CHANGED
@@ -4,8 +4,8 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
|
4 |
/**
|
5 |
* Imagify DB base class.
|
6 |
*
|
7 |
-
* @
|
8 |
-
* @
|
9 |
*/
|
10 |
abstract class Imagify_Abstract_DB {
|
11 |
|
@@ -14,59 +14,58 @@ abstract class Imagify_Abstract_DB {
|
|
14 |
*
|
15 |
* @var string
|
16 |
*/
|
17 |
-
const VERSION = '1.
|
18 |
|
19 |
/**
|
20 |
* The single instance of the class.
|
21 |
*
|
22 |
-
* @
|
23 |
-
* @since
|
24 |
-
*
|
25 |
-
* @var object
|
26 |
*/
|
27 |
protected static $_instance;
|
28 |
|
29 |
/**
|
30 |
* The name of our database table.
|
31 |
*
|
32 |
-
* @var
|
33 |
-
* @
|
34 |
-
* @
|
35 |
*/
|
36 |
public $table_name;
|
37 |
|
38 |
/**
|
39 |
* The version of our database table.
|
40 |
*
|
41 |
-
* @var
|
42 |
-
* @
|
43 |
-
* @
|
44 |
*/
|
45 |
public $version;
|
46 |
|
47 |
/**
|
48 |
* The name of the primary column.
|
49 |
*
|
50 |
-
* @var
|
51 |
-
* @
|
52 |
-
* @
|
53 |
*/
|
54 |
public $primary_key;
|
55 |
|
56 |
/**
|
57 |
* Get things started.
|
58 |
*
|
59 |
-
* @
|
60 |
-
* @
|
61 |
*/
|
62 |
protected function __construct() {}
|
63 |
|
64 |
/**
|
65 |
* Get the main Instance.
|
66 |
*
|
67 |
-
* @
|
68 |
-
* @
|
69 |
-
* @author
|
70 |
*
|
71 |
* @return object Main instance.
|
72 |
*/
|
@@ -81,32 +80,28 @@ abstract class Imagify_Abstract_DB {
|
|
81 |
/**
|
82 |
* Whitelist of columns.
|
83 |
*
|
84 |
-
* @
|
85 |
-
* @
|
86 |
*
|
87 |
* @return array
|
88 |
*/
|
89 |
-
public function get_columns()
|
90 |
-
return array();
|
91 |
-
}
|
92 |
|
93 |
/**
|
94 |
* Default column values.
|
95 |
*
|
96 |
-
* @
|
97 |
-
* @
|
98 |
*
|
99 |
* @return array
|
100 |
*/
|
101 |
-
public function get_column_defaults()
|
102 |
-
return array();
|
103 |
-
}
|
104 |
|
105 |
/**
|
106 |
* Retrieve a row by the primary key.
|
107 |
*
|
108 |
-
* @
|
109 |
-
* @
|
110 |
*
|
111 |
* @param string $row_id A primary key.
|
112 |
* @return object
|
@@ -119,8 +114,8 @@ abstract class Imagify_Abstract_DB {
|
|
119 |
/**
|
120 |
* Retrieve a row by a specific column / value.
|
121 |
*
|
122 |
-
* @
|
123 |
-
* @
|
124 |
*
|
125 |
* @param string $column A column name.
|
126 |
* @param string $row_id A value.
|
@@ -135,8 +130,8 @@ abstract class Imagify_Abstract_DB {
|
|
135 |
/**
|
136 |
* Retrieve a specific column's value by the primary key.
|
137 |
*
|
138 |
-
* @
|
139 |
-
* @
|
140 |
*
|
141 |
* @param string $column A column name.
|
142 |
* @param string $row_id A primary key.
|
@@ -151,8 +146,8 @@ abstract class Imagify_Abstract_DB {
|
|
151 |
/**
|
152 |
* Retrieve a specific column's value by the the specified column / value.
|
153 |
*
|
154 |
-
* @
|
155 |
-
* @
|
156 |
*
|
157 |
* @param string $column A column name.
|
158 |
* @param string $column_where A column name.
|
@@ -169,8 +164,8 @@ abstract class Imagify_Abstract_DB {
|
|
169 |
/**
|
170 |
* Retrieve a specific column's value by the the specified column / values.
|
171 |
*
|
172 |
-
* @access public
|
173 |
* @since 1.6.12
|
|
|
174 |
* @author Grégory Viguier
|
175 |
*
|
176 |
* @param string $column A column name.
|
@@ -182,16 +177,15 @@ abstract class Imagify_Abstract_DB {
|
|
182 |
global $wpdb;
|
183 |
$column = esc_sql( $column );
|
184 |
$column_where = esc_sql( $column_where );
|
185 |
-
$column_values =
|
186 |
-
$column_values = "'" . implode( "','", $column_values ) . "'";
|
187 |
return $wpdb->get_var( "SELECT $column FROM $this->table_name WHERE $column_where IN ( $column_values ) LIMIT 1;" ); // WPCS: unprepared SQL ok.
|
188 |
}
|
189 |
|
190 |
/**
|
191 |
* Insert a new row.
|
192 |
*
|
193 |
-
* @
|
194 |
-
* @
|
195 |
*
|
196 |
* @param string $data New data.
|
197 |
* @return int
|
@@ -223,8 +217,8 @@ abstract class Imagify_Abstract_DB {
|
|
223 |
/**
|
224 |
* Update a row.
|
225 |
*
|
226 |
-
* @
|
227 |
-
* @
|
228 |
*
|
229 |
* @param string $row_id A primary key.
|
230 |
* @param array $data New data.
|
@@ -269,8 +263,8 @@ abstract class Imagify_Abstract_DB {
|
|
269 |
/**
|
270 |
* Delete a row identified by the primary key.
|
271 |
*
|
272 |
-
* @
|
273 |
-
* @
|
274 |
*
|
275 |
* @param string $row_id A primary key.
|
276 |
* @return bool
|
@@ -292,6 +286,7 @@ abstract class Imagify_Abstract_DB {
|
|
292 |
* Check if the given table exists.
|
293 |
*
|
294 |
* @since 1.5
|
|
|
295 |
*
|
296 |
* @param string $table The table name.
|
297 |
* @return bool True if the table name exists.
|
@@ -302,5 +297,4 @@ abstract class Imagify_Abstract_DB {
|
|
302 |
|
303 |
return $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE '%s'", $table ) ) === $table;
|
304 |
}
|
305 |
-
|
306 |
}
|
4 |
/**
|
5 |
* Imagify DB base class.
|
6 |
*
|
7 |
+
* @since 1.5
|
8 |
+
* @source https://gist.github.com/pippinsplugins/e220a7f0f0f2fbe64608
|
9 |
*/
|
10 |
abstract class Imagify_Abstract_DB {
|
11 |
|
14 |
*
|
15 |
* @var string
|
16 |
*/
|
17 |
+
const VERSION = '1.1.1';
|
18 |
|
19 |
/**
|
20 |
* The single instance of the class.
|
21 |
*
|
22 |
+
* @var object
|
23 |
+
* @since 1.5
|
24 |
+
* @access protected
|
|
|
25 |
*/
|
26 |
protected static $_instance;
|
27 |
|
28 |
/**
|
29 |
* The name of our database table.
|
30 |
*
|
31 |
+
* @var string
|
32 |
+
* @since 1.5
|
33 |
+
* @access public
|
34 |
*/
|
35 |
public $table_name;
|
36 |
|
37 |
/**
|
38 |
* The version of our database table.
|
39 |
*
|
40 |
+
* @var string
|
41 |
+
* @since 1.5
|
42 |
+
* @access public
|
43 |
*/
|
44 |
public $version;
|
45 |
|
46 |
/**
|
47 |
* The name of the primary column.
|
48 |
*
|
49 |
+
* @var string
|
50 |
+
* @since 1.5
|
51 |
+
* @access public
|
52 |
*/
|
53 |
public $primary_key;
|
54 |
|
55 |
/**
|
56 |
* Get things started.
|
57 |
*
|
58 |
+
* @since 1.5
|
59 |
+
* @access protected
|
60 |
*/
|
61 |
protected function __construct() {}
|
62 |
|
63 |
/**
|
64 |
* Get the main Instance.
|
65 |
*
|
66 |
+
* @since 1.6.5
|
67 |
+
* @access public
|
68 |
+
* @author Grégory Viguier
|
69 |
*
|
70 |
* @return object Main instance.
|
71 |
*/
|
80 |
/**
|
81 |
* Whitelist of columns.
|
82 |
*
|
83 |
+
* @since 1.5
|
84 |
+
* @access public
|
85 |
*
|
86 |
* @return array
|
87 |
*/
|
88 |
+
abstract public function get_columns();
|
|
|
|
|
89 |
|
90 |
/**
|
91 |
* Default column values.
|
92 |
*
|
93 |
+
* @since 1.5
|
94 |
+
* @access public
|
95 |
*
|
96 |
* @return array
|
97 |
*/
|
98 |
+
abstract public function get_column_defaults();
|
|
|
|
|
99 |
|
100 |
/**
|
101 |
* Retrieve a row by the primary key.
|
102 |
*
|
103 |
+
* @since 1.5
|
104 |
+
* @access public
|
105 |
*
|
106 |
* @param string $row_id A primary key.
|
107 |
* @return object
|
114 |
/**
|
115 |
* Retrieve a row by a specific column / value.
|
116 |
*
|
117 |
+
* @since 1.5
|
118 |
+
* @access public
|
119 |
*
|
120 |
* @param string $column A column name.
|
121 |
* @param string $row_id A value.
|
130 |
/**
|
131 |
* Retrieve a specific column's value by the primary key.
|
132 |
*
|
133 |
+
* @since 1.5
|
134 |
+
* @access public
|
135 |
*
|
136 |
* @param string $column A column name.
|
137 |
* @param string $row_id A primary key.
|
146 |
/**
|
147 |
* Retrieve a specific column's value by the the specified column / value.
|
148 |
*
|
149 |
+
* @since 1.5
|
150 |
+
* @access public
|
151 |
*
|
152 |
* @param string $column A column name.
|
153 |
* @param string $column_where A column name.
|
164 |
/**
|
165 |
* Retrieve a specific column's value by the the specified column / values.
|
166 |
*
|
|
|
167 |
* @since 1.6.12
|
168 |
+
* @access public
|
169 |
* @author Grégory Viguier
|
170 |
*
|
171 |
* @param string $column A column name.
|
177 |
global $wpdb;
|
178 |
$column = esc_sql( $column );
|
179 |
$column_where = esc_sql( $column_where );
|
180 |
+
$column_values = Imagify_DB::prepare_values_list( $column_values );
|
|
|
181 |
return $wpdb->get_var( "SELECT $column FROM $this->table_name WHERE $column_where IN ( $column_values ) LIMIT 1;" ); // WPCS: unprepared SQL ok.
|
182 |
}
|
183 |
|
184 |
/**
|
185 |
* Insert a new row.
|
186 |
*
|
187 |
+
* @since 1.5
|
188 |
+
* @access public
|
189 |
*
|
190 |
* @param string $data New data.
|
191 |
* @return int
|
217 |
/**
|
218 |
* Update a row.
|
219 |
*
|
220 |
+
* @since 1.5
|
221 |
+
* @access public
|
222 |
*
|
223 |
* @param string $row_id A primary key.
|
224 |
* @param array $data New data.
|
263 |
/**
|
264 |
* Delete a row identified by the primary key.
|
265 |
*
|
266 |
+
* @since 1.5
|
267 |
+
* @access public
|
268 |
*
|
269 |
* @param string $row_id A primary key.
|
270 |
* @return bool
|
286 |
* Check if the given table exists.
|
287 |
*
|
288 |
* @since 1.5
|
289 |
+
* @access public
|
290 |
*
|
291 |
* @param string $table The table name.
|
292 |
* @return bool True if the table name exists.
|
297 |
|
298 |
return $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE '%s'", $table ) ) === $table;
|
299 |
}
|
|
|
300 |
}
|
inc/classes/class-imagify-admin-ajax-post.php
CHANGED
@@ -14,7 +14,7 @@ class Imagify_Admin_Ajax_Post {
|
|
14 |
*
|
15 |
* @var string
|
16 |
*/
|
17 |
-
const VERSION = '1.0';
|
18 |
|
19 |
/**
|
20 |
* Actions to be triggered on admin ajax and admin post.
|
@@ -138,8 +138,7 @@ class Imagify_Admin_Ajax_Post {
|
|
138 |
imagify_check_nonce( 'imagify-manual-upload-' . $attachment_id . '-' . $context );
|
139 |
imagify_check_user_capacity( 'manual-optimize', $attachment_id );
|
140 |
|
141 |
-
$
|
142 |
-
$attachment = new $class_name( $attachment_id );
|
143 |
|
144 |
// Optimize it!!!!!
|
145 |
$attachment->optimize();
|
@@ -168,8 +167,7 @@ class Imagify_Admin_Ajax_Post {
|
|
168 |
imagify_check_nonce( 'imagify-manual-override-upload-' . $attachment_id . '-' . $context );
|
169 |
imagify_check_user_capacity( 'manual-optimize', $attachment_id );
|
170 |
|
171 |
-
$
|
172 |
-
$attachment = new $class_name( $attachment_id );
|
173 |
|
174 |
// Restore the backup file.
|
175 |
$attachment->restore();
|
@@ -201,8 +199,7 @@ class Imagify_Admin_Ajax_Post {
|
|
201 |
imagify_check_nonce( 'imagify-optimize-missing-sizes-' . $attachment_id . '-' . $context );
|
202 |
imagify_check_user_capacity( 'manual-optimize', $attachment_id );
|
203 |
|
204 |
-
$
|
205 |
-
$attachment = new $class_name( $attachment_id );
|
206 |
|
207 |
// Optimize the missing thumbnails.
|
208 |
$attachment->optimize_missing_thumbnails();
|
@@ -231,8 +228,7 @@ class Imagify_Admin_Ajax_Post {
|
|
231 |
imagify_check_nonce( 'imagify-restore-upload-' . $attachment_id . '-' . $context );
|
232 |
imagify_check_user_capacity( 'manual-optimize', $attachment_id );
|
233 |
|
234 |
-
$
|
235 |
-
$attachment = new $class_name( $attachment_id );
|
236 |
|
237 |
// Restore the backup file.
|
238 |
$attachment->restore();
|
@@ -262,8 +258,7 @@ class Imagify_Admin_Ajax_Post {
|
|
262 |
imagify_check_nonce( 'imagify-bulk-upload', 'imagifybulkuploadnonce' );
|
263 |
imagify_check_user_capacity( 'bulk-optimize', $attachment_id );
|
264 |
|
265 |
-
$
|
266 |
-
$attachment = new $class_name( $attachment_id );
|
267 |
$optimization_level = get_transient( 'imagify_bulk_optimization_level' );
|
268 |
|
269 |
// Restore it if the optimization level is updated.
|
@@ -322,8 +317,7 @@ class Imagify_Admin_Ajax_Post {
|
|
322 |
imagify_check_nonce( 'new_media-' . $attachment_id );
|
323 |
imagify_check_user_capacity( 'auto-optimize' );
|
324 |
|
325 |
-
$
|
326 |
-
$attachment = new $class_name( $attachment_id );
|
327 |
|
328 |
// Optimize it!!!!!
|
329 |
$attachment->optimize( null, $_POST['metadata'] );
|
@@ -346,13 +340,13 @@ class Imagify_Admin_Ajax_Post {
|
|
346 |
imagify_check_nonce( 'image_editor-' . $attachment_id );
|
347 |
imagify_check_user_capacity( 'edit_post', $attachment_id );
|
348 |
|
349 |
-
|
|
|
|
|
350 |
return;
|
351 |
}
|
352 |
|
353 |
-
$optimization_level = (
|
354 |
-
$class_name = get_imagify_attachment_class_name( 'wp', $attachment_id, 'wp_ajax_imagify_async_optimize_save_image_editor_file' );
|
355 |
-
$attachment = new $class_name( $attachment_id );
|
356 |
$metadata = wp_get_attachment_metadata( $attachment_id );
|
357 |
|
358 |
// Remove old optimization data.
|
@@ -420,11 +414,10 @@ class Imagify_Admin_Ajax_Post {
|
|
420 |
$unoptimized_attachment_limit = (int) apply_filters( 'imagify_unoptimized_attachment_limit', 10000 );
|
421 |
$unoptimized_attachment_limit = -1 === $unoptimized_attachment_limit ? PHP_INT_MAX : $unoptimized_attachment_limit;
|
422 |
|
423 |
-
|
424 |
-
$mime_types = esc_sql( $mime_types );
|
425 |
-
$mime_types = "'" . implode( "','", $mime_types ) . "'";
|
426 |
|
427 |
-
$
|
|
|
428 |
"SELECT $wpdb->posts.ID
|
429 |
FROM $wpdb->posts
|
430 |
LEFT JOIN $wpdb->postmeta
|
@@ -466,7 +459,7 @@ class Imagify_Admin_Ajax_Post {
|
|
466 |
wp_send_json_error( array( 'message' => 'no-images' ) );
|
467 |
}
|
468 |
|
469 |
-
$results =
|
470 |
// Get attachments filename.
|
471 |
'filenames' => '_wp_attached_file',
|
472 |
// Get attachments data.
|
14 |
*
|
15 |
* @var string
|
16 |
*/
|
17 |
+
const VERSION = '1.0.1';
|
18 |
|
19 |
/**
|
20 |
* Actions to be triggered on admin ajax and admin post.
|
138 |
imagify_check_nonce( 'imagify-manual-upload-' . $attachment_id . '-' . $context );
|
139 |
imagify_check_user_capacity( 'manual-optimize', $attachment_id );
|
140 |
|
141 |
+
$attachment = get_imagify_attachment( $context, $attachment_id, 'imagify_manual_upload' );
|
|
|
142 |
|
143 |
// Optimize it!!!!!
|
144 |
$attachment->optimize();
|
167 |
imagify_check_nonce( 'imagify-manual-override-upload-' . $attachment_id . '-' . $context );
|
168 |
imagify_check_user_capacity( 'manual-optimize', $attachment_id );
|
169 |
|
170 |
+
$attachment = get_imagify_attachment( $context, $attachment_id, 'imagify_manual_override_upload' );
|
|
|
171 |
|
172 |
// Restore the backup file.
|
173 |
$attachment->restore();
|
199 |
imagify_check_nonce( 'imagify-optimize-missing-sizes-' . $attachment_id . '-' . $context );
|
200 |
imagify_check_user_capacity( 'manual-optimize', $attachment_id );
|
201 |
|
202 |
+
$attachment = get_imagify_attachment( $context, $attachment_id, 'imagify_optimize_missing_sizes' );
|
|
|
203 |
|
204 |
// Optimize the missing thumbnails.
|
205 |
$attachment->optimize_missing_thumbnails();
|
228 |
imagify_check_nonce( 'imagify-restore-upload-' . $attachment_id . '-' . $context );
|
229 |
imagify_check_user_capacity( 'manual-optimize', $attachment_id );
|
230 |
|
231 |
+
$attachment = get_imagify_attachment( $context, $attachment_id, 'imagify_restore_upload' );
|
|
|
232 |
|
233 |
// Restore the backup file.
|
234 |
$attachment->restore();
|
258 |
imagify_check_nonce( 'imagify-bulk-upload', 'imagifybulkuploadnonce' );
|
259 |
imagify_check_user_capacity( 'bulk-optimize', $attachment_id );
|
260 |
|
261 |
+
$attachment = get_imagify_attachment( $context, $attachment_id, 'imagify_bulk_upload' );
|
|
|
262 |
$optimization_level = get_transient( 'imagify_bulk_optimization_level' );
|
263 |
|
264 |
// Restore it if the optimization level is updated.
|
317 |
imagify_check_nonce( 'new_media-' . $attachment_id );
|
318 |
imagify_check_user_capacity( 'auto-optimize' );
|
319 |
|
320 |
+
$attachment = get_imagify_attachment( $context, $attachment_id, 'imagify_async_optimize_upload_new_media' );
|
|
|
321 |
|
322 |
// Optimize it!!!!!
|
323 |
$attachment->optimize( null, $_POST['metadata'] );
|
340 |
imagify_check_nonce( 'image_editor-' . $attachment_id );
|
341 |
imagify_check_user_capacity( 'edit_post', $attachment_id );
|
342 |
|
343 |
+
$attachment = get_imagify_attachment( 'wp', $attachment_id, 'wp_ajax_imagify_async_optimize_save_image_editor_file' );
|
344 |
+
|
345 |
+
if ( ! $attachment->get_data() ) {
|
346 |
return;
|
347 |
}
|
348 |
|
349 |
+
$optimization_level = $attachment->get_optimization_level();
|
|
|
|
|
350 |
$metadata = wp_get_attachment_metadata( $attachment_id );
|
351 |
|
352 |
// Remove old optimization data.
|
414 |
$unoptimized_attachment_limit = (int) apply_filters( 'imagify_unoptimized_attachment_limit', 10000 );
|
415 |
$unoptimized_attachment_limit = -1 === $unoptimized_attachment_limit ? PHP_INT_MAX : $unoptimized_attachment_limit;
|
416 |
|
417 |
+
Imagify_DB::unlimit_joins();
|
|
|
|
|
418 |
|
419 |
+
$mime_types = Imagify_DB::get_mime_types();
|
420 |
+
$ids = $wpdb->get_col( $wpdb->prepare( // WPCS: unprepared SQL ok.
|
421 |
"SELECT $wpdb->posts.ID
|
422 |
FROM $wpdb->posts
|
423 |
LEFT JOIN $wpdb->postmeta
|
459 |
wp_send_json_error( array( 'message' => 'no-images' ) );
|
460 |
}
|
461 |
|
462 |
+
$results = Imagify_DB::get_metas( array(
|
463 |
// Get attachments filename.
|
464 |
'filenames' => '_wp_attached_file',
|
465 |
// Get attachments data.
|
inc/classes/class-imagify-assets.php
CHANGED
@@ -123,7 +123,7 @@ class Imagify_Assets {
|
|
123 |
return;
|
124 |
}
|
125 |
|
126 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_and_scripts' ) );
|
127 |
add_action( 'wp_enqueue_media', array( $this, 'enqueue_media_modal' ) );
|
128 |
|
129 |
add_action( 'admin_footer-media_page_imagify-bulk-optimization', array( $this, 'print_support_script' ) );
|
123 |
return;
|
124 |
}
|
125 |
|
126 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_and_scripts' ), IMAGIFY_INT_MAX );
|
127 |
add_action( 'wp_enqueue_media', array( $this, 'enqueue_media_modal' ) );
|
128 |
|
129 |
add_action( 'admin_footer-media_page_imagify-bulk-optimization', array( $this, 'print_support_script' ) );
|
inc/classes/class-imagify-attachment.php
CHANGED
@@ -13,7 +13,7 @@ class Imagify_Attachment extends Imagify_Abstract_Attachment {
|
|
13 |
*
|
14 |
* @var string
|
15 |
*/
|
16 |
-
const VERSION = '1.1';
|
17 |
|
18 |
/**
|
19 |
* The editor instance used to resize files.
|
@@ -26,22 +26,16 @@ class Imagify_Attachment extends Imagify_Abstract_Attachment {
|
|
26 |
protected $editor;
|
27 |
|
28 |
/**
|
29 |
-
* Get the attachment backup file path.
|
30 |
*
|
31 |
-
* @since 1.
|
|
|
32 |
* @access public
|
33 |
*
|
34 |
-
* @return string|
|
35 |
*/
|
36 |
-
public function
|
37 |
-
|
38 |
-
$backup_path = get_imagify_attachment_backup_path( $file_path );
|
39 |
-
|
40 |
-
if ( $backup_path && file_exists( $backup_path ) ) {
|
41 |
-
return $backup_path;
|
42 |
-
}
|
43 |
-
|
44 |
-
return false;
|
45 |
}
|
46 |
|
47 |
/**
|
@@ -490,7 +484,7 @@ class Imagify_Attachment extends Imagify_Abstract_Attachment {
|
|
490 |
*/
|
491 |
public function optimize_missing_thumbnails( $optimization_level = null ) {
|
492 |
// Check if the attachment extension is allowed.
|
493 |
-
if ( !
|
494 |
return new WP_Error( 'mime_type_not_supported', __( 'This type of file is not supported.', 'imagify' ) );
|
495 |
}
|
496 |
|
@@ -502,6 +496,11 @@ class Imagify_Attachment extends Imagify_Abstract_Attachment {
|
|
502 |
return array();
|
503 |
}
|
504 |
|
|
|
|
|
|
|
|
|
|
|
505 |
/**
|
506 |
* Fires before optimizing the missing thumbnails.
|
507 |
*
|
13 |
*
|
14 |
* @var string
|
15 |
*/
|
16 |
+
const VERSION = '1.1.1';
|
17 |
|
18 |
/**
|
19 |
* The editor instance used to resize files.
|
26 |
protected $editor;
|
27 |
|
28 |
/**
|
29 |
+
* Get the attachment backup file path, even if the file doesn't exist.
|
30 |
*
|
31 |
+
* @since 1.6.13
|
32 |
+
* @author Grégory Viguier
|
33 |
* @access public
|
34 |
*
|
35 |
+
* @return string|bool The file path. False on failure.
|
36 |
*/
|
37 |
+
public function get_raw_backup_path() {
|
38 |
+
return get_imagify_attachment_backup_path( $this->get_original_path() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
|
41 |
/**
|
484 |
*/
|
485 |
public function optimize_missing_thumbnails( $optimization_level = null ) {
|
486 |
// Check if the attachment extension is allowed.
|
487 |
+
if ( ! $this->is_mime_type_supported() ) {
|
488 |
return new WP_Error( 'mime_type_not_supported', __( 'This type of file is not supported.', 'imagify' ) );
|
489 |
}
|
490 |
|
496 |
return array();
|
497 |
}
|
498 |
|
499 |
+
// Stop the process if there is no backup file to use.
|
500 |
+
if ( ! $this->has_backup() ) {
|
501 |
+
return new WP_Error( 'no_backup', __( 'This file has no backup file.', 'imagify' ) );
|
502 |
+
}
|
503 |
+
|
504 |
/**
|
505 |
* Fires before optimizing the missing thumbnails.
|
506 |
*
|
inc/classes/class-imagify-db.php
ADDED
@@ -0,0 +1,188 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Imagify DB class. It reunites tools to work with the DB.
|
6 |
+
*
|
7 |
+
* @since 1.6.13
|
8 |
+
* @author Grégory Viguier
|
9 |
+
*/
|
10 |
+
class Imagify_DB {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Class version.
|
14 |
+
*
|
15 |
+
* @var string
|
16 |
+
*/
|
17 |
+
const VERSION = '1.0';
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Some hosts limit the number of JOINs in SQL queries, but we need them.
|
21 |
+
*
|
22 |
+
* @since 1.6.13
|
23 |
+
* @access public
|
24 |
+
* @author Grégory Viguier
|
25 |
+
*/
|
26 |
+
public static function unlimit_joins() {
|
27 |
+
global $wpdb;
|
28 |
+
static $done = false;
|
29 |
+
|
30 |
+
if ( $done ) {
|
31 |
+
return;
|
32 |
+
}
|
33 |
+
|
34 |
+
$done = true;
|
35 |
+
$query = 'SET SQL_BIG_SELECTS=1';
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Filter the SQL query allowing to remove the limit on JOINs.
|
39 |
+
*
|
40 |
+
* @since 1.6.13
|
41 |
+
* @author Grégory Viguier
|
42 |
+
*
|
43 |
+
* @param string|bool $query The query. False to prevent any query.
|
44 |
+
*/
|
45 |
+
$query = apply_filters( 'imagify_db_unlimit_joins_query', $query );
|
46 |
+
|
47 |
+
if ( $query && is_string( $query ) ) {
|
48 |
+
$wpdb->query( $query ); // WPCS: unprepared SQL ok.
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Change an array of values into a comma separated list, ready to be used in a `IN ()` clause.
|
54 |
+
*
|
55 |
+
* @since 1.6.13
|
56 |
+
* @access public
|
57 |
+
* @author Grégory Viguier
|
58 |
+
*
|
59 |
+
* @param array $values An array of values.
|
60 |
+
* @return string A comma separated list of values.
|
61 |
+
*/
|
62 |
+
public static function prepare_values_list( $values ) {
|
63 |
+
$values = esc_sql( (array) $values );
|
64 |
+
$values = array_map( array( __CLASS__, 'quote_string' ), $values );
|
65 |
+
return implode( ',', $values );
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Wrap a value in quotes, unless it's an integer.
|
70 |
+
*
|
71 |
+
* @since 1.6.13
|
72 |
+
* @access public
|
73 |
+
* @author Grégory Viguier
|
74 |
+
*
|
75 |
+
* @param int|string $value A value.
|
76 |
+
* @return int|string
|
77 |
+
*/
|
78 |
+
public static function quote_string( $value ) {
|
79 |
+
return is_numeric( $value ) ? $value : "'" . addcslashes( $value, "'" ) . "'";
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Get Imagify mime types, ready to be used in a `IN ()` clause.
|
84 |
+
*
|
85 |
+
* @since 1.6.13
|
86 |
+
* @access public
|
87 |
+
* @author Grégory Viguier
|
88 |
+
*
|
89 |
+
* @return string A comma separated list of mime types.
|
90 |
+
*/
|
91 |
+
public static function get_mime_types() {
|
92 |
+
static $mime_types;
|
93 |
+
|
94 |
+
if ( ! isset( $mime_types ) ) {
|
95 |
+
$mime_types = self::prepare_values_list( get_imagify_mime_type() );
|
96 |
+
}
|
97 |
+
|
98 |
+
return $mime_types;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Combine two arrays with some specific keys.
|
103 |
+
* We use this function to combine the result of 2 SQL queries.
|
104 |
+
*
|
105 |
+
* @since 1.6.13
|
106 |
+
* @access public
|
107 |
+
* @author Grégory Viguier
|
108 |
+
*
|
109 |
+
* @param array $keys An array of keys.
|
110 |
+
* @param array $values An array of arrays like array( 'id' => id, 'value' => value ).
|
111 |
+
* @param int $keep_keys_order Set to true to return an array ordered like $keys instead of $values.
|
112 |
+
* @return array The combined arrays.
|
113 |
+
*/
|
114 |
+
public static function combine_query_results( $keys, $values, $keep_keys_order = false ) {
|
115 |
+
if ( ! $keys || ! $values ) {
|
116 |
+
return array();
|
117 |
+
}
|
118 |
+
|
119 |
+
$result = array();
|
120 |
+
$keys = array_flip( $keys );
|
121 |
+
|
122 |
+
foreach ( $values as $v ) {
|
123 |
+
if ( isset( $keys[ $v['id'] ] ) ) {
|
124 |
+
$result[ $v['id'] ] = $v['value'];
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
if ( $keep_keys_order ) {
|
129 |
+
$keys = array_intersect_key( $keys, $result );
|
130 |
+
return array_replace( $keys, $result );
|
131 |
+
}
|
132 |
+
|
133 |
+
return $result;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* A helper to retrieve all values from one or several post metas, given a list of post IDs.
|
138 |
+
* The $wpdb cache is flushed to save memory.
|
139 |
+
*
|
140 |
+
* @since 1.6.13
|
141 |
+
* @access public
|
142 |
+
* @author Grégory Viguier
|
143 |
+
*
|
144 |
+
* @param array $metas An array of meta names like:
|
145 |
+
* array(
|
146 |
+
* 'key1' => 'meta_name_1',
|
147 |
+
* 'key2' => 'meta_name_2',
|
148 |
+
* 'key3' => 'meta_name_3',
|
149 |
+
* )
|
150 |
+
* If a key contains 'data', the results will be unserialized.
|
151 |
+
* @param array $ids An array of post IDs.
|
152 |
+
* @return array An array of arrays of results like:
|
153 |
+
* array(
|
154 |
+
* 'key1' => array( post_id_1 => 'result_1', post_id_2 => 'result_2', post_id_3 => 'result_3' ),
|
155 |
+
* 'key2' => array( post_id_1 => 'result_4', post_id_3 => 'result_5' ),
|
156 |
+
* 'key3' => array( post_id_1 => 'result_6', post_id_2 => 'result_7' ),
|
157 |
+
* )
|
158 |
+
*/
|
159 |
+
public static function get_metas( $metas, $ids ) {
|
160 |
+
global $wpdb;
|
161 |
+
|
162 |
+
if ( ! $ids ) {
|
163 |
+
return array_fill_keys( array_keys( $metas ), array() );
|
164 |
+
}
|
165 |
+
|
166 |
+
$sql_ids = implode( ',', $ids );
|
167 |
+
|
168 |
+
foreach ( $metas as $result_name => $meta_name ) {
|
169 |
+
$metas[ $result_name ] = $wpdb->get_results( // WPCS: unprepared SQL ok.
|
170 |
+
"SELECT pm.post_id as id, pm.meta_value as value
|
171 |
+
FROM $wpdb->postmeta as pm
|
172 |
+
WHERE pm.meta_key = '$meta_name'
|
173 |
+
AND pm.post_id IN ( $sql_ids )
|
174 |
+
ORDER BY pm.post_id DESC",
|
175 |
+
ARRAY_A
|
176 |
+
);
|
177 |
+
|
178 |
+
$wpdb->flush();
|
179 |
+
$metas[ $result_name ] = self::combine_query_results( $ids, $metas[ $result_name ], true );
|
180 |
+
|
181 |
+
if ( strpos( $result_name, 'data' ) !== false ) {
|
182 |
+
$metas[ $result_name ] = array_map( 'maybe_unserialize', $metas[ $result_name ] );
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
return $metas;
|
187 |
+
}
|
188 |
+
}
|
inc/common/attachments.php
CHANGED
@@ -53,9 +53,7 @@ add_action( 'delete_attachment', '_imagify_delete_backup_file' );
|
|
53 |
* @param int $post_id Attachment ID.
|
54 |
*/
|
55 |
function _imagify_delete_backup_file( $post_id ) {
|
56 |
-
|
57 |
-
$attachment = new $class_name( $post_id );
|
58 |
-
$attachment->delete_backup();
|
59 |
}
|
60 |
|
61 |
add_action( 'shutdown', '_imagify_optimize_save_image_editor_file' );
|
@@ -78,7 +76,9 @@ function _imagify_optimize_save_image_editor_file() {
|
|
78 |
|
79 |
check_ajax_referer( 'image_editor-' . $attachment_id );
|
80 |
|
81 |
-
|
|
|
|
|
82 |
return;
|
83 |
}
|
84 |
|
53 |
* @param int $post_id Attachment ID.
|
54 |
*/
|
55 |
function _imagify_delete_backup_file( $post_id ) {
|
56 |
+
get_imagify_attachment( 'wp', $post_id, 'delete_attachment' )->delete_backup();
|
|
|
|
|
57 |
}
|
58 |
|
59 |
add_action( 'shutdown', '_imagify_optimize_save_image_editor_file' );
|
76 |
|
77 |
check_ajax_referer( 'image_editor-' . $attachment_id );
|
78 |
|
79 |
+
$attachment = get_imagify_attachment( 'wp', $attachment_id, 'save_image_editor_file' );
|
80 |
+
|
81 |
+
if ( ! $attachment->get_data() ) {
|
82 |
return;
|
83 |
}
|
84 |
|
inc/functions/admin-stats.php
CHANGED
@@ -31,11 +31,8 @@ function imagify_count_attachments() {
|
|
31 |
return $count;
|
32 |
}
|
33 |
|
34 |
-
$mime_types =
|
35 |
-
$
|
36 |
-
$mime_types = "'" . implode( "','", $mime_types ) . "'";
|
37 |
-
|
38 |
-
$count = (int) $wpdb->get_var( // WPCS: unprepared SQL ok.
|
39 |
"
|
40 |
SELECT COUNT( ID )
|
41 |
FROM $wpdb->posts
|
@@ -93,11 +90,10 @@ function imagify_count_error_attachments() {
|
|
93 |
return $count;
|
94 |
}
|
95 |
|
96 |
-
|
97 |
-
$mime_types = esc_sql( $mime_types );
|
98 |
-
$mime_types = "'" . implode( "','", $mime_types ) . "'";
|
99 |
|
100 |
-
$
|
|
|
101 |
"
|
102 |
SELECT COUNT( $wpdb->posts.ID )
|
103 |
FROM $wpdb->posts
|
@@ -146,11 +142,10 @@ function imagify_count_optimized_attachments() {
|
|
146 |
return $count;
|
147 |
}
|
148 |
|
149 |
-
|
150 |
-
$mime_types = esc_sql( $mime_types );
|
151 |
-
$mime_types = "'" . implode( "','", $mime_types ) . "'";
|
152 |
|
153 |
-
$
|
|
|
154 |
"
|
155 |
SELECT COUNT( $wpdb->posts.ID )
|
156 |
FROM $wpdb->posts
|
@@ -403,11 +398,8 @@ function imagify_count_saving_data( $key = '' ) {
|
|
403 |
function imagify_calculate_total_size_images_library() {
|
404 |
global $wpdb;
|
405 |
|
406 |
-
$mime_types =
|
407 |
-
$
|
408 |
-
$mime_types = "'" . implode( "','", $mime_types ) . "'";
|
409 |
-
|
410 |
-
$image_ids = $wpdb->get_col( // WPCS: unprepared SQL ok.
|
411 |
"
|
412 |
SELECT ID
|
413 |
FROM $wpdb->posts
|
@@ -445,6 +437,7 @@ function imagify_calculate_total_size_images_library() {
|
|
445 |
*/
|
446 |
function imagify_calculate_average_size_images_per_month() {
|
447 |
$query = array(
|
|
|
448 |
'post_type' => 'attachment',
|
449 |
'post_status' => 'inherit',
|
450 |
'post_mime_type' => get_imagify_mime_type(),
|
@@ -538,7 +531,7 @@ function imagify_calculate_total_image_size( $image_ids, $partial_total_images,
|
|
538 |
return 0;
|
539 |
}
|
540 |
|
541 |
-
$results =
|
542 |
// Get attachments filename.
|
543 |
'filenames' => '_wp_attached_file',
|
544 |
// Get attachments data.
|
31 |
return $count;
|
32 |
}
|
33 |
|
34 |
+
$mime_types = Imagify_DB::get_mime_types();
|
35 |
+
$count = (int) $wpdb->get_var( // WPCS: unprepared SQL ok.
|
|
|
|
|
|
|
36 |
"
|
37 |
SELECT COUNT( ID )
|
38 |
FROM $wpdb->posts
|
90 |
return $count;
|
91 |
}
|
92 |
|
93 |
+
Imagify_DB::unlimit_joins();
|
|
|
|
|
94 |
|
95 |
+
$mime_types = Imagify_DB::get_mime_types();
|
96 |
+
$count = (int) $wpdb->get_var( // WPCS: unprepared SQL ok.
|
97 |
"
|
98 |
SELECT COUNT( $wpdb->posts.ID )
|
99 |
FROM $wpdb->posts
|
142 |
return $count;
|
143 |
}
|
144 |
|
145 |
+
Imagify_DB::unlimit_joins();
|
|
|
|
|
146 |
|
147 |
+
$mime_types = Imagify_DB::get_mime_types();
|
148 |
+
$count = (int) $wpdb->get_var( // WPCS: unprepared SQL ok.
|
149 |
"
|
150 |
SELECT COUNT( $wpdb->posts.ID )
|
151 |
FROM $wpdb->posts
|
398 |
function imagify_calculate_total_size_images_library() {
|
399 |
global $wpdb;
|
400 |
|
401 |
+
$mime_types = Imagify_DB::get_mime_types();
|
402 |
+
$image_ids = $wpdb->get_col( // WPCS: unprepared SQL ok.
|
|
|
|
|
|
|
403 |
"
|
404 |
SELECT ID
|
405 |
FROM $wpdb->posts
|
437 |
*/
|
438 |
function imagify_calculate_average_size_images_per_month() {
|
439 |
$query = array(
|
440 |
+
'is_imagify' => true,
|
441 |
'post_type' => 'attachment',
|
442 |
'post_status' => 'inherit',
|
443 |
'post_mime_type' => get_imagify_mime_type(),
|
531 |
return 0;
|
532 |
}
|
533 |
|
534 |
+
$results = Imagify_DB::get_metas( array(
|
535 |
// Get attachments filename.
|
536 |
'filenames' => '_wp_attached_file',
|
537 |
// Get attachments data.
|
inc/functions/admin-ui.php
CHANGED
@@ -247,8 +247,8 @@ function get_imagify_attachment_optimize_missing_thumbnails_link( $attachment, $
|
|
247 |
*/
|
248 |
$display = apply_filters( 'imagify_display_missing_thumbnails_link', true, $attachment, $context );
|
249 |
|
250 |
-
// Stop the process if the filter is false or if the API key isn't valid.
|
251 |
-
if ( ! $display || ! imagify_valid_key() ) {
|
252 |
return '';
|
253 |
}
|
254 |
|
247 |
*/
|
248 |
$display = apply_filters( 'imagify_display_missing_thumbnails_link', true, $attachment, $context );
|
249 |
|
250 |
+
// Stop the process if the filter is false, or if the API key isn't valid, or if there is no backup file.
|
251 |
+
if ( ! $display || ! imagify_valid_key() || ! $attachment->has_backup() ) {
|
252 |
return '';
|
253 |
}
|
254 |
|
inc/functions/admin.php
CHANGED
@@ -160,40 +160,6 @@ function get_imagify_max_intermediate_image_size() {
|
|
160 |
);
|
161 |
}
|
162 |
|
163 |
-
/**
|
164 |
-
* Combine two arrays with some specific keys.
|
165 |
-
* We use this function to combine the result of 2 SQL queries.
|
166 |
-
*
|
167 |
-
* @since 1.4.5
|
168 |
-
* @since 1.6.7 Added the $keep_keys_order parameter.
|
169 |
-
*
|
170 |
-
* @param array $keys An array of keys.
|
171 |
-
* @param array $values An array of arrays like array( 'id' => id, 'value' => value ).
|
172 |
-
* @param int $keep_keys_order Set to true to return an array ordered like $keys instead of $values.
|
173 |
-
* @return array The combined arrays.
|
174 |
-
*/
|
175 |
-
function imagify_query_results_combine( $keys, $values, $keep_keys_order = false ) {
|
176 |
-
if ( ! $keys || ! $values ) {
|
177 |
-
return array();
|
178 |
-
}
|
179 |
-
|
180 |
-
$result = array();
|
181 |
-
$keys = array_flip( $keys );
|
182 |
-
|
183 |
-
foreach ( $values as $v ) {
|
184 |
-
if ( isset( $keys[ $v['id'] ] ) ) {
|
185 |
-
$result[ $v['id'] ] = $v['value'];
|
186 |
-
}
|
187 |
-
}
|
188 |
-
|
189 |
-
if ( $keep_keys_order ) {
|
190 |
-
$keys = array_intersect_key( $keys, $result );
|
191 |
-
return array_replace( $keys, $result );
|
192 |
-
}
|
193 |
-
|
194 |
-
return $result;
|
195 |
-
}
|
196 |
-
|
197 |
/**
|
198 |
* Get the default Bulk Optimization buffer size.
|
199 |
*
|
@@ -220,58 +186,6 @@ function get_imagify_bulk_buffer_size() {
|
|
220 |
}
|
221 |
}
|
222 |
|
223 |
-
/**
|
224 |
-
* A helper to retrieve all values from one or several post metas, given a list of post IDs.
|
225 |
-
* The $wpdb cache is flushed to save memory.
|
226 |
-
*
|
227 |
-
* @since 1.6.7
|
228 |
-
* @author Grégory Viguier
|
229 |
-
*
|
230 |
-
* @param array $metas An array of meta names like:
|
231 |
-
* array(
|
232 |
-
* 'key1' => 'meta_name_1',
|
233 |
-
* 'key2' => 'meta_name_2',
|
234 |
-
* 'key3' => 'meta_name_3',
|
235 |
-
* )
|
236 |
-
* If a key contains 'data', the results will be unserialized.
|
237 |
-
* @param array $ids An array of post IDs.
|
238 |
-
* @return array An array of arrays of results like:
|
239 |
-
* array(
|
240 |
-
* 'key1' => array( post_id_1 => 'result_1', post_id_2 => 'result_2', post_id_3 => 'result_3' ),
|
241 |
-
* 'key2' => array( post_id_1 => 'result_4', post_id_3 => 'result_5' ),
|
242 |
-
* 'key3' => array( post_id_1 => 'result_6', post_id_2 => 'result_7' ),
|
243 |
-
* )
|
244 |
-
*/
|
245 |
-
function imagify_get_wpdb_metas( $metas, $ids ) {
|
246 |
-
global $wpdb;
|
247 |
-
|
248 |
-
if ( ! $ids ) {
|
249 |
-
return array_fill_keys( array_keys( $metas ), array() );
|
250 |
-
}
|
251 |
-
|
252 |
-
$sql_ids = implode( ',', $ids );
|
253 |
-
|
254 |
-
foreach ( $metas as $result_name => $meta_name ) {
|
255 |
-
$metas[ $result_name ] = $wpdb->get_results( // WPCS: unprepared SQL ok.
|
256 |
-
"SELECT pm.post_id as id, pm.meta_value as value
|
257 |
-
FROM $wpdb->postmeta as pm
|
258 |
-
WHERE pm.meta_key = '$meta_name'
|
259 |
-
AND pm.post_id IN ( $sql_ids )
|
260 |
-
ORDER BY pm.post_id DESC",
|
261 |
-
ARRAY_A
|
262 |
-
);
|
263 |
-
|
264 |
-
$wpdb->flush();
|
265 |
-
$metas[ $result_name ] = imagify_query_results_combine( $ids, $metas[ $result_name ], true );
|
266 |
-
|
267 |
-
if ( strpos( $result_name, 'data' ) !== false ) {
|
268 |
-
$metas[ $result_name ] = array_map( 'maybe_unserialize', $metas[ $result_name ] );
|
269 |
-
}
|
270 |
-
}
|
271 |
-
|
272 |
-
return $metas;
|
273 |
-
}
|
274 |
-
|
275 |
/**
|
276 |
* Simple helper to get the WP Rocket's site URL.
|
277 |
* The URL is localized and contains some utm_*** parameters.
|
160 |
);
|
161 |
}
|
162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
/**
|
164 |
* Get the default Bulk Optimization buffer size.
|
165 |
*
|
186 |
}
|
187 |
}
|
188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
/**
|
190 |
* Simple helper to get the WP Rocket's site URL.
|
191 |
* The URL is localized and contains some utm_*** parameters.
|
inc/functions/common.php
CHANGED
@@ -141,6 +141,7 @@ function imagify_autoload( $class ) {
|
|
141 |
'Imagify_Admin_Ajax_Post' => 1,
|
142 |
'Imagify_Assets' => 1,
|
143 |
'Imagify_Attachment' => 1,
|
|
|
144 |
'Imagify_Notices' => 1,
|
145 |
'Imagify_User' => 1,
|
146 |
'Imagify' => 1,
|
@@ -157,6 +158,7 @@ function imagify_autoload( $class ) {
|
|
157 |
'Imagify_AS3CF_Attachment' => 'amazon-s3-and-cloudfront',
|
158 |
'Imagify_AS3CF' => 'amazon-s3-and-cloudfront',
|
159 |
'Imagify_Enable_Media_Replace' => 'enable-media-replace',
|
|
|
160 |
'Imagify_NGG_Attachment' => 'nextgen-gallery',
|
161 |
'Imagify_NGG_DB' => 'nextgen-gallery',
|
162 |
'Imagify_NGG_Storage' => 'nextgen-gallery',
|
141 |
'Imagify_Admin_Ajax_Post' => 1,
|
142 |
'Imagify_Assets' => 1,
|
143 |
'Imagify_Attachment' => 1,
|
144 |
+
'Imagify_DB' => 1,
|
145 |
'Imagify_Notices' => 1,
|
146 |
'Imagify_User' => 1,
|
147 |
'Imagify' => 1,
|
158 |
'Imagify_AS3CF_Attachment' => 'amazon-s3-and-cloudfront',
|
159 |
'Imagify_AS3CF' => 'amazon-s3-and-cloudfront',
|
160 |
'Imagify_Enable_Media_Replace' => 'enable-media-replace',
|
161 |
+
'Imagify_Formidable_Pro' => 'formidable-pro',
|
162 |
'Imagify_NGG_Attachment' => 'nextgen-gallery',
|
163 |
'Imagify_NGG_DB' => 'nextgen-gallery',
|
164 |
'Imagify_NGG_Storage' => 'nextgen-gallery',
|
inc/functions/deprecated.php
CHANGED
@@ -30,8 +30,7 @@ class Imagify_Deprecated {
|
|
30 |
* @return object Main instance.
|
31 |
*/
|
32 |
public static function instance() {
|
33 |
-
|
34 |
-
_deprecated_function( $class_name . '::' . __FUNCTION__ . '()', '1.6.5', 'Imagify::get_instance()' );
|
35 |
return Imagify::get_instance();
|
36 |
}
|
37 |
|
@@ -220,14 +219,18 @@ if ( function_exists( 'emr_delete_current_files' ) ) :
|
|
220 |
|
221 |
$attachment_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid='%s';", $guid ) );
|
222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
// Stop if the attachment wasn't optimized yet by Imagify.
|
224 |
-
if ( !
|
225 |
return;
|
226 |
}
|
227 |
|
228 |
-
$optimization_level =
|
229 |
-
$class_name = get_imagify_attachment_class_name( 'wp', $attachment_id, 'enable-media-replace-upload-done' );
|
230 |
-
$attachment = new $class_name( $attachment_id );
|
231 |
|
232 |
// Remove old optimization data.
|
233 |
$attachment->delete_imagify_data();
|
@@ -339,6 +342,69 @@ if ( class_exists( 'C_NextGEN_Bootstrap' ) && class_exists( 'Mixin' ) && get_sit
|
|
339 |
return Imagify_NGG_DB::get_instance();
|
340 |
}
|
341 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
endif;
|
343 |
|
344 |
if ( is_admin() ) :
|
30 |
* @return object Main instance.
|
31 |
*/
|
32 |
public static function instance() {
|
33 |
+
_deprecated_function( get_class( $this ) . '::' . __FUNCTION__ . '()', '1.6.5', 'Imagify::get_instance()' );
|
|
|
34 |
return Imagify::get_instance();
|
35 |
}
|
36 |
|
219 |
|
220 |
$attachment_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid='%s';", $guid ) );
|
221 |
|
222 |
+
if ( ! $attachment_id ) {
|
223 |
+
return;
|
224 |
+
}
|
225 |
+
|
226 |
+
$attachment = get_imagify_attachment( 'wp', $attachment_id, 'enable-media-replace-upload-done' );
|
227 |
+
|
228 |
// Stop if the attachment wasn't optimized yet by Imagify.
|
229 |
+
if ( ! $attachment->get_data() ) {
|
230 |
return;
|
231 |
}
|
232 |
|
233 |
+
$optimization_level = $attachment->get_optimization_level();
|
|
|
|
|
234 |
|
235 |
// Remove old optimization data.
|
236 |
$attachment->delete_imagify_data();
|
342 |
return Imagify_NGG_DB::get_instance();
|
343 |
}
|
344 |
|
345 |
+
/**
|
346 |
+
* Delete the Imagify data when an image is deleted.
|
347 |
+
*
|
348 |
+
* @since 1.5
|
349 |
+
* @since 1.6.13 Deprecated.
|
350 |
+
* @author Jonathan Buttigieg
|
351 |
+
*
|
352 |
+
* @param int $image_id An image ID.
|
353 |
+
*/
|
354 |
+
function _imagify_ngg_delete_picture( $image_id ) {
|
355 |
+
_deprecated_function( __FUNCTION__ . '()', '1.6.13', 'Imagify_NGG_DB::get_instance()->delete( $image_id )' );
|
356 |
+
|
357 |
+
Imagify_NGG_DB::get_instance()->delete( $image_id );
|
358 |
+
}
|
359 |
+
|
360 |
+
/**
|
361 |
+
* Combine two arrays with some specific keys.
|
362 |
+
* We use this function to combine the result of 2 SQL queries.
|
363 |
+
*
|
364 |
+
* @since 1.4.5
|
365 |
+
* @since 1.6.7 Added the $keep_keys_order parameter.
|
366 |
+
* @since 1.6.13 Deprecated.
|
367 |
+
*
|
368 |
+
* @param array $keys An array of keys.
|
369 |
+
* @param array $values An array of arrays like array( 'id' => id, 'value' => value ).
|
370 |
+
* @param int $keep_keys_order Set to true to return an array ordered like $keys instead of $values.
|
371 |
+
* @return array The combined arrays.
|
372 |
+
*/
|
373 |
+
function imagify_query_results_combine( $keys, $values, $keep_keys_order = false ) {
|
374 |
+
_deprecated_function( __FUNCTION__ . '()', '1.6.13', 'Imagify_DB::combine_query_results( $keys, $values, $keep_keys_order )' );
|
375 |
+
|
376 |
+
return Imagify_DB::combine_query_results( $keys, $values, $keep_keys_order );
|
377 |
+
}
|
378 |
+
|
379 |
+
/**
|
380 |
+
* A helper to retrieve all values from one or several post metas, given a list of post IDs.
|
381 |
+
* The $wpdb cache is flushed to save memory.
|
382 |
+
*
|
383 |
+
* @since 1.6.7
|
384 |
+
* @since 1.6.13 Deprecated.
|
385 |
+
* @author Grégory Viguier
|
386 |
+
*
|
387 |
+
* @param array $metas An array of meta names like:
|
388 |
+
* array(
|
389 |
+
* 'key1' => 'meta_name_1',
|
390 |
+
* 'key2' => 'meta_name_2',
|
391 |
+
* 'key3' => 'meta_name_3',
|
392 |
+
* )
|
393 |
+
* If a key contains 'data', the results will be unserialized.
|
394 |
+
* @param array $ids An array of post IDs.
|
395 |
+
* @return array An array of arrays of results like:
|
396 |
+
* array(
|
397 |
+
* 'key1' => array( post_id_1 => 'result_1', post_id_2 => 'result_2', post_id_3 => 'result_3' ),
|
398 |
+
* 'key2' => array( post_id_1 => 'result_4', post_id_3 => 'result_5' ),
|
399 |
+
* 'key3' => array( post_id_1 => 'result_6', post_id_2 => 'result_7' ),
|
400 |
+
* )
|
401 |
+
*/
|
402 |
+
function imagify_get_wpdb_metas( $metas, $ids ) {
|
403 |
+
_deprecated_function( __FUNCTION__ . '()', '1.6.13', 'Imagify_DB::get_metas( $metas, $ids )' );
|
404 |
+
|
405 |
+
return Imagify_DB::get_metas( $metas, $ids );
|
406 |
+
}
|
407 |
+
|
408 |
endif;
|
409 |
|
410 |
if ( is_admin() ) :
|
inc/functions/formatting.php
CHANGED
@@ -66,3 +66,19 @@ function get_imagify_attachment_class_name( $context, $attachment_id, $identifie
|
|
66 |
|
67 |
return 'Imagify_' . ( 'wp' !== $context ? $context . '_' : '' ) . 'Attachment';
|
68 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
return 'Imagify_' . ( 'wp' !== $context ? $context . '_' : '' ) . 'Attachment';
|
68 |
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Get the Imagify attachment instance depending to a context.
|
72 |
+
*
|
73 |
+
* @since 1.6.13
|
74 |
+
* @author Grégory Viguier
|
75 |
+
*
|
76 |
+
* @param string $context The context to determine the class name.
|
77 |
+
* @param int $attachment_id The attachment ID.
|
78 |
+
* @param string $identifier An identifier.
|
79 |
+
* @return object The Imagify attachment instance.
|
80 |
+
*/
|
81 |
+
function get_imagify_attachment( $context, $attachment_id, $identifier ) {
|
82 |
+
$class_name = get_imagify_attachment_class_name( $context, $attachment_id, $identifier );
|
83 |
+
return new $class_name( $attachment_id );
|
84 |
+
}
|
inc/functions/process.php
CHANGED
@@ -16,12 +16,13 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
|
16 |
function do_imagify( $file_path, $args = array() ) {
|
17 |
$errors = new WP_Error();
|
18 |
$args = array_merge( array(
|
19 |
-
'backup' => get_imagify_option( 'backup'
|
20 |
'optimization_level' => get_imagify_option( 'optimization_level', 1 ),
|
21 |
-
'keep_exif' => get_imagify_option( 'exif'
|
22 |
'context' => 'wp',
|
23 |
'resized' => false,
|
24 |
'original_size' => 0,
|
|
|
25 |
), $args );
|
26 |
|
27 |
/**
|
@@ -72,8 +73,8 @@ function do_imagify( $file_path, $args = array() ) {
|
|
72 |
|
73 |
// Check that file exists.
|
74 |
if ( 0 === $file_size ) {
|
75 |
-
/* translators: %s is a file
|
76 |
-
$errors->add( 'image_not_found', sprintf( __( 'Skipped (%s), image not found.', 'imagify' ),
|
77 |
return $errors;
|
78 |
}
|
79 |
|
@@ -106,9 +107,9 @@ function do_imagify( $file_path, $args = array() ) {
|
|
106 |
}
|
107 |
|
108 |
// Create a backup file.
|
109 |
-
if (
|
110 |
// TODO (@Greg): Send an error message if the backup fails.
|
111 |
-
imagify_backup_file( $file_path );
|
112 |
}
|
113 |
|
114 |
if ( ! function_exists( 'download_url' ) ) {
|
@@ -151,19 +152,11 @@ function do_imagify( $file_path, $args = array() ) {
|
|
151 |
* @since 1.4
|
152 |
*/
|
153 |
function imagify_do_async_job( $body ) {
|
154 |
-
// No need to send all the cookies.
|
155 |
-
$cookies = isset( $_COOKIE ) && is_array( $_COOKIE ) ? $_COOKIE : array();
|
156 |
-
$cookies = array_intersect_key( $_COOKIE, array(
|
157 |
-
SECURE_AUTH_COOKIE => '',
|
158 |
-
AUTH_COOKIE => '',
|
159 |
-
LOGGED_IN_COOKIE => '',
|
160 |
-
) );
|
161 |
-
|
162 |
$args = array(
|
163 |
'timeout' => 0.01,
|
164 |
'blocking' => false,
|
165 |
'body' => $body,
|
166 |
-
'cookies' => $
|
167 |
'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
|
168 |
);
|
169 |
|
@@ -224,6 +217,11 @@ function imagify_backup_file( $file_path, $backup_path = null ) {
|
|
224 |
|
225 |
$filesystem = imagify_get_filesystem();
|
226 |
|
|
|
|
|
|
|
|
|
|
|
227 |
// Make sure the source file exists.
|
228 |
if ( ! $filesystem->exists( $file_path ) ) {
|
229 |
return new WP_Error( 'source_doesnt_exist', __( 'The file to backup does not exist.', 'imagify' ), array(
|
@@ -238,16 +236,11 @@ function imagify_backup_file( $file_path, $backup_path = null ) {
|
|
238 |
}
|
239 |
|
240 |
$backup_path = get_imagify_attachment_backup_path( $file_path );
|
241 |
-
|
242 |
-
// Make sure the uploads directory has no errors.
|
243 |
-
if ( ! $backup_path ) {
|
244 |
-
return new WP_Error( 'wp_upload_error', __( 'Error while retrieving the uploads directory path.', 'imagify' ) );
|
245 |
-
}
|
246 |
}
|
247 |
|
248 |
-
// Make sure the
|
249 |
-
if ( !
|
250 |
-
return new WP_Error( '
|
251 |
}
|
252 |
|
253 |
// Create sub-directories.
|
16 |
function do_imagify( $file_path, $args = array() ) {
|
17 |
$errors = new WP_Error();
|
18 |
$args = array_merge( array(
|
19 |
+
'backup' => get_imagify_option( 'backup' ),
|
20 |
'optimization_level' => get_imagify_option( 'optimization_level', 1 ),
|
21 |
+
'keep_exif' => get_imagify_option( 'exif' ),
|
22 |
'context' => 'wp',
|
23 |
'resized' => false,
|
24 |
'original_size' => 0,
|
25 |
+
'backup_path' => null,
|
26 |
), $args );
|
27 |
|
28 |
/**
|
73 |
|
74 |
// Check that file exists.
|
75 |
if ( 0 === $file_size ) {
|
76 |
+
/* translators: %s is a file path. */
|
77 |
+
$errors->add( 'image_not_found', sprintf( __( 'Skipped (%s), image not found.', 'imagify' ), '<code>' . imagify_make_file_path_relative( $file_path ) . '</code>' ) );
|
78 |
return $errors;
|
79 |
}
|
80 |
|
107 |
}
|
108 |
|
109 |
// Create a backup file.
|
110 |
+
if ( $args['backup'] && ! $args['resized'] ) {
|
111 |
// TODO (@Greg): Send an error message if the backup fails.
|
112 |
+
imagify_backup_file( $file_path, $args['backup_path'] );
|
113 |
}
|
114 |
|
115 |
if ( ! function_exists( 'download_url' ) ) {
|
152 |
* @since 1.4
|
153 |
*/
|
154 |
function imagify_do_async_job( $body ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
$args = array(
|
156 |
'timeout' => 0.01,
|
157 |
'blocking' => false,
|
158 |
'body' => $body,
|
159 |
+
'cookies' => isset( $_COOKIE ) && is_array( $_COOKIE ) ? $_COOKIE : array(),
|
160 |
'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
|
161 |
);
|
162 |
|
217 |
|
218 |
$filesystem = imagify_get_filesystem();
|
219 |
|
220 |
+
// Make sure the filesystem has no errors.
|
221 |
+
if ( ! empty( $filesystem->errors->errors ) ) {
|
222 |
+
return new WP_Error( 'filesystem_error', __( 'Filesystem error.', 'imagify' ), $filesystem->errors );
|
223 |
+
}
|
224 |
+
|
225 |
// Make sure the source file exists.
|
226 |
if ( ! $filesystem->exists( $file_path ) ) {
|
227 |
return new WP_Error( 'source_doesnt_exist', __( 'The file to backup does not exist.', 'imagify' ), array(
|
236 |
}
|
237 |
|
238 |
$backup_path = get_imagify_attachment_backup_path( $file_path );
|
|
|
|
|
|
|
|
|
|
|
239 |
}
|
240 |
|
241 |
+
// Make sure the uploads directory has no errors.
|
242 |
+
if ( ! $backup_path ) {
|
243 |
+
return new WP_Error( 'wp_upload_error', __( 'Error while retrieving the uploads directory path.', 'imagify' ) );
|
244 |
}
|
245 |
|
246 |
// Create sub-directories.
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
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.8.
|
6 |
-
Stable tag: 1.6.
|
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 |
|
@@ -136,21 +136,32 @@ When the plugin is disabled, your existing images remain optimized. Backups of t
|
|
136 |
3. Media Page
|
137 |
|
138 |
== Changelog ==
|
139 |
-
= 1.6.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
* New: added links to the documentation in the plugin's admin bar item and the plugin's row (plugins page). There is more to come.
|
141 |
* Improvement: image attachments that don't have some mandatory WordPress metadata are not included in Imagify stats anymore.
|
142 |
* Fix: the "Optimized size" progress bar in the bulk optimization page now behaves like the "Original size" one does.
|
143 |
* Dev stuff: auto-optimization can be disabled on an attachment basis with the new filter `imagify_auto_optimize_attachment`. For example it can be used to disable auto-optimization for a specific file extension.
|
144 |
* Dev stuff: classes are now auto-loaded. Some constants have been removed.
|
145 |
|
146 |
-
= 1.6.11 =
|
147 |
* Improvement: Imagify now works with the iOS app, and with XML-RPC in general.
|
148 |
* Improvement: we harmonized and improved how user roles are handled.
|
149 |
* Improvement: prevent optimized image to be cached by the browser in the comparison tool.
|
150 |
* Fix: sometimes the comparison tool's button wouldn't show on the attachment edition page.
|
151 |
* Fix: the bulk optimization button works again.
|
152 |
|
153 |
-
= 1.6.10 =
|
154 |
* New: if new thumbnail sizes appear after activating a new theme or plugin, you can now optimize only these missing sizes instead of restoring and re-optimizing all images.
|
155 |
* Improvement: CSS and JS files have been split and are loaded only when needed.
|
156 |
* Improvement: in each NextGen Galleries you now have "Optimize" and "Restore" bulk actions.
|
@@ -162,10 +173,10 @@ When the plugin is disabled, your existing images remain optimized. Backups of t
|
|
162 |
* Regression fix: the issue with Imagify's popup on WP Rocket options screen is now also solved when WP Rocket is white-labelled.
|
163 |
* Lots of various small fixes and code improvements.
|
164 |
|
165 |
-
= 1.6.9.1 =
|
166 |
* Regression fix: don't load Imagify's popup files on WP Rocket options screen to avoid conflicts.
|
167 |
|
168 |
-
= 1.6.9 =
|
169 |
* Improvement: the bulk optimization now stops as soon as the quota is fully consumed, instead of trying to optimize more images and getting error messages one after the other.
|
170 |
* Improvement: updated (almost) all JavaScript libraries we use. SweetAlert won't conflict with new versions anymore. Few code improvements.
|
171 |
* Improvement: in the medias list, improved the Imagify column behavior on small screens.
|
@@ -175,7 +186,7 @@ When the plugin is disabled, your existing images remain optimized. Backups of t
|
|
175 |
* Regression fix: fixed optimization and restoration not working in NextGen Gallery.
|
176 |
* Regression fix: fixed the bulk optimization not working with PHP 5.2.
|
177 |
|
178 |
-
= 1.6.8 =
|
179 |
* Improvement: don't display the restore bulk action in the medias list if there is nothing to restore.
|
180 |
* Improvement: you can know select and unselect all image sizes at once in the settings page.
|
181 |
* Improvement: detect when the backup directory is not writable. A warning is displayed dynamically under the backup setting, a notice is also displayed on some pages.
|
@@ -183,10 +194,10 @@ When the plugin is disabled, your existing images remain optimized. Backups of t
|
|
183 |
* Bug Fix: the "Save & Go to Bulk Optimizer" button now redirects you even if no settings have been changed.
|
184 |
* Lots of various small fixes and code improvements.
|
185 |
|
186 |
-
= 1.6.7.1 =
|
187 |
* Bug Fix: Fixed the "Unknown error" during a bulk optimization.
|
188 |
|
189 |
-
= 1.6.7 =
|
190 |
* Improvement: Compatibility with the plugin WP Offload S3 Pro, and fixed a few things for both Lite and Pro versions.
|
191 |
* Improvement: Improved performance on the bulk optimization page for huge image libraries.
|
192 |
* Improvement: When performing a bulk optimization, moved the attachments with the "WELL DONE" message at the end of the queue, it helps to speed up things.
|
@@ -195,50 +206,50 @@ When the plugin is disabled, your existing images remain optimized. Backups of t
|
|
195 |
* Regression fix: Fixed the buffer size on the bulk optimization page.
|
196 |
* Dev stuff: Added a hook allowing to filter arguments when doing a request to our API. It can be used to increase the timeout value for example.
|
197 |
|
198 |
-
= 1.6.6 =
|
199 |
* New: Compatibility with the plugin WP Offload S3 Lite. Your images now will be sent to Amazon S3 after being optimized. Also works when you store your images only on S3, not locally.
|
200 |
* Improvement: Added a filter to the asynchronous job arguments.
|
201 |
* Bug fix: Compatibility with Internet Explorer 9 to 11.
|
202 |
* Regression fix: The comparison tool stopped working in the medias list since the previous version.
|
203 |
|
204 |
-
= 1.6.5 =
|
205 |
* Improvement: Code quality of the whole plugin has been improved to fit more WordPress coding standards.
|
206 |
* Improvement: Lots of internationalization improvements. Now the plugin's internationalization fully rely on the repository system.
|
207 |
* Bug Fix: Fixed an error with php 7.1: `Uncaught Error: [] operator not supported for strings in /wp-content/plugins/imagify/inc/functions/admin.php:134`.
|
208 |
|
209 |
-
= 1.6.4 =
|
210 |
* Improvement: Provide a link to optimize in higher level when an image is already optimized.
|
211 |
* Improvement: Add a dedicated message for 413 HTTP error when the image is too big to be uploaded on our servers.
|
212 |
|
213 |
-
= 1.6.3 =
|
214 |
* Improvement: The discount is now automatically applied in when you buy from the plugin and a promotion is active
|
215 |
|
216 |
-
= 1.6.2 =
|
217 |
* Bug Fix: Correctly display the modal when clicking on the plan suggestion button on bulk optimization page
|
218 |
|
219 |
-
= 1.6.1 =
|
220 |
* Bug Fix: Better offer suggestion when your medias library is bigger than 3GB
|
221 |
|
222 |
-
= 1.6 =
|
223 |
* New: Knowing how many MB/GB you need to optimize your existing and future images is complicated. We love to make things easier, so Imagify will do it and advise you the best plan.
|
224 |
* New: You can now buy all the plans without leaving your WordPress administration
|
225 |
* Improvement: Some styles fixed in the interface
|
226 |
|
227 |
-
= 1.5.10 =
|
228 |
* Improvement: Set to 1 the Bulk buffer size when there are more than 10 thumbnails to avoid "Unknown error" on the Bulk Optimization
|
229 |
|
230 |
-
= 1.5.9 =
|
231 |
* Bug Fix: Don't delete the thumbnail when the maximum file size is set to one of the thumbnail size
|
232 |
* Bug Fix: Don't strip the image meta data if possible (only with Imagick)
|
233 |
* Bug Fix: Fix persistent "WELL DONE" message because of "original_size" meta value was 0
|
234 |
|
235 |
-
= 1.5.8 =
|
236 |
* Regression fix: Check if the backup option is active before doing a backup when an image is resized
|
237 |
|
238 |
-
= 1.5.7 =
|
239 |
* Improvement: Resize images bigger than the maximum width defined in the settings using WP Image Editor instead of Imagify API
|
240 |
|
241 |
-
= 1.5.6 =
|
242 |
* Improvement: Dynamically update from the API the maximum image size allowed in bulk optimization
|
243 |
* Improvement: Updated SweetAlert to SweetAlert2
|
244 |
|
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.8.3
|
6 |
+
Stable tag: 1.6.13
|
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 |
|
136 |
3. Media Page
|
137 |
|
138 |
== Changelog ==
|
139 |
+
= 1.6.13 - 2017/11/07 =
|
140 |
+
* New: added links to the documentation in Imagify' settings and bulk optimization pages.
|
141 |
+
* Improvement: better compatibility with NextGen Gallery plugin. Imagify no longer resizes NextGen images nor removes exif, to let NextGen Gallery do its job peacefully.
|
142 |
+
* Improvement: better compatibility with WP Real Media Library plugin, our modal wasn't working correctly.
|
143 |
+
* Improvement: better compatibility with plugins that use cookies, like Duo Two-Factor Authentication and Shield Security, to prevent being disconnected.
|
144 |
+
* Improvement: better compatibility with SireGround. A "security" measure was preventing Imagify to work correctly.
|
145 |
+
* Improvement: better compatibility with hosts that limit some SQL queries, it prevented our bulk optimization to work.
|
146 |
+
* Improvement: better compatibility with Heartbeat Control plugin, it prevented our bulk optimization to work.
|
147 |
+
* Improvement: better compatibility with Formidable Forms Pro plugin, the bulk optimizer was never satisfied.
|
148 |
+
* Bug Fix: fixed a few bugs when optimizing in NextGen Gallery.
|
149 |
+
|
150 |
+
= 1.6.12 - 2017/10/18 =
|
151 |
* New: added links to the documentation in the plugin's admin bar item and the plugin's row (plugins page). There is more to come.
|
152 |
* Improvement: image attachments that don't have some mandatory WordPress metadata are not included in Imagify stats anymore.
|
153 |
* Fix: the "Optimized size" progress bar in the bulk optimization page now behaves like the "Original size" one does.
|
154 |
* Dev stuff: auto-optimization can be disabled on an attachment basis with the new filter `imagify_auto_optimize_attachment`. For example it can be used to disable auto-optimization for a specific file extension.
|
155 |
* Dev stuff: classes are now auto-loaded. Some constants have been removed.
|
156 |
|
157 |
+
= 1.6.11 - 2017/10/12 =
|
158 |
* Improvement: Imagify now works with the iOS app, and with XML-RPC in general.
|
159 |
* Improvement: we harmonized and improved how user roles are handled.
|
160 |
* Improvement: prevent optimized image to be cached by the browser in the comparison tool.
|
161 |
* Fix: sometimes the comparison tool's button wouldn't show on the attachment edition page.
|
162 |
* Fix: the bulk optimization button works again.
|
163 |
|
164 |
+
= 1.6.10 - 2017/10/05 =
|
165 |
* New: if new thumbnail sizes appear after activating a new theme or plugin, you can now optimize only these missing sizes instead of restoring and re-optimizing all images.
|
166 |
* Improvement: CSS and JS files have been split and are loaded only when needed.
|
167 |
* Improvement: in each NextGen Galleries you now have "Optimize" and "Restore" bulk actions.
|
173 |
* Regression fix: the issue with Imagify's popup on WP Rocket options screen is now also solved when WP Rocket is white-labelled.
|
174 |
* Lots of various small fixes and code improvements.
|
175 |
|
176 |
+
= 1.6.9.1 - 2017/08/12 =
|
177 |
* Regression fix: don't load Imagify's popup files on WP Rocket options screen to avoid conflicts.
|
178 |
|
179 |
+
= 1.6.9 - 2017/08/11 =
|
180 |
* Improvement: the bulk optimization now stops as soon as the quota is fully consumed, instead of trying to optimize more images and getting error messages one after the other.
|
181 |
* Improvement: updated (almost) all JavaScript libraries we use. SweetAlert won't conflict with new versions anymore. Few code improvements.
|
182 |
* Improvement: in the medias list, improved the Imagify column behavior on small screens.
|
186 |
* Regression fix: fixed optimization and restoration not working in NextGen Gallery.
|
187 |
* Regression fix: fixed the bulk optimization not working with PHP 5.2.
|
188 |
|
189 |
+
= 1.6.8 - 2017/07/26 =
|
190 |
* Improvement: don't display the restore bulk action in the medias list if there is nothing to restore.
|
191 |
* Improvement: you can know select and unselect all image sizes at once in the settings page.
|
192 |
* Improvement: detect when the backup directory is not writable. A warning is displayed dynamically under the backup setting, a notice is also displayed on some pages.
|
194 |
* Bug Fix: the "Save & Go to Bulk Optimizer" button now redirects you even if no settings have been changed.
|
195 |
* Lots of various small fixes and code improvements.
|
196 |
|
197 |
+
= 1.6.7.1 - 2017/07/13 =
|
198 |
* Bug Fix: Fixed the "Unknown error" during a bulk optimization.
|
199 |
|
200 |
+
= 1.6.7 - 2017/07/12 =
|
201 |
* Improvement: Compatibility with the plugin WP Offload S3 Pro, and fixed a few things for both Lite and Pro versions.
|
202 |
* Improvement: Improved performance on the bulk optimization page for huge image libraries.
|
203 |
* Improvement: When performing a bulk optimization, moved the attachments with the "WELL DONE" message at the end of the queue, it helps to speed up things.
|
206 |
* Regression fix: Fixed the buffer size on the bulk optimization page.
|
207 |
* Dev stuff: Added a hook allowing to filter arguments when doing a request to our API. It can be used to increase the timeout value for example.
|
208 |
|
209 |
+
= 1.6.6 - 2017/06/27 =
|
210 |
* New: Compatibility with the plugin WP Offload S3 Lite. Your images now will be sent to Amazon S3 after being optimized. Also works when you store your images only on S3, not locally.
|
211 |
* Improvement: Added a filter to the asynchronous job arguments.
|
212 |
* Bug fix: Compatibility with Internet Explorer 9 to 11.
|
213 |
* Regression fix: The comparison tool stopped working in the medias list since the previous version.
|
214 |
|
215 |
+
= 1.6.5 - 2017/06/22 =
|
216 |
* Improvement: Code quality of the whole plugin has been improved to fit more WordPress coding standards.
|
217 |
* Improvement: Lots of internationalization improvements. Now the plugin's internationalization fully rely on the repository system.
|
218 |
* Bug Fix: Fixed an error with php 7.1: `Uncaught Error: [] operator not supported for strings in /wp-content/plugins/imagify/inc/functions/admin.php:134`.
|
219 |
|
220 |
+
= 1.6.4 - 2017/04/06 =
|
221 |
* Improvement: Provide a link to optimize in higher level when an image is already optimized.
|
222 |
* Improvement: Add a dedicated message for 413 HTTP error when the image is too big to be uploaded on our servers.
|
223 |
|
224 |
+
= 1.6.3 - 2016/12/16 =
|
225 |
* Improvement: The discount is now automatically applied in when you buy from the plugin and a promotion is active
|
226 |
|
227 |
+
= 1.6.2 - 2016/11/22 =
|
228 |
* Bug Fix: Correctly display the modal when clicking on the plan suggestion button on bulk optimization page
|
229 |
|
230 |
+
= 1.6.1 - 2016/11/22 =
|
231 |
* Bug Fix: Better offer suggestion when your medias library is bigger than 3GB
|
232 |
|
233 |
+
= 1.6 - 2016/11/21 =
|
234 |
* New: Knowing how many MB/GB you need to optimize your existing and future images is complicated. We love to make things easier, so Imagify will do it and advise you the best plan.
|
235 |
* New: You can now buy all the plans without leaving your WordPress administration
|
236 |
* Improvement: Some styles fixed in the interface
|
237 |
|
238 |
+
= 1.5.10 - 2016/10/05 =
|
239 |
* Improvement: Set to 1 the Bulk buffer size when there are more than 10 thumbnails to avoid "Unknown error" on the Bulk Optimization
|
240 |
|
241 |
+
= 1.5.9 - 2016/09/27 =
|
242 |
* Bug Fix: Don't delete the thumbnail when the maximum file size is set to one of the thumbnail size
|
243 |
* Bug Fix: Don't strip the image meta data if possible (only with Imagick)
|
244 |
* Bug Fix: Fix persistent "WELL DONE" message because of "original_size" meta value was 0
|
245 |
|
246 |
+
= 1.5.8 - 2016/08/24 =
|
247 |
* Regression fix: Check if the backup option is active before doing a backup when an image is resized
|
248 |
|
249 |
+
= 1.5.7 - 2016/08/23 =
|
250 |
* Improvement: Resize images bigger than the maximum width defined in the settings using WP Image Editor instead of Imagify API
|
251 |
|
252 |
+
= 1.5.6 - 2016/07/29 =
|
253 |
* Improvement: Dynamically update from the API the maximum image size allowed in bulk optimization
|
254 |
* Improvement: Updated SweetAlert to SweetAlert2
|
255 |
|