Weglot Translate – Translate your WP website - Version 3.1.4

Version Description

(12/12/2019) = * Update back office style for WordPress 5.3 * Fix: Flags SRC attribute with AMP * Fix: Custom URL feature - Revisions * Improve compatibility: WP Optimize * Improve compatibility: Cache Enabler * Add default exclude block for SecuPress plugin and SQLI protect * Add default exclude block for plugin query monitor > 3.3.0 * Remove the "Not allowed" mechanism.

Download this release

Release Info

Developer remyb92
Plugin Icon 128x128 Weglot Translate – Translate your WP website
Version 3.1.4
Comparing to
See all releases

Code changes from version 3.1.3 to 3.1.4

app/styles/admin.scss CHANGED
@@ -1,186 +1,352 @@
1
- @import '_colors.scss';
2
- @import 'selectize.css';
3
 
4
- .weglot__choice__language{
5
- border-bottom:1px solid #eee;
6
- margin:5px 0px;
7
- &--local{
8
- border-width:50px;
9
- color: #a6a6a6;
10
- display:block;
 
 
 
 
 
 
 
 
11
  }
12
- }
13
 
14
- .weglot_text_error {
15
- color:red;
16
- }
17
 
18
- .weglot_reset{
19
- text-decoration: underline;
20
- font-style: italic;
21
- &:hover{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  cursor: pointer;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  }
24
- }
25
 
26
- .weglot_custom_url{
27
- border-bottom: 1px solid #ccc;
28
- margin-bottom: 10px;
29
- a{
30
- margin: 5px 0px;
31
  display: inline-block;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  }
33
- &--text_link{
34
- margin-bottom: 4px;
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
36
- }
37
 
38
- .btn{
39
- background:$primary;
40
- display: inline-block;
41
- padding: 8px 10px;
42
- border-radius: 4px;
43
- transition: .2s background linear,.2s color linear,.2s border linear,.2s text-shadow linear;
44
- outline: 0;
45
- -webkit-font-smoothing: antialiased;
46
- text-rendering: optimizeLegibility;
47
- font-weight: 700;
48
- cursor: pointer;
49
- text-align: center;
50
- text-decoration: none;
51
- box-shadow: none;
52
- white-space: nowrap;
53
- color:white;
54
- border:1px solid $primary;
55
- &.btn-soft{
56
- background-color: #fff;
57
- color:$textColor;
58
- border-color:#eaeaea;
59
-
60
- }
61
- &.btn-primary{
62
- &:active,
63
- &:focus,
64
- &:hover{
65
- border-color: $primaryHover;
66
- background-color: $primaryHover;
67
  }
68
  }
69
 
70
- }
 
71
 
72
- .js-btn-remove{
73
- border: none;
74
- background-color: #ed6657;
75
- color: #fff;
76
- display: inline-block;
77
- width: 32px;
78
- height: 32px;
79
- position: relative;
80
- border-radius: 50%;
81
- cursor: pointer;
82
- transform: translateY(-5%);
83
- margin-left:10px;
84
- transition: opacity 175ms linear;
85
- outline: 0;
86
- }
87
 
88
- .item-exclude{
89
- position: relative;
90
- margin-bottom: 10px;
91
- }
 
 
 
 
 
 
 
 
 
 
92
 
93
- input[type='text'],textarea {
94
- &:focus {
95
- border-color: $primaryHover;
96
- box-shadow: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  }
98
- }
99
 
100
- ::-webkit-input-placeholder,
101
- :-moz-placeholder,
102
- ::-moz-placeholder,
103
- :-ms-input-placeholder
104
- {
105
- color: #C0C0C0;
106
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
 
108
- .sub-label {
109
- font-size: 13px;
110
- font-weight: normal;
111
- margin: 2px 0 0;
112
- }
113
 
114
- .weglot-select-original {
115
- height : 36px!important;
116
- margin : 0;
117
- }
118
- .original-select,
119
- #type_flags {
120
- padding: 8px;
121
- height: 36px!important;
122
- width: 300px;
123
- }
124
- #type_flags {
125
- width: 150px;
126
- }
127
 
128
- .selectize-control.multi .selectize-input > div {
129
- background-color : #eff0ff;
130
- }
 
 
131
 
132
- input[type="text"], .wg-input-textarea {
133
- padding:8px;
134
- }
135
- .wg-input-textarea::placeholder{
136
- color:#ccc;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  }
138
 
 
 
 
139
 
140
- #wrap-weglot{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
 
142
  .weglot-nokkey:before {
143
- content:'\274C';
144
- display:inline-block;
145
- color:red;
146
- padding:0 6px 0 0;
147
  font-size: 15px;
148
- padding:0 10px;
149
  }
 
150
  .weglot-okkey:before {
151
- content: '\2713';
152
  display: inline-block;
153
- color: green;
154
  padding: 0 10px;
155
  font-size: 20px;
156
  font-weight: bold;
157
- padding:0 10px;
158
- }
159
- display:flex;
160
- margin-left: 15px;
161
- .wrap {
162
- flex: 4;
163
  }
164
- .weglot-infobox{
165
- flex:2;
 
166
  align-self: start;
167
- margin:10px 20px 0 2px;
168
- background-color: #fff;
169
  background-color: white;
170
- border: 1px solid #e0e0e0;
171
  border-radius: 12px;
172
  overflow: hidden;
 
173
  h3 {
174
- color : rgb(24, 22, 76);
175
- background-color : white;
176
  padding: 30px 30px 0 30px;
177
- margin : 0px;
178
  font-size: 23px;
179
  line-height: 1.3;
180
  }
 
181
  div {
182
  padding: 15px 30px 30px 30px;
183
  }
 
184
  .weglot-editbtn {
185
  box-shadow: 0 2px 4px 0 rgba(1, 1, 2, 0.05);
186
  background-color: rgb(61, 70, 251);
@@ -188,43 +354,40 @@ input[type="text"], .wg-input-textarea {
188
  height: 45px;
189
  border-radius: 23px;
190
  line-height: 45px;
 
 
 
 
 
191
 
192
- font-size: 14px!important;
193
- text-decoration : none;
194
- padding : 0px 30px;
195
- display : inline-block;
196
- transition:all .2s ease-in;
197
  &:hover {
198
- color : white;
199
  background: rgb(37, 46, 215);
200
  }
201
- p {
202
- font-size: 15px;
203
- }
204
  }
205
  }
206
 
207
- .selectize-control,
208
  input[type="text"],
 
209
  .wg-input-textarea,
210
- .weglot-select-original{
211
- width : 100%;
212
- max-width: 300px;
213
  }
214
 
215
  #submit {
216
  height: 50px;
217
- padding: 0 30px!important;
218
  font-size: 16px;
219
  }
220
 
221
  .description {
222
- display: inline-block;
223
  }
224
 
225
  .wg-tooltip {
226
- position : absolute;
227
- display:none;
228
  }
229
 
230
  #mainform {
@@ -242,125 +405,68 @@ input[type="text"], .wg-input-textarea {
242
  }
243
 
244
  .question-icon {
245
- font-size : 17px;
246
  }
247
 
248
  .form-table {
249
  margin-bottom: 50px;
250
  }
 
251
  .country-selector {
252
- z-index: 1!important;
253
  }
254
-
255
  }
256
 
257
 
258
- .weglot-info {
259
- position: relative;
260
- color: #3741cc;
261
- font-weight: bold;
262
-
263
- &:hover {
264
- .wg-tooltip {
265
- line-height: 1.4;
266
- position: absolute;
267
- top: 27px;
268
- display: block!important;
269
- background-color: #24292d;
270
- width: 160px;
271
- padding: 10px;
272
- color: white;
273
- font-weight: normal;
274
- border: 1px solid #e0e0e0;
275
- font-size: 12px;
276
- }
277
- }
278
- }
279
 
280
- .weglot-box-overlay{
281
- position: fixed;
282
- top: 0;
283
- left: 0;
284
- display: flex;
285
- width: 100%;
286
- height: 100%;
287
- background-color: rgba(0,0,0,0.85);
288
- z-index: 9999;
289
- justify-content: center;
290
- align-items: center;
291
- .weglot-box{
292
- background-color: #fff;
293
- padding: 25px;
294
- text-align:center;
295
- -webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
296
- -moz-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
297
- box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
298
- &--title{
299
- font-size: 24px;
300
- line-height: 1.3;
301
- }
302
- &--text{
303
- font-size: 18px;
304
  }
305
- &--subtext{
306
- font-size: 12px;
307
- font-style: italic;
308
  }
309
- }
310
- .weglot-btn-close{
311
- float:right;
312
- cursor: pointer;
313
- }
314
- }
315
 
 
316
 
317
- .flag-style-openclose {
318
- display: inline-block;
319
- font-size: 12px;
320
- color: #51C7A7;
321
- text-decoration: underline;
322
- cursor: default;
323
- margin-right: 20px;
324
- &:hover{
325
- opacity : 0.6;
326
- cursor: pointer;
327
- }
328
- }
329
 
330
- .flag-style-wrapper {
331
- padding : 15px 0px;
332
- p {
333
- font-size : 12px!important;
334
- }
335
- select {
336
- padding : 3px!important;
337
- font-size : 12px;
338
- }
339
- }
 
 
 
 
340
 
 
341
 
342
- #private_mode {
343
- + p + div {
344
- display: none;
345
- }
346
- &:checked + p + div {
347
- display: block;
348
- }
349
- }
350
 
351
- #private-mode-detail {
352
- margin-top: 20px;
353
- .private-mode-detail-lang{
354
- display:flex;
355
- align-items:center;
356
- margin-top: 15px;
357
- margin-bottom: 15px;
358
- margin-left: 15px;
359
- input,label{
360
- line-height: 1.3;
361
- }
362
- input{
363
- margin-right: 15px;
364
  }
365
  }
366
  }
1
+ @import "_colors.scss";
2
+ @import "selectize.css";
3
 
4
+ $wp-color-red: #dc3232; // RGB(220,50,50)
5
+ $wp-color-green: #46b450; // RGB(70, 180, 80)
6
+
7
+ #weglot-url-translate,
8
+ #wrap-weglot {
9
+
10
+ .weglot__choice__language {
11
+ border-bottom: 1px solid #eee;
12
+ margin: 5px 0px;
13
+
14
+ &--local {
15
+ border-width: 50px;
16
+ color: #a6a6a6;
17
+ display: block;
18
+ }
19
  }
 
20
 
21
+ .weglot_text_error {
22
+ color: $wp-color-red;
23
+ }
24
 
25
+ .weglot_reset {
26
+ text-decoration: underline;
27
+ font-style: italic;
28
+
29
+ &:hover {
30
+ cursor: pointer;
31
+ }
32
+ }
33
+
34
+ .btn {
35
+ background: $primary;
36
+ display: inline-block;
37
+ padding: 8px 10px;
38
+ border-radius: 4px;
39
+ transition: 0.2s background linear, 0.2s color linear,
40
+ 0.2s border linear, 0.2s text-shadow linear;
41
+ outline: 0;
42
+ -webkit-font-smoothing: antialiased;
43
+ text-rendering: optimizeLegibility;
44
+ font-weight: 700;
45
  cursor: pointer;
46
+ text-align: center;
47
+ text-decoration: none;
48
+ box-shadow: none;
49
+ white-space: nowrap;
50
+ color: white;
51
+ border: 1px solid $primary;
52
+
53
+ &.btn-soft {
54
+ background-color: #fff;
55
+ color: $textColor;
56
+ border-radius: 4px;
57
+ border: 1px solid #7e8993;
58
+ line-height: 1.4em;
59
+ }
60
+
61
+ &.btn-primary {
62
+ &:active,
63
+ &:focus,
64
+ &:hover {
65
+ border-color: $primaryHover;
66
+ background-color: $primaryHover;
67
+ }
68
+ }
69
  }
 
70
 
71
+ .js-btn-remove {
72
+ border: none;
73
+ background-color: #e35b5b;
74
+ color: #fff;
 
75
  display: inline-block;
76
+ width: 22px;
77
+ height: 22px;
78
+ border-radius: 50%;
79
+ cursor: pointer;
80
+ transform: translateY(-5%);
81
+ transition: opacity 175ms linear;
82
+ outline: 0;
83
+ padding: 0;
84
+ margin: 4px 0;
85
+ vertical-align: middle;
86
+
87
+ &:hover {
88
+ background-color: #c62d2d;
89
+ }
90
+ }
91
+
92
+ .item-exclude {
93
+ position: relative;
94
+ margin-bottom: 10px;
95
  }
96
+
97
+ ::-webkit-input-placeholder,
98
+ :-moz-placeholder,
99
+ ::-moz-placeholder,
100
+ :-ms-input-placeholder {
101
+ color: #c0c0c0;
102
+ }
103
+
104
+ .sub-label {
105
+ font-size: 13px;
106
+ font-weight: normal;
107
+ margin: 2px 0 0;
108
+ color: #444;
109
+ opacity: 0.8;
110
  }
 
111
 
112
+ .weglot-select-original {
113
+ height: 36px !important;
114
+ margin: 0;
115
+ }
116
+
117
+ .original-select,
118
+ #type_flags {
119
+ padding: 8px;
120
+ height: 36px !important;
121
+ width: 300px;
122
+ }
123
+
124
+ #type_flags {
125
+ width: 150px;
126
+ }
127
+
128
+ .selectize-control.multi .selectize-input {
129
+ border: 1px solid #7e8993;
130
+ border-radius: 4px;
131
+ box-shadow: unset;
132
+
133
+ & > div {
134
+ background-color: #eff0ff;
135
+ border: 1px solid #7e8993;
136
+ border-radius: 2px;
137
+
138
+ .remove {
139
+ border-left-color: #7e8993;
140
+ }
141
  }
142
  }
143
 
144
+ .wg-input-textarea {
145
+ padding: 8px;
146
 
147
+ &::placeholder {
148
+ color: #c0c0c0;
149
+ }
150
+ }
 
 
 
 
 
 
 
 
 
 
 
151
 
152
+ .weglot-select.weglot-select-original,
153
+ input[type="text"],
154
+ textarea,
155
+ select,
156
+ #type_flags {
157
+ padding: 0 8px;
158
+ border-radius: 4px;
159
+ border: 1px solid #7e8993;
160
+
161
+ &:focus {
162
+ border-color: $primaryHover !important;
163
+ box-shadow: none !important;
164
+ }
165
+ }
166
 
167
+ .weglot-info {
168
+ position: relative;
169
+ color: #3741cc;
170
+ font-weight: bold;
171
+
172
+ &:hover {
173
+ .wg-tooltip {
174
+ line-height: 1.4;
175
+ position: absolute;
176
+ top: 27px;
177
+ display: block !important;
178
+ background-color: #24292d;
179
+ width: 160px;
180
+ padding: 10px;
181
+ color: white;
182
+ font-weight: normal;
183
+ border: 1px solid #e0e0e0;
184
+ font-size: 12px;
185
+ }
186
+ }
187
  }
 
188
 
189
+ .weglot-box-overlay {
190
+ position: fixed;
191
+ top: 0;
192
+ left: 0;
193
+ display: flex;
194
+ width: 100%;
195
+ height: 100%;
196
+ background-color: rgba(0, 0, 0, 0.85);
197
+ z-index: 9999;
198
+ justify-content: center;
199
+ align-items: center;
200
+
201
+ .weglot-box {
202
+ background-color: #fff;
203
+ padding: 25px;
204
+ text-align: center;
205
+ -webkit-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75);
206
+ -moz-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75);
207
+ box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75);
208
+
209
+ &--title {
210
+ font-size: 24px;
211
+ line-height: 1.3;
212
+ }
213
 
214
+ &--text {
215
+ font-size: 18px;
216
+ }
 
 
217
 
218
+ &--subtext {
219
+ font-size: 12px;
220
+ font-style: italic;
221
+ }
222
+ }
 
 
 
 
 
 
 
 
223
 
224
+ .weglot-btn-close {
225
+ float: right;
226
+ cursor: pointer;
227
+ }
228
+ }
229
 
230
+ .flag-style-openclose {
231
+ display: inline-block;
232
+ font-size: 12px;
233
+ text-decoration: underline;
234
+ cursor: default;
235
+ margin: 12px 15px 0 10px;
236
+ color: $wp-color-green;
237
+
238
+ &:hover {
239
+ color: #399648;
240
+ cursor: pointer;
241
+ }
242
+ }
243
+
244
+ .flag-style-wrapper {
245
+ padding: 15px 0px;
246
+
247
+ p {
248
+ font-size: 12px !important;
249
+ }
250
+
251
+ select {
252
+ font-size: 12px;
253
+ margin: 0 2px 6px 0;
254
+ padding: 0 26px 0 8px;
255
+ }
256
+ }
257
+
258
+ #private_mode {
259
+ + p + div {
260
+ display: none;
261
+ }
262
+
263
+ &:checked + p + div {
264
+ display: block;
265
+ }
266
+ }
267
+
268
+ #private-mode-detail {
269
+ margin-top: 20px;
270
+
271
+ .private-mode-detail-lang {
272
+ display: flex;
273
+ align-items: center;
274
+ margin-bottom: 10px;
275
+ margin-left: 25px;
276
+
277
+ input[type="checkbox"] {
278
+ margin-top: -1px;
279
+ }
280
+ }
281
+ }
282
  }
283
 
284
+ #wrap-weglot {
285
+ display: flex;
286
+ margin-left: 15px;
287
 
288
+ .wrap {
289
+ flex: 4;
290
+ }
291
+
292
+ input[type="text"]:not(#destination_language-selectized),
293
+ input[type="url"] {
294
+ padding: 0 8px;
295
+ height: 36px;
296
+ }
297
+
298
+ select {
299
+ height: 36px;
300
+ vertical-align: top;
301
+ border-radius: 4px;
302
+ padding: 0 26px 0 8px;
303
+ }
304
+
305
+ input[type="checkbox"] {
306
+ margin-top: -4px;
307
+ }
308
 
309
  .weglot-nokkey:before {
310
+ content: "\274C";
311
+ display: inline-block;
312
+ color: $wp-color-red;
313
+ padding: 0 6px 0 0;
314
  font-size: 15px;
315
+ padding: 0 10px;
316
  }
317
+
318
  .weglot-okkey:before {
319
+ content: "\2713";
320
  display: inline-block;
321
+ color: $wp-color-green;
322
  padding: 0 10px;
323
  font-size: 20px;
324
  font-weight: bold;
325
+ padding: 0 10px;
 
 
 
 
 
326
  }
327
+
328
+ .weglot-infobox {
329
+ flex: 2;
330
  align-self: start;
331
+ margin: 10px 20px 0 2px;
 
332
  background-color: white;
333
+ border: 1px solid #e0e0e0;
334
  border-radius: 12px;
335
  overflow: hidden;
336
+
337
  h3 {
338
+ color: rgb(24, 22, 76);
339
+ background-color: white;
340
  padding: 30px 30px 0 30px;
341
+ margin: 0px;
342
  font-size: 23px;
343
  line-height: 1.3;
344
  }
345
+
346
  div {
347
  padding: 15px 30px 30px 30px;
348
  }
349
+
350
  .weglot-editbtn {
351
  box-shadow: 0 2px 4px 0 rgba(1, 1, 2, 0.05);
352
  background-color: rgb(61, 70, 251);
354
  height: 45px;
355
  border-radius: 23px;
356
  line-height: 45px;
357
+ font-size: 14px !important;
358
+ text-decoration: none;
359
+ padding: 0 30px;
360
+ display: inline-block;
361
+ transition: all 0.2s ease-in;
362
 
 
 
 
 
 
363
  &:hover {
364
+ color: white;
365
  background: rgb(37, 46, 215);
366
  }
 
 
 
367
  }
368
  }
369
 
 
370
  input[type="text"],
371
+ .selectize-control,
372
  .wg-input-textarea,
373
+ .weglot-select-original {
374
+ width: 100%;
375
+ max-width: 320px;
376
  }
377
 
378
  #submit {
379
  height: 50px;
380
+ padding: 0 30px !important;
381
  font-size: 16px;
382
  }
383
 
384
  .description {
385
+ display: inline;
386
  }
387
 
388
  .wg-tooltip {
389
+ position: absolute;
390
+ display: none;
391
  }
392
 
393
  #mainform {
405
  }
406
 
407
  .question-icon {
408
+ font-size: 17px;
409
  }
410
 
411
  .form-table {
412
  margin-bottom: 50px;
413
  }
414
+
415
  .country-selector {
416
+ z-index: 1 !important;
417
  }
 
418
  }
419
 
420
 
421
+ #weglot-url-translate {
422
+ .weglot_custom_url {
423
+ border-bottom: 1px solid #ccc;
424
+ margin-bottom: 20px;
425
+ padding-bottom: 10px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
426
 
427
+
428
+ a {
429
+ margin: 5px 0px;
430
+ display: inline-block;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
431
  }
432
+
433
+ &--text_link {
434
+ margin-bottom: 4px;
435
  }
 
 
 
 
 
 
436
 
437
+ .weglot_custom_url--text_link {
438
 
439
+ input[type="text"] {
440
+ min-height: 24px !important;
441
+ height: 24px;
442
+ }
 
 
 
 
 
 
 
 
443
 
444
+ button {
445
+ margin-top: -2px;
446
+ font-size: 11px;
447
+ padding: 0 8px;
448
+
449
+ &.button-weglot-lang {
450
+ .dashicons {
451
+ font-size: 14px;
452
+ line-height: 21px;
453
+ margin-right: -3px;
454
+ margin-left: -4px;
455
+ }
456
+ }
457
+ }
458
 
459
+ }
460
 
461
+ a.weglot_reset {
462
+ text-decoration: none;
 
 
 
 
 
 
463
 
464
+ &:link,
465
+ &:visited,
466
+ &:hover,
467
+ &:active {
468
+ text-decoration: none;
469
+ }
 
 
 
 
 
 
 
470
  }
471
  }
472
  }
bootstrap.php CHANGED
@@ -66,9 +66,12 @@ abstract class Context_Weglot {
66
  '\WeglotWP\Third\Woocommerce\Wc_Active',
67
  '\WeglotWP\Third\WPForms\Wpforms_Active',
68
  '\WeglotWP\Third\UnderConstructionPage\Ucp_Active',
 
69
  '\WeglotWP\Third\TheEventsCalendar\Theeventscalendar_Active',
70
  '\WeglotWP\Third\MailOptin\Mailoptin_Active',
71
  '\WeglotWP\Third\ContactForm7\Contactform7_Active',
 
 
72
  ];
73
 
74
  self::$context->set_services( $services );
@@ -102,8 +105,11 @@ abstract class Context_Weglot {
102
  '\WeglotWP\Third\Woocommerce\WC_Filter_Urls_Weglot',
103
  '\WeglotWP\Third\Woocommerce\WC_Cart_Reload_Weglot',
104
  '\WeglotWP\Third\UnderConstructionPage\Ucp_Tracking',
 
105
  '\WeglotWP\Third\TheEventsCalendar\Theeventscalendar_Words',
106
  '\WeglotWP\Third\Contactform7\Contactform7_Json_Keys',
 
 
107
  ];
108
 
109
  self::$context->set_actions( $actions );
66
  '\WeglotWP\Third\Woocommerce\Wc_Active',
67
  '\WeglotWP\Third\WPForms\Wpforms_Active',
68
  '\WeglotWP\Third\UnderConstructionPage\Ucp_Active',
69
+ '\WeglotWP\Third\Maintenance\Maintenance_Active',
70
  '\WeglotWP\Third\TheEventsCalendar\Theeventscalendar_Active',
71
  '\WeglotWP\Third\MailOptin\Mailoptin_Active',
72
  '\WeglotWP\Third\ContactForm7\Contactform7_Active',
73
+ '\WeglotWP\Third\WpOptimize\Wp_Optimize_Active',
74
+ '\WeglotWP\Third\CacheEnabler\Cache_Enabler_Active',
75
  ];
76
 
77
  self::$context->set_services( $services );
105
  '\WeglotWP\Third\Woocommerce\WC_Filter_Urls_Weglot',
106
  '\WeglotWP\Third\Woocommerce\WC_Cart_Reload_Weglot',
107
  '\WeglotWP\Third\UnderConstructionPage\Ucp_Tracking',
108
+ '\WeglotWP\Third\Maintenance\Maintenance_Tracking',
109
  '\WeglotWP\Third\TheEventsCalendar\Theeventscalendar_Words',
110
  '\WeglotWP\Third\Contactform7\Contactform7_Json_Keys',
111
+ '\WeglotWP\Third\WpOptimize\Wp_Optimize_Cache',
112
+ '\WeglotWP\Third\CacheEnabler\Cache_Enabler_Cache',
113
  ];
114
 
115
  self::$context->set_actions( $actions );
dist/css/admin-css.css CHANGED
@@ -322,4 +322,4 @@
322
  opacity: 0.5;
323
  background-color: #fafafa;
324
  }
325
- .weglot__choice__language{border-bottom:1px solid #eee;margin:5px 0px}.weglot__choice__language--local{border-width:50px;color:#a6a6a6;display:block}.weglot_text_error{color:red}.weglot_reset{text-decoration:underline;font-style:italic}.weglot_reset:hover{cursor:pointer}.weglot_custom_url{border-bottom:1px solid #ccc;margin-bottom:10px}.weglot_custom_url a{margin:5px 0px;display:inline-block}.weglot_custom_url--text_link{margin-bottom:4px}.btn{background:#335ee2;display:inline-block;padding:8px 10px;border-radius:4px;-webkit-transition:.2s background linear,.2s color linear,.2s border linear,.2s text-shadow linear;-o-transition:.2s background linear,.2s color linear,.2s border linear,.2s text-shadow linear;transition:.2s background linear,.2s color linear,.2s border linear,.2s text-shadow linear;outline:0;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;font-weight:700;cursor:pointer;text-align:center;text-decoration:none;-webkit-box-shadow:none;box-shadow:none;white-space:nowrap;color:white;border:1px solid #335ee2}.btn.btn-soft{background-color:#fff;color:#24284c;border-color:#eaeaea}.btn.btn-primary:active,.btn.btn-primary:focus,.btn.btn-primary:hover{border-color:#446dea;background-color:#446dea}.js-btn-remove{border:none;background-color:#ed6657;color:#fff;display:inline-block;width:32px;height:32px;position:relative;border-radius:50%;cursor:pointer;-webkit-transform:translateY(-5%);-ms-transform:translateY(-5%);transform:translateY(-5%);margin-left:10px;-webkit-transition:opacity 175ms linear;-o-transition:opacity 175ms linear;transition:opacity 175ms linear;outline:0}.item-exclude{position:relative;margin-bottom:10px}input[type='text']:focus,textarea:focus{border-color:#446dea;-webkit-box-shadow:none;box-shadow:none}::-webkit-input-placeholder,:-moz-placeholder,::-moz-placeholder,:-ms-input-placeholder{color:#C0C0C0}.sub-label{font-size:13px;font-weight:normal;margin:2px 0 0}.weglot-select-original{height:36px !important;margin:0}.original-select,#type_flags{padding:8px;height:36px !important;width:300px}#type_flags{width:150px}.selectize-control.multi .selectize-input>div{background-color:#eff0ff}input[type="text"],.wg-input-textarea{padding:8px}.wg-input-textarea::-webkit-input-placeholder{color:#ccc}.wg-input-textarea::-moz-placeholder{color:#ccc}.wg-input-textarea::-ms-input-placeholder{color:#ccc}.wg-input-textarea::placeholder{color:#ccc}#wrap-weglot{display:-webkit-box;display:-ms-flexbox;display:flex;margin-left:15px}#wrap-weglot .weglot-nokkey:before{content:'\274C';display:inline-block;color:red;padding:0 6px 0 0;font-size:15px;padding:0 10px}#wrap-weglot .weglot-okkey:before{content:'\2713';display:inline-block;color:green;padding:0 10px;font-size:20px;font-weight:bold;padding:0 10px}#wrap-weglot .wrap{-webkit-box-flex:4;-ms-flex:4;flex:4}#wrap-weglot .weglot-infobox{-webkit-box-flex:2;-ms-flex:2;flex:2;-ms-flex-item-align:start;align-self:start;margin:10px 20px 0 2px;background-color:#fff;background-color:white;border:1px solid #e0e0e0;border-radius:12px;overflow:hidden}#wrap-weglot .weglot-infobox h3{color:#18164c;background-color:white;padding:30px 30px 0 30px;margin:0px;font-size:23px;line-height:1.3}#wrap-weglot .weglot-infobox div{padding:15px 30px 30px 30px}#wrap-weglot .weglot-infobox .weglot-editbtn{-webkit-box-shadow:0 2px 4px 0 rgba(1,1,2,0.05);box-shadow:0 2px 4px 0 rgba(1,1,2,0.05);background-color:#3d46fb;color:#fff;height:45px;border-radius:23px;line-height:45px;font-size:14px !important;text-decoration:none;padding:0px 30px;display:inline-block;-webkit-transition:all .2s ease-in;-o-transition:all .2s ease-in;transition:all .2s ease-in}#wrap-weglot .weglot-infobox .weglot-editbtn:hover{color:white;background:#252ed7}#wrap-weglot .weglot-infobox .weglot-editbtn p{font-size:15px}#wrap-weglot .selectize-control,#wrap-weglot input[type="text"],#wrap-weglot .wg-input-textarea,#wrap-weglot .weglot-select-original{width:100%;max-width:300px}#wrap-weglot #submit{height:50px;padding:0 30px !important;font-size:16px}#wrap-weglot .description{display:inline-block}#wrap-weglot .wg-tooltip{position:absolute;display:none}#wrap-weglot #mainform{margin-bottom:50px}#wrap-weglot .arrow-up{width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-bottom:10px solid #24292d;position:absolute;top:-10px;left:36px}#wrap-weglot .question-icon{font-size:17px}#wrap-weglot .form-table{margin-bottom:50px}#wrap-weglot .country-selector{z-index:1 !important}.weglot-info{position:relative;color:#3741cc;font-weight:bold}.weglot-info:hover .wg-tooltip{line-height:1.4;position:absolute;top:27px;display:block !important;background-color:#24292d;width:160px;padding:10px;color:white;font-weight:normal;border:1px solid #e0e0e0;font-size:12px}.weglot-box-overlay{position:fixed;top:0;left:0;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;height:100%;background-color:rgba(0,0,0,0.85);z-index:9999;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.weglot-box-overlay .weglot-box{background-color:#fff;padding:25px;text-align:center;-webkit-box-shadow:0px 0px 5px 0px rgba(0,0,0,0.75);box-shadow:0px 0px 5px 0px rgba(0,0,0,0.75)}.weglot-box-overlay .weglot-box--title{font-size:24px;line-height:1.3}.weglot-box-overlay .weglot-box--text{font-size:18px}.weglot-box-overlay .weglot-box--subtext{font-size:12px;font-style:italic}.weglot-box-overlay .weglot-btn-close{float:right;cursor:pointer}.flag-style-openclose{display:inline-block;font-size:12px;color:#51C7A7;text-decoration:underline;cursor:default;margin-right:20px}.flag-style-openclose:hover{opacity:0.6;cursor:pointer}.flag-style-wrapper{padding:15px 0px}.flag-style-wrapper p{font-size:12px !important}.flag-style-wrapper select{padding:3px !important;font-size:12px}#private_mode+p+div{display:none}#private_mode:checked+p+div{display:block}#private-mode-detail{margin-top:20px}#private-mode-detail .private-mode-detail-lang{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-top:15px;margin-bottom:15px;margin-left:15px}#private-mode-detail .private-mode-detail-lang input,#private-mode-detail .private-mode-detail-lang label{line-height:1.3}#private-mode-detail .private-mode-detail-lang input{margin-right:15px}
322
  opacity: 0.5;
323
  background-color: #fafafa;
324
  }
325
+ #weglot-url-translate .weglot__choice__language,#wrap-weglot .weglot__choice__language{border-bottom:1px solid #eee;margin:5px 0px}#weglot-url-translate .weglot__choice__language--local,#wrap-weglot .weglot__choice__language--local{border-width:50px;color:#a6a6a6;display:block}#weglot-url-translate .weglot_text_error,#wrap-weglot .weglot_text_error{color:#dc3232}#weglot-url-translate .weglot_reset,#wrap-weglot .weglot_reset{text-decoration:underline;font-style:italic}#weglot-url-translate .weglot_reset:hover,#wrap-weglot .weglot_reset:hover{cursor:pointer}#weglot-url-translate .btn,#wrap-weglot .btn{background:#335ee2;display:inline-block;padding:8px 10px;border-radius:4px;-webkit-transition:0.2s background linear, 0.2s color linear, 0.2s border linear, 0.2s text-shadow linear;-o-transition:0.2s background linear, 0.2s color linear, 0.2s border linear, 0.2s text-shadow linear;transition:0.2s background linear, 0.2s color linear, 0.2s border linear, 0.2s text-shadow linear;outline:0;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;font-weight:700;cursor:pointer;text-align:center;text-decoration:none;-webkit-box-shadow:none;box-shadow:none;white-space:nowrap;color:white;border:1px solid #335ee2}#weglot-url-translate .btn.btn-soft,#wrap-weglot .btn.btn-soft{background-color:#fff;color:#24284c;border-radius:4px;border:1px solid #7e8993;line-height:1.4em}#weglot-url-translate .btn.btn-primary:active,#weglot-url-translate .btn.btn-primary:focus,#weglot-url-translate .btn.btn-primary:hover,#wrap-weglot .btn.btn-primary:active,#wrap-weglot .btn.btn-primary:focus,#wrap-weglot .btn.btn-primary:hover{border-color:#446dea;background-color:#446dea}#weglot-url-translate .js-btn-remove,#wrap-weglot .js-btn-remove{border:none;background-color:#e35b5b;color:#fff;display:inline-block;width:22px;height:22px;border-radius:50%;cursor:pointer;-webkit-transform:translateY(-5%);-ms-transform:translateY(-5%);transform:translateY(-5%);-webkit-transition:opacity 175ms linear;-o-transition:opacity 175ms linear;transition:opacity 175ms linear;outline:0;padding:0;margin:4px 0;vertical-align:middle}#weglot-url-translate .js-btn-remove:hover,#wrap-weglot .js-btn-remove:hover{background-color:#c62d2d}#weglot-url-translate .item-exclude,#wrap-weglot .item-exclude{position:relative;margin-bottom:10px}#weglot-url-translate ::-webkit-input-placeholder,#weglot-url-translate :-moz-placeholder,#weglot-url-translate ::-moz-placeholder,#weglot-url-translate :-ms-input-placeholder,#wrap-weglot ::-webkit-input-placeholder,#wrap-weglot :-moz-placeholder,#wrap-weglot ::-moz-placeholder,#wrap-weglot :-ms-input-placeholder{color:#c0c0c0}#weglot-url-translate .sub-label,#wrap-weglot .sub-label{font-size:13px;font-weight:normal;margin:2px 0 0;color:#444;opacity:0.8}#weglot-url-translate .weglot-select-original,#wrap-weglot .weglot-select-original{height:36px !important;margin:0}#weglot-url-translate .original-select,#weglot-url-translate #type_flags,#wrap-weglot .original-select,#wrap-weglot #type_flags{padding:8px;height:36px !important;width:300px}#weglot-url-translate #type_flags,#wrap-weglot #type_flags{width:150px}#weglot-url-translate .selectize-control.multi .selectize-input,#wrap-weglot .selectize-control.multi .selectize-input{border:1px solid #7e8993;border-radius:4px;-webkit-box-shadow:unset;box-shadow:unset}#weglot-url-translate .selectize-control.multi .selectize-input>div,#wrap-weglot .selectize-control.multi .selectize-input>div{background-color:#eff0ff;border:1px solid #7e8993;border-radius:2px}#weglot-url-translate .selectize-control.multi .selectize-input>div .remove,#wrap-weglot .selectize-control.multi .selectize-input>div .remove{border-left-color:#7e8993}#weglot-url-translate .wg-input-textarea,#wrap-weglot .wg-input-textarea{padding:8px}#weglot-url-translate .wg-input-textarea::-webkit-input-placeholder,#wrap-weglot .wg-input-textarea::-webkit-input-placeholder{color:#c0c0c0}#weglot-url-translate .wg-input-textarea::-moz-placeholder,#wrap-weglot .wg-input-textarea::-moz-placeholder{color:#c0c0c0}#weglot-url-translate .wg-input-textarea::-ms-input-placeholder,#wrap-weglot .wg-input-textarea::-ms-input-placeholder{color:#c0c0c0}#weglot-url-translate .wg-input-textarea::placeholder,#wrap-weglot .wg-input-textarea::placeholder{color:#c0c0c0}#weglot-url-translate .weglot-select.weglot-select-original,#weglot-url-translate input[type="text"],#weglot-url-translate textarea,#weglot-url-translate select,#weglot-url-translate #type_flags,#wrap-weglot .weglot-select.weglot-select-original,#wrap-weglot input[type="text"],#wrap-weglot textarea,#wrap-weglot select,#wrap-weglot #type_flags{padding:0 8px;border-radius:4px;border:1px solid #7e8993}#weglot-url-translate .weglot-select.weglot-select-original:focus,#weglot-url-translate input[type="text"]:focus,#weglot-url-translate textarea:focus,#weglot-url-translate select:focus,#weglot-url-translate #type_flags:focus,#wrap-weglot .weglot-select.weglot-select-original:focus,#wrap-weglot input[type="text"]:focus,#wrap-weglot textarea:focus,#wrap-weglot select:focus,#wrap-weglot #type_flags:focus{border-color:#446dea !important;-webkit-box-shadow:none !important;box-shadow:none !important}#weglot-url-translate .weglot-info,#wrap-weglot .weglot-info{position:relative;color:#3741cc;font-weight:bold}#weglot-url-translate .weglot-info:hover .wg-tooltip,#wrap-weglot .weglot-info:hover .wg-tooltip{line-height:1.4;position:absolute;top:27px;display:block !important;background-color:#24292d;width:160px;padding:10px;color:white;font-weight:normal;border:1px solid #e0e0e0;font-size:12px}#weglot-url-translate .weglot-box-overlay,#wrap-weglot .weglot-box-overlay{position:fixed;top:0;left:0;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;height:100%;background-color:rgba(0,0,0,0.85);z-index:9999;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}#weglot-url-translate .weglot-box-overlay .weglot-box,#wrap-weglot .weglot-box-overlay .weglot-box{background-color:#fff;padding:25px;text-align:center;-webkit-box-shadow:0px 0px 5px 0px rgba(0,0,0,0.75);box-shadow:0px 0px 5px 0px rgba(0,0,0,0.75)}#weglot-url-translate .weglot-box-overlay .weglot-box--title,#wrap-weglot .weglot-box-overlay .weglot-box--title{font-size:24px;line-height:1.3}#weglot-url-translate .weglot-box-overlay .weglot-box--text,#wrap-weglot .weglot-box-overlay .weglot-box--text{font-size:18px}#weglot-url-translate .weglot-box-overlay .weglot-box--subtext,#wrap-weglot .weglot-box-overlay .weglot-box--subtext{font-size:12px;font-style:italic}#weglot-url-translate .weglot-box-overlay .weglot-btn-close,#wrap-weglot .weglot-box-overlay .weglot-btn-close{float:right;cursor:pointer}#weglot-url-translate .flag-style-openclose,#wrap-weglot .flag-style-openclose{display:inline-block;font-size:12px;text-decoration:underline;cursor:default;margin:12px 15px 0 10px;color:#46b450}#weglot-url-translate .flag-style-openclose:hover,#wrap-weglot .flag-style-openclose:hover{color:#399648;cursor:pointer}#weglot-url-translate .flag-style-wrapper,#wrap-weglot .flag-style-wrapper{padding:15px 0px}#weglot-url-translate .flag-style-wrapper p,#wrap-weglot .flag-style-wrapper p{font-size:12px !important}#weglot-url-translate .flag-style-wrapper select,#wrap-weglot .flag-style-wrapper select{font-size:12px;margin:0 2px 6px 0;padding:0 26px 0 8px}#weglot-url-translate #private_mode+p+div,#wrap-weglot #private_mode+p+div{display:none}#weglot-url-translate #private_mode:checked+p+div,#wrap-weglot #private_mode:checked+p+div{display:block}#weglot-url-translate #private-mode-detail,#wrap-weglot #private-mode-detail{margin-top:20px}#weglot-url-translate #private-mode-detail .private-mode-detail-lang,#wrap-weglot #private-mode-detail .private-mode-detail-lang{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:10px;margin-left:25px}#weglot-url-translate #private-mode-detail .private-mode-detail-lang input[type="checkbox"],#wrap-weglot #private-mode-detail .private-mode-detail-lang input[type="checkbox"]{margin-top:-1px}#wrap-weglot{display:-webkit-box;display:-ms-flexbox;display:flex;margin-left:15px}#wrap-weglot .wrap{-webkit-box-flex:4;-ms-flex:4;flex:4}#wrap-weglot input[type="text"]:not(#destination_language-selectized),#wrap-weglot input[type="url"]{padding:0 8px;height:36px}#wrap-weglot select{height:36px;vertical-align:top;border-radius:4px;padding:0 26px 0 8px}#wrap-weglot input[type="checkbox"]{margin-top:-4px}#wrap-weglot .weglot-nokkey:before{content:"\274C";display:inline-block;color:#dc3232;padding:0 6px 0 0;font-size:15px;padding:0 10px}#wrap-weglot .weglot-okkey:before{content:"\2713";display:inline-block;color:#46b450;padding:0 10px;font-size:20px;font-weight:bold;padding:0 10px}#wrap-weglot .weglot-infobox{-webkit-box-flex:2;-ms-flex:2;flex:2;-ms-flex-item-align:start;align-self:start;margin:10px 20px 0 2px;background-color:white;border:1px solid #e0e0e0;border-radius:12px;overflow:hidden}#wrap-weglot .weglot-infobox h3{color:#18164c;background-color:white;padding:30px 30px 0 30px;margin:0px;font-size:23px;line-height:1.3}#wrap-weglot .weglot-infobox div{padding:15px 30px 30px 30px}#wrap-weglot .weglot-infobox .weglot-editbtn{-webkit-box-shadow:0 2px 4px 0 rgba(1,1,2,0.05);box-shadow:0 2px 4px 0 rgba(1,1,2,0.05);background-color:#3d46fb;color:#fff;height:45px;border-radius:23px;line-height:45px;font-size:14px !important;text-decoration:none;padding:0 30px;display:inline-block;-webkit-transition:all 0.2s ease-in;-o-transition:all 0.2s ease-in;transition:all 0.2s ease-in}#wrap-weglot .weglot-infobox .weglot-editbtn:hover{color:white;background:#252ed7}#wrap-weglot input[type="text"],#wrap-weglot .selectize-control,#wrap-weglot .wg-input-textarea,#wrap-weglot .weglot-select-original{width:100%;max-width:320px}#wrap-weglot #submit{height:50px;padding:0 30px !important;font-size:16px}#wrap-weglot .description{display:inline}#wrap-weglot .wg-tooltip{position:absolute;display:none}#wrap-weglot #mainform{margin-bottom:50px}#wrap-weglot .arrow-up{width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-bottom:10px solid #24292d;position:absolute;top:-10px;left:36px}#wrap-weglot .question-icon{font-size:17px}#wrap-weglot .form-table{margin-bottom:50px}#wrap-weglot .country-selector{z-index:1 !important}#weglot-url-translate .weglot_custom_url{border-bottom:1px solid #ccc;margin-bottom:20px;padding-bottom:10px}#weglot-url-translate .weglot_custom_url a{margin:5px 0px;display:inline-block}#weglot-url-translate .weglot_custom_url--text_link{margin-bottom:4px}#weglot-url-translate .weglot_custom_url .weglot_custom_url--text_link input[type="text"]{min-height:24px !important;height:24px}#weglot-url-translate .weglot_custom_url .weglot_custom_url--text_link button{margin-top:-2px;font-size:11px;padding:0 8px}#weglot-url-translate .weglot_custom_url .weglot_custom_url--text_link button.button-weglot-lang .dashicons{font-size:14px;line-height:21px;margin-right:-3px;margin-left:-4px}#weglot-url-translate .weglot_custom_url a.weglot_reset{text-decoration:none}#weglot-url-translate .weglot_custom_url a.weglot_reset:link,#weglot-url-translate .weglot_custom_url a.weglot_reset:visited,#weglot-url-translate .weglot_custom_url a.weglot_reset:hover,#weglot-url-translate .weglot_custom_url a.weglot_reset:active{text-decoration:none}
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: translate, multilingual, language, translation, localization
4
  Requires at least: 4.5
5
  Tested up to: 5.3
6
  Requires PHP: 5.4
7
- Stable tag: 3.1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -201,6 +201,16 @@ See changelog for upgrade changes.
201
 
202
  == Changelog ==
203
 
 
 
 
 
 
 
 
 
 
 
204
  = 3.1.3 (29/10/2019) =
205
  * Improve compatibility: Woocommerce with IE 11
206
  * Improve compatibility: Contact Form 7
4
  Requires at least: 4.5
5
  Tested up to: 5.3
6
  Requires PHP: 5.4
7
+ Stable tag: 3.1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
201
 
202
  == Changelog ==
203
 
204
+ = 3.1.4 (12/12/2019) =
205
+ * Update back office style for WordPress 5.3
206
+ * Fix: Flags SRC attribute with AMP
207
+ * Fix: Custom URL feature - Revisions
208
+ * Improve compatibility: WP Optimize
209
+ * Improve compatibility: Cache Enabler
210
+ * Add default exclude block for SecuPress plugin and SQLI protect
211
+ * Add default exclude block for plugin query monitor > 3.3.0
212
+ * Remove the "Not allowed" mechanism.
213
+
214
  = 3.1.3 (29/10/2019) =
215
  * Improve compatibility: Woocommerce with IE 11
216
  * Improve compatibility: Contact Form 7
src/actions/admin/class-metabox-url-translate-weglot.php CHANGED
@@ -33,7 +33,7 @@ class Metabox_Url_Translate_Weglot implements Hooks_Interface_Weglot {
33
  */
34
  public function hooks() {
35
  add_action( 'add_meta_boxes', [ $this, 'add_meta_boxes_url_translate' ] );
36
- add_action( 'save_post', [ $this, 'save_post_meta_boxes_url_translate' ] );
37
  add_action( 'wp_ajax_weglot_post_name', [ $this, 'weglot_post_name' ] );
38
  add_action( 'wp_ajax_weglot_reset_custom_url', [ $this, 'weglot_reset_custom_url' ] );
39
 
@@ -246,7 +246,7 @@ class Metabox_Url_Translate_Weglot implements Hooks_Interface_Weglot {
246
  * @return array
247
  */
248
  public function weglot_wp_insert_post_data( $data, $postarr ) {
249
- $post = get_post( $postarr['ID'] );
250
  if ( $post ) {
251
  $this->old_post_name = $post->post_name;
252
  $this->new_post_name = $data['post_name'];
@@ -260,7 +260,7 @@ class Metabox_Url_Translate_Weglot implements Hooks_Interface_Weglot {
260
  * @param mixed $post_id
261
  * @return void
262
  */
263
- public function save_post_meta_boxes_url_translate( $post_id ) {
264
 
265
  // Add nonce for security and authentication.
266
  $post_name_weglot = isset( $_POST[ Helper_Post_Meta_Weglot::POST_NAME_WEGLOT ] ) ? $_POST[ Helper_Post_Meta_Weglot::POST_NAME_WEGLOT ] : []; //phpcs:ignore
@@ -280,7 +280,7 @@ class Metabox_Url_Translate_Weglot implements Hooks_Interface_Weglot {
280
  }
281
 
282
  // Check if not a revision.
283
- if ( wp_is_post_revision( $post_id ) ) {
284
  return;
285
  }
286
 
33
  */
34
  public function hooks() {
35
  add_action( 'add_meta_boxes', [ $this, 'add_meta_boxes_url_translate' ] );
36
+ add_action( 'save_post', [ $this, 'save_post_meta_boxes_url_translate' ], 10, 3 );
37
  add_action( 'wp_ajax_weglot_post_name', [ $this, 'weglot_post_name' ] );
38
  add_action( 'wp_ajax_weglot_reset_custom_url', [ $this, 'weglot_reset_custom_url' ] );
39
 
246
  * @return array
247
  */
248
  public function weglot_wp_insert_post_data( $data, $postarr ) {
249
+ $post = get_post( $postarr['ID'] );
250
  if ( $post ) {
251
  $this->old_post_name = $post->post_name;
252
  $this->new_post_name = $data['post_name'];
260
  * @param mixed $post_id
261
  * @return void
262
  */
263
+ public function save_post_meta_boxes_url_translate( $post_id, $post, $update ) {
264
 
265
  // Add nonce for security and authentication.
266
  $post_name_weglot = isset( $_POST[ Helper_Post_Meta_Weglot::POST_NAME_WEGLOT ] ) ? $_POST[ Helper_Post_Meta_Weglot::POST_NAME_WEGLOT ] : []; //phpcs:ignore
280
  }
281
 
282
  // Check if not a revision.
283
+ if ( wp_is_post_revision( $post_id ) || $update ) {
284
  return;
285
  }
286
 
src/services/class-button-service-weglot.php CHANGED
@@ -115,7 +115,7 @@ class Button_Service_Weglot {
115
  $name = $this->get_name_with_language_entry( $current_language_entry );
116
 
117
  $uniq_id = 'wg' . uniqid( strtotime( 'now' ) ) . rand( 1, 1000 );
118
- $button_html .= sprintf( '<input id="%s" class="weglot_choice" type="checkbox" name="menu"/><label for="%s" class="wgcurrent wg-li weglot-lang weglot-language %s" data-code-language="%s"><span>%s</span></label>', $uniq_id, $uniq_id, $flag_class . $current_language, $current_language_entry->getIso639(), $name );
119
 
120
  $button_html .= '<ul>';
121
 
@@ -135,8 +135,8 @@ class Button_Service_Weglot {
135
 
136
  $button_html .= sprintf(
137
  '<a data-wg-notranslate href="%s">%s</a>',
138
- $link_button,
139
- $name
140
  );
141
 
142
  $button_html .= '</li>';
115
  $name = $this->get_name_with_language_entry( $current_language_entry );
116
 
117
  $uniq_id = 'wg' . uniqid( strtotime( 'now' ) ) . rand( 1, 1000 );
118
+ $button_html .= sprintf( '<input id="%s" class="weglot_choice" type="checkbox" name="menu"/><label for="%s" class="wgcurrent wg-li weglot-lang weglot-language %s" data-code-language="%s"><span>%s</span></label>', esc_attr($uniq_id), esc_attr($uniq_id), esc_attr($flag_class . $current_language), esc_attr($current_language_entry->getIso639()), esc_html($name) );
119
 
120
  $button_html .= '<ul>';
121
 
135
 
136
  $button_html .= sprintf(
137
  '<a data-wg-notranslate href="%s">%s</a>',
138
+ esc_url($link_button),
139
+ esc_html($name)
140
  );
141
 
142
  $button_html .= '</li>';
src/services/class-href-lang-service-weglot.php CHANGED
@@ -38,7 +38,7 @@ class Href_Lang_Service_Weglot {
38
  }
39
 
40
  $url = $this->custom_url_services->get_link( $language, false );
41
- $render .= '<link rel="alternate" href="' . $url . '" hreflang="' . $language . '"/>' . "\n";
42
  }
43
  } catch ( \Exception $e ) {
44
  $render = $this->request_url_services->get_weglot_url()->generateHrefLangsTags();
38
  }
39
 
40
  $url = $this->custom_url_services->get_link( $language, false );
41
+ $render .= '<link rel="alternate" href="' . esc_url($url) . '" hreflang="' . $language . '"/>' . "\n";
42
  }
43
  } catch ( \Exception $e ) {
44
  $render = $this->request_url_services->get_weglot_url()->generateHrefLangsTags();
src/services/class-option-service-weglot.php CHANGED
@@ -382,18 +382,34 @@ class Option_Service_Weglot {
382
  */
383
  public function get_exclude_blocks() {
384
  $exclude_blocks = $this->get_option( 'exclude_blocks' );
 
 
385
  $exclude_blocks[] = '#wpadminbar';
386
- $exclude_blocks[] = '#query-monitor';
 
387
  $exclude_blocks[] = '.menu-item-weglot';
388
  $exclude_blocks[] = '.menu-item-weglot a';
389
- $exclude_blocks[] = '.mini-cart-counter';
 
390
  $exclude_blocks[] = '.material-icons';
 
 
391
  $exclude_blocks[] = '.fas';
392
  $exclude_blocks[] = '.far';
393
  $exclude_blocks[] = '.fad';
 
 
 
 
 
 
 
394
  $exclude_blocks[] = '.amount'; //Added to prevent prices to pass
395
  $exclude_blocks[] = 'address';
396
 
 
 
 
397
  return apply_filters( 'weglot_exclude_blocks', $exclude_blocks );
398
  }
399
 
382
  */
383
  public function get_exclude_blocks() {
384
  $exclude_blocks = $this->get_option( 'exclude_blocks' );
385
+
386
+ // WordPress
387
  $exclude_blocks[] = '#wpadminbar';
388
+
389
+ // Weglot Switcher
390
  $exclude_blocks[] = '.menu-item-weglot';
391
  $exclude_blocks[] = '.menu-item-weglot a';
392
+
393
+ // Material Icons
394
  $exclude_blocks[] = '.material-icons';
395
+
396
+ // Font Awesome
397
  $exclude_blocks[] = '.fas';
398
  $exclude_blocks[] = '.far';
399
  $exclude_blocks[] = '.fad';
400
+
401
+ // Plugin Query Monitor
402
+ $exclude_blocks[] = '#query-monitor';
403
+ $exclude_blocks[] = '#query-monitor-main';
404
+
405
+ // Plugin Woocommerce
406
+ $exclude_blocks[] = '.mini-cart-counter';
407
  $exclude_blocks[] = '.amount'; //Added to prevent prices to pass
408
  $exclude_blocks[] = 'address';
409
 
410
+ // Plugin SecuPress
411
+ $exclude_blocks[] = '#secupress-donttranslate';
412
+
413
  return apply_filters( 'weglot_exclude_blocks', $exclude_blocks );
414
  }
415
 
src/services/class-regex-checkers-service-weglot.php CHANGED
@@ -35,7 +35,7 @@ class Regex_Checkers_Service_Weglot {
35
 
36
  $other_words = apply_filters( 'weglot_words_translate', [] );
37
  foreach ($other_words as $other_word) {
38
- array_push($checkers, new RegexChecker( '#\b' . $other_word . '\b#' , SourceType::SOURCE_TEXT , 0));
39
  }
40
 
41
 
35
 
36
  $other_words = apply_filters( 'weglot_words_translate', [] );
37
  foreach ($other_words as $other_word) {
38
+ array_push($checkers, new RegexChecker( '#\b' . $other_word . '\b#u' , SourceType::SOURCE_TEXT , 0));
39
  }
40
 
41
 
src/services/class-translate-service-weglot.php CHANGED
@@ -21,12 +21,12 @@ class Translate_Service_Weglot {
21
  * @since 2.3.0
22
  */
23
  public function __construct() {
24
- $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
25
- $this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
26
- $this->replace_url_services = weglot_get_service( 'Replace_Url_Service_Weglot' );
27
- $this->replace_link_services = weglot_get_service( 'Replace_Link_Service_Weglot' );
28
- $this->parser_services = weglot_get_service( 'Parser_Service_Weglot' );
29
- $this->generate_switcher_service = weglot_get_service( 'Generate_Switcher_Service_Weglot' );
30
  }
31
 
32
 
@@ -68,19 +68,9 @@ class Translate_Service_Weglot {
68
  public function weglot_treat_page( $content ) {
69
  $this->set_current_language( $this->request_url_services->get_current_language() ); // Need to reset
70
 
71
- $allowed = $this->option_services->get_option( 'allowed' );
72
  // Choose type translate
73
- $type = ( Helper_Json_Inline_Weglot::is_json( $content ) ) ? 'json' : 'html';
74
- $type = apply_filters( 'weglot_type_treat_page', $type );
75
-
76
- if ( ! $allowed ) {
77
- $content = $this->weglot_render_dom( $content );
78
- if ( 'json' === $type || wp_doing_ajax() ) {
79
- return $content;
80
- }
81
-
82
- return $content . '<!--Not allowed-->';
83
- }
84
 
85
  $active_translation = apply_filters( 'weglot_active_translation', true );
86
 
@@ -94,11 +84,11 @@ class Translate_Service_Weglot {
94
  try {
95
  switch ( $type ) {
96
  case 'json':
97
- $extraKeys = apply_filters( 'weglot_add_json_keys' , array() );
98
- $translated_content = $parser->translate( $content, $this->original_language, $this->current_language, $extraKeys );
99
- $translated_content = json_encode($this->replace_url_services->replace_link_in_json( json_decode($translated_content , true) ));
100
- $translated_content = apply_filters( 'weglot_json_treat_page', $translated_content );
101
- return $translated_content;
102
  case 'html':
103
  $translated_content = $parser->translate( $content, $this->original_language, $this->current_language ); // phpcs:ignore
104
  $translated_content = apply_filters( 'weglot_html_treat_page', $translated_content );
@@ -110,18 +100,19 @@ class Translate_Service_Weglot {
110
  }
111
  } catch ( ApiError $e ) {
112
  if ( 'json' !== $type ) {
113
- define( 'DONOTCACHEPAGE', 1 );
114
- nocache_headers();
 
 
115
  $content .= '<!--Weglot error API : ' . $this->remove_comments( $e->getMessage() ) . '-->';
116
  }
117
- if ( strpos( $e->getMessage(), 'NMC' ) !== false ) {
118
- $this->option_services->set_option_by_key( 'allowed', false );
119
- }
120
  return $content;
121
  } catch ( \Exception $e ) {
122
  if ( 'json' !== $type ) {
123
- define( 'DONOTCACHEPAGE', 1 );
124
- nocache_headers();
 
 
125
  $content .= '<!--Weglot error : ' . $this->remove_comments( $e->getMessage() ) . '-->';
126
  }
127
  return $content;
21
  * @since 2.3.0
22
  */
23
  public function __construct() {
24
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
25
+ $this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
26
+ $this->replace_url_services = weglot_get_service( 'Replace_Url_Service_Weglot' );
27
+ $this->replace_link_services = weglot_get_service( 'Replace_Link_Service_Weglot' );
28
+ $this->parser_services = weglot_get_service( 'Parser_Service_Weglot' );
29
+ $this->generate_switcher_service = weglot_get_service( 'Generate_Switcher_Service_Weglot' );
30
  }
31
 
32
 
68
  public function weglot_treat_page( $content ) {
69
  $this->set_current_language( $this->request_url_services->get_current_language() ); // Need to reset
70
 
 
71
  // Choose type translate
72
+ $type = ( Helper_Json_Inline_Weglot::is_json( $content ) ) ? 'json' : 'html';
73
+ $type = apply_filters( 'weglot_type_treat_page', $type );
 
 
 
 
 
 
 
 
 
74
 
75
  $active_translation = apply_filters( 'weglot_active_translation', true );
76
 
84
  try {
85
  switch ( $type ) {
86
  case 'json':
87
+ $extraKeys = apply_filters( 'weglot_add_json_keys', array() );
88
+ $translated_content = $parser->translate( $content, $this->original_language, $this->current_language, $extraKeys );
89
+ $translated_content = json_encode( $this->replace_url_services->replace_link_in_json( json_decode( $translated_content, true ) ) );
90
+ $translated_content = apply_filters( 'weglot_json_treat_page', $translated_content );
91
+ return $translated_content;
92
  case 'html':
93
  $translated_content = $parser->translate( $content, $this->original_language, $this->current_language ); // phpcs:ignore
94
  $translated_content = apply_filters( 'weglot_html_treat_page', $translated_content );
100
  }
101
  } catch ( ApiError $e ) {
102
  if ( 'json' !== $type ) {
103
+ if ( ! defined( 'DONOTCACHEPAGE' ) ) {
104
+ define( 'DONOTCACHEPAGE', 1 );
105
+ }
106
+ nocache_headers();
107
  $content .= '<!--Weglot error API : ' . $this->remove_comments( $e->getMessage() ) . '-->';
108
  }
 
 
 
109
  return $content;
110
  } catch ( \Exception $e ) {
111
  if ( 'json' !== $type ) {
112
+ if ( ! defined( 'DONOTCACHEPAGE' ) ) {
113
+ define( 'DONOTCACHEPAGE', 1 );
114
+ }
115
+ nocache_headers();
116
  $content .= '<!--Weglot error : ' . $this->remove_comments( $e->getMessage() ) . '-->';
117
  }
118
  return $content;
src/third/amp/class-amp-enqueue-weglot.php CHANGED
@@ -42,7 +42,8 @@ class Amp_Enqueue_Weglot implements Hooks_Interface_Weglot {
42
  * @return void
43
  */
44
  public function weglot_amp_post_template_css() {
45
- echo file_get_contents( WEGLOT_DIR_DIST . '/css/front-amp-css.css' ); //phpcs:ignore
46
- echo $this->option_services->get_flag_css(); //phpcs:ignore
 
47
  }
48
  }
42
  * @return void
43
  */
44
  public function weglot_amp_post_template_css() {
45
+ $css = file_get_contents( WEGLOT_DIR_DIST . '/css/front-amp-css.css' ); //phpcs:ignore
46
+ $css = str_replace( '../images/', plugins_url( WEGLOT_NAME ) . '/dist/images/', $css );
47
+ echo $css . $this->option_services->get_flag_css(); //phpcs:ignore
48
  }
49
  }
src/third/cacheenabler/class-cache-enabler-active.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Third\CacheEnabler;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+
10
+ use WeglotWP\Models\Third_Active_Interface_Weglot;
11
+
12
+
13
+ /**
14
+ * Cache_Enabler_Active
15
+ *
16
+ * @since 3.1.4
17
+ */
18
+ class Cache_Enabler_Active implements Third_Active_Interface_Weglot {
19
+
20
+ /**
21
+ * @since 3.1.4
22
+ * @return boolean
23
+ *
24
+ * Check if Cache Enabler plugin is active
25
+ * https://fr.wordpress.org/plugins/cache-enabler/
26
+ */
27
+ public function is_active() {
28
+ if ( ! function_exists( 'is_plugin_active' ) ) {
29
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
30
+ }
31
+
32
+ $active = true;
33
+
34
+ if ( ! is_plugin_active( 'cache-enabler/cache-enabler.php' ) ) {
35
+ $active = false;
36
+ }
37
+
38
+ return apply_filters( 'weglot_cache_enabler_is_active', $active );
39
+ }
40
+ }
src/third/cacheenabler/class-cache-enabler-cache.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Third\CacheEnabler;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Helpers\Helper_Is_Admin;
10
+ use WeglotWP\Models\Hooks_Interface_Weglot;
11
+
12
+ /**
13
+ * Cache_Enabler_Cache
14
+ *
15
+ * @since 3.1.4
16
+ */
17
+ class Cache_Enabler_Cache implements Hooks_Interface_Weglot {
18
+
19
+ /**
20
+ * @since 3.1.4
21
+ * @return void
22
+ */
23
+ public function __construct() {
24
+ $this->cache_enabler_active = weglot_get_service( 'Cache_Enabler_Active' );
25
+ $this->generate_switcher_service = weglot_get_service( 'Generate_Switcher_Service_Weglot' );
26
+ }
27
+
28
+ /**
29
+ * @since 3.1.4
30
+ * @see Hooks_Interface_Weglot
31
+ * @return void
32
+ */
33
+ public function hooks() {
34
+
35
+ if ( ! $this->cache_enabler_active->is_active() ) {
36
+ return;
37
+ }
38
+
39
+ add_filter( 'bypass_cache', [ $this, 'bypass_cache' ] );
40
+ add_action( 'wp_head', [ $this, 'buffer_start' ] );
41
+ }
42
+
43
+ /**
44
+ * @since 3.1.4
45
+ * @return bool
46
+ */
47
+ public function bypass_cache( $bypass_cache ) {
48
+
49
+ if ( weglot_get_original_language() !== weglot_get_current_language() ) {
50
+ return true;
51
+ }
52
+
53
+ return $bypass_cache;
54
+ }
55
+
56
+ /**
57
+ * @since 3.1.4
58
+ * @return void
59
+ */
60
+ public function buffer_start() {
61
+ ob_start( [ $this, 'add_default_switcher' ] );
62
+ }
63
+
64
+ /**
65
+ * @since 3.1.4
66
+ * @return string
67
+ */
68
+ public function add_default_switcher( $dom ) {
69
+ return $this->generate_switcher_service->generate_switcher_from_dom( $dom );
70
+ }
71
+
72
+ }
src/third/maintenance/class-maintenance-active.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Third\Maintenance;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+
10
+ use WeglotWP\Models\Third_Active_Interface_Weglot;
11
+
12
+
13
+ /**
14
+ * Maintenance_Active
15
+ *
16
+ * @since 3.1.1
17
+ */
18
+ class Maintenance_Active implements Third_Active_Interface_Weglot {
19
+
20
+ /**
21
+ * @since 3.1.1
22
+ * @return boolean
23
+ *
24
+ * Check if Maintenance plugin is active
25
+ * https://fr.wordpress.org/plugins/maintenance/
26
+ */
27
+ public function is_active() {
28
+ if ( ! function_exists( 'is_plugin_active' ) ) {
29
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
30
+ }
31
+
32
+ $active = true;
33
+
34
+ if ( ! is_plugin_active( 'maintenance/maintenance.php' ) ) {
35
+ $active = false;
36
+ }
37
+
38
+ return apply_filters( 'weglot_maintenance_is_active', $active );
39
+ }
40
+ }
src/third/maintenance/class-maintenance-tracking.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Third\Maintenance;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Helpers\Helper_Is_Admin;
10
+ use WeglotWP\Models\Hooks_Interface_Weglot;
11
+
12
+ /**
13
+ * Maintenance_Tracking
14
+ *
15
+ * @since 3.1.1
16
+ */
17
+ class Maintenance_Tracking implements Hooks_Interface_Weglot {
18
+
19
+ /**
20
+ * @since 3.1.1
21
+ * @return void
22
+ */
23
+ public function __construct() {
24
+ $this->maintenance_active_services = weglot_get_service( 'Maintenance_Active' );
25
+ }
26
+
27
+ /**
28
+ * @since 3.1.1
29
+ * @see Hooks_Interface_Weglot
30
+ * @return void
31
+ */
32
+ public function hooks() {
33
+ if( ! Helper_Is_Admin::is_wp_admin()) {
34
+ return;
35
+ }
36
+
37
+ if ( ! $this->maintenance_active_services->is_active() ) {
38
+ return;
39
+ }
40
+
41
+ add_filter( 'weglot_tabs_admin_options_available', [ $this, 'weglot_maintenance_tracking' ] );
42
+ }
43
+
44
+
45
+ /**
46
+ * @since 3.1.1
47
+ * @return void
48
+ */
49
+ public function weglot_maintenance_tracking( $options_available ) {
50
+
51
+ if (isset($options_available['api_key_private']['description'])) {
52
+
53
+ $register_link = 'https://dashboard.weglot.com/register-wordpress';
54
+ $register_link_tracked = 'https://weglot.com/ad-track?origin=maintenance&redirectTo=https://dashboard.weglot.com/register-wordpress';
55
+
56
+ $options_available['api_key_private']['description'] = \str_replace( $register_link, $register_link_tracked, $options_available['api_key_private']['description'] );
57
+ }
58
+
59
+ return $options_available;
60
+ }
61
+
62
+ }
src/third/underconstructionpage/class-ucp-active.php CHANGED
@@ -20,6 +20,9 @@ class Ucp_Active implements Third_Active_Interface_Weglot {
20
  /**
21
  * @since 3.1.1
22
  * @return boolean
 
 
 
23
  */
24
  public function is_active() {
25
  if ( ! function_exists( 'is_plugin_active' ) ) {
20
  /**
21
  * @since 3.1.1
22
  * @return boolean
23
+ *
24
+ * Check if under-construction-page plugin is active
25
+ * https://fr.wordpress.org/plugins/under-construction-page/
26
  */
27
  public function is_active() {
28
  if ( ! function_exists( 'is_plugin_active' ) ) {
src/third/wpoptimize/class-wp-optimize-active.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Third\WpOptimize;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+
10
+ use WeglotWP\Models\Third_Active_Interface_Weglot;
11
+
12
+
13
+ /**
14
+ * Wp_Optimize_Active
15
+ *
16
+ * @since 3.1.4
17
+ */
18
+ class Wp_Optimize_Active implements Third_Active_Interface_Weglot {
19
+
20
+ /**
21
+ * @since 3.1.4
22
+ * @return boolean
23
+ *
24
+ * Check if WP Optimize plugin is active
25
+ * https://fr.wordpress.org/plugins/wp-optimize/
26
+ */
27
+ public function is_active() {
28
+ if ( ! function_exists( 'is_plugin_active' ) ) {
29
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
30
+ }
31
+
32
+ $active = true;
33
+
34
+ if ( ! is_plugin_active( 'wp-optimize/wp-optimize.php' ) ) {
35
+ $active = false;
36
+ }
37
+
38
+ return apply_filters( 'weglot_wp_optimize_is_active', $active );
39
+ }
40
+ }
src/third/wpoptimize/class-wp-optimize-cache.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Third\WpOptimize;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Helpers\Helper_Is_Admin;
10
+ use WeglotWP\Models\Hooks_Interface_Weglot;
11
+
12
+ /**
13
+ * Wp_Optimize_Cache
14
+ *
15
+ * @since 3.1.4
16
+ */
17
+ class Wp_Optimize_Cache implements Hooks_Interface_Weglot {
18
+
19
+ /**
20
+ * @since 3.1.4
21
+ * @return void
22
+ */
23
+ public function __construct() {
24
+ $this->wp_optimize_active_services = weglot_get_service( 'Wp_Optimize_Active' );
25
+ }
26
+
27
+ /**
28
+ * @since 3.1.4
29
+ * @see Hooks_Interface_Weglot
30
+ * @return void
31
+ */
32
+ public function hooks() {
33
+
34
+ if ( ! $this->wp_optimize_active_services->is_active() ) {
35
+ return;
36
+ }
37
+
38
+ add_filter( 'wpo_can_cache_page', [ $this, 'weglot_wpo_can_cache_page' ] );
39
+ }
40
+
41
+
42
+ /**
43
+ * @since 3.1.4
44
+ * @return bool
45
+ */
46
+ public function weglot_wpo_can_cache_page( $can_cache_page ) {
47
+
48
+ if ( weglot_get_original_language() !== weglot_get_current_language() ) {
49
+ return false;
50
+ }
51
+
52
+ return $can_cache_page;
53
+ }
54
+
55
+ }
templates/admin/metaboxes/url-translate.php CHANGED
@@ -51,13 +51,13 @@ else{
51
  <?php echo esc_url( home_url() ); ?>/<?php echo esc_attr( $code ); ?>/<?php echo esc_attr( $display_link ); ?><span id="text-edit-<?php echo esc_attr( $code ); ?>"><?php echo esc_attr( $post_name_weglot ); ?></span>
52
  <input type="text" id="lang-<?php echo esc_attr( $code ); ?>" name="post_name_weglot[<?php echo esc_attr( $code ); ?>]" value="<?php echo esc_attr( $post_name_input ); ?>" style="display:none;"/>
53
 
54
- <button type="button" class="button button-small button-weglot-lang" data-lang="<?php echo esc_attr( $code ); ?>" aria-label="Edit permalink weglot"><?php esc_html_e( 'Edit', 'weglot' ); ?></button>
55
 
56
  <button type="button" class="button button-small button-weglot-lang-submit" data-lang="<?php echo esc_attr( $code ); ?>" style="display:none;"><?php esc_html_e( 'Ok', 'weglot' ); ?></button>
57
  </p>
58
  <p id="weglot_permalink_not_available_<?php echo esc_attr( $code ); ?>" class="weglot_text_error" style="display:none;"><?php esc_html_e( 'The permalink is not available.', 'weglot' ); ?></p>
59
  <a id="weglot_reset_custom_<?php echo esc_attr( $code ); ?>" data-lang="<?php echo esc_attr( $code ); ?>" data-id="<?php echo esc_attr( $post->ID ); ?>" href="<?php echo $post_name_weglot ; ?>" class="weglot_reset">
60
- <?php esc_html_e( 'Reset custom url', 'weglot' ); ?>
61
  </a>
62
  </div>
63
 
51
  <?php echo esc_url( home_url() ); ?>/<?php echo esc_attr( $code ); ?>/<?php echo esc_attr( $display_link ); ?><span id="text-edit-<?php echo esc_attr( $code ); ?>"><?php echo esc_attr( $post_name_weglot ); ?></span>
52
  <input type="text" id="lang-<?php echo esc_attr( $code ); ?>" name="post_name_weglot[<?php echo esc_attr( $code ); ?>]" value="<?php echo esc_attr( $post_name_input ); ?>" style="display:none;"/>
53
 
54
+ <button type="button" class="button button-small button-weglot-lang" data-lang="<?php echo esc_attr( $code ); ?>" aria-label="Edit permalink weglot"><span class="dashicons dashicons-edit"></span> <?php esc_html_e( 'Edit', 'weglot' ); ?></button>
55
 
56
  <button type="button" class="button button-small button-weglot-lang-submit" data-lang="<?php echo esc_attr( $code ); ?>" style="display:none;"><?php esc_html_e( 'Ok', 'weglot' ); ?></button>
57
  </p>
58
  <p id="weglot_permalink_not_available_<?php echo esc_attr( $code ); ?>" class="weglot_text_error" style="display:none;"><?php esc_html_e( 'The permalink is not available.', 'weglot' ); ?></p>
59
  <a id="weglot_reset_custom_<?php echo esc_attr( $code ); ?>" data-lang="<?php echo esc_attr( $code ); ?>" data-id="<?php echo esc_attr( $post->ID ); ?>" href="<?php echo $post_name_weglot ; ?>" class="weglot_reset">
60
+ <span class="dashicons dashicons-update-alt"></span> <?php esc_html_e( 'Reset custom url', 'weglot' ); ?>
61
  </a>
62
  </div>
63
 
templates/admin/pages/tabs/advanced.php CHANGED
@@ -116,7 +116,7 @@ $languages = array_values( $languages );
116
  endif;
117
  ?>
118
  </div>
119
- <button id="js-add-exclude-url" class="btn btn-soft"><?php esc_html_e( 'Add an URL to exclude', 'weglot' ); ?></button>
120
  </td>
121
  </tr>
122
  <tr valign="top">
@@ -148,7 +148,7 @@ $languages = array_values( $languages );
148
  endif;
149
  ?>
150
  </div>
151
- <button id="js-add-exclude-block" class="btn btn-soft"><?php esc_html_e( 'Add a block to exclude', 'weglot' ); ?></button>
152
  </td>
153
  </tr>
154
  </tbody>
116
  endif;
117
  ?>
118
  </div>
119
+ <button id="js-add-exclude-url" class="btn btn-soft"><span class="dashicons dashicons-plus-alt"></span> <?php esc_html_e( 'Add an URL to exclude', 'weglot' ); ?></button>
120
  </td>
121
  </tr>
122
  <tr valign="top">
148
  endif;
149
  ?>
150
  </div>
151
+ <button id="js-add-exclude-block" class="btn btn-soft"><span class="dashicons dashicons-plus-alt"></span> <?php esc_html_e( 'Add a block to exclude', 'weglot' ); ?></button>
152
  </td>
153
  </tr>
154
  </tbody>
templates/admin/pages/tabs/custom-urls.php CHANGED
@@ -37,15 +37,12 @@ use Weglot\WeglotContext;
37
  <div style="flex:5;">
38
  <input style="max-width:100%;" type="text" value="<?php echo $key; ?>" data-key="<?php echo $keyGenerate; ?>" class="custom-url custom-<?php echo $keyGenerate; ?>" data-lang="<?php echo $lang; ?>" />
39
  </div>
40
-
41
- <div style="align-self:flex-end; flex:1">
42
  <button class="js-btn-remove" data-key="<?php echo $keyGenerate; ?>">
43
  <span class="dashicons dashicons-minus"></span>
44
  </button>
45
  </div>
46
-
47
  </div>
48
-
49
  <?php
50
  } ?>
51
 
37
  <div style="flex:5;">
38
  <input style="max-width:100%;" type="text" value="<?php echo $key; ?>" data-key="<?php echo $keyGenerate; ?>" class="custom-url custom-<?php echo $keyGenerate; ?>" data-lang="<?php echo $lang; ?>" />
39
  </div>
40
+ <div style="align-self:flex-end; flex:1; text-align: center; height: 32px;">
 
41
  <button class="js-btn-remove" data-key="<?php echo $keyGenerate; ?>">
42
  <span class="dashicons dashicons-minus"></span>
43
  </button>
44
  </div>
 
45
  </div>
 
46
  <?php
47
  } ?>
48
 
templates/admin/pages/tabs/status.php CHANGED
@@ -132,7 +132,21 @@ $options = weglot_get_options();
132
  </tr>
133
  <tr>
134
  <td><?php esc_html_e( 'Exclude URLs', 'weglot' ); ?></td>
135
- <td><?php echo esc_attr( implode( $options[ 'exclude_urls' ], ' - ' ) ); ?></td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  </tr>
137
  <tr>
138
  <td><?php esc_html_e( 'Exclude Blocks', 'weglot' ); ?></td>
@@ -142,7 +156,7 @@ $options = weglot_get_options();
142
  </table>
143
  <br />
144
  <div class="widefat">
145
- <h2><?php esc_html_e( 'Custom URLS', 'weglot'); ?></h2>
146
- <?php var_export($options['custom_urls']); ?>
147
  </div>
148
  </div>
132
  </tr>
133
  <tr>
134
  <td><?php esc_html_e( 'Exclude URLs', 'weglot' ); ?></td>
135
+ <td>
136
+ <?php if ( ! empty($options[ 'exclude_urls' ] ) ):
137
+ foreach ( $options[ 'exclude_urls' ] as $type => $exclude_url ) :
138
+ if ( empty( $exclude_url['type'] ) || empty( $exclude_url['value'] ) ) {
139
+ continue;
140
+ }
141
+
142
+ echo esc_html( $exclude_url['type'] . ' - ' . $exclude_url['value'] ) . '<br/>';
143
+
144
+ endforeach;
145
+ else:
146
+ esc_html_e( 'Empty', 'weglot' );
147
+ endif; ?>
148
+ </td>
149
+
150
  </tr>
151
  <tr>
152
  <td><?php esc_html_e( 'Exclude Blocks', 'weglot' ); ?></td>
156
  </table>
157
  <br />
158
  <div class="widefat">
159
+ <h2><?php esc_html_e( 'Custom URLS', 'weglot' ); ?></h2>
160
+ <pre><?php var_export( $options['custom_urls'] ); ?></pre>
161
  </div>
162
  </div>
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitd16e8dc8ccadf07a05dbbfb57b47c482::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit0bd32020b44e0c8a75f811f996d6668d::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitd16e8dc8ccadf07a05dbbfb57b47c482
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitd16e8dc8ccadf07a05dbbfb57b47c482
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitd16e8dc8ccadf07a05dbbfb57b47c482', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitd16e8dc8ccadf07a05dbbfb57b47c482', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInitd16e8dc8ccadf07a05dbbfb57b47c482::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInitd16e8dc8ccadf07a05dbbfb57b47c482
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInitd16e8dc8ccadf07a05dbbfb57b47c482::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequired16e8dc8ccadf07a05dbbfb57b47c482($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
- function composerRequired16e8dc8ccadf07a05dbbfb57b47c482($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit0bd32020b44e0c8a75f811f996d6668d
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit0bd32020b44e0c8a75f811f996d6668d', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit0bd32020b44e0c8a75f811f996d6668d', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit0bd32020b44e0c8a75f811f996d6668d::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInit0bd32020b44e0c8a75f811f996d6668d::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequire0bd32020b44e0c8a75f811f996d6668d($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequire0bd32020b44e0c8a75f811f996d6668d($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitd16e8dc8ccadf07a05dbbfb57b47c482
8
  {
9
  public static $files = array (
10
  '6c200413eed8aeea54dbaf934a31b127' => __DIR__ . '/..' . '/weglot/simplehtmldom/src/simple_html_dom.php',
@@ -57,10 +57,10 @@ class ComposerStaticInitd16e8dc8ccadf07a05dbbfb57b47c482
57
  public static function getInitializer(ClassLoader $loader)
58
  {
59
  return \Closure::bind(function () use ($loader) {
60
- $loader->prefixLengthsPsr4 = ComposerStaticInitd16e8dc8ccadf07a05dbbfb57b47c482::$prefixLengthsPsr4;
61
- $loader->prefixDirsPsr4 = ComposerStaticInitd16e8dc8ccadf07a05dbbfb57b47c482::$prefixDirsPsr4;
62
- $loader->prefixesPsr0 = ComposerStaticInitd16e8dc8ccadf07a05dbbfb57b47c482::$prefixesPsr0;
63
- $loader->classMap = ComposerStaticInitd16e8dc8ccadf07a05dbbfb57b47c482::$classMap;
64
 
65
  }, null, ClassLoader::class);
66
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit0bd32020b44e0c8a75f811f996d6668d
8
  {
9
  public static $files = array (
10
  '6c200413eed8aeea54dbaf934a31b127' => __DIR__ . '/..' . '/weglot/simplehtmldom/src/simple_html_dom.php',
57
  public static function getInitializer(ClassLoader $loader)
58
  {
59
  return \Closure::bind(function () use ($loader) {
60
+ $loader->prefixLengthsPsr4 = ComposerStaticInit0bd32020b44e0c8a75f811f996d6668d::$prefixLengthsPsr4;
61
+ $loader->prefixDirsPsr4 = ComposerStaticInit0bd32020b44e0c8a75f811f996d6668d::$prefixDirsPsr4;
62
+ $loader->prefixesPsr0 = ComposerStaticInit0bd32020b44e0c8a75f811f996d6668d::$prefixesPsr0;
63
+ $loader->classMap = ComposerStaticInit0bd32020b44e0c8a75f811f996d6668d::$classMap;
64
 
65
  }, null, ClassLoader::class);
66
  }
vendor/composer/installed.json CHANGED
@@ -171,17 +171,17 @@
171
  },
172
  {
173
  "name": "weglot/weglot-php",
174
- "version": "1.0.0",
175
- "version_normalized": "1.0.0.0",
176
  "source": {
177
  "type": "git",
178
  "url": "https://github.com/weglot/weglot-php.git",
179
- "reference": "ce8909398d3754bcef12036d5aaf4adc3f40d475"
180
  },
181
  "dist": {
182
  "type": "zip",
183
- "url": "https://api.github.com/repos/weglot/weglot-php/zipball/ce8909398d3754bcef12036d5aaf4adc3f40d475",
184
- "reference": "ce8909398d3754bcef12036d5aaf4adc3f40d475",
185
  "shasum": ""
186
  },
187
  "require": {
@@ -194,7 +194,7 @@
194
  "codeception/codeception": "^2.4",
195
  "vlucas/phpdotenv": "^2.4"
196
  },
197
- "time": "2019-09-16T13:55:47+00:00",
198
  "type": "library",
199
  "installation-source": "dist",
200
  "autoload": {
171
  },
172
  {
173
  "name": "weglot/weglot-php",
174
+ "version": "1.0.2",
175
+ "version_normalized": "1.0.2.0",
176
  "source": {
177
  "type": "git",
178
  "url": "https://github.com/weglot/weglot-php.git",
179
+ "reference": "18e643a5178b2cf1b53293b58850793a0b2ab587"
180
  },
181
  "dist": {
182
  "type": "zip",
183
+ "url": "https://api.github.com/repos/weglot/weglot-php/zipball/18e643a5178b2cf1b53293b58850793a0b2ab587",
184
+ "reference": "18e643a5178b2cf1b53293b58850793a0b2ab587",
185
  "shasum": ""
186
  },
187
  "require": {
194
  "codeception/codeception": "^2.4",
195
  "vlucas/phpdotenv": "^2.4"
196
  },
197
+ "time": "2019-12-16T09:50:51+00:00",
198
  "type": "library",
199
  "installation-source": "dist",
200
  "autoload": {
vendor/weglot/weglot-php/CHANGELOG.md CHANGED
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
 
7
  ## [Unreleased]
8
 
 
 
 
 
 
 
 
 
9
  ## [0.5.21] - 2019-03-12
10
  ### Added
11
  - Util Regex for excluded paths
6
 
7
  ## [Unreleased]
8
 
9
+ ## [1.0.2] - 2019-12-16
10
+ ### Changed
11
+ - Fixed formatter on text regex when it contain '#'
12
+
13
+ ## [1.0.1] - 2019-12-03
14
+ ### Changed
15
+ - Fixed formatter on text regex to only take word
16
+
17
  ## [0.5.21] - 2019-03-12
18
  ### Added
19
  - Util Regex for excluded paths
vendor/weglot/weglot-php/src/Parser/Parser.php CHANGED
@@ -478,7 +478,7 @@ class Parser
478
  $source = $tree['dom']->save();
479
  foreach ($tree['regexes'] as $regex) {
480
  $translatedRegex = $this->formatters($regex['source'], $translateEntry, $regex, $index);
481
- $source = str_replace($regex['source'] , $translatedRegex, $source);
482
  }
483
  }
484
  return $source;
478
  $source = $tree['dom']->save();
479
  foreach ($tree['regexes'] as $regex) {
480
  $translatedRegex = $this->formatters($regex['source'], $translateEntry, $regex, $index);
481
+ $source = preg_replace( '#\b' . preg_quote( $regex['source'], '#' ) . '\b#' , $translatedRegex, $source);
482
  }
483
  }
484
  return $source;
vendor/weglot/weglot-php/src/Util/Server.php CHANGED
@@ -41,6 +41,7 @@ class Server
41
  $checkBotGoogle = (Text::contains($userAgent, 'Google') ||
42
  Text::contains($userAgent, 'facebook') ||
43
  Text::contains($userAgent, 'wprocketbot') ||
 
44
  Text::contains($userAgent, 'SemrushBot'));
45
 
46
  if ($userAgent !== null && !$checkBotAgent) {
41
  $checkBotGoogle = (Text::contains($userAgent, 'Google') ||
42
  Text::contains($userAgent, 'facebook') ||
43
  Text::contains($userAgent, 'wprocketbot') ||
44
+ Text::contains($userAgent, 'AhrefsBot') ||
45
  Text::contains($userAgent, 'SemrushBot'));
46
 
47
  if ($userAgent !== null && !$checkBotAgent) {
weglot.php CHANGED
@@ -7,7 +7,7 @@ Author: Weglot Translate team
7
  Author URI: https://weglot.com/
8
  Text Domain: weglot
9
  Domain Path: /languages/
10
- Version: 3.1.3
11
  */
12
 
13
  /**
@@ -22,7 +22,7 @@ if ( ! defined('ABSPATH')) {
22
  define('WEGLOT_NAME', 'Weglot');
23
  define('WEGLOT_SLUG', 'weglot-translate');
24
  define('WEGLOT_OPTION_GROUP', 'group-weglot-translate');
25
- define('WEGLOT_VERSION', '3.1.3');
26
  define('WEGLOT_PHP_MIN', '5.4');
27
  define('WEGLOT_BNAME', plugin_basename(__FILE__));
28
  define('WEGLOT_DIR', __DIR__ );
7
  Author URI: https://weglot.com/
8
  Text Domain: weglot
9
  Domain Path: /languages/
10
+ Version: 3.1.4
11
  */
12
 
13
  /**
22
  define('WEGLOT_NAME', 'Weglot');
23
  define('WEGLOT_SLUG', 'weglot-translate');
24
  define('WEGLOT_OPTION_GROUP', 'group-weglot-translate');
25
+ define('WEGLOT_VERSION', '3.1.4');
26
  define('WEGLOT_PHP_MIN', '5.4');
27
  define('WEGLOT_BNAME', plugin_basename(__FILE__));
28
  define('WEGLOT_DIR', __DIR__ );