Gallery Custom Links - Version 1.2.0

Version Description

  • Add: This was asked to me a lot, so I have adding the settings in order to change the parameters of the plugin easily. It will be much easier to make it faster now.
  • Info: If you like the plugin, your reviews are welcome here :) Thank you!
Download this release

Release Info

Developer TigrouMeow
Plugin Icon 128x128 Gallery Custom Links
Version 1.2.0
Comparing to
See all releases

Code changes from version 1.1.5 to 1.2.0

common/admin.css ADDED
@@ -0,0 +1,405 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* MEOW-TABS */
2
+
3
+ .meow-tabs {
4
+ display: flex;
5
+ flex-wrap: wrap;
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ .meow-tabs * {
10
+ box-sizing: border-box;
11
+ }
12
+
13
+ .meow-tabs .meow-tabs-input {
14
+ position: absolute;
15
+ opacity: 0;
16
+ }
17
+
18
+ .meow-tabs .meow-tabs-label {
19
+ width: auto;
20
+ padding: 4px 12px;
21
+ background: #3c3c3c;
22
+ cursor: pointer;
23
+ font-weight: bold;
24
+ font-size: 13px;
25
+ text-transform: uppercase;
26
+ color: white;
27
+ transition: background 0.1s, color 0.1s;
28
+ }
29
+
30
+ .meow-tabs .inside {
31
+ display: none;
32
+ width: 100%;
33
+ }
34
+
35
+ .meow-tabs .meow-tabs-label:hover {
36
+ background: #36495f;
37
+ }
38
+
39
+ .meow-tabs .meow-tabs-label:active {
40
+ background: #3C82C7;
41
+ }
42
+
43
+ .meow-tabs .meow-tabs-input:focus + .meow-tabs-label {
44
+ box-shadow: inset 0px 0px 0px 3px #2aa1c0;
45
+ z-index: 1;
46
+ }
47
+
48
+ .meow-tabs .meow-tabs-input:checked + .meow-tabs-label {
49
+ background: #3C82C7 !important;
50
+ }
51
+
52
+ .meow-tabs-input:checked + .meow-tabs-label + .inside {
53
+ display: block;
54
+ order: 99;
55
+ }
56
+
57
+ .meow-tabs .inside {
58
+ background: #fff;
59
+ }
60
+
61
+ /* MEOW-BOX */
62
+
63
+ .meow-box {
64
+ box-sizing: border-box;
65
+ border: 1px solid #e5e5e5;
66
+ box-shadow: 2px 2px 1px rgba(0,0,0,.02);
67
+ background: #fff;
68
+ color: #444;
69
+ margin-bottom: 15px;
70
+ font-size: 13px !important;
71
+ border-top-right-radius: 8px;
72
+ }
73
+
74
+ .meow-box input, .meow-box th, .meow-box label, .meow-box select {
75
+ font-size: 13px !important;
76
+ }
77
+
78
+ .meow-box small {
79
+ font-size: 12px !important;
80
+ }
81
+
82
+ .meow-box h3 {
83
+ font-size: 13px;
84
+ padding: 4px 12px;
85
+ margin: 0;
86
+ background: #3c3c3c;
87
+ color: #ffffff;
88
+ text-transform: uppercase;
89
+ border-top-right-radius: 8px;
90
+ /*border-bottom: 1px solid #eee;*/
91
+ }
92
+
93
+ .meow-box h3 .dashicons {
94
+ position: relative;
95
+ top: 0px;
96
+ margin-right: 5px;
97
+ }
98
+
99
+ .meow-box .pro_info {
100
+ padding: 5px;
101
+ margin: 10px -10px 5px -10px;
102
+ font-size: 11px;
103
+ line-height: 13px;
104
+ }
105
+
106
+ .meow-box .pro_info.enabled {
107
+ background: #4482d2;
108
+ border-left: 5px solid #4482d2;
109
+ color: white;
110
+ }
111
+
112
+ .meow-box .pro_info.disabled {
113
+ background: #96555b;
114
+ border-left: 5px solid #632329;
115
+ color: white;
116
+ }
117
+
118
+ .meow-box .pro_info.disabled a {
119
+ background: #96555b;
120
+ color: red;
121
+ text-decoration: none;
122
+ }
123
+
124
+ .meow-box .inside {
125
+ margin: 10px;
126
+ }
127
+
128
+ .meow-box th {
129
+ padding: 10px 10px 10px 0px;
130
+ width: 22%;
131
+ }
132
+
133
+ .meow-box td {
134
+ padding: 10px 10px;
135
+ }
136
+
137
+ .meow-box p.submit, .meow-box div.submit {
138
+ text-align: right;
139
+ margin: 10px -10px -10px -10px;
140
+ padding: 7px 10px 10px 0px !important;
141
+ border-top: 1px solid #eee !important;
142
+ max-width: inherit;
143
+ background: rgba(125, 125, 125, 0.04);
144
+ border-radius: 0px;
145
+ }
146
+
147
+ .meow-box [type="text"], .meow-box select {
148
+ width: 100%;
149
+ }
150
+
151
+ /* CONTROLS INSIDE A COLUMN (LABEL ON THE LEFT, VALUE ON THE RIGHT) */
152
+ .meow-box td [type="text"], .meow-box td [type="checkbox"], .meow-box td select {
153
+ margin-top: -3px;
154
+ }
155
+
156
+ .meow-header-ad {
157
+ float: right;
158
+ }
159
+
160
+ /* BUTTONS */
161
+
162
+ .meow-button-xs {
163
+ font-size: 10px !important;
164
+ height: 20px !important;
165
+ line-height: 18px !important;
166
+ position: relative !important;
167
+ top: 1px !important;
168
+ text-align: center !important
169
+ }
170
+
171
+ /* MODAL */
172
+
173
+ #meow-modal-info-backdrop {
174
+ background: rgba(0, 0, 0, 0.75);
175
+ position: fixed;
176
+ top: 0px;
177
+ bottom: 0px;
178
+ right: 0px;
179
+ left: 0px;
180
+ z-index: 10000;
181
+ }
182
+
183
+ #meow-modal-info {
184
+ background: white;
185
+ box-shadow: 0px 0px 5px black;
186
+ padding: 15px;
187
+ overflow-y: scroll;
188
+ position: fixed;
189
+ z-index: 10000;
190
+ left: 100px;
191
+ right: 100px;
192
+ top: 50px;
193
+ bottom: 50px;
194
+ }
195
+
196
+ #meow-modal-info h3 {
197
+ height: 25px;
198
+ border-bottom: 2px solid #808080;
199
+ }
200
+
201
+ #meow-modal-info td {
202
+ text-align: center;
203
+ font-size: 11px;
204
+ border: 1px solid #D3DCFF;
205
+ padding: 10px 15px;
206
+ background: #EFF8FF;
207
+ }
208
+
209
+ #meow-modal-info .close {
210
+ float: right;
211
+ font-size: 18px;
212
+ font-weight: bold;
213
+ font-family: Verdana;
214
+ cursor: pointer;
215
+ }
216
+
217
+ #meow-modal-info .loading {
218
+ background-color: #F2F2F2;
219
+ text-align: center;
220
+ padding-top: 10px;
221
+ background-size: 32px 32px;
222
+ }
223
+
224
+ #meow-modal-info .meow-sized-image {
225
+ width: 19px;
226
+ height: 19px;
227
+ margin-right: 10px;
228
+ }
229
+
230
+ /* IMAGE SIZES RELATED INFO */
231
+
232
+ .meow-sized-images {
233
+ margin-top: 0px;
234
+ cursor: pointer;
235
+ }
236
+
237
+ .meow-sized-images li, #meow-modal-info .meow-sized-image {
238
+ display: block;
239
+ color: white;
240
+ padding: 5px 0px;
241
+ font-size: 10px;
242
+ text-align: center;
243
+ width: 18px;
244
+ height: 18px;
245
+ line-height: 8px;
246
+ background: black;
247
+ float: left;
248
+ margin-right: 1px;
249
+ box-sizing: border-box;
250
+ margin-bottom: 2px;
251
+ }
252
+
253
+ .meow-sized-images:after {
254
+ clear: both;
255
+ content:""; display:table;
256
+ }
257
+
258
+ .meow-sized-images + span {
259
+ position: relative;
260
+ top: -12px;
261
+ }
262
+
263
+ /* MEOW COLORS */
264
+
265
+ .meow-bk-blue {
266
+ background: #3C82C7 !important;
267
+ color: white;
268
+ }
269
+
270
+ .meow-bk-orange {
271
+ background: #f1900e !important;
272
+ color: white;
273
+ }
274
+
275
+ .meow-bk-red {
276
+ background: #c53a47 !important;
277
+ color: white;
278
+ }
279
+
280
+ .meow-bk-gray {
281
+ background: gray !important;
282
+ color: white;
283
+ }
284
+
285
+ .meow-bk-green {
286
+ background: #2b9463 !important;
287
+ color: white;
288
+ }
289
+
290
+ .meow-bk-black {
291
+ background: #3c3c3c !important;
292
+ color: white;
293
+ }
294
+
295
+ .meow-bk-purple {
296
+ background: #984c96 !important;
297
+ color: white;
298
+ }
299
+
300
+ /* DASHBOARD */
301
+
302
+ .meow-dashboard {
303
+ box-sizing: border-box;
304
+ }
305
+
306
+ .meow-dashboard .meow-box ul {
307
+ padding: 0px;
308
+ margin: 0px;
309
+ }
310
+
311
+ .meow-featured-plugins .meow-box li {
312
+ min-height: 80px;
313
+ }
314
+
315
+ .meow-dashboard .meow-box li {
316
+ border-bottom: 1px solid #eee;
317
+ margin: 0px;
318
+ padding: 10px;
319
+ box-sizing: border-box;
320
+ }
321
+
322
+ .meow-dashboard .meow-box li img {
323
+ width: 80px;
324
+ height: 80px;
325
+ float: left;
326
+ margin: -10px 10px -10px -10px;
327
+
328
+ }
329
+
330
+ .meow-dashboard .meow-box li:last-child {
331
+ border: none;
332
+ padding-bottom: 0px;
333
+ }
334
+
335
+ .meow-button-xs .dashicons {
336
+ font-size: 18px !important;
337
+ }
338
+
339
+ .meow-button-xs.updating-message:before {
340
+ margin-top: 0px !important;
341
+ }
342
+
343
+ .meow-button-xs.updating-message * {
344
+ display: none;
345
+ }
346
+
347
+ #phpinfo {
348
+ font-size: 11px;
349
+ }
350
+
351
+ #phpinfo .e {
352
+ padding: 5px;
353
+ background: lightgray;
354
+ }
355
+
356
+ #phpinfo .h th {
357
+ padding: 5px;
358
+ color: white;
359
+ background: gray;
360
+ text-align: left;
361
+ font-size: 14px !important;
362
+ }
363
+
364
+ #phpinfo h1 {
365
+ padding: 10px 0px;
366
+ font-weight: bold;
367
+ }
368
+
369
+ #phpinfo h2 {
370
+ padding: 10px 0px;
371
+ font-weight: bold;
372
+ font-size: 20px;
373
+ }
374
+
375
+ #error_log {
376
+ font-size: 12px;
377
+ }
378
+
379
+ /* ROWS AND COLUMNS */
380
+ .meow-col { display: block; float:left; margin: 1% 0 1% 1.6%; }
381
+ .meow-col:first-child { margin-left: 0; }
382
+
383
+ /* GROUPING */
384
+ .meow-row { clear: both; padding: 0px; margin: 0px; }
385
+ .meow-row:before,
386
+ .meow-row:after { content:""; display:table; }
387
+ .meow-row:after { clear:both; }
388
+ .meow-row { zoom:1; /* For IE 6/7 */ }
389
+
390
+ /* GRID OF THREE */
391
+ .meow-span_3_of_3 { width: 100%; }
392
+ .meow-span_2_of_3 { width: 66.1%; }
393
+ .meow-span_1_of_3 { width: 32.2%; }
394
+
395
+ /* GRID OF TWO */
396
+ .meow-span_2_of_2 { width: 100%; }
397
+ .meow-span_1_of_2 { width: 49.2%; }
398
+
399
+ @media only screen and (max-width: 480px) {
400
+ .meow-col { margin: 0 0 0px 0;}
401
+ .meow-span_3_of_3, .meow-span_2_of_3, .meow-span_1_of_3 { width: 100%; }
402
+ .meow-span_2_of_2, .meow-span_1_of_2 { width: 100%; }
403
+ .meow-header-ad { display: none !important; }
404
+ .meow-box [type="text"] { width: 100% !important; }
405
+ }
common/admin.php ADDED
@@ -0,0 +1,476 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( !class_exists( 'MeowApps_Admin' ) ) {
4
+
5
+ class MeowApps_Admin {
6
+
7
+ public static $logo = 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxIiB2aWV3Qm94PSIwIDAgMTY1IDE2NSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8c3R5bGU+CiAgICAuc3Qye2ZpbGw6IzgwNDYyNX0uc3Qze2ZpbGw6I2ZkYTk2MH0KICA8L3N0eWxlPgogIDxwYXRoIGQ9Ik03MiA3YTc2IDc2IDAgMCAxIDg0IDkxQTc1IDc1IDAgMSAxIDcyIDd6IiBmaWxsPSIjNGE2YjhjIi8+CiAgPHBhdGggZD0iTTQ4IDQ4YzIgNSAyIDEwIDUgMTQgNSA4IDEzIDE3IDIyIDIwbDEtMTBjMS0yIDMtMyA1LTNoMTNjMiAwIDQgMSA1IDNsMyA5IDQtMTBjMi0zIDYtMiA5LTJoMTFjMyAyIDMgNSAzIDhsMiAzN2MwIDMtMSA3LTQgOGgtMTJjLTIgMC0zLTItNS00LTEgMS0yIDMtNCAzLTUgMS05IDEtMTMtMS0zIDItNSAyLTkgMnMtOSAxLTEwLTNjLTItNC0xLTggMC0xMi04LTMtMTUtNy0yMi0xMi03LTctMTUtMTQtMjAtMjMtMy00LTUtOC01LTEzIDEtNCAzLTEwIDYtMTMgNC0zIDEyLTIgMTUgMnoiIGZpbGw9IiMxMDEwMTAiLz4KICA8cGF0aCBjbGFzcz0ic3QyIiBkPSJNNDMgNTFsNCAxMS02IDVoLTZjLTMtNS0zLTExIDAtMTYgMi0yIDYtMyA4IDB6Ii8+CiAgPHBhdGggY2xhc3M9InN0MyIgZD0iTTQ3IDYybDMgNmMwIDMgMCA0LTIgNnMtNCAyLTcgMmwtNi05aDZsNi01eiIvPgogIDxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik01MCA2OGw4IDljLTMgMy01IDYtOSA4bC04LTljMyAwIDUgMCA3LTJzMy0zIDItNnoiLz4KICA8cGF0aCBkPSJNODIgNzRoMTJsNSAxOCAzIDExIDgtMjloMTNsMiA0MmgtOGwtMS0yLTEtMzEtMTAgMzItNyAxLTktMzMtMSAyOS0xIDRoLThsMy00MnoiIGZpbGw9IiNmZmYiLz4KICA8cGF0aCBjbGFzcz0ic3QzIiBkPSJNNTggNzdsNSA1Yy0xIDQtMiA4LTcgOGwtNy01YzQtMiA2LTUgOS04eiIvPgogIDxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik02MyA4Mmw5IDUtNiA5LTEwLTZjNSAwIDYtNCA3LTh6Ii8+CiAgPHBhdGggY2xhc3M9InN0MyIgZD0iTTcyIDg3bDMgMS0xIDExLTgtMyA2LTEweiIvPgo8L3N2Zz4K';
8
+
9
+ public static $loaded = false;
10
+ public static $admin_version = "2.0";
11
+
12
+ public $prefix; // prefix used for actions, filters (mfrh)
13
+ public $mainfile; // plugin main file (media-file-renamer.php)
14
+ public $domain; // domain used for translation (media-file-renamer)
15
+
16
+ public function __construct( $prefix, $mainfile, $domain, $disableReview = false ) {
17
+
18
+ // Core Admin (used by all Meow Apps plugins)
19
+ if ( !MeowApps_Admin::$loaded ) {
20
+ if ( is_admin() ) {
21
+ add_action( 'admin_menu', array( $this, 'admin_menu_start' ) );
22
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
23
+ add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
24
+ }
25
+ MeowApps_Admin::$loaded = true;
26
+ }
27
+
28
+ // Variables for this plugin
29
+ $this->prefix = $prefix;
30
+ $this->mainfile = $mainfile;
31
+ $this->domain = $domain;
32
+ $this->is_theme = ( strpos( $this->mainfile, '-theme' ) !== false );
33
+
34
+ // If there is no mainfile, it's either a Pro only Plugin (with no Free version available) or a Theme.
35
+ if ( !$this->is_theme ) {
36
+ register_activation_hook( $mainfile, array( $this, 'show_meowapps_create_rating_date' ) );
37
+ if ( is_admin() ) {
38
+ $license = get_option( $this->prefix . '_license', "" );
39
+ if ( ( !empty( $license ) ) && !file_exists( plugin_dir_path( $this->mainfile ) . 'common/meowapps/admin.php' ) ) {
40
+ add_action( 'admin_notices', array( $this, 'admin_notices_licensed_free' ) );
41
+ }
42
+ if ( !$disableReview ) {
43
+ $rating_date = $this->create_rating_date();
44
+ if ( time() > $rating_date ) {
45
+ add_action( 'admin_notices', array( $this, 'admin_notices_rating' ) );
46
+ }
47
+ }
48
+ }
49
+ }
50
+
51
+ add_filter( 'edd_sl_api_request_verify_ssl', array( $this, 'request_verify_ssl' ), 10, 0 );
52
+ }
53
+
54
+ function request_verify_ssl() {
55
+ return get_option( 'force_sslverify', false );
56
+ }
57
+
58
+ function show_meowapps_create_rating_date() {
59
+ delete_option( 'meowapps_hide_meowapps' );
60
+ $this->create_rating_date();
61
+ }
62
+
63
+ function create_rating_date() {
64
+ $rating_date = get_option( $this->prefix . '_rating_date' );
65
+ if ( empty( $rating_date ) ) {
66
+ $two_months = strtotime( '+2 months' );
67
+ $six_months = strtotime( '+4 months' );
68
+ $rating_date = mt_rand( $two_months, $six_months );
69
+ update_option( $this->prefix . '_rating_date', $rating_date, false );
70
+ }
71
+ return $rating_date;
72
+ }
73
+
74
+ function admin_notices_rating() {
75
+ if ( isset( $_POST[$this->prefix . '_remind_me'] ) ) {
76
+ $two_weeks = strtotime( '+2 weeks' );
77
+ $six_weeks = strtotime( '+6 weeks' );
78
+ $future_date = mt_rand( $two_weeks, $six_weeks );
79
+ update_option( $this->prefix . '_rating_date', $future_date, false );
80
+ return;
81
+ }
82
+ else if ( isset( $_POST[$this->prefix . '_never_remind_me'] ) ) {
83
+ $twenty_years = strtotime( '+5 years' );
84
+ update_option( $this->prefix . '_rating_date', $twenty_years, false );
85
+ return;
86
+ }
87
+ else if ( isset( $_POST[$this->prefix . '_did_it'] ) ) {
88
+ $twenty_years = strtotime( '+10 years' );
89
+ update_option( $this->prefix . '_rating_date', $twenty_years, false );
90
+ return;
91
+ }
92
+ $rating_date = get_option( $this->prefix . '_rating_date' );
93
+ echo '<div class="notice notice-success" data-rating-date="' . date( 'Y-m-d', $rating_date ) . '">';
94
+ echo '<p style="font-size: 100%;">You have been using <b>' . $this->nice_name_from_file( $this->mainfile ) . '</b> for some time now. Thank you! Could you kindly share your opinion with me, along with, maybe, features you would like to see implemented? Then, please <a style="font-weight: bold; color: #b926ff;" target="_blank" href="https://wordpress.org/support/plugin/' . $this->nice_short_url_from_file( $this->mainfile ) . '/reviews/?rate=5#new-post">write a little review</a>. That will also bring me joy and motivation, and I will get back to you :) <u>In the case you already have written a review</u>, please check again. Many reviews got removed from WordPress recently.';
95
+ echo '<p>
96
+ <form method="post" action="" style="float: right;">
97
+ <input type="hidden" name="' . $this->prefix . '_never_remind_me" value="true">
98
+ <input type="submit" name="submit" id="submit" class="button button-red" value="Never remind me!">
99
+ </form>
100
+ <form method="post" action="" style="float: right; margin-right: 10px;">
101
+ <input type="hidden" name="' . $this->prefix . '_remind_me" value="true">
102
+ <input type="submit" name="submit" id="submit" class="button button-primary" value="Remind me in a few weeks...">
103
+ </form>
104
+ <form method="post" action="" style="float: right; margin-right: 10px;">
105
+ <input type="hidden" name="' . $this->prefix . '_did_it" value="true">
106
+ <input type="submit" name="submit" id="submit" class="button button-primary" value="Yes, I did it!">
107
+ </form>
108
+ <div style="clear: both;"></div>
109
+ </p>
110
+ ';
111
+ echo '</div>';
112
+ }
113
+
114
+ function nice_short_url_from_file( $file ) {
115
+ $info = pathinfo( $file );
116
+ if ( !empty( $info ) ) {
117
+ $info['filename'] = str_replace( '-pro', '', $info['filename'] );
118
+ return $info['filename'];
119
+ }
120
+ return "";
121
+ }
122
+
123
+ function nice_name_from_file( $file ) {
124
+ $info = pathinfo( $file );
125
+ if ( !empty( $info ) ) {
126
+ if ( $info['filename'] == 'wplr-sync' ) {
127
+ return "WP/LR Sync";
128
+ }
129
+ $info['filename'] = str_replace( '-', ' ', $info['filename'] );
130
+ $file = ucwords( $info['filename'] );
131
+ }
132
+ return $file;
133
+ }
134
+
135
+ function admin_notices_licensed_free() {
136
+ if ( isset( $_POST[$this->prefix . '_reset_sub'] ) ) {
137
+ delete_option( $this->prefix . '_pro_serial' );
138
+ delete_option( $this->prefix . '_license' );
139
+ return;
140
+ }
141
+ echo '<div class="error">';
142
+ echo '<p>It looks like you are using the free version of the plugin (<b>' . $this->nice_name_from_file( $this->mainfile ) . '</b>) but a license for the Pro version was also found. The Pro version might have been replaced by the Free version during an update (might be caused by a temporarily issue). If it is the case, <b>please download it again</b> from the <a target="_blank" href="https://store.meowapps.com">Meow Store</a>. If you wish to continue using the free version and clear this message, click on this button.';
143
+ echo '<p>
144
+ <form method="post" action="">
145
+ <input type="hidden" name="' . $this->prefix . '_reset_sub" value="true">
146
+ <input type="submit" name="submit" id="submit" class="button" value="Remove the license">
147
+ </form>
148
+ </p>
149
+ ';
150
+ echo '</div>';
151
+ }
152
+
153
+ function display_ads() {
154
+ return !get_option( 'meowapps_hide_ads', false );
155
+ }
156
+
157
+ function display_title( $title = "Meow Apps",
158
+ $author = "By <a style='text-decoration: none;' href='https://meowapps.com' target='_blank'>Jordy Meow</a>" ) {
159
+ if ( !empty( $this->prefix ) && $title !== "Meow Apps" )
160
+ $title = apply_filters( $this->prefix . '_plugin_title', $title );
161
+ if ( $this->display_ads() ) {
162
+ }
163
+ ?>
164
+ <h1 style="line-height: 16px;">
165
+ <img width="42" style="margin-right: 10px; float: left; position: relative; top: -5px;"
166
+ src="<?php echo MeowApps_Admin::$logo ?>"><?php echo $title; ?><br />
167
+ <span style="font-size: 12px"><?php echo $author; ?></span>
168
+ </h1>
169
+ <div style="clear: both;"></div>
170
+ <?php
171
+ }
172
+
173
+ function admin_enqueue_scripts() {
174
+ wp_register_style( 'meowapps-core-css', $this->common_url( 'admin.css' ) );
175
+ wp_enqueue_style( 'meowapps-core-css' );
176
+ }
177
+
178
+ function admin_menu_start() {
179
+ if ( get_option( 'meowapps_hide_meowapps', false ) ) {
180
+ register_setting( 'general', 'meowapps_hide_meowapps' );
181
+ add_settings_field( 'meowapps_hide_ads', 'Meow Apps Menu', array( $this, 'meowapps_hide_dashboard_callback' ), 'general' );
182
+ return;
183
+ }
184
+
185
+ // Creates standard menu if it does NOT exist
186
+ global $submenu;
187
+ if ( !isset( $submenu[ 'meowapps-main-menu' ] ) ) {
188
+ add_menu_page( 'Meow Apps', '<img style="width: 24px; margin-left: -30px; position: absolute; margin-top: -3px;" src="' . MeowApps_Admin::$logo . '" />Meow Apps', 'manage_options', 'meowapps-main-menu',
189
+ array( $this, 'admin_meow_apps' ), '', 82 );
190
+ add_submenu_page( 'meowapps-main-menu', __( 'Dashboard', 'meowapps' ),
191
+ __( 'Dashboard', 'meowapps' ), 'manage_options',
192
+ 'meowapps-main-menu', array( $this, 'admin_meow_apps' ) );
193
+ }
194
+
195
+ add_settings_section( 'meowapps_common_settings', null, null, 'meowapps_common_settings-menu' );
196
+ add_settings_field( 'meowapps_hide_meowapps', "Main Menu",
197
+ array( $this, 'meowapps_hide_dashboard_callback' ),
198
+ 'meowapps_common_settings-menu', 'meowapps_common_settings' );
199
+ add_settings_field( 'meowapps_force_sslverify', "SSL Verify",
200
+ array( $this, 'meowapps_force_sslverify_callback' ),
201
+ 'meowapps_common_settings-menu', 'meowapps_common_settings' );
202
+ // add_settings_field( 'meowapps_hide_ads', "Ads",
203
+ // array( $this, 'meowapps_hide_ads_callback' ),
204
+ // 'meowapps_common_settings-menu', 'meowapps_common_settings' );
205
+ register_setting( 'meowapps_common_settings', 'force_sslverify' );
206
+ register_setting( 'meowapps_common_settings', 'meowapps_hide_meowapps' );
207
+ register_setting( 'meowapps_common_settings', 'meowapps_hide_ads' );
208
+ }
209
+
210
+ function meowapps_hide_ads_callback() {
211
+ $value = get_option( 'meowapps_hide_ads', null );
212
+ $html = '<input type="checkbox" id="meowapps_hide_ads" name="meowapps_hide_ads" value="1" ' .
213
+ checked( 1, get_option( 'meowapps_hide_ads' ), false ) . '/>';
214
+ $html .= __( '<label>Hide</label><br /><small>Doesn\'t display the ads.</small>', 'meowapps' );
215
+ echo $html;
216
+ }
217
+
218
+ function meowapps_hide_dashboard_callback() {
219
+ $value = get_option( 'meowapps_hide_meowapps', null );
220
+ $html = '<input type="checkbox" id="meowapps_hide_meowapps" name="meowapps_hide_meowapps" value="1" ' .
221
+ checked( 1, get_option( 'meowapps_hide_meowapps' ), false ) . '/>';
222
+ $html .= __( '<label>Hide <b>Meow Apps</b> Menu</label><br /><small>Hide Meow Apps menu and all its components, for a cleaner admin. This option will be reset if a new Meow Apps plugin is installed. <b>Once activated, an option will be added in your General settings to display it again.</b></small>', 'meowapps' );
223
+ echo $html;
224
+ }
225
+
226
+ function meowapps_force_sslverify_callback() {
227
+ $value = get_option( 'force_sslverify', null );
228
+ $html = '<input type="checkbox" id="force_sslverify" name="force_sslverify" value="1" ' .
229
+ checked( 1, get_option( 'force_sslverify' ), false ) . '/>';
230
+ $html .= __( '<label>Force</label><br /><small>Updates and licenses checks are usually made without checking SSL certificates and it is actually fine this way. But if you are intransigent when it comes to SSL matters, this option will force it.</small>', 'meowapps' );
231
+ echo $html;
232
+ }
233
+
234
+ function display_serialkey_box( $url = "https://meowapps.com/" ) {
235
+ $html = '<div class="meow-box">';
236
+ $html .= '<h3 class="' . ( $this->is_registered( $this->prefix ) ? 'meow-bk-blue' : 'meow-bk-red' ) . '">Pro Version ' .
237
+ ( $this->is_registered( $this->prefix ) ? '(enabled)' : '(disabled)' ) . '</h3>';
238
+ $html .= '<div class="inside">';
239
+ echo $html;
240
+ $html = apply_filters( $this->prefix . '_meowapps_license_input', ( 'More information about the Pro version here:
241
+ <a target="_blank" href="' . $url . '">' . $url . '</a>. If you actually bought the Pro version already, please remove the current plugin and download the Pro version from your account at the <a target="_blank" href="https://store.meowapps.com/account/downloads/">Meow Apps Store</a>.' ), $url );
242
+ $html .= '</div>';
243
+ $html .= '</div>';
244
+ echo $html;
245
+ }
246
+
247
+ function is_registered() {
248
+ return apply_filters( $this->prefix . '_meowapps_is_registered', false, $this->prefix );
249
+ }
250
+
251
+ function check_install( $plugin ) {
252
+ $pro = false;
253
+
254
+ $pluginpath = trailingslashit( plugin_dir_path( __FILE__ ) ) . '../../' . $plugin . '-pro';
255
+ if ( !file_exists( $pluginpath ) ) {
256
+ $pluginpath = trailingslashit( plugin_dir_path( __FILE__ ) ) . '../../' . $plugin;
257
+ if ( !file_exists( $pluginpath ) ) {
258
+ $url = wp_nonce_url( "update.php?action=install-plugin&plugin=$plugin", "install-plugin_$plugin" );
259
+ return "<a href='$url'><small><span class='' style='float: right;'>install</span></small></a>";
260
+ }
261
+ }
262
+ else {
263
+ $pro = true;
264
+ $plugin = $plugin . "-pro";
265
+ }
266
+
267
+ $plugin_file = $plugin . '/' . $plugin . '.php';
268
+ if ( is_plugin_active( $plugin_file ) ) {
269
+ if ( $plugin == 'wplr-sync' )
270
+ $pro = true;
271
+ if ( $pro )
272
+ return "<small><span style='float: right;'><span class='dashicons dashicons-heart' style='color: rgba(255, 63, 0, 1); font-size: 30px !important; margin-right: 10px;'></span></span></small>";
273
+ else
274
+ return "<small><span style='float: right;'><span class='dashicons dashicons-yes' style='color: #00b4ff; font-size: 30px !important; margin-right: 10px;'></span></span></small>";
275
+ }
276
+ else {
277
+ $url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=' . $plugin_file ),
278
+ 'activate-plugin_' . $plugin_file );
279
+ return '<small><span style="color: black; float: right;">off
280
+ (<a style="color: rgba(30,140,190,1); text-decoration: none;" href="' .
281
+ $url . '">enable</a>)</span></small>';
282
+ }
283
+ }
284
+
285
+ function common_url( $file ) {
286
+ die( "Meow Apps: The function common_url( \$file ) needs to be overriden." );
287
+ // Normally, this should be used:
288
+ // return plugin_dir_url( __FILE__ ) . ( '\/common\/' . $file );
289
+ }
290
+
291
+ function meowapps_logo_url() {
292
+ return $this->common_url( 'img/meowapps.png' );
293
+ }
294
+
295
+ function plugins_loaded() {
296
+ if ( isset( $_GET[ 'tool' ] ) && $_GET[ 'tool' ] == 'error_log' ) {
297
+ $sec = "5";
298
+ header( "Refresh: $sec;" );
299
+ }
300
+ }
301
+
302
+ function admin_meow_apps() {
303
+
304
+ echo '<div class="wrap meow-dashboard">';
305
+ if ( isset( $_GET['tool'] ) && $_GET['tool'] == 'phpinfo' ) {
306
+ echo "<a href=\"javascript:history.go(-1)\">< Go back</a><br /><br />";
307
+ echo '<div id="phpinfo">';
308
+ ob_start();
309
+ phpinfo();
310
+ $pinfo = ob_get_contents();
311
+ ob_end_clean();
312
+ $pinfo = preg_replace( '%^.*<body>(.*)</body>.*$%ms','$1', $pinfo );
313
+ echo $pinfo;
314
+ echo "</div>";
315
+ }
316
+ else if ( isset( $_GET['tool'] ) && $_GET['tool'] == 'error_log' ) {
317
+ $log_msg = '=== MEOW APPS DEBUG (This is not an error) ===';
318
+ if ( isset( $_POST['write_logs'] ) ) {
319
+ error_log( $log_msg );
320
+ }
321
+ $errorpath = ini_get( 'error_log' );
322
+ echo "<a href=\"javascript:history.go(-1)\">< Go back</a><br /><br />";
323
+ echo '
324
+ <form method="post">
325
+ <input type="hidden" name="write_logs" value="true">
326
+ <input class="button button-primary" type="submit" value="Write in the Error Logs">
327
+ </form><br />';
328
+ echo '<div id="error_log">';
329
+ if ( file_exists( $errorpath ) ) {
330
+ echo "Now (auto-reload every 5 seconds): [" . date( "d-M-Y H:i:s", time() ) . " UTC]<br /><br /><h2 style='margin: 0px;'>Errors (order by latest)</h2>";
331
+ $errors = file_get_contents( $errorpath );
332
+ $errors = explode( "\n", $errors );
333
+ $errors = array_reverse( $errors );
334
+ $errors = implode( "<br />", $errors );
335
+ echo $errors;
336
+ }
337
+ else {
338
+ echo "The PHP Error Logs cannot be found. Please ask your hosting service for it.";
339
+ }
340
+ echo "</div>";
341
+
342
+ }
343
+ else {
344
+
345
+ ?>
346
+ <?php $this->display_title( 'Meow Apps' ); ?>
347
+ <p>
348
+ <?php _e( 'Meow Apps is run by Jordy Meow, a photographer and software developer living in Japan (and taking <a target="_blank" href="http://offbeatjapan.org">a lot of photos</a>). Meow Apps is a suite of plugins focusing on photography, imaging, optimization and it teams up with the best players in the community (other themes and plugins developers). For more information, please check <a href="http://meowapps.com" target="_blank">Meow Apps</a>.', 'meowapps' )
349
+ ?>
350
+ </p>
351
+
352
+ <h2 style="margin-bottom: 0px; margin-top: 25px;">Featured Plugins</h2>
353
+ <div class="meow-row meow-featured-plugins">
354
+ <div class="meow-box meow-col meow-span_1_of_2">
355
+ <ul class="">
356
+ <li><img src='<?= $this->common_url( 'img/media-cleaner.jpg' ) ?>' />
357
+ <a href='https://meowapps.com/plugin/media-cleaner/'><b>Media Cleaner</b></a>
358
+ <?php echo $this->check_install( 'media-cleaner' ) ?><br />
359
+ Detect the files which are not in use.</li>
360
+ <li><img src='<?= $this->common_url( 'img/media-file-renamer.jpg' ) ?>' />
361
+ <a href='https://meowapps.com/plugin/media-file-renamer/'><b>Media File Renamer</b></a>
362
+ <?php echo $this->check_install( 'media-file-renamer' ) ?><br />
363
+ For nicer filenames and a better SEO.</li>
364
+ <li><img src='<?= $this->common_url( 'img/default.png' ) ?>' />
365
+ <a href='https://meowapps.com/plugin/contact-form-block/'><b>Contact Form Block</b></a>
366
+ <?php echo $this->check_install( 'contact-form-block' ) ?><br />
367
+ A simpler, nicer, prettier contact form.</li>
368
+ <!--li><img src='<?= $this->common_url( 'img/wp-retina-2x.jpg' ) ?>' />
369
+ <a href='https://meowapps.com/plugin/wp-retina-2x/'><b>WP Retina 2x</b></a>
370
+ <?php echo $this->check_install( 'wp-retina-2x' ) ?><br />
371
+ The famous plugin that adds Retina support.</li-->
372
+
373
+ </ul>
374
+ </div>
375
+ <div class="meow-box meow-col meow-span_1_of_2 ">
376
+ <ul class="">
377
+ <li><img src='<?= $this->common_url( 'img/meow-gallery.jpg' ) ?>' />
378
+ <a href='https://meowapps.com/plugin/meow-gallery/'><b>Meow Gallery</b></a>
379
+ <?php echo $this->check_install( 'meow-gallery' ) ?><br />
380
+ Beautiful but lightweight gallery with many layouts. The only one that allows you to uninstall it without losing anything.</li>
381
+ <li><img src='<?= $this->common_url( 'img/meow-lightbox.jpg' ) ?>' />
382
+ <a href='https://meowapps.com/plugin/meow-lightbox/'><b>Meow Lightbox</b></a>
383
+ <?php echo $this->check_install( 'meow-lightbox' ) ?><br />
384
+ Pretty and ultra-optimized Lightbox which can also display your EXIF data. You will love it.</li>
385
+ <li><img src='<?= $this->common_url( 'img/wplr-sync.jpg' ) ?>' />
386
+ <a href='https://meowapps.com/plugin/wplr-sync/'><b>WP/LR Sync</b></a>
387
+ <?php echo $this->check_install( 'wplr-sync' ) ?><br />
388
+ Synchronize your Lightroom to your WordPress. This plugin is loved by all the photographers using Lightroom and WordPress.</li>
389
+ </ul>
390
+ </div>
391
+ </div>
392
+
393
+ <h2>Recommendations</h2>
394
+ <div style="background: white; padding: 5px 15px 5px 15px; box-shadow: 2px 2px 1px rgba(0,0,0,.02);">
395
+ <p>
396
+ <?php _e( 'Too many WordPress installs are blown-up with useless and/or huge plugins, and bad practices. But that is because most users are overwhelmed by the diversity and immensity of the WordPress jungle. One rule of thumb is to keep your install the simplest as possible, with the least amount of plugins, in number and weight.', 'meowapps' )?>
397
+ </p>
398
+ <p>
399
+ <?php _e( 'Articles are kept being updated on the Meow Apps website, with all the latest recommendations. Please have a look and make your WordPress simpler, faster, better: ', 'meowapps' )?>
400
+ <a href='https://meowapps.com/debugging-wordpress/' target='_blank'>
401
+ How To Debug</a>,
402
+ <a href='https://meowapps.com/seo-optimization/' target='_blank'>
403
+ SEO Checklist & Optimization</a>,
404
+ <a href='https://meowapps.com/clean-optimize-wordpress/' target='_blank'>
405
+ Clean Up and Optimize</a>,
406
+ <a href='https://meowapps.com/optimize-images-cdn/' target='_blank'>
407
+ Optimize Images</a>,
408
+ <a href='https://meowapps.com/best-hosting-services-wordpress/' target='_blank'>
409
+ Best Hosting Services</a>.
410
+ </p>
411
+ </div>
412
+
413
+ <h2 style="margin-bottom: 0px; margin-top: 25px;">Common Options & Tools</h2>
414
+ <div class="meow-row">
415
+ <div class="meow-box meow-col meow-span_2_of_3">
416
+ <h3><span class="dashicons dashicons-admin-tools"></span> Common</h3>
417
+ <div class="inside">
418
+ <form method="post" action="options.php">
419
+ <?php settings_fields( 'meowapps_common_settings' ); ?>
420
+ <?php do_settings_sections( 'meowapps_common_settings-menu' ); ?>
421
+ <?php submit_button(); ?>
422
+ </form>
423
+ </div>
424
+ </div>
425
+
426
+ <div class="meow-box meow-col meow-span_1_of_3">
427
+ <h3><span class="dashicons dashicons-admin-tools"></span> Debug</h3>
428
+ <div class="inside">
429
+ <ul>
430
+ <li><a href="?page=meowapps-main-menu&amp;tool=error_log">Display Error Log</a></li>
431
+ <li><a href="?page=meowapps-main-menu&amp;tool=phpinfo">Display PHP Info</a></li>
432
+ </ul>
433
+ </div>
434
+ </div>
435
+
436
+ <div class="meow-box meow-col meow-span_1_of_3">
437
+ <h3><span class="dashicons dashicons-admin-tools"></span> Post Types (used by this install)</h3>
438
+ <div class="inside">
439
+ <?php
440
+ global $wpdb;
441
+ // Maybe we could avoid to check more post_types.
442
+ // SELECT post_type, COUNT(*) FROM `wp_posts` GROUP BY post_type
443
+ $types = $wpdb->get_results( "SELECT post_type as 'type', COUNT(*) as 'count' FROM $wpdb->posts GROUP BY post_type" );
444
+ $result = array();
445
+ foreach( $types as $type )
446
+ array_push( $result, "{$type->type} ({$type->count})" );
447
+ echo implode( $result, ', ' );
448
+ ?>
449
+ </div>
450
+ </div>
451
+ </div>
452
+
453
+ <?php
454
+ }
455
+ echo "<br /><small style='color: lightgray;'>Meow Admin " . MeowApps_Admin::$admin_version . "</small></div>";
456
+ }
457
+
458
+ // HELPERS
459
+
460
+ static function size_shortname( $name ) {
461
+ $name = preg_split( '[_-]', $name );
462
+ $short = strtoupper( substr( $name[0], 0, 1 ) );
463
+ if ( count( $name ) > 1 )
464
+ $short .= strtoupper( substr( $name[1], 0, 1 ) );
465
+ return $short;
466
+ }
467
+
468
+ }
469
+
470
+ }
471
+
472
+ if ( file_exists( plugin_dir_path( __FILE__ ) . '/meowapps/admin.php' ) ) {
473
+ require( 'meowapps/admin.php' );
474
+ }
475
+
476
+ ?>
common/img/default.png ADDED
Binary file
common/img/media-cleaner.jpg ADDED
Binary file
common/img/media-file-renamer.jpg ADDED
Binary file
common/img/meow-gallery.jpg ADDED
Binary file
common/img/meow-lightbox.jpg ADDED
Binary file
common/img/meowapps.png ADDED
Binary file
common/img/wp-retina-2x.jpg ADDED
Binary file
common/img/wplr-sync.jpg ADDED
Binary file
gallery_custom_links.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Gallery Custom Links
4
  Plugin URI: https://meowapps.com
5
  Description: Gallery Custom Links allows you to link images from galleries to a specified URL. Tested with WordPress Gallery, Gutenberg, the Meow Gallery and others.
6
- Version: 1.1.5
7
  Author: Jordy Meow
8
  Author URI: https://meowapps.com
9
  Text Domain: gallery-custom-links
@@ -23,7 +23,7 @@ if ( class_exists( 'Meow_Gallery_Custom_Links' ) ) {
23
  }
24
 
25
  global $mgcl_version;
26
- $mgcl_version = '1.1.5';
27
 
28
  include "mgcl_admin.php";
29
  $mgcl_admin = new Meow_Gallery_Custom_Links_Admin( 'mgcl', __FILE__, 'gallery-custom-links' );
3
  Plugin Name: Gallery Custom Links
4
  Plugin URI: https://meowapps.com
5
  Description: Gallery Custom Links allows you to link images from galleries to a specified URL. Tested with WordPress Gallery, Gutenberg, the Meow Gallery and others.
6
+ Version: 1.2.0
7
  Author: Jordy Meow
8
  Author URI: https://meowapps.com
9
  Text Domain: gallery-custom-links
23
  }
24
 
25
  global $mgcl_version;
26
+ $mgcl_version = '1.2.0';
27
 
28
  include "mgcl_admin.php";
29
  $mgcl_admin = new Meow_Gallery_Custom_Links_Admin( 'mgcl', __FILE__, 'gallery-custom-links' );
mgcl_admin.php CHANGED
@@ -1,17 +1,24 @@
1
  <?php
2
 
3
- class Meow_Gallery_Custom_Links_Admin { // extends MeowApps_Admin
 
 
4
 
5
  public $core;
6
 
7
  public function __construct( $prefix, $mainfile, $domain ) {
8
- //parent::__construct( $prefix, $mainfile, $domain );
9
  if ( is_admin() ) {
 
10
  add_filter( 'attachment_fields_to_edit', array( $this, 'attachment_fields_to_edit' ), 10, 2 );
11
  add_filter( 'attachment_fields_to_save', array( $this, 'apply_filter_attachment_fields_to_save' ), 10 , 2 );
12
  }
13
  }
14
 
 
 
 
 
15
  function attachment_fields_to_edit( $fields, $post ) {
16
  $fields['gallery_link_url'] = array(
17
  'label' => __( 'Link URL', 'gallery-custom-links' ),
@@ -59,6 +66,105 @@ class Meow_Gallery_Custom_Links_Admin { // extends MeowApps_Admin
59
  return $post;
60
  }
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  }
63
 
64
  ?>
1
  <?php
2
 
3
+ include "common/admin.php";
4
+
5
+ class Meow_Gallery_Custom_Links_Admin extends MeowApps_Admin { // extends MeowApps_Admin
6
 
7
  public $core;
8
 
9
  public function __construct( $prefix, $mainfile, $domain ) {
10
+ parent::__construct( $prefix, $mainfile, $domain );
11
  if ( is_admin() ) {
12
+ add_action( 'admin_menu', array( $this, 'app_menu' ) );
13
  add_filter( 'attachment_fields_to_edit', array( $this, 'attachment_fields_to_edit' ), 10, 2 );
14
  add_filter( 'attachment_fields_to_save', array( $this, 'apply_filter_attachment_fields_to_save' ), 10 , 2 );
15
  }
16
  }
17
 
18
+ function common_url( $file ) {
19
+ return trailingslashit( plugin_dir_url( __FILE__ ) ) . 'common/' . $file;
20
+ }
21
+
22
  function attachment_fields_to_edit( $fields, $post ) {
23
  $fields['gallery_link_url'] = array(
24
  'label' => __( 'Link URL', 'gallery-custom-links' ),
66
  return $post;
67
  }
68
 
69
+ function app_menu() {
70
+
71
+ $method = apply_filters( 'mgcl_method', 'media_title' );
72
+
73
+ // SUBMENU > Settings
74
+ add_submenu_page( 'meowapps-main-menu', 'Gallery Custom Links', 'Custom Links', 'manage_options',
75
+ 'mgcl_settings-menu', array( $this, 'admin_settings' ) );
76
+
77
+ // SUBMENU > Settings > Basic Settings
78
+ add_settings_section( 'mgcl_settings', null, null, 'mgcl_settings-menu' );
79
+ add_settings_field( 'mgcl_obmode', "OB Mode",
80
+ array( $this, 'admin_obmode_callback' ),
81
+ 'mgcl_settings-menu', 'mgcl_settings' );
82
+ add_settings_field( 'mgcl_parsing_engine', "Parsing Engine",
83
+ array( $this, 'admin_parsing_engine_callback' ),
84
+ 'mgcl_settings-menu', 'mgcl_settings' );
85
+ add_settings_field( 'mgcl_log', "Logs",
86
+ array( $this, 'admin_log_callback' ),
87
+ 'mgcl_settings-menu', 'mgcl_settings' );
88
+
89
+ register_setting( 'mgcl_settings', 'mgcl_obmode' );
90
+ register_setting( 'mgcl_settings', 'mgcl_parsing_engine' );
91
+ register_setting( 'mgcl_settings', 'mgcl_log' );
92
+ }
93
+
94
+ function admin_settings() {
95
+ ?>
96
+ <div class="wrap">
97
+ <?php echo $this->display_title( "Gallery Custom Links" ); ?>
98
+
99
+ <div class="meow-row">
100
+ <div class="meow-box meow-col meow-span_2_of_2">
101
+ <h3>How to use</h3>
102
+ <div class="inside">
103
+ <?php
104
+ printf(
105
+ /* Translators: %s: link to tutorial */
106
+ esc_html__( 'This plugin works out of the box, the default settings are the best for most installs. If your photos are only in the content, then you should switch the OB Mode off, that will make the process much faster. Don\'t hesitate to take a look at the %s.', 'gallery-custom-links' ),
107
+ '<a target="_blank" href="https://meowapps.com/plugin/gallery-custom-links/">' . esc_html__( 'official page', 'gallery-custom-links' ) . '</a>'
108
+ );
109
+ ?>
110
+ </div>
111
+ </div>
112
+ </div>
113
+
114
+
115
+ <div class="meow-row">
116
+
117
+ <div class="meow-col meow-span_1_of_2">
118
+
119
+ <div class="meow-box">
120
+ <h3>Settings</h3>
121
+ <div class="inside">
122
+ <form method="post" action="options.php">
123
+ <?php settings_fields( 'mgcl_settings' ); ?>
124
+ <?php do_settings_sections( 'mgcl_settings-menu' ); ?>
125
+ <?php submit_button(); ?>
126
+ </form>
127
+ </div>
128
+ </div>
129
+
130
+ </div>
131
+
132
+ </div>
133
+
134
+ </div>
135
+ <?php
136
+ }
137
+
138
+ function admin_obmode_callback( $args ) {
139
+ $html = '<input type="checkbox" id="mgcl_obmode" name="mgcl_obmode" value="1" ' .
140
+ checked( 1, get_option( 'mgcl_obmode', true ), false ) . '/>';
141
+ $html .= '<label>' . __( 'Enabled', 'gallery-custom-links' ) . '</label>';
142
+ echo $html;
143
+ }
144
+
145
+ function admin_parsing_engine_callback( $args ) {
146
+ $layouts = array(
147
+ //'None' => array( 'name' => __( 'None', 'gallery-custom-links' ), 'desc' => "" ),
148
+ 'HtmlDomParser' => array( 'name' => __( 'HtmlDomParser', 'gallery-custom-links' ), 'desc' => "" ),
149
+ 'DiDom' => array( 'name' => __( 'DiDom', 'gallery-custom-links' ), 'desc' => "" )
150
+ );
151
+ $html = '';
152
+ $image_size = get_option( 'mgcl_parsing_engine', 'HtmlDomParser' );
153
+ foreach ( $layouts as $key => $arg )
154
+ $html .= '<input type="radio" class="radio" id="mgcl_parsing_engine" name="mgcl_parsing_engine" value="' . $key . '"' .
155
+ checked( $key, $image_size, false ) . ' > ' .
156
+ ( empty( $arg ) ? 'None' : $arg['name'] ) .
157
+ '<br />';
158
+ echo $html;
159
+ }
160
+
161
+ function admin_log_callback( $args ) {
162
+ $html = '<input type="checkbox" id="mgcl_log" name="mgcl_log" value="1" ' .
163
+ checked( 1, get_option( 'mgcl_log', false ), false ) . '/>';
164
+ $html .= '<label>' . __( 'Enabled', 'gallery-custom-links' ) . '</label>';
165
+ echo $html;
166
+ }
167
+
168
  }
169
 
170
  ?>
mgcl_core.php CHANGED
@@ -16,7 +16,9 @@ class Meow_Gallery_Custom_Links
16
  if ( is_admin() || $this->is_rest() ) {
17
  return;
18
  }
19
-
 
 
20
  if ( $this->isObMode ) {
21
  add_action( 'init', array( $this, 'start' ) );
22
  add_action( 'shutdown', array( $this, 'shutdown' ) );
@@ -38,11 +40,6 @@ class Meow_Gallery_Custom_Links
38
  return false;
39
  }
40
 
41
- function setOptions() {
42
- $this->isObMode = get_option( 'mwl_obmode', $this->isObMode );
43
- $this->parsingEngine = get_option( 'mwl_parsing_engine', $this->parsingEngine );
44
- }
45
-
46
  function init() {
47
  //add_action( 'init', array( $this, 'init' ) );
48
  // We don't need this now, we go through all the images.
16
  if ( is_admin() || $this->is_rest() ) {
17
  return;
18
  }
19
+ $this->isObMode = get_option( 'mgcl_obmode', $this->isObMode );
20
+ $this->parsingEngine = get_option( 'mgcl_parsing_engine', $this->parsingEngine );
21
+ $this->enableLogs = get_option( 'mgcl_log', $this->enableLogs );
22
  if ( $this->isObMode ) {
23
  add_action( 'init', array( $this, 'start' ) );
24
  add_action( 'shutdown', array( $this, 'shutdown' ) );
40
  return false;
41
  }
42
 
 
 
 
 
 
43
  function init() {
44
  //add_action( 'init', array( $this, 'init' ) );
45
  // We don't need this now, we go through all the images.
readme.txt CHANGED
@@ -1,10 +1,11 @@
1
  === Gallery Custom Links ===
2
  Contributors: TigrouMeow
3
  Tags: custom, links, gallery, gutenberg
 
4
  Requires at least: 5.0
5
- Tested up to: 5.1
6
  Requires PHP: 7.0
7
- Stable tag: 1.1.5
8
 
9
  Gallery Custom Links allows you to link images from galleries to a specified URL. Tested with WordPress Gallery, Gutenberg, the Meow Gallery and others.
10
 
@@ -41,9 +42,12 @@ Replace all the files. Nothing else to do.
41
 
42
  == Changelog ==
43
 
 
 
 
 
44
  = 1.1.5 =
45
  * Fix: Simpler and probably better REST detection.
46
- * Info: If you like the plugin, your reviews are welcome [here](https://wordpress.org/support/plugin/gallery-custom-links/reviews/?rate=5#new-post) :) Thank you!
47
 
48
  = 1.1.4 =
49
  * Fix: Attempt to fix the way autoload is working.
1
  === Gallery Custom Links ===
2
  Contributors: TigrouMeow
3
  Tags: custom, links, gallery, gutenberg
4
+ Donate link: https://commerce.coinbase.com/checkout/d047546a-77a8-41c8-9ea9-4a950f61832f
5
  Requires at least: 5.0
6
+ Tested up to: 5.2
7
  Requires PHP: 7.0
8
+ Stable tag: 1.2.0
9
 
10
  Gallery Custom Links allows you to link images from galleries to a specified URL. Tested with WordPress Gallery, Gutenberg, the Meow Gallery and others.
11
 
42
 
43
  == Changelog ==
44
 
45
+ = 1.2.0 =
46
+ * Add: This was asked to me a lot, so I have adding the settings in order to change the parameters of the plugin easily. It will be much easier to make it faster now.
47
+ * Info: If you like the plugin, your reviews are welcome [here](https://wordpress.org/support/plugin/gallery-custom-links/reviews/?rate=5#new-post) :) Thank you!
48
+
49
  = 1.1.5 =
50
  * Fix: Simpler and probably better REST detection.
 
51
 
52
  = 1.1.4 =
53
  * Fix: Attempt to fix the way autoload is working.
vendor/imangazaliev/didom/.gitignore ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /vendor
2
+ /.idea
3
+ composer.phar
4
+ composer.lock
5
+ .php_cs.cache
6
+ .DS_Store
7
+ Thumbs.db