Version Description
- UI changes
Download this release
Release Info
Developer | UmeshSingla |
Plugin | Smush Image Compression and Optimization |
Version | 2.0.1 |
Comparing to | |
See all releases |
Code changes from version 2.0 to 2.0.1
- assets/css/wp-smushit-admin.css +290 -201
- lib/class-wp-smush-admin.php +123 -74
- readme.txt +14 -5
- wp-smush.php +4 -3
assets/css/wp-smushit-admin.css
CHANGED
@@ -1,229 +1,247 @@
|
|
1 |
/*
|
2 |
Smush button transformation
|
3 |
*/
|
4 |
-
.button.wp-smushit-started{
|
5 |
-
|
6 |
}
|
7 |
-
|
8 |
-
|
|
|
9 |
}
|
10 |
|
11 |
-
.button.wp-smush-finished.disabled
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
}
|
|
|
18 |
/*
|
19 |
Loader
|
20 |
*/
|
21 |
-
.wp-smushit-loader-wrap{
|
22 |
-
|
23 |
-
}
|
24 |
-
.floatingCirclesG{
|
25 |
-
position:relative;
|
26 |
-
width:28px;
|
27 |
-
height:28px;
|
28 |
-
-moz-transform:scale(0.6);
|
29 |
-
-webkit-transform:scale(0.6);
|
30 |
-
-ms-transform:scale(0.6);
|
31 |
-
-o-transform:scale(0.6);
|
32 |
-
transform:scale(0.6);
|
33 |
-
}
|
34 |
-
|
35 |
-
.f_circleG{
|
36 |
-
position:absolute;
|
37 |
-
background-color:#FFFFFF;
|
38 |
-
height:5px;
|
39 |
-
width:5px;
|
40 |
-
-moz-border-radius:3px;
|
41 |
-
-moz-animation-name:f_fadeG;
|
42 |
-
-moz-animation-duration:0.8s;
|
43 |
-
-moz-animation-iteration-count:infinite;
|
44 |
-
-moz-animation-direction:linear;
|
45 |
-
-webkit-border-radius:3px;
|
46 |
-
-webkit-animation-name:f_fadeG;
|
47 |
-
-webkit-animation-duration:0.8s;
|
48 |
-
-webkit-animation-iteration-count:infinite;
|
49 |
-
-webkit-animation-direction:linear;
|
50 |
-
-ms-border-radius:3px;
|
51 |
-
-ms-animation-name:f_fadeG;
|
52 |
-
-ms-animation-duration:0.8s;
|
53 |
-
-ms-animation-iteration-count:infinite;
|
54 |
-
-ms-animation-direction:linear;
|
55 |
-
-o-border-radius:3px;
|
56 |
-
-o-animation-name:f_fadeG;
|
57 |
-
-o-animation-duration:0.8s;
|
58 |
-
-o-animation-iteration-count:infinite;
|
59 |
-
-o-animation-direction:linear;
|
60 |
-
border-radius:3px;
|
61 |
-
animation-name:f_fadeG;
|
62 |
-
animation-duration:0.8s;
|
63 |
-
animation-iteration-count:infinite;
|
64 |
-
animation-direction:linear;
|
65 |
-
}
|
66 |
-
|
67 |
-
#frotateG_01{
|
68 |
-
left:0;
|
69 |
-
top:11px;
|
70 |
-
-moz-animation-delay:0.3s;
|
71 |
-
-webkit-animation-delay:0.3s;
|
72 |
-
-ms-animation-delay:0.3s;
|
73 |
-
-o-animation-delay:0.3s;
|
74 |
-
animation-delay:0.3s;
|
75 |
-
}
|
76 |
-
|
77 |
-
#frotateG_02{
|
78 |
-
left:3px;
|
79 |
-
top:3px;
|
80 |
-
-moz-animation-delay:0.4s;
|
81 |
-
-webkit-animation-delay:0.4s;
|
82 |
-
-ms-animation-delay:0.4s;
|
83 |
-
-o-animation-delay:0.4s;
|
84 |
-
animation-delay:0.4s;
|
85 |
-
}
|
86 |
-
|
87 |
-
#frotateG_03{
|
88 |
-
left:11px;
|
89 |
-
top:0;
|
90 |
-
-moz-animation-delay:0.5s;
|
91 |
-
-webkit-animation-delay:0.5s;
|
92 |
-
-ms-animation-delay:0.5s;
|
93 |
-
-o-animation-delay:0.5s;
|
94 |
-
animation-delay:0.5s;
|
95 |
-
}
|
96 |
-
|
97 |
-
#frotateG_04{
|
98 |
-
right:3px;
|
99 |
-
top:3px;
|
100 |
-
-moz-animation-delay:0.6s;
|
101 |
-
-webkit-animation-delay:0.6s;
|
102 |
-
-ms-animation-delay:0.6s;
|
103 |
-
-o-animation-delay:0.6s;
|
104 |
-
animation-delay:0.6s;
|
105 |
-
}
|
106 |
-
|
107 |
-
#frotateG_05{
|
108 |
-
right:0;
|
109 |
-
top:11px;
|
110 |
-
-moz-animation-delay:0.7s;
|
111 |
-
-webkit-animation-delay:0.7s;
|
112 |
-
-ms-animation-delay:0.7s;
|
113 |
-
-o-animation-delay:0.7s;
|
114 |
-
animation-delay:0.7s;
|
115 |
-
}
|
116 |
-
|
117 |
-
#frotateG_06{
|
118 |
-
right:3px;
|
119 |
-
bottom:3px;
|
120 |
-
-moz-animation-delay:0.8s;
|
121 |
-
-webkit-animation-delay:0.8s;
|
122 |
-
-ms-animation-delay:0.8s;
|
123 |
-
-o-animation-delay:0.8s;
|
124 |
-
animation-delay:0.8s;
|
125 |
-
}
|
126 |
-
|
127 |
-
#frotateG_07{
|
128 |
-
left:11px;
|
129 |
-
bottom:0;
|
130 |
-
-moz-animation-delay:0.9s;
|
131 |
-
-webkit-animation-delay:0.9s;
|
132 |
-
-ms-animation-delay:0.9s;
|
133 |
-
-o-animation-delay:0.9s;
|
134 |
-
animation-delay:0.9s;
|
135 |
-
}
|
136 |
-
|
137 |
-
#frotateG_08{
|
138 |
-
left:3px;
|
139 |
-
bottom:3px;
|
140 |
-
-moz-animation-delay:1s;
|
141 |
-
-webkit-animation-delay:1s;
|
142 |
-
-ms-animation-delay:1s;
|
143 |
-
-o-animation-delay:1s;
|
144 |
-
animation-delay:1s;
|
145 |
}
|
146 |
|
147 |
-
|
148 |
-
|
149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
|
151 |
-
|
152 |
-
|
|
|
153 |
|
154 |
}
|
155 |
|
156 |
-
@-webkit-keyframes f_fadeG{
|
157 |
-
|
158 |
-
|
|
|
159 |
|
160 |
-
|
161 |
-
|
|
|
162 |
|
163 |
}
|
164 |
|
165 |
-
@-ms-keyframes f_fadeG{
|
166 |
-
|
167 |
-
|
|
|
168 |
|
169 |
-
|
170 |
-
|
|
|
171 |
|
172 |
}
|
173 |
|
174 |
-
@-o-keyframes f_fadeG{
|
175 |
-
|
176 |
-
|
|
|
177 |
|
178 |
-
|
179 |
-
|
|
|
180 |
|
181 |
}
|
182 |
|
183 |
-
@keyframes f_fadeG{
|
184 |
-
|
185 |
-
|
|
|
186 |
|
187 |
-
|
188 |
-
|
|
|
189 |
|
190 |
}
|
191 |
|
192 |
/*
|
193 |
Progressbar ui
|
194 |
*/
|
195 |
-
#progress-ui{
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
}
|
200 |
|
201 |
-
#progress-ui #wp-smushit-progress-wrap{
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
overflow: hidden;
|
206 |
}
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
|
|
211 |
}
|
212 |
-
|
213 |
-
|
|
|
214 |
}
|
215 |
-
|
216 |
-
|
217 |
-
|
|
|
218 |
}
|
219 |
-
|
220 |
-
|
221 |
-
|
|
|
222 |
}
|
223 |
|
224 |
-
#progress-ui p#check-status{
|
225 |
-
|
226 |
}
|
|
|
227 |
/*
|
228 |
Progressbar ui
|
229 |
*/
|
@@ -296,7 +314,7 @@ p#wp-smush-compression span {
|
|
296 |
font-weight: bold;
|
297 |
}
|
298 |
|
299 |
-
.media-lib-wp-smush-el{
|
300 |
position: absolute;
|
301 |
display: block;
|
302 |
width: 90%;
|
@@ -305,86 +323,106 @@ p#wp-smush-compression span {
|
|
305 |
top: 5%;
|
306 |
background: transparent;
|
307 |
}
|
308 |
-
|
|
|
309 |
background: rgba(255, 255, 255, 0.5);
|
310 |
}
|
311 |
-
|
|
|
312 |
display: block;
|
313 |
}
|
314 |
-
|
|
|
315 |
margin-bottom: 5% !important;
|
316 |
}
|
317 |
-
|
|
|
318 |
display: block;
|
319 |
}
|
320 |
-
|
|
|
321 |
margin: 10px;
|
322 |
float: left;
|
323 |
}
|
|
|
324 |
#wp-smush-send span.wp-smushing {
|
325 |
display: inline-block;
|
326 |
vertical-align: top;
|
327 |
}
|
|
|
328 |
#wp-smush-send .wp-smush-loader-wrap {
|
329 |
display: inline-block;
|
330 |
}
|
|
|
331 |
button .wp-smush-loader-wrap {
|
332 |
display: inline-block;
|
333 |
float: left;
|
334 |
}
|
|
|
335 |
/** Settings Page **/
|
336 |
-
|
337 |
display: block;
|
338 |
overflow: auto;
|
339 |
margin: 0;
|
340 |
}
|
341 |
|
342 |
-
|
343 |
display: inline-block;
|
344 |
-
list-style: none;
|
345 |
float: left;
|
346 |
margin: 5px 20px 5px 0;
|
347 |
padding: 5px 5px 5px 0;
|
348 |
}
|
349 |
|
|
|
|
|
|
|
|
|
350 |
input#wp-smush-save-settings {
|
351 |
margin: 15px 0;
|
352 |
}
|
353 |
-
|
|
|
354 |
position: absolute;
|
355 |
left: -10%;
|
356 |
bottom: -3%;
|
357 |
display: none;
|
358 |
}
|
359 |
-
|
|
|
360 |
display: block;
|
361 |
cursor: auto;
|
362 |
}
|
363 |
|
364 |
-
.active:hover .media-lib-wp-smush-icon{
|
365 |
display: block;
|
366 |
}
|
367 |
-
|
|
|
368 |
color: #0074a2;
|
369 |
}
|
370 |
|
371 |
-
.active .media-lib-wp-smush-icon{
|
372 |
cursor: pointer;
|
373 |
}
|
374 |
-
|
|
|
375 |
display: block;
|
376 |
color: #0074a2;
|
377 |
}
|
378 |
-
|
|
|
379 |
font-size: 30px;
|
380 |
}
|
381 |
-
|
|
|
382 |
left: -7%;
|
383 |
bottom: -7%;
|
384 |
}
|
385 |
-
|
|
|
386 |
content: "";
|
387 |
}
|
|
|
388 |
/** Grid view button **/
|
389 |
.smush-wrap {
|
390 |
margin-left: 14%;
|
@@ -415,6 +453,57 @@ input#wp-smush-save-settings {
|
|
415 |
.smush-status.success {
|
416 |
color: #0074a2;
|
417 |
}
|
418 |
-
|
419 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
}
|
1 |
/*
|
2 |
Smush button transformation
|
3 |
*/
|
4 |
+
.button.wp-smushit-started {
|
5 |
+
padding: 0 10px 1px 0;
|
6 |
}
|
7 |
+
|
8 |
+
.button.wp-smushit-started .floatingCirclesG {
|
9 |
+
float: left;
|
10 |
}
|
11 |
|
12 |
+
.button.wp-smush-finished.disabled, .button.wp-smush-finished:disabled, .button.wp-smush-finished[disabled] {
|
13 |
+
color: #fff !important;
|
14 |
+
background: #00cf21 !important;
|
15 |
+
border-color: #619f6b !important;
|
16 |
+
-webkit-box-shadow: inset 0 1px 0 rgba(0, 207, 33, .5), 0 1px 0 rgba(0, 0, 0, .15) !important;
|
17 |
+
box-shadow: inset 0 1px 0 rgba(0, 207, 33, .5), 0 1px 0 rgba(0, 0, 0, .15) !important;
|
18 |
}
|
19 |
+
|
20 |
/*
|
21 |
Loader
|
22 |
*/
|
23 |
+
.wp-smushit-loader-wrap {
|
24 |
+
display: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
|
27 |
+
.floatingCirclesG {
|
28 |
+
position: relative;
|
29 |
+
width: 28px;
|
30 |
+
height: 28px;
|
31 |
+
-moz-transform: scale(0.6);
|
32 |
+
-webkit-transform: scale(0.6);
|
33 |
+
-ms-transform: scale(0.6);
|
34 |
+
-o-transform: scale(0.6);
|
35 |
+
transform: scale(0.6);
|
36 |
+
}
|
37 |
+
|
38 |
+
.f_circleG {
|
39 |
+
position: absolute;
|
40 |
+
background-color: #FFFFFF;
|
41 |
+
height: 5px;
|
42 |
+
width: 5px;
|
43 |
+
-moz-border-radius: 3px;
|
44 |
+
-moz-animation-name: f_fadeG;
|
45 |
+
-moz-animation-duration: 0.8s;
|
46 |
+
-moz-animation-iteration-count: infinite;
|
47 |
+
-moz-animation-direction: linear;
|
48 |
+
-webkit-border-radius: 3px;
|
49 |
+
-webkit-animation-name: f_fadeG;
|
50 |
+
-webkit-animation-duration: 0.8s;
|
51 |
+
-webkit-animation-iteration-count: infinite;
|
52 |
+
-webkit-animation-direction: linear;
|
53 |
+
-ms-border-radius: 3px;
|
54 |
+
-ms-animation-name: f_fadeG;
|
55 |
+
-ms-animation-duration: 0.8s;
|
56 |
+
-ms-animation-iteration-count: infinite;
|
57 |
+
-ms-animation-direction: linear;
|
58 |
+
-o-border-radius: 3px;
|
59 |
+
-o-animation-name: f_fadeG;
|
60 |
+
-o-animation-duration: 0.8s;
|
61 |
+
-o-animation-iteration-count: infinite;
|
62 |
+
-o-animation-direction: linear;
|
63 |
+
border-radius: 3px;
|
64 |
+
animation-name: f_fadeG;
|
65 |
+
animation-duration: 0.8s;
|
66 |
+
animation-iteration-count: infinite;
|
67 |
+
animation-direction: linear;
|
68 |
+
}
|
69 |
+
|
70 |
+
#frotateG_01 {
|
71 |
+
left: 0;
|
72 |
+
top: 11px;
|
73 |
+
-moz-animation-delay: 0.3s;
|
74 |
+
-webkit-animation-delay: 0.3s;
|
75 |
+
-ms-animation-delay: 0.3s;
|
76 |
+
-o-animation-delay: 0.3s;
|
77 |
+
animation-delay: 0.3s;
|
78 |
+
}
|
79 |
+
|
80 |
+
#frotateG_02 {
|
81 |
+
left: 3px;
|
82 |
+
top: 3px;
|
83 |
+
-moz-animation-delay: 0.4s;
|
84 |
+
-webkit-animation-delay: 0.4s;
|
85 |
+
-ms-animation-delay: 0.4s;
|
86 |
+
-o-animation-delay: 0.4s;
|
87 |
+
animation-delay: 0.4s;
|
88 |
+
}
|
89 |
+
|
90 |
+
#frotateG_03 {
|
91 |
+
left: 11px;
|
92 |
+
top: 0;
|
93 |
+
-moz-animation-delay: 0.5s;
|
94 |
+
-webkit-animation-delay: 0.5s;
|
95 |
+
-ms-animation-delay: 0.5s;
|
96 |
+
-o-animation-delay: 0.5s;
|
97 |
+
animation-delay: 0.5s;
|
98 |
+
}
|
99 |
+
|
100 |
+
#frotateG_04 {
|
101 |
+
right: 3px;
|
102 |
+
top: 3px;
|
103 |
+
-moz-animation-delay: 0.6s;
|
104 |
+
-webkit-animation-delay: 0.6s;
|
105 |
+
-ms-animation-delay: 0.6s;
|
106 |
+
-o-animation-delay: 0.6s;
|
107 |
+
animation-delay: 0.6s;
|
108 |
+
}
|
109 |
+
|
110 |
+
#frotateG_05 {
|
111 |
+
right: 0;
|
112 |
+
top: 11px;
|
113 |
+
-moz-animation-delay: 0.7s;
|
114 |
+
-webkit-animation-delay: 0.7s;
|
115 |
+
-ms-animation-delay: 0.7s;
|
116 |
+
-o-animation-delay: 0.7s;
|
117 |
+
animation-delay: 0.7s;
|
118 |
+
}
|
119 |
+
|
120 |
+
#frotateG_06 {
|
121 |
+
right: 3px;
|
122 |
+
bottom: 3px;
|
123 |
+
-moz-animation-delay: 0.8s;
|
124 |
+
-webkit-animation-delay: 0.8s;
|
125 |
+
-ms-animation-delay: 0.8s;
|
126 |
+
-o-animation-delay: 0.8s;
|
127 |
+
animation-delay: 0.8s;
|
128 |
+
}
|
129 |
+
|
130 |
+
#frotateG_07 {
|
131 |
+
left: 11px;
|
132 |
+
bottom: 0;
|
133 |
+
-moz-animation-delay: 0.9s;
|
134 |
+
-webkit-animation-delay: 0.9s;
|
135 |
+
-ms-animation-delay: 0.9s;
|
136 |
+
-o-animation-delay: 0.9s;
|
137 |
+
animation-delay: 0.9s;
|
138 |
+
}
|
139 |
+
|
140 |
+
#frotateG_08 {
|
141 |
+
left: 3px;
|
142 |
+
bottom: 3px;
|
143 |
+
-moz-animation-delay: 1s;
|
144 |
+
-webkit-animation-delay: 1s;
|
145 |
+
-ms-animation-delay: 1s;
|
146 |
+
-o-animation-delay: 1s;
|
147 |
+
animation-delay: 1s;
|
148 |
+
}
|
149 |
+
|
150 |
+
@-moz-keyframes f_fadeG {
|
151 |
+
0% {
|
152 |
+
background-color: #000000
|
153 |
+
}
|
154 |
|
155 |
+
100% {
|
156 |
+
background-color: #FFFFFF
|
157 |
+
}
|
158 |
|
159 |
}
|
160 |
|
161 |
+
@-webkit-keyframes f_fadeG {
|
162 |
+
0% {
|
163 |
+
background-color: #000000
|
164 |
+
}
|
165 |
|
166 |
+
100% {
|
167 |
+
background-color: #FFFFFF
|
168 |
+
}
|
169 |
|
170 |
}
|
171 |
|
172 |
+
@-ms-keyframes f_fadeG {
|
173 |
+
0% {
|
174 |
+
background-color: #000000
|
175 |
+
}
|
176 |
|
177 |
+
100% {
|
178 |
+
background-color: #FFFFFF
|
179 |
+
}
|
180 |
|
181 |
}
|
182 |
|
183 |
+
@-o-keyframes f_fadeG {
|
184 |
+
0% {
|
185 |
+
background-color: #000000
|
186 |
+
}
|
187 |
|
188 |
+
100% {
|
189 |
+
background-color: #FFFFFF
|
190 |
+
}
|
191 |
|
192 |
}
|
193 |
|
194 |
+
@keyframes f_fadeG {
|
195 |
+
0% {
|
196 |
+
background-color: #000000
|
197 |
+
}
|
198 |
|
199 |
+
100% {
|
200 |
+
background-color: #FFFFFF
|
201 |
+
}
|
202 |
|
203 |
}
|
204 |
|
205 |
/*
|
206 |
Progressbar ui
|
207 |
*/
|
208 |
+
#progress-ui {
|
209 |
+
width: 80%;
|
210 |
+
margin-bottom: 20px;
|
211 |
+
display: none;
|
212 |
}
|
213 |
|
214 |
+
#progress-ui #wp-smushit-progress-wrap {
|
215 |
+
height: 16px;
|
216 |
+
border: 1px solid #0074a2;
|
217 |
+
border-radius: 7px;
|
218 |
overflow: hidden;
|
219 |
}
|
220 |
+
|
221 |
+
#progress-ui #wp-smushit-progress-wrap .wp-smushit-progressbar {
|
222 |
+
height: 16px;
|
223 |
+
float: left;
|
224 |
+
width: 100%;
|
225 |
}
|
226 |
+
|
227 |
+
#progress-ui #wp-smushit-progress-wrap .wp-smushit-progressbar div {
|
228 |
+
height: 16px;
|
229 |
}
|
230 |
+
|
231 |
+
#progress-ui #wp-smushit-progress-wrap #wp-smushit-smush-progress div {
|
232 |
+
border-radius: 5px 0 0 5px;
|
233 |
+
background-color: #2ea2cc;
|
234 |
}
|
235 |
+
|
236 |
+
#progress-ui #wp-smushit-progress-wrap #wp-smushit-check-progress div {
|
237 |
+
border-radius: 0 5px 5px 0;
|
238 |
+
background-color: #0074a2;
|
239 |
}
|
240 |
|
241 |
+
#progress-ui p#check-status {
|
242 |
+
display: none;
|
243 |
}
|
244 |
+
|
245 |
/*
|
246 |
Progressbar ui
|
247 |
*/
|
314 |
font-weight: bold;
|
315 |
}
|
316 |
|
317 |
+
.media-lib-wp-smush-el {
|
318 |
position: absolute;
|
319 |
display: block;
|
320 |
width: 90%;
|
323 |
top: 5%;
|
324 |
background: transparent;
|
325 |
}
|
326 |
+
|
327 |
+
.media-lib-wp-smush-el.is_smushed {
|
328 |
background: rgba(255, 255, 255, 0.5);
|
329 |
}
|
330 |
+
|
331 |
+
.media-lib-wp-smush-el .spinner {
|
332 |
display: block;
|
333 |
}
|
334 |
+
|
335 |
+
.media-lib-wp-smush-button {
|
336 |
margin-bottom: 5% !important;
|
337 |
}
|
338 |
+
|
339 |
+
.has-smush-button:hover .media-lib-wp-smush-el {
|
340 |
display: block;
|
341 |
}
|
342 |
+
|
343 |
+
.column-smushit .wp-smush-loader {
|
344 |
margin: 10px;
|
345 |
float: left;
|
346 |
}
|
347 |
+
|
348 |
#wp-smush-send span.wp-smushing {
|
349 |
display: inline-block;
|
350 |
vertical-align: top;
|
351 |
}
|
352 |
+
|
353 |
#wp-smush-send .wp-smush-loader-wrap {
|
354 |
display: inline-block;
|
355 |
}
|
356 |
+
|
357 |
button .wp-smush-loader-wrap {
|
358 |
display: inline-block;
|
359 |
float: left;
|
360 |
}
|
361 |
+
|
362 |
/** Settings Page **/
|
363 |
+
#wp-smush-options-wrap {
|
364 |
display: block;
|
365 |
overflow: auto;
|
366 |
margin: 0;
|
367 |
}
|
368 |
|
369 |
+
#wp-smush-options-wrap .wp-smush-setting-row {
|
370 |
display: inline-block;
|
|
|
371 |
float: left;
|
372 |
margin: 5px 20px 5px 0;
|
373 |
padding: 5px 5px 5px 0;
|
374 |
}
|
375 |
|
376 |
+
.wp-smush-pro-features {
|
377 |
+
display: inline-block;
|
378 |
+
}
|
379 |
+
|
380 |
input#wp-smush-save-settings {
|
381 |
margin: 15px 0;
|
382 |
}
|
383 |
+
|
384 |
+
.media-lib-wp-smush-icon {
|
385 |
position: absolute;
|
386 |
left: -10%;
|
387 |
bottom: -3%;
|
388 |
display: none;
|
389 |
}
|
390 |
+
|
391 |
+
.is_smushed .media-lib-wp-smush-icon {
|
392 |
display: block;
|
393 |
cursor: auto;
|
394 |
}
|
395 |
|
396 |
+
.active:hover .media-lib-wp-smush-icon {
|
397 |
display: block;
|
398 |
}
|
399 |
+
|
400 |
+
.active:hover .media-lib-wp-smush-icon:hover:before {
|
401 |
color: #0074a2;
|
402 |
}
|
403 |
|
404 |
+
.active .media-lib-wp-smush-icon {
|
405 |
cursor: pointer;
|
406 |
}
|
407 |
+
|
408 |
+
.media-lib-wp-smush-icon.active {
|
409 |
display: block;
|
410 |
color: #0074a2;
|
411 |
}
|
412 |
+
|
413 |
+
.media-lib-wp-smush-icon:before {
|
414 |
font-size: 30px;
|
415 |
}
|
416 |
+
|
417 |
+
.media-lib-wp-smush-icon.spinner {
|
418 |
left: -7%;
|
419 |
bottom: -7%;
|
420 |
}
|
421 |
+
|
422 |
+
.media-lib-wp-smush-icon.spinner:before {
|
423 |
content: "";
|
424 |
}
|
425 |
+
|
426 |
/** Grid view button **/
|
427 |
.smush-wrap {
|
428 |
margin-left: 14%;
|
453 |
.smush-status.success {
|
454 |
color: #0074a2;
|
455 |
}
|
456 |
+
|
457 |
+
.smush-status.error {
|
458 |
+
color: red;
|
459 |
+
}
|
460 |
+
|
461 |
+
/*===================================*\
|
462 |
+
=======================================
|
463 |
+
== ==
|
464 |
+
== UPGRADE NOTES ==
|
465 |
+
== ==
|
466 |
+
=======================================
|
467 |
+
\*===================================*/
|
468 |
+
.pro-only {
|
469 |
+
position: relative;
|
470 |
+
margin: 3px 0;
|
471 |
+
display: inline-block;
|
472 |
+
}
|
473 |
+
|
474 |
+
.pro-only .pro-note {
|
475 |
+
opacity: 0;
|
476 |
+
position: absolute;
|
477 |
+
top: -3px;
|
478 |
+
left: -3px;
|
479 |
+
right: -3px;
|
480 |
+
bottom: -3px;
|
481 |
+
text-align: center;
|
482 |
+
background: rgba(0, 0, 0, 0.6);
|
483 |
+
color: #FFF;
|
484 |
+
font-family: "Source Sans Pro", "Open Sans", sans-serif;
|
485 |
+
font-weight: 100;
|
486 |
+
font-size: 20px;
|
487 |
+
z-index: 9999;
|
488 |
+
transition: opacity .2s;
|
489 |
+
}
|
490 |
+
|
491 |
+
.pro-only .pro-note a {
|
492 |
+
color: #7ed321;
|
493 |
+
}
|
494 |
+
|
495 |
+
.pro-only:hover .pro-note {
|
496 |
+
opacity: 1;
|
497 |
+
}
|
498 |
+
|
499 |
+
.inactive {
|
500 |
+
position: relative;
|
501 |
+
}
|
502 |
+
|
503 |
+
.inactive .wp-smush-setting-row {
|
504 |
+
opacity: .35;
|
505 |
+
}
|
506 |
+
|
507 |
+
.inactive-anim {
|
508 |
+
transition: opacity .3s;
|
509 |
}
|
lib/class-wp-smush-admin.php
CHANGED
@@ -77,6 +77,9 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
77 |
// hook into admin footer to load a hidden html/css spinner
|
78 |
add_action( 'admin_footer-upload.php', array( $this, 'print_loader' ) );
|
79 |
|
|
|
|
|
|
|
80 |
$this->total_count = $this->total_count();
|
81 |
$this->smushed_count = $this->smushed_count();
|
82 |
$this->stats = $this->global_stats();
|
@@ -85,14 +88,14 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
85 |
|
86 |
}
|
87 |
|
88 |
-
function __get($prop){
|
89 |
|
90 |
-
if( method_exists("WpSmushitAdmin", $prop ) ){
|
91 |
return $this->$prop();
|
92 |
}
|
93 |
|
94 |
$method_name = "get_" . $prop;
|
95 |
-
if( method_exists("WpSmushitAdmin", $method_name
|
96 |
return $this->$method_name();
|
97 |
}
|
98 |
}
|
@@ -162,10 +165,10 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
162 |
$bulk = new WpSmushitBulk();
|
163 |
$handle = 'wp-smushit-admin-js';
|
164 |
|
165 |
-
if ( $this->is_premium() ||
|
166 |
$bulk_now = __( 'Bulk Smush Now', WP_SMUSH_DOMAIN );
|
167 |
} else {
|
168 |
-
$bulk_now = sprintf( __( 'Bulk Smush %d Attachments', WP_SMUSH_DOMAIN ),
|
169 |
}
|
170 |
|
171 |
$wp_smush_msgs = array(
|
@@ -177,7 +180,7 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
177 |
'smush_it' => __( 'Smush it', WP_SMUSH_DOMAIN ),
|
178 |
'smush_now' => __( 'Smush Now', WP_SMUSH_DOMAIN ),
|
179 |
'sending' => __( 'Sending ...', WP_SMUSH_DOMAIN ),
|
180 |
-
"error_in_bulk" => __( '{{errors}} image(s) were skipped due to an error.', WP_SMUSH_DOMAIN)
|
181 |
);
|
182 |
|
183 |
wp_localize_script( $handle, 'wp_smush_msgs', $wp_smush_msgs );
|
@@ -248,9 +251,12 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
248 |
<li><?php _e( 'Access 24/7/365 support from <a href="https://premium.wpmudev.org/support/?utm_source=wordpress.org&utm_medium=plugin&utm_campaign=WP%20Smush%20Upgrade">the best WordPress support team on the planet</a>.', WP_SMUSH_DOMAIN ); ?></li>
|
249 |
<li><?php _e( 'Download <a href="https://premium.wpmudev.org/?utm_source=wordpress.org&utm_medium=plugin&utm_campaign=WP%20Smush%20Upgrade">350+ other premium plugins and themes</a> included in your membership.', WP_SMUSH_DOMAIN ); ?></li>
|
250 |
</ol>
|
251 |
-
<p
|
|
|
|
|
252 |
|
253 |
<p><?php _e( 'Already upgraded to a WPMU DEV membership? Install and Login to our Dashboard plugin to enable Smush Pro features.', WP_SMUSH_DOMAIN ); ?></p>
|
|
|
254 |
<p>
|
255 |
<?php
|
256 |
if ( ! class_exists( 'WPMUDEV_Dashboard' ) ) {
|
@@ -258,10 +264,10 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
258 |
$function = is_multisite() ? 'network_admin_url' : 'admin_url';
|
259 |
$url = wp_nonce_url( $function( 'plugins.php?action=activate&plugin=wpmudev-updates%2Fupdate-notifications.php' ), 'activate-plugin_wpmudev-updates/update-notifications.php' );
|
260 |
?><a class="button-secondary"
|
261 |
-
|
262 |
} else { //dashboard not installed at all
|
263 |
?><a class="button-secondary" target="_blank"
|
264 |
-
|
265 |
}
|
266 |
}
|
267 |
?>
|
@@ -298,14 +304,63 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
298 |
?>
|
299 |
<form action="" method="post">
|
300 |
|
301 |
-
<
|
302 |
<?php
|
303 |
-
//
|
304 |
-
|
305 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
306 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
?>
|
308 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
// nonce
|
310 |
wp_nonce_field( 'save_wp_smush_options', 'wp_smush_options_nonce' );
|
311 |
?>
|
@@ -353,9 +408,9 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
353 |
*
|
354 |
* @return int
|
355 |
*/
|
356 |
-
function get_exceeding_items_count(){
|
357 |
-
$count
|
358 |
-
$bulk
|
359 |
$attachments = $bulk->get_attachments();
|
360 |
//Check images bigger than 1Mb, used to display the count of images that can't be smushed
|
361 |
foreach ( $attachments as $attachment ) {
|
@@ -393,7 +448,7 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
393 |
<h3><?php _e( 'Smush in Bulk', WP_SMUSH_DOMAIN ) ?></h3>
|
394 |
<?php
|
395 |
|
396 |
-
if ( $this->remaining_count == 0
|
397 |
?>
|
398 |
<p><?php _e( "Congratulations, all your images are currently Smushed!", WP_SMUSH_DOMAIN ); ?></p>
|
399 |
<?php
|
@@ -437,7 +492,7 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
437 |
if ( ! $auto_smush && $this->remaining_count == 0 ) {
|
438 |
?>
|
439 |
<p><?php printf( __( 'When you <a href="%s">upload some images</a> they will be available to smush here.', WP_SMUSH_DOMAIN ), admin_url( 'media-new.php' ) ); ?></p>
|
440 |
-
|
441 |
} else { ?>
|
442 |
<p>
|
443 |
<?php
|
@@ -453,7 +508,7 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
453 |
|
454 |
function print_loader() {
|
455 |
?>
|
456 |
-
<div class="wp-smush-loader-wrap hidden"
|
457 |
<div class="floatingCirclesG">
|
458 |
<div class="f_circleG" id="frotateG_01">
|
459 |
</div>
|
@@ -483,9 +538,11 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
483 |
|
484 |
// calculate %ages
|
485 |
if ( $this->total_count > 0 ) //avoid divide by zero error with no attachments
|
|
|
486 |
$smushed_pc = $this->smushed_count / $this->total_count * 100;
|
487 |
-
else
|
488 |
$smushed_pc = 0;
|
|
|
489 |
|
490 |
$progress_ui = '<div id="progress-ui">';
|
491 |
|
@@ -514,21 +571,6 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
514 |
echo $progress_ui;
|
515 |
}
|
516 |
|
517 |
-
function aprogress_ui() {
|
518 |
-
$bulk = new WpSmushitBulk;
|
519 |
-
$total = count( $bulk->get_attachments() );
|
520 |
-
$total = $total ? $total : 1; ?>
|
521 |
-
|
522 |
-
<div id="progress-ui">
|
523 |
-
<div id="smush-status" style="margin: 0 0 5px;"><?php printf( __( 'Smushing <span id="smushed-count">1</span> of <span id="smushing-total">%d</span>', WP_SMUSH_DOMAIN ), $total ); ?></div>
|
524 |
-
<div id="wp-smushit-progress-wrap">
|
525 |
-
<div id="wp-smushit-smush-progress" class="wp-smushit-progressbar">
|
526 |
-
<div></div>
|
527 |
-
</div>
|
528 |
-
</div>
|
529 |
-
</div> <?php
|
530 |
-
}
|
531 |
-
|
532 |
/**
|
533 |
* Processes the Smush request and sends back the next id for smushing
|
534 |
*/
|
@@ -572,7 +614,7 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
572 |
$stats['smushed'] = $this->smushed_count();
|
573 |
$stats['total'] = $this->total_count;
|
574 |
|
575 |
-
if( is_wp_error( $smush ) ) {
|
576 |
wp_send_json_error( $stats );
|
577 |
} else {
|
578 |
wp_send_json_success( $stats );
|
@@ -622,7 +664,7 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
622 |
*/
|
623 |
function check_bulk_limit() {
|
624 |
|
625 |
-
$transient_name
|
626 |
$bulk_sent_count = get_transient( $transient_name );
|
627 |
|
628 |
//If bulk sent count is not set
|
@@ -630,18 +672,21 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
630 |
|
631 |
//start transient at 0
|
632 |
set_transient( $transient_name, 1, 60 );
|
|
|
633 |
return true;
|
634 |
|
635 |
} else if ( $bulk_sent_count < $this->max_free_bulk ) {
|
636 |
|
637 |
//If lte $this->max_free_bulk images are sent, increment
|
638 |
set_transient( $transient_name, $bulk_sent_count + 1, 60 );
|
|
|
639 |
return true;
|
640 |
|
641 |
} else { //Bulk sent count is set and greater than $this->max_free_bulk
|
642 |
|
643 |
//clear it and return false to stop the process
|
644 |
set_transient( $transient_name, 0, 60 );
|
|
|
645 |
return false;
|
646 |
|
647 |
}
|
@@ -758,7 +803,7 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
758 |
*
|
759 |
* @return int
|
760 |
*/
|
761 |
-
function remaining_count(){
|
762 |
return $this->total_count - $this->smushed_count;
|
763 |
}
|
764 |
|
@@ -800,8 +845,8 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
800 |
* @todo Add the API status here, next to the button
|
801 |
*/
|
802 |
function setup_button() {
|
803 |
-
$button
|
804 |
-
$disabled = !empty($button['disabled']) ? ' disabled="disabled"' : '';
|
805 |
?>
|
806 |
<button class="button button-primary<?php echo ' ' . $button['class']; ?>" name="smush-all" <?php echo $disabled; ?>>
|
807 |
<span><?php echo $button['text'] ?></span>
|
@@ -877,7 +922,7 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
877 |
$button['class'] = 'wp-smush-button wp-smush-send';
|
878 |
|
879 |
} else { //if not premium and over limit
|
880 |
-
$button['text'] = sprintf( __( 'Bulk Smush %d Attachments', WP_SMUSH_DOMAIN ),
|
881 |
$button['class'] = 'wp-smush-button wp-smush-send';
|
882 |
|
883 |
}
|
@@ -885,38 +930,6 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
885 |
return $button;
|
886 |
}
|
887 |
|
888 |
-
/**
|
889 |
-
* Render a checkbox
|
890 |
-
*
|
891 |
-
* @param string $key The setting's name
|
892 |
-
*
|
893 |
-
* @return string checkbox html
|
894 |
-
*/
|
895 |
-
function render_checked( $key, $text ) {
|
896 |
-
// the key for options table
|
897 |
-
$opt_name = WP_SMUSH_PREFIX . $key;
|
898 |
-
|
899 |
-
// default value
|
900 |
-
$opt_val = get_option( $opt_name, false );
|
901 |
-
|
902 |
-
//If value is not set for auto smushing set it to 1
|
903 |
-
if ( $key == 'auto' && $opt_val === false ) {
|
904 |
-
$opt_val = 1;
|
905 |
-
}
|
906 |
-
|
907 |
-
//disable lossy for non-premium members
|
908 |
-
$disabled = '';
|
909 |
-
if ( ( 'lossy' == $key || 'backup' == $key ) && ! $this->is_premium() ) {
|
910 |
-
$disabled = ' disabled';
|
911 |
-
$opt_val = 0;
|
912 |
-
}
|
913 |
-
|
914 |
-
// return html
|
915 |
-
return sprintf(
|
916 |
-
"<li><label><input type='checkbox' name='%1\$s' id='%1\$s' value='1' %2\$s %3\$s>%4\$s</label></li>", esc_attr( $opt_name ), checked( $opt_val, 1, false ), $disabled, $text
|
917 |
-
);
|
918 |
-
}
|
919 |
-
|
920 |
function get_smushed_image_ids() {
|
921 |
$args = array(
|
922 |
'fields' => 'ids',
|
@@ -972,6 +985,42 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
972 |
|
973 |
return $links;
|
974 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
975 |
}
|
976 |
|
977 |
$wpsmushit_admin = new WpSmushitAdmin();
|
77 |
// hook into admin footer to load a hidden html/css spinner
|
78 |
add_action( 'admin_footer-upload.php', array( $this, 'print_loader' ) );
|
79 |
|
80 |
+
/// Smush Upgrade
|
81 |
+
add_action( 'admin_notices', array( $this, 'smush_upgrade' ) );
|
82 |
+
|
83 |
$this->total_count = $this->total_count();
|
84 |
$this->smushed_count = $this->smushed_count();
|
85 |
$this->stats = $this->global_stats();
|
88 |
|
89 |
}
|
90 |
|
91 |
+
function __get( $prop ) {
|
92 |
|
93 |
+
if ( method_exists( "WpSmushitAdmin", $prop ) ) {
|
94 |
return $this->$prop();
|
95 |
}
|
96 |
|
97 |
$method_name = "get_" . $prop;
|
98 |
+
if ( method_exists( "WpSmushitAdmin", $method_name ) ) {
|
99 |
return $this->$method_name();
|
100 |
}
|
101 |
}
|
165 |
$bulk = new WpSmushitBulk();
|
166 |
$handle = 'wp-smushit-admin-js';
|
167 |
|
168 |
+
if ( $this->is_premium() || $this->remaining_count <= $this->max_free_bulk ) {
|
169 |
$bulk_now = __( 'Bulk Smush Now', WP_SMUSH_DOMAIN );
|
170 |
} else {
|
171 |
+
$bulk_now = sprintf( __( 'Bulk Smush %d Attachments', WP_SMUSH_DOMAIN ), $this->max_free_bulk );
|
172 |
}
|
173 |
|
174 |
$wp_smush_msgs = array(
|
180 |
'smush_it' => __( 'Smush it', WP_SMUSH_DOMAIN ),
|
181 |
'smush_now' => __( 'Smush Now', WP_SMUSH_DOMAIN ),
|
182 |
'sending' => __( 'Sending ...', WP_SMUSH_DOMAIN ),
|
183 |
+
"error_in_bulk" => __( '{{errors}} image(s) were skipped due to an error.', WP_SMUSH_DOMAIN )
|
184 |
);
|
185 |
|
186 |
wp_localize_script( $handle, 'wp_smush_msgs', $wp_smush_msgs );
|
251 |
<li><?php _e( 'Access 24/7/365 support from <a href="https://premium.wpmudev.org/support/?utm_source=wordpress.org&utm_medium=plugin&utm_campaign=WP%20Smush%20Upgrade">the best WordPress support team on the planet</a>.', WP_SMUSH_DOMAIN ); ?></li>
|
252 |
<li><?php _e( 'Download <a href="https://premium.wpmudev.org/?utm_source=wordpress.org&utm_medium=plugin&utm_campaign=WP%20Smush%20Upgrade">350+ other premium plugins and themes</a> included in your membership.', WP_SMUSH_DOMAIN ); ?></li>
|
253 |
</ol>
|
254 |
+
<p>
|
255 |
+
<a class="button-primary" href="<?php echo $this->upgrade_url; ?>"><?php _e( 'Upgrade Now »', WP_SMUSH_DOMAIN ); ?></a>
|
256 |
+
</p>
|
257 |
|
258 |
<p><?php _e( 'Already upgraded to a WPMU DEV membership? Install and Login to our Dashboard plugin to enable Smush Pro features.', WP_SMUSH_DOMAIN ); ?></p>
|
259 |
+
|
260 |
<p>
|
261 |
<?php
|
262 |
if ( ! class_exists( 'WPMUDEV_Dashboard' ) ) {
|
264 |
$function = is_multisite() ? 'network_admin_url' : 'admin_url';
|
265 |
$url = wp_nonce_url( $function( 'plugins.php?action=activate&plugin=wpmudev-updates%2Fupdate-notifications.php' ), 'activate-plugin_wpmudev-updates/update-notifications.php' );
|
266 |
?><a class="button-secondary"
|
267 |
+
href="<?php echo $url; ?>"><?php _e( 'Activate WPMU DEV Dashboard', WP_SMUSH_DOMAIN ); ?></a><?php
|
268 |
} else { //dashboard not installed at all
|
269 |
?><a class="button-secondary" target="_blank"
|
270 |
+
href="https://premium.wpmudev.org/project/wpmu-dev-dashboard/"><?php _e( 'Install WPMU DEV Dashboard', WP_SMUSH_DOMAIN ); ?></a><?php
|
271 |
}
|
272 |
}
|
273 |
?>
|
304 |
?>
|
305 |
<form action="" method="post">
|
306 |
|
307 |
+
<div id="wp-smush-options-wrap">
|
308 |
<?php
|
309 |
+
//Smush auto key
|
310 |
+
$opt_auto = WP_SMUSH_PREFIX . 'auto';
|
311 |
+
//Auto value
|
312 |
+
$opt_auto_val = get_option( $opt_auto, false );
|
313 |
+
|
314 |
+
//If value is not set for auto smushing set it to 1
|
315 |
+
if ( $opt_auto_val === false ) {
|
316 |
+
//default to checked
|
317 |
+
$opt_auto_val = 1;
|
318 |
}
|
319 |
+
|
320 |
+
//Smush auto key
|
321 |
+
$opt_lossy = WP_SMUSH_PREFIX . 'lossy';
|
322 |
+
//Auto value
|
323 |
+
$opt_lossy_val = get_option( $opt_lossy, false );
|
324 |
+
|
325 |
+
//Smush auto key
|
326 |
+
$opt_backup = WP_SMUSH_PREFIX . 'backup';
|
327 |
+
//Auto value
|
328 |
+
$opt_backup_val = get_option( $opt_backup, false );
|
329 |
+
|
330 |
+
//disable lossy for non-premium members
|
331 |
+
$disabled = $class = '';
|
332 |
+
if ( ! $this->is_premium() ) {
|
333 |
+
$disabled = ' disabled';
|
334 |
+
$opt_lossy_val = $opt_backup_val = 0;
|
335 |
+
$class = ' inactive inactive-anim';
|
336 |
+
}
|
337 |
+
|
338 |
+
// return html
|
339 |
+
printf(
|
340 |
+
"<div class='wp-smush-setting-row'><label><input type='checkbox' name='%1\$s' id='%1\$s' value='1' %2\$s %3\$s>%4\$s</label></div>", esc_attr( $opt_auto ), checked( $opt_auto_val, 1, false ), '', $this->settings['auto']
|
341 |
+
);
|
342 |
?>
|
343 |
+
<div class="pro-only<?php echo $class; ?>"><?php
|
344 |
+
|
345 |
+
//Lossy
|
346 |
+
printf(
|
347 |
+
"<div class='wp-smush-setting-row'><label><input type='checkbox' name='%1\$s' id='%1\$s' value='1' %2\$s %3\$s>%4\$s</label></div>", esc_attr( $opt_lossy ), checked( $opt_lossy_val, 1, false ), $disabled, $this->settings['lossy']
|
348 |
+
);
|
349 |
+
|
350 |
+
//Backup
|
351 |
+
printf(
|
352 |
+
"<div class='wp-smush-setting-row'><label><input type='checkbox' name='%1\$s' id='%1\$s' value='1' %2\$s %3\$s>%4\$s</label></div>", esc_attr( $opt_backup ), checked( $opt_backup_val, 1, false ), $disabled, $this->settings['backup']
|
353 |
+
);
|
354 |
+
if ( ! $this->is_premium() ) {
|
355 |
+
?>
|
356 |
+
<div class="pro-note">
|
357 |
+
<div style="padding:14px 0 14px;">Pro feature only. <a href="http://premium.wpmudev.org/project/wp-smush-pro/" target="_blank">Find out more »</a></div>
|
358 |
+
</div>
|
359 |
+
<?php
|
360 |
+
}
|
361 |
+
?>
|
362 |
+
</div><!-- End of pro-only -->
|
363 |
+
</div><!-- End of wrap --><?php
|
364 |
// nonce
|
365 |
wp_nonce_field( 'save_wp_smush_options', 'wp_smush_options_nonce' );
|
366 |
?>
|
408 |
*
|
409 |
* @return int
|
410 |
*/
|
411 |
+
function get_exceeding_items_count() {
|
412 |
+
$count = 0;
|
413 |
+
$bulk = new WpSmushitBulk();
|
414 |
$attachments = $bulk->get_attachments();
|
415 |
//Check images bigger than 1Mb, used to display the count of images that can't be smushed
|
416 |
foreach ( $attachments as $attachment ) {
|
448 |
<h3><?php _e( 'Smush in Bulk', WP_SMUSH_DOMAIN ) ?></h3>
|
449 |
<?php
|
450 |
|
451 |
+
if ( $this->remaining_count == 0 ) {
|
452 |
?>
|
453 |
<p><?php _e( "Congratulations, all your images are currently Smushed!", WP_SMUSH_DOMAIN ); ?></p>
|
454 |
<?php
|
492 |
if ( ! $auto_smush && $this->remaining_count == 0 ) {
|
493 |
?>
|
494 |
<p><?php printf( __( 'When you <a href="%s">upload some images</a> they will be available to smush here.', WP_SMUSH_DOMAIN ), admin_url( 'media-new.php' ) ); ?></p>
|
495 |
+
<?php
|
496 |
} else { ?>
|
497 |
<p>
|
498 |
<?php
|
508 |
|
509 |
function print_loader() {
|
510 |
?>
|
511 |
+
<div class="wp-smush-loader-wrap hidden">
|
512 |
<div class="floatingCirclesG">
|
513 |
<div class="f_circleG" id="frotateG_01">
|
514 |
</div>
|
538 |
|
539 |
// calculate %ages
|
540 |
if ( $this->total_count > 0 ) //avoid divide by zero error with no attachments
|
541 |
+
{
|
542 |
$smushed_pc = $this->smushed_count / $this->total_count * 100;
|
543 |
+
} else {
|
544 |
$smushed_pc = 0;
|
545 |
+
}
|
546 |
|
547 |
$progress_ui = '<div id="progress-ui">';
|
548 |
|
571 |
echo $progress_ui;
|
572 |
}
|
573 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
574 |
/**
|
575 |
* Processes the Smush request and sends back the next id for smushing
|
576 |
*/
|
614 |
$stats['smushed'] = $this->smushed_count();
|
615 |
$stats['total'] = $this->total_count;
|
616 |
|
617 |
+
if ( is_wp_error( $smush ) ) {
|
618 |
wp_send_json_error( $stats );
|
619 |
} else {
|
620 |
wp_send_json_success( $stats );
|
664 |
*/
|
665 |
function check_bulk_limit() {
|
666 |
|
667 |
+
$transient_name = WP_SMUSH_PREFIX . 'bulk_sent_count';
|
668 |
$bulk_sent_count = get_transient( $transient_name );
|
669 |
|
670 |
//If bulk sent count is not set
|
672 |
|
673 |
//start transient at 0
|
674 |
set_transient( $transient_name, 1, 60 );
|
675 |
+
|
676 |
return true;
|
677 |
|
678 |
} else if ( $bulk_sent_count < $this->max_free_bulk ) {
|
679 |
|
680 |
//If lte $this->max_free_bulk images are sent, increment
|
681 |
set_transient( $transient_name, $bulk_sent_count + 1, 60 );
|
682 |
+
|
683 |
return true;
|
684 |
|
685 |
} else { //Bulk sent count is set and greater than $this->max_free_bulk
|
686 |
|
687 |
//clear it and return false to stop the process
|
688 |
set_transient( $transient_name, 0, 60 );
|
689 |
+
|
690 |
return false;
|
691 |
|
692 |
}
|
803 |
*
|
804 |
* @return int
|
805 |
*/
|
806 |
+
function remaining_count() {
|
807 |
return $this->total_count - $this->smushed_count;
|
808 |
}
|
809 |
|
845 |
* @todo Add the API status here, next to the button
|
846 |
*/
|
847 |
function setup_button() {
|
848 |
+
$button = $this->button_state();
|
849 |
+
$disabled = ! empty( $button['disabled'] ) ? ' disabled="disabled"' : '';
|
850 |
?>
|
851 |
<button class="button button-primary<?php echo ' ' . $button['class']; ?>" name="smush-all" <?php echo $disabled; ?>>
|
852 |
<span><?php echo $button['text'] ?></span>
|
922 |
$button['class'] = 'wp-smush-button wp-smush-send';
|
923 |
|
924 |
} else { //if not premium and over limit
|
925 |
+
$button['text'] = sprintf( __( 'Bulk Smush %d Attachments', WP_SMUSH_DOMAIN ), $this->max_free_bulk );
|
926 |
$button['class'] = 'wp-smush-button wp-smush-send';
|
927 |
|
928 |
}
|
930 |
return $button;
|
931 |
}
|
932 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
933 |
function get_smushed_image_ids() {
|
934 |
$args = array(
|
935 |
'fields' => 'ids',
|
985 |
|
986 |
return $links;
|
987 |
}
|
988 |
+
|
989 |
+
function smush_upgrade() {
|
990 |
+
if ( ! current_user_can( 'edit_others_posts' ) ) {
|
991 |
+
return;
|
992 |
+
}
|
993 |
+
|
994 |
+
if ( isset( $_GET['page'] ) && 'wp-smush-bulk' == $_GET['page'] ) {
|
995 |
+
return;
|
996 |
+
}
|
997 |
+
|
998 |
+
if ( isset( $_GET['dismiss_smush_upgrade'] ) ) {
|
999 |
+
update_option( 'dismiss_smush_upgrade', 1 );
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
if ( get_option( 'dismiss_smush_upgrade' ) || $this->is_premium() ) {
|
1003 |
+
return;
|
1004 |
+
}
|
1005 |
+
?>
|
1006 |
+
<div class="error">
|
1007 |
+
<a href="<?php echo admin_url( 'index.php' ); ?>?dismiss_smush_upgrade=1" style="float:right;margin-top: 10px;text-decoration: none;"><span class="dashicons dashicons-dismiss" style="color:gray;"></span>Dismiss</a>
|
1008 |
+
|
1009 |
+
<h3><span class="dashicons dashicons-megaphone" style="color:red"></span> Happy Smushing!</h3>
|
1010 |
+
|
1011 |
+
<p>Welcome to the all new WP Smush, now running on the WPMU DEV Smush infrastructure!</p>
|
1012 |
+
|
1013 |
+
<p>That means that you can continue smushing your images for free, now with added https support, speed,
|
1014 |
+
and reliability... enjoy!</p>
|
1015 |
+
|
1016 |
+
<p>And now, if you'd like to upgrade to the WP Smush Pro plugin you can smush images up to 8MB in size,
|
1017 |
+
get 'Super Smushing' of, on average, 60% reduction, backup all non smushed images and bulk smush an
|
1018 |
+
unlimited number of images at once.
|
1019 |
+
<a href="https://premium.wpmudev.org/?coupon=SMUSH50OFF#pricing"> Click here to upgrade with a 50%
|
1020 |
+
discount</a>.</p>
|
1021 |
+
</div>
|
1022 |
+
<?php
|
1023 |
+
}
|
1024 |
}
|
1025 |
|
1026 |
$wpsmushit_admin = new WpSmushitAdmin();
|
readme.txt
CHANGED
@@ -1,20 +1,25 @@
|
|
1 |
=== WP Smush ===
|
2 |
Plugin Name: WP Smush
|
3 |
-
Version: 2.0
|
4 |
Author: WPMU DEV
|
5 |
Author URI: http://premium.wpmudev.org/
|
6 |
-
Contributors: WPMUDEV,
|
7 |
Tags: Attachment,Attachments,Compress,Compress Image File,Compress Image Size,Compress JPG,Compressed JPG, Compression Image,Image,Images,JPG,Optimise,Optimize,Photo,Photos,Pictures,PNG,Reduce Image Size,Smush,Smush.it,Upload,WordPress Compression,WordPress Image Tool,Yahoo, Yahoo Smush.it
|
8 |
Requires at least: 3.5
|
9 |
Tested up to: 4.2
|
10 |
-
Stable tag: 2.0
|
11 |
License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
12 |
|
|
|
|
|
13 |
== Description ==
|
14 |
|
15 |
<blockquote>
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
18 |
</blockquote>
|
19 |
|
20 |
WP Smush strips hidden, bulky information from your images, reducing the file size without losing quality. The faster your site loads, the more Google, Bing, Yahoo and other search engines will like it.
|
@@ -76,6 +81,10 @@ Yahoo's Smush.it API is gone forever. So WPMU DEV built our own free API that is
|
|
76 |
|
77 |
|
78 |
== Changelog ==
|
|
|
|
|
|
|
|
|
79 |
= 2.0 =
|
80 |
* Complete rewrite to use WPMU DEV's new fast and reliable API service.
|
81 |
* New: One-click bulk smushing of all your images.
|
1 |
=== WP Smush ===
|
2 |
Plugin Name: WP Smush
|
3 |
+
Version: 2.0.1
|
4 |
Author: WPMU DEV
|
5 |
Author URI: http://premium.wpmudev.org/
|
6 |
+
Contributors: WPMUDEV, alexdunane
|
7 |
Tags: Attachment,Attachments,Compress,Compress Image File,Compress Image Size,Compress JPG,Compressed JPG, Compression Image,Image,Images,JPG,Optimise,Optimize,Photo,Photos,Pictures,PNG,Reduce Image Size,Smush,Smush.it,Upload,WordPress Compression,WordPress Image Tool,Yahoo, Yahoo Smush.it
|
8 |
Requires at least: 3.5
|
9 |
Tested up to: 4.2
|
10 |
+
Stable tag: 2.0.1
|
11 |
License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
12 |
|
13 |
+
Reduce image file sizes, improve performance and boost your SEO using the free <a href="https://premium.wpmudev.org/">WPMU DEV</a> WordPress Smush API.
|
14 |
+
|
15 |
== Description ==
|
16 |
|
17 |
<blockquote>
|
18 |
+
<strong>All new massively improved smushing!</strong>
|
19 |
+
<br />
|
20 |
+
<br />
|
21 |
+
|
22 |
+
Try now for a completely new, incredibly powerful and 100% free images smushing process, brought to you by the team at WPMU DEV!
|
23 |
</blockquote>
|
24 |
|
25 |
WP Smush strips hidden, bulky information from your images, reducing the file size without losing quality. The faster your site loads, the more Google, Bing, Yahoo and other search engines will like it.
|
81 |
|
82 |
|
83 |
== Changelog ==
|
84 |
+
|
85 |
+
= 2.0.1 =
|
86 |
+
* UI changes
|
87 |
+
|
88 |
= 2.0 =
|
89 |
* Complete rewrite to use WPMU DEV's new fast and reliable API service.
|
90 |
* New: One-click bulk smushing of all your images.
|
wp-smush.php
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
/*
|
3 |
Plugin Name: WP Smush
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/wp-smushit/
|
5 |
-
Description: Reduce image file sizes
|
6 |
Author: WPMU DEV
|
7 |
-
Version: 2.0
|
8 |
Author URI: http://premium.wpmudev.org/
|
9 |
Textdomain: wp_smush
|
10 |
*/
|
@@ -35,7 +35,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
35 |
/**
|
36 |
* Constants
|
37 |
*/
|
38 |
-
define( 'WP_SMUSH_VERSON', "2.0" );
|
|
|
39 |
/**
|
40 |
* Plugin base name
|
41 |
*/
|
2 |
/*
|
3 |
Plugin Name: WP Smush
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/wp-smushit/
|
5 |
+
Description: Reduce image file sizes, improve performance and boost your SEO using the free <a href="https://premium.wpmudev.org/">WPMU DEV</a> WordPress Smush API.
|
6 |
Author: WPMU DEV
|
7 |
+
Version: 2.0.1
|
8 |
Author URI: http://premium.wpmudev.org/
|
9 |
Textdomain: wp_smush
|
10 |
*/
|
35 |
/**
|
36 |
* Constants
|
37 |
*/
|
38 |
+
define( 'WP_SMUSH_VERSON', "2.0.1" );
|
39 |
+
|
40 |
/**
|
41 |
* Plugin base name
|
42 |
*/
|