Version Description
- Tweak: Show WooCommerce placeholder image if the current product has no thumbnail in WooCommerce Products Listing widget.
- Fixed: Enable Beta Tester option is not working.
Download this release
Release Info
Developer | leap13 |
Plugin | Premium Addons for Elementor |
Version | 4.8.10 |
Comparing to | |
See all releases |
Code changes from version 4.8.9 to 4.8.10
- admin/assets/js/admin.js +473 -473
- admin/includes/admin-helper.php +1062 -1061
- admin/includes/templates/features.php +185 -185
- includes/templates/sources/base.php +2 -2
- modules/woocommerce/templates/product-1.php +2 -1
- modules/woocommerce/templates/product-10.php +2 -1
- modules/woocommerce/templates/product-11.php +13 -13
- modules/woocommerce/templates/product-2.php +4 -3
- modules/woocommerce/templates/product-3.php +3 -2
- modules/woocommerce/templates/product-4.php +3 -2
- modules/woocommerce/templates/product-5.php +3 -2
- modules/woocommerce/templates/product-6.php +3 -2
- modules/woocommerce/templates/product-7.php +8 -7
- modules/woocommerce/templates/product-8.php +2 -1
- modules/woocommerce/templates/product-9.php +2 -1
- premium-addons-for-elementor.php +31 -31
- readme.txt +6 -1
admin/assets/js/admin.js
CHANGED
@@ -1,473 +1,473 @@
|
|
1 |
-
(function ($) {
|
2 |
-
|
3 |
-
"use strict";
|
4 |
-
|
5 |
-
var redHadfontLink = document.createElement('link');
|
6 |
-
redHadfontLink.rel = 'stylesheet';
|
7 |
-
redHadfontLink.href = 'https://fonts.googleapis.com/css?family=Red Hat Display:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic';
|
8 |
-
redHadfontLink.type = 'text/css';
|
9 |
-
document.head.appendChild(redHadfontLink);
|
10 |
-
|
11 |
-
var poppinsfontLink = document.createElement('link');
|
12 |
-
poppinsfontLink.rel = 'stylesheet';
|
13 |
-
poppinsfontLink.href = 'https://fonts.googleapis.com/css?family=Poppins:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic';
|
14 |
-
poppinsfontLink.type = 'text/css';
|
15 |
-
document.head.appendChild(poppinsfontLink);
|
16 |
-
|
17 |
-
var settings = premiumAddonsSettings.settings;
|
18 |
-
|
19 |
-
window.PremiumAddonsNavigation = function () {
|
20 |
-
|
21 |
-
var self = this,
|
22 |
-
$tabs = $(".pa-settings-tab"),
|
23 |
-
$elementsTabs = $(".pa-elements-tab");
|
24 |
-
|
25 |
-
self.init = function () {
|
26 |
-
|
27 |
-
if (!$tabs.length) {
|
28 |
-
return;
|
29 |
-
}
|
30 |
-
|
31 |
-
self.initNavTabs($tabs);
|
32 |
-
|
33 |
-
self.initElementsTabs($elementsTabs);
|
34 |
-
|
35 |
-
if (
|
36 |
-
self.getUnusedWidget();
|
37 |
-
}
|
38 |
-
|
39 |
-
self.handleElementsActions();
|
40 |
-
|
41 |
-
self.handleSettingsSave();
|
42 |
-
|
43 |
-
self.handleRollBack();
|
44 |
-
|
45 |
-
self.handleNewsLetterForm();
|
46 |
-
|
47 |
-
self.handlePaproActions();
|
48 |
-
|
49 |
-
};
|
50 |
-
|
51 |
-
// Handle settings form submission
|
52 |
-
self.handleSettingsSave = function () {
|
53 |
-
|
54 |
-
$("#pa-features .pa-section-info-cta input, #pa-modules .pa-switcher input").on(
|
55 |
-
'change',
|
56 |
-
function () {
|
57 |
-
self.saveElementsSettings('elements');
|
58 |
-
}
|
59 |
-
)
|
60 |
-
|
61 |
-
$("#pa-ver-control input, #pa-integrations input, #pa-ver-control input, #pa-integrations select").change(
|
62 |
-
function () {
|
63 |
-
self.saveElementsSettings('additional');
|
64 |
-
}
|
65 |
-
);
|
66 |
-
|
67 |
-
$("#pa-integrations input[type=text]").on(
|
68 |
-
'keyup',
|
69 |
-
function () {
|
70 |
-
self.saveElementsSettings('additional');
|
71 |
-
}
|
72 |
-
)
|
73 |
-
|
74 |
-
};
|
75 |
-
|
76 |
-
//get unused widgets.
|
77 |
-
self.getUnusedWidget = function () {
|
78 |
-
|
79 |
-
if (
|
80 |
-
$(".pa-btn-group .pa-btn-unused").addClass("dimmed");
|
81 |
-
}
|
82 |
-
|
83 |
-
$.ajax(
|
84 |
-
{
|
85 |
-
url: settings.ajaxurl,
|
86 |
-
type: 'POST',
|
87 |
-
data: {
|
88 |
-
action: 'pa_get_unused_widgets',
|
89 |
-
security: settings.nonce,
|
90 |
-
},
|
91 |
-
success: function (response) {
|
92 |
-
console.log('unused widgets retrieved');
|
93 |
-
self.unusedElements = response.data;
|
94 |
-
},
|
95 |
-
error: function (err) {
|
96 |
-
console.log(err);
|
97 |
-
}
|
98 |
-
}
|
99 |
-
);
|
100 |
-
};
|
101 |
-
|
102 |
-
// Handle global enable/disable buttons
|
103 |
-
self.handleElementsActions = function () {
|
104 |
-
|
105 |
-
$(".pa-elements-filter select").on(
|
106 |
-
'change',
|
107 |
-
function () {
|
108 |
-
var filter = $(this).val(),
|
109 |
-
$activeTab = $(".pa-switchers-container").not(".hidden");
|
110 |
-
|
111 |
-
$activeTab.find(".pa-switcher").removeClass("hidden");
|
112 |
-
|
113 |
-
if ('free' === filter) {
|
114 |
-
$activeTab.find(".pro-element").addClass("hidden");
|
115 |
-
} else if ('pro' === filter) {
|
116 |
-
$activeTab.find(".pa-switcher").not(".pro-element").addClass("hidden");
|
117 |
-
}
|
118 |
-
}
|
119 |
-
);
|
120 |
-
|
121 |
-
// Enable/Disable all widgets
|
122 |
-
$(".pa-btn-group").on(
|
123 |
-
"click",
|
124 |
-
'.pa-btn',
|
125 |
-
function () {
|
126 |
-
|
127 |
-
var $btn = $(this),
|
128 |
-
isChecked = $btn.hasClass("pa-btn-enable");
|
129 |
-
|
130 |
-
if (!$btn.hasClass("active")) {
|
131 |
-
$(".pa-btn-group .pa-btn").removeClass("active");
|
132 |
-
$btn.addClass("active");
|
133 |
-
|
134 |
-
$.ajax(
|
135 |
-
{
|
136 |
-
url: settings.ajaxurl,
|
137 |
-
type: 'POST',
|
138 |
-
data: {
|
139 |
-
action: 'pa_save_global_btn',
|
140 |
-
security: settings.nonce,
|
141 |
-
isGlobalOn: isChecked
|
142 |
-
}
|
143 |
-
}
|
144 |
-
);
|
145 |
-
|
146 |
-
}
|
147 |
-
|
148 |
-
if (isChecked) {
|
149 |
-
$(".pa-btn-group .pa-btn-unused").removeClass("dimmed");
|
150 |
-
} else {
|
151 |
-
$(".pa-btn-group .pa-btn-unused").addClass("dimmed");
|
152 |
-
}
|
153 |
-
|
154 |
-
$("#pa-modules .pa-switcher input").prop("checked", isChecked);
|
155 |
-
|
156 |
-
self.saveElementsSettings('elements');
|
157 |
-
|
158 |
-
}
|
159 |
-
);
|
160 |
-
|
161 |
-
//Disable unused widgets.
|
162 |
-
$(".pa-btn-group").on(
|
163 |
-
"click",
|
164 |
-
'.pa-btn-unused',
|
165 |
-
function () {
|
166 |
-
|
167 |
-
$.each(self.unusedElements, function (index, selector) {
|
168 |
-
$('#pa-modules .pa-switcher.' + selector).find('input').prop('checked', false);
|
169 |
-
});
|
170 |
-
|
171 |
-
$(this).addClass('dimmed');
|
172 |
-
|
173 |
-
self.saveElementsSettings('elements');
|
174 |
-
}
|
175 |
-
);
|
176 |
-
|
177 |
-
$("#pa-modules .pa-switcher input").on(
|
178 |
-
'change',
|
179 |
-
function () {
|
180 |
-
var $this = $(this),
|
181 |
-
id = $this.attr('id'),
|
182 |
-
isChecked = $this.prop('checked');
|
183 |
-
|
184 |
-
$("input[name='" + id + "']").prop('checked', isChecked);
|
185 |
-
}
|
186 |
-
)
|
187 |
-
|
188 |
-
};
|
189 |
-
|
190 |
-
// Handle Tabs Elements
|
191 |
-
self.initElementsTabs = function ($elem) {
|
192 |
-
|
193 |
-
var $links = $elem.find('a'),
|
194 |
-
$sections = $(".pa-switchers-container");
|
195 |
-
|
196 |
-
$sections.eq(0).removeClass("hidden");
|
197 |
-
$links.eq(0).addClass("active");
|
198 |
-
|
199 |
-
$links.on(
|
200 |
-
'click',
|
201 |
-
function (e) {
|
202 |
-
|
203 |
-
e.preventDefault();
|
204 |
-
|
205 |
-
var $link = $(this),
|
206 |
-
href = $link.attr('href');
|
207 |
-
|
208 |
-
// Set this tab to active
|
209 |
-
$links.removeClass("active");
|
210 |
-
$link.addClass("active");
|
211 |
-
|
212 |
-
// Navigate to tab section
|
213 |
-
$sections.addClass("hidden");
|
214 |
-
$("#" + href).removeClass("hidden");
|
215 |
-
|
216 |
-
}
|
217 |
-
);
|
218 |
-
};
|
219 |
-
|
220 |
-
// Handle settings tabs
|
221 |
-
self.initNavTabs = function ($elem) {
|
222 |
-
|
223 |
-
var $links = $elem.find('a'),
|
224 |
-
$lastSection = null;
|
225 |
-
|
226 |
-
$(window).on(
|
227 |
-
'hashchange',
|
228 |
-
function () {
|
229 |
-
|
230 |
-
var hash = window.location.hash.match(new RegExp('tab=([^&]*)')),
|
231 |
-
slug = hash ? hash[1] : $links.first().attr('href').replace('#tab=', ''),
|
232 |
-
$link = $('#pa-tab-link-' + slug);
|
233 |
-
|
234 |
-
if (!$link.length) {
|
235 |
-
return
|
236 |
-
|
237 |
-
}
|
238 |
-
$links.removeClass('pa-section-active');
|
239 |
-
$link.addClass('pa-section-active');
|
240 |
-
|
241 |
-
// Hide the last active section
|
242 |
-
if ($lastSection) {
|
243 |
-
$lastSection.hide();
|
244 |
-
}
|
245 |
-
|
246 |
-
var $section = $('#pa-section-' + slug);
|
247 |
-
$section.css(
|
248 |
-
{
|
249 |
-
display: 'block'
|
250 |
-
}
|
251 |
-
);
|
252 |
-
|
253 |
-
$lastSection = $section;
|
254 |
-
|
255 |
-
}
|
256 |
-
).trigger('hashchange');
|
257 |
-
|
258 |
-
};
|
259 |
-
|
260 |
-
self.handleRollBack = function () {
|
261 |
-
|
262 |
-
// Rollback button
|
263 |
-
$('.pa-rollback-button').on(
|
264 |
-
'click',
|
265 |
-
function (event) {
|
266 |
-
|
267 |
-
event.preventDefault();
|
268 |
-
|
269 |
-
var $this = $(this),
|
270 |
-
href = $this.attr('href');
|
271 |
-
|
272 |
-
if (!href) {
|
273 |
-
return;
|
274 |
-
}
|
275 |
-
|
276 |
-
// Show PAPRO stable version if PAPRO Rollback is clicked
|
277 |
-
var isPAPRO = '';
|
278 |
-
if (-1 !== href.indexOf('papro_rollback')) {
|
279 |
-
isPAPRO = 'papro_';
|
280 |
-
}
|
281 |
-
|
282 |
-
var premiumRollBackConfirm = premiumAddonsSettings.premiumRollBackConfirm;
|
283 |
-
|
284 |
-
var dialogsManager = new DialogsManager.Instance();
|
285 |
-
|
286 |
-
dialogsManager.createWidget(
|
287 |
-
'confirm',
|
288 |
-
{
|
289 |
-
headerMessage: premiumRollBackConfirm.i18n.rollback_to_previous_version,
|
290 |
-
message: premiumRollBackConfirm['i18n'][isPAPRO + 'rollback_confirm'],
|
291 |
-
strings: {
|
292 |
-
cancel: premiumRollBackConfirm.i18n.cancel,
|
293 |
-
confirm: premiumRollBackConfirm.i18n.yes,
|
294 |
-
},
|
295 |
-
onConfirm: function () {
|
296 |
-
|
297 |
-
$this.addClass('loading');
|
298 |
-
|
299 |
-
location.href = $this.attr('href');
|
300 |
-
|
301 |
-
}
|
302 |
-
}
|
303 |
-
).show();
|
304 |
-
}
|
305 |
-
);
|
306 |
-
|
307 |
-
};
|
308 |
-
|
309 |
-
self.saveElementsSettings = function (action) { //save elements settings changes
|
310 |
-
|
311 |
-
var $form = null;
|
312 |
-
|
313 |
-
if ('elements' === action) {
|
314 |
-
$form = $('form#pa-settings, form#pa-features');
|
315 |
-
action = 'pa_elements_settings';
|
316 |
-
} else {
|
317 |
-
$form = $('
|
318 |
-
action = 'pa_additional_settings';
|
319 |
-
}
|
320 |
-
|
321 |
-
$.ajax(
|
322 |
-
{
|
323 |
-
url: settings.ajaxurl,
|
324 |
-
type: 'POST',
|
325 |
-
data: {
|
326 |
-
action: action,
|
327 |
-
security: settings.nonce,
|
328 |
-
fields: $form.serialize(),
|
329 |
-
},
|
330 |
-
success: function (response) {
|
331 |
-
|
332 |
-
console.log("settings saved");
|
333 |
-
},
|
334 |
-
error: function (err) {
|
335 |
-
|
336 |
-
console.log(err);
|
337 |
-
|
338 |
-
}
|
339 |
-
}
|
340 |
-
);
|
341 |
-
|
342 |
-
}
|
343 |
-
|
344 |
-
self.handlePaproActions = function () {
|
345 |
-
|
346 |
-
// Trigger SWAL for PRO elements
|
347 |
-
$(".pro-slider").on(
|
348 |
-
'click',
|
349 |
-
function () {
|
350 |
-
|
351 |
-
var redirectionLink = " https://premiumaddons.com/pro/?utm_source=wp-menu&utm_medium=wp-dash&utm_campaign=get-pro&utm_term=";
|
352 |
-
|
353 |
-
Swal.fire(
|
354 |
-
{
|
355 |
-
title: '<span class="pa-swal-head">Get PRO Widgets & Addons<span>',
|
356 |
-
html: 'Supercharge your Elementor with PRO widgets and addons that you won’t find anywhere else.',
|
357 |
-
type: 'warning',
|
358 |
-
showCloseButton: true,
|
359 |
-
showCancelButton: true,
|
360 |
-
cancelButtonText: "More Info",
|
361 |
-
focusConfirm: true,
|
362 |
-
customClass: 'pa-swal',
|
363 |
-
}
|
364 |
-
).then(
|
365 |
-
function (res) {
|
366 |
-
// Handle More Info button
|
367 |
-
if (res.dismiss === 'cancel') {
|
368 |
-
window.open(redirectionLink + settings.theme, '_blank');
|
369 |
-
}
|
370 |
-
|
371 |
-
}
|
372 |
-
);
|
373 |
-
}
|
374 |
-
);
|
375 |
-
|
376 |
-
// Trigger SWAL for White Labeling
|
377 |
-
$(".premium-white-label-form.pro-inactive").on(
|
378 |
-
'submit',
|
379 |
-
function (e) {
|
380 |
-
|
381 |
-
e.preventDefault();
|
382 |
-
|
383 |
-
var redirectionLink = " https://premiumaddons.com/pro/?utm_source=wp-menu&utm_medium=wp-dash&utm_campaign=get-pro&utm_term=";
|
384 |
-
|
385 |
-
Swal.fire(
|
386 |
-
{
|
387 |
-
title: '<span class="pa-swal-head">Enable White Labeling Options<span>',
|
388 |
-
html: 'Premium Addons can be completely re-branded with your own brand name and author details. Your clients will never know what tools you are using to build their website and will think that this is your own tool set. White-labeling works as long as your license is active.',
|
389 |
-
type: 'warning',
|
390 |
-
showCloseButton: true,
|
391 |
-
showCancelButton: true,
|
392 |
-
cancelButtonText: "More Info",
|
393 |
-
focusConfirm: true
|
394 |
-
}
|
395 |
-
).then(
|
396 |
-
function (res) {
|
397 |
-
// Handle More Info button
|
398 |
-
if (res.dismiss === 'cancel') {
|
399 |
-
window.open(redirectionLink + settings.theme, '_blank');
|
400 |
-
}
|
401 |
-
|
402 |
-
}
|
403 |
-
);
|
404 |
-
}
|
405 |
-
);
|
406 |
-
|
407 |
-
};
|
408 |
-
|
409 |
-
self.handleNewsLetterForm = function () {
|
410 |
-
|
411 |
-
$('.pa-newsletter-form').on('submit', function (e) {
|
412 |
-
e.preventDefault();
|
413 |
-
|
414 |
-
var email = $("#pa_news_email").val();
|
415 |
-
|
416 |
-
if (checkEmail(email)) {
|
417 |
-
$.ajax(
|
418 |
-
{
|
419 |
-
url: settings.ajaxurl,
|
420 |
-
type: 'POST',
|
421 |
-
data: {
|
422 |
-
action: 'subscribe_newsletter',
|
423 |
-
security: settings.nonce,
|
424 |
-
email: email
|
425 |
-
},
|
426 |
-
beforeSend: function () {
|
427 |
-
console.log("Adding user to subscribers list");
|
428 |
-
},
|
429 |
-
success: function (response) {
|
430 |
-
if (response.data) {
|
431 |
-
var status = response.data.status;
|
432 |
-
if (status) {
|
433 |
-
console.log("User added to subscribers list");
|
434 |
-
swal.fire({
|
435 |
-
title: 'Thanks for subscribing!',
|
436 |
-
text: 'Click OK to continue',
|
437 |
-
type: 'success',
|
438 |
-
timer: 1000
|
439 |
-
});
|
440 |
-
}
|
441 |
-
|
442 |
-
}
|
443 |
-
|
444 |
-
},
|
445 |
-
error: function (err) {
|
446 |
-
console.log(err);
|
447 |
-
}
|
448 |
-
}
|
449 |
-
);
|
450 |
-
} else {
|
451 |
-
Swal.fire({
|
452 |
-
type: 'error',
|
453 |
-
title: 'Invalid Email Address...',
|
454 |
-
text: 'Please enter a valid email address!'
|
455 |
-
});
|
456 |
-
}
|
457 |
-
|
458 |
-
})
|
459 |
-
|
460 |
-
}
|
461 |
-
|
462 |
-
function checkEmail(emailAddress) {
|
463 |
-
var pattern = new RegExp(/^(("[\w-+\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-+\s]+")([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][\d]\.|1[\d]{2}\.|[\d]{1,2}\.))((25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\.){2}(25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\]?$)/i);
|
464 |
-
return pattern.test(emailAddress);
|
465 |
-
}
|
466 |
-
|
467 |
-
};
|
468 |
-
|
469 |
-
var instance = new PremiumAddonsNavigation();
|
470 |
-
|
471 |
-
instance.init();
|
472 |
-
|
473 |
-
})(jQuery);
|
1 |
+
(function ($) {
|
2 |
+
|
3 |
+
"use strict";
|
4 |
+
|
5 |
+
var redHadfontLink = document.createElement('link');
|
6 |
+
redHadfontLink.rel = 'stylesheet';
|
7 |
+
redHadfontLink.href = 'https://fonts.googleapis.com/css?family=Red Hat Display:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic';
|
8 |
+
redHadfontLink.type = 'text/css';
|
9 |
+
document.head.appendChild(redHadfontLink);
|
10 |
+
|
11 |
+
var poppinsfontLink = document.createElement('link');
|
12 |
+
poppinsfontLink.rel = 'stylesheet';
|
13 |
+
poppinsfontLink.href = 'https://fonts.googleapis.com/css?family=Poppins:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic';
|
14 |
+
poppinsfontLink.type = 'text/css';
|
15 |
+
document.head.appendChild(poppinsfontLink);
|
16 |
+
|
17 |
+
var settings = premiumAddonsSettings.settings;
|
18 |
+
|
19 |
+
window.PremiumAddonsNavigation = function () {
|
20 |
+
|
21 |
+
var self = this,
|
22 |
+
$tabs = $(".pa-settings-tab"),
|
23 |
+
$elementsTabs = $(".pa-elements-tab");
|
24 |
+
|
25 |
+
self.init = function () {
|
26 |
+
|
27 |
+
if (!$tabs.length) {
|
28 |
+
return;
|
29 |
+
}
|
30 |
+
|
31 |
+
self.initNavTabs($tabs);
|
32 |
+
|
33 |
+
self.initElementsTabs($elementsTabs);
|
34 |
+
|
35 |
+
if (settings.isTrackerAllowed) {
|
36 |
+
self.getUnusedWidget();
|
37 |
+
}
|
38 |
+
|
39 |
+
self.handleElementsActions();
|
40 |
+
|
41 |
+
self.handleSettingsSave();
|
42 |
+
|
43 |
+
self.handleRollBack();
|
44 |
+
|
45 |
+
self.handleNewsLetterForm();
|
46 |
+
|
47 |
+
self.handlePaproActions();
|
48 |
+
|
49 |
+
};
|
50 |
+
|
51 |
+
// Handle settings form submission
|
52 |
+
self.handleSettingsSave = function () {
|
53 |
+
|
54 |
+
$("#pa-features .pa-section-info-cta input, #pa-modules .pa-switcher input").on(
|
55 |
+
'change',
|
56 |
+
function () {
|
57 |
+
self.saveElementsSettings('elements');
|
58 |
+
}
|
59 |
+
)
|
60 |
+
|
61 |
+
$("#pa-ver-control input, #pa-integrations input, #pa-ver-control input, #pa-integrations select").change(
|
62 |
+
function () {
|
63 |
+
self.saveElementsSettings('additional');
|
64 |
+
}
|
65 |
+
);
|
66 |
+
|
67 |
+
$("#pa-integrations input[type=text]").on(
|
68 |
+
'keyup',
|
69 |
+
function () {
|
70 |
+
self.saveElementsSettings('additional');
|
71 |
+
}
|
72 |
+
)
|
73 |
+
|
74 |
+
};
|
75 |
+
|
76 |
+
//get unused widgets.
|
77 |
+
self.getUnusedWidget = function () {
|
78 |
+
|
79 |
+
if ($(".pa-btn-group .pa-btn-disable").hasClass("active")) {
|
80 |
+
$(".pa-btn-group .pa-btn-unused").addClass("dimmed");
|
81 |
+
}
|
82 |
+
|
83 |
+
$.ajax(
|
84 |
+
{
|
85 |
+
url: settings.ajaxurl,
|
86 |
+
type: 'POST',
|
87 |
+
data: {
|
88 |
+
action: 'pa_get_unused_widgets',
|
89 |
+
security: settings.nonce,
|
90 |
+
},
|
91 |
+
success: function (response) {
|
92 |
+
console.log('unused widgets retrieved');
|
93 |
+
self.unusedElements = response.data;
|
94 |
+
},
|
95 |
+
error: function (err) {
|
96 |
+
console.log(err);
|
97 |
+
}
|
98 |
+
}
|
99 |
+
);
|
100 |
+
};
|
101 |
+
|
102 |
+
// Handle global enable/disable buttons
|
103 |
+
self.handleElementsActions = function () {
|
104 |
+
|
105 |
+
$(".pa-elements-filter select").on(
|
106 |
+
'change',
|
107 |
+
function () {
|
108 |
+
var filter = $(this).val(),
|
109 |
+
$activeTab = $(".pa-switchers-container").not(".hidden");
|
110 |
+
|
111 |
+
$activeTab.find(".pa-switcher").removeClass("hidden");
|
112 |
+
|
113 |
+
if ('free' === filter) {
|
114 |
+
$activeTab.find(".pro-element").addClass("hidden");
|
115 |
+
} else if ('pro' === filter) {
|
116 |
+
$activeTab.find(".pa-switcher").not(".pro-element").addClass("hidden");
|
117 |
+
}
|
118 |
+
}
|
119 |
+
);
|
120 |
+
|
121 |
+
// Enable/Disable all widgets
|
122 |
+
$(".pa-btn-group").on(
|
123 |
+
"click",
|
124 |
+
'.pa-btn',
|
125 |
+
function () {
|
126 |
+
|
127 |
+
var $btn = $(this),
|
128 |
+
isChecked = $btn.hasClass("pa-btn-enable");
|
129 |
+
|
130 |
+
if (!$btn.hasClass("active")) {
|
131 |
+
$(".pa-btn-group .pa-btn").removeClass("active");
|
132 |
+
$btn.addClass("active");
|
133 |
+
|
134 |
+
$.ajax(
|
135 |
+
{
|
136 |
+
url: settings.ajaxurl,
|
137 |
+
type: 'POST',
|
138 |
+
data: {
|
139 |
+
action: 'pa_save_global_btn',
|
140 |
+
security: settings.nonce,
|
141 |
+
isGlobalOn: isChecked
|
142 |
+
}
|
143 |
+
}
|
144 |
+
);
|
145 |
+
|
146 |
+
}
|
147 |
+
|
148 |
+
if (isChecked) {
|
149 |
+
$(".pa-btn-group .pa-btn-unused").removeClass("dimmed");
|
150 |
+
} else {
|
151 |
+
$(".pa-btn-group .pa-btn-unused").addClass("dimmed");
|
152 |
+
}
|
153 |
+
|
154 |
+
$("#pa-modules .pa-switcher input").prop("checked", isChecked);
|
155 |
+
|
156 |
+
self.saveElementsSettings('elements');
|
157 |
+
|
158 |
+
}
|
159 |
+
);
|
160 |
+
|
161 |
+
//Disable unused widgets.
|
162 |
+
$(".pa-btn-group").on(
|
163 |
+
"click",
|
164 |
+
'.pa-btn-unused',
|
165 |
+
function () {
|
166 |
+
|
167 |
+
$.each(self.unusedElements, function (index, selector) {
|
168 |
+
$('#pa-modules .pa-switcher.' + selector).find('input').prop('checked', false);
|
169 |
+
});
|
170 |
+
|
171 |
+
$(this).addClass('dimmed');
|
172 |
+
|
173 |
+
self.saveElementsSettings('elements');
|
174 |
+
}
|
175 |
+
);
|
176 |
+
|
177 |
+
$("#pa-modules .pa-switcher input").on(
|
178 |
+
'change',
|
179 |
+
function () {
|
180 |
+
var $this = $(this),
|
181 |
+
id = $this.attr('id'),
|
182 |
+
isChecked = $this.prop('checked');
|
183 |
+
|
184 |
+
$("input[name='" + id + "']").prop('checked', isChecked);
|
185 |
+
}
|
186 |
+
)
|
187 |
+
|
188 |
+
};
|
189 |
+
|
190 |
+
// Handle Tabs Elements
|
191 |
+
self.initElementsTabs = function ($elem) {
|
192 |
+
|
193 |
+
var $links = $elem.find('a'),
|
194 |
+
$sections = $(".pa-switchers-container");
|
195 |
+
|
196 |
+
$sections.eq(0).removeClass("hidden");
|
197 |
+
$links.eq(0).addClass("active");
|
198 |
+
|
199 |
+
$links.on(
|
200 |
+
'click',
|
201 |
+
function (e) {
|
202 |
+
|
203 |
+
e.preventDefault();
|
204 |
+
|
205 |
+
var $link = $(this),
|
206 |
+
href = $link.attr('href');
|
207 |
+
|
208 |
+
// Set this tab to active
|
209 |
+
$links.removeClass("active");
|
210 |
+
$link.addClass("active");
|
211 |
+
|
212 |
+
// Navigate to tab section
|
213 |
+
$sections.addClass("hidden");
|
214 |
+
$("#" + href).removeClass("hidden");
|
215 |
+
|
216 |
+
}
|
217 |
+
);
|
218 |
+
};
|
219 |
+
|
220 |
+
// Handle settings tabs
|
221 |
+
self.initNavTabs = function ($elem) {
|
222 |
+
|
223 |
+
var $links = $elem.find('a'),
|
224 |
+
$lastSection = null;
|
225 |
+
|
226 |
+
$(window).on(
|
227 |
+
'hashchange',
|
228 |
+
function () {
|
229 |
+
|
230 |
+
var hash = window.location.hash.match(new RegExp('tab=([^&]*)')),
|
231 |
+
slug = hash ? hash[1] : $links.first().attr('href').replace('#tab=', ''),
|
232 |
+
$link = $('#pa-tab-link-' + slug);
|
233 |
+
|
234 |
+
if (!$link.length) {
|
235 |
+
return
|
236 |
+
|
237 |
+
}
|
238 |
+
$links.removeClass('pa-section-active');
|
239 |
+
$link.addClass('pa-section-active');
|
240 |
+
|
241 |
+
// Hide the last active section
|
242 |
+
if ($lastSection) {
|
243 |
+
$lastSection.hide();
|
244 |
+
}
|
245 |
+
|
246 |
+
var $section = $('#pa-section-' + slug);
|
247 |
+
$section.css(
|
248 |
+
{
|
249 |
+
display: 'block'
|
250 |
+
}
|
251 |
+
);
|
252 |
+
|
253 |
+
$lastSection = $section;
|
254 |
+
|
255 |
+
}
|
256 |
+
).trigger('hashchange');
|
257 |
+
|
258 |
+
};
|
259 |
+
|
260 |
+
self.handleRollBack = function () {
|
261 |
+
|
262 |
+
// Rollback button
|
263 |
+
$('.pa-rollback-button').on(
|
264 |
+
'click',
|
265 |
+
function (event) {
|
266 |
+
|
267 |
+
event.preventDefault();
|
268 |
+
|
269 |
+
var $this = $(this),
|
270 |
+
href = $this.attr('href');
|
271 |
+
|
272 |
+
if (!href) {
|
273 |
+
return;
|
274 |
+
}
|
275 |
+
|
276 |
+
// Show PAPRO stable version if PAPRO Rollback is clicked
|
277 |
+
var isPAPRO = '';
|
278 |
+
if (-1 !== href.indexOf('papro_rollback')) {
|
279 |
+
isPAPRO = 'papro_';
|
280 |
+
}
|
281 |
+
|
282 |
+
var premiumRollBackConfirm = premiumAddonsSettings.premiumRollBackConfirm;
|
283 |
+
|
284 |
+
var dialogsManager = new DialogsManager.Instance();
|
285 |
+
|
286 |
+
dialogsManager.createWidget(
|
287 |
+
'confirm',
|
288 |
+
{
|
289 |
+
headerMessage: premiumRollBackConfirm.i18n.rollback_to_previous_version,
|
290 |
+
message: premiumRollBackConfirm['i18n'][isPAPRO + 'rollback_confirm'],
|
291 |
+
strings: {
|
292 |
+
cancel: premiumRollBackConfirm.i18n.cancel,
|
293 |
+
confirm: premiumRollBackConfirm.i18n.yes,
|
294 |
+
},
|
295 |
+
onConfirm: function () {
|
296 |
+
|
297 |
+
$this.addClass('loading');
|
298 |
+
|
299 |
+
location.href = $this.attr('href');
|
300 |
+
|
301 |
+
}
|
302 |
+
}
|
303 |
+
).show();
|
304 |
+
}
|
305 |
+
);
|
306 |
+
|
307 |
+
};
|
308 |
+
|
309 |
+
self.saveElementsSettings = function (action) { //save elements settings changes
|
310 |
+
|
311 |
+
var $form = null;
|
312 |
+
|
313 |
+
if ('elements' === action) {
|
314 |
+
$form = $('form#pa-settings, form#pa-features');
|
315 |
+
action = 'pa_elements_settings';
|
316 |
+
} else {
|
317 |
+
$form = $('form#pa-ver-control, form#pa-integrations');
|
318 |
+
action = 'pa_additional_settings';
|
319 |
+
}
|
320 |
+
|
321 |
+
$.ajax(
|
322 |
+
{
|
323 |
+
url: settings.ajaxurl,
|
324 |
+
type: 'POST',
|
325 |
+
data: {
|
326 |
+
action: action,
|
327 |
+
security: settings.nonce,
|
328 |
+
fields: $form.serialize(),
|
329 |
+
},
|
330 |
+
success: function (response) {
|
331 |
+
|
332 |
+
console.log("settings saved");
|
333 |
+
},
|
334 |
+
error: function (err) {
|
335 |
+
|
336 |
+
console.log(err);
|
337 |
+
|
338 |
+
}
|
339 |
+
}
|
340 |
+
);
|
341 |
+
|
342 |
+
}
|
343 |
+
|
344 |
+
self.handlePaproActions = function () {
|
345 |
+
|
346 |
+
// Trigger SWAL for PRO elements
|
347 |
+
$(".pro-slider").on(
|
348 |
+
'click',
|
349 |
+
function () {
|
350 |
+
|
351 |
+
var redirectionLink = " https://premiumaddons.com/pro/?utm_source=wp-menu&utm_medium=wp-dash&utm_campaign=get-pro&utm_term=";
|
352 |
+
|
353 |
+
Swal.fire(
|
354 |
+
{
|
355 |
+
title: '<span class="pa-swal-head">Get PRO Widgets & Addons<span>',
|
356 |
+
html: 'Supercharge your Elementor with PRO widgets and addons that you won’t find anywhere else.',
|
357 |
+
type: 'warning',
|
358 |
+
showCloseButton: true,
|
359 |
+
showCancelButton: true,
|
360 |
+
cancelButtonText: "More Info",
|
361 |
+
focusConfirm: true,
|
362 |
+
customClass: 'pa-swal',
|
363 |
+
}
|
364 |
+
).then(
|
365 |
+
function (res) {
|
366 |
+
// Handle More Info button
|
367 |
+
if (res.dismiss === 'cancel') {
|
368 |
+
window.open(redirectionLink + settings.theme, '_blank');
|
369 |
+
}
|
370 |
+
|
371 |
+
}
|
372 |
+
);
|
373 |
+
}
|
374 |
+
);
|
375 |
+
|
376 |
+
// Trigger SWAL for White Labeling
|
377 |
+
$(".premium-white-label-form.pro-inactive").on(
|
378 |
+
'submit',
|
379 |
+
function (e) {
|
380 |
+
|
381 |
+
e.preventDefault();
|
382 |
+
|
383 |
+
var redirectionLink = " https://premiumaddons.com/pro/?utm_source=wp-menu&utm_medium=wp-dash&utm_campaign=get-pro&utm_term=";
|
384 |
+
|
385 |
+
Swal.fire(
|
386 |
+
{
|
387 |
+
title: '<span class="pa-swal-head">Enable White Labeling Options<span>',
|
388 |
+
html: 'Premium Addons can be completely re-branded with your own brand name and author details. Your clients will never know what tools you are using to build their website and will think that this is your own tool set. White-labeling works as long as your license is active.',
|
389 |
+
type: 'warning',
|
390 |
+
showCloseButton: true,
|
391 |
+
showCancelButton: true,
|
392 |
+
cancelButtonText: "More Info",
|
393 |
+
focusConfirm: true
|
394 |
+
}
|
395 |
+
).then(
|
396 |
+
function (res) {
|
397 |
+
// Handle More Info button
|
398 |
+
if (res.dismiss === 'cancel') {
|
399 |
+
window.open(redirectionLink + settings.theme, '_blank');
|
400 |
+
}
|
401 |
+
|
402 |
+
}
|
403 |
+
);
|
404 |
+
}
|
405 |
+
);
|
406 |
+
|
407 |
+
};
|
408 |
+
|
409 |
+
self.handleNewsLetterForm = function () {
|
410 |
+
|
411 |
+
$('.pa-newsletter-form').on('submit', function (e) {
|
412 |
+
e.preventDefault();
|
413 |
+
|
414 |
+
var email = $("#pa_news_email").val();
|
415 |
+
|
416 |
+
if (checkEmail(email)) {
|
417 |
+
$.ajax(
|
418 |
+
{
|
419 |
+
url: settings.ajaxurl,
|
420 |
+
type: 'POST',
|
421 |
+
data: {
|
422 |
+
action: 'subscribe_newsletter',
|
423 |
+
security: settings.nonce,
|
424 |
+
email: email
|
425 |
+
},
|
426 |
+
beforeSend: function () {
|
427 |
+
console.log("Adding user to subscribers list");
|
428 |
+
},
|
429 |
+
success: function (response) {
|
430 |
+
if (response.data) {
|
431 |
+
var status = response.data.status;
|
432 |
+
if (status) {
|
433 |
+
console.log("User added to subscribers list");
|
434 |
+
swal.fire({
|
435 |
+
title: 'Thanks for subscribing!',
|
436 |
+
text: 'Click OK to continue',
|
437 |
+
type: 'success',
|
438 |
+
timer: 1000
|
439 |
+
});
|
440 |
+
}
|
441 |
+
|
442 |
+
}
|
443 |
+
|
444 |
+
},
|
445 |
+
error: function (err) {
|
446 |
+
console.log(err);
|
447 |
+
}
|
448 |
+
}
|
449 |
+
);
|
450 |
+
} else {
|
451 |
+
Swal.fire({
|
452 |
+
type: 'error',
|
453 |
+
title: 'Invalid Email Address...',
|
454 |
+
text: 'Please enter a valid email address!'
|
455 |
+
});
|
456 |
+
}
|
457 |
+
|
458 |
+
})
|
459 |
+
|
460 |
+
}
|
461 |
+
|
462 |
+
function checkEmail(emailAddress) {
|
463 |
+
var pattern = new RegExp(/^(("[\w-+\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-+\s]+")([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][\d]\.|1[\d]{2}\.|[\d]{1,2}\.))((25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\.){2}(25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\]?$)/i);
|
464 |
+
return pattern.test(emailAddress);
|
465 |
+
}
|
466 |
+
|
467 |
+
};
|
468 |
+
|
469 |
+
var instance = new PremiumAddonsNavigation();
|
470 |
+
|
471 |
+
instance.init();
|
472 |
+
|
473 |
+
})(jQuery);
|
admin/includes/admin-helper.php
CHANGED
@@ -1,1061 +1,1062 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* PA Admin Helper
|
4 |
-
*/
|
5 |
-
|
6 |
-
namespace PremiumAddons\Admin\Includes;
|
7 |
-
|
8 |
-
use PremiumAddons\Includes\Helper_Functions;
|
9 |
-
use Elementor\Modules\Usage\Module;
|
10 |
-
|
11 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
-
exit;
|
13 |
-
}
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Class Admin_Helper
|
17 |
-
*/
|
18 |
-
class Admin_Helper {
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Admin settings tabs
|
22 |
-
*
|
23 |
-
* @var tabs
|
24 |
-
*/
|
25 |
-
private static $tabs = null;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Class instance
|
29 |
-
*
|
30 |
-
* @var instance
|
31 |
-
*/
|
32 |
-
private static $instance = null;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Premium Addons Settings Page Slug
|
36 |
-
*
|
37 |
-
* @var page_slug
|
38 |
-
*/
|
39 |
-
protected $page_slug = 'premium-addons';
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Current Screen ID
|
43 |
-
*
|
44 |
-
* @var current_screen
|
45 |
-
*/
|
46 |
-
public static $current_screen = null;
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Elements List
|
50 |
-
*
|
51 |
-
* @var elements_list
|
52 |
-
*/
|
53 |
-
public static $elements_list = null;
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Elements Names
|
57 |
-
*
|
58 |
-
* @var elements_names
|
59 |
-
*/
|
60 |
-
public static $elements_names = null;
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Integrations List
|
64 |
-
*
|
65 |
-
* @var integrations_list
|
66 |
-
*/
|
67 |
-
public static $integrations_list = null;
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Constructor for the class
|
71 |
-
*/
|
72 |
-
public function __construct() {
|
73 |
-
|
74 |
-
// Get current screen ID.
|
75 |
-
add_action( 'current_screen', array( $this, 'get_current_screen' ) );
|
76 |
-
|
77 |
-
// Insert admin settings submenus.
|
78 |
-
$this->set_admin_tabs();
|
79 |
-
add_action( 'admin_menu', array( $this, 'add_menu_tabs' ), 100 );
|
80 |
-
|
81 |
-
// Enqueue required admin scripts.
|
82 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
83 |
-
|
84 |
-
// Plugin Action Links.
|
85 |
-
add_filter( 'plugin_action_links_' . PREMIUM_ADDONS_BASENAME, array( $this, 'insert_action_links' ) );
|
86 |
-
add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
|
87 |
-
|
88 |
-
// Register AJAX HOOKS.
|
89 |
-
add_action( 'wp_ajax_pa_save_global_btn', array( $this, 'save_global_btn_value' ) );
|
90 |
-
add_action( 'wp_ajax_pa_elements_settings', array( $this, 'save_settings' ) );
|
91 |
-
add_action( 'wp_ajax_pa_additional_settings', array( $this, 'save_additional_settings' ) );
|
92 |
-
add_action( 'wp_ajax_pa_get_unused_widgets', array( $this, 'get_unused_widgets' ) );
|
93 |
-
|
94 |
-
add_action( 'wp_ajax_subscribe_newsletter', array( $this, 'subscribe_newsletter' ) );
|
95 |
-
|
96 |
-
add_action( 'pa_before_render_admin_tabs', array( $this, 'render_dashboard_header' ) );
|
97 |
-
|
98 |
-
// Register Rollback hooks.
|
99 |
-
add_action( 'admin_post_premium_addons_rollback', array( $this, 'run_pa_rollback' ) );
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
*
|
120 |
-
*
|
121 |
-
*
|
122 |
-
*
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
*
|
131 |
-
*
|
132 |
-
*
|
133 |
-
*
|
134 |
-
* @
|
135 |
-
*
|
136 |
-
*
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
*
|
153 |
-
*
|
154 |
-
*
|
155 |
-
*
|
156 |
-
* @
|
157 |
-
*
|
158 |
-
*
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
'premium-
|
167 |
-
'premium-
|
168 |
-
'premium-map-
|
169 |
-
'premium-map-
|
170 |
-
'
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
*
|
182 |
-
*
|
183 |
-
*
|
184 |
-
*
|
185 |
-
* @
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
'
|
257 |
-
'
|
258 |
-
'
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
'
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
'
|
267 |
-
'
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
*
|
286 |
-
*
|
287 |
-
*
|
288 |
-
*
|
289 |
-
*
|
290 |
-
*
|
291 |
-
*
|
292 |
-
*
|
293 |
-
* @
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
*
|
323 |
-
*
|
324 |
-
*
|
325 |
-
*
|
326 |
-
*
|
327 |
-
*
|
328 |
-
* @
|
329 |
-
*
|
330 |
-
*
|
331 |
-
* @param
|
332 |
-
*
|
333 |
-
*
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
'
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
*
|
360 |
-
*
|
361 |
-
* @
|
362 |
-
*
|
363 |
-
*
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
*
|
376 |
-
*
|
377 |
-
* @
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
'
|
387 |
-
'
|
388 |
-
'
|
389 |
-
'
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
'
|
394 |
-
'
|
395 |
-
'
|
396 |
-
'
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
'
|
401 |
-
'
|
402 |
-
'
|
403 |
-
'
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
'
|
408 |
-
'
|
409 |
-
'
|
410 |
-
'
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
'
|
415 |
-
'
|
416 |
-
'
|
417 |
-
'
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
'
|
422 |
-
'
|
423 |
-
'
|
424 |
-
'
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
'
|
429 |
-
'
|
430 |
-
'
|
431 |
-
'
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
*
|
442 |
-
*
|
443 |
-
*
|
444 |
-
*
|
445 |
-
* @
|
446 |
-
*
|
447 |
-
*
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
$plugin_name,
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
'',
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
$
|
470 |
-
$tab['title'],
|
471 |
-
'
|
472 |
-
|
473 |
-
'
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
*
|
483 |
-
*
|
484 |
-
*
|
485 |
-
*
|
486 |
-
* @
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
$link .= '
|
500 |
-
|
501 |
-
$link .= '<
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
*
|
528 |
-
*
|
529 |
-
* @
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
*
|
577 |
-
*
|
578 |
-
*
|
579 |
-
*
|
580 |
-
* @
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
*
|
604 |
-
*
|
605 |
-
*
|
606 |
-
*
|
607 |
-
* @
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
'premium-
|
622 |
-
'premium-
|
623 |
-
'premium-map-
|
624 |
-
'premium-map-
|
625 |
-
'
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
*
|
637 |
-
*
|
638 |
-
*
|
639 |
-
*
|
640 |
-
* @
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
*
|
661 |
-
*
|
662 |
-
* @
|
663 |
-
*
|
664 |
-
*
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
*
|
690 |
-
*
|
691 |
-
* @
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
*
|
716 |
-
*
|
717 |
-
* @
|
718 |
-
*
|
719 |
-
*
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
*
|
737 |
-
*
|
738 |
-
* @
|
739 |
-
*
|
740 |
-
*
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
*
|
761 |
-
*
|
762 |
-
* @
|
763 |
-
*
|
764 |
-
*
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
*
|
783 |
-
*
|
784 |
-
* @
|
785 |
-
*
|
786 |
-
*
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
*
|
804 |
-
*
|
805 |
-
*
|
806 |
-
*
|
807 |
-
* @
|
808 |
-
*
|
809 |
-
*
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
*
|
822 |
-
*
|
823 |
-
*
|
824 |
-
*
|
825 |
-
* @
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
'
|
837 |
-
'
|
838 |
-
'
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
*
|
857 |
-
*
|
858 |
-
* @
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
*
|
881 |
-
*
|
882 |
-
* @
|
883 |
-
*
|
884 |
-
*
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
*
|
914 |
-
*
|
915 |
-
* @
|
916 |
-
*
|
917 |
-
*
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
$
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
$
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
*
|
960 |
-
*
|
961 |
-
*
|
962 |
-
*
|
963 |
-
*
|
964 |
-
*
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
'
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
$body =
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
*
|
1003 |
-
*
|
1004 |
-
*
|
1005 |
-
*
|
1006 |
-
*
|
1007 |
-
*
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
'
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
$
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
*
|
1046 |
-
*
|
1047 |
-
* @
|
1048 |
-
*
|
1049 |
-
*
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
}
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* PA Admin Helper
|
4 |
+
*/
|
5 |
+
|
6 |
+
namespace PremiumAddons\Admin\Includes;
|
7 |
+
|
8 |
+
use PremiumAddons\Includes\Helper_Functions;
|
9 |
+
use Elementor\Modules\Usage\Module;
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
+
exit;
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Class Admin_Helper
|
17 |
+
*/
|
18 |
+
class Admin_Helper {
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Admin settings tabs
|
22 |
+
*
|
23 |
+
* @var tabs
|
24 |
+
*/
|
25 |
+
private static $tabs = null;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Class instance
|
29 |
+
*
|
30 |
+
* @var instance
|
31 |
+
*/
|
32 |
+
private static $instance = null;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Premium Addons Settings Page Slug
|
36 |
+
*
|
37 |
+
* @var page_slug
|
38 |
+
*/
|
39 |
+
protected $page_slug = 'premium-addons';
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Current Screen ID
|
43 |
+
*
|
44 |
+
* @var current_screen
|
45 |
+
*/
|
46 |
+
public static $current_screen = null;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Elements List
|
50 |
+
*
|
51 |
+
* @var elements_list
|
52 |
+
*/
|
53 |
+
public static $elements_list = null;
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Elements Names
|
57 |
+
*
|
58 |
+
* @var elements_names
|
59 |
+
*/
|
60 |
+
public static $elements_names = null;
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Integrations List
|
64 |
+
*
|
65 |
+
* @var integrations_list
|
66 |
+
*/
|
67 |
+
public static $integrations_list = null;
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Constructor for the class
|
71 |
+
*/
|
72 |
+
public function __construct() {
|
73 |
+
|
74 |
+
// Get current screen ID.
|
75 |
+
add_action( 'current_screen', array( $this, 'get_current_screen' ) );
|
76 |
+
|
77 |
+
// Insert admin settings submenus.
|
78 |
+
$this->set_admin_tabs();
|
79 |
+
add_action( 'admin_menu', array( $this, 'add_menu_tabs' ), 100 );
|
80 |
+
|
81 |
+
// Enqueue required admin scripts.
|
82 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
83 |
+
|
84 |
+
// Plugin Action Links.
|
85 |
+
add_filter( 'plugin_action_links_' . PREMIUM_ADDONS_BASENAME, array( $this, 'insert_action_links' ) );
|
86 |
+
add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
|
87 |
+
|
88 |
+
// Register AJAX HOOKS.
|
89 |
+
add_action( 'wp_ajax_pa_save_global_btn', array( $this, 'save_global_btn_value' ) );
|
90 |
+
add_action( 'wp_ajax_pa_elements_settings', array( $this, 'save_settings' ) );
|
91 |
+
add_action( 'wp_ajax_pa_additional_settings', array( $this, 'save_additional_settings' ) );
|
92 |
+
add_action( 'wp_ajax_pa_get_unused_widgets', array( $this, 'get_unused_widgets' ) );
|
93 |
+
|
94 |
+
add_action( 'wp_ajax_subscribe_newsletter', array( $this, 'subscribe_newsletter' ) );
|
95 |
+
|
96 |
+
add_action( 'pa_before_render_admin_tabs', array( $this, 'render_dashboard_header' ) );
|
97 |
+
|
98 |
+
// Register Rollback hooks.
|
99 |
+
add_action( 'admin_post_premium_addons_rollback', array( $this, 'run_pa_rollback' ) );
|
100 |
+
|
101 |
+
if ( is_admin() ) {
|
102 |
+
$current_page = $_SERVER['REQUEST_URI'];
|
103 |
+
if ( false === strpos( $current_page, 'action=elementor' ) ) {
|
104 |
+
Admin_Notices::get_instance();
|
105 |
+
|
106 |
+
// Beta Tester.
|
107 |
+
Beta_Testers::get_instance();
|
108 |
+
|
109 |
+
// PA Duplicator.
|
110 |
+
if ( self::check_duplicator() ) {
|
111 |
+
Duplicator::get_instance();
|
112 |
+
}
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Checks user credentials for specific action
|
120 |
+
*
|
121 |
+
* @since 2.6.8
|
122 |
+
*
|
123 |
+
* @return boolean
|
124 |
+
*/
|
125 |
+
public static function check_user_can( $action ) {
|
126 |
+
return current_user_can( $action );
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Get Elements List
|
131 |
+
*
|
132 |
+
* Get a list of all the elements available in the plugin
|
133 |
+
*
|
134 |
+
* @since 3.20.9
|
135 |
+
* @access private
|
136 |
+
*
|
137 |
+
* @return array widget_list
|
138 |
+
*/
|
139 |
+
private static function get_elements_list() {
|
140 |
+
|
141 |
+
if ( null === self::$elements_list ) {
|
142 |
+
|
143 |
+
self::$elements_list = require_once PREMIUM_ADDONS_PATH . 'admin/includes/elements.php';
|
144 |
+
|
145 |
+
}
|
146 |
+
|
147 |
+
return self::$elements_list;
|
148 |
+
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Get Integrations List
|
153 |
+
*
|
154 |
+
* Get a list of all the integrations available in the plugin
|
155 |
+
*
|
156 |
+
* @since 3.20.9
|
157 |
+
* @access private
|
158 |
+
*
|
159 |
+
* @return array integrations_list
|
160 |
+
*/
|
161 |
+
private static function get_integrations_list() {
|
162 |
+
|
163 |
+
if ( null === self::$integrations_list ) {
|
164 |
+
|
165 |
+
self::$integrations_list = array(
|
166 |
+
'premium-map-api',
|
167 |
+
'premium-youtube-api',
|
168 |
+
'premium-map-disable-api',
|
169 |
+
'premium-map-cluster',
|
170 |
+
'premium-map-locale',
|
171 |
+
'is-beta-tester',
|
172 |
+
);
|
173 |
+
|
174 |
+
}
|
175 |
+
|
176 |
+
return self::$integrations_list;
|
177 |
+
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Admin Enqueue Scripts
|
182 |
+
*
|
183 |
+
* Enqueue the required assets on our admin pages
|
184 |
+
*
|
185 |
+
* @since 1.0.0
|
186 |
+
* @access public
|
187 |
+
*/
|
188 |
+
public function admin_enqueue_scripts() {
|
189 |
+
|
190 |
+
wp_enqueue_style(
|
191 |
+
'pa_admin_icon',
|
192 |
+
PREMIUM_ADDONS_URL . 'admin/assets/fonts/style.css',
|
193 |
+
array(),
|
194 |
+
PREMIUM_ADDONS_VERSION,
|
195 |
+
'all'
|
196 |
+
);
|
197 |
+
|
198 |
+
$suffix = is_rtl() ? '-rtl' : '';
|
199 |
+
|
200 |
+
$current_screen = self::get_current_screen();
|
201 |
+
|
202 |
+
wp_enqueue_style(
|
203 |
+
'pa-notice-css',
|
204 |
+
PREMIUM_ADDONS_URL . 'admin/assets/css/notice' . $suffix . '.css',
|
205 |
+
array(),
|
206 |
+
PREMIUM_ADDONS_VERSION,
|
207 |
+
'all'
|
208 |
+
);
|
209 |
+
|
210 |
+
if ( strpos( $current_screen, $this->page_slug ) !== false ) {
|
211 |
+
|
212 |
+
wp_enqueue_style(
|
213 |
+
'pa-admin-css',
|
214 |
+
PREMIUM_ADDONS_URL . 'admin/assets/css/admin' . $suffix . '.css',
|
215 |
+
array(),
|
216 |
+
PREMIUM_ADDONS_VERSION,
|
217 |
+
'all'
|
218 |
+
);
|
219 |
+
|
220 |
+
wp_enqueue_style(
|
221 |
+
'pa-sweetalert-style',
|
222 |
+
PREMIUM_ADDONS_URL . 'admin/assets/js/sweetalert2/sweetalert2.min.css',
|
223 |
+
array(),
|
224 |
+
PREMIUM_ADDONS_VERSION,
|
225 |
+
'all'
|
226 |
+
);
|
227 |
+
|
228 |
+
wp_enqueue_script(
|
229 |
+
'pa-admin',
|
230 |
+
PREMIUM_ADDONS_URL . 'admin/assets/js/admin.js',
|
231 |
+
array( 'jquery' ),
|
232 |
+
PREMIUM_ADDONS_VERSION,
|
233 |
+
true
|
234 |
+
);
|
235 |
+
|
236 |
+
wp_enqueue_script(
|
237 |
+
'pa-sweetalert-core',
|
238 |
+
PREMIUM_ADDONS_URL . 'admin/assets/js/sweetalert2/core.js',
|
239 |
+
array( 'jquery' ),
|
240 |
+
PREMIUM_ADDONS_VERSION,
|
241 |
+
true
|
242 |
+
);
|
243 |
+
|
244 |
+
wp_enqueue_script(
|
245 |
+
'pa-sweetalert',
|
246 |
+
PREMIUM_ADDONS_URL . 'admin/assets/js/sweetalert2/sweetalert2.min.js',
|
247 |
+
array( 'jquery', 'pa-sweetalert-core' ),
|
248 |
+
PREMIUM_ADDONS_VERSION,
|
249 |
+
true
|
250 |
+
);
|
251 |
+
|
252 |
+
$theme_slug = Helper_Functions::get_installed_theme();
|
253 |
+
|
254 |
+
$localized_data = array(
|
255 |
+
'settings' => array(
|
256 |
+
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
257 |
+
'nonce' => wp_create_nonce( 'pa-settings-tab' ),
|
258 |
+
'theme' => $theme_slug,
|
259 |
+
'isTrackerAllowed' => 'yes' === get_option( 'elementor_allow_tracking', 'no' ) ? true : false,
|
260 |
+
),
|
261 |
+
'premiumRollBackConfirm' => array(
|
262 |
+
'home_url' => home_url(),
|
263 |
+
'i18n' => array(
|
264 |
+
'rollback_to_previous_version' => __( 'Rollback to Previous Version', 'premium-addons-for-elementor' ),
|
265 |
+
/* translators: %s: PA stable version */
|
266 |
+
'rollback_confirm' => sprintf( __( 'Are you sure you want to reinstall version %s?', 'premium-addons-for-elementor' ), PREMIUM_ADDONS_STABLE_VERSION ),
|
267 |
+
'yes' => __( 'Continue', 'premium-addons-for-elementor' ),
|
268 |
+
'cancel' => __( 'Cancel', 'premium-addons-for-elementor' ),
|
269 |
+
),
|
270 |
+
),
|
271 |
+
);
|
272 |
+
|
273 |
+
// Add PAPRO Rollback Confirm message if PAPRO installed.
|
274 |
+
if ( Helper_Functions::check_papro_version() ) {
|
275 |
+
/* translators: %s: PA stable version */
|
276 |
+
$localized_data['premiumRollBackConfirm']['i18n']['papro_rollback_confirm'] = sprintf( __( 'Are you sure you want to reinstall version %s?', 'premium-addons-for-elementor' ), PREMIUM_ADDONS_STABLE_VERSION );
|
277 |
+
}
|
278 |
+
|
279 |
+
wp_localize_script( 'pa-admin', 'premiumAddonsSettings', $localized_data );
|
280 |
+
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
+
/**
|
285 |
+
* Insert action links.
|
286 |
+
*
|
287 |
+
* Adds action links to the plugin list table
|
288 |
+
*
|
289 |
+
* Fired by `plugin_action_links` filter.
|
290 |
+
*
|
291 |
+
* @param array $links plugin action links.
|
292 |
+
*
|
293 |
+
* @since 1.0.0
|
294 |
+
* @access public
|
295 |
+
*/
|
296 |
+
public function insert_action_links( $links ) {
|
297 |
+
|
298 |
+
$papro_path = 'premium-addons-pro/premium-addons-pro-for-elementor.php';
|
299 |
+
|
300 |
+
$is_papro_installed = Helper_Functions::is_plugin_installed( $papro_path );
|
301 |
+
|
302 |
+
$settings_link = sprintf( '<a href="%1$s">%2$s</a>', admin_url( 'admin.php?page=' . $this->page_slug . '#tab=elements' ), __( 'Settings', 'premium-addons-for-elementor' ) );
|
303 |
+
|
304 |
+
$rollback_link = sprintf( '<a href="%1$s">%2$s %3$s</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ), __( 'Rollback to Version ', 'premium-addons-for-elementor' ), PREMIUM_ADDONS_STABLE_VERSION );
|
305 |
+
|
306 |
+
$new_links = array( $settings_link, $rollback_link );
|
307 |
+
|
308 |
+
if ( ! $is_papro_installed ) {
|
309 |
+
|
310 |
+
$link = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro', 'plugins-page', 'wp-dash', 'get-pro' );
|
311 |
+
|
312 |
+
$pro_link = sprintf( '<a href="%s" target="_blank" style="color: #FF6000; font-weight: bold;">%s</a>', $link, __( 'Go Pro', 'premium-addons-for-elementor' ) );
|
313 |
+
array_push( $new_links, $pro_link );
|
314 |
+
}
|
315 |
+
|
316 |
+
$new_links = array_merge( $links, $new_links );
|
317 |
+
|
318 |
+
return $new_links;
|
319 |
+
}
|
320 |
+
|
321 |
+
/**
|
322 |
+
* Plugin row meta.
|
323 |
+
*
|
324 |
+
* Extends plugin row meta links
|
325 |
+
*
|
326 |
+
* Fired by `plugin_row_meta` filter.
|
327 |
+
*
|
328 |
+
* @since 3.8.4
|
329 |
+
* @access public
|
330 |
+
*
|
331 |
+
* @param array $meta array of the plugin's metadata.
|
332 |
+
* @param string $file path to the plugin file.
|
333 |
+
*
|
334 |
+
* @return array An array of plugin row meta links.
|
335 |
+
*/
|
336 |
+
public function plugin_row_meta( $meta, $file ) {
|
337 |
+
|
338 |
+
if ( Helper_Functions::is_hide_row_meta() ) {
|
339 |
+
return $meta;
|
340 |
+
}
|
341 |
+
|
342 |
+
if ( PREMIUM_ADDONS_BASENAME === $file ) {
|
343 |
+
|
344 |
+
$link = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/support', 'plugins-page', 'wp-dash', 'get-support' );
|
345 |
+
|
346 |
+
$row_meta = array(
|
347 |
+
'docs' => '<a href="' . esc_attr( $link ) . '" aria-label="' . esc_attr( __( 'View Premium Addons for Elementor Documentation', 'premium-addons-for-elementor' ) ) . '" target="_blank">' . __( 'Docs & FAQs', 'premium-addons-for-elementor' ) . '</a>',
|
348 |
+
'videos' => '<a href="https://www.youtube.com/watch?v=D3INxWw_jKI&list=PLLpZVOYpMtTArB4hrlpSnDJB36D2sdoTv" aria-label="' . esc_attr( __( 'View Premium Addons Video Tutorials', 'premium-addons-for-elementor' ) ) . '" target="_blank">' . __( 'Video Tutorials', 'premium-addons-for-elementor' ) . '</a>',
|
349 |
+
);
|
350 |
+
|
351 |
+
$meta = array_merge( $meta, $row_meta );
|
352 |
+
}
|
353 |
+
|
354 |
+
return $meta;
|
355 |
+
|
356 |
+
}
|
357 |
+
|
358 |
+
/**
|
359 |
+
* Gets current screen slug
|
360 |
+
*
|
361 |
+
* @since 3.3.8
|
362 |
+
* @access public
|
363 |
+
*
|
364 |
+
* @return string current screen slug
|
365 |
+
*/
|
366 |
+
public static function get_current_screen() {
|
367 |
+
|
368 |
+
self::$current_screen = get_current_screen()->id;
|
369 |
+
|
370 |
+
return isset( self::$current_screen ) ? self::$current_screen : false;
|
371 |
+
|
372 |
+
}
|
373 |
+
|
374 |
+
/**
|
375 |
+
* Set Admin Tabs
|
376 |
+
*
|
377 |
+
* @access private
|
378 |
+
* @since 3.20.8
|
379 |
+
*/
|
380 |
+
private function set_admin_tabs() {
|
381 |
+
|
382 |
+
$slug = $this->page_slug;
|
383 |
+
|
384 |
+
self::$tabs = array(
|
385 |
+
'general' => array(
|
386 |
+
'id' => 'general',
|
387 |
+
'slug' => $slug . '#tab=general',
|
388 |
+
'title' => __( 'General', 'premium-addons-for-elementor' ),
|
389 |
+
'href' => '#tab=general',
|
390 |
+
'template' => PREMIUM_ADDONS_PATH . 'admin/includes/templates/general',
|
391 |
+
),
|
392 |
+
'elements' => array(
|
393 |
+
'id' => 'elements',
|
394 |
+
'slug' => $slug . '#tab=elements',
|
395 |
+
'title' => __( 'Widgets & Add-ons', 'premium-addons-for-elementor' ),
|
396 |
+
'href' => '#tab=elements',
|
397 |
+
'template' => PREMIUM_ADDONS_PATH . 'admin/includes/templates/modules-settings',
|
398 |
+
),
|
399 |
+
'features' => array(
|
400 |
+
'id' => 'features',
|
401 |
+
'slug' => $slug . '#tab=features',
|
402 |
+
'title' => __( 'Global Features', 'premium-addons-for-elementor' ),
|
403 |
+
'href' => '#tab=features',
|
404 |
+
'template' => PREMIUM_ADDONS_PATH . 'admin/includes/templates/features',
|
405 |
+
),
|
406 |
+
'integrations' => array(
|
407 |
+
'id' => 'integrations',
|
408 |
+
'slug' => $slug . '#tab=integrations',
|
409 |
+
'title' => __( 'Integrations', 'premium-addons-for-elementor' ),
|
410 |
+
'href' => '#tab=integrations',
|
411 |
+
'template' => PREMIUM_ADDONS_PATH . 'admin/includes/templates/integrations',
|
412 |
+
),
|
413 |
+
'version-control' => array(
|
414 |
+
'id' => 'vcontrol',
|
415 |
+
'slug' => $slug . '#tab=vcontrol',
|
416 |
+
'title' => __( 'Version Control', 'premium-addons-for-elementor' ),
|
417 |
+
'href' => '#tab=vcontrol',
|
418 |
+
'template' => PREMIUM_ADDONS_PATH . 'admin/includes/templates/version-control',
|
419 |
+
),
|
420 |
+
'white-label' => array(
|
421 |
+
'id' => 'white-label',
|
422 |
+
'slug' => $slug . '#tab=white-label',
|
423 |
+
'title' => __( 'White Labeling', 'premium-addons-for-elementor' ),
|
424 |
+
'href' => '#tab=white-label',
|
425 |
+
'template' => PREMIUM_ADDONS_PATH . 'admin/includes/templates/white-label',
|
426 |
+
),
|
427 |
+
'info' => array(
|
428 |
+
'id' => 'system-info',
|
429 |
+
'slug' => $slug . '#tab=system-info',
|
430 |
+
'title' => __( 'System Info', 'premium-addons-for-elementor' ),
|
431 |
+
'href' => '#tab=system-info',
|
432 |
+
'template' => PREMIUM_ADDONS_PATH . 'admin/includes/templates/info',
|
433 |
+
),
|
434 |
+
);
|
435 |
+
|
436 |
+
self::$tabs = apply_filters( 'pa_admin_register_tabs', self::$tabs );
|
437 |
+
|
438 |
+
}
|
439 |
+
|
440 |
+
/**
|
441 |
+
* Add Menu Tabs
|
442 |
+
*
|
443 |
+
* Create Submenu Page
|
444 |
+
*
|
445 |
+
* @since 3.20.9
|
446 |
+
* @access public
|
447 |
+
*
|
448 |
+
* @return void
|
449 |
+
*/
|
450 |
+
public function add_menu_tabs() {
|
451 |
+
|
452 |
+
$plugin_name = Helper_Functions::name();
|
453 |
+
|
454 |
+
call_user_func(
|
455 |
+
'add_menu_page',
|
456 |
+
$plugin_name,
|
457 |
+
$plugin_name,
|
458 |
+
'manage_options',
|
459 |
+
$this->page_slug,
|
460 |
+
array( $this, 'render_setting_tabs' ),
|
461 |
+
'',
|
462 |
+
100
|
463 |
+
);
|
464 |
+
|
465 |
+
foreach ( self::$tabs as $tab ) {
|
466 |
+
|
467 |
+
call_user_func(
|
468 |
+
'add_submenu_page',
|
469 |
+
$this->page_slug,
|
470 |
+
$tab['title'],
|
471 |
+
$tab['title'],
|
472 |
+
'manage_options',
|
473 |
+
$tab['slug'],
|
474 |
+
'__return_null'
|
475 |
+
);
|
476 |
+
}
|
477 |
+
|
478 |
+
remove_submenu_page( $this->page_slug, $this->page_slug );
|
479 |
+
}
|
480 |
+
|
481 |
+
/**
|
482 |
+
* Render Setting Tabs
|
483 |
+
*
|
484 |
+
* Render the final HTML content for admin setting tabs
|
485 |
+
*
|
486 |
+
* @access public
|
487 |
+
* @since 3.20.8
|
488 |
+
*/
|
489 |
+
public function render_setting_tabs() {
|
490 |
+
|
491 |
+
?>
|
492 |
+
<div class="pa-settings-wrap">
|
493 |
+
<?php do_action( 'pa_before_render_admin_tabs' ); ?>
|
494 |
+
<div class="pa-settings-tabs">
|
495 |
+
<ul class="pa-settings-tabs-list">
|
496 |
+
<?php
|
497 |
+
foreach ( self::$tabs as $key => $tab ) {
|
498 |
+
$link = '<li class="pa-settings-tab">';
|
499 |
+
$link .= '<a id="pa-tab-link-' . esc_attr( $tab['id'] ) . '"';
|
500 |
+
$link .= ' href="' . esc_url( $tab['href'] ) . '">';
|
501 |
+
$link .= '<i class="pa-dash-' . esc_attr( $tab['id'] ) . '"></i>';
|
502 |
+
$link .= '<span>' . esc_html( $tab['title'] ) . '</span>';
|
503 |
+
$link .= '</a>';
|
504 |
+
$link .= '</li>';
|
505 |
+
|
506 |
+
echo $link;
|
507 |
+
}
|
508 |
+
?>
|
509 |
+
</ul>
|
510 |
+
</div> <!-- Settings Tabs -->
|
511 |
+
|
512 |
+
<div class="pa-settings-sections">
|
513 |
+
<?php
|
514 |
+
foreach ( self::$tabs as $key => $tab ) {
|
515 |
+
echo wp_kses_post( '<div id="pa-section-' . $tab['id'] . '" class="pa-section pa-section-' . $key . '">' );
|
516 |
+
include_once $tab['template'] . '.php';
|
517 |
+
echo '</div>';
|
518 |
+
}
|
519 |
+
?>
|
520 |
+
</div> <!-- Settings Sections -->
|
521 |
+
<?php do_action( 'pa_after_render_admin_tabs' ); ?>
|
522 |
+
</div> <!-- Settings Wrap -->
|
523 |
+
<?php
|
524 |
+
}
|
525 |
+
|
526 |
+
/**
|
527 |
+
* Render Dashboard Header
|
528 |
+
*
|
529 |
+
* @since 4.0.0
|
530 |
+
* @access public
|
531 |
+
*/
|
532 |
+
public function render_dashboard_header() {
|
533 |
+
|
534 |
+
$url = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro/', 'settings-page', 'wp-dash', 'dashboard' );
|
535 |
+
|
536 |
+
$show_logo = Helper_Functions::is_hide_logo();
|
537 |
+
|
538 |
+
?>
|
539 |
+
|
540 |
+
<div class="papro-admin-notice">
|
541 |
+
<?php if ( ! $show_logo ) : ?>
|
542 |
+
<div class="papro-admin-notice-left">
|
543 |
+
<div class="papro-admin-notice-logo">
|
544 |
+
<img class="pa-notice-logo" src="<?php echo esc_attr( PREMIUM_ADDONS_URL . 'admin/images/papro-notice-logo.png' ); ?>">
|
545 |
+
</div>
|
546 |
+
<a href="https://premiumaddons.com" target="_blank"></a>
|
547 |
+
</div>
|
548 |
+
<?php endif; ?>
|
549 |
+
|
550 |
+
<?php if ( ! Helper_Functions::check_papro_version() ) : ?>
|
551 |
+
<div class="papro-admin-notice-right">
|
552 |
+
<div class="papro-admin-notice-info">
|
553 |
+
<h4>
|
554 |
+
<?php echo esc_html( __( 'Get Premium Addons PRO', 'premium-addons-for-elementor' ) ); ?>
|
555 |
+
</h4>
|
556 |
+
<p>
|
557 |
+
<?php
|
558 |
+
/* translators: %s: html tags */
|
559 |
+
echo wp_kses_post( sprintf( __( 'Supercharge your Elementor with %1$sPRO Widgets & Addons%2$s that you won\'t find anywhere else.', 'premium-addons-for-elementor' ), '<span>', '</span>' ) );
|
560 |
+
?>
|
561 |
+
</p>
|
562 |
+
</div>
|
563 |
+
<div class="papro-admin-notice-cta">
|
564 |
+
<a class="papro-notice-btn" href="<?php echo esc_url( $url ); ?>" target="_blank">
|
565 |
+
<?php echo esc_html( __( 'Get PRO', 'premium-addons-for-elementor' ) ); ?>
|
566 |
+
</a>
|
567 |
+
</div>
|
568 |
+
</div>
|
569 |
+
<?php endif; ?>
|
570 |
+
</div>
|
571 |
+
|
572 |
+
<?php
|
573 |
+
}
|
574 |
+
|
575 |
+
/**
|
576 |
+
* Save Settings
|
577 |
+
*
|
578 |
+
* Save elements settings using AJAX
|
579 |
+
*
|
580 |
+
* @access public
|
581 |
+
* @since 3.20.8
|
582 |
+
*/
|
583 |
+
public function save_settings() {
|
584 |
+
|
585 |
+
check_ajax_referer( 'pa-settings-tab', 'security' );
|
586 |
+
|
587 |
+
if ( ! isset( $_POST['fields'] ) ) {
|
588 |
+
return;
|
589 |
+
}
|
590 |
+
|
591 |
+
parse_str( sanitize_text_field( $_POST['fields'] ), $settings );
|
592 |
+
|
593 |
+
$defaults = self::get_default_elements();
|
594 |
+
|
595 |
+
$elements = array_fill_keys( array_keys( array_intersect_key( $settings, $defaults ) ), true );
|
596 |
+
|
597 |
+
update_option( 'pa_save_settings', $elements );
|
598 |
+
|
599 |
+
wp_send_json_success();
|
600 |
+
}
|
601 |
+
|
602 |
+
/**
|
603 |
+
* Save Integrations Control Settings
|
604 |
+
*
|
605 |
+
* Stores integration and version control settings
|
606 |
+
*
|
607 |
+
* @since 3.20.8
|
608 |
+
* @access public
|
609 |
+
*/
|
610 |
+
public function save_additional_settings() {
|
611 |
+
|
612 |
+
check_ajax_referer( 'pa-settings-tab', 'security' );
|
613 |
+
|
614 |
+
if ( ! isset( $_POST['fields'] ) ) {
|
615 |
+
return;
|
616 |
+
}
|
617 |
+
|
618 |
+
parse_str( sanitize_text_field( $_POST['fields'] ), $settings );
|
619 |
+
|
620 |
+
$new_settings = array(
|
621 |
+
'premium-map-api' => sanitize_text_field( $settings['premium-map-api'] ),
|
622 |
+
'premium-youtube-api' => sanitize_text_field( $settings['premium-youtube-api'] ),
|
623 |
+
'premium-map-disable-api' => intval( $settings['premium-map-disable-api'] ? 1 : 0 ),
|
624 |
+
'premium-map-cluster' => intval( $settings['premium-map-cluster'] ? 1 : 0 ),
|
625 |
+
'premium-map-locale' => sanitize_text_field( $settings['premium-map-locale'] ),
|
626 |
+
'is-beta-tester' => intval( $settings['is-beta-tester'] ? 1 : 0 ),
|
627 |
+
);
|
628 |
+
|
629 |
+
update_option( 'pa_maps_save_settings', $new_settings );
|
630 |
+
|
631 |
+
wp_send_json_success( $settings );
|
632 |
+
|
633 |
+
}
|
634 |
+
|
635 |
+
/**
|
636 |
+
* Save Global Button Value
|
637 |
+
*
|
638 |
+
* Saves value for elements global switcher
|
639 |
+
*
|
640 |
+
* @since 4.0.0
|
641 |
+
* @access public
|
642 |
+
*/
|
643 |
+
public function save_global_btn_value() {
|
644 |
+
|
645 |
+
check_ajax_referer( 'pa-settings-tab', 'security' );
|
646 |
+
|
647 |
+
if ( ! isset( $_POST['isGlobalOn'] ) ) {
|
648 |
+
wp_send_json_error();
|
649 |
+
}
|
650 |
+
|
651 |
+
$global_btn_value = sanitize_text_field( $_POST['isGlobalOn'] );
|
652 |
+
|
653 |
+
update_option( 'pa_global_btn_value', $global_btn_value );
|
654 |
+
|
655 |
+
wp_send_json_success();
|
656 |
+
|
657 |
+
}
|
658 |
+
|
659 |
+
/**
|
660 |
+
* Get default Elements
|
661 |
+
*
|
662 |
+
* @since 3.20.9
|
663 |
+
* @access private
|
664 |
+
*
|
665 |
+
* @return $default_keys array keys defaults
|
666 |
+
*/
|
667 |
+
private static function get_default_elements() {
|
668 |
+
|
669 |
+
$elements = self::get_elements_list();
|
670 |
+
|
671 |
+
$keys = array();
|
672 |
+
|
673 |
+
// Now, we need to fill our array with elements keys.
|
674 |
+
foreach ( $elements as $cat ) {
|
675 |
+
if ( count( $cat['elements'] ) ) {
|
676 |
+
foreach ( $cat['elements'] as $elem ) {
|
677 |
+
array_push( $keys, $elem['key'] );
|
678 |
+
}
|
679 |
+
}
|
680 |
+
}
|
681 |
+
|
682 |
+
$default_keys = array_fill_keys( $keys, true );
|
683 |
+
|
684 |
+
return $default_keys;
|
685 |
+
|
686 |
+
}
|
687 |
+
|
688 |
+
/**
|
689 |
+
* Get Pro Elements
|
690 |
+
*
|
691 |
+
* @since 4.5.3
|
692 |
+
* @access public
|
693 |
+
*/
|
694 |
+
public static function get_pro_elements() {
|
695 |
+
|
696 |
+
$elements = self::get_elements_list();
|
697 |
+
|
698 |
+
$pro_elements = array();
|
699 |
+
|
700 |
+
$all_elements = $elements['cat-1'];
|
701 |
+
|
702 |
+
if ( count( $all_elements['elements'] ) ) {
|
703 |
+
foreach ( $all_elements['elements'] as $elem ) {
|
704 |
+
if ( isset( $elem['is_pro'] ) && ! isset( $elem['is_global'] ) ) {
|
705 |
+
array_push( $pro_elements, $elem );
|
706 |
+
}
|
707 |
+
}
|
708 |
+
}
|
709 |
+
|
710 |
+
return $pro_elements;
|
711 |
+
|
712 |
+
}
|
713 |
+
|
714 |
+
/**
|
715 |
+
* Get Default Interations
|
716 |
+
*
|
717 |
+
* @since 3.20.9
|
718 |
+
* @access private
|
719 |
+
*
|
720 |
+
* @return $default_keys array default keys
|
721 |
+
*/
|
722 |
+
private static function get_default_integrations() {
|
723 |
+
|
724 |
+
$settings = self::get_integrations_list();
|
725 |
+
|
726 |
+
$default_keys = array_fill_keys( $settings, true );
|
727 |
+
|
728 |
+
// Beta Tester should NOT be enabled by default.
|
729 |
+
$default_keys['is-beta-tester'] = false;
|
730 |
+
|
731 |
+
return $default_keys;
|
732 |
+
|
733 |
+
}
|
734 |
+
|
735 |
+
/**
|
736 |
+
* Get enabled widgets
|
737 |
+
*
|
738 |
+
* @since 3.20.9
|
739 |
+
* @access public
|
740 |
+
*
|
741 |
+
* @return array $enabled_keys enabled elements
|
742 |
+
*/
|
743 |
+
public static function get_enabled_elements() {
|
744 |
+
|
745 |
+
$defaults = self::get_default_elements();
|
746 |
+
|
747 |
+
$enabled_keys = get_option( 'pa_save_settings', $defaults );
|
748 |
+
|
749 |
+
foreach ( $defaults as $key => $value ) {
|
750 |
+
if ( ! isset( $enabled_keys[ $key ] ) ) {
|
751 |
+
$defaults[ $key ] = 0;
|
752 |
+
}
|
753 |
+
}
|
754 |
+
|
755 |
+
return $defaults;
|
756 |
+
|
757 |
+
}
|
758 |
+
|
759 |
+
/**
|
760 |
+
* Check If Premium Templates is enabled
|
761 |
+
*
|
762 |
+
* @since 3.6.0
|
763 |
+
* @access public
|
764 |
+
*
|
765 |
+
* @return boolean
|
766 |
+
*/
|
767 |
+
public static function check_premium_templates() {
|
768 |
+
|
769 |
+
$settings = self::get_enabled_elements();
|
770 |
+
|
771 |
+
if ( ! isset( $settings['premium-templates'] ) ) {
|
772 |
+
return true;
|
773 |
+
}
|
774 |
+
|
775 |
+
$is_enabled = $settings['premium-templates'];
|
776 |
+
|
777 |
+
return $is_enabled;
|
778 |
+
}
|
779 |
+
|
780 |
+
|
781 |
+
/**
|
782 |
+
* Check If Premium Duplicator is enabled
|
783 |
+
*
|
784 |
+
* @since 3.20.9
|
785 |
+
* @access public
|
786 |
+
*
|
787 |
+
* @return boolean
|
788 |
+
*/
|
789 |
+
public static function check_duplicator() {
|
790 |
+
|
791 |
+
$settings = self::get_enabled_elements();
|
792 |
+
|
793 |
+
if ( ! isset( $settings['premium-duplicator'] ) ) {
|
794 |
+
return true;
|
795 |
+
}
|
796 |
+
|
797 |
+
$is_enabled = $settings['premium-duplicator'];
|
798 |
+
|
799 |
+
return $is_enabled;
|
800 |
+
}
|
801 |
+
|
802 |
+
/**
|
803 |
+
* Get Integrations Settings
|
804 |
+
*
|
805 |
+
* Get plugin integrations settings
|
806 |
+
*
|
807 |
+
* @since 3.20.9
|
808 |
+
* @access public
|
809 |
+
*
|
810 |
+
* @return array $settings integrations settings
|
811 |
+
*/
|
812 |
+
public static function get_integrations_settings() {
|
813 |
+
|
814 |
+
$enabled_keys = get_option( 'pa_maps_save_settings', self::get_default_integrations() );
|
815 |
+
|
816 |
+
return $enabled_keys;
|
817 |
+
|
818 |
+
}
|
819 |
+
|
820 |
+
/**
|
821 |
+
* Run PA Rollback
|
822 |
+
*
|
823 |
+
* Trigger PA Rollback actions
|
824 |
+
*
|
825 |
+
* @since 4.2.5
|
826 |
+
* @access public
|
827 |
+
*/
|
828 |
+
public function run_pa_rollback() {
|
829 |
+
|
830 |
+
check_admin_referer( 'premium_addons_rollback' );
|
831 |
+
|
832 |
+
$plugin_slug = basename( PREMIUM_ADDONS_FILE, '.php' );
|
833 |
+
|
834 |
+
$pa_rollback = new PA_Rollback(
|
835 |
+
array(
|
836 |
+
'version' => PREMIUM_ADDONS_STABLE_VERSION,
|
837 |
+
'plugin_name' => PREMIUM_ADDONS_BASENAME,
|
838 |
+
'plugin_slug' => $plugin_slug,
|
839 |
+
'package_url' => sprintf( 'https://downloads.wordpress.org/plugin/%s.%s.zip', $plugin_slug, PREMIUM_ADDONS_STABLE_VERSION ),
|
840 |
+
)
|
841 |
+
);
|
842 |
+
|
843 |
+
$pa_rollback->run();
|
844 |
+
|
845 |
+
wp_die(
|
846 |
+
'',
|
847 |
+
esc_html( __( 'Rollback to Previous Version', 'premium-addons-for-elementor' ) ),
|
848 |
+
array(
|
849 |
+
'response' => 200,
|
850 |
+
)
|
851 |
+
);
|
852 |
+
|
853 |
+
}
|
854 |
+
|
855 |
+
/**
|
856 |
+
* Disable unused widgets.
|
857 |
+
*
|
858 |
+
* @access public
|
859 |
+
* @since 4.5.8
|
860 |
+
*/
|
861 |
+
public function get_unused_widgets() {
|
862 |
+
|
863 |
+
check_ajax_referer( 'pa-settings-tab', 'security' );
|
864 |
+
|
865 |
+
if ( ! current_user_can( 'install_plugins' ) ) {
|
866 |
+
wp_send_json_error();
|
867 |
+
}
|
868 |
+
|
869 |
+
$pa_elements = self::get_pa_elements_names();
|
870 |
+
|
871 |
+
$used_widgets = self::get_used_widgets();
|
872 |
+
|
873 |
+
$unused_widgets = array_diff( $pa_elements, array_keys( $used_widgets ) );
|
874 |
+
|
875 |
+
wp_send_json_success( $unused_widgets );
|
876 |
+
|
877 |
+
}
|
878 |
+
|
879 |
+
/**
|
880 |
+
* Get PA widget names.
|
881 |
+
*
|
882 |
+
* @access public
|
883 |
+
* @since 4.5.8
|
884 |
+
*
|
885 |
+
* @return array
|
886 |
+
*/
|
887 |
+
public static function get_pa_elements_names() {
|
888 |
+
|
889 |
+
$names = self::$elements_names;
|
890 |
+
|
891 |
+
if ( null === $names ) {
|
892 |
+
|
893 |
+
$names = array_map(
|
894 |
+
function( $item ) {
|
895 |
+
return isset( $item['name'] ) ? $item['name'] : 'global';
|
896 |
+
},
|
897 |
+
self::get_elements_list()['cat-1']['elements']
|
898 |
+
);
|
899 |
+
|
900 |
+
$names = array_filter(
|
901 |
+
$names,
|
902 |
+
function( $name ) {
|
903 |
+
return 'global' !== $name;
|
904 |
+
}
|
905 |
+
);
|
906 |
+
|
907 |
+
}
|
908 |
+
|
909 |
+
return $names;
|
910 |
+
}
|
911 |
+
|
912 |
+
/**
|
913 |
+
* Get used widgets.
|
914 |
+
*
|
915 |
+
* @access public
|
916 |
+
* @since 4.5.8
|
917 |
+
*
|
918 |
+
* @return array
|
919 |
+
*/
|
920 |
+
public static function get_used_widgets() {
|
921 |
+
|
922 |
+
$used_widgets = array();
|
923 |
+
$tracker_allowed = 'yes' === get_option( 'elementor_allow_tracking' ) ? true : false;
|
924 |
+
|
925 |
+
if ( ! $tracker_allowed ) {
|
926 |
+
return false;
|
927 |
+
}
|
928 |
+
|
929 |
+
if ( class_exists( 'Elementor\Modules\Usage\Module' ) ) {
|
930 |
+
|
931 |
+
$module = Module::instance();
|
932 |
+
$elements = $module->get_formatted_usage( 'raw' );
|
933 |
+
|
934 |
+
$pa_elements = self::get_pa_elements_names();
|
935 |
+
|
936 |
+
if ( is_array( $elements ) || is_object( $elements ) ) {
|
937 |
+
|
938 |
+
foreach ( $elements as $post_type => $data ) {
|
939 |
+
|
940 |
+
foreach ( $data['elements'] as $element => $count ) {
|
941 |
+
|
942 |
+
if ( in_array( $element, $pa_elements, true ) ) {
|
943 |
+
|
944 |
+
if ( isset( $used_widgets[ $element ] ) ) {
|
945 |
+
$used_widgets[ $element ] += $count;
|
946 |
+
} else {
|
947 |
+
$used_widgets[ $element ] = $count;
|
948 |
+
}
|
949 |
+
}
|
950 |
+
}
|
951 |
+
}
|
952 |
+
}
|
953 |
+
}
|
954 |
+
|
955 |
+
return $used_widgets;
|
956 |
+
}
|
957 |
+
|
958 |
+
/**
|
959 |
+
* Subscribe Newsletter
|
960 |
+
*
|
961 |
+
* Adds an email to Premium Addons subscribers list
|
962 |
+
*
|
963 |
+
* @since 4.7.0
|
964 |
+
*
|
965 |
+
* @access public
|
966 |
+
*/
|
967 |
+
public function subscribe_newsletter() {
|
968 |
+
|
969 |
+
check_ajax_referer( 'pa-settings-tab', 'security' );
|
970 |
+
|
971 |
+
if ( ! self::check_user_can( 'manage_options' ) ) {
|
972 |
+
wp_send_json_error();
|
973 |
+
}
|
974 |
+
|
975 |
+
$email = isset( $_POST['email'] ) ? $_POST['email'] : '';
|
976 |
+
|
977 |
+
$api_url = 'https://premiumaddons.com/wp-json/mailchimp/v2/add';
|
978 |
+
|
979 |
+
$request = add_query_arg(
|
980 |
+
array(
|
981 |
+
'email' => $email,
|
982 |
+
),
|
983 |
+
$api_url
|
984 |
+
);
|
985 |
+
|
986 |
+
$response = wp_remote_get(
|
987 |
+
$request,
|
988 |
+
array(
|
989 |
+
'timeout' => 60,
|
990 |
+
'sslverify' => true,
|
991 |
+
)
|
992 |
+
);
|
993 |
+
|
994 |
+
$body = wp_remote_retrieve_body( $response );
|
995 |
+
$body = json_decode( $body, true );
|
996 |
+
|
997 |
+
wp_send_json_success( $body );
|
998 |
+
|
999 |
+
}
|
1000 |
+
|
1001 |
+
/**
|
1002 |
+
* Get PA News
|
1003 |
+
*
|
1004 |
+
* Gets a list of the latest three blog posts
|
1005 |
+
*
|
1006 |
+
* @since 4.7.0
|
1007 |
+
*
|
1008 |
+
* @access public
|
1009 |
+
*/
|
1010 |
+
public function get_pa_news() {
|
1011 |
+
|
1012 |
+
$posts = get_transient( 'pa_news' );
|
1013 |
+
|
1014 |
+
if ( empty( $posts ) ) {
|
1015 |
+
|
1016 |
+
$api_url = 'https://premiumaddons.com/wp-json/wp/v2/posts';
|
1017 |
+
|
1018 |
+
$request = add_query_arg(
|
1019 |
+
array(
|
1020 |
+
'per_page' => 3,
|
1021 |
+
),
|
1022 |
+
$api_url
|
1023 |
+
);
|
1024 |
+
|
1025 |
+
$response = wp_remote_get(
|
1026 |
+
$request,
|
1027 |
+
array(
|
1028 |
+
'timeout' => 60,
|
1029 |
+
'sslverify' => true,
|
1030 |
+
)
|
1031 |
+
);
|
1032 |
+
|
1033 |
+
$body = wp_remote_retrieve_body( $response );
|
1034 |
+
$posts = json_decode( $body, true );
|
1035 |
+
|
1036 |
+
set_transient( 'pa_news', $posts, WEEK_IN_SECONDS );
|
1037 |
+
|
1038 |
+
}
|
1039 |
+
|
1040 |
+
return $posts;
|
1041 |
+
|
1042 |
+
}
|
1043 |
+
|
1044 |
+
/**
|
1045 |
+
* Creates and returns an instance of the class
|
1046 |
+
*
|
1047 |
+
* @since 1.0.0
|
1048 |
+
* @access public
|
1049 |
+
*
|
1050 |
+
* @return object
|
1051 |
+
*/
|
1052 |
+
public static function get_instance() {
|
1053 |
+
|
1054 |
+
if ( ! isset( self::$instance ) ) {
|
1055 |
+
|
1056 |
+
self::$instance = new self();
|
1057 |
+
|
1058 |
+
}
|
1059 |
+
|
1060 |
+
return self::$instance;
|
1061 |
+
}
|
1062 |
+
}
|
admin/includes/templates/features.php
CHANGED
@@ -1,185 +1,185 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
|
7 |
-
use PremiumAddons\Includes\Helper_Functions;
|
8 |
-
|
9 |
-
$prefix = Helper_Functions::get_prefix();
|
10 |
-
|
11 |
-
// Get elements settings
|
12 |
-
$enabled_elements = self::get_enabled_elements();
|
13 |
-
|
14 |
-
$elements = self::get_elements_list();
|
15 |
-
|
16 |
-
$features = $elements['cat-11']['elements'];
|
17 |
-
|
18 |
-
?>
|
19 |
-
|
20 |
-
<div class="pa-section-content">
|
21 |
-
<div class="row">
|
22 |
-
<div class="col-full">
|
23 |
-
<form action="" method="POST" id="pa-features" name="pa-features" class="pa-settings-form">
|
24 |
-
<div id="pa-features-settings" class="pa-settings-tab">
|
25 |
-
|
26 |
-
<div class="pa-section-outer-wrap">
|
27 |
-
<div class="pa-section-info-wrap">
|
28 |
-
<div class="pa-section-info">
|
29 |
-
<h4><?php echo sprintf( '%1$s %2$s', $prefix, __( 'Templates', 'premium-addons-for-elementor' ) ); ?></h4>
|
30 |
-
<p><?php echo __( 'Build Professional Website in Minutes Using Our Pre-Made Premium Elementor Templates.', 'premium-addons-for-elementor' ); ?></p>
|
31 |
-
</div>
|
32 |
-
|
33 |
-
<div class="pa-section-info-cta">
|
34 |
-
<label class="switch">
|
35 |
-
<input type="checkbox" id="premium-templates" name="premium-templates" <?php echo checked( 1, $enabled_elements['premium-templates'], false ); ?>>
|
36 |
-
<span class="slider round"></span>
|
37 |
-
</label>
|
38 |
-
</p>
|
39 |
-
</div>
|
40 |
-
</div>
|
41 |
-
<a href="<?php echo esc_url( $features[0]['demo'] ); ?>" target="_blank"></a>
|
42 |
-
</div>
|
43 |
-
|
44 |
-
<div class="pa-section-outer-wrap">
|
45 |
-
<div class="pa-section-info-wrap">
|
46 |
-
<div class="pa-section-info">
|
47 |
-
<h4><?php echo __( 'Equal Height', 'premium-addons-for-elementor' ); ?></h4>
|
48 |
-
<p><?php echo __( 'Make your widgets the same height with just ONE click.', 'premium-addons-for-elementor' ); ?></p>
|
49 |
-
</div>
|
50 |
-
|
51 |
-
<div class="pa-section-info-cta">
|
52 |
-
<label class="switch">
|
53 |
-
<input type="checkbox" id="premium-equal-height" name="premium-equal-height" <?php echo checked( 1, $enabled_elements['premium-equal-height'], false ); ?>>
|
54 |
-
<span class="slider round"></span>
|
55 |
-
</label>
|
56 |
-
</p>
|
57 |
-
</div>
|
58 |
-
</div>
|
59 |
-
<a href="<?php echo esc_url( $features[1]['demo'] ); ?>" target="_blank"></a>
|
60 |
-
</div>
|
61 |
-
|
62 |
-
<div class="pa-section-outer-wrap">
|
63 |
-
<div class="pa-section-info-wrap">
|
64 |
-
<div class="pa-section-info">
|
65 |
-
<h4><?php echo __( 'Custom Mouse Cursor', 'premium-addons-for-elementor' ); ?></h4>
|
66 |
-
<p><?php echo __( 'Change the default mouse cursor with icon, image, or Lottie animation for any Elementor section, column, or widget.', 'premium-addons-for-elementor' ); ?></p>
|
67 |
-
</div>
|
68 |
-
<?php
|
69 |
-
|
70 |
-
$status = ( isset( $features[3]['is_pro'] ) && ! Helper_Functions::check_papro_version() ) ? 'disabled' : checked( 1, $enabled_elements['premium-global-cursor'], false );
|
71 |
-
$class = ( isset( $features[3]['is_pro'] ) && ! Helper_Functions::check_papro_version() ) ? 'pro-' : '';
|
72 |
-
$switcher_class = $class . 'slider round';
|
73 |
-
|
74 |
-
?>
|
75 |
-
<div class="pa-section-info-cta">
|
76 |
-
<label class="switch">
|
77 |
-
<input type="checkbox" id="premium-global-cursor" name="premium-global-cursor" <?php echo $status; ?>>
|
78 |
-
<span class="<?php echo esc_attr( $switcher_class ); ?>"></span>
|
79 |
-
</label>
|
80 |
-
</p>
|
81 |
-
</div>
|
82 |
-
</div>
|
83 |
-
<a href="<?php echo esc_url( $features[3]['demo'] ); ?>" target="_blank"></a>
|
84 |
-
</div>
|
85 |
-
|
86 |
-
<div class="pa-section-outer-wrap">
|
87 |
-
<div class="pa-section-info-wrap">
|
88 |
-
<div class="pa-section-info">
|
89 |
-
<h4><?php echo __( 'Global Badge', 'premium-addons-for-elementor' ); ?></h4>
|
90 |
-
<p><?php echo __( 'Add icon, image, Lottie, or SVG blob shape badge to any Elementor section, column, or widget.', 'premium-addons-for-elementor' ); ?></p>
|
91 |
-
</div>
|
92 |
-
<?php
|
93 |
-
|
94 |
-
$status = ( isset( $features[4]['is_pro'] ) && ! Helper_Functions::check_papro_version() ) ? 'disabled' : checked( 1, $enabled_elements['premium-global-badge'], false );
|
95 |
-
$class = ( isset( $features[4]['is_pro'] ) && ! Helper_Functions::check_papro_version() ) ? 'pro-' : '';
|
96 |
-
$switcher_class = $class . 'slider round';
|
97 |
-
|
98 |
-
?>
|
99 |
-
<div class="pa-section-info-cta">
|
100 |
-
<label class="switch">
|
101 |
-
<input type="checkbox" id="premium-global-badge" name="premium-global-badge" <?php echo $status; ?>>
|
102 |
-
<span class="<?php echo esc_attr( $switcher_class ); ?>"></span>
|
103 |
-
</label>
|
104 |
-
</p>
|
105 |
-
</div>
|
106 |
-
</div>
|
107 |
-
<a href="<?php echo esc_url( $features[4]['demo'] ); ?>" target="_blank"></a>
|
108 |
-
</div>
|
109 |
-
|
110 |
-
<div class="pa-section-outer-wrap">
|
111 |
-
<div class="pa-section-info-wrap">
|
112 |
-
<div class="pa-section-info">
|
113 |
-
<h4><?php echo __( 'Display Conditions', 'premium-addons-for-elementor' ); ?></h4>
|
114 |
-
<p><?php echo __( 'Show/hide content dynamically based on location, browser, operating system, user role, device type, Woocommerce, ACF, etc.', 'premium-addons-for-elementor' ); ?></p>
|
115 |
-
</div>
|
116 |
-
|
117 |
-
<div class="pa-section-info-cta">
|
118 |
-
<label class="switch">
|
119 |
-
<input type="checkbox" id="pa-display-conditions" name="pa-display-conditions" <?php echo checked( 1, $enabled_elements['pa-display-conditions'], false ); ?>>
|
120 |
-
<span class="slider round"></span>
|
121 |
-
</label>
|
122 |
-
</p>
|
123 |
-
</div>
|
124 |
-
</div>
|
125 |
-
<a href="<?php echo esc_url( $features[2]['demo'] ); ?>" target="_blank"></a>
|
126 |
-
</div>
|
127 |
-
|
128 |
-
<div class="pa-section-outer-wrap">
|
129 |
-
<div class="pa-section-info-wrap">
|
130 |
-
<div class="pa-section-info">
|
131 |
-
<h4><?php echo __( 'Floating Effects', 'premium-addons-for-elementor' ); ?></h4>
|
132 |
-
<p><?php echo __( 'Apply advanced floating effects on any Elementor element or a custom CSS selector.', 'premium-addons-for-elementor' ); ?></p>
|
133 |
-
</div>
|
134 |
-
|
135 |
-
<div class="pa-section-info-cta">
|
136 |
-
<label class="switch">
|
137 |
-
<input type="checkbox" id="premium-floating-effects" name="premium-floating-effects" <?php echo checked( 1, $enabled_elements['premium-floating-effects'], false ); ?>>
|
138 |
-
<span class="slider round"></span>
|
139 |
-
</label>
|
140 |
-
</p>
|
141 |
-
</div>
|
142 |
-
</div>
|
143 |
-
<a href="<?php echo esc_url( $features[5]['demo'] ); ?>" target="_blank"></a>
|
144 |
-
</div>
|
145 |
-
|
146 |
-
<div class="pa-section-outer-wrap">
|
147 |
-
<div class="pa-section-info-wrap">
|
148 |
-
<div class="pa-section-info">
|
149 |
-
<h4><?php echo __( 'Cross-Domain Copy N’ Paste', 'premium-addons-for-elementor' ); ?></h4>
|
150 |
-
<p><?php echo __( 'Copy any Elementor content from site to another in just ONE click.', 'premium-addons-for-elementor' ); ?></p>
|
151 |
-
</div>
|
152 |
-
|
153 |
-
<div class="pa-section-info-cta">
|
154 |
-
<label class="switch">
|
155 |
-
<input type="checkbox" id="premium-cross-domain" name="premium-cross-domain" <?php echo checked( 1, $enabled_elements['premium-cross-domain'], false ); ?>>
|
156 |
-
<span class="slider round"></span>
|
157 |
-
</label>
|
158 |
-
</p>
|
159 |
-
</div>
|
160 |
-
</div>
|
161 |
-
<a href="<?php echo esc_url( $features[6]['demo'] ); ?>" target="_blank"></a>
|
162 |
-
</div>
|
163 |
-
|
164 |
-
<div class="pa-section-outer-wrap">
|
165 |
-
<div class="pa-section-info-wrap">
|
166 |
-
<div class="pa-section-info">
|
167 |
-
<h4><?php echo __( 'Duplicator', 'premium-addons-for-elementor' ); ?></h4>
|
168 |
-
<p><?php echo __( 'Duplicate any post, page or template on your website.', 'premium-addons-for-elementor' ); ?></p>
|
169 |
-
</div>
|
170 |
-
|
171 |
-
<div class="pa-section-info-cta">
|
172 |
-
<label class="switch">
|
173 |
-
<input type="checkbox" id="premium-duplicator" name="premium-duplicator" <?php echo checked( 1, $enabled_elements['premium-duplicator'], false ); ?>>
|
174 |
-
<span class="slider round"></span>
|
175 |
-
</label>
|
176 |
-
</p>
|
177 |
-
</div>
|
178 |
-
</div>
|
179 |
-
</div>
|
180 |
-
|
181 |
-
</div>
|
182 |
-
</form> <!-- End Form -->
|
183 |
-
</div>
|
184 |
-
</div>
|
185 |
-
</div> <!-- End Section Content -->
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
use PremiumAddons\Includes\Helper_Functions;
|
8 |
+
|
9 |
+
$prefix = Helper_Functions::get_prefix();
|
10 |
+
|
11 |
+
// Get elements settings
|
12 |
+
$enabled_elements = self::get_enabled_elements();
|
13 |
+
|
14 |
+
$elements = self::get_elements_list();
|
15 |
+
|
16 |
+
$features = $elements['cat-11']['elements'];
|
17 |
+
|
18 |
+
?>
|
19 |
+
|
20 |
+
<div class="pa-section-content">
|
21 |
+
<div class="row">
|
22 |
+
<div class="col-full">
|
23 |
+
<form action="" method="POST" id="pa-features" name="pa-features" class="pa-settings-form">
|
24 |
+
<div id="pa-features-settings" class="pa-settings-tab">
|
25 |
+
|
26 |
+
<div class="pa-section-outer-wrap">
|
27 |
+
<div class="pa-section-info-wrap">
|
28 |
+
<div class="pa-section-info">
|
29 |
+
<h4><?php echo sprintf( '%1$s %2$s', $prefix, __( 'Templates', 'premium-addons-for-elementor' ) ); ?></h4>
|
30 |
+
<p><?php echo __( 'Build Professional Website in Minutes Using Our Pre-Made Premium Elementor Templates.', 'premium-addons-for-elementor' ); ?></p>
|
31 |
+
</div>
|
32 |
+
|
33 |
+
<div class="pa-section-info-cta">
|
34 |
+
<label class="switch">
|
35 |
+
<input type="checkbox" id="premium-templates" name="premium-templates" <?php echo checked( 1, $enabled_elements['premium-templates'], false ); ?>>
|
36 |
+
<span class="slider round"></span>
|
37 |
+
</label>
|
38 |
+
</p>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
<a href="<?php echo esc_url( $features[0]['demo'] ); ?>" target="_blank"></a>
|
42 |
+
</div>
|
43 |
+
|
44 |
+
<div class="pa-section-outer-wrap">
|
45 |
+
<div class="pa-section-info-wrap">
|
46 |
+
<div class="pa-section-info">
|
47 |
+
<h4><?php echo __( 'Equal Height', 'premium-addons-for-elementor' ); ?></h4>
|
48 |
+
<p><?php echo __( 'Make your widgets the same height with just ONE click.', 'premium-addons-for-elementor' ); ?></p>
|
49 |
+
</div>
|
50 |
+
|
51 |
+
<div class="pa-section-info-cta">
|
52 |
+
<label class="switch">
|
53 |
+
<input type="checkbox" id="premium-equal-height" name="premium-equal-height" <?php echo checked( 1, $enabled_elements['premium-equal-height'], false ); ?>>
|
54 |
+
<span class="slider round"></span>
|
55 |
+
</label>
|
56 |
+
</p>
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
<a href="<?php echo esc_url( $features[1]['demo'] ); ?>" target="_blank"></a>
|
60 |
+
</div>
|
61 |
+
|
62 |
+
<div class="pa-section-outer-wrap">
|
63 |
+
<div class="pa-section-info-wrap">
|
64 |
+
<div class="pa-section-info">
|
65 |
+
<h4><?php echo __( 'Custom Mouse Cursor', 'premium-addons-for-elementor' ); ?></h4>
|
66 |
+
<p><?php echo __( 'Change the default mouse cursor with icon, image, or Lottie animation for any Elementor section, column, or widget.', 'premium-addons-for-elementor' ); ?></p>
|
67 |
+
</div>
|
68 |
+
<?php
|
69 |
+
|
70 |
+
$status = ( isset( $features[3]['is_pro'] ) && ! Helper_Functions::check_papro_version() ) ? 'disabled' : checked( 1, $enabled_elements['premium-global-cursor'], false );
|
71 |
+
$class = ( isset( $features[3]['is_pro'] ) && ! Helper_Functions::check_papro_version() ) ? 'pro-' : '';
|
72 |
+
$switcher_class = $class . 'slider round';
|
73 |
+
|
74 |
+
?>
|
75 |
+
<div class="pa-section-info-cta">
|
76 |
+
<label class="switch">
|
77 |
+
<input type="checkbox" id="premium-global-cursor" name="premium-global-cursor" <?php echo $status; ?>>
|
78 |
+
<span class="<?php echo esc_attr( $switcher_class ); ?>"></span>
|
79 |
+
</label>
|
80 |
+
</p>
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
<a href="<?php echo esc_url( $features[3]['demo'] ); ?>" target="_blank"></a>
|
84 |
+
</div>
|
85 |
+
|
86 |
+
<div class="pa-section-outer-wrap">
|
87 |
+
<div class="pa-section-info-wrap">
|
88 |
+
<div class="pa-section-info">
|
89 |
+
<h4><?php echo __( 'Global Badge', 'premium-addons-for-elementor' ); ?></h4>
|
90 |
+
<p><?php echo __( 'Add icon, image, Lottie, or SVG blob shape badge to any Elementor section, column, or widget.', 'premium-addons-for-elementor' ); ?></p>
|
91 |
+
</div>
|
92 |
+
<?php
|
93 |
+
|
94 |
+
$status = ( isset( $features[4]['is_pro'] ) && ! Helper_Functions::check_papro_version() ) ? 'disabled' : checked( 1, $enabled_elements['premium-global-badge'], false );
|
95 |
+
$class = ( isset( $features[4]['is_pro'] ) && ! Helper_Functions::check_papro_version() ) ? 'pro-' : '';
|
96 |
+
$switcher_class = $class . 'slider round';
|
97 |
+
|
98 |
+
?>
|
99 |
+
<div class="pa-section-info-cta">
|
100 |
+
<label class="switch">
|
101 |
+
<input type="checkbox" id="premium-global-badge" name="premium-global-badge" <?php echo $status; ?>>
|
102 |
+
<span class="<?php echo esc_attr( $switcher_class ); ?>"></span>
|
103 |
+
</label>
|
104 |
+
</p>
|
105 |
+
</div>
|
106 |
+
</div>
|
107 |
+
<a href="<?php echo esc_url( $features[4]['demo'] ); ?>" target="_blank"></a>
|
108 |
+
</div>
|
109 |
+
|
110 |
+
<div class="pa-section-outer-wrap">
|
111 |
+
<div class="pa-section-info-wrap">
|
112 |
+
<div class="pa-section-info">
|
113 |
+
<h4><?php echo __( 'Display Conditions', 'premium-addons-for-elementor' ); ?></h4>
|
114 |
+
<p><?php echo __( 'Show/hide content dynamically based on location, browser, operating system, user role, device type, Woocommerce, ACF, etc.', 'premium-addons-for-elementor' ); ?></p>
|
115 |
+
</div>
|
116 |
+
|
117 |
+
<div class="pa-section-info-cta">
|
118 |
+
<label class="switch">
|
119 |
+
<input type="checkbox" id="pa-display-conditions" name="pa-display-conditions" <?php echo checked( 1, $enabled_elements['pa-display-conditions'], false ); ?>>
|
120 |
+
<span class="slider round"></span>
|
121 |
+
</label>
|
122 |
+
</p>
|
123 |
+
</div>
|
124 |
+
</div>
|
125 |
+
<a href="<?php echo esc_url( $features[2]['demo'] ); ?>" target="_blank"></a>
|
126 |
+
</div>
|
127 |
+
|
128 |
+
<div class="pa-section-outer-wrap">
|
129 |
+
<div class="pa-section-info-wrap">
|
130 |
+
<div class="pa-section-info">
|
131 |
+
<h4><?php echo __( 'Floating Effects', 'premium-addons-for-elementor' ); ?></h4>
|
132 |
+
<p><?php echo __( 'Apply advanced floating effects on any Elementor element or a custom CSS selector.', 'premium-addons-for-elementor' ); ?></p>
|
133 |
+
</div>
|
134 |
+
|
135 |
+
<div class="pa-section-info-cta">
|
136 |
+
<label class="switch">
|
137 |
+
<input type="checkbox" id="premium-floating-effects" name="premium-floating-effects" <?php echo checked( 1, $enabled_elements['premium-floating-effects'], false ); ?>>
|
138 |
+
<span class="slider round"></span>
|
139 |
+
</label>
|
140 |
+
</p>
|
141 |
+
</div>
|
142 |
+
</div>
|
143 |
+
<a href="<?php echo esc_url( $features[5]['demo'] ); ?>" target="_blank"></a>
|
144 |
+
</div>
|
145 |
+
|
146 |
+
<div class="pa-section-outer-wrap">
|
147 |
+
<div class="pa-section-info-wrap">
|
148 |
+
<div class="pa-section-info">
|
149 |
+
<h4><?php echo __( 'Cross-Domain Copy N’ Paste', 'premium-addons-for-elementor' ); ?></h4>
|
150 |
+
<p><?php echo __( 'Copy any Elementor content from site to another in just ONE click.', 'premium-addons-for-elementor' ); ?></p>
|
151 |
+
</div>
|
152 |
+
|
153 |
+
<div class="pa-section-info-cta">
|
154 |
+
<label class="switch">
|
155 |
+
<input type="checkbox" id="premium-cross-domain" name="premium-cross-domain" <?php echo checked( 1, $enabled_elements['premium-cross-domain'], false ); ?>>
|
156 |
+
<span class="slider round"></span>
|
157 |
+
</label>
|
158 |
+
</p>
|
159 |
+
</div>
|
160 |
+
</div>
|
161 |
+
<a href="<?php echo esc_url( $features[6]['demo'] ); ?>" target="_blank"></a>
|
162 |
+
</div>
|
163 |
+
|
164 |
+
<div class="pa-section-outer-wrap">
|
165 |
+
<div class="pa-section-info-wrap">
|
166 |
+
<div class="pa-section-info">
|
167 |
+
<h4><?php echo __( 'Duplicator', 'premium-addons-for-elementor' ); ?></h4>
|
168 |
+
<p><?php echo __( 'Duplicate any post, page or template on your website.', 'premium-addons-for-elementor' ); ?></p>
|
169 |
+
</div>
|
170 |
+
|
171 |
+
<div class="pa-section-info-cta">
|
172 |
+
<label class="switch">
|
173 |
+
<input type="checkbox" id="premium-duplicator" name="premium-duplicator" <?php echo checked( 1, $enabled_elements['premium-duplicator'], false ); ?>>
|
174 |
+
<span class="slider round"></span>
|
175 |
+
</label>
|
176 |
+
</p>
|
177 |
+
</div>
|
178 |
+
</div>
|
179 |
+
</div>
|
180 |
+
|
181 |
+
</div>
|
182 |
+
</form> <!-- End Form -->
|
183 |
+
</div>
|
184 |
+
</div>
|
185 |
+
</div> <!-- End Section Content -->
|
includes/templates/sources/base.php
CHANGED
@@ -285,7 +285,7 @@ abstract class Premium_Templates_Source_Base {
|
|
285 |
// wp_die();
|
286 |
$element_data['settings'][ $control['name'] ] = $control_class->{$method}( $element->get_settings( $control['name'] ), $control );
|
287 |
} elseif ( 'repeater' === $control['type'] ) {
|
288 |
-
$element_data['settings'][ $control['name'] ] = $this->on_import_repeater( $element->get_settings( $control['name'] ), $
|
289 |
// $element_data['settings'][ $control['name'] ]['url'] = Utils::get_placeholder_image_src();
|
290 |
} else {
|
291 |
if ( ! empty( $element_data['settings'][ $control['name'] ]['url'] ) ) {
|
@@ -326,7 +326,7 @@ abstract class Premium_Templates_Source_Base {
|
|
326 |
return $settings;
|
327 |
}
|
328 |
|
329 |
-
public function on_import_repeater( $settings, $control_data = array()
|
330 |
if ( empty( $settings ) || empty( $control_data['fields'] ) ) {
|
331 |
return $settings;
|
332 |
}
|
285 |
// wp_die();
|
286 |
$element_data['settings'][ $control['name'] ] = $control_class->{$method}( $element->get_settings( $control['name'] ), $control );
|
287 |
} elseif ( 'repeater' === $control['type'] ) {
|
288 |
+
$element_data['settings'][ $control['name'] ] = $this->on_import_repeater( $element->get_settings( $control['name'] ), $with_media, $control );
|
289 |
// $element_data['settings'][ $control['name'] ]['url'] = Utils::get_placeholder_image_src();
|
290 |
} else {
|
291 |
if ( ! empty( $element_data['settings'][ $control['name'] ]['url'] ) ) {
|
326 |
return $settings;
|
327 |
}
|
328 |
|
329 |
+
public function on_import_repeater( $settings, $media, $control_data = array() ) {
|
330 |
if ( empty( $settings ) || empty( $control_data['fields'] ) ) {
|
331 |
return $settings;
|
332 |
}
|
modules/woocommerce/templates/product-1.php
CHANGED
@@ -66,7 +66,8 @@ $out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status',
|
|
66 |
woocommerce_template_loop_product_link_open();
|
67 |
|
68 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
69 |
-
|
|
|
70 |
}
|
71 |
|
72 |
if ( 'swap' === $settings['hover_style'] ) {
|
66 |
woocommerce_template_loop_product_link_open();
|
67 |
|
68 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
69 |
+
$product_thumb = has_post_thumbnail( $product_id ) ? get_the_post_thumbnail_url( $product_id, $image_size ) : wc_placeholder_img_src( $image_size );
|
70 |
+
echo '<img src="' . esc_url( $product_thumb ) . '">';
|
71 |
}
|
72 |
|
73 |
if ( 'swap' === $settings['hover_style'] ) {
|
modules/woocommerce/templates/product-10.php
CHANGED
@@ -91,7 +91,8 @@ $out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status', tr
|
|
91 |
woocommerce_template_loop_product_link_open();
|
92 |
|
93 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
94 |
-
|
|
|
95 |
}
|
96 |
|
97 |
if ( 'swap' === $settings['hover_style'] ) {
|
91 |
woocommerce_template_loop_product_link_open();
|
92 |
|
93 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
94 |
+
$product_thumb = has_post_thumbnail( $product_id ) ? get_the_post_thumbnail_url( $product_id, $image_size ) : wc_placeholder_img_src( $image_size );
|
95 |
+
echo '<img src="' . esc_url( $product_thumb ) . '">';
|
96 |
}
|
97 |
|
98 |
if ( 'swap' === $settings['hover_style'] ) {
|
modules/woocommerce/templates/product-11.php
CHANGED
@@ -21,12 +21,12 @@ if ( empty( $product ) || ! $product->is_visible() ) {
|
|
21 |
|
22 |
<?php
|
23 |
|
24 |
-
$product_id
|
25 |
-
$class
|
26 |
-
$classes
|
27 |
-
$classes[]
|
28 |
-
$wc_classes
|
29 |
-
$image_size
|
30 |
$sale_ribbon = self::$settings['sale'];
|
31 |
$featured_ribbon = self::$settings['featured'];
|
32 |
$quick_view = $this->get_option_value( 'quick_view' );
|
@@ -59,11 +59,12 @@ $out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status',
|
|
59 |
|
60 |
echo '<div class="premium-woo-product-thumbnail">';
|
61 |
woocommerce_template_loop_product_link_open();
|
62 |
-
|
|
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
|
68 |
woocommerce_template_loop_product_link_close();
|
69 |
Premium_Template_Tags::get_current_product_linked_images( $image_size );
|
@@ -74,7 +75,6 @@ $out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status',
|
|
74 |
echo '<i class="premium-woo-qv-icon fa fa-eye"></i>';
|
75 |
echo '</div>';
|
76 |
}
|
77 |
-
|
78 |
}
|
79 |
|
80 |
do_action( 'pa_woo_product_before_details_wrap_start', $product_id, $settings );
|
@@ -118,7 +118,7 @@ $out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status',
|
|
118 |
echo '</div>';
|
119 |
|
120 |
// if ( 'yes' === $this->get_option_value( 'product_excerpt' ) ) {
|
121 |
-
//
|
122 |
// }
|
123 |
|
124 |
echo '<div class="premium-woo-product-buttons">';
|
@@ -133,7 +133,7 @@ $out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status',
|
|
133 |
|
134 |
echo '</div>';
|
135 |
do_action( 'pa_woo_product_before_details_wrap_end', $product_id, $settings );
|
136 |
-
echo
|
137 |
do_action( 'pa_woo_product_after_details_wrap_end', $product_id, $settings );
|
138 |
|
139 |
?>
|
21 |
|
22 |
<?php
|
23 |
|
24 |
+
$product_id = $product->get_id();
|
25 |
+
$class = array();
|
26 |
+
$classes = array();
|
27 |
+
$classes[] = 'post-' . $product_id;
|
28 |
+
$wc_classes = implode( ' ', wc_product_post_class( $classes, $class, $product_id ) );
|
29 |
+
$image_size = $settings['featured_image_size'];
|
30 |
$sale_ribbon = self::$settings['sale'];
|
31 |
$featured_ribbon = self::$settings['featured'];
|
32 |
$quick_view = $this->get_option_value( 'quick_view' );
|
59 |
|
60 |
echo '<div class="premium-woo-product-thumbnail">';
|
61 |
woocommerce_template_loop_product_link_open();
|
62 |
+
$product_thumb = has_post_thumbnail( $product_id ) ? get_the_post_thumbnail_url( $product_id, $image_size ) : wc_placeholder_img_src( $image_size );
|
63 |
+
echo '<img src="' . esc_url( $product_thumb ) . '">';
|
64 |
|
65 |
+
if ( 'swap' === $settings['hover_style'] ) {
|
66 |
+
Premium_Template_Tags::get_current_product_swap_image( $image_size );
|
67 |
+
}
|
68 |
|
69 |
woocommerce_template_loop_product_link_close();
|
70 |
Premium_Template_Tags::get_current_product_linked_images( $image_size );
|
75 |
echo '<i class="premium-woo-qv-icon fa fa-eye"></i>';
|
76 |
echo '</div>';
|
77 |
}
|
|
|
78 |
}
|
79 |
|
80 |
do_action( 'pa_woo_product_before_details_wrap_start', $product_id, $settings );
|
118 |
echo '</div>';
|
119 |
|
120 |
// if ( 'yes' === $this->get_option_value( 'product_excerpt' ) ) {
|
121 |
+
// Premium_Template_Tags::get_product_excerpt();
|
122 |
// }
|
123 |
|
124 |
echo '<div class="premium-woo-product-buttons">';
|
133 |
|
134 |
echo '</div>';
|
135 |
do_action( 'pa_woo_product_before_details_wrap_end', $product_id, $settings );
|
136 |
+
echo '</div>';
|
137 |
do_action( 'pa_woo_product_after_details_wrap_end', $product_id, $settings );
|
138 |
|
139 |
?>
|
modules/woocommerce/templates/product-2.php
CHANGED
@@ -30,8 +30,8 @@ $wc_classes = implode( ' ', wc_product_post_class( $classes, $class, $product_id
|
|
30 |
$sale_ribbon = self::$settings['sale'];
|
31 |
$featured_ribbon = self::$settings['featured'];
|
32 |
$quick_view = $this->get_option_value( 'quick_view' );
|
33 |
-
$image_size
|
34 |
-
$out_of_stock
|
35 |
|
36 |
?>
|
37 |
<li class="<?php echo esc_attr( $wc_classes ); ?>">
|
@@ -62,7 +62,8 @@ $out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status', tr
|
|
62 |
woocommerce_template_loop_product_link_open();
|
63 |
|
64 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
65 |
-
|
|
|
66 |
}
|
67 |
|
68 |
if ( 'swap' === $settings['hover_style'] ) {
|
30 |
$sale_ribbon = self::$settings['sale'];
|
31 |
$featured_ribbon = self::$settings['featured'];
|
32 |
$quick_view = $this->get_option_value( 'quick_view' );
|
33 |
+
$image_size = $settings['featured_image_size'];
|
34 |
+
$out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status', true ) && 'yes' === self::$settings['sold_out'];
|
35 |
|
36 |
?>
|
37 |
<li class="<?php echo esc_attr( $wc_classes ); ?>">
|
62 |
woocommerce_template_loop_product_link_open();
|
63 |
|
64 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
65 |
+
$product_thumb = has_post_thumbnail( $product_id ) ? get_the_post_thumbnail_url( $product_id, $image_size ) : wc_placeholder_img_src( $image_size );
|
66 |
+
echo '<img src="' . esc_url( $product_thumb ) . '">';
|
67 |
}
|
68 |
|
69 |
if ( 'swap' === $settings['hover_style'] ) {
|
modules/woocommerce/templates/product-3.php
CHANGED
@@ -31,7 +31,7 @@ $sale_ribbon = self::$settings['sale'];
|
|
31 |
$featured_ribbon = self::$settings['featured'];
|
32 |
$quick_view = $this->get_option_value( 'quick_view' );
|
33 |
$out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status', true ) && 'yes' === self::$settings['sold_out'];
|
34 |
-
$image_size
|
35 |
?>
|
36 |
<li class=" <?php echo esc_attr( $wc_classes ); ?>">
|
37 |
<div class="premium-woo-product-wrapper">
|
@@ -61,7 +61,8 @@ $image_size = $settings['featured_image_size'];
|
|
61 |
woocommerce_template_loop_product_link_open();
|
62 |
|
63 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
64 |
-
|
|
|
65 |
}
|
66 |
|
67 |
if ( 'swap' === $settings['hover_style'] ) {
|
31 |
$featured_ribbon = self::$settings['featured'];
|
32 |
$quick_view = $this->get_option_value( 'quick_view' );
|
33 |
$out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status', true ) && 'yes' === self::$settings['sold_out'];
|
34 |
+
$image_size = $settings['featured_image_size'];
|
35 |
?>
|
36 |
<li class=" <?php echo esc_attr( $wc_classes ); ?>">
|
37 |
<div class="premium-woo-product-wrapper">
|
61 |
woocommerce_template_loop_product_link_open();
|
62 |
|
63 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
64 |
+
$product_thumb = has_post_thumbnail( $product_id ) ? get_the_post_thumbnail_url( $product_id, $image_size ) : wc_placeholder_img_src( $image_size );
|
65 |
+
echo '<img src="' . esc_url( $product_thumb ) . '">';
|
66 |
}
|
67 |
|
68 |
if ( 'swap' === $settings['hover_style'] ) {
|
modules/woocommerce/templates/product-4.php
CHANGED
@@ -34,7 +34,7 @@ $sale_ribbon = self::$settings['sale'];
|
|
34 |
$featured_ribbon = self::$settings['featured'];
|
35 |
$quick_view = $this->get_option_value( 'quick_view' );
|
36 |
$out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status', true ) && 'yes' === self::$settings['sold_out'];
|
37 |
-
$image_size
|
38 |
?>
|
39 |
<li class=" <?php echo esc_attr( $wc_classes ); ?>">
|
40 |
<div class="premium-woo-product-wrapper">
|
@@ -65,7 +65,8 @@ $image_size = $settings['featured_image_size'];
|
|
65 |
woocommerce_template_loop_product_link_open();
|
66 |
|
67 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
68 |
-
|
|
|
69 |
}
|
70 |
|
71 |
if ( 'swap' === $settings['hover_style'] ) {
|
34 |
$featured_ribbon = self::$settings['featured'];
|
35 |
$quick_view = $this->get_option_value( 'quick_view' );
|
36 |
$out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status', true ) && 'yes' === self::$settings['sold_out'];
|
37 |
+
$image_size = $settings['featured_image_size'];
|
38 |
?>
|
39 |
<li class=" <?php echo esc_attr( $wc_classes ); ?>">
|
40 |
<div class="premium-woo-product-wrapper">
|
65 |
woocommerce_template_loop_product_link_open();
|
66 |
|
67 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
68 |
+
$product_thumb = has_post_thumbnail( $product_id ) ? get_the_post_thumbnail_url( $product_id, $image_size ) : wc_placeholder_img_src( $image_size );
|
69 |
+
echo '<img src="' . esc_url( $product_thumb ) . '">';
|
70 |
}
|
71 |
|
72 |
if ( 'swap' === $settings['hover_style'] ) {
|
modules/woocommerce/templates/product-5.php
CHANGED
@@ -31,7 +31,7 @@ $wc_classes = implode( ' ', wc_product_post_class( $classes, $class, $product_id
|
|
31 |
$sale_ribbon = self::$settings['sale'];
|
32 |
$featured_ribbon = self::$settings['featured'];
|
33 |
$quick_view = $this->get_option_value( 'quick_view' );
|
34 |
-
$image_size
|
35 |
|
36 |
if ( 'yes' === $quick_view ) {
|
37 |
$qv_type = $this->get_option_value( 'quick_view_type' );
|
@@ -66,7 +66,8 @@ $out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status', tr
|
|
66 |
woocommerce_template_loop_product_link_open();
|
67 |
|
68 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
69 |
-
|
|
|
70 |
}
|
71 |
|
72 |
if ( 'swap' === $settings['hover_style'] ) {
|
31 |
$sale_ribbon = self::$settings['sale'];
|
32 |
$featured_ribbon = self::$settings['featured'];
|
33 |
$quick_view = $this->get_option_value( 'quick_view' );
|
34 |
+
$image_size = $settings['featured_image_size'];
|
35 |
|
36 |
if ( 'yes' === $quick_view ) {
|
37 |
$qv_type = $this->get_option_value( 'quick_view_type' );
|
66 |
woocommerce_template_loop_product_link_open();
|
67 |
|
68 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
69 |
+
$product_thumb = has_post_thumbnail( $product_id ) ? get_the_post_thumbnail_url( $product_id, $image_size ) : wc_placeholder_img_src( $image_size );
|
70 |
+
echo '<img src="' . esc_url( $product_thumb ) . '">';
|
71 |
}
|
72 |
|
73 |
if ( 'swap' === $settings['hover_style'] ) {
|
modules/woocommerce/templates/product-6.php
CHANGED
@@ -31,7 +31,7 @@ $sale_ribbon = self::$settings['sale'];
|
|
31 |
$featured_ribbon = self::$settings['featured'];
|
32 |
$quick_view = $this->get_option_value( 'quick_view' );
|
33 |
$out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status', true ) && 'yes' === self::$settings['sold_out'];
|
34 |
-
$image_size
|
35 |
?>
|
36 |
<li class=" <?php echo esc_attr( $wc_classes ); ?>">
|
37 |
<div class="premium-woo-product-wrapper">
|
@@ -60,7 +60,8 @@ $image_size = $settings['featured_image_size'];
|
|
60 |
woocommerce_template_loop_product_link_open();
|
61 |
|
62 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
63 |
-
|
|
|
64 |
}
|
65 |
|
66 |
if ( 'swap' === $settings['hover_style'] ) {
|
31 |
$featured_ribbon = self::$settings['featured'];
|
32 |
$quick_view = $this->get_option_value( 'quick_view' );
|
33 |
$out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status', true ) && 'yes' === self::$settings['sold_out'];
|
34 |
+
$image_size = $settings['featured_image_size'];
|
35 |
?>
|
36 |
<li class=" <?php echo esc_attr( $wc_classes ); ?>">
|
37 |
<div class="premium-woo-product-wrapper">
|
60 |
woocommerce_template_loop_product_link_open();
|
61 |
|
62 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
63 |
+
$product_thumb = has_post_thumbnail( $product_id ) ? get_the_post_thumbnail_url( $product_id, $image_size ) : wc_placeholder_img_src( $image_size );
|
64 |
+
echo '<img src="' . esc_url( $product_thumb ) . '">';
|
65 |
}
|
66 |
|
67 |
if ( 'swap' === $settings['hover_style'] ) {
|
modules/woocommerce/templates/product-7.php
CHANGED
@@ -21,12 +21,12 @@ if ( empty( $product ) || ! $product->is_visible() ) {
|
|
21 |
|
22 |
<?php
|
23 |
|
24 |
-
$product_id
|
25 |
-
$class
|
26 |
-
$classes
|
27 |
-
$classes[]
|
28 |
-
$wc_classes
|
29 |
-
$image_size
|
30 |
$sale_ribbon = self::$settings['sale'];
|
31 |
$featured_ribbon = self::$settings['featured'];
|
32 |
$quick_view = $this->get_option_value( 'quick_view' );
|
@@ -60,7 +60,8 @@ $out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status',
|
|
60 |
|
61 |
echo '<div class="premium-woo-product-thumbnail">';
|
62 |
woocommerce_template_loop_product_link_open();
|
63 |
-
|
|
|
64 |
if ( 'swap' === $settings['hover_style'] ) {
|
65 |
Premium_Template_Tags::get_current_product_swap_image( $image_size = $settings['featured_image_size'] );
|
66 |
}
|
21 |
|
22 |
<?php
|
23 |
|
24 |
+
$product_id = $product->get_id();
|
25 |
+
$class = array();
|
26 |
+
$classes = array();
|
27 |
+
$classes[] = 'post-' . $product_id;
|
28 |
+
$wc_classes = implode( ' ', wc_product_post_class( $classes, $class, $product_id ) );
|
29 |
+
$image_size = $settings['featured_image_size'];
|
30 |
$sale_ribbon = self::$settings['sale'];
|
31 |
$featured_ribbon = self::$settings['featured'];
|
32 |
$quick_view = $this->get_option_value( 'quick_view' );
|
60 |
|
61 |
echo '<div class="premium-woo-product-thumbnail">';
|
62 |
woocommerce_template_loop_product_link_open();
|
63 |
+
$product_thumb = has_post_thumbnail( $product_id ) ? get_the_post_thumbnail_url( $product_id, $image_size ) : wc_placeholder_img_src( $image_size );
|
64 |
+
echo '<img src="' . esc_url( $product_thumb ) . '">';
|
65 |
if ( 'swap' === $settings['hover_style'] ) {
|
66 |
Premium_Template_Tags::get_current_product_swap_image( $image_size = $settings['featured_image_size'] );
|
67 |
}
|
modules/woocommerce/templates/product-8.php
CHANGED
@@ -81,7 +81,8 @@ $out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status',
|
|
81 |
woocommerce_template_loop_product_link_open();
|
82 |
|
83 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
84 |
-
|
|
|
85 |
}
|
86 |
|
87 |
if ( 'swap' === $settings['hover_style'] ) {
|
81 |
woocommerce_template_loop_product_link_open();
|
82 |
|
83 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
84 |
+
$product_thumb = has_post_thumbnail( $product_id ) ? get_the_post_thumbnail_url( $product_id, $image_size ) : wc_placeholder_img_src( $image_size );
|
85 |
+
echo '<img src="' . esc_url( $product_thumb ) . '">';
|
86 |
}
|
87 |
|
88 |
if ( 'swap' === $settings['hover_style'] ) {
|
modules/woocommerce/templates/product-9.php
CHANGED
@@ -65,7 +65,8 @@ $out_of_stock = 'outofstock' === get_post_meta( $product_id, '_stock_status', tr
|
|
65 |
woocommerce_template_loop_product_link_open();
|
66 |
|
67 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
68 |
-
|
|
|
69 |
}
|
70 |
|
71 |
if ( 'swap' === $settings['hover_style'] ) {
|
65 |
woocommerce_template_loop_product_link_open();
|
66 |
|
67 |
if ( 'yes' === $this->get_option_value( 'product_image' ) ) {
|
68 |
+
$product_thumb = has_post_thumbnail( $product_id ) ? get_the_post_thumbnail_url( $product_id, $image_size ) : wc_placeholder_img_src( $image_size );
|
69 |
+
echo '<img src="' . esc_url( $product_thumb ) . '">';
|
70 |
}
|
71 |
|
72 |
if ( 'swap' === $settings['hover_style'] ) {
|
premium-addons-for-elementor.php
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Plugin Name: Premium Addons for Elementor
|
4 |
-
Description: Premium Addons for Elementor plugin includes widgets and addons like Blog Post Grid, Gallery, WooCommerce Listing , Carousel, Modal Popup, Google Maps, Pricing Tables, Lottie Animations, Countdown, Testimonials.
|
5 |
-
Plugin URI: https://premiumaddons.com
|
6 |
-
Version: 4.8.
|
7 |
-
Elementor tested up to: 3.5.5
|
8 |
-
Elementor Pro tested up to: 3.6.2
|
9 |
-
Author: Leap13
|
10 |
-
Author URI: https://leap13.com/
|
11 |
-
Text Domain: premium-addons-for-elementor
|
12 |
-
Domain Path: /languages
|
13 |
-
License: GNU General Public License v3.0
|
14 |
-
*/
|
15 |
-
|
16 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
17 |
-
exit; // No access of directly access.
|
18 |
-
}
|
19 |
-
|
20 |
-
// Define Constants.
|
21 |
-
define( 'PREMIUM_ADDONS_VERSION', '4.8.
|
22 |
-
define( 'PREMIUM_ADDONS_URL', plugins_url( '/', __FILE__ ) );
|
23 |
-
define( 'PREMIUM_ADDONS_PATH', plugin_dir_path( __FILE__ ) );
|
24 |
-
define( 'PREMIUM_ADDONS_FILE', __FILE__ );
|
25 |
-
define( 'PREMIUM_ADDONS_BASENAME', plugin_basename( PREMIUM_ADDONS_FILE ) );
|
26 |
-
define( 'PREMIUM_ADDONS_STABLE_VERSION', '4.8.
|
27 |
-
|
28 |
-
/*
|
29 |
-
* Load plugin core file
|
30 |
-
*/
|
31 |
-
require_once PREMIUM_ADDONS_PATH . 'includes/class-pa-core.php';
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Premium Addons for Elementor
|
4 |
+
Description: Premium Addons for Elementor plugin includes widgets and addons like Blog Post Grid, Gallery, WooCommerce Listing , Carousel, Modal Popup, Google Maps, Pricing Tables, Lottie Animations, Countdown, Testimonials.
|
5 |
+
Plugin URI: https://premiumaddons.com
|
6 |
+
Version: 4.8.10
|
7 |
+
Elementor tested up to: 3.5.5
|
8 |
+
Elementor Pro tested up to: 3.6.2
|
9 |
+
Author: Leap13
|
10 |
+
Author URI: https://leap13.com/
|
11 |
+
Text Domain: premium-addons-for-elementor
|
12 |
+
Domain Path: /languages
|
13 |
+
License: GNU General Public License v3.0
|
14 |
+
*/
|
15 |
+
|
16 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
17 |
+
exit; // No access of directly access.
|
18 |
+
}
|
19 |
+
|
20 |
+
// Define Constants.
|
21 |
+
define( 'PREMIUM_ADDONS_VERSION', '4.8.10' );
|
22 |
+
define( 'PREMIUM_ADDONS_URL', plugins_url( '/', __FILE__ ) );
|
23 |
+
define( 'PREMIUM_ADDONS_PATH', plugin_dir_path( __FILE__ ) );
|
24 |
+
define( 'PREMIUM_ADDONS_FILE', __FILE__ );
|
25 |
+
define( 'PREMIUM_ADDONS_BASENAME', plugin_basename( PREMIUM_ADDONS_FILE ) );
|
26 |
+
define( 'PREMIUM_ADDONS_STABLE_VERSION', '4.8.9' );
|
27 |
+
|
28 |
+
/*
|
29 |
+
* Load plugin core file
|
30 |
+
*/
|
31 |
+
require_once PREMIUM_ADDONS_PATH . 'includes/class-pa-core.php';
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Donate Link: https://premiumaddons.com/?utm_source=wp-repo&utm_medium=link&utm_c
|
|
5 |
Requires at least: 5.0
|
6 |
Tested Up To: 5.9.1
|
7 |
Requires PHP: 5.4
|
8 |
-
Stable Tag: 4.8.
|
9 |
License: GPL v3.0
|
10 |
License URI: https://opensource.org/licenses/GPL-3.0
|
11 |
|
@@ -206,6 +206,11 @@ Premium Addons for Elementor is 100% Ads Free, Ads can only be detected from You
|
|
206 |
|
207 |
== Changelog ==
|
208 |
|
|
|
|
|
|
|
|
|
|
|
209 |
= 4.8.9 =
|
210 |
|
211 |
- Tweak: Added Product Image Height option in WooCommerce Products Listing widget.
|
5 |
Requires at least: 5.0
|
6 |
Tested Up To: 5.9.1
|
7 |
Requires PHP: 5.4
|
8 |
+
Stable Tag: 4.8.10
|
9 |
License: GPL v3.0
|
10 |
License URI: https://opensource.org/licenses/GPL-3.0
|
11 |
|
206 |
|
207 |
== Changelog ==
|
208 |
|
209 |
+
= 4.8.10 =
|
210 |
+
|
211 |
+
- Tweak: Show WooCommerce placeholder image if the current product has no thumbnail in WooCommerce Products Listing widget.
|
212 |
+
- Fixed: Enable Beta Tester option is not working.
|
213 |
+
|
214 |
= 4.8.9 =
|
215 |
|
216 |
- Tweak: Added Product Image Height option in WooCommerce Products Listing widget.
|