PluginProbe
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment / 2.1.14
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment v2.1.14
3.1.13 3.1.12 3.1.11 3.1.10 3.1.9 3.1.8 3.1.7 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 All 122 releases
← All changes | Inc/Core/Layouts/public/box.php +13 -47 1.0.02.1.14 View file →
@@ -1,12 +1,12 @@
1 1 <?php
2 2 /**
3 3 * @package FireBox
4 - * @version 1.0.0 Free
4 + * @version 2.1.14 Free
5 5 *
6 6 * @author FirePlugins <info@fireplugins.com>
7 7 * @link https://www.fireplugins.com
8 - * @copyright Copyright © 2021 FirePlugins All Rights Reserved
8 + * @copyright Copyright © 2024 FirePlugins All Rights Reserved
9 9 * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
10 10 */
11 11
12 12 if (!defined('ABSPATH'))
@@ -14,56 +14,19 @@
14 14 exit; // Exit if accessed directly.
15 15 }
16 16 $box = $this->data->get('box', []);
17 17 $box = new \FPFramework\Libs\Registry($box);
18 -$params = $this->data->get('params', []);
19 -$params = new \FPFramework\Libs\Registry($params);
20 18
21 19 $custom_code = $box->get('params.data.customcode', '');
22 -if (is_string($custom_code))
23 -{
24 - $custom_code = stripslashes($custom_code);
25 - $custom_code = html_entity_decode($custom_code);
26 -}
27 20
28 21 $close_button = (int) $box->get('params.data.closebutton.show', '');
29 22
30 23 $rtl = (int) $box->get('params.data.rtl', 0);
31 -
32 -$css = is_string($box->get('params.data.customcss')) ? $box->get('params.data.customcss') : '';
33 -
34 -// add responsive CSS
35 -if ($responsive_css = $box->get('params.data.responsive_css', []))
36 -{
37 - if (isset($responsive_css->tablet) && !empty($responsive_css->tablet))
38 - {
39 - $css .= '
40 -@media only screen and (max-width: 768px) {
41 - .fb-' . esc_attr($box->get('ID')) . ' .fb-dialog { ' . esc_html($responsive_css->tablet) . ' }
42 -}';
43 - }
44 - if (isset($responsive_css->mobile) && !empty($responsive_css->mobile))
45 - {
46 - $css .= '
47 -@media only screen and (max-width: 468px) {
48 - .fb-' . esc_attr($box->get('ID')) . ' .fb-dialog { ' . esc_html($responsive_css->mobile) . ' }
49 -}';
50 - }
51 -}
52 -
53 -// render box css at the bottom of the page
54 -if (!empty($css))
55 -{
56 - add_action( 'wp_footer', function() use ($css, $box) {
57 - echo '<style type="text/css" class="fb-' . esc_attr($box->get('ID')) . '-style fb-responsive-style">' . wp_strip_all_tags($css) . '</style>';
58 - }, 100);
59 -}
60 24 ?>
61 25 <div data-id="<?php echo esc_attr($box->get('ID')); ?>"
62 26 class="fb-inst fb-hide <?php echo esc_attr(implode(' ', (array) $box->get('classes'))); ?>"
63 - data-options='<?php echo json_encode($box->get('settings')) ?>'
27 + data-options='<?php echo wp_json_encode($box->get('settings'), JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP); ?>'
64 28 data-type='<?php echo esc_attr($box->get('params.data.mode')); ?>'
65 - <?php if (!empty($box->get('styles_container'))) { ?>style="<?php echo esc_attr($box->get('styles_container')); ?>"<?php } ?>
66 29 <?php if ($rtl == 1) { ?>dir="rtl"<?php } ?>>
67 30
68 31 <?php if ($close_button == 2) { firebox()->renderer->public->render('closebutton', ['box' => $this->data->get('box', [])]); } ?>
69 32
@@ -72,14 +35,17 @@
72 35 <?php if ($close_button == 1) { firebox()->renderer->public->render('closebutton', ['box' => $this->data->get('box', [])]); } ?>
73 36
74 37 <div class="fb-container">
75 38 <div class="fb-content">
76 - <?php
77 - echo $box->get('post_content');
78 - ?>
39 + <?php echo $box->get('post_content'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
79 40 </div>
80 41 </div>
81 - <?php if (!empty($custom_code)): ?>
82 - <script type="text/javascript" class="fb-<?php echo esc_attr($box->get('ID')); ?>-custom-code"><?php echo $custom_code; ?></script>
83 - <?php endif; ?>
42 + <?php
43 + if (is_string($custom_code) && !empty($custom_code))
44 + {
45 + $custom_code = html_entity_decode(stripslashes($custom_code));
46 + wp_add_inline_script('firebox', $custom_code);
47 + }
48 + ?>
84 49 </div>
85 -</div>
50 +</div>
51 +<?php