PluginProbe
Super RSS Reader – Add attractive RSS Feed Widget / 4.5
Super RSS Reader – Add attractive RSS Feed Widget v4.5
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 +213 -106 3.24.5 View file →
@@ -9,13 +9,13 @@
9 9 // Initialize
10 10 public function __construct(){
11 11 $widget_ops = array(
12 12 'classname' => 'widget_super_rss_reader',
13 - 'description' => 'Enhanced RSS feed reader widget with advanced features.'
13 + 'description' => __( 'An RSS feed reader widget with advanced features', 'super-rss-reader' )
14 14 );
15 15
16 - $control_ops = array('width' => 500, 'height' => 500);
17 - parent::__construct('super_rss_reader', 'Super RSS Reader', $widget_ops, $control_ops);
16 + $control_ops = array( 'width' => 500, 'height' => 500 );
17 + parent::__construct( 'super_rss_reader', 'Super RSS Reader', $widget_ops, $control_ops );
18 18 }
19 19
20 20 // Display the Widget
21 21 public function widget( $args, $instance ){
@@ -29,17 +29,14 @@
29 29 }
30 30
31 31 echo $before_widget . $title;
32 32
33 - echo "\n" . '
34 - <!-- Start - Super RSS Reader v' . SRR_VERSION . '-->
35 - <div class="super-rss-reader-widget">' . "\n";
33 + echo '<!-- Start - Super RSS Reader v' . SRR_VERSION . '-->
34 + <div class="super-rss-reader-widget">';
36 35
37 36 SRR_Widget::render_feed( $instance );
38 37
39 - echo "\n" . '</div>
40 - <!-- End - Super RSS Reader -->
41 - ' . "\n";
38 + echo '</div><!-- End - Super RSS Reader -->';
42 39 echo $after_widget;
43 40
44 41 }
45 42
@@ -58,13 +55,20 @@
58 55 $instance[ 'show_author' ] = intval( isset( $new_instance['show_author'] ) ? $new_instance['show_author'] : 0 );
59 56 $instance[ 'show_thumb' ] = intval( isset( $new_instance['show_thumb'] ) ? $new_instance['show_thumb'] : 0 );
60 57 $instance[ 'strip_desc' ] = intval( $new_instance['strip_desc'] );
61 58 $instance[ 'strip_title' ] = intval( $new_instance['strip_title'] );
59 + $instance[ 'date_format' ] = stripslashes( $new_instance['date_format'] );
60 + $instance[ 'order_by' ] = stripslashes( $new_instance['order_by'] );
62 61 $instance[ 'read_more' ] = stripslashes( $new_instance['read_more'] );
63 62 $instance[ 'add_nofollow' ] = intval( isset( $new_instance['add_nofollow'] ) ? $new_instance['add_nofollow'] : 0 );
64 63 $instance[ 'open_newtab' ] = intval( isset( $new_instance['open_newtab'] ) ? $new_instance['open_newtab'] : 0 );
65 64 $instance[ 'rich_desc' ] = intval( isset( $new_instance['rich_desc'] ) ? $new_instance['rich_desc'] : 0 );
66 -
65 + $instance[ 'desc_type' ] = stripslashes( $new_instance['desc_type'] );
66 + $instance[ 'thumbnail_position' ] = stripslashes( $new_instance['thumbnail_position'] );
67 + $instance[ 'thumbnail_size' ] = stripslashes( $new_instance['thumbnail_size'] );
68 + $instance[ 'thumbnail_default' ] = stripslashes( $new_instance['thumbnail_default'] );
69 + $instance[ 'no_feed_text' ] = stripslashes( $new_instance['no_feed_text'] );
70 +
67 71 $instance[ 'color_style' ] = stripslashes( $new_instance['color_style']);
68 72 $instance[ 'display_type' ] = stripslashes( $new_instance['display_type']);
69 73 $instance[ 'visible_items' ] = intval( $new_instance['visible_items']);
70 74 $instance[ 'ticker_speed' ] = intval( $new_instance['ticker_speed']);
@@ -74,9 +78,9 @@
74 78
75 79 // Widget form
76 80 public function form( $instance ){
77 81
78 - $instance = wp_parse_args( (array) $instance, SRR_Options::default_options() );
82 + $instance = wp_parse_args( (array) $instance, SRR_Options::defaults() );
79 83
80 84 $title = htmlspecialchars( isset( $instance['title'] ) ? $instance[ 'title' ] : '' );
81 85 $urls = htmlspecialchars($instance['urls']);
82 86 $tab_titles = htmlspecialchars($instance['tab_titles']);
@@ -89,10 +93,17 @@
89 93 $open_newtab = intval($instance['open_newtab']);
90 94 $add_nofollow = intval($instance['add_nofollow']);
91 95 $strip_desc = intval($instance['strip_desc']);
92 96 $strip_title = intval($instance['strip_title']);
97 + $date_format = htmlspecialchars($instance['date_format']);
98 + $order_by = htmlspecialchars($instance['order_by']);
93 99 $read_more = htmlspecialchars($instance['read_more']);
94 100 $rich_desc = intval($instance['rich_desc']);
101 + $desc_type = htmlspecialchars($instance['desc_type']);
102 + $thumbnail_position = htmlspecialchars($instance['thumbnail_position']);
103 + $thumbnail_size = htmlspecialchars($instance['thumbnail_size']);
104 + $thumbnail_default = htmlspecialchars($instance['thumbnail_default']);
105 + $no_feed_text = htmlspecialchars($instance['no_feed_text']);
95 106
96 107 $color_style = stripslashes($instance['color_style']);
97 108 $display_type = stripslashes($instance['display_type']);
98 109 $visible_items = intval($instance['visible_items']);
@@ -97,8 +108,10 @@
97 108 $display_type = stripslashes($instance['display_type']);
98 109 $visible_items = intval($instance['visible_items']);
99 110 $ticker_speed = intval($instance['ticker_speed']);
100 111
112 + $option_lists = SRR_Options::select_options();
113 +
101 114 // Replacing commas with new lines
102 115 $urls = str_replace( ',', "\n", $urls );
103 116 $tab_titles = str_replace( ',', "\n", $tab_titles );
104 117
@@ -105,170 +118,264 @@
105 118 ?>
106 119
107 120 <div class="srr_settings">
108 121
109 - <section>
122 + <div class="srr_row">
123 + <div class="srr_label srr_xsm"><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title', 'super-rss-reader' ); ?></label></div>
124 + <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>
110 126
127 + <div class="srr_row">
128 + <div class="srr_label srr_xsm"><label for="<?php echo $this->get_field_id('urls'); ?>"><?php _e( 'URL(s)', 'super-rss-reader' ); ?></label></div>
129 + <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>
130 + <small class="srr_small_text"><?php _e( 'Can enter multiple RSS/atom feed URLs in new line', 'super-rss-reader' ); ?></small></div>
131 + </div>
132 +
133 + <div class="srr_row">
134 + <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>
135 + <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>
136 + <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>
137 + </div>
138 +
139 + <ul class="srr_tab_list">
140 + <li><a href="#" data-tab="general" class="active"><?php _e( 'General', 'super-rss-reader' ); ?></a></li>
141 + <li><a href="#" data-tab="content"><?php _e( 'Content', 'super-rss-reader' ); ?></a></li>
142 + <li><a href="#" data-tab="display"><?php _e( 'Display', 'super-rss-reader' ); ?></a></li>
143 + <li><a href="#" data-tab="filter"><?php _e( 'Filter', 'super-rss-reader' ); ?><span class="srr_pro_tag">PRO</span></a></li>
144 + </ul>
145 +
146 + <section data-tab-id="general" class="active">
147 +
111 148 <div class="srr_row">
112 - <div class="srr_label srr_xsm"><label for="<?php echo $this->get_field_id('title'); ?>">Title</label></div>
113 - <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>
149 + <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>
150 + <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>
114 151 </div>
115 152
116 153 <div class="srr_row">
117 - <div class="srr_label srr_xsm"><label for="<?php echo $this->get_field_id('urls'); ?>">URL(s)</label></div>
118 - <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>
119 - <small class="srr_small_text">Can enter multiple RSS/atom feed URLs in new line</small></div>
154 + <div class="srr_label"><label for="<?php echo $this->get_field_id('show_desc'); ?>"><?php _e( 'Show Description', 'super-rss-reader' ); ?></label></div>
155 + <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>
120 156 </div>
121 157
122 158 <div class="srr_row">
123 - <div class="srr_label srr_xsm"><label for="<?php echo $this->get_field_id('tab_titles'); ?>">Tab titles</label></div>
124 - <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>
125 - <small class="srr_small_text">Enter corresponding tab titles in new line.</small></div>
159 + <div class="srr_label"><label for="<?php echo $this->get_field_id('show_date'); ?>"><?php _e( 'Show Date', 'super-rss-reader' ); ?></label></div>
160 + <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>
126 161 </div>
162 +
163 + <div class="srr_row">
164 + <div class="srr_label"><label for="<?php echo $this->get_field_id('show_author'); ?>"><?php _e( 'Show Author', 'super-rss-reader' ); ?></label></div>
165 + <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>
127 167
168 + <div class="srr_row">
169 + <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>
170 + <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>
128 172 </section>
129 173
130 - <h4>Display</h4>
174 + <section data-tab-id="content">
131 175
132 - <section data-tab-id="display">
133 176 <div class="srr_row">
134 - <div class="srr_label"><label for="<?php echo $this->get_field_id('show_desc'); ?>">Show Description</label></div>
135 - <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>
177 + <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>
178 + <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>
136 179 </div>
137 180
138 181 <div class="srr_row">
139 - <div class="srr_label"><label for="<?php echo $this->get_field_id('show_date'); ?>">Show Date</label></div>
140 - <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>
182 + <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>
183 + <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>
141 184 </div>
142 -
185 +
143 186 <div class="srr_row">
144 - <div class="srr_label"><label for="<?php echo $this->get_field_id('show_author'); ?>">Show Author</label></div>
145 - <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>
187 + <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>
188 + <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>
146 189 </div>
147 190
148 191 <div class="srr_row">
149 - <div class="srr_label"><label for="<?php echo $this->get_field_id('show_thumb'); ?>">Show thumbnail if present</label></div>
150 - <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>
192 + <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>
193 + <div class="srr_field">
194 + <?php
195 + echo '<select name="' . $this->get_field_name('order_by') . '" id="' . $this->get_field_id('order_by') . '">';
196 + foreach( $option_lists[ 'order_by' ] as $k => $v ){
197 + echo '<option value="' . $k . '" ' . selected( $order_by, $k, false ) . '>' . $v . '</option>';
198 + }
199 + echo '</select>';
200 + ?>
201 + </div>
151 202 </div>
152 - </section>
153 203
154 - <h4>Content</h4>
204 + <div class="srr_row">
205 + <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>
206 + <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" />
207 + <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>
208 + </div>
209 + </div>
155 210
156 - <section data-tab-id="content">
211 + <h4><?php _e( 'Description', 'super-rss-reader' ); ?></h4>
157 212
158 213 <div class="srr_row">
159 - <div class="srr_label"><label for="<?php echo $this->get_field_id('count');?>">Total items to show:</label></div>
160 - <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" title="No of feed items to parse"/></div>
214 + <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>
215 + <div class="srr_field">
216 + <?php
217 + echo '<select name="' . $this->get_field_name('desc_type') . '" id="' . $this->get_field_id('desc_type') . '">';
218 + foreach( $option_lists[ 'desc_type' ] as $k => $v ){
219 + echo '<option value="' . $k . '" ' . selected( $desc_type, $k, false ) . '>' . $v . '</option>';
220 + }
221 + echo '</select>';
222 + ?>
223 + </div>
161 224 </div>
162 225
163 226 <div class="srr_row">
164 - <div class="srr_label"><label for="<?php echo $this->get_field_id('strip_desc');?>">Trim description to words:</label></div>
165 - <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" title="The number of words to be displayed. Use 0 to disable stripping"/></div>
227 + <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>
228 + <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>
166 229 </div>
167 230
168 231 <div class="srr_row">
169 - <div class="srr_label"><label for="<?php echo $this->get_field_id('read_more'); ?>">Read more text:</label></div>
170 - <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" title="Leave blank to hide read more text"/></div>
232 + <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>
233 + <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>
171 234 </div>
172 235
173 236 <div class="srr_row">
174 - <div class="srr_label"><label for="<?php echo $this->get_field_id('add_nofollow'); ?>">Add "no follow" attribute to links</label></div>
175 - <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>
237 + <div class="srr_label"><label for="<?php echo $this->get_field_id('rich_desc'); ?>"><?php _e( 'Enable rich description', 'super-rss-reader' ); ?></label></div>
238 + <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>
176 239 </div>
177 240
241 + <?php if( $rich_desc == 1 ): ?>
242 + <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>
243 + <?php endif; ?>
244 +
245 + <h4><?php _e( 'Thumbnail', 'super-rss-reader' ); ?></h4>
246 +
178 247 <div class="srr_row">
179 - <div class="srr_label"><label for="<?php echo $this->get_field_id('open_newtab'); ?>">Open links in new tab</label></div>
180 - <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>
248 + <div class="srr_label"><label for="<?php echo $this->get_field_id('thumbnail_position');?>"><?php _e( 'Thumbnail position', 'super-rss-reader' ); ?></label></div>
249 + <div class="srr_field">
250 + <?php
251 + echo '<select name="' . $this->get_field_name('thumbnail_position') . '" id="' . $this->get_field_id('thumbnail_position') . '">';
252 + foreach( $option_lists[ 'thumbnail_position' ] as $k => $v ){
253 + echo '<option value="' . $k . '" ' . selected( $thumbnail_position, $k, false ) . '>' . $v . '</option>';
254 + }
255 + echo '</select>';
256 + ?>
257 + </div>
181 258 </div>
182 259
183 260 <div class="srr_row">
184 - <div class="srr_label"><label for="<?php echo $this->get_field_id('strip_title'); ?>">Trim title to words:</label></div>
185 - <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" title="The number of words to be displayed. Use 0 to disable stripping"/></div>
261 + <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>
262 + <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>
186 263 </div>
187 264
188 265 <div class="srr_row">
189 - <div class="srr_label"><label for="<?php echo $this->get_field_id('rich_desc'); ?>">Enable rich description</label></div>
190 - <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>
266 + <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>
267 + <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>
191 268 </div>
192 269
270 + <h4><?php _e( 'Misc', 'super-rss-reader' ); ?></h4>
271 +
272 + <div class="srr_row">
273 + <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>
274 + <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>
275 + </div>
276 +
193 277 </section>
194 278
195 - <?php if( $rich_desc == 1 ): ?>
196 - <span class="srr_note">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.</span>
197 - <?php endif; ?>
279 + <section data-tab-id="display">
198 280
199 - <h4>Style</h4>
200 - <section>
281 + <div class="srr_row">
282 + <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>
283 + <div class="srr_field">
284 + <?php
285 + echo '<select name="' . $this->get_field_name('color_style') . '" id="' . $this->get_field_id('color_style') . '">';
286 + foreach( $option_lists[ 'color_style' ] as $k => $v ){
287 + echo '<option value="' . $k . '" ' . selected( $color_style, $k, false ) . '>' . $v . '</option>';
288 + }
289 + echo '</select>';
290 + ?>
291 + </div>
292 + </div>
201 293
202 - <div class="srr_row">
203 - <div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('color_style');?>">Color theme: </label></div>
204 - <div class="srr_field">
205 - <?php
206 - $color_themes = SRR_Options::color_themes();
207 - echo '<select name="' . $this->get_field_name('color_style') . '" id="' . $this->get_field_id('color_style') . '">';
208 - foreach($color_themes as $k => $v){
209 - echo '<option value="' . $v . '" ' . ($color_style == $v ? 'selected="selected"' : "") . '>' . $k . '</option>';
210 - }
211 - echo '</select>';
212 - ?>
294 + <div class="srr_row">
295 + <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>
296 + <div class="srr_field">
297 + <?php
298 + echo '<select name="' . $this->get_field_name('display_type') . '" id="' . $this->get_field_id('display_type') . '">';
299 + foreach( $option_lists[ 'display_type' ] as $k => $v ){
300 + echo '<option value="' . $k . '" ' . selected( $display_type, $k, false ) . '>' . $v . '</option>';
301 + }
302 + echo '</select>';
303 + ?>
304 + </div>
213 305 </div>
214 - </div>
215 306
216 - <div class="srr_row">
217 - <div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('visible_items');?>">Widget height:</label></div>
218 - <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; ?>" title="Height of the RSS feed."/><br/>
219 - <small class="srr_small_text">Set value less than 20 to show visible feed items. Example: <b>5</b> items</small></br>
220 - <small class="srr_small_text">Set value greater than 20 for fixed widget height. Example: <b>400</b> px</small></div>
221 - </div>
307 + <div class="srr_row">
308 + <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>
309 + <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>
310 + </div>
222 311
223 - <div class="srr_row">
224 - <div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('display_type');?>">Display type: </label></div>
225 - <div class="srr_field">
226 - <?php
227 - $display_types = SRR_Options::display_types();
228 - echo '<select name="' . $this->get_field_name('display_type') . '" id="' . $this->get_field_id('display_type') . '">';
229 - foreach($display_types as $k => $v){
230 - echo '<option value="' . $k . '" ' . ($display_type == $k ? 'selected="selected"' : "") . '>' . $v . '</option>';
231 - }
232 - echo '</select>';
233 - ?>
312 + <div class="srr_row">
313 + <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>
314 + <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/>
315 + <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>
316 + <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>
234 317 </div>
235 - </div>
236 318
237 - <div class="srr_row">
238 - <div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('ticker_speed');?>">Ticker speed: </label></div>
239 - <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>
240 - </div>
319 + </section>
241 320
321 + <section data-tab-id="filter" class="srr_pro_sec">
322 +
323 + <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>
324 +
325 + <div>
326 + <h4><?php _e( 'Filter RSS feed items', 'super-rss-reader' ); ?></h4>
327 +
328 + <div class="srr_row">
329 + <div class="srr_label"><label><?php _e( 'Filter type', 'super-rss-reader' ); ?></label></div>
330 + <div class="srr_field">
331 + <?php
332 + echo '<select disabled="disabled">';
333 + echo '<option>Show items based on filter</option>';
334 + echo '</select>';
335 + ?>
336 + </div>
337 + </div>
338 +
339 + <div class="srr_row">
340 + <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>
341 + <div class="srr_field"><a href="#"><?php _e( 'View/Edit filter rules', 'super-rss-reader' ); ?></a></div>
342 + </div>
343 + </div>
344 +
242 345 </section>
243 346
244 347 </div>
245 -
246 - <div class="srr_coffee">
247 - <p>Thank you for using Super RSS Reader. If you found it useful, please buy me a coffee !</p>
248 - <div class="srr_coffee_wrap">
249 - <select class="srr_coffee_amt">
250 - <option value="6" selected="selected">$6</option>
251 - <option value="7">$7</option>
252 - <option value="8">$8</option>
253 - <option value="9">$9</option>
254 - <option value="10">$10</option>
255 - <option value="11">$11</option>
256 - <option value="12">$12</option>
257 - <option value="13">$13</option>
258 - <option value="14">$14</option>
259 - <option value="15">$15</option>
260 - <option value="">Custom</option>
261 - </select>
262 - <a class="button button-primary srr_coffee_btn" href="https://www.paypal.me/vaakash/6" data-link="https://www.paypal.me/vaakash/" target="_blank">Buy me a coffee !</a>
348 +
349 + <div class="srr_pro">
350 + <div class="srr_pro_intro">
351 + <div><span class="srr_pro_label">PRO</span></div>
352 + <p>Get the PRO version to enjoy more features like<br/> <span>Shortcode, Grid display, Filter by keyword</span> and more !</p>
353 + <div><span class="dashicons dashicons-arrow-down-alt2 srr_pro_more"></span></div>
263 354 </div>
355 + <div class="srr_pro_details">
356 + <ul class="srr_pro_features">
357 + <li>Shortcode - <span>Display RSS feed anywhere in your website</span></li>
358 + <li>Grid display - <span>Display feed item in rows and columns</span></li>
359 + <li>Filter by keyword - <span>Show/hide feed items based on keyword</span></li>
360 + <li>Custom template - <span>Change order of feed item content, add HTML</span></li>
361 + <li>4+ new color themes</li>
362 + <li>Updates and support for 1 year</li>
363 + </ul>
364 + <p><a href="https://www.aakashweb.com/wordpress-plugins/super-rss-reader/?utm_source=admin&utm_medium=widget-get&utm_campaign=srr-pro#pro" class="button button-primary">Get PRO version</a> <a href="https://www.aakashweb.com/wordpress-plugins/super-rss-reader/?utm_source=admin&utm_medium=widget-info&utm_campaign=srr-pro" class="button">More information</a></p>
365 + </div>
264 366 </div>
265 367
266 368 <div class="srr_info">
267 - <p><a href="https://www.aakashweb.com/docs/super-rss-reader/faq/" target="_blank">FAQ</a> | <a href="https://www.aakashweb.com/forum/discuss/wordpress-plugins/super-rss-reader/" target="_blank">Report issue</a> | <a href="https://wordpress.org/support/plugin/super-rss-reader/reviews/?rate=5#new-post" target="_blank">Rate 5 stars & review</a> | v<?php echo SRR_VERSION; ?></p>
369 + <p><a href="https://www.aakashweb.com/docs/super-rss-reader/" target="_blank">Docs</a> | <a href="https://www.aakashweb.com/forum/discuss/wordpress-plugins/super-rss-reader/" target="_blank">Report issue</a> | <a href="https://wordpress.org/support/plugin/super-rss-reader/reviews/?rate=5#new-post" target="_blank">Rate 5 stars & review</a> | v<?php echo SRR_VERSION; ?></p>
268 370 </div>
269 371
270 372 <?php
271 373 }
374 +
375 + public function tt( $text ){
376 + echo '<div class="srr_tt" tabindex="0"><span class="dashicons dashicons-editor-help"></span><span class="srr_tt_text"><span>' . $text . '</span></span></div>';
377 + }
378 +
272 379 }
273 380
274 381 ?>