Super RSS Reader - Version 3.0

Version Description

  • New: Plugin code is refactored.
  • New: Options are reorganized for easy configuration.
  • Fix: Minor UI changes.
  • Fix: Certain PHP notices on saving widget settings.
Download this release

Release Info

Developer vaakash
Plugin Icon 128x128 Super RSS Reader
Version 3.0
Comparing to
See all releases

Code changes from version 2.8 to 3.0

admin/css/style.css CHANGED
@@ -3,24 +3,21 @@
3
  margin: 15px 0;
4
  padding: 0 0 10px 0;
5
  }
6
- .srr_settings label{
7
- font-size: 12px;
8
- }
9
  .srr_settings td {
10
  padding: 5px 0;
11
  }
12
- .srr_smalltext{
13
  font-size: 11px;
14
  color: #666666;
15
  }
16
  .srr_coffee {
17
- border: 1px solid #4CAF50;
18
- border-radius: 3px;
19
- padding: 10px 220px 10px 60px;
20
- background: url(../images/coffee.svg) 12px 10px no-repeat;
21
  background-size: 7%;
22
  position: relative;
23
- margin: 20px 0px;
 
24
  }
25
  .srr_coffee p{
26
  margin: 0;
@@ -28,17 +25,14 @@
28
  }
29
  .srr_coffee_wrap{
30
  position: absolute;
31
- top: 12px;
32
- right: 5px;
33
- width: 205px;
34
  }
35
  .srr_coffee_wrap p{
36
  display: inline-block;
37
  }
38
  .srr_coffee_btn{
39
- height: 24px !important;
40
- font-size: 12px !important;
41
- vertical-align: middle !important;
42
  }
43
  .srr_note{
44
  border: 1px solid #FFD893;
@@ -48,6 +42,40 @@
48
  display: block;
49
  border-radius: 3px;
50
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  #available-widgets [id*="super_rss_reader"] .widget-title h3 {
52
  background-image: url(../images/super-rss-reader-sm.png);
53
  background-position: 94%;
3
  margin: 15px 0;
4
  padding: 0 0 10px 0;
5
  }
 
 
 
6
  .srr_settings td {
7
  padding: 5px 0;
8
  }
9
+ .srr_small_text{
10
  font-size: 11px;
11
  color: #666666;
12
  }
13
  .srr_coffee {
14
+ border: 1px solid #dfdfdf;
15
+ padding: 10px 240px 10px 60px;
16
+ background: #f9fff7 url(../images/coffee.svg) 12px no-repeat;
 
17
  background-size: 7%;
18
  position: relative;
19
+ margin: 20px -15px -1px -15px;
20
+ border-width: 1px 0;
21
  }
22
  .srr_coffee p{
23
  margin: 0;
25
  }
26
  .srr_coffee_wrap{
27
  position: absolute;
28
+ top: 11px;
29
+ right: 15px;
 
30
  }
31
  .srr_coffee_wrap p{
32
  display: inline-block;
33
  }
34
  .srr_coffee_btn{
35
+ margin-left: 5px !important;
 
 
36
  }
37
  .srr_note{
38
  border: 1px solid #FFD893;
42
  display: block;
43
  border-radius: 3px;
44
  }
45
+ .srr_survey p {
46
+ border: 1px solid #dfdfdf;
47
+ padding: 15px;
48
+ font-size: 12px;
49
+ background: #fffbe8;
50
+ margin: 0 -15px;
51
+ border-width: 1px 0;
52
+ }
53
+ .srr_survey p span{
54
+ background: #ffe660;
55
+ padding: 2px 5px;
56
+ border-radius: 3px;
57
+ margin: 0 5px 0 0;
58
+ }
59
+ .srr_survey .button-primary{
60
+ float: right;
61
+ margin: 10px 0 0 10px;
62
+ }
63
+ .srr_info{
64
+ border-bottom: 1px solid #dfdfdf;
65
+ margin: 0px -15px 20px -15px;
66
+ padding: 10px 15px;
67
+ background: #fafafa;
68
+ }
69
+ .srr_info p{
70
+ margin: 0;
71
+ }
72
+ .srr_info a{
73
+ text-decoration: none;
74
+ }
75
+ .srr_info a:hover {
76
+ text-decoration: underline;
77
+ }
78
+
79
  #available-widgets [id*="super_rss_reader"] .widget-title h3 {
80
  background-image: url(../images/super-rss-reader-sm.png);
81
  background-position: 94%;
includes/widget-admin.php ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contains WordPress widget class
4
+ *
5
+ */
6
+
7
+ class super_rss_reader_widget extends WP_Widget{
8
+
9
+ // Initialize
10
+ public function __construct(){
11
+ $widget_ops = array(
12
+ 'classname' => 'widget_super_rss_reader',
13
+ 'description' => 'Enhanced RSS feed reader widget with advanced features.'
14
+ );
15
+
16
+ $control_ops = array('width' => 500, 'height' => 500);
17
+ parent::__construct('super_rss_reader', 'Super RSS Reader', $widget_ops, $control_ops);
18
+ }
19
+
20
+ // Display the Widget
21
+ public function widget( $args, $instance ){
22
+
23
+ extract( $args );
24
+
25
+ if( empty( $instance[ 'title' ] ) ){
26
+ $title = '';
27
+ }else{
28
+ $title = $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title;
29
+ }
30
+
31
+ echo $before_widget . $title;
32
+
33
+ echo "\n" . '
34
+ <!-- Start - Super RSS Reader v' . SRR_VERSION . '-->
35
+ <div class="super-rss-reader-widget">' . "\n";
36
+
37
+ SRR_Widget::render_feed( $instance );
38
+
39
+ echo "\n" . '</div>
40
+ <!-- End - Super RSS Reader -->
41
+ ' . "\n";
42
+ echo $after_widget;
43
+
44
+ }
45
+
46
+ // Save settings
47
+ public function update( $new_instance, $old_instance ){
48
+
49
+ $instance = $old_instance;
50
+ $new_instance = wp_parse_args( $new_instance, SRR_Widget::default_settings() );
51
+
52
+ $instance[ 'title' ] = stripslashes( $new_instance['title'] );
53
+ $instance[ 'urls' ] = stripslashes( $new_instance['urls']) ;
54
+ $instance[ 'tab_titles' ] = stripslashes( $new_instance['tab_titles'] );
55
+
56
+ $instance[ 'count' ] = intval( $new_instance['count'] );
57
+ $instance[ 'show_date' ] = intval( $new_instance['show_date'] );
58
+ $instance[ 'show_desc' ] = intval( $new_instance['show_desc'] );
59
+ $instance[ 'show_author' ] = intval( $new_instance['show_author'] );
60
+ $instance[ 'show_thumb' ] = stripslashes( $new_instance['show_thumb'] );
61
+ $instance[ 'open_newtab' ] = intval( $new_instance['open_newtab'] );
62
+ $instance[ 'add_nofollow' ] = intval( $new_instance['add_nofollow'] );
63
+ $instance[ 'strip_desc' ] = intval( $new_instance['strip_desc'] );
64
+ $instance[ 'strip_title' ] = intval( $new_instance['strip_title'] );
65
+ $instance[ 'read_more' ] = stripslashes( $new_instance['read_more'] );
66
+ $instance[ 'rich_desc' ] = stripslashes( $new_instance['rich_desc'] );
67
+
68
+ $instance[ 'color_style' ] = stripslashes( $new_instance['color_style']);
69
+ $instance[ 'enable_ticker' ] = intval( $new_instance['enable_ticker']);
70
+ $instance[ 'visible_items' ] = intval( $new_instance['visible_items']);
71
+ $instance[ 'ticker_speed' ] = intval( $new_instance['ticker_speed']);
72
+
73
+ return $instance;
74
+ }
75
+
76
+ // Widget form
77
+ public function form( $instance ){
78
+
79
+ $instance = wp_parse_args((array) $instance, SRR_Widget::default_settings());
80
+
81
+ $title = htmlspecialchars($instance['title']);
82
+ $urls = htmlspecialchars($instance['urls']);
83
+ $tab_titles = htmlspecialchars($instance['tab_titles']);
84
+
85
+ $count = intval($instance['count']);
86
+ $show_date = intval($instance['show_date']);
87
+ $show_desc = intval($instance['show_desc']);
88
+ $show_author = intval($instance['show_author']);
89
+ $show_thumb = intval($instance['show_thumb']);
90
+ $open_newtab = intval($instance['open_newtab']);
91
+ $add_nofollow = intval($instance['add_nofollow']);
92
+ $strip_desc = intval($instance['strip_desc']);
93
+ $strip_title = intval($instance['strip_title']);
94
+ $read_more = htmlspecialchars($instance['read_more']);
95
+ $rich_desc = htmlspecialchars($instance['rich_desc']);
96
+
97
+ $color_style = stripslashes($instance['color_style']);
98
+ $enable_ticker = intval($instance['enable_ticker']);
99
+ $visible_items = intval($instance['visible_items']);
100
+ $ticker_speed = intval($instance['ticker_speed']);
101
+
102
+ // Replacing commas with new lines
103
+ $urls = str_replace( ',', "\n", $urls );
104
+ $tab_titles = str_replace( ',', "\n", $tab_titles );
105
+
106
+ ?>
107
+ <div class="srr_settings">
108
+ <table width="100%" height="72" border="0">
109
+ <tr>
110
+ <td width="13%" height="33"><label for="<?php echo $this->get_field_id('title'); ?>">Title</label></td>
111
+ <td width="87%"><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"/></td>
112
+ </tr>
113
+ <tr>
114
+ <td><label for="<?php echo $this->get_field_id('urls'); ?>">URL(s)</label></td>
115
+ <td><textarea id="<?php echo $this->get_field_id('urls');?>" name="<?php echo $this->get_field_name('urls'); ?>" class="widefat"><?php echo $urls; ?></textarea>
116
+ <small class="srr_small_text">Can enter multiple RSS/atom feed URLs in new line</small>
117
+ </td>
118
+ </tr>
119
+
120
+ <tr>
121
+ <td><label for="<?php echo $this->get_field_id('tab_titles'); ?>">Tab titles</label></td>
122
+ <td><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>
123
+ <small class="srr_small_text">Enter corresponding tab titles in new line.</small>
124
+ </td>
125
+ </tr>
126
+
127
+ </table>
128
+ </div>
129
+
130
+ <div class="srr_settings">
131
+ <h4>Settings</h4>
132
+ <table width="100%" border="0">
133
+ <tr height="30px">
134
+ <td width="7%"><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"' : ""; ?> /></td>
135
+ <td width="43%"><label for="<?php echo $this->get_field_id('show_desc'); ?>">Show Description</label></td>
136
+ <td width="7%"><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"' : ""; ?> /></td>
137
+ <td width="43%"><label for="<?php echo $this->get_field_id('show_date'); ?>">Show Date</label></td>
138
+ </tr>
139
+
140
+ <tr height="30px">
141
+ <td><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"' : ""; ?> /></td>
142
+ <td><label for="<?php echo $this->get_field_id('show_author'); ?>">Show Author</label></td>
143
+ <td><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"' : ""; ?> /></td>
144
+ <td><label for="<?php echo $this->get_field_id('show_thumb'); ?>">Show thumbnail if present</label></td>
145
+ </tr>
146
+
147
+ </table>
148
+
149
+ <h4></h4>
150
+
151
+ <table width="100%" border="0">
152
+ <tr height="30px">
153
+ <td width="7%"><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"' : ""; ?> /></td>
154
+ <td width="40%"><label for="<?php echo $this->get_field_id('rich_desc'); ?>">Enable full or rich description</label></td>
155
+ <td width="28%"><label for="<?php echo $this->get_field_id('count');?>">Total items to show:</label></td>
156
+ <td width="25%"><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"/></td>
157
+ </tr>
158
+
159
+ <tr height="30">
160
+ <td><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"' : ""; ?> /></td>
161
+ <td><label for="<?php echo $this->get_field_id('add_nofollow'); ?>">Add "no follow" attribute to links</label></td>
162
+ <td><label for="<?php echo $this->get_field_id('strip_desc');?>">Strip description characters:</label></td>
163
+ <td><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 charaters to be displayed. Use 0 to disable stripping"/> </td>
164
+ </tr>
165
+
166
+ <tr height="30">
167
+ <td><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"' : ""; ?> /></td>
168
+ <td><label for="<?php echo $this->get_field_id('open_newtab'); ?>">Open links in new tab</label></td>
169
+ <td><label for="<?php echo $this->get_field_id('read_more'); ?>">Read more text:</label></td>
170
+ <td><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"/></td>
171
+ </tr>
172
+
173
+ <tr height="30">
174
+ <td></td>
175
+ <td></td>
176
+ <td><label for="<?php echo $this->get_field_id('strip_title'); ?>">Strip title characters:</label></td>
177
+ <td><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 charaters to be displayed. Use 0 to disable stripping"/></td>
178
+ </tr>
179
+
180
+ </table>
181
+ </div>
182
+
183
+ <?php if( $rich_desc == 1 ): ?>
184
+ <span class="srr_note">Note: You have enabled "Full/Rich HTML" 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>
185
+ <?php endif; ?>
186
+
187
+ <div class="srr_settings">
188
+ <h4>Customization</h4>
189
+ <table width="100%" height="109" border="0">
190
+ <tr>
191
+ <td height="32"><label for="<?php echo $this->get_field_id('color_style');?>">Color theme: </label></td>
192
+ <td>
193
+ <?php
194
+ $color_themes = SRR_Widget::color_themes();
195
+ echo '<select name="' . $this->get_field_name('color_style') . '" id="' . $this->get_field_id('color_style') . '">';
196
+ foreach($color_themes as $k => $v){
197
+ echo '<option value="' . $v . '" ' . ($color_style == $v ? 'selected="selected"' : "") . '>' . $k . '</option>';
198
+ }
199
+ echo '</select>';
200
+ ?>
201
+ </td>
202
+ </tr>
203
+ <tr>
204
+ <td height="36"><label for="<?php echo $this->get_field_id('visible_items');?>">Widget height:</label></td>
205
+ <td><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/>
206
+ <small class="srr_small_text">Set value less than 20 to show visible feed items. Example: <b>5</b> items</small></br>
207
+ <small class="srr_small_text">Set value greater than 20 for fixed widget height. Example: <b>400</b> px</small></br>
208
+ </td>
209
+ </tr>
210
+ <tr>
211
+ <td height="33"><label for="<?php echo $this->get_field_id('enable_ticker'); ?>">Ticker animation:</label> </td>
212
+ <td><input id="<?php echo $this->get_field_id('enable_ticker'); ?>" type="checkbox" name="<?php echo $this->get_field_name('enable_ticker'); ?>" value="1" <?php echo $enable_ticker == "1" ? 'checked="checked"' : ""; ?> /></td>
213
+ </tr>
214
+ <tr>
215
+ <td height="36"><label for="<?php echo $this->get_field_id('ticker_speed');?>">Ticker speed: </label></td>
216
+ <td><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
217
+ </td>
218
+ </tr>
219
+ </table>
220
+ </div>
221
+
222
+ <div class="srr_coffee">
223
+ <p>Thank you for using Super RSS Reader. If you found it useful, please buy me a coffee !</p>
224
+ <div class="srr_coffee_wrap">
225
+ <select class="srr_coffee_amt">
226
+ <option value="6" selected="selected">$6</option>
227
+ <option value="7">$7</option>
228
+ <option value="8">$8</option>
229
+ <option value="9">$9</option>
230
+ <option value="10">$10</option>
231
+ <option value="11">$11</option>
232
+ <option value="12">$12</option>
233
+ <option value="13">$13</option>
234
+ <option value="14">$14</option>
235
+ <option value="15">$15</option>
236
+ <option value="">Custom</option>
237
+ </select>
238
+ <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>
239
+ </div>
240
+ </div>
241
+
242
+ <div class="srr_survey">
243
+ <p><a href="https://forms.gle/cvzQ7k2Lex5xZLDf9" class="button button-primary" target="_blank">Share a feature</a><span>Request feature</span> Want any feature you would like to see in Super RSS Reader plugin ? Please share your requirements and features in a quick form.</p>
244
+ </div>
245
+
246
+ <div class="srr_info">
247
+ <p><a href="https://www.aakashweb.com/docs/super-rss-reader-doc/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>
248
+ </div>
249
+
250
+ <?php
251
+ }
252
+ }
253
+
254
+ ?>
includes/widget.php ADDED
@@ -0,0 +1,285 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contains core logic for the widget
4
+ *
5
+ */
6
+
7
+ if( ! defined( 'ABSPATH' ) ) exit;
8
+
9
+ class SRR_Widget{
10
+
11
+ public static function init(){
12
+
13
+ add_action( 'widgets_init', array( __class__, 'init_widget' ) );
14
+
15
+ add_action( 'wp_enqueue_scripts', array( __class__, 'public_scripts' ) );
16
+
17
+ add_action( 'admin_enqueue_scripts', array( __class__, 'admin_scripts' ) );
18
+
19
+ }
20
+
21
+ public static function init_widget(){
22
+
23
+ register_widget( 'super_rss_reader_widget' );
24
+
25
+ }
26
+
27
+ public static function public_scripts(){
28
+
29
+ wp_enqueue_script( 'jquery-easy-ticker-js', SRR_URL . 'public/js/jquery.easy-ticker.min.js', array( 'jquery', 'super-rss-reader-js' ) );
30
+ wp_enqueue_script( 'super-rss-reader-js', SRR_URL . 'public/js/script.min.js', array( 'jquery' ) );
31
+ wp_enqueue_style( 'super-rss-reader-css', SRR_URL . 'public/css/style.min.css' );
32
+
33
+ }
34
+
35
+ public static function admin_scripts( $hook ){
36
+
37
+ if( $hook == 'widgets.php' ){
38
+ wp_enqueue_style( 'srr_admin_css', SRR_URL . 'admin/css/style.css' );
39
+ wp_enqueue_script( 'srr_admin_js', SRR_URL . 'admin/js/script.js' );
40
+ }
41
+
42
+ }
43
+
44
+ public static function default_settings(){
45
+ return array(
46
+ 'title' => '',
47
+ 'urls' => '',
48
+ 'tab_titles' => '',
49
+ 'count' => 5,
50
+ 'show_date' => 0,
51
+ 'show_desc' => 1,
52
+ 'show_author' => 0,
53
+ 'show_thumb' => 1,
54
+ 'open_newtab' => 1,
55
+ 'strip_desc' => 100,
56
+ 'add_nofollow' => 1,
57
+ 'read_more' => '[...]',
58
+ 'rich_desc' => 0 ,
59
+ 'color_style' => 'none',
60
+ 'enable_ticker' => 1,
61
+ 'visible_items' => 5,
62
+ 'strip_title' => 0,
63
+ 'ticker_speed' => 4,
64
+ );
65
+ }
66
+
67
+ public static function color_themes(){
68
+ return array(
69
+ 'No style' => 'none',
70
+ 'Grey' => 'grey',
71
+ 'Dark' => 'dark',
72
+ 'Orange' => 'orange',
73
+ 'Simple modern' => 'smodern'
74
+ );
75
+ }
76
+
77
+ public static function render_feed( $settings ){
78
+
79
+ $settings = wp_parse_args( $settings, self::default_settings() );
80
+
81
+ $urls = stripslashes( $settings['urls'] );
82
+ $tab_titles = stripslashes( $settings['tab_titles'] );
83
+ $count = intval( $settings['count'] );
84
+
85
+ $show_date = intval( $settings['show_date'] );
86
+ $show_desc = intval( $settings['show_desc'] );
87
+ $show_author = intval( $settings['show_author'] );
88
+ $show_thumb = stripslashes( $settings['show_thumb'] );
89
+ $open_newtab = intval( $settings['open_newtab'] );
90
+ $add_nofollow = intval( $settings['add_nofollow'] );
91
+ $strip_desc = intval( $settings['strip_desc'] );
92
+ $strip_title = intval( $settings['strip_title'] );
93
+ $read_more = htmlspecialchars( $settings['read_more'] );
94
+ $rich_desc = intval( $settings['rich_desc'] );
95
+
96
+ $color_theme = stripslashes( $settings['color_style'] );
97
+ $enable_ticker = intval( $settings['enable_ticker'] );
98
+ $visible_items = intval( $settings['visible_items'] );
99
+ $ticker_speed = intval( $settings['ticker_speed'] ) * 1000;
100
+
101
+ if( empty( $urls ) ){
102
+ return '';
103
+ }
104
+
105
+ $url_delim = strpos( $urls, ',' ) !== false ? ',' : "\n";
106
+ $tab_title_delim = strpos( $tab_titles, ',' ) !== false ? ',' : "\n";
107
+
108
+ $rand = array();
109
+ $url = explode( $url_delim, $urls );
110
+ $tab_title = explode( $tab_title_delim, $tab_titles );
111
+ $url_count = count( $url );
112
+
113
+ // Generating the tabs
114
+ if( $url_count > 1 ){
115
+ echo '<ul class="srr-tab-wrap srr-tab-style-' . $color_theme . ' srr-clearfix">';
116
+ for( $i=0; $i < $url_count; $i++ ){
117
+
118
+ // Get the Feed URL
119
+ $feed_url = trim( $url[$i] );
120
+ $rss = fetch_feed( $feed_url );
121
+ $rand[$i] = rand(100, 999);
122
+
123
+ if( !is_wp_error( $rss ) ){
124
+
125
+ if( isset( $tab_title[$i] ) && !empty( $tab_title[$i] ) ){
126
+ $rss_title = $tab_title[$i];
127
+ }else{
128
+ $rss_title = esc_attr( strip_tags( $rss->get_title() ) );
129
+ }
130
+
131
+ echo '<li data-tab="srr-tab-' . $rand[$i] . '">' . $rss_title . '</li>';
132
+ }else{
133
+ echo '<li data-tab="srr-tab-' . $rand[$i] . '">Error</li>';
134
+ }
135
+
136
+ }
137
+ echo '</ul>';
138
+ }
139
+
140
+ // Generating the feed items
141
+ for( $i=0; $i < $url_count; $i++ ){
142
+
143
+ // Get the Feed URL
144
+ $feed_url = trim( $url[$i] );
145
+ if( isset( $url[$i] ) ){
146
+ $rss = fetch_feed( $feed_url );
147
+ }else{
148
+ return '';
149
+ }
150
+
151
+ if( method_exists( $rss, 'enable_order_by_date' ) ){
152
+ $rss->enable_order_by_date( false );
153
+ }
154
+
155
+ // Check for feed errors
156
+ if (!is_wp_error( $rss ) ){
157
+ $max_items = $rss->get_item_quantity( $count );
158
+ $rss_items = $rss->get_items( 0, $max_items );
159
+ $rss_title = esc_attr( strip_tags( $rss->get_title() ) );
160
+ $rss_desc = esc_attr( strip_tags( $rss->get_description() ) );
161
+ }else{
162
+ echo '<div class="srr-wrap srr-style-' . $color_theme .'" data-id="srr-tab-' . $rand[$i] . '"><p>RSS Error: ' . $rss->get_error_message() . '</p></div>';
163
+ continue;
164
+ }
165
+
166
+ $randAttr = isset($rand[$i]) ? ' data-id="srr-tab-' . $rand[$i] . '" ' : '';
167
+
168
+ // Outer Wrap start
169
+ echo '<div class="srr-wrap ' . (($enable_ticker == 1 ) ? 'srr-vticker' : '' ) . ' srr-style-' . $color_theme . '" data-visible="' . $visible_items . '" data-speed="' . $ticker_speed . '"' . $randAttr . '><div>';
170
+
171
+ // Check feed items
172
+ if ($max_items == 0){
173
+ echo '<div>No items.</div>';
174
+ }else{
175
+ $j=1;
176
+ // Loop through each feed item
177
+ foreach ($rss_items as $item){
178
+
179
+ // Getting link
180
+ $link = $item->get_link();
181
+ while ( stristr( $link, 'http' ) != $link ){ $link = substr( $link, 1 ); }
182
+ $link = esc_url(strip_tags($link));
183
+
184
+ // Getting title
185
+ $title = esc_attr(strip_tags($item->get_title()));
186
+ if ( empty($title) )
187
+ $title = __('No Title');
188
+
189
+ if( $strip_title != 0 ){
190
+ $titleLen = strlen($title);
191
+ $title = wp_html_excerpt( $title, $strip_title );
192
+ $title = ($titleLen > $strip_title) ? $title . ' ...' : $title;
193
+ }
194
+
195
+ // Open links in new tab
196
+ $new_tab = ($open_newtab) ? ' target="_blank"' : '';
197
+
198
+ // Add no follow attribute
199
+ $no_follow = ($add_nofollow) ? ' rel="nofollow"' : '';
200
+
201
+ // Getting date
202
+ $date = $item->get_date('j F Y');
203
+
204
+ // Getting thumbnail if present @since v2.2
205
+ $thumb = '';
206
+ if ($show_thumb == 1 && $enclosure = $item->get_enclosure()){
207
+ $thumb_url = $enclosure->get_thumbnail();
208
+ if(!empty($thumb_url))
209
+ $thumb = '<img src="' . $thumb_url . '" alt="' . $title . '" class="srr-thumb" align="left"/>';
210
+ }
211
+
212
+ // Getting description
213
+ $desc = '';
214
+ if( $rich_desc == 1 ){
215
+ $desc = strip_tags( str_replace( 'eval', '', $item->get_description() ) , '<p><a><img><em><strong><font><strike><s><u><i>');
216
+
217
+ }else{
218
+ $read_more = '';
219
+ $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) );
220
+ if($strip_desc != 0){
221
+ $desc = wp_html_excerpt( $desc, $strip_desc );
222
+ $read_more = ( !empty( $read_more ) ) ? '<a href="' . $link . '" title="Read more"' . $new_tab . $no_follow . '>' . $read_more . '</a>' : '';
223
+
224
+ if ( '[...]' == substr( $desc, -5 ) )
225
+ $desc = substr( $desc, 0, -5 );
226
+ elseif ( '[&hellip;]' != substr( $desc, -10 ) )
227
+ $desc .= '';
228
+
229
+ $desc = esc_html( $desc );
230
+ }
231
+
232
+ $desc = $thumb . $desc . ' ' . $read_more;
233
+
234
+ }
235
+
236
+ // Getting the author
237
+ $author = $item->get_author();
238
+ if ( is_object($author) ) {
239
+ $author = $author->get_name();
240
+ $author = esc_html(strip_tags($author));
241
+ }
242
+
243
+ echo "\n\t";
244
+
245
+ // Display the feed items
246
+ echo '<div class="srr-item ' . (($j%2 == 0) ? 'even' : 'odd') . '">';
247
+ echo '<div class="srr-title"><a href="' . $link . '"' . $new_tab . $no_follow . ' title="Posted on ' . $date . '">' . $title . '</a></div>';
248
+ echo '<div class="srr-meta">';
249
+
250
+ if($show_date && !empty($date))
251
+ echo '<time class="srr-date">' . $date . '</time>';
252
+
253
+ if($show_author && !empty($author))
254
+ echo ' - <cite class="srr-author">' . $author . '</cite>';
255
+
256
+ echo '</div>';
257
+
258
+ if($show_desc)
259
+ echo '<p class="srr-summary srr-clearfix">' . $desc . '</p>';
260
+
261
+ echo '</div>';
262
+ // End display
263
+
264
+ $j++;
265
+ }
266
+ }
267
+
268
+ // Outer wrap end
269
+ echo "\n\n</div>
270
+ </div>\n\n" ;
271
+
272
+ if ( !is_wp_error($rss) )
273
+ $rss->__destruct();
274
+
275
+ unset($rss);
276
+
277
+ }
278
+
279
+ }
280
+
281
+ }
282
+
283
+ SRR_Widget::init();
284
+
285
+ ?>
readme.txt CHANGED
@@ -1,20 +1,20 @@
1
- === Super RSS Reader ===
2
  Contributors: vaakash
3
  Author URI: https://www.aakashweb.com/
4
  Plugin URI: https://www.aakashweb.com/wordpress-plugins/super-rss-reader/
5
- Tags: rss, feeds, widget, ticker, feed, twitter, admin, plugin, posts, page, thumbnail, atom, jquery
6
  License: GPLv2 or later
7
  Donate Link: https://www.paypal.me/vaakash
8
  Requires at least: 2.8
9
  Requires PHP: 5.3
10
- Tested up to: 5.3.2
11
- Stable tag: 2.8
12
 
13
- An RSS widget plugin to display feeds with news ticker effect in multiple tabbed feeds, thumbnails, customizable color themes and more
14
 
15
  == Description ==
16
 
17
- Super RSS Reader is jQuery based RSS reader widget, which displays the RSS feeds in the widget in an attractive way. It uses the jQuery easy ticker plugin to add a news ticker like effect to the RSS feeds. Multiple RSS feeds can be added for a single widget and they get separated in tabs.
18
 
19
  The plugin is fully customizable with external styles and with some inbuilt color styles. It acts as a perfect replacement for the default RSS widget in WordPress.
20
 
@@ -22,7 +22,7 @@ The plugin is fully customizable with external styles and with some inbuilt colo
22
 
23
  = Features =
24
 
25
- * jQuery [news ticker like effect](https://www.aakashweb.com/jquery-plugins/easy-ticker/) to the RSS feeds (can turn off or on)
26
  * Display feeds in **multiple tabs**
27
  * Display **thumbnail** to the feed items if available.
28
  * Select **color themes** for widget. Customizable via CSS.
@@ -34,9 +34,8 @@ The plugin is fully customizable with external styles and with some inbuilt colo
34
 
35
  = Resources =
36
 
37
- * [Documentation](https://www.aakashweb.com/docs/super-rss-reader-doc/)
38
  * [FAQs](https://www.aakashweb.com/docs/super-rss-reader-doc/faq/)
39
- * [Support/Report bugs](https://www.aakashweb.com/forum/discuss/wordpress-plugins/super-rss-reader/)
40
 
41
  == Installation ==
42
 
@@ -77,7 +76,7 @@ No, Super RSS Reader only supports vertical support feature for now.
77
 
78
  = How to create a tabbed mode or multiple feeds ? =
79
 
80
- Just enter the RSS feed URLs seperated by comma in the widget, the plugin automatically renders the tab.
81
 
82
  = What fields are shown in the feed output by default ? =
83
 
@@ -98,8 +97,14 @@ The size of the ticker library is only 2.74 KB.
98
 
99
  == Changelog ==
100
 
 
 
 
 
 
 
101
  = 2.8 =
102
- * New: jQuery ticker script is not loaded locally.
103
  * Fix: Minor style adjustments to the admin widget.
104
 
105
  = 2.7 =
@@ -124,7 +129,7 @@ The size of the ticker library is only 2.74 KB.
124
  * Added a new 'Simple modern' color style.
125
 
126
  = 2.3 =
127
- * Fixed imcompatibility of other jQuery plugins due to the usage of the latest version of jQuery.
128
 
129
  = 2.2 =
130
  * Displays "thumbnail" of the feed item if available.
@@ -157,4 +162,4 @@ Version 2.0 is a major and recommended upgrade for previous version users.
157
  == Credits ==
158
 
159
  * RSS feed reading engine is the inbuilt WordPress's engine
160
- * The news ticker effect is powered by the [jQuery Easy ticker plugin](https://www.aakashweb.com/jquery-plugins/easy-ticker/)
1
+ === Super RSS Reader - Add attractive RSS Feed Widget ===
2
  Contributors: vaakash
3
  Author URI: https://www.aakashweb.com/
4
  Plugin URI: https://www.aakashweb.com/wordpress-plugins/super-rss-reader/
5
+ Tags: rss, feeds, widget, ticker, feed, twitter, admin, plugin, posts, page, thumbnail, atom, news
6
  License: GPLv2 or later
7
  Donate Link: https://www.paypal.me/vaakash
8
  Requires at least: 2.8
9
  Requires PHP: 5.3
10
+ Tested up to: 5.4
11
+ Stable tag: 3.0
12
 
13
+ A plugin to display RSS feed(s) in widget with news ticker effect in multiple tabbed feeds, thumbnails, customizable color themes and more.
14
 
15
  == Description ==
16
 
17
+ Super RSS Reader is a RSS reader widget which displays the RSS feeds in an attractive way. It displays the multiple RSS feeds and adds a news ticker like effect to them. Multiple RSS feeds can be added to a single widget in separate tabs.
18
 
19
  The plugin is fully customizable with external styles and with some inbuilt color styles. It acts as a perfect replacement for the default RSS widget in WordPress.
20
 
22
 
23
  = Features =
24
 
25
+ * **News ticker** like effect to the RSS feeds (can turn off or on)
26
  * Display feeds in **multiple tabs**
27
  * Display **thumbnail** to the feed items if available.
28
  * Select **color themes** for widget. Customizable via CSS.
34
 
35
  = Resources =
36
 
 
37
  * [FAQs](https://www.aakashweb.com/docs/super-rss-reader-doc/faq/)
38
+ * [Support forum](https://www.aakashweb.com/forum/discuss/wordpress-plugins/super-rss-reader/)
39
 
40
  == Installation ==
41
 
76
 
77
  = How to create a tabbed mode or multiple feeds ? =
78
 
79
+ Just enter the RSS feed URLs separated by comma in the widget, the plugin automatically renders the tab.
80
 
81
  = What fields are shown in the feed output by default ? =
82
 
97
 
98
  == Changelog ==
99
 
100
+ = 3.0 =
101
+ * New: Plugin code is refactored.
102
+ * New: Options are reorganized for easy configuration.
103
+ * Fix: Minor UI changes.
104
+ * Fix: Certain PHP notices on saving widget settings.
105
+
106
  = 2.8 =
107
+ * New: jQuery ticker script is now loaded locally.
108
  * Fix: Minor style adjustments to the admin widget.
109
 
110
  = 2.7 =
129
  * Added a new 'Simple modern' color style.
130
 
131
  = 2.3 =
132
+ * Fixed incompatibility of other jQuery plugins due to the usage of the latest version of jQuery.
133
 
134
  = 2.2 =
135
  * Displays "thumbnail" of the feed item if available.
162
  == Credits ==
163
 
164
  * RSS feed reading engine is the inbuilt WordPress's engine
165
+ * The news ticker effect is powered by [jQuery Easy ticker plugin](https://www.aakashweb.com/jquery-plugins/easy-ticker/)
super-rss-reader.php CHANGED
@@ -5,491 +5,41 @@
5
  * Author URI: https://www.aakashweb.com/
6
  * Description: Super RSS Reader is jQuery based RSS reader widget, which displays the RSS feeds in the widget in an attractive way. It uses the jQuery easy ticker plugin to add a news ticker like effect to the RSS feeds. Multiple RSS feeds can be added for a single widget and they get separated in tabs.
7
  * Author: Aakash Chakravarthy
8
- * Version: 2.8
 
 
 
9
  */
10
 
11
- define('SRR_VERSION', '2.8');
12
- define('SRR_URL', plugin_dir_url( __FILE__ ));
 
13
 
14
- // Include the required scripts & styles
15
- function srr_public_scripts(){
16
- wp_enqueue_script('jquery-easy-ticker-js', SRR_URL . 'public/js/jquery.easy-ticker.min.js', array( 'jquery', 'super-rss-reader-js' ));
17
- wp_enqueue_script('super-rss-reader-js', SRR_URL . 'public/js/script.min.js', array( 'jquery' ));
18
- wp_enqueue_style('super-rss-reader-css', SRR_URL . 'public/css/style.min.css');
19
- }
20
- add_action('wp_enqueue_scripts', 'srr_public_scripts');
21
 
22
- // Default color styles
23
- function srr_color_styles(){
24
- return array(
25
- 'No style' => 'none',
26
- 'Grey' => 'grey',
27
- 'Dark' => 'dark',
28
- 'Orange' => 'orange',
29
- 'Simple modern' => 'smodern'
30
- );
31
- }
32
 
33
- function srr_defaults(){
34
- return array(
35
- 'title' => '',
36
- 'urls' => '',
37
- 'tab_titles' => '',
38
- 'count' => 5,
39
- 'show_date' => 0,
40
- 'show_desc' => 1,
41
- 'show_author' => 0,
42
- 'show_thumb' => 1,
43
- 'open_newtab' => 1,
44
- 'strip_desc' => 100,
45
- 'add_nofollow' => 1,
46
- 'read_more' => '[...]',
47
- 'rich_desc' => 0 ,
48
- 'color_style' => 'none',
49
- 'enable_ticker' => 1,
50
- 'visible_items' => 5,
51
- 'strip_title' => 0,
52
- 'ticker_speed' => 4,
53
- );
54
- }
55
 
56
- // The main RSS Parser
57
- function srr_rss_parser($instance){
58
-
59
- $instance = wp_parse_args($instance, srr_defaults());
60
-
61
- $urls = stripslashes($instance['urls']);
62
- $tab_titles = stripslashes($instance['tab_titles']);
63
- $count = intval($instance['count']);
64
-
65
- $show_date = intval($instance['show_date']);
66
- $show_desc = intval($instance['show_desc']);
67
- $show_author = intval($instance['show_author']);
68
- $show_thumb = stripslashes($instance['show_thumb']);
69
- $open_newtab = intval($instance['open_newtab']);
70
- $add_nofollow = intval($instance['add_nofollow']);
71
- $strip_desc = intval($instance['strip_desc']);
72
- $strip_title = intval($instance['strip_title']);
73
- $read_more = htmlspecialchars($instance['read_more']);
74
- $rich_desc = intval($instance['rich_desc']);
75
-
76
- $color_style = stripslashes($instance['color_style']);
77
- $enable_ticker = intval($instance['enable_ticker']);
78
- $visible_items = intval($instance['visible_items']);
79
- $ticker_speed = intval($instance['ticker_speed']) * 1000;
80
-
81
- if(empty($urls)){
82
- return '';
83
- }
84
-
85
- $rand = array();
86
- $url = explode(',', $urls);
87
- $tab_title = explode(',', $tab_titles);
88
- $ucount = count($url);
89
-
90
- // Generate the Tabs
91
- if($ucount > 1){
92
- echo '<ul class="srr-tab-wrap srr-tab-style-' . $color_style . ' srr-clearfix">';
93
- for( $i=0; $i < $ucount; $i++ ){
94
- // Get the Feed URL
95
- $feedUrl = trim( $url[$i] );
96
- $rss = fetch_feed( $feedUrl );
97
- $rand[$i] = rand(0, 999);
98
-
99
- if (!is_wp_error($rss)){
100
-
101
- if( isset( $tab_title[$i] ) && !empty( $tab_title[$i]) ){
102
- $rss_title = $tab_title[$i];
103
- }else{
104
- $rss_title = esc_attr(strip_tags($rss->get_title()));
105
- }
106
-
107
- echo '<li data-tab="srr-tab-' . $rand[$i] . '">' . $rss_title . '</li>';
108
- }else{
109
- echo '<li data-tab="srr-tab-' . $rand[$i] . '">Error</li>';
110
- }
111
-
112
- }
113
- echo '</ul>';
114
- }
115
-
116
- for($i=0; $i<$ucount; $i++){
117
- // Get the Feed URL
118
- $feedUrl = trim($url[$i]);
119
- if(isset($url[$i])){
120
- $rss = fetch_feed($feedUrl);
121
- }else{
122
- return '';
123
- }
124
-
125
- if( method_exists( $rss, 'enable_order_by_date' ) ){
126
- $rss->enable_order_by_date(false);
127
- }
128
-
129
- // Check for feed errors
130
- if (!is_wp_error( $rss ) ){
131
- $maxitems = $rss->get_item_quantity($count);
132
- $rss_items = $rss->get_items(0, $maxitems);
133
- $rss_title = esc_attr(strip_tags($rss->get_title()));
134
- $rss_desc = esc_attr(strip_tags($rss->get_description()));
135
- }else{
136
- echo '<div class="srr-wrap srr-style-' . $color_style .'" data-id="srr-tab-' . $rand[$i] . '"><p>RSS Error: ' . $rss->get_error_message() . '</p></div>';
137
- continue;
138
- }
139
-
140
- $randAttr = isset($rand[$i]) ? ' data-id="srr-tab-' . $rand[$i] . '" ' : '';
141
-
142
- // Outer Wrap start
143
- echo '<div class="srr-wrap ' . (($enable_ticker == 1 ) ? 'srr-vticker' : '' ) . ' srr-style-' . $color_style . '" data-visible="' . $visible_items . '" data-speed="' . $ticker_speed . '"' . $randAttr . '><div>';
144
-
145
- // Check feed items
146
- if ($maxitems == 0){
147
- echo '<div>No items.</div>';
148
- }else{
149
- $j=1;
150
- // Loop through each feed item
151
- foreach ($rss_items as $item){
152
- // Get the link
153
- $link = $item->get_link();
154
- while ( stristr($link, 'http') != $link ){ $link = substr($link, 1); }
155
- $link = esc_url(strip_tags($link));
156
-
157
- // Get the item title
158
- $title = esc_attr(strip_tags($item->get_title()));
159
- if ( empty($title) )
160
- $title = __('No Title');
161
-
162
- if( $strip_title != 0 ){
163
- $titleLen = strlen($title);
164
- $title = wp_html_excerpt( $title, $strip_title );
165
- $title = ($titleLen > $strip_title) ? $title . ' ...' : $title;
166
- }
167
-
168
- // Open links in new tab
169
- $newtab = ($open_newtab) ? ' target="_blank"' : '';
170
-
171
- // Add no follow attribute
172
- $nofollow = ($add_nofollow) ? ' rel="nofollow"' : '';
173
-
174
- // Get the date
175
- $date = $item->get_date('j F Y');
176
-
177
- // Get thumbnail if present @since v2.2
178
- $thumb = '';
179
- if ($show_thumb == 1 && $enclosure = $item->get_enclosure()){
180
- $thumburl = $enclosure->get_thumbnail();
181
- if(!empty($thumburl))
182
- $thumb = '<img src="' . $thumburl . '" alt="' . $title . '" class="srr-thumb" align="left"/>';
183
- }
184
-
185
- // Get the description
186
- $desc = '';
187
- if( $rich_desc == 1 ){
188
- $desc = strip_tags( str_replace( 'eval', '', $item->get_description() ) , '<p><a><img><em><strong><font><strike><s><u><i>');
189
 
190
- }else{
191
- $rmore = '';
192
- $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) );
193
- if($strip_desc != 0){
194
- $desc = wp_html_excerpt( $desc, $strip_desc );
195
- $rmore = (!empty($read_more)) ? '<a href="' . $link . '" title="Read more"' . $newtab . $nofollow . '>' . $read_more . '</a>' : '';
196
-
197
- if ( '[...]' == substr( $desc, -5 ) )
198
- $desc = substr( $desc, 0, -5 );
199
- elseif ( '[&hellip;]' != substr( $desc, -10 ) )
200
- $desc .= '';
201
-
202
- $desc = esc_html( $desc );
203
- }
204
-
205
- $desc = $thumb . $desc . ' ' . $rmore;
206
-
207
- }
208
-
209
- // Get the author
210
- $author = $item->get_author();
211
- if ( is_object($author) ) {
212
- $author = $author->get_name();
213
- $author = esc_html(strip_tags($author));
214
- }
215
-
216
- echo "\n\n\t";
217
-
218
- // Display the feed items
219
- echo '<div class="srr-item ' . (($j%2 == 0) ? 'even' : 'odd') . '">';
220
- echo '<div class="srr-title"><a href="' . $link . '"' . $newtab . $nofollow . ' title="Posted on ' . $date . '">' . $title . '</a></div>';
221
- echo '<div class="srr-meta">';
222
-
223
- if($show_date && !empty($date))
224
- echo '<time class="srr-date">' . $date . '</time>';
225
-
226
- if($show_author && !empty($author))
227
- echo ' - <cite class="srr-author">' . $author . '</cite>';
228
-
229
- echo '</div>';
230
-
231
- if($show_desc)
232
- echo '<p class="srr-summary srr-clearfix">' . $desc . '</p>';
233
-
234
- echo '</div>';
235
- // End display
236
-
237
- $j++;
238
- }
239
- }
240
-
241
- // Outer wrap end
242
- echo "\n\n</div>
243
- </div> \n\n" ;
244
-
245
- if ( ! is_wp_error($rss) )
246
- $rss->__destruct();
247
-
248
- unset($rss);
249
-
250
  }
251
- }
252
 
253
- class super_rss_reader_widget extends WP_Widget{
254
- // Initialize
255
- public function __construct(){
256
- $widget_ops = array(
257
- 'classname' => 'widget_super_rss_reader',
258
- 'description' => 'Enhanced RSS feed reader widget with advanced features.'
259
- );
260
-
261
- $control_ops = array('width' => 500, 'height' => 500);
262
- parent::__construct('super_rss_reader', 'Super RSS Reader', $widget_ops, $control_ops);
263
- }
264
-
265
- // Display the Widget
266
- public function widget($args, $instance){
267
- extract($args);
268
- if(empty($instance['title'])){
269
- $title = '';
270
- }else{
271
- $title = $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
272
- }
273
-
274
- echo $before_widget . $title;
275
- echo "\n" . '
276
- <!-- Start - Super RSS Reader v' . SRR_VERSION . '-->
277
- <div class="super-rss-reader-widget">' . "\n";
278
-
279
- srr_rss_parser($instance);
280
-
281
- echo "\n" . '</div>
282
- <!-- End - Super RSS Reader -->
283
- ' . "\n";
284
- echo $after_widget;
285
- }
286
-
287
- // Save settings
288
- public function update($new_instance, $old_instance){
289
- $instance = $old_instance;
290
- $instance['title'] = stripslashes($new_instance['title']);
291
- $instance['urls'] = stripslashes($new_instance['urls']);
292
- $instance['tab_titles'] = stripslashes($new_instance['tab_titles']);
293
-
294
- $instance['count'] = intval($new_instance['count']);
295
- $instance['show_date'] = intval($new_instance['show_date']);
296
- $instance['show_desc'] = intval($new_instance['show_desc']);
297
- $instance['show_author'] = intval($new_instance['show_author']);
298
- $instance['show_thumb'] = stripslashes($new_instance['show_thumb']);
299
- $instance['open_newtab'] = intval($new_instance['open_newtab']);
300
- $instance['add_nofollow'] = intval($new_instance['add_nofollow']);
301
- $instance['strip_desc'] = intval($new_instance['strip_desc']);
302
- $instance['strip_title'] = intval($new_instance['strip_title']);
303
- $instance['read_more'] = stripslashes($new_instance['read_more']);
304
- $instance['rich_desc'] = stripslashes($new_instance['rich_desc']);
305
-
306
- $instance['color_style'] = stripslashes($new_instance['color_style']);
307
- $instance['enable_ticker'] = intval($new_instance['enable_ticker']);
308
- $instance['visible_items'] = intval($new_instance['visible_items']);
309
- $instance['ticker_speed'] = intval($new_instance['ticker_speed']);
310
-
311
- return $instance;
312
- }
313
-
314
- // Widget form
315
- public function form($instance){
316
-
317
- $instance = wp_parse_args((array) $instance, srr_defaults());
318
-
319
- $title = htmlspecialchars($instance['title']);
320
- $urls = htmlspecialchars($instance['urls']);
321
- $tab_titles = htmlspecialchars($instance['tab_titles']);
322
-
323
- $count = intval($instance['count']);
324
- $show_date = intval($instance['show_date']);
325
- $show_desc = intval($instance['show_desc']);
326
- $show_author = intval($instance['show_author']);
327
- $show_thumb = intval($instance['show_thumb']);
328
- $open_newtab = intval($instance['open_newtab']);
329
- $add_nofollow = intval($instance['add_nofollow']);
330
- $strip_desc = intval($instance['strip_desc']);
331
- $strip_title = intval($instance['strip_title']);
332
- $read_more = htmlspecialchars($instance['read_more']);
333
- $rich_desc = htmlspecialchars($instance['rich_desc']);
334
-
335
- $color_style = stripslashes($instance['color_style']);
336
- $enable_ticker = intval($instance['enable_ticker']);
337
- $visible_items = intval($instance['visible_items']);
338
- $ticker_speed = intval($instance['ticker_speed']);
339
-
340
- ?>
341
- <div class="srr_settings">
342
- <table width="100%" height="72" border="0">
343
- <tr>
344
- <td width="13%" height="33"><label for="<?php echo $this->get_field_id('title'); ?>">Title: </label></td>
345
- <td width="87%"><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"/></td>
346
- </tr>
347
- <tr>
348
- <td><label for="<?php echo $this->get_field_id('urls'); ?>">URLs: </label></td>
349
- <td><input id="<?php echo $this->get_field_id('urls');?>" name="<?php echo $this->get_field_name('urls'); ?>" type="text" value="<?php echo $urls; ?>" class="widefat"/>
350
- <small class="srr_smalltext">Can enter multiple RSS/atom feed URLs seperated by a comma.</small>
351
- </td>
352
- </tr>
353
-
354
- <tr>
355
- <td><label for="<?php echo $this->get_field_id('tab_titles'); ?>">Tab titles: </label></td>
356
- <td><input id="<?php echo $this->get_field_id('tab_titles');?>" name="<?php echo $this->get_field_name('tab_titles'); ?>" type="text" value="<?php echo $tab_titles; ?>" class="widefat"/>
357
- <small class="srr_smalltext">Enter corresponding tab titles seperated by a comma.</small>
358
- </td>
359
- </tr>
360
-
361
- </table>
362
- </div>
363
-
364
- <div class="srr_settings">
365
- <h4>Settings</h4>
366
- <table width="100%" border="0">
367
- <tr>
368
- <td width="7%" height="28"><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"' : ""; ?> /></td>
369
- <td width="40%"><label for="<?php echo $this->get_field_id('show_desc'); ?>">Show Description</label></td>
370
- <td width="28%"><label for="<?php echo $this->get_field_id('count');?>">Total items to show:</label></td>
371
- <td width="25%"><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"/></td>
372
- </tr>
373
- <tr>
374
- <td height="32"><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"' : ""; ?> /></td>
375
- <td><label for="<?php echo $this->get_field_id('show_date'); ?>">Show Date</label></td>
376
- <td><label for="<?php echo $this->get_field_id('strip_desc');?>">Strip description characters:</label></td>
377
- <td><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 charaters to be displayed. Use 0 to disable stripping"/> </td>
378
- </tr>
379
- <tr>
380
- <td height="29"><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"' : ""; ?> /></td>
381
- <td><label for="<?php echo $this->get_field_id('show_author'); ?>">Show Author</label></td>
382
- <td><label for="<?php echo $this->get_field_id('strip_title'); ?>">Strip title characters:</label></td>
383
- <td><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 charaters to be displayed. Use 0 to disable stripping"/></td>
384
- </tr>
385
- <tr>
386
- <td height="29"><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"' : ""; ?> /></td>
387
- <td><label for="<?php echo $this->get_field_id('open_newtab'); ?>">Open links in new tab</label></td>
388
- <td><label for="<?php echo $this->get_field_id('read_more'); ?>">Read more text:</label></td>
389
- <td><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"/></td>
390
- </tr>
391
- <tr>
392
- <td height="29"><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"' : ""; ?> /></td>
393
- <td><label for="<?php echo $this->get_field_id('show_thumb'); ?>">Show thumbnail if present</label></td>
394
- <td>&nbsp;</td>
395
- <td>&nbsp;</td>
396
- </tr>
397
-
398
- <tr>
399
- <td height="29"><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"' : ""; ?> /></td>
400
- <td><label for="<?php echo $this->get_field_id('rich_desc'); ?>">Enable full or rich description</label></td>
401
- <td>&nbsp;</td>
402
- <td>&nbsp;</td>
403
- </tr>
404
-
405
- <tr>
406
- <td height="29"><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"' : ""; ?> /></td>
407
- <td><label for="<?php echo $this->get_field_id('add_nofollow'); ?>">Add "no follow" attribute to links</label></td>
408
- <td>&nbsp;</td>
409
- <td>&nbsp;</td>
410
- </tr>
411
-
412
- </table>
413
- </div>
414
-
415
- <?php if( $rich_desc == 1 ): ?>
416
- <span class="srr_note">Note: You have enabled "Full/Rich HTML" Please make sure that the feed(s) are from trusted sources and do not contain any harmful scripts. If there are some aligment issues in the description, please use custom CSS to fix that. </span>
417
- <?php endif; ?>
418
-
419
- <div class="srr_settings">
420
- <h4>Other settings</h4>
421
- <table width="100%" height="109" border="0">
422
- <tr>
423
- <td height="32"><label for="<?php echo $this->get_field_id('color_style');?>">Color style: </label></td>
424
- <td>
425
- <?php
426
- $color_styles = srr_color_styles();
427
- echo '<select name="' . $this->get_field_name('color_style') . '" id="' . $this->get_field_id('color_style') . '">';
428
- foreach($color_styles as $k => $v){
429
- echo '<option value="' . $v . '" ' . ($color_style == $v ? 'selected="selected"' : "") . '>' . $k . '</option>';
430
- }
431
- echo '</select>';
432
- ?>
433
- </td>
434
- </tr>
435
- <tr>
436
- <td height="36"><label for="<?php echo $this->get_field_id('visible_items');?>">Widget height:</label></td>
437
- <td><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/>
438
- <small>Set value less than 20 to show visible feed items. Example: <b>5</b> items</small></br>
439
- <small>Set value greater than 20 for fixed widget height. Example: <b>400</b> px</small></br>
440
- </td>
441
- </tr>
442
- <tr>
443
- <td height="33"><label for="<?php echo $this->get_field_id('enable_ticker'); ?>">Ticker animation:</label> </td>
444
- <td><input id="<?php echo $this->get_field_id('enable_ticker'); ?>" type="checkbox" name="<?php echo $this->get_field_name('enable_ticker'); ?>" value="1" <?php echo $enable_ticker == "1" ? 'checked="checked"' : ""; ?> /></td>
445
- </tr>
446
- <tr>
447
- <td height="36"><label for="<?php echo $this->get_field_id('ticker_speed');?>">Ticker speed: </label></td>
448
- <td><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
449
- </td>
450
- </tr>
451
- </table>
452
- </div>
453
-
454
- <div class="srr_coffee">
455
- <p>Thank you for using Super RSS Reader. If you found it useful, please buy me a coffee !</p>
456
- <div class="srr_coffee_wrap">
457
- <select class="srr_coffee_amt">
458
- <option value="2">$2</option>
459
- <option value="3">$3</option>
460
- <option value="4">$4</option>
461
- <option value="5">$5</option>
462
- <option value="6" selected="selected">$6</option>
463
- <option value="7">$7</option>
464
- <option value="8">$8</option>
465
- <option value="9">$9</option>
466
- <option value="10">$10</option>
467
- <option value="11">$11</option>
468
- <option value="12">$12</option>
469
- <option value="">Custom</option>
470
- </select>
471
- <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>
472
- </div>
473
- </div>
474
-
475
- <p><a href="https://www.aakashweb.com/docs/super-rss-reader-doc/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>
476
-
477
- <?php
478
  }
479
- }
480
 
481
- function super_rss_reader_init(){
482
- register_widget('super_rss_reader_widget');
483
- }
484
- add_action('widgets_init', 'super_rss_reader_init');
485
 
 
486
 
487
- function srr_admin_scripts( $hook ){
488
- if( $hook == 'widgets.php' ){
489
- wp_enqueue_style( 'srr_admin_css', SRR_URL . 'admin/css/style.css' );
490
- wp_enqueue_script( 'srr_admin_js', SRR_URL . 'admin/js/script.js' );
491
  }
 
492
  }
493
- add_action( 'admin_enqueue_scripts', 'srr_admin_scripts' );
 
494
 
495
  ?>
5
  * Author URI: https://www.aakashweb.com/
6
  * Description: Super RSS Reader is jQuery based RSS reader widget, which displays the RSS feeds in the widget in an attractive way. It uses the jQuery easy ticker plugin to add a news ticker like effect to the RSS feeds. Multiple RSS feeds can be added for a single widget and they get separated in tabs.
7
  * Author: Aakash Chakravarthy
8
+ * Author URI: https://www.aakashweb.com/
9
+ * Version: 3.0
10
+ * Text Domain: super-rss-reader
11
+ * Domain Path: /languages
12
  */
13
 
14
+ define( 'SRR_VERSION', '3.0' );
15
+ define( 'SRR_PATH', plugin_dir_path( __FILE__ ) ); // All have trailing slash
16
+ define( 'SRR_URL', plugin_dir_url( __FILE__ ) );
17
 
18
+ final class Super_RSS_Reader{
 
 
 
 
 
 
19
 
20
+ public static function init(){
 
 
 
 
 
 
 
 
 
21
 
22
+ self::includes();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
+ add_action( 'plugins_loaded', array( __class__, 'load_text_domain' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  }
 
27
 
28
+ public static function includes(){
29
+
30
+ include_once( SRR_PATH . 'includes/widget.php' );
31
+ include_once( SRR_PATH . 'includes/widget-admin.php' );
32
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
 
34
 
35
+ public static function load_text_domain(){
 
 
 
36
 
37
+ load_plugin_textdomain( 'super-rss-reader', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
38
 
 
 
 
 
39
  }
40
+
41
  }
42
+
43
+ Super_RSS_Reader::init();
44
 
45
  ?>