PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.0
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.0
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
← All changes | widgets/archive/widget.php +51 -28 10.11.1 → 11.1.0 View file →
@@ -1,6 +1,8 @@
1 1 <?php
2 2
3 +defined('ABSPATH') || die('Restricted Access');
4 +
3 5 use AcyMailing\Classes\ListClass;
4 6 use AcyMailing\FrontControllers\ArchiveController;
5 7
6 8 class acym_archive_widget extends WP_Widget
@@ -15,8 +17,9 @@
15 17 ['description' => acym_translation('ACYM_MENU_ARCHIVE_DESC')]
16 18 );
17 19 }
18 20
21 + //Widget Configuration
19 22 public function form($instance)
20 23 {
21 24 $this->loadAcyMailing();
22 25
@@ -52,30 +55,44 @@
52 55 }
53 56 }
54 57
55 58 echo '<div class="acyblock">';
56 - echo '<p><label class="acyWPconfig" for="'.$this->get_field_id('title').'">'.acym_translation('ACYM_TITLE').'</label>
57 - <input type="text" class="widefat" id="'.$this->get_field_id('title').'" name="'.$this->get_field_name('title').'" value="'.$params['title'].'" /></p>';
58 - echo '<p><label class="acyWPconfig"> '.acym_translation('ACYM_WIDGET_CAMPAIGN_NUMBER_PER_PAGE').'</label>
59 - '.acym_translationSprintf(
60 - 'ACYM_X_NEWSLETTERS_PER_PAGE',
61 - acym_select(
62 - [
63 - '5' => '5',
64 - '10' => '10',
65 - '15' => '15',
66 - '20' => '20',
67 - '30' => '30',
68 - '50' => '50',
69 - '100' => '100',
70 - '200' => '200',
59 + echo '<p><label class="acyWPconfig" for="'.esc_attr($this->get_field_id('title')).'">'.esc_html(acym_translation('ACYM_TITLE')).'</label>
60 + <input type="text" class="widefat" id="'.esc_attr($this->get_field_id('title')).'" name="'.esc_attr($this->get_field_name('title')).'" value="'.esc_attr(
61 + $params['title']
62 + ).'" /></p>';
63 + echo '<p><label class="acyWPconfig"> '.esc_html(acym_translation('ACYM_WIDGET_CAMPAIGN_NUMBER_PER_PAGE')).'</label>
64 + '.wp_kses(
65 + acym_translationSprintf(
66 + 'ACYM_X_NEWSLETTERS_PER_PAGE',
67 + acym_select(
68 + [
69 + '5' => '5',
70 + '10' => '10',
71 + '15' => '15',
72 + '20' => '20',
73 + '30' => '30',
74 + '50' => '50',
75 + '100' => '100',
76 + '200' => '200',
77 + ],
78 + $this->get_field_name('nbNewslettersPerPage'),
79 + $params['nbNewslettersPerPage']
80 + )
81 + ),
82 + [
83 + 'select' => [
84 + 'name' => true,
85 + 'id' => true,
71 86 ],
72 - $this->get_field_name('nbNewslettersPerPage'),
73 - $params['nbNewslettersPerPage']
74 - )
87 + 'option' => [
88 + 'value' => true,
89 + 'selected' => true,
90 + ],
91 + ]
75 92 ).'</p>';
76 - echo '<p><label class="acyWPconfig" title="'.acym_translation('ACYM_LISTS_ARCHIVE').'">'.acym_translation('ACYM_LISTS').'</label>';
77 - echo acym_selectMultiple(
93 + echo '<p><label class="acyWPconfig" title="'.esc_attr(acym_translation('ACYM_LISTS_ARCHIVE')).'">'.esc_html(acym_translation('ACYM_LISTS')).'</label>';
94 + acym_selectMultiple(
78 95 $lists,
79 96 $this->get_field_name('lists'),
80 97 explode(',', $params['lists']),
81 98 [
@@ -82,20 +99,24 @@
82 99 'style' => 'width:100%;',
83 100 'id' => $this->get_field_id('lists'),
84 101 ],
85 102 'id',
86 - 'name'
103 + 'name',
104 + true
87 105 );
88 106
89 - echo '<p><label class="acyWPconfig" title="'.acym_translation('ACYM_ARCHIVE_POPUP_DESC').'">'.acym_translation('ACYM_ARCHIVE_POPUP').'</label>';
90 - echo acym_boolean($this->get_field_name('popup'), $params['popup'], $this->get_field_id('popup')).'</p>';
107 + echo '<p><label class="acyWPconfig" title="'.esc_attr(acym_translation('ACYM_ARCHIVE_POPUP_DESC')).'">'.esc_html(acym_translation('ACYM_ARCHIVE_POPUP')).'</label>';
108 + acym_boolean($this->get_field_name('popup'), $params['popup'], $this->get_field_id('popup')).'</p>';
91 109
92 - echo '<p><label class="acyWPconfig" title="'.acym_translation('ACYM_ARCHIVE_ONLY_USER_LIST_DESC').'">'.acym_translation('ACYM_ARCHIVE_ONLY_USER_LIST').'</label>';
93 - echo acym_boolean($this->get_field_name('displayUserListOnly'), $params['displayUserListOnly'], $this->get_field_id('displayUserListOnly')).'</p>';
110 + echo '<p><label class="acyWPconfig" title="'.esc_attr(acym_translation('ACYM_ARCHIVE_ONLY_USER_LIST_DESC')).'">'.esc_html(
111 + acym_translation('ACYM_ARCHIVE_ONLY_USER_LIST')
112 + ).'</label>';
113 + acym_boolean($this->get_field_name('displayUserListOnly'), $params['displayUserListOnly'], $this->get_field_id('displayUserListOnly')).'</p>';
94 114
95 115 echo '</div>';
96 116 }
97 117
118 + // Widget's output
98 119 public function widget($args, $instance)
99 120 {
100 121 $this->loadAcyMailing();
101 122
@@ -102,14 +123,16 @@
102 123 if (!acym_isElementorEdition()) {
103 124 acym_loadAssets('archive', 'listing');
104 125 }
105 126
106 - echo $args['before_widget'];
127 + echo wp_kses_post($args['before_widget']);
107 128
108 129 if (!isset($instance['title'])) $instance['title'] = '';
109 130 $title = apply_filters('widget_title', $instance['title'], $instance, $args['widget_id']);
110 131 if (!empty($title)) {
111 - echo $args['before_title'].$title.$args['after_title'];
132 + echo wp_kses_post($args['before_title']);
133 + echo esc_html($title);
134 + echo wp_kses_post($args['after_title']);
112 135 }
113 136
114 137 acym_setVar('page', 'front');
115 138 $searchs = acym_getVar('array', 'acym_search', []);
@@ -127,9 +150,9 @@
127 150
128 151 $archiveController = new ArchiveController();
129 152 $archiveController->showArchive($viewParams);
130 153
131 - echo $args['after_widget'];
154 + echo wp_kses_post($args['after_widget']);
132 155 }
133 156
134 157 private function loadAcyMailing(): void
135 158 {