Premium Addons for Elementor - Version 2.6.7

Version Description

  • Tweak: Premium Testimonials widget performance enhanced.
  • Tweak: Plugin core enhancement for faster performance.
  • Fixed: Conflict with 'Pods Custom Content Types and Fields' plugin.
Download this release

Release Info

Developer leap13
Plugin Icon 128x128 Premium Addons for Elementor
Version 2.6.7
Comparing to
See all releases

Code changes from version 2.6.6 to 2.6.7

Files changed (37) hide show
  1. admin/assets/admin.css +1 -365
  2. admin/assets/admin.js +0 -1
  3. admin/assets/js/sweetalert2/{js/core.js → core.js} +0 -0
  4. admin/assets/js/sweetalert2/{css/sweetalert2.min.css → sweetalert2.min.css} +0 -0
  5. admin/assets/js/sweetalert2/{js/sweetalert2.min.js → sweetalert2.min.js} +0 -0
  6. admin/includes/notices.php +254 -0
  7. admin/settings/about.php +4 -12
  8. admin/settings/elements.php +73 -66
  9. admin/settings/gomaps.php +17 -4
  10. admin/settings/gopro.php +2 -18
  11. admin/settings/version-control.php +3 -4
  12. elementor-helper.php +1 -1
  13. includes/class-addons-category.php +49 -0
  14. includes/class-addons-integration.php +241 -0
  15. includes/{beta-testers.php → class-beta-testers.php} +1 -1
  16. premium-addons-for-elementor.php +125 -468
  17. readme.txt +10 -5
  18. widgets/premium-banner.php +2 -4
  19. widgets/premium-blog.php +5 -11
  20. widgets/premium-button.php +2 -4
  21. widgets/premium-carousel.php +2 -3
  22. widgets/premium-contactform.php +10 -13
  23. widgets/premium-countdown.php +2 -4
  24. widgets/premium-counter.php +3 -5
  25. widgets/premium-dual-header.php +2 -4
  26. widgets/premium-fancytext.php +2 -4
  27. widgets/premium-grid.php +2 -3
  28. widgets/premium-image-button.php +2 -4
  29. widgets/{premium-imageseparator.php → premium-image-separator.php} +2 -4
  30. widgets/premium-maps.php +2 -4
  31. widgets/premium-modalbox.php +2 -4
  32. widgets/premium-person.php +2 -4
  33. widgets/premium-pricing-table.php +2 -4
  34. widgets/premium-progressbar.php +2 -4
  35. widgets/premium-testimonials.php +94 -45
  36. widgets/premium-title.php +2 -5
  37. widgets/premium-videobox.php +2 -4
admin/assets/admin.css CHANGED
@@ -1,365 +1 @@
1
- .pa-header-wrapper {
2
- padding: 20px;
3
- overflow: hidden;
4
- }
5
- .pa-title-left {
6
- width: 80%;
7
- float: left;
8
- }
9
- h1.pa-title-main {
10
- padding: 0;
11
- line-height: 1.3em;
12
- font-size: 42px;
13
- margin-top: 5px;
14
- }
15
- .pa-title-sub {
16
- color:#777;
17
- font-weight: normal;
18
- margin-left: 3px;
19
- }
20
- .pa-title-right {
21
- float: right;
22
- }
23
- .pa-title-right img {
24
- width: 100px;
25
- height: 100px;
26
- }
27
- .button.pa-btn {
28
- border: none;
29
- color: #fff;
30
- text-align: center;
31
- padding: 3px;
32
- max-width: 250px;
33
- height: auto;
34
- margin-bottom: 15px;
35
- display: block;
36
- font-weight: bold;
37
- box-shadow: none;
38
- }
39
- .pa-btn.pa-save-button {
40
- background-color: #1A7FC2;
41
- margin-bottom: 0;
42
- margin-top: 30px;
43
- padding: 3px 10px;
44
- }
45
- .pa-btn.pa-save-button:hover {
46
- background: #0e629a;
47
- color: #fff;
48
- }
49
-
50
- .pa-btn.pa-save-button:focus {
51
- background: #0e629a;
52
- color: #fff;
53
- }
54
-
55
- .pa-settings-tabs-list {
56
- margin: 0;
57
- border-bottom: 1px solid #ccc;
58
- }
59
- /*About Settings Tab*/
60
- .pa-settings-tabs-list li {
61
- display: inline-block;
62
- margin-bottom: 4px;
63
- margin-left: 0.5em;
64
- }
65
- .pa-tab-list-item {
66
- background: #e5e5e5;
67
- padding: 9px 15px;
68
- line-height: 30px;
69
- font-size: 18px;
70
- font-weight: bold;
71
- color: #444;
72
- text-decoration: none;
73
- border: 1px solid #ccc;
74
- border-bottom: none;
75
- }
76
- .pa-tab-list-item:focus {
77
- box-shadow: none;
78
- }
79
- li.ui-state-default:not(.ui-state-active):hover a {
80
- background: #fff;
81
- color: #444;
82
- }
83
- li.ui-state-active a{
84
- outline: none;
85
- color: black;
86
- background: transparent;
87
- box-shadow: none;
88
- border-bottom: 1px solid #f1f1f1;
89
- }
90
- .pa-row {
91
- width: 100%;
92
- overflow: hidden;
93
- }
94
- .pa-settings-tabs {
95
- padding: 15px 25px;
96
- margin-top: -3em;
97
- }
98
- #pa-about {
99
- margin-top: 50px;
100
- }
101
- .pa-col-half {
102
- width: 40%;
103
- height: auto;
104
- float: left;
105
- }
106
- .pa-about-panel {
107
- width: 100%;
108
- display: inline-block;
109
- margin-bottom: 20px;
110
- }
111
- .pa-icon-container {
112
- float: left;
113
- display: inline-block;
114
- width: 45px;
115
- }
116
- .pa-icon-container i {
117
- font-size: 25px;
118
- }
119
- .pa-text-container {
120
- display: inline-block;
121
- width: 80%;
122
- }
123
- .pa-text-container h4 {
124
- margin: 0;
125
- font-weight: normal;
126
- font-size: 18px;
127
- }
128
- .pa-text-container p {
129
- line-height: 22px;
130
- color: #444;
131
- font-size: 13px;
132
- margin: 1em 0;
133
- }
134
- /*Elements Settings Tab*/
135
- .pa-elements-table {
136
- border-collapse: collapse;
137
- margin-top: 0.5em;
138
- margin-left: 5px;
139
- width: 80%;
140
- clear: both;
141
- }
142
- .pa-elements-table th {
143
- vertical-align: top;
144
- text-align: left;
145
- padding: 20px 10px 20px 0;
146
- width: 200px;
147
- line-height: 1.3;
148
- font-weight: 600;
149
- }
150
- .pa-elements-table tr {
151
- border-bottom: 1px solid #ddd;
152
- }
153
- .pa-elements-table td {
154
- margin-bottom: 9px;
155
- padding: 15px 10px;
156
- line-height: 1.3;
157
- vertical-align: middle;
158
- }
159
- .pa-elements-table .pa-element-desc {
160
- font-weight: 300;
161
- padding-bottom: 1.5em;
162
- border-bottom: 1px solid #ddd;
163
- }
164
- /* The switch - the box around the slider */
165
- .switch {
166
- position: relative;
167
- display: inline-block;
168
- width: 70px;
169
- height: 33px;
170
- }
171
- /* Hide default HTML checkbox */
172
- .switch input {
173
- display:none;
174
- }
175
- /* The slider */
176
- .slider,
177
- .pro-slider {
178
- position: absolute;
179
- cursor: pointer;
180
- top: 0;
181
- left: 0;
182
- right: 0;
183
- bottom: 0;
184
- background-color: rgb(242,242,242);
185
- box-shadow: 0 0 2px 1px #ccc inset;
186
- -webkit-transition: .4s;
187
- transition: .4s;
188
- }
189
- .slider:before,
190
- .pro-slider:before {
191
- position: absolute;
192
- content: "";
193
- height: 27.5px;
194
- width: 27.5px;
195
- left: 0px;
196
- bottom: 1.1px;
197
- background: radial-gradient(farthest-corner at 14px 0px,
198
- rgb(240,240,240) 50%, rgb(202,202,202) 100%);
199
- -webkit-transition: .4s;
200
- transition: .4s;
201
- padding: 0;
202
- margin: 0;
203
- border: 1px solid rgb(198,198,198);
204
- box-shadow: 0px 2.5px 5px rgb(184,184,185);
205
- }
206
- input:checked + .slider {
207
- background-color: rgb(24,164,253);
208
- box-shadow: 0 0 2px 1px rgb(20,154,253) inset;
209
- border: 1px solid rgb(20,154,253);
210
- }
211
- input:focus + .slider {
212
- box-shadow: 0 0 1px rgb(24,164,253);
213
- }
214
- input:checked + .slider:before {
215
- box-shadow: 0px 2.5px 5px #0d6fbd;
216
- border: 1px solid #0d6fbd;
217
- -webkit-transform: translateX(40px);
218
- -ms-transform: translateX(40px);
219
- transform: translateX(40px);
220
- }
221
-
222
- /* Rounded sliders */
223
- .slider.round,
224
- .pro-slider.round {
225
- border: 1px solid rgb(184,184,185);
226
- border-radius: 34px;
227
- }
228
- .slider.round:before,
229
- .pro-slider.round:before {
230
- border-radius: 50%;
231
- }
232
- .pa-maps-table {
233
- text-align: left;
234
- }
235
- .pa-api-title {
236
- display: inline-block;
237
- margin: 0;
238
- }
239
- .pa-api-disable-title label,
240
- .pa-is-beta label{
241
- margin-right: 15px;
242
- }
243
- .pa-api-disable-title span,
244
- .pa-is-beta span{
245
- font-weight: normal;
246
- }
247
- .pa-maps-api-notice {
248
- margin: 10px 0 0 0;
249
- }
250
- .pa-api-title input {
251
- margin-top: 10px;
252
- font-size: normal;
253
- font-weight: normal;
254
- width: 400px;
255
- margin-left: 30px;
256
- }
257
- #pa-maintenance {
258
- margin-top: 30px;
259
- }
260
- .pa-beta-table tr {
261
- text-align: left;
262
- }
263
- .pa-roll-back,
264
- .pa-beta-test{
265
- text-align: left;
266
- font-size: 20px;
267
- font-weight: normal;
268
- margin-top: 15px;
269
- margin-bottom: 10px;
270
- }
271
- .pa-beta-test {
272
- margin-top: 0;
273
- }
274
- .pa-roll-back-span,
275
- .pa-beta-test-span{
276
- line-height: 22px;
277
- color: #444;
278
- font-size: 13px;
279
- margin: 0;
280
- font-weight: normal;
281
- }
282
- .pa-roll-row,
283
- .pa-beta-row{
284
- float: left;
285
- }
286
- .pa-beta-row{
287
- margin-top: 13px;
288
- }
289
- .pa-roll-row th,
290
- .pa-beta-row th{
291
- vertical-align: top;
292
- text-align: left;
293
- padding: 20px 10px 20px 0;
294
- width: 200px;
295
- line-height: 1.3;
296
- }
297
- .pa-roll-row td{
298
- padding: 15px 10px;
299
- }
300
- .pa-beta-row td{
301
- padding: 22px 10px;
302
- }
303
- .pa-roll-row .pa-rollback-button {
304
- box-shadow: 0 1px 0 #ccc;
305
- color: #555;
306
- border: 1px solid #ccc;
307
- background: #f7f7f7;
308
- vertical-align: top;
309
- margin: 0;
310
- padding: 0 10px 1px;
311
- }
312
- .pa-roll-row .pa-rollback-button:hover {
313
- background: #fafafa;
314
- border-color: #999;
315
- color: #23282d;
316
- }
317
- .pa-roll-row .pa-roll-desc{
318
- font-style: italic;
319
- color: red;
320
- margin-top: 4px;
321
- }
322
- .pa-beta-row .pa-beta-desc{
323
- font-style: italic;
324
- margin-top: 4px;
325
- }
326
- .pa-sys-info-tab {
327
- background: #f7f7f7;
328
- margin: 8px;
329
- border: 2px solid #ddd;
330
- border-radius: 3px;
331
- padding: 0;
332
- }
333
- .pa-system-info-container {
334
- padding: 10px;
335
- }
336
- .pa-sys-info-tab .pa-sys-info-title {
337
- margin: 0;
338
- margin-bottom: 0px;
339
- padding: 10px;
340
- border-bottom: 2px solid #ddd;
341
- background: #fff;
342
- margin-bottom: 10px;
343
- font-weight: 500;
344
- }
345
- tr.pa-sec-elems-tr {
346
- border: none;
347
- }
348
- tr.pa-sec-elems-tr th {
349
- padding-bottom: 0;
350
- }
351
- tr.pa-sec-elems-tr th h1{
352
- font-weight: bold;
353
- font-size: 25px;
354
- letter-spacing: 1px;
355
- color: #555;
356
- margin-bottom: 0;
357
- }
358
- .pa-swal-head {
359
- display: block;
360
- margin-bottom: 20px;
361
- }
362
- .pa-swal-desc {
363
- font-weight: bold;
364
- color: #0f6aa7;
365
- }
1
+ .pa-header-wrapper{padding:20px;overflow:hidden}.pa-title-left{width:80%;float:left}h1.pa-title-main{padding:0;line-height:1.3em;font-size:42px;margin-top:5px}.pa-title-sub{color:#777;font-weight:400;margin-left:3px}.pa-title-right{float:right}.pa-title-right img{width:100px;height:100px}.button.pa-btn{border:none;color:#fff;text-align:center;padding:3px;max-width:250px;height:auto;margin-bottom:15px;display:block;font-weight:700;box-shadow:none}.pa-btn.pa-save-button{background-color:#1A7FC2;margin-bottom:0;margin-top:30px;padding:3px 10px}.pa-btn.pa-save-button:hover{background:#0e629a;color:#fff}.pa-btn.pa-save-button:focus{background:#0e629a;color:#fff}.pa-settings-tabs-list{margin:0;border-bottom:1px solid #ccc}.pa-settings-tabs-list li{display:inline-block;margin-bottom:4px;margin-left:.5em}.pa-tab-list-item{background:#e5e5e5;padding:9px 15px;line-height:30px;font-size:18px;font-weight:700;color:#444;text-decoration:none;border:1px solid #ccc;border-bottom:none}.pa-tab-list-item:focus{box-shadow:none}li.ui-state-default:not(.ui-state-active):hover a{background:#fff;color:#444}li.ui-state-active a{outline:none;color:#000;background:transparent;box-shadow:none;border-bottom:1px solid #f1f1f1}.pa-row{width:100%;overflow:hidden}.pa-settings-tabs{padding:15px 25px;margin-top:-3em}#pa-about{margin-top:50px}.pa-col-half{width:40%;height:auto;float:left}.pa-about-panel{width:100%;display:inline-block;margin-bottom:20px}.pa-icon-container{float:left;display:inline-block;width:45px}.pa-icon-container i{font-size:25px}.pa-text-container{display:inline-block;width:80%}.pa-text-container h4{margin:0;font-weight:400;font-size:18px}.pa-text-container p{line-height:22px;color:#444;font-size:13px;margin:1em 0}.pa-elements-table{border-collapse:collapse;margin-top:.5em;margin-left:5px;width:80%;clear:both}.pa-elements-table th{vertical-align:top;text-align:left;padding:20px 10px 20px 0;width:200px;line-height:1.3;font-weight:600}.pa-elements-table tr{border-bottom:1px solid #ddd}.pa-elements-table td{margin-bottom:9px;padding:15px 10px;line-height:1.3;vertical-align:middle}.pa-elements-table .pa-element-desc{font-weight:300;padding-bottom:1.5em;border-bottom:1px solid #ddd}.switch{position:relative;display:inline-block;width:70px;height:33px}.switch input{display:none}.slider,.pro-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#f2f2f2;box-shadow:0 0 2px 1px #ccc inset;-webkit-transition:.4s;transition:.4s}.slider:before,.pro-slider:before{position:absolute;content:"";height:27.5px;width:27.5px;left:0;bottom:1.1px;background:radial-gradient(farthest-corner at 14px 0px,#f0f0f0 50%,#cacaca 100%);-webkit-transition:.4s;transition:.4s;padding:0;margin:0;border:1px solid #c6c6c6;box-shadow:0 2.5px 5px #b8b8b9}input:checked + .slider{background-color:#18a4fd;box-shadow:0 0 2px 1px #149afd inset;border:1px solid #149afd}input:focus + .slider{box-shadow:0 0 1px #18a4fd}input:checked + .slider:before{box-shadow:0 2.5px 5px #0d6fbd;border:1px solid #0d6fbd;-webkit-transform:translateX(40px);-ms-transform:translateX(40px);transform:translateX(40px)}.slider.round,.pro-slider.round{border:1px solid #b8b8b9;border-radius:34px}.slider.round:before,.pro-slider.round:before{border-radius:50%}.pa-maps-table{text-align:left}.pa-api-title{display:inline-block;margin:0}.pa-api-disable-title label,.pa-is-beta label{margin-right:15px}.pa-api-disable-title span,.pa-is-beta span{font-weight:400}.pa-maps-api-notice{margin:10px 0 0}.pa-api-title input{margin-top:10px;font-size:normal;font-weight:400;width:400px;margin-left:30px}#pa-maintenance{margin-top:30px}.pa-beta-table tr{text-align:left}.pa-roll-back,.pa-beta-test{text-align:left;font-size:20px;font-weight:400;margin-top:15px;margin-bottom:10px}.pa-beta-test{margin-top:0}.pa-roll-back-span,.pa-beta-test-span{line-height:22px;color:#444;font-size:13px;margin:0;font-weight:400}.pa-roll-row,.pa-beta-row{float:left}.pa-beta-row{margin-top:13px}.pa-roll-row th,.pa-beta-row th{vertical-align:top;text-align:left;padding:20px 10px 20px 0;width:200px;line-height:1.3}.pa-roll-row td{padding:15px 10px}.pa-beta-row td{padding:22px 10px}.pa-roll-row .pa-rollback-button{box-shadow:0 1px 0 #ccc;color:#555;border:1px solid #ccc;background:#f7f7f7;vertical-align:top;margin:0;padding:0 10px 1px}.pa-roll-row .pa-rollback-button:hover{background:#fafafa;border-color:#999;color:#23282d}.pa-roll-row .pa-roll-desc{font-style:italic;color:red;margin-top:4px}.pa-beta-row .pa-beta-desc{font-style:italic;margin-top:4px}.pa-sys-info-tab{background:#f7f7f7;margin:8px;border:2px solid #ddd;border-radius:3px;padding:0}.pa-system-info-container{padding:10px}.pa-sys-info-tab .pa-sys-info-title{margin:0;margin-bottom:0;padding:10px;border-bottom:2px solid #ddd;background:#fff;margin-bottom:10px;font-weight:500}tr.pa-sec-elems-tr{border:none}tr.pa-sec-elems-tr th{padding-bottom:0}tr.pa-sec-elems-tr th h1{font-weight:700;font-size:25px;letter-spacing:1px;color:#555;margin-bottom:0}.pa-swal-head{display:block;margin-bottom:20px}.pa-swal-desc{font-weight:700;color:#0f6aa7}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/assets/admin.js CHANGED
@@ -1,6 +1,5 @@
1
  //Go Between the Tabs
2
  ( function ( $ ){
3
-
4
  var redirectionLink = " https://premiumaddons.com/pro/?utm_source=wp-menu&utm_medium=wp-dash&utm_campaign=get-pro&utm_term=";
5
  "use strict";
6
 
1
  //Go Between the Tabs
2
  ( function ( $ ){
 
3
  var redirectionLink = " https://premiumaddons.com/pro/?utm_source=wp-menu&utm_medium=wp-dash&utm_campaign=get-pro&utm_term=";
4
  "use strict";
5
 
admin/assets/js/sweetalert2/{js/core.js → core.js} RENAMED
File without changes
admin/assets/js/sweetalert2/{css/sweetalert2.min.css → sweetalert2.min.css} RENAMED
File without changes
admin/assets/js/sweetalert2/{js/sweetalert2.min.js → sweetalert2.min.js} RENAMED
File without changes
admin/includes/notices.php ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace PremiumAddons;
4
+
5
+ if( !defined( 'ABSPATH') ) exit();
6
+
7
+ class Premium_Admin_Notices {
8
+
9
+ private static $instance = null;
10
+
11
+ private static $elementor = 'elementor';
12
+
13
+ /**
14
+ * Constructor for the class
15
+ */
16
+ public function __construct() {
17
+ add_action('admin_init', array( $this, 'init') );
18
+
19
+ add_action('admin_notices', array( $this, 'check_admin_notices' ) );
20
+ }
21
+
22
+ /**
23
+ * init required functions
24
+ */
25
+ public function init(){
26
+ $this->handle_get_pro_notice();
27
+ $this->handle_review_notice();
28
+ }
29
+
30
+ /**
31
+ * init notices check functions
32
+ */
33
+ public function check_admin_notices() {
34
+ $this->required_plugins_check();
35
+ $this->get_review_notice();
36
+ $this->get_pro_notice();
37
+ }
38
+
39
+ /**
40
+ * Checks if get pro version message is dismissed.
41
+ * @access public
42
+ * @return void
43
+ */
44
+ public function handle_get_pro_notice() {
45
+
46
+ if ( ! isset( $_GET['get_pa_pro'] ) ) {
47
+ return;
48
+ }
49
+
50
+ if ( 'opt_out' === $_GET['get_pa_pro'] ) {
51
+ check_admin_referer( 'opt_out' );
52
+
53
+ update_option( 'get_pa_pro_notice', '1' );
54
+ }
55
+
56
+ wp_redirect( remove_query_arg( 'get_pa_pro' ) );
57
+ exit;
58
+ }
59
+
60
+
61
+ /**
62
+ * Checks if review message is dismissed.
63
+ * @access public
64
+ * @return void
65
+ */
66
+ public function handle_review_notice() {
67
+
68
+ if ( ! isset( $_GET['pa_review'] ) ) {
69
+ return;
70
+ }
71
+
72
+ if ( 'opt_out' === $_GET['pa_review'] ) {
73
+ check_admin_referer( 'opt_out' );
74
+
75
+ update_option( 'pa_review_notice', '1' );
76
+ }
77
+
78
+ wp_redirect( remove_query_arg( 'pa_review' ) );
79
+ exit;
80
+ }
81
+
82
+ /**
83
+ * Shows an admin notice when Elementor is missing.
84
+ * @since 1.0.0
85
+ * @return boolean
86
+ */
87
+ public function required_plugins_check() {
88
+
89
+ $elementor_path = sprintf( '%s/%s.php', self::$elementor, self::$elementor );
90
+
91
+ if( ! defined('ELEMENTOR_VERSION' ) ) {
92
+
93
+ if ( ! self::is_plugin_installed( $elementor_path ) ) {
94
+
95
+ if( self::check_user_can( 'install_plugins' ) ) {
96
+
97
+ $install_url = wp_nonce_url( self_admin_url( sprintf( 'update.php?action=install-plugin&plugin=%s', self::$elementor ) ), 'install-plugin_elementor' );
98
+
99
+ $message = __( '<p>Premium Addons for Elementor is not working because you need to Install Elementor plugin.</p>', 'premium-addons-for-elementor' );
100
+
101
+ $message .= sprintf( '<p><a href="%s" class="button-primary">%s</a></p>', $install_url, __( 'Install Now', 'premium-addons-for-elementor' ) );
102
+
103
+ }
104
+ } else {
105
+ if( self::check_user_can( 'activate_plugins' ) ) {
106
+
107
+ $activation_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $elementor_path . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $elementor_path );
108
+
109
+ $message = '<p>' . __( 'Premium Addons for Elementor is not working because you need to activate Elementor plugin.', 'premium-addons-for-elementor' ) . '</p>';
110
+
111
+ $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $activation_url, __( 'Activate Now', 'premium-addons-for-elementor' ) ) . '</p>';
112
+
113
+ }
114
+ }
115
+ $this->render_admin_notices( $message );
116
+ }
117
+ }
118
+
119
+ /**
120
+ * Checks if review admin notice is dismissed
121
+ * @since 2.6.8
122
+ * @return boolean
123
+ */
124
+ public function get_review_notice() {
125
+
126
+ $review = get_option( 'pa_review_notice' );
127
+
128
+ $review_url = 'https://wordpress.org/support/plugin/premium-addons-for-elementor/reviews/?filter=5';
129
+
130
+ if ( '1' === $review ) {
131
+ return;
132
+ } else if ( '1' !== $review ) {
133
+ $optout_url = wp_nonce_url( add_query_arg( 'pa_review', 'opt_out' ), 'opt_out' );
134
+
135
+ $review_message = sprintf( __('<p style="display: flex; align-items: center; padding:10px 10px 10px 0;"><img src="%s" style="margin-right: 0.8em; width: 40px;">Did you like<strong>&nbspPremium Addons for Elementor&nbsp</strong>Plugin?<span>&nbspplease help us by leaving a five star review on WordPress.org.&nbsp</span><a href="%s" target="_blank" style="flex-grow: 2;">Leave a Review.</a>', 'premium-addons-for-elementor' ), PREMIUM_ADDONS_URL .'admin/images/premium-addons-logo.png' ,$review_url );
136
+
137
+ }
138
+
139
+ $review_message .= sprintf(__('<a href="%s" style="text-decoration: none; margin-left: 1em; float:right; "><span class="dashicons dashicons-dismiss"></span></a></p>', 'premium-addons-for-elementor'), $optout_url );
140
+
141
+ $this->render_admin_notices( $review_message );
142
+ }
143
+
144
+
145
+ /**
146
+ * Shows an admin notice when Elementor is missing.
147
+ * @since 2.6.8
148
+ * @return boolean
149
+ */
150
+ public function get_pro_notice(){
151
+
152
+ $pro_path = 'premium-addons-pro/premium-addons-pro-for-elementor.php';
153
+
154
+ $theme = self::get_installed_theme();
155
+
156
+ $url = sprintf( 'https://premiumaddons.com/pro/?utm_source=notification&utm_medium=wp-dash&utm_campaign=get-pro&utm_term=%s', $theme );
157
+
158
+ if ( ! self::is_plugin_installed( $pro_path ) && current_user_can( 'install_plugins' ) ) {
159
+
160
+ $get_pro = get_option( 'get_pa_pro_notice' );
161
+
162
+ if ( '1' === $get_pro ) {
163
+ return;
164
+ } else if ( '1' !== $get_pro ) {
165
+ $optout_url = wp_nonce_url( add_query_arg( 'get_pa_pro', 'opt_out' ), 'opt_out' );
166
+
167
+ $message = sprintf( __('<p style="display: flex; align-items: center; padding:10px 10px 10px 0;"><img src="%s" style="margin-right: 0.8em; width: 40px;"><strong>Premium Addons PRO&nbsp</strong><span> is now available!&nbsp</span><a href="%s" target="_blank" style="flex-grow: 2;"> Check it out now.</a>', 'premium-addons-for-elementor' ), PREMIUM_ADDONS_URL .'admin/images/premium-addons-logo.png' ,$url );
168
+
169
+ }
170
+
171
+ $message .= sprintf(__('<a href="%s" style="text-decoration: none; margin-left: 1em; float:right; "><span class="dashicons dashicons-dismiss"></span></a></p>', 'premium-addons-for-elementor'), $optout_url );
172
+
173
+ $this->render_admin_notices( $message );
174
+
175
+ }
176
+ }
177
+
178
+ /**
179
+ * Returns the active theme slug
180
+ */
181
+ public static function get_installed_theme() {
182
+
183
+ $theme = wp_get_theme();
184
+
185
+ if( $theme->parent() ) {
186
+
187
+ $theme_name = $theme->parent()->get('Name');
188
+
189
+ } else {
190
+
191
+ $theme_name = $theme->get('Name');
192
+
193
+ }
194
+
195
+ $theme_name = sanitize_key( $theme_name );
196
+
197
+ return $theme_name;
198
+ }
199
+
200
+
201
+ /**
202
+ * Checks if a plugin is installed
203
+ * @since 1.0.0
204
+ * @return boolean
205
+ */
206
+ public static function is_plugin_installed( $plugin_path ){
207
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
208
+ $plugins = get_plugins();
209
+ return isset( $plugins[ $plugin_path ] );
210
+ }
211
+
212
+ /**
213
+ * Checks user credentials
214
+ * @since 2.6.8
215
+ * @return boolean
216
+ */
217
+ public static function check_user_can($action) {
218
+ return current_user_can( $action );
219
+ }
220
+
221
+ /**
222
+ * Renders an admin notice error message
223
+ * @since 1.0.0
224
+ * @access private
225
+ * @return void
226
+ */
227
+ private function render_admin_notices( $message ) {
228
+ ?>
229
+ <div class="error pa-notice-wrap">
230
+ <?php echo $message; ?>
231
+ </div>
232
+ <?php
233
+ }
234
+
235
+ public static function get_instance(){
236
+ if( self::$instance == null ) {
237
+ self::$instance = new self;
238
+ }
239
+ return self::$instance;
240
+ }
241
+
242
+ }
243
+
244
+ if( ! function_exists('get_notices_instance') ) {
245
+ /**
246
+ * Returns an instance of the plugin class.
247
+ * @since 1.1.1
248
+ * @return object
249
+ */
250
+ function get_notices_instance() {
251
+ return Premium_Admin_Notices::get_instance();
252
+ }
253
+ }
254
+ get_notices_instance();
admin/settings/about.php CHANGED
@@ -6,7 +6,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
6
  class PA_About {
7
 
8
  public function create_about_menu(){
9
- if ( ! Helper_Functions::is_show_about()){
10
  add_submenu_page(
11
  'premium-addons',
12
  '',
@@ -20,15 +20,7 @@ class PA_About {
20
 
21
  public function pa_about_page(){
22
 
23
- $theme = wp_get_theme();
24
-
25
- if( $theme->parent() ) {
26
- $theme_name = $theme->parent()->get('Name');
27
- } else {
28
- $theme_name = $theme->get('Name');
29
- }
30
-
31
- $theme_name = sanitize_key( $theme_name );
32
 
33
  $url = sprintf('https://premiumaddons.com/pro/?utm_source=about-page&utm_medium=wp-dash&utm_campaign=get-pro&utm_term=%s', $theme_name );
34
 
@@ -42,7 +34,7 @@ class PA_About {
42
  <h1 class="pa-title-main"><?php echo Helper_Functions::name(); ?></h1>
43
  <h3 class="pa-title-sub"><?php echo sprintf(__('Thank you for using %s. This plugin has been developed by %s and we hope you enjoy using it.','premium-addons-for-elementor'), Helper_Functions::name(),Helper_Functions::author()); ?></h3>
44
  </div>
45
- <?php if( ! Helper_Functions::is_show_logo()) : ?>
46
  <div class="pa-title-right">
47
  <img class="pa-logo" src="<?php echo PREMIUM_ADDONS_URL . 'admin/images/premium-addons-logo.png';?>">
48
  </div>
@@ -60,7 +52,7 @@ class PA_About {
60
  <h4>What is Premium Addons?</h4>
61
  <p>Premium Addons for Elementor extends Elementor Page Builder capabilities with many fully customizable widgets and addons that help you to build impressive websites with no coding required.</p>
62
  <?php if( !defined('PREMIUM_PRO_ADDONS_VERSION') ) : ?>
63
- <p>Get more widgets and addons with <strong>Premium Addons Pro</strong> <a href="<?php echo esc_url( $url ); ?>" target="_blank" >Click Here</a> to know more.</p>
64
  <?php endif; ?>
65
  </div>
66
  </div>
6
  class PA_About {
7
 
8
  public function create_about_menu(){
9
+ if ( ! Helper_Functions::is_show_about() ) {
10
  add_submenu_page(
11
  'premium-addons',
12
  '',
20
 
21
  public function pa_about_page(){
22
 
23
+ $theme_name = Premium_Admin_Notices::get_installed_theme();
 
 
 
 
 
 
 
 
24
 
25
  $url = sprintf('https://premiumaddons.com/pro/?utm_source=about-page&utm_medium=wp-dash&utm_campaign=get-pro&utm_term=%s', $theme_name );
26
 
34
  <h1 class="pa-title-main"><?php echo Helper_Functions::name(); ?></h1>
35
  <h3 class="pa-title-sub"><?php echo sprintf(__('Thank you for using %s. This plugin has been developed by %s and we hope you enjoy using it.','premium-addons-for-elementor'), Helper_Functions::name(),Helper_Functions::author()); ?></h3>
36
  </div>
37
+ <?php if( ! Helper_Functions::is_show_logo() ) : ?>
38
  <div class="pa-title-right">
39
  <img class="pa-logo" src="<?php echo PREMIUM_ADDONS_URL . 'admin/images/premium-addons-logo.png';?>">
40
  </div>
52
  <h4>What is Premium Addons?</h4>
53
  <p>Premium Addons for Elementor extends Elementor Page Builder capabilities with many fully customizable widgets and addons that help you to build impressive websites with no coding required.</p>
54
  <?php if( !defined('PREMIUM_PRO_ADDONS_VERSION') ) : ?>
55
+ <p>Get more widgets and addons with <strong>Premium Addons Pro</strong> <a href="<?php echo esc_url( $url ); ?>" target="_blank" >Click Here</a> to know more.</p>
56
  <?php endif; ?>
57
  </div>
58
  </div>
admin/settings/elements.php CHANGED
@@ -8,7 +8,7 @@ class PA_admin_settings {
8
 
9
  protected $page_slug = 'premium-addons';
10
 
11
- public $pa_elements_keys = ['premium-banner', 'premium-blog','premium-carousel', 'premium-countdown','premium-counter','premium-dual-header','premium-fancytext','premium-image-separator','premium-maps','premium-modalbox','premium-person','premium-progressbar','premium-testimonials','premium-title','premium-videobox','premium-pricing-table','premium-button','premium-contactform', 'premium-image-button', 'premium-grid'];
12
 
13
  private $pa_default_settings;
14
 
@@ -25,7 +25,7 @@ class PA_admin_settings {
25
 
26
  public function localize_js_script(){
27
  wp_localize_script(
28
- 'premium-addons-admin-js',
29
  'premiumRollBackConfirm',
30
  [
31
  'home_url' => home_url(),
@@ -43,60 +43,53 @@ class PA_admin_settings {
43
  wp_enqueue_style( 'pa_admin_icon', PREMIUM_ADDONS_URL .'admin/assets/pa-elements-font/css/pafont.css' );
44
  $current_screen = get_current_screen();
45
  if( strpos($current_screen->id , $this->page_slug) !== false ){
 
46
 
47
- wp_register_style( 'premium-addons-admin-style', PREMIUM_ADDONS_URL.'admin/assets/admin.css' );
48
- wp_enqueue_style('premium-addons-admin-style');
49
 
50
- wp_register_style( 'premium-addons-sweetalert-style', PREMIUM_ADDONS_URL.'admin/assets/js/sweetalert2/css/sweetalert2.min.css' );
51
- wp_enqueue_style('premium-addons-sweetalert-style');
52
 
53
- wp_register_script('premium-addons-admin-js', PREMIUM_ADDONS_URL .'admin/assets/admin.js' , array('jquery'), PREMIUM_ADDONS_VERSION , true );
54
- wp_enqueue_script('premium-addons-admin-js');
55
 
56
- wp_register_script('premium-addons-admin-dialog', PREMIUM_ADDONS_URL . 'admin/assets/js/dialog/dialog.js',array('jquery-ui-position'),PREMIUM_ADDONS_VERSION,true);
57
- wp_enqueue_script('premium-addons-admin-dialog');
58
 
59
- wp_register_script( 'premium-addons-sweetalert-core', PREMIUM_ADDONS_URL.'admin/assets/js/sweetalert2/js/core.js', array( 'jquery' ), PREMIUM_ADDONS_VERSION, true );
60
- wp_enqueue_script('premium-addons-sweetalert-core');
61
-
62
- wp_register_script( 'premium-addons-sweetalert', PREMIUM_ADDONS_URL.'admin/assets/js/sweetalert2/js/sweetalert2.min.js', array( 'jquery', 'premium-addons-sweetalert-core' ), PREMIUM_ADDONS_VERSION, true );
63
- wp_enqueue_script('premium-addons-sweetalert');
64
 
65
  }
66
  }
67
 
68
  public function pa_admin_menu() {
69
- if( defined('PREMIUM_PRO_ADDONS_VERSION') && isset(get_option('pa_wht_lbl_save_settings')['premium-wht-lbl-plugin-name']) && '' != get_option('pa_wht_lbl_save_settings')['premium-wht-lbl-plugin-name'] ){
70
- $plugin_name = get_option('pa_wht_lbl_save_settings')['premium-wht-lbl-plugin-name'];
71
- } else {
 
72
  $plugin_name = 'Premium Addons for Elementor';
73
  }
74
 
75
- add_menu_page( $plugin_name, $plugin_name , 'manage_options', 'premium-addons', array( $this , 'pa_admin_page' ), '' , 100 );
 
 
 
 
 
 
 
 
76
  }
77
 
78
  public function pa_admin_page(){
79
-
80
- $theme = wp_get_theme();
81
 
82
- if( $theme->parent() ) {
83
- $theme_name = $theme->parent()->get('Name');
84
- } else {
85
- $theme_name = $theme->get('Name');
86
- }
87
-
88
- $theme_name = sanitize_key($theme_name);
89
-
90
  $js_info = array(
91
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
92
  'theme' => $theme_name
93
  );
94
 
95
- wp_localize_script( 'premium-addons-admin-js', 'settings', $js_info );
96
 
97
- $this->pa_default_settings = array_fill_keys( $this->pa_elements_keys, true );
98
 
99
- $this->pa_get_settings = get_option( 'pa_save_settings', $this->pa_default_settings );
100
 
101
  $pa_new_settings = array_diff_key( $this->pa_default_settings, $this->pa_get_settings );
102
 
@@ -579,40 +572,54 @@ class PA_admin_settings {
579
  <?php
580
  }
581
 
582
- public function pa_save_settings_with_ajax() {
583
 
584
- if( isset( $_POST['fields'] ) ) {
585
- parse_str( $_POST['fields'], $settings );
586
- }else {
587
- return;
588
- }
 
 
 
 
 
 
589
 
590
- $this->pa_settings = array(
591
- 'premium-banner' => intval( $settings['premium-banner'] ? 1 : 0 ),
592
- 'premium-blog' => intval( $settings['premium-blog'] ? 1 : 0 ),
593
- 'premium-carousel' => intval( $settings['premium-carousel'] ? 1 : 0 ),
594
- 'premium-countdown' => intval( $settings['premium-countdown'] ? 1 : 0 ),
595
- 'premium-counter' => intval( $settings['premium-counter'] ? 1 : 0 ),
596
- 'premium-dual-header' => intval( $settings['premium-dual-header'] ? 1 : 0 ),
597
- 'premium-fancytext' => intval( $settings['premium-fancytext'] ? 1 : 0 ),
598
- 'premium-image-separator' => intval( $settings['premium-image-separator'] ? 1 : 0 ),
599
- 'premium-maps' => intval( $settings['premium-maps'] ? 1 : 0 ),
600
- 'premium-modalbox' => intval( $settings['premium-modalbox'] ? 1 : 0 ),
601
- 'premium-person' => intval( $settings['premium-person'] ? 1 : 0 ),
602
- 'premium-progressbar' => intval( $settings['premium-progressbar'] ? 1 : 0 ),
603
- 'premium-testimonials' => intval( $settings['premium-testimonials'] ? 1 : 0 ),
604
- 'premium-title' => intval( $settings['premium-title'] ? 1 : 0 ),
605
- 'premium-videobox' => intval( $settings['premium-videobox'] ? 1 : 0 ),
606
- 'premium-pricing-table' => intval( $settings['premium-pricing-table'] ? 1 : 0),
607
- 'premium-button' => intval( $settings['premium-button'] ? 1 : 0),
608
- 'premium-contactform' => intval( $settings['premium-contactform'] ? 1 : 0),
609
- 'premium-image-button' => intval( $settings['premium-image-button'] ? 1 : 0),
610
- 'premium-grid' => intval( $settings['premium-grid'] ? 1 : 0),
611
- );
612
-
613
- update_option( 'pa_save_settings', $this->pa_settings );
614
-
615
- return true;
616
- die();
617
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
618
  }
8
 
9
  protected $page_slug = 'premium-addons';
10
 
11
+ public static $pa_elements_keys = ['premium-banner', 'premium-blog','premium-carousel', 'premium-countdown','premium-counter','premium-dual-header','premium-fancytext','premium-image-separator','premium-maps','premium-modalbox','premium-person','premium-progressbar','premium-testimonials','premium-title','premium-videobox','premium-pricing-table','premium-button','premium-contactform', 'premium-image-button', 'premium-grid'];
12
 
13
  private $pa_default_settings;
14
 
25
 
26
  public function localize_js_script(){
27
  wp_localize_script(
28
+ 'pa-admin-js',
29
  'premiumRollBackConfirm',
30
  [
31
  'home_url' => home_url(),
43
  wp_enqueue_style( 'pa_admin_icon', PREMIUM_ADDONS_URL .'admin/assets/pa-elements-font/css/pafont.css' );
44
  $current_screen = get_current_screen();
45
  if( strpos($current_screen->id , $this->page_slug) !== false ){
46
+ wp_enqueue_style( 'pa-admin-css', PREMIUM_ADDONS_URL.'admin/assets/admin.css' );
47
 
48
+ wp_enqueue_style( 'premium-addons-sweetalert-style', PREMIUM_ADDONS_URL.'admin/assets/js/sweetalert2/sweetalert2.min.css' );
 
49
 
50
+ wp_enqueue_script('pa-admin-js', PREMIUM_ADDONS_URL .'admin/assets/admin.js' , array('jquery'), PREMIUM_ADDONS_VERSION , true );
 
51
 
52
+ wp_enqueue_script('pa-admin-dialog', PREMIUM_ADDONS_URL . 'admin/assets/js/dialog/dialog.js',array('jquery-ui-position'),PREMIUM_ADDONS_VERSION,true);
 
53
 
54
+ wp_enqueue_script('pa-sweetalert-core', PREMIUM_ADDONS_URL . 'admin/assets/js/sweetalert2/core.js', array( 'jquery' ), PREMIUM_ADDONS_VERSION, true );
 
55
 
56
+ wp_enqueue_script( 'pa-sweetalert', PREMIUM_ADDONS_URL . 'admin/assets/js/sweetalert2/sweetalert2.min.js', array( 'jquery', 'pa-sweetalert-core' ), PREMIUM_ADDONS_VERSION, true );
 
 
 
 
57
 
58
  }
59
  }
60
 
61
  public function pa_admin_menu() {
62
+
63
+ $plugin_name = get_option('pa_wht_lbl_save_settings')['premium-wht-lbl-plugin-name'];
64
+
65
+ if( ! defined('PREMIUM_PRO_ADDONS_VERSION') || ! isset( $plugin_name ) || '' == $plugin_name ){
66
  $plugin_name = 'Premium Addons for Elementor';
67
  }
68
 
69
+ add_menu_page(
70
+ $plugin_name,
71
+ $plugin_name,
72
+ 'manage_options',
73
+ 'premium-addons',
74
+ array( $this , 'pa_admin_page' ),
75
+ '' ,
76
+ 100
77
+ );
78
  }
79
 
80
  public function pa_admin_page(){
81
+ $theme_name = Premium_Admin_Notices::get_installed_theme();
 
82
 
 
 
 
 
 
 
 
 
83
  $js_info = array(
84
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
85
  'theme' => $theme_name
86
  );
87
 
88
+ wp_localize_script( 'pa-admin-js', 'settings', $js_info );
89
 
90
+ $this->pa_default_settings = $this->get_default_keys();
91
 
92
+ $this->pa_get_settings = $this->get_enabled_keys();
93
 
94
  $pa_new_settings = array_diff_key( $this->pa_default_settings, $this->pa_get_settings );
95
 
572
  <?php
573
  }
574
 
575
+ public static function get_default_keys() {
576
 
577
+ $default_keys = array_fill_keys( self::$pa_elements_keys, true );
578
+
579
+ return $default_keys;
580
+ }
581
+
582
+ public static function get_enabled_keys() {
583
+
584
+ $enabled_keys = get_option( 'pa_save_settings', self::get_default_keys() );
585
+
586
+ return $enabled_keys;
587
+ }
588
 
589
+ public function pa_save_settings_with_ajax() {
590
+
591
+ if( isset( $_POST['fields'] ) ) {
592
+ parse_str( $_POST['fields'], $settings );
593
+ } else {
594
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
595
  }
596
+
597
+ $this->pa_settings = array(
598
+ 'premium-banner' => intval( $settings['premium-banner'] ? 1 : 0 ),
599
+ 'premium-blog' => intval( $settings['premium-blog'] ? 1 : 0 ),
600
+ 'premium-carousel' => intval( $settings['premium-carousel'] ? 1 : 0 ),
601
+ 'premium-countdown' => intval( $settings['premium-countdown'] ? 1 : 0 ),
602
+ 'premium-counter' => intval( $settings['premium-counter'] ? 1 : 0 ),
603
+ 'premium-dual-header' => intval( $settings['premium-dual-header'] ? 1 : 0 ),
604
+ 'premium-fancytext' => intval( $settings['premium-fancytext'] ? 1 : 0 ),
605
+ 'premium-image-separator' => intval( $settings['premium-image-separator'] ? 1 : 0 ),
606
+ 'premium-maps' => intval( $settings['premium-maps'] ? 1 : 0 ),
607
+ 'premium-modalbox' => intval( $settings['premium-modalbox'] ? 1 : 0 ),
608
+ 'premium-person' => intval( $settings['premium-person'] ? 1 : 0 ),
609
+ 'premium-progressbar' => intval( $settings['premium-progressbar'] ? 1 : 0 ),
610
+ 'premium-testimonials' => intval( $settings['premium-testimonials'] ? 1 : 0 ),
611
+ 'premium-title' => intval( $settings['premium-title'] ? 1 : 0 ),
612
+ 'premium-videobox' => intval( $settings['premium-videobox'] ? 1 : 0 ),
613
+ 'premium-pricing-table' => intval( $settings['premium-pricing-table'] ? 1 : 0),
614
+ 'premium-button' => intval( $settings['premium-button'] ? 1 : 0),
615
+ 'premium-contactform' => intval( $settings['premium-contactform'] ? 1 : 0),
616
+ 'premium-image-button' => intval( $settings['premium-image-button'] ? 1 : 0),
617
+ 'premium-grid' => intval( $settings['premium-grid'] ? 1 : 0),
618
+ );
619
+
620
+ update_option( 'pa_save_settings', $this->pa_settings );
621
+
622
+ return true;
623
+ die();
624
+ }
625
  }
admin/settings/gomaps.php CHANGED
@@ -6,7 +6,7 @@ if(!defined('ABSPATH')) exit;
6
 
7
  class PA_Gomaps {
8
 
9
- public $pa_maps_keys = [ 'premium-map-api', 'premium-map-disable-api' ];
10
 
11
  private $pa_maps_default_settings;
12
 
@@ -36,11 +36,11 @@ class PA_Gomaps {
36
  'ajaxurl' => admin_url( 'admin-ajax.php' )
37
  );
38
 
39
- wp_localize_script( 'premium-addons-admin-js', 'settings', $js_info );
40
 
41
- $this->pa_maps_default_settings = array_fill_keys( $this->pa_maps_keys, true );
42
 
43
- $this->pa_maps_get_settings = get_option( 'pa_maps_save_settings', $this->pa_maps_default_settings );
44
 
45
  $pa_maps_new_settings = array_diff_key( $this->pa_maps_default_settings, $this->pa_maps_get_settings );
46
 
@@ -99,6 +99,19 @@ class PA_Gomaps {
99
  </div>
100
  <?php }
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  public function pa_save_maps_settings_with_ajax() {
103
 
104
  if( isset( $_POST['fields'] ) ) {
6
 
7
  class PA_Gomaps {
8
 
9
+ public static $pa_maps_keys = [ 'premium-map-api', 'premium-map-disable-api' ];
10
 
11
  private $pa_maps_default_settings;
12
 
36
  'ajaxurl' => admin_url( 'admin-ajax.php' )
37
  );
38
 
39
+ wp_localize_script( 'pa-admin-js', 'settings', $js_info );
40
 
41
+ $this->pa_maps_default_settings = $this->get_default_keys();
42
 
43
+ $this->pa_maps_get_settings = $this->get_enabled_keys();
44
 
45
  $pa_maps_new_settings = array_diff_key( $this->pa_maps_default_settings, $this->pa_maps_get_settings );
46
 
99
  </div>
100
  <?php }
101
 
102
+ public static function get_default_keys() {
103
+
104
+ $default_keys = array_fill_keys( self::$pa_maps_keys, true );
105
+
106
+ return $default_keys;
107
+ }
108
+
109
+ public static function get_enabled_keys() {
110
+ $enabled_keys = get_option( 'pa_maps_save_settings', self::get_default_keys() );
111
+
112
+ return $enabled_keys;
113
+ }
114
+
115
  public function pa_save_maps_settings_with_ajax() {
116
 
117
  if( isset( $_POST['fields'] ) ) {
admin/settings/gopro.php CHANGED
@@ -21,7 +21,7 @@ class Pro_Settings {
21
 
22
  public function handle_custom_redirects() {
23
 
24
- $active_theme = $this->get_installed_theme();
25
 
26
  if ( empty( $_GET['page'] ) ) {
27
  return;
@@ -29,7 +29,7 @@ class Pro_Settings {
29
 
30
  if ( 'premium-addons-pro' === $_GET['page'] ) {
31
 
32
- $url = sprintf('https://premiumaddons.com/pro/?utm_source=wp-menu&utm_medium=wp-dash&utm_campaign=get-pro&utm_term=%s', $active_theme );
33
 
34
  wp_redirect( $url );
35
 
@@ -49,22 +49,6 @@ class Pro_Settings {
49
 
50
  $this->handle_custom_redirects();
51
 
52
- }
53
-
54
- public function get_installed_theme() {
55
-
56
- $theme = wp_get_theme();
57
-
58
- if( $theme->parent() ) {
59
- $theme_name = $theme->parent()->get('Name');
60
- } else {
61
- $theme_name = $theme->get('Name');
62
- }
63
-
64
- $theme_name = sanitize_key( $theme_name );
65
-
66
- return $theme_name;
67
-
68
  }
69
 
70
  public function __construct() {
21
 
22
  public function handle_custom_redirects() {
23
 
24
+ $theme_name = Premium_Admin_Notices::get_installed_theme();
25
 
26
  if ( empty( $_GET['page'] ) ) {
27
  return;
29
 
30
  if ( 'premium-addons-pro' === $_GET['page'] ) {
31
 
32
+ $url = sprintf('https://premiumaddons.com/pro/?utm_source=wp-menu&utm_medium=wp-dash&utm_campaign=get-pro&utm_term=%s', $theme_name );
33
 
34
  wp_redirect( $url );
35
 
49
 
50
  $this->handle_custom_redirects();
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
 
54
  public function __construct() {
admin/settings/version-control.php CHANGED
@@ -14,8 +14,7 @@ class PA_Version_Control {
14
 
15
  private $pa_beta_get_settings;
16
 
17
- public function __construct()
18
- {
19
  add_action( 'admin_menu', array ($this,'create_version_control_menu' ), 100 );
20
  add_action( 'wp_ajax_pa_beta_save_settings', array( $this, 'pa_beta_save_settings_with_ajax' ) );
21
  }
@@ -39,7 +38,7 @@ class PA_Version_Control {
39
  'ajaxurl' => admin_url( 'admin-ajax.php' )
40
  );
41
 
42
- wp_localize_script( 'premium-addons-admin-js', 'settings', $js_info );
43
 
44
  $this->pa_beta_default_settings = array_fill_keys( $this->pa_beta_keys, true );
45
 
@@ -80,7 +79,7 @@ class PA_Version_Control {
80
  <tr class="pa-roll-row">
81
  <th>Rollback Version</th>
82
  <td>
83
- <div><?php echo sprintf( '<a target="_blank" href="%s" class="button pa-btn pa-rollback-button elementor-button-spinner">Reinstall Version 2.6.5</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ) ); ?> </div>
84
  <p class="pa-roll-desc"><span>Warning: Please backup your database before making the rollback.</span></p>
85
  </td>
86
  </tr>
14
 
15
  private $pa_beta_get_settings;
16
 
17
+ public function __construct() {
 
18
  add_action( 'admin_menu', array ($this,'create_version_control_menu' ), 100 );
19
  add_action( 'wp_ajax_pa_beta_save_settings', array( $this, 'pa_beta_save_settings_with_ajax' ) );
20
  }
38
  'ajaxurl' => admin_url( 'admin-ajax.php' )
39
  );
40
 
41
+ wp_localize_script( 'pa-admin-js', 'settings', $js_info );
42
 
43
  $this->pa_beta_default_settings = array_fill_keys( $this->pa_beta_keys, true );
44
 
79
  <tr class="pa-roll-row">
80
  <th>Rollback Version</th>
81
  <td>
82
+ <div><?php echo sprintf( '<a target="_blank" href="%s" class="button pa-btn pa-rollback-button elementor-button-spinner">Reinstall Version 2.6.6</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ) ); ?> </div>
83
  <p class="pa-roll-desc"><span>Warning: Please backup your database before making the rollback.</span></p>
84
  </td>
85
  </tr>
elementor-helper.php CHANGED
@@ -57,7 +57,7 @@ class premium_Template_Tags {
57
 
58
  $all_posts = get_posts( array(
59
  'posts_per_page' => -1,
60
- 'post_type' => $post_type,
61
  )
62
  );
63
  if( !empty( $all_posts ) && !is_wp_error( $all_posts ) ) {
57
 
58
  $all_posts = get_posts( array(
59
  'posts_per_page' => -1,
60
+ 'post_type' => 'page',
61
  )
62
  );
63
  if( !empty( $all_posts ) && !is_wp_error( $all_posts ) ) {
includes/class-addons-category.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace PremiumAddons;
4
+
5
+ if( ! defined( 'ABSPATH' ) ) exit();
6
+
7
+ class Premium_Addons_Category {
8
+
9
+ private static $instance = null;
10
+
11
+ public function __construct() {
12
+ $this->create_premium_category();
13
+ }
14
+
15
+ public function create_premium_category() {
16
+ \Elementor\Plugin::instance()->elements_manager->add_category(
17
+ 'premium-elements',
18
+ array(
19
+ 'title' => Helper_Functions::get_category()
20
+ ),
21
+ 1);
22
+ }
23
+ /**
24
+ * Creates and returns an instance of the class
25
+ * @since 2.6.8
26
+ * @access public
27
+ * return object
28
+ */
29
+ public static function get_instance(){
30
+ if( self::$instance == null ) {
31
+ self::$instance = new self;
32
+ }
33
+ return self::$instance;
34
+ }
35
+ }
36
+
37
+
38
+ if ( ! function_exists( 'premium_addons_category' ) ) {
39
+
40
+ /**
41
+ * Returns an instance of the plugin class.
42
+ * @since 2.6.8
43
+ * @return object
44
+ */
45
+ function premium_addons_category() {
46
+ return Premium_Addons_Category::get_instance();
47
+ }
48
+ }
49
+ premium_addons_category();
includes/class-addons-integration.php ADDED
@@ -0,0 +1,241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace PremiumAddons;
4
+
5
+ if( ! defined( 'ABSPATH' ) ) exit();
6
+
7
+ class Premium_Addons_Integration {
8
+
9
+ private static $instance = null;
10
+
11
+ /**
12
+ * Initialize integration hooks
13
+ *
14
+ * @return void
15
+ */
16
+ public function __construct() {
17
+ add_action( 'elementor/editor/before_enqueue_styles', array( $this, 'premium_font_setup' ) );
18
+
19
+ add_action( 'elementor/frontend/after_enqueue_styles', array( $this, 'premium_required_assets' ) );
20
+
21
+ add_action( 'elementor/widgets/widgets_registered', array( $this, 'premium_widgets_area' ) );
22
+
23
+ add_action( 'elementor/frontend/after_register_scripts', array( $this, 'premium_register_scripts' ) );
24
+
25
+ add_action('elementor/editor/before_enqueue_scripts', array($this,'premium_maps_get_address'));
26
+
27
+ add_action('wp_enqueue_scripts', array($this, 'premium_maps_required_script'));
28
+ }
29
+
30
+ /**
31
+ * Loads plugin icons font
32
+ * @since 1.0.0
33
+ * @access public
34
+ * @return void
35
+ */
36
+ public function premium_font_setup() {
37
+ wp_enqueue_style(
38
+ 'premium-addons-font',
39
+ PREMIUM_ADDONS_URL . 'admin/assets/pa-elements-font/css/pa-elements.css'
40
+ );
41
+ }
42
+
43
+ /**
44
+ * Enqueue required CSS files
45
+ * @since 1.0.0
46
+ * @access public
47
+ */
48
+ public function premium_required_assets() {
49
+ wp_enqueue_style(
50
+ 'premium-addons',
51
+ PREMIUM_ADDONS_URL . 'assets/css/premium-addons.css',
52
+ array(),
53
+ PREMIUM_ADDONS_VERSION,
54
+ 'all'
55
+ );
56
+
57
+ $check_grid_active = PA_admin_settings::get_enabled_keys()['premium-grid'];
58
+ if( $check_grid_active ){
59
+ wp_enqueue_style('pa-prettyphoto', PREMIUM_ADDONS_URL . 'assets/css/prettyphoto.css', array(), PREMIUM_ADDONS_VERSION, 'all');
60
+ }
61
+
62
+ }
63
+
64
+ /** Load widgets require function
65
+ * @since 1.0.0
66
+ * @access public
67
+ */
68
+ public function premium_widgets_area() {
69
+ $this->premium_widget_register();
70
+ }
71
+
72
+ /** Requires widgets files
73
+ * @since 1.0.0
74
+ * @access private
75
+ */
76
+ private function premium_widget_register() {
77
+
78
+ $check_component_active = PA_admin_settings::get_enabled_keys();
79
+
80
+ foreach ( glob( PREMIUM_ADDONS_PATH . 'widgets/' . '*.php' ) as $file ) {
81
+
82
+ $slug = basename( $file, '.php' );
83
+
84
+ $enabled = isset( $check_component_active[ $slug ] ) ? $check_component_active[ $slug ] : '';
85
+
86
+ if ( filter_var( $enabled, FILTER_VALIDATE_BOOLEAN ) || ! $check_component_active ) {
87
+ $this->register_addon( $file );
88
+ }
89
+ }
90
+
91
+ }
92
+
93
+ /** Registers required JS files
94
+ * @since 1.0.0
95
+ * @access public
96
+ */
97
+ public function premium_register_scripts() {
98
+
99
+ $check_component_active = PA_admin_settings::get_enabled_keys();
100
+
101
+ if ( $check_component_active['premium-progressbar'] || $check_component_active['premium-videobox'] || $check_component_active['premium-grid'] || $check_component_active['premium-fancytext'] || $check_component_active['premium-countdown'] || $check_component_active['premium-carousel'] || $check_component_active['premium-banner'] || $check_component_active['premium-maps'] || $check_component_active['premium-modalbox'] || $check_component_active['premium-blog'] || $check_component_active['premium-counter'] ) {
102
+ wp_register_script('premium-addons-js', PREMIUM_ADDONS_URL . 'assets/js/premium-addons.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
103
+ }
104
+
105
+ if ( $check_component_active['premium-counter'] ) {
106
+ wp_register_script('counter-up-js', PREMIUM_ADDONS_URL . 'assets/js/lib/countUpmin.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
107
+ }
108
+
109
+ if ( $check_component_active['premium-grid']) {
110
+ wp_register_script('isotope-js', PREMIUM_ADDONS_URL . 'assets/js/lib/isotope.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
111
+ wp_register_script('prettyPhoto-js', PREMIUM_ADDONS_URL . 'assets/js/lib/prettyPhoto.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
112
+ }
113
+
114
+ if ( $check_component_active['premium-fancytext'] ) {
115
+ wp_register_script('vticker-js', PREMIUM_ADDONS_URL . 'assets/js/lib/Vticker.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
116
+ wp_register_script('typed-js', PREMIUM_ADDONS_URL . 'assets/js/lib/typedmin.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
117
+ }
118
+
119
+ if ( $check_component_active['premium-countdown'] ) {
120
+ wp_register_script('count-down-timer-js', PREMIUM_ADDONS_URL . 'assets/js/lib/jquerycountdown.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
121
+ }
122
+
123
+ if ( $check_component_active['premium-carousel'] ) {
124
+ wp_register_script('slick-carousel-js', PREMIUM_ADDONS_URL . 'assets/js/lib/slickmin.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
125
+ }
126
+
127
+ if ( $check_component_active['premium-blog'] ) {
128
+ wp_register_script('isotope-js', PREMIUM_ADDONS_URL . 'assets/js/lib/isotope.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
129
+ }
130
+
131
+ if ( $check_component_active['premium-modalbox'] ) {
132
+ wp_register_script('modal-js', PREMIUM_ADDONS_URL . 'assets/js/lib/modal.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
133
+ }
134
+ }
135
+
136
+ /*
137
+ * Enqueue Premium Maps API script
138
+ */
139
+ public function premium_maps_required_script() {
140
+
141
+ $premium_maps_api = PA_Gomaps::get_enabled_keys()['premium-map-api'];
142
+
143
+ $premium_maps_disable_api = PA_Gomaps::get_enabled_keys()['premium-map-disable-api'];
144
+
145
+ $premium_maps_enabled = PA_admin_settings::get_enabled_keys()['premium-maps'];
146
+
147
+ if( $premium_maps_disable_api ) {
148
+
149
+ wp_enqueue_script('premium-maps-api-js', 'https://maps.googleapis.com/maps/api/js?key=' . $premium_maps_api, array(), PREMIUM_ADDONS_VERSION, false);
150
+
151
+ }
152
+
153
+ if ( $premium_maps_enabled ) {
154
+
155
+ wp_enqueue_script('google-maps-cluster', 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js', array(), PREMIUM_ADDONS_VERSION, false);
156
+
157
+ }
158
+
159
+ }
160
+
161
+ public function premium_maps_get_address() {
162
+
163
+ $premium_maps_api = PA_Gomaps::get_enabled_keys()['premium-map-api'];
164
+
165
+ $premium_maps_disable_api = PA_Gomaps::get_enabled_keys()['premium-map-disable-api'];
166
+
167
+ $map_enabled = PA_admin_settings::get_enabled_keys()['premium-maps'];
168
+
169
+ $premium_maps_enabled = isset( $map_enabled ) ? $map_enabled : 1;
170
+
171
+ if ( $premium_maps_disable_api ) {
172
+
173
+ wp_enqueue_script('premium-maps-api-js', 'https://maps.googleapis.com/maps/api/js?key=' . $premium_maps_api, array(), PREMIUM_ADDONS_VERSION, false);
174
+
175
+ }
176
+
177
+ if( $premium_maps_enabled ) {
178
+
179
+ wp_enqueue_script('premium-maps-address', PREMIUM_ADDONS_URL . 'assets/js/premium-maps-address.js', array('jquery'), PREMIUM_ADDONS_VERSION, true);
180
+
181
+ }
182
+
183
+ }
184
+
185
+ /**
186
+ * Register addon by file name
187
+ *
188
+ * @param string $file File name.
189
+ * @param object $widgets_manager Widgets manager instance.
190
+ * @return void
191
+ */
192
+ public function register_addon( $file ) {
193
+ $base = basename( str_replace( '.php', '', $file ) );
194
+ $class = ucwords( str_replace( '-', ' ', $base ) );
195
+ $class = str_replace( ' ', '_', $class );
196
+ $class = sprintf( 'Elementor\%s', $class );
197
+
198
+ if( 'Elementor\Premium_Contactform' != $class ){
199
+ require $file;
200
+ } else {
201
+ if( function_exists('wpcf7') ) {
202
+ require $file;
203
+ }
204
+ }
205
+
206
+ if ( 'Elementor\Premium_Blog' == $class ) {
207
+ require_once ( PREMIUM_ADDONS_PATH . 'queries.php' );
208
+ }
209
+
210
+ if ( class_exists( $class ) ) {
211
+ \Elementor\PLUGIN::instance()->widgets_manager->register_widget_type( new $class );
212
+ }
213
+ }
214
+
215
+ /**
216
+ * Creates and returns an instance of the class
217
+ * @since 1.0.0
218
+ * @access public
219
+ * return object
220
+ */
221
+ public static function get_instance(){
222
+ if( self::$instance == null ) {
223
+ self::$instance = new self;
224
+ }
225
+ return self::$instance;
226
+ }
227
+ }
228
+
229
+
230
+ if ( ! function_exists( 'premium_addons_integration' ) ) {
231
+
232
+ /**
233
+ * Returns an instance of the plugin class.
234
+ * @since 1.0.0
235
+ * @return object
236
+ */
237
+ function premium_addons_integration() {
238
+ return Premium_Addons_Integration::get_instance();
239
+ }
240
+ }
241
+ premium_addons_integration();
includes/{beta-testers.php → class-beta-testers.php} RENAMED
@@ -2,7 +2,7 @@
2
 
3
  if ( ! defined( 'ABSPATH' ) ) exit;
4
 
5
- class PA_Beta_Testers {
6
  private $transient_key;
7
  private function get_beta_version() {
8
  $beta_version = get_site_transient( $this->transient_key );
2
 
3
  if ( ! defined( 'ABSPATH' ) ) exit;
4
 
5
+ class Premium_Beta_Testers {
6
  private $transient_key;
7
  private function get_beta_version() {
8
  $beta_version = get_site_transient( $this->transient_key );
premium-addons-for-elementor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Premium Addons for Elementor
4
  Description: Premium Addons Plugin Includes 20 premium widgets for Elementor Page Builder.
5
  Plugin URI: https://premiumaddons.com
6
- Version: 2.6.6
7
  Author: Leap13
8
  Author URI: http://leap13.com/
9
  Text Domain: premium-addons-for-elementor
@@ -15,507 +15,164 @@ License: GNU General Public License v3.0
15
  /**
16
  * Checking if WordPress is installed
17
  */
18
- if (!function_exists('add_action')) {
19
  die('WordPress not Installed'); // if WordPress not installed kill the page.
20
  }
21
 
22
- if (!defined('ABSPATH')) exit; // No access of directly access
23
 
24
 
25
- define('PREMIUM_ADDONS_VERSION', '2.6.6');
26
  define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
27
  define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
28
  define('PREMIUM_ADDONS_FILE', __FILE__);
29
  define('PREMIUM_ADDONS_BASENAME', plugin_basename(__FILE__));
30
- define('PREMIUM_ADDONS_STABLE_VERSION', '2.6.5');
31
 
32
- /**
33
- * Loading text domain, Including required files
34
- */
35
- add_action('plugins_loaded', 'premium_addons_elementor_setup');
36
- function premium_addons_elementor_setup() {
37
-
38
- load_plugin_textdomain('premium-addons-for-elementor', false, dirname(plugin_basename(__FILE__)) . '/languages/');
39
-
40
- // Requires System Info When on Dashboard
41
- if (is_admin()) {
42
- require_once (PREMIUM_ADDONS_PATH . 'includes/system-info.php');
43
- require_once (PREMIUM_ADDONS_PATH . 'includes/maintenance.php');
44
- require_once (PREMIUM_ADDONS_PATH . 'includes/rollback.php');
45
- require_once (PREMIUM_ADDONS_PATH . 'includes/beta-testers.php');
46
- require_once (PREMIUM_ADDONS_PATH . 'plugin.php');
47
- require_once (PREMIUM_ADDONS_PATH . 'admin/settings/about.php');
48
- require_once (PREMIUM_ADDONS_PATH . 'admin/settings/version-control.php');
49
- require_once (PREMIUM_ADDONS_PATH . 'admin/settings/sys-info.php');
50
- require_once (PREMIUM_ADDONS_PATH . 'admin/settings/gopro.php');
51
- $beta_testers = new PA_Beta_Testers();
52
- }
53
-
54
- require_once (PREMIUM_ADDONS_PATH . 'includes/helper-functions.php');
55
- require_once (PREMIUM_ADDONS_PATH . 'admin/settings/gomaps.php');
56
- require_once (PREMIUM_ADDONS_PATH . 'admin/settings/elements.php');
57
-
58
- // load the template tags
59
- if (file_exists(PREMIUM_ADDONS_PATH . 'elementor-helper.php')) {
60
- require_once (PREMIUM_ADDONS_PATH . 'elementor-helper.php');
61
- }
62
-
63
  /*
64
- * Instantiate the premium Addons for the elementor page builder
65
- * Included 1. 'premium_addons_widget_register()' for the main method for initaite addons
66
- * 2. 'premium_addons_widgets_area()' creating the widgets
67
- * 3. 'initiate_elementor_addons()' creating the category of the widgets
68
  */
69
-
70
- new premium_Addon_Elementor();
71
- }
72
-
73
- // CSS THAT DISPLAYS ON EDITOR PANEL
74
- add_action('elementor/editor/before_enqueue_scripts', function () {
75
-
76
- wp_register_style('premium-elements-progression-admin-styles', PREMIUM_ADDONS_URL . 'admin/assets/pa-elements-font/css/pa-elements.css');
77
- wp_enqueue_style('premium-elements-progression-admin-styles');
78
-
79
- });
80
-
81
- /*Automatic Redirection Upon Activation*/
82
- register_activation_hook(__FILE__, 'pa_activation');
83
-
84
- add_action('admin_init', 'pa_redirection');
85
-
86
- function pa_activation() {
87
- add_option('pa_activation_redirect', true);
88
- }
89
-
90
- function pa_redirection() {
91
-
92
- if (get_option('pa_activation_redirect', false)) {
93
- delete_option('pa_activation_redirect');
94
- if (!is_network_admin()) {
95
- wp_redirect("admin.php?page=premium-addons");
96
- }
97
- }
98
- }
99
-
100
- class premium_Addon_Elementor {
101
-
102
- protected $pa_elements_keys = ['premium-banner', 'premium-blog', 'premium-carousel', 'premium-countdown', 'premium-counter', 'premium-dual-header', 'premium-fancytext', 'premium-image-separator', 'premium-maps', 'premium-modalbox', 'premium-person', 'premium-progressbar', 'premium-testimonials', 'premium-title', 'premium-videobox', 'premium-pricing-table', 'premium-contactform', 'premium-button', 'premium-image-button', 'premium-grid'];
103
-
104
- /**
105
- * Load all the hooks here
106
- * @since 1.0
107
- */
108
- public function __construct() {
109
- add_action('admin_init', array( $this, 'handle_get_pro_notice'));
110
- add_action('admin_init', array( $this, 'handle_review_notice'));
111
- add_action('admin_notices', array( $this, 'required_plugins_check' ));
112
- add_action('admin_notices', array( $this, 'premium_admin_notices'));
113
- add_action('elementor/init', array($this, 'initiate_elementor_addons'));
114
- add_action('elementor/widgets/widgets_registered', array($this, 'premium_addons_widget_register'));
115
- add_action('elementor/frontend/after_register_scripts', array($this, 'premium_addons_register_scripts'));
116
- add_action('elementor/frontend/after_register_styles', array($this, 'premium_addons_register_styles'));
117
- add_action('elementor/editor/before_enqueue_scripts', array($this,'premium_maps_get_address'));
118
- add_action('elementor/frontend/after_enqueue_styles', array($this, 'premium_addons_enqueue_styles'));
119
- add_action('wp_enqueue_scripts', array($this, 'premium_maps_required_script'));
120
- add_action('admin_post_premium_addons_rollback', 'post_premium_addons_rollback');
121
- }
122
-
123
- /**
124
- * Shows an admin notice when Elementor is missing
125
- */
126
- public function required_plugins_check() {
127
-
128
- $elementor_path = 'elementor/elementor.php';
129
 
130
- if( !defined('ELEMENTOR_VERSION') ) {
131
-
132
- if ( ! is_plugin_installed( $elementor_path ) ) {
133
-
134
- if( current_user_can( 'install_plugins' ) ) {
135
-
136
- $install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' );
137
-
138
- $message = __( '<p>Premium Addons for Elementor is not working because you need to Install Elementor plugin.</p>', 'premium-addons-for-elementor' );
139
-
140
- $message .= sprintf( '<p><a href="%s" class="button-primary">%s</a></p>', $install_url, __( 'Install Now', 'premium-addons-for-elementor' ) );
141
-
142
- $this->render_admin_notices( $message );
143
-
144
- }
145
- } else {
146
- if( current_user_can( 'activate_plugins' ) ) {
147
-
148
- $plugin = 'elementor/elementor.php';
149
-
150
- $activation_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin );
151
-
152
- $message = '<p>' . __( 'Premium Addons for Elementor is not working because you need to activate Elementor plugin.', 'premium-addons-for-elementor' ) . '</p>';
153
-
154
- $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $activation_url, __( 'Activate Now', 'premium-addons-for-elementor' ) ) . '</p>';
155
-
156
- $this->render_admin_notices( $message );
157
- }
158