PluginProbe
Super RSS Reader – Add attractive RSS Feed Widget / 4.7
Super RSS Reader – Add attractive RSS Feed Widget v4.7
trunk 0.8 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 3.0 3.1 3.2 4.0 4.0.1 4.1 4.2 4.3 4.4 4.4.1 4.5 4.6 4.7 4.8 All 33 releases
← All changes | includes/widget-admin.php +118 -118 4.64.7 View file →
@@ -44,11 +44,11 @@
44 44 public function update( $new_instance, $old_instance ){
45 45
46 46 $instance = $old_instance;
47 47
48 - $instance[ 'title' ] = stripslashes( $new_instance['title'] );
49 - $instance[ 'urls' ] = stripslashes( $new_instance['urls']) ;
50 - $instance[ 'tab_titles' ] = stripslashes( $new_instance['tab_titles'] );
48 + $instance[ 'title' ] = sanitize_text_field( $new_instance['title'] );
49 + $instance[ 'urls' ] = sanitize_textarea_field( $new_instance['urls'] ) ;
50 + $instance[ 'tab_titles' ] = wp_kses_post( $new_instance['tab_titles'] );
51 51
52 52 $instance[ 'count' ] = intval( $new_instance['count'] );
53 53 $instance[ 'show_date' ] = intval( isset( $new_instance['show_date'] ) ? $new_instance['show_date'] : 0 );
54 54 $instance[ 'show_desc' ] = intval( isset( $new_instance['show_desc'] ) ? $new_instance['show_desc'] : 0 );
@@ -55,25 +55,25 @@
55 55 $instance[ 'show_author' ] = intval( isset( $new_instance['show_author'] ) ? $new_instance['show_author'] : 0 );
56 56 $instance[ 'show_thumb' ] = intval( isset( $new_instance['show_thumb'] ) ? $new_instance['show_thumb'] : 0 );
57 57 $instance[ 'strip_desc' ] = intval( $new_instance['strip_desc'] );
58 58 $instance[ 'strip_title' ] = intval( $new_instance['strip_title'] );
59 - $instance[ 'date_format' ] = stripslashes( $new_instance['date_format'] );
60 - $instance[ 'date_timezone' ] = stripslashes( $new_instance['date_timezone'] );
61 - $instance[ 'order_by' ] = stripslashes( $new_instance['order_by'] );
62 - $instance[ 'read_more' ] = stripslashes( $new_instance['read_more'] );
59 + $instance[ 'date_format' ] = sanitize_text_field( $new_instance['date_format'] );
60 + $instance[ 'date_timezone' ] = sanitize_text_field( $new_instance['date_timezone'] );
61 + $instance[ 'order_by' ] = sanitize_text_field( $new_instance['order_by'] );
62 + $instance[ 'read_more' ] = sanitize_text_field( $new_instance['read_more'] );
63 63 $instance[ 'add_nofollow' ] = intval( isset( $new_instance['add_nofollow'] ) ? $new_instance['add_nofollow'] : 0 );
64 64 $instance[ 'open_newtab' ] = intval( isset( $new_instance['open_newtab'] ) ? $new_instance['open_newtab'] : 0 );
65 65 $instance[ 'rich_desc' ] = intval( isset( $new_instance['rich_desc'] ) ? $new_instance['rich_desc'] : 0 );
66 - $instance[ 'desc_type' ] = stripslashes( $new_instance['desc_type'] );
67 - $instance[ 'thumbnail_position' ] = stripslashes( $new_instance['thumbnail_position'] );
68 - $instance[ 'thumbnail_size' ] = stripslashes( $new_instance['thumbnail_size'] );
69 - $instance[ 'thumbnail_default' ] = stripslashes( $new_instance['thumbnail_default'] );
70 - $instance[ 'no_feed_text' ] = stripslashes( $new_instance['no_feed_text'] );
66 + $instance[ 'desc_type' ] = sanitize_text_field( $new_instance['desc_type'] );
67 + $instance[ 'thumbnail_position' ] = sanitize_text_field( $new_instance['thumbnail_position'] );
68 + $instance[ 'thumbnail_size' ] = sanitize_text_field( $new_instance['thumbnail_size'] );
69 + $instance[ 'thumbnail_default' ] = sanitize_text_field( $new_instance['thumbnail_default'] );
70 + $instance[ 'no_feed_text' ] = wp_kses_post( $new_instance['no_feed_text'] );
71 71
72 - $instance[ 'color_style' ] = stripslashes( $new_instance['color_style']);
73 - $instance[ 'display_type' ] = stripslashes( $new_instance['display_type']);
74 - $instance[ 'visible_items' ] = intval( $new_instance['visible_items']);
75 - $instance[ 'ticker_speed' ] = intval( $new_instance['ticker_speed']);
72 + $instance[ 'color_style' ] = sanitize_text_field( $new_instance['color_style']);
73 + $instance[ 'display_type' ] = sanitize_text_field( $new_instance['display_type']);
74 + $instance[ 'visible_items' ] = intval( $new_instance['visible_items'] );
75 + $instance[ 'ticker_speed' ] = intval( $new_instance['ticker_speed'] );
76 76
77 77 return $instance;
78 78 }
79 79
@@ -81,37 +81,37 @@
81 81 public function form( $instance ){
82 82
83 83 $instance = wp_parse_args( (array) $instance, SRR_Options::defaults() );
84 84
85 - $title = htmlspecialchars( isset( $instance['title'] ) ? $instance[ 'title' ] : '' );
86 - $urls = htmlspecialchars($instance['urls']);
87 - $tab_titles = htmlspecialchars($instance['tab_titles']);
85 + $title = isset( $instance['title'] ) ? $instance[ 'title' ] : '';
86 + $urls = $instance['urls'];
87 + $tab_titles = $instance['tab_titles'];
88 88
89 - $count = intval($instance['count']);
90 - $show_date = intval($instance['show_date']);
91 - $show_desc = intval($instance['show_desc']);
92 - $show_author = intval($instance['show_author']);
93 - $show_thumb = intval($instance['show_thumb']);
94 - $open_newtab = intval($instance['open_newtab']);
95 - $add_nofollow = intval($instance['add_nofollow']);
96 - $strip_desc = intval($instance['strip_desc']);
97 - $strip_title = intval($instance['strip_title']);
98 - $date_format = htmlspecialchars($instance['date_format']);
99 - $date_timezone = htmlspecialchars($instance['date_timezone']);
100 - $order_by = htmlspecialchars($instance['order_by']);
101 - $read_more = htmlspecialchars($instance['read_more']);
102 - $rich_desc = intval($instance['rich_desc']);
103 - $desc_type = htmlspecialchars($instance['desc_type']);
104 - $thumbnail_position = htmlspecialchars($instance['thumbnail_position']);
105 - $thumbnail_size = htmlspecialchars($instance['thumbnail_size']);
106 - $thumbnail_default = htmlspecialchars($instance['thumbnail_default']);
107 - $no_feed_text = htmlspecialchars($instance['no_feed_text']);
89 + $count = $instance['count'];
90 + $show_date = $instance['show_date'];
91 + $show_desc = $instance['show_desc'];
92 + $show_author = $instance['show_author'];
93 + $show_thumb = $instance['show_thumb'];
94 + $open_newtab = $instance['open_newtab'];
95 + $add_nofollow = $instance['add_nofollow'];
96 + $strip_desc = $instance['strip_desc'];
97 + $strip_title = $instance['strip_title'];
98 + $date_format = $instance['date_format'];
99 + $date_timezone = $instance['date_timezone'];
100 + $order_by = $instance['order_by'];
101 + $read_more = $instance['read_more'];
102 + $rich_desc = $instance['rich_desc'];
103 + $desc_type = $instance['desc_type'];
104 + $thumbnail_position = $instance['thumbnail_position'];
105 + $thumbnail_size = $instance['thumbnail_size'];
106 + $thumbnail_default = $instance['thumbnail_default'];
107 + $no_feed_text = $instance['no_feed_text'];
108 108
109 - $color_style = stripslashes($instance['color_style']);
110 - $display_type = stripslashes($instance['display_type']);
111 - $visible_items = intval($instance['visible_items']);
112 - $ticker_speed = intval($instance['ticker_speed']);
113 -
109 + $color_style = $instance['color_style'];
110 + $display_type = $instance['display_type'];
111 + $visible_items = $instance['visible_items'];
112 + $ticker_speed = $instance['ticker_speed'];
113 +
114 114 $option_lists = SRR_Options::select_options();
115 115
116 116 // Replacing commas with new lines
117 117 $urls = str_replace( ',', "\n", $urls );
@@ -121,56 +121,56 @@
121 121
122 122 <div class="srr_settings">
123 123
124 124 <div class="srr_row">
125 - <div class="srr_label srr_xsm"><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title', 'super-rss-reader' ); ?></label></div>
126 - <div class="srr_field"><input id="<?php echo $this->get_field_id('title');?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" class="widefat"/></div>
125 + <div class="srr_label srr_xsm"><label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php esc_html_e( 'Title', 'super-rss-reader' ); ?></label></div>
126 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('title') ); ?>" name="<?php echo esc_attr( $this->get_field_name('title') ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" class="widefat"/></div>
127 127 </div>
128 128
129 129 <div class="srr_row">
130 - <div class="srr_label srr_xsm"><label for="<?php echo $this->get_field_id('urls'); ?>"><?php _e( 'URL(s)', 'super-rss-reader' ); ?></label></div>
131 - <div class="srr_field"><textarea id="<?php echo $this->get_field_id('urls');?>" name="<?php echo $this->get_field_name('urls'); ?>" class="widefat"><?php echo $urls; ?></textarea>
132 - <small class="srr_small_text"><?php _e( 'Can enter multiple RSS/atom feed URLs in new line', 'super-rss-reader' ); ?></small></div>
130 + <div class="srr_label srr_xsm"><label for="<?php echo esc_attr( $this->get_field_id('urls') ); ?>"><?php esc_html_e( 'URL(s)', 'super-rss-reader' ); ?></label></div>
131 + <div class="srr_field"><textarea id="<?php echo esc_attr( $this->get_field_id('urls') ); ?>" name="<?php echo esc_attr( $this->get_field_name('urls') ); ?>" class="widefat"><?php echo esc_html( $urls ); ?></textarea>
132 + <small class="srr_small_text"><?php esc_html_e( 'Can enter multiple RSS/atom feed URLs in new line', 'super-rss-reader' ); ?></small></div>
133 133 </div>
134 134
135 135 <div class="srr_row">
136 - <div class="srr_label srr_xsm"><label for="<?php echo $this->get_field_id('tab_titles'); ?>"><?php _e( 'Tab titles', 'super-rss-reader' ); ?></label></div>
137 - <div class="srr_field"><textarea id="<?php echo $this->get_field_id('tab_titles');?>" name="<?php echo $this->get_field_name('tab_titles'); ?>" class="widefat"><?php echo $tab_titles; ?></textarea>
138 - <small class="srr_small_text"><?php _e( 'Enter corresponding tab titles in new line. Leave empty to take from feed.', 'super-rss-reader' ); ?></small></div>
136 + <div class="srr_label srr_xsm"><label for="<?php echo esc_attr( $this->get_field_id('tab_titles') ); ?>"><?php esc_html_e( 'Tab titles', 'super-rss-reader' ); ?></label></div>
137 + <div class="srr_field"><textarea id="<?php echo esc_attr( $this->get_field_id('tab_titles') ); ?>" name="<?php echo esc_attr( $this->get_field_name('tab_titles') ); ?>" class="widefat"><?php echo esc_html( $tab_titles ); ?></textarea>
138 + <small class="srr_small_text"><?php esc_html_e( 'Enter corresponding tab titles in new line. Leave empty to take from feed.', 'super-rss-reader' ); ?></small></div>
139 139 </div>
140 140
141 141 <ul class="srr_tab_list">
142 - <li><a href="#" data-tab="general" class="active"><?php _e( 'General', 'super-rss-reader' ); ?></a></li>
143 - <li><a href="#" data-tab="content"><?php _e( 'Content', 'super-rss-reader' ); ?></a></li>
144 - <li><a href="#" data-tab="display"><?php _e( 'Display', 'super-rss-reader' ); ?></a></li>
145 - <li><a href="#" data-tab="filter"><?php _e( 'Filter', 'super-rss-reader' ); ?><span class="srr_pro_tag">PRO</span></a></li>
142 + <li><a href="#" data-tab="general" class="active"><?php esc_html_e( 'General', 'super-rss-reader' ); ?></a></li>
143 + <li><a href="#" data-tab="content"><?php esc_html_e( 'Content', 'super-rss-reader' ); ?></a></li>
144 + <li><a href="#" data-tab="display"><?php esc_html_e( 'Display', 'super-rss-reader' ); ?></a></li>
145 + <li><a href="#" data-tab="filter"><?php esc_html_e( 'Filter', 'super-rss-reader' ); ?><span class="srr_pro_tag">PRO</span></a></li>
146 146 </ul>
147 147
148 148 <section data-tab-id="general" class="active">
149 149
150 150 <div class="srr_row">
151 - <div class="srr_label"><label for="<?php echo $this->get_field_id('count');?>"><?php _e( 'Total items to show', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'Number of feed items to be displayed', 'super-rss-reader' ) ); ?></div>
152 - <div class="srr_field"><input id="<?php echo $this->get_field_id('count');?>" name="<?php echo $this->get_field_name('count'); ?>" type="number" value="<?php echo $count; ?>" class="widefat" /></div>
151 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('count') ); ?>"><?php esc_html_e( 'Total items to show', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'Number of feed items to be displayed', 'super-rss-reader' ) ); ?></div>
152 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('count') ); ?>" name="<?php echo esc_attr( $this->get_field_name('count') ); ?>" type="number" value="<?php echo esc_attr( $count ); ?>" class="widefat" /></div>
153 153 </div>
154 154
155 155 <div class="srr_row">
156 - <div class="srr_label"><label for="<?php echo $this->get_field_id('show_desc'); ?>"><?php _e( 'Show Description', 'super-rss-reader' ); ?></label></div>
157 - <div class="srr_field"><input id="<?php echo $this->get_field_id('show_desc'); ?>" type="checkbox" name="<?php echo $this->get_field_name('show_desc'); ?>" value="1" <?php echo $show_desc == "1" ? 'checked="checked"' : ""; ?> /></div>
156 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('show_desc') ); ?>"><?php esc_html_e( 'Show Description', 'super-rss-reader' ); ?></label></div>
157 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('show_desc') ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name('show_desc') ); ?>" value="1" <?php echo $show_desc == "1" ? 'checked="checked"' : ""; ?> /></div>
158 158 </div>
159 159
160 160 <div class="srr_row">
161 - <div class="srr_label"><label for="<?php echo $this->get_field_id('show_date'); ?>"><?php _e( 'Show Date', 'super-rss-reader' ); ?></label></div>
162 - <div class="srr_field"><input id="<?php echo $this->get_field_id('show_date'); ?>" type="checkbox" name="<?php echo $this->get_field_name('show_date'); ?>" value="1" <?php echo $show_date == "1" ? 'checked="checked"' : ""; ?> /></div>
161 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('show_date') ); ?>"><?php esc_html_e( 'Show Date', 'super-rss-reader' ); ?></label></div>
162 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('show_date') ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name('show_date') ); ?>" value="1" <?php echo $show_date == "1" ? 'checked="checked"' : ""; ?> /></div>
163 163 </div>
164 164
165 165 <div class="srr_row">
166 - <div class="srr_label"><label for="<?php echo $this->get_field_id('show_author'); ?>"><?php _e( 'Show Author', 'super-rss-reader' ); ?></label></div>
167 - <div class="srr_field"><input id="<?php echo $this->get_field_id('show_author'); ?>" type="checkbox" name="<?php echo $this->get_field_name('show_author'); ?>" value="1" <?php echo $show_author == "1" ? 'checked="checked"' : ""; ?> /></div>
166 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('show_author') ); ?>"><?php esc_html_e( 'Show Author', 'super-rss-reader' ); ?></label></div>
167 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('show_author') ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name('show_author') ); ?>" value="1" <?php echo $show_author == "1" ? 'checked="checked"' : ""; ?> /></div>
168 168 </div>
169 169
170 170 <div class="srr_row">
171 - <div class="srr_label"><label for="<?php echo $this->get_field_id('show_thumb'); ?>"><?php _e( 'Show thumbnail if present', 'super-rss-reader' ); ?></label></div>
172 - <div class="srr_field"><input id="<?php echo $this->get_field_id('show_thumb'); ?>" type="checkbox" name="<?php echo $this->get_field_name('show_thumb'); ?>" value="1" <?php echo $show_thumb == "1" ? 'checked="checked"' : ""; ?> /></div>
171 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('show_thumb') ); ?>"><?php esc_html_e( 'Show thumbnail if present', 'super-rss-reader' ); ?></label></div>
172 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('show_thumb') ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name('show_thumb') ); ?>" value="1" <?php echo $show_thumb == "1" ? 'checked="checked"' : ""; ?> /></div>
173 173 </div>
174 174 </section>
175 175
176 176 <section data-tab-id="content">
@@ -175,24 +175,24 @@
175 175
176 176 <section data-tab-id="content">
177 177
178 178 <div class="srr_row">
179 - <div class="srr_label"><label for="<?php echo $this->get_field_id('add_nofollow'); ?>"><?php _e( 'Add "no follow" attribute to links', 'super-rss-reader' ); ?></label></div>
180 - <div class="srr_field"><input id="<?php echo $this->get_field_id('add_nofollow'); ?>" type="checkbox" name="<?php echo $this->get_field_name('add_nofollow'); ?>" value="1" <?php echo $add_nofollow == "1" ? 'checked="checked"' : ""; ?> /></div>
179 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('add_nofollow') ); ?>"><?php esc_html_e( 'Add "no follow" attribute to links', 'super-rss-reader' ); ?></label></div>
180 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('add_nofollow') ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name('add_nofollow') ); ?>" value="1" <?php echo $add_nofollow == "1" ? 'checked="checked"' : ""; ?> /></div>
181 181 </div>
182 182
183 183 <div class="srr_row">
184 - <div class="srr_label"><label for="<?php echo $this->get_field_id('open_newtab'); ?>"><?php _e( 'Open links in new tab', 'super-rss-reader' ); ?></label></div>
185 - <div class="srr_field"><input id="<?php echo $this->get_field_id('open_newtab'); ?>" type="checkbox" name="<?php echo $this->get_field_name('open_newtab'); ?>" value="1" <?php echo $open_newtab == "1" ? 'checked="checked"' : ""; ?> /></div>
184 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('open_newtab') ); ?>"><?php esc_html_e( 'Open links in new tab', 'super-rss-reader' ); ?></label></div>
185 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('open_newtab') ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name('open_newtab') ); ?>" value="1" <?php echo $open_newtab == "1" ? 'checked="checked"' : ""; ?> /></div>
186 186 </div>
187 187
188 188 <div class="srr_row">
189 - <div class="srr_label"><label for="<?php echo $this->get_field_id('strip_title'); ?>"><?php _e( 'Trim title to words', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The number of words to be displayed. Use 0 to disable trimming', 'super-rss-reader' ) ); ?></div>
190 - <div class="srr_field"><input id="<?php echo $this->get_field_id('strip_title');?>" name="<?php echo $this->get_field_name('strip_title'); ?>" type="number" value="<?php echo $strip_title; ?>" class="widefat" /></div>
189 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('strip_title') ); ?>"><?php esc_html_e( 'Trim title to words', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The number of words to be displayed. Use 0 to disable trimming', 'super-rss-reader' ) ); ?></div>
190 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('strip_title') ); ?>" name="<?php echo esc_attr( $this->get_field_name('strip_title') ); ?>" type="number" value="<?php echo esc_attr( $strip_title ); ?>" class="widefat" /></div>
191 191 </div>
192 192
193 193 <div class="srr_row">
194 - <div class="srr_label"><label for="<?php echo $this->get_field_id('order_by');?>"><?php _e( 'Order feed items by', 'super-rss-reader' ); ?></label></div>
194 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('order_by') ); ?>"><?php esc_html_e( 'Order feed items by', 'super-rss-reader' ); ?></label></div>
195 195 <div class="srr_field">
196 196 <?php
197 197 echo '<select name="' . $this->get_field_name('order_by') . '" id="' . $this->get_field_id('order_by') . '">';
198 198 foreach( $option_lists[ 'order_by' ] as $k => $v ){
@@ -203,23 +203,23 @@
203 203 </div>
204 204 </div>
205 205
206 206 <div class="srr_row">
207 - <div class="srr_label"><label for="<?php echo $this->get_field_id('date_format'); ?>"><?php _e( 'Date format', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The format of the feed item date.', 'super-rss-reader' ) ); ?></div>
208 - <div class="srr_field"><input id="<?php echo $this->get_field_id('date_format'); ?>" name="<?php echo $this->get_field_name('date_format'); ?>" type="text" value="<?php echo $date_format; ?>" class="widefat" />
209 - <small class="srr_small_text"><a href="https://wordpress.org/support/article/formatting-date-and-time/" target="_blank"><?php _e( 'Refer format codes here', 'super-rss-reader' ); ?>.</a> <?php _e( 'Default: ', 'super-rss-reader' ); ?> <code>j F Y</code> <?php _e( 'or Type <code>relative</code> for relative format (example 2 days ago)', 'super-rss-reader' ); ?></small>
207 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('date_format') ); ?>"><?php esc_html_e( 'Date format', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The format of the feed item date.', 'super-rss-reader' ) ); ?></div>
208 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('date_format') ); ?>" name="<?php echo esc_attr( $this->get_field_name('date_format') ); ?>" type="text" value="<?php echo esc_attr( $date_format ); ?>" class="widefat" />
209 + <small class="srr_small_text"><a href="https://wordpress.org/support/article/formatting-date-and-time/" target="_blank"><?php esc_html_e( 'Refer format codes here', 'super-rss-reader' ); ?></a> <?php echo wp_kses( __( 'Default: <code>j F Y</code> or type <code>relative</code> for relative format (example 2 days ago)', 'super-rss-reader' ), array( 'code' => array() ) ); ?></small>
210 210 </div>
211 211 </div>
212 212
213 - <h4><?php _e( 'Description', 'super-rss-reader' ); ?></h4>
213 + <h4><?php esc_html_e( 'Description', 'super-rss-reader' ); ?></h4>
214 214
215 215 <div class="srr_row">
216 - <div class="srr_label"><label for="<?php echo $this->get_field_id('desc_type');?>"><?php _e( 'Description to prefer', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'Sometimes feed items have both summary and the full post content. Select the type to prefer.', 'super-rss-reader' ) ); ?></div>
216 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('desc_type') ); ?>"><?php esc_html_e( 'Description to prefer', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'Sometimes feed items have both summary and the full post content. Select the type to prefer.', 'super-rss-reader' ) ); ?></div>
217 217 <div class="srr_field">
218 218 <?php
219 - echo '<select name="' . $this->get_field_name('desc_type') . '" id="' . $this->get_field_id('desc_type') . '">';
219 + echo '<select name="' . esc_attr( $this->get_field_name('desc_type') ) . '" id="' . esc_attr( $this->get_field_id('desc_type') ) . '">';
220 220 foreach( $option_lists[ 'desc_type' ] as $k => $v ){
221 - echo '<option value="' . $k . '" ' . selected( $desc_type, $k, false ) . '>' . $v . '</option>';
221 + echo '<option value="' . esc_attr( $k ) . '" ' . selected( $desc_type, $k, false ) . '>' . esc_html( $v ) . '</option>';
222 222 }
223 223 echo '</select>';
224 224 ?>
225 225 </div>
@@ -225,35 +225,35 @@
225 225 </div>
226 226 </div>
227 227
228 228 <div class="srr_row">
229 - <div class="srr_label"><label for="<?php echo $this->get_field_id('strip_desc');?>"><?php _e( 'Trim description to words', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The number of words to be displayed. Use 0 to disable trimming', 'super-rss-reader' ) ); ?></div>
230 - <div class="srr_field"><input id="<?php echo $this->get_field_id('strip_desc');?>" name="<?php echo $this->get_field_name('strip_desc'); ?>" type="number" value="<?php echo $strip_desc; ?>" class="widefat" /></div>
229 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('strip_desc') ); ?>"><?php esc_html_e( 'Trim description to words', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The number of words to be displayed. Use 0 to disable trimming', 'super-rss-reader' ) ); ?></div>
230 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('strip_desc') ); ?>" name="<?php echo esc_attr( $this->get_field_name('strip_desc') ); ?>" type="number" value="<?php echo esc_attr( $strip_desc ); ?>" class="widefat" /></div>
231 231 </div>
232 232
233 233 <div class="srr_row">
234 - <div class="srr_label"><label for="<?php echo $this->get_field_id('read_more'); ?>"><?php _e( 'Read more text', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'Leave blank to hide read more text', 'super-rss-reader' ) ); ?></div>
235 - <div class="srr_field"><input id="<?php echo $this->get_field_id('read_more'); ?>" name="<?php echo $this->get_field_name('read_more'); ?>" type="text" value="<?php echo $read_more; ?>" class="widefat" /></div>
234 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('read_more') ); ?>"><?php esc_html_e( 'Read more text', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'Leave blank to hide read more text', 'super-rss-reader' ) ); ?></div>
235 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('read_more') ); ?>" name="<?php echo esc_attr( $this->get_field_name('read_more') ); ?>" type="text" value="<?php echo esc_attr( $read_more ); ?>" class="widefat" /></div>
236 236 </div>
237 237
238 238 <div class="srr_row">
239 - <div class="srr_label"><label for="<?php echo $this->get_field_id('rich_desc'); ?>"><?php _e( 'Enable rich description', 'super-rss-reader' ); ?></label></div>
240 - <div class="srr_field"><input id="<?php echo $this->get_field_id('rich_desc'); ?>" type="checkbox" name="<?php echo $this->get_field_name('rich_desc'); ?>" value="1" <?php echo $rich_desc == "1" ? 'checked="checked"' : ""; ?> /></div>
239 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('rich_desc') ); ?>"><?php esc_html_e( 'Enable rich description', 'super-rss-reader' ); ?></label></div>
240 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('rich_desc') ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name('rich_desc') ); ?>" value="1" <?php echo $rich_desc == "1" ? 'checked="checked"' : ""; ?> /></div>
241 241 </div>
242 242
243 243 <?php if( $rich_desc == 1 ): ?>
244 - <span class="srr_note"><?php _e( 'Note: You have enabled "Full/Rich HTML". If no description is present, then the full content will be displayed. Please make sure that the feed(s) are from trusted sources and do not contain any harmful scripts. If there are some alignment issues in the description, please use custom CSS to fix that.', 'super-rss-reader' ); ?></span>
244 + <span class="srr_note"><?php esc_html_e( 'Note: You have enabled "Full/Rich HTML". If no description is present, then the full content will be displayed. Please make sure that the feed(s) are from trusted sources and do not contain any harmful scripts. If there are some alignment issues in the description, please use custom CSS to fix that.', 'super-rss-reader' ); ?></span>
245 245 <?php endif; ?>
246 246
247 - <h4><?php _e( 'Thumbnail', 'super-rss-reader' ); ?></h4>
247 + <h4><?php esc_html_e( 'Thumbnail', 'super-rss-reader' ); ?></h4>
248 248
249 249 <div class="srr_row">
250 - <div class="srr_label"><label for="<?php echo $this->get_field_id('thumbnail_position');?>"><?php _e( 'Thumbnail position', 'super-rss-reader' ); ?></label></div>
250 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('thumbnail_position') ); ?>"><?php esc_html_e( 'Thumbnail position', 'super-rss-reader' ); ?></label></div>
251 251 <div class="srr_field">
252 252 <?php
253 - echo '<select name="' . $this->get_field_name('thumbnail_position') . '" id="' . $this->get_field_id('thumbnail_position') . '">';
253 + echo '<select name="' . esc_attr( $this->get_field_name('thumbnail_position') ) . '" id="' . esc_attr( $this->get_field_id('thumbnail_position') ) . '">';
254 254 foreach( $option_lists[ 'thumbnail_position' ] as $k => $v ){
255 - echo '<option value="' . $k . '" ' . selected( $thumbnail_position, $k, false ) . '>' . $v . '</option>';
255 + echo '<option value="' . esc_attr( $k ) . '" ' . selected( $thumbnail_position, $k, false ) . '>' . esc_html( $v ) . '</option>';
256 256 }
257 257 echo '</select>';
258 258 ?>
259 259 </div>
@@ -259,14 +259,14 @@
259 259 </div>
260 260 </div>
261 261
262 262 <div class="srr_row">
263 - <div class="srr_label"><label for="<?php echo $this->get_field_id('thumbnail_size'); ?>"><?php _e( 'Thumbnail size', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The size of the thumbnail including the units. Example 64px, 10%', 'super-rss-reader' ) ); ?></div>
264 - <div class="srr_field"><input id="<?php echo $this->get_field_id('thumbnail_size');?>" name="<?php echo $this->get_field_name('thumbnail_size'); ?>" type="text" value="<?php echo $thumbnail_size; ?>" class="widefat" /></div>
263 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('thumbnail_size') ); ?>"><?php esc_html_e( 'Thumbnail size', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The size of the thumbnail including the units. Example 64px, 10%', 'super-rss-reader' ) ); ?></div>
264 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('thumbnail_size') ); ?>" name="<?php echo esc_attr( $this->get_field_name('thumbnail_size') ); ?>" type="text" value="<?php echo esc_attr( $thumbnail_size ); ?>" class="widefat" /></div>
265 265 </div>
266 266
267 267 <div class="srr_row">
268 - <div class="srr_label"><label for="<?php echo $this->get_field_id('thumbnail_force');?>"><?php _e( 'Fetch thumbnail from the page (feed URL) directly if not available.', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'If feed item does not have an image, then fetch it from the page directly. This feature is available in the PRO version', 'super-rss-reader' ) ); ?></div>
268 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('thumbnail_force') ); ?>"><?php esc_html_e( 'Fetch thumbnail from the page (feed URL) directly if not available.', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'If feed item does not have an image, then fetch it from the page directly. This feature is available in the PRO version', 'super-rss-reader' ) ); ?></div>
269 269 <div class="srr_field">
270 270 <select>
271 271 <option disabled selected>No</option>
272 272 <option disabled>When absent in feed item</option>
@@ -276,24 +276,24 @@
276 276 </div>
277 277 </div>
278 278
279 279 <div class="srr_row">
280 - <div class="srr_label"><label for="<?php echo $this->get_field_id('thumbnail_default'); ?>"><?php _e( 'Default thumbnail image', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The URL of the default thumbnail image if not present. Leave empty to skip thumbnail if not present.', 'super-rss-reader' ) ); ?></div>
281 - <div class="srr_field"><input id="<?php echo $this->get_field_id('thumbnail_default');?>" name="<?php echo $this->get_field_name('thumbnail_default'); ?>" type="text" value="<?php echo $thumbnail_default; ?>" class="widefat" /></div>
280 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('thumbnail_default') ); ?>"><?php esc_html_e( 'Default thumbnail image', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The URL of the default thumbnail image if not present. Leave empty to skip thumbnail if not present.', 'super-rss-reader' ) ); ?></div>
281 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('thumbnail_default') ); ?>" name="<?php echo esc_attr( $this->get_field_name('thumbnail_default') ); ?>" type="text" value="<?php echo esc_attr( $thumbnail_default ); ?>" class="widefat" /></div>
282 282 </div>
283 283
284 - <h4><?php _e( 'Misc', 'super-rss-reader' ); ?></h4>
284 + <h4><?php esc_html_e( 'Misc', 'super-rss-reader' ); ?></h4>
285 285
286 286 <div class="srr_row">
287 - <div class="srr_label"><label for="<?php echo $this->get_field_id('date_timezone'); ?>"><?php _e( 'Date timezone', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The timezone of the feed item date.', 'super-rss-reader' ) ); ?></div>
288 - <div class="srr_field"><input id="<?php echo $this->get_field_id('date_timezone');?>" name="<?php echo $this->get_field_name('date_timezone'); ?>" type="text" value="<?php echo $date_timezone; ?>" class="widefat" />
289 - <small class="srr_small_text"><a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones" target="_blank"><?php _e( 'Refer timezone name here', 'super-rss-reader' ); ?>.</a> <?php _e( 'Example: ', 'super-rss-reader' ); ?> <code>Asia/Taipei</code> <?php _e( 'Default: ', 'super-rss-reader' ); ?> <code>UTC</code></small>
287 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('date_timezone') ); ?>"><?php esc_html_e( 'Date timezone', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The timezone of the feed item date.', 'super-rss-reader' ) ); ?></div>
288 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('date_timezone') ); ?>" name="<?php echo esc_attr( $this->get_field_name('date_timezone') ); ?>" type="text" value="<?php echo esc_attr( $date_timezone ); ?>" class="widefat" />
289 + <small class="srr_small_text"><a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones" target="_blank"><?php esc_html_e( 'Refer timezone name here', 'super-rss-reader' ); ?>.</a> <?php esc_html_e( 'Example: ', 'super-rss-reader' ); ?> <code>Asia/Taipei</code> <?php esc_html_e( 'Default: ', 'super-rss-reader' ); ?> <code>UTC</code></small>
290 290 </div>
291 291 </div>
292 292
293 293 <div class="srr_row">
294 - <div class="srr_label"><label for="<?php echo $this->get_field_id('no_feed_text'); ?>"><?php _e( 'No feed items text', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'Text to display when there are no feed items', 'super-rss-reader' ) ); ?></div>
295 - <div class="srr_field"><input id="<?php echo $this->get_field_id('no_feed_text');?>" name="<?php echo $this->get_field_name('no_feed_text'); ?>" type="text" value="<?php echo $no_feed_text; ?>" class="widefat" /></div>
294 + <div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('no_feed_text') ); ?>"><?php esc_html_e( 'No feed items text', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'Text to display when there are no feed items', 'super-rss-reader' ) ); ?></div>
295 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('no_feed_text') ); ?>" name="<?php echo esc_attr( $this->get_field_name('no_feed_text') ); ?>" type="text" value="<?php echo esc_attr( $no_feed_text ); ?>" class="widefat" /></div>
296 296 </div>
297 297
298 298 </section>
299 299
@@ -299,14 +299,14 @@
299 299
300 300 <section data-tab-id="display">
301 301
302 302 <div class="srr_row">
303 - <div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('color_style');?>"><?php _e( 'Color theme', 'super-rss-reader' ); ?></label></div>
303 + <div class="srr_label srr_sm"><label for="<?php echo esc_attr( $this->get_field_id('color_style') ); ?>"><?php esc_html_e( 'Color theme', 'super-rss-reader' ); ?></label></div>
304 304 <div class="srr_field">
305 305 <?php
306 - echo '<select name="' . $this->get_field_name('color_style') . '" id="' . $this->get_field_id('color_style') . '">';
306 + echo '<select name="' . esc_attr( $this->get_field_name('color_style') ) . '" id="' . esc_attr( $this->get_field_id('color_style') ) . '">';
307 307 foreach( $option_lists[ 'color_style' ] as $k => $v ){
308 - echo '<option value="' . $k . '" ' . selected( $color_style, $k, false ) . '>' . $v . '</option>';
308 + echo '<option value="' . esc_attr( $k ) . '" ' . selected( $color_style, $k, false ) . '>' . esc_html( $v ) . '</option>';
309 309 }
310 310 echo '</select>';
311 311 ?>
312 312 </div>
@@ -312,14 +312,14 @@
312 312 </div>
313 313 </div>
314 314
315 315 <div class="srr_row">
316 - <div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('display_type');?>"><?php _e( 'Display type', 'super-rss-reader' ); ?></label></div>
316 + <div class="srr_label srr_sm"><label for="<?php echo esc_attr( $this->get_field_id('display_type') ); ?>"><?php esc_html_e( 'Display type', 'super-rss-reader' ); ?></label></div>
317 317 <div class="srr_field">
318 318 <?php
319 - echo '<select name="' . $this->get_field_name('display_type') . '" id="' . $this->get_field_id('display_type') . '">';
319 + echo '<select name="' . esc_attr( $this->get_field_name('display_type') ) . '" id="' . esc_attr( $this->get_field_id('display_type') ) . '">';
320 320 foreach( $option_lists[ 'display_type' ] as $k => $v ){
321 - echo '<option value="' . $k . '" ' . selected( $display_type, $k, false ) . '>' . $v . '</option>';
321 + echo '<option value="' . esc_attr( $k ) . '" ' . selected( $display_type, $k, false ) . '>' . esc_html( $v ) . '</option>';
322 322 }
323 323 echo '</select>';
324 324 ?>
325 325 </div>
@@ -325,17 +325,17 @@
325 325 </div>
326 326 </div>
327 327
328 328 <div class="srr_row">
329 - <div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('ticker_speed');?>"><?php _e( 'Ticker speed', 'super-rss-reader' ); ?></label></div>
330 - <div class="srr_field"><input id="<?php echo $this->get_field_id('ticker_speed');?>" name="<?php echo $this->get_field_name('ticker_speed'); ?>" type="number" value="<?php echo $ticker_speed; ?>" title="Speed of the ticker in seconds"/> seconds</div>
329 + <div class="srr_label srr_sm"><label for="<?php echo esc_attr( $this->get_field_id('ticker_speed') ); ?>"><?php esc_html_e( 'Ticker speed', 'super-rss-reader' ); ?></label></div>
330 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('ticker_speed') ); ?>" name="<?php echo esc_attr( $this->get_field_name('ticker_speed') ); ?>" type="number" value="<?php echo esc_attr( $ticker_speed ); ?>" title="Speed of the ticker in seconds"/> seconds</div>
331 331 </div>
332 332
333 333 <div class="srr_row">
334 - <div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('visible_items');?>"><?php _e( 'Widget height', 'super-rss-reader' ); ?><?php $this->tt( __( 'The height of the widget when display type is "ticker"', 'super-rss-reader' ) ); ?></label></div>
335 - <div class="srr_field"><input id="<?php echo $this->get_field_id('visible_items');?>" name="<?php echo $this->get_field_name('visible_items'); ?>" type="number" value="<?php echo $visible_items; ?>" /><br/>
336 - <small class="srr_small_text"><?php _e( 'Set value less than 20 to show visible feed items. Example: <b>5</b> items', 'super-rss-reader' ); ?></small></br>
337 - <small class="srr_small_text"><?php _e( 'Set value greater than 20 for fixed widget height. Example: <b>400</b> px', 'super-rss-reader' ); ?></small></div>
334 + <div class="srr_label srr_sm"><label for="<?php echo esc_attr( $this->get_field_id('visible_items') ); ?>"><?php esc_html_e( 'Widget height', 'super-rss-reader' ); ?><?php $this->tt( __( 'The height of the widget when display type is "ticker"', 'super-rss-reader' ) ); ?></label></div>
335 + <div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('visible_items') ); ?>" name="<?php echo esc_attr( $this->get_field_name('visible_items') ); ?>" type="number" value="<?php echo esc_attr( $visible_items ); ?>" /><br/>
336 + <small class="srr_small_text"><?php esc_html_e( 'Set value less than 20 to show visible feed items. Example: 5 items', 'super-rss-reader' ); ?></small></br>
337 + <small class="srr_small_text"><?php esc_html_e( 'Set value greater than 20 for fixed widget height. Example: 400 px', 'super-rss-reader' ); ?></small></div>
338 338 </div>
339 339
340 340 </section>
341 341
@@ -343,12 +343,12 @@
343 343
344 344 <p>You can build rules to show/hide feed items based on feed title, URL and description. This feature is available in the <a href="https://www.aakashweb.com/wordpress-plugins/super-rss-reader/?utm_source=admin&utm_medium=filter&utm_campaign=srr-pro#pro" target="_blank">PRO version</a>.</p>
345 345
346 346 <div>
347 - <h4><?php _e( 'Filter RSS feed items', 'super-rss-reader' ); ?></h4>
347 + <h4><?php esc_html_e( 'Filter RSS feed items', 'super-rss-reader' ); ?></h4>
348 348
349 349 <div class="srr_row">
350 - <div class="srr_label"><label><?php _e( 'Filter type', 'super-rss-reader' ); ?></label></div>
350 + <div class="srr_label"><label><?php esc_html_e( 'Filter type', 'super-rss-reader' ); ?></label></div>
351 351 <div class="srr_field">
352 352 <?php
353 353 echo '<select disabled="disabled">';
354 354 echo '<option>Show items based on filter</option>';
@@ -357,10 +357,10 @@
357 357 </div>
358 358 </div>
359 359
360 360 <div class="srr_row">
361 - <div class="srr_label"><label><?php _e( 'Filter rules', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The rules for the keyword filters', 'super-rss-reader' ) ); ?></div>
362 - <div class="srr_field"><a href="#"><?php _e( 'View/Edit filter rules', 'super-rss-reader' ); ?></a></div>
361 + <div class="srr_label"><label><?php esc_html_e( 'Filter rules', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The rules for the keyword filters', 'super-rss-reader' ) ); ?></div>
362 + <div class="srr_field"><a href="#"><?php esc_html_e( 'View/Edit filter rules', 'super-rss-reader' ); ?></a></div>
363 363 </div>
364 364 </div>
365 365
366 366 </section>
@@ -394,10 +394,10 @@
394 394 <?php
395 395 }
396 396
397 397 public function tt( $text ){
398 - echo '<div class="srr_tt" tabindex="0"><span class="dashicons dashicons-editor-help"></span><span class="srr_tt_text"><span>' . $text . '</span></span></div>';
398 + echo '<div class="srr_tt" tabindex="0"><span class="dashicons dashicons-editor-help"></span><span class="srr_tt_text"><span>' . esc_html( $text ) . '</span></span></div>';
399 399 }
400 400
401 401 }
402 402
403 403 ?>