Version Description
Download this release
Release Info
Developer | vaakash |
Plugin | Super RSS Reader |
Version | 4.1 |
Comparing to | |
See all releases |
Code changes from version 4.0.1 to 4.1
- includes/feed.php +41 -16
- includes/options.php +8 -0
- includes/widget-admin.php +15 -1
- readme.txt +8 -2
- super-rss-reader.php +2 -2
includes/feed.php
CHANGED
@@ -30,10 +30,12 @@ class SRR_Feed{
|
|
30 |
$add_nofollow = intval( $this->options['add_nofollow'] );
|
31 |
$strip_desc = intval( $this->options['strip_desc'] );
|
32 |
$strip_title = intval( $this->options['strip_title'] );
|
|
|
33 |
$read_more = htmlspecialchars( $this->options['read_more'] );
|
34 |
$rich_desc = intval( $this->options['rich_desc'] );
|
35 |
$thumbnail_position = htmlspecialchars( $this->options['thumbnail_position'] );
|
36 |
$thumbnail_size = htmlspecialchars( $this->options['thumbnail_size'] );
|
|
|
37 |
|
38 |
$color_theme = stripslashes( $this->options['color_style'] );
|
39 |
$display_type = stripslashes( $this->options['display_type'] );
|
@@ -146,13 +148,13 @@ class SRR_Feed{
|
|
146 |
$no_follow = $add_nofollow ? ' rel="nofollow noopener noreferrer"' : '';
|
147 |
|
148 |
// Date
|
149 |
-
$date = $item->get_date( '
|
150 |
$date_full = esc_attr( $item->get_date() );
|
151 |
|
152 |
// Thumbnail
|
153 |
$thumb = '';
|
154 |
if ( $show_thumb == 1 ){
|
155 |
-
$thumb_url = $this->get_thumbnail_url( $item );
|
156 |
if( !empty( $thumb_url ) ){
|
157 |
$thumb_styles = array(
|
158 |
'width' => $thumbnail_size,
|
@@ -201,35 +203,58 @@ class SRR_Feed{
|
|
201 |
$author = esc_html( strip_tags( $author ) );
|
202 |
}
|
203 |
|
204 |
-
|
205 |
-
$
|
206 |
-
$
|
|
|
207 |
|
208 |
-
$
|
209 |
|
210 |
// Metadata
|
211 |
if( $show_date || $show_author ){
|
212 |
-
$
|
213 |
if( $show_date && !empty( $date ) ){
|
214 |
-
$
|
215 |
}
|
216 |
|
217 |
if( $show_author && !empty( $author ) ){
|
218 |
-
$
|
219 |
}
|
220 |
-
$
|
221 |
}
|
222 |
|
223 |
if ( $show_thumb ){
|
224 |
-
$
|
225 |
}
|
226 |
|
227 |
if( $show_desc ){
|
228 |
-
$
|
229 |
-
$
|
230 |
-
$
|
231 |
}
|
232 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
$html .= '</div>'; // End item inner clearfix
|
234 |
$html .= '</div>'; // End feed item
|
235 |
|
@@ -253,7 +278,7 @@ class SRR_Feed{
|
|
253 |
|
254 |
}
|
255 |
|
256 |
-
function get_thumbnail_url( $item ){
|
257 |
|
258 |
// Try to get from the item enclosure
|
259 |
$enclosure = $item->get_enclosure();
|
@@ -283,7 +308,7 @@ class SRR_Feed{
|
|
283 |
return $image[0]['data'];
|
284 |
}
|
285 |
|
286 |
-
return
|
287 |
|
288 |
}
|
289 |
|
30 |
$add_nofollow = intval( $this->options['add_nofollow'] );
|
31 |
$strip_desc = intval( $this->options['strip_desc'] );
|
32 |
$strip_title = intval( $this->options['strip_title'] );
|
33 |
+
$date_format = htmlspecialchars( $this->options['date_format'] );
|
34 |
$read_more = htmlspecialchars( $this->options['read_more'] );
|
35 |
$rich_desc = intval( $this->options['rich_desc'] );
|
36 |
$thumbnail_position = htmlspecialchars( $this->options['thumbnail_position'] );
|
37 |
$thumbnail_size = htmlspecialchars( $this->options['thumbnail_size'] );
|
38 |
+
$thumbnail_default = htmlspecialchars( $this->options['thumbnail_default'] );
|
39 |
|
40 |
$color_theme = stripslashes( $this->options['color_style'] );
|
41 |
$display_type = stripslashes( $this->options['display_type'] );
|
148 |
$no_follow = $add_nofollow ? ' rel="nofollow noopener noreferrer"' : '';
|
149 |
|
150 |
// Date
|
151 |
+
$date = date_i18n( $date_format, $item->get_date( 'U' ) );
|
152 |
$date_full = esc_attr( $item->get_date() );
|
153 |
|
154 |
// Thumbnail
|
155 |
$thumb = '';
|
156 |
if ( $show_thumb == 1 ){
|
157 |
+
$thumb_url = $this->get_thumbnail_url( $item, $thumbnail_default );
|
158 |
if( !empty( $thumb_url ) ){
|
159 |
$thumb_styles = array(
|
160 |
'width' => $thumbnail_size,
|
203 |
$author = esc_html( strip_tags( $author ) );
|
204 |
}
|
205 |
|
206 |
+
$t_title = '';
|
207 |
+
$t_meta = '';
|
208 |
+
$t_thumb = '';
|
209 |
+
$t_desc = '';
|
210 |
|
211 |
+
$t_title .= '<div class="srr-title"><a href="' . $link . '"' . $new_tab . $no_follow . ' title="' . $title_full . '">' . $title . '</a></div>';
|
212 |
|
213 |
// Metadata
|
214 |
if( $show_date || $show_author ){
|
215 |
+
$t_meta .= '<div class="srr-meta">';
|
216 |
if( $show_date && !empty( $date ) ){
|
217 |
+
$t_meta .= '<time class="srr-date" title="' . $date_full . ' UTC">' . $date . '</time>';
|
218 |
}
|
219 |
|
220 |
if( $show_author && !empty( $author ) ){
|
221 |
+
$t_meta .= ' - <cite class="srr-author">' . $author . '</cite>';
|
222 |
}
|
223 |
+
$t_meta .= '</div>'; // End meta
|
224 |
}
|
225 |
|
226 |
if ( $show_thumb ){
|
227 |
+
$t_thumb .= $thumb;
|
228 |
}
|
229 |
|
230 |
if( $show_desc ){
|
231 |
+
$t_desc .= '<div class="srr-summary srr-clearfix">';
|
232 |
+
$t_desc .= $rich_desc ? $desc : ( '<p>' . $desc . '</p>' );
|
233 |
+
$t_desc .= '</div>'; // End summary
|
234 |
}
|
235 |
|
236 |
+
$f_data = apply_filters( 'srr_mod_item_html', array(
|
237 |
+
'title' => $t_title,
|
238 |
+
'meta' => $t_meta,
|
239 |
+
'thumbnail' => $t_thumb,
|
240 |
+
'description' => $t_desc,
|
241 |
+
'before' => '',
|
242 |
+
'after' => ''
|
243 |
+
), $url, $item );
|
244 |
+
|
245 |
+
$f_title = !isset( $f_data[ 'title' ] ) ? '' : $f_data[ 'title' ];
|
246 |
+
$f_meta = !isset( $f_data[ 'meta' ] ) ? '' : $f_data[ 'meta' ];
|
247 |
+
$f_thumb = !isset( $f_data[ 'thumbnail' ] ) ? '' : $f_data[ 'thumbnail' ];
|
248 |
+
$f_desc = !isset( $f_data[ 'description' ] ) ? '' : $f_data[ 'description' ];
|
249 |
+
$f_before = !isset( $f_data[ 'before' ] ) ? '' : $f_data[ 'before' ];
|
250 |
+
$f_after = !isset( $f_data[ 'after' ] ) ? '' : $f_data[ 'after' ];
|
251 |
+
|
252 |
+
// Display the feed items
|
253 |
+
$html .= '<div class="srr-item ' . ( ( $j%2 == 0 ) ? 'srr-stripe' : '') . '">';
|
254 |
+
$html .= '<div class="srr-clearfix">';
|
255 |
+
$html .= $f_before;
|
256 |
+
$html .= $f_title . $f_meta . $f_thumb . $f_desc;
|
257 |
+
$html .= $f_after;
|
258 |
$html .= '</div>'; // End item inner clearfix
|
259 |
$html .= '</div>'; // End feed item
|
260 |
|
278 |
|
279 |
}
|
280 |
|
281 |
+
function get_thumbnail_url( $item, $thumbnail_default ){
|
282 |
|
283 |
// Try to get from the item enclosure
|
284 |
$enclosure = $item->get_enclosure();
|
308 |
return $image[0]['data'];
|
309 |
}
|
310 |
|
311 |
+
return trim( $thumbnail_default );
|
312 |
|
313 |
}
|
314 |
|
includes/options.php
CHANGED
@@ -63,6 +63,10 @@ class SRR_Options{
|
|
63 |
'default' => 0,
|
64 |
'description' => __( 'Trim the title text to certain number of words.', 'super-rss-reader' )
|
65 |
),
|
|
|
|
|
|
|
|
|
66 |
'read_more' => array(
|
67 |
'default' => '[...]',
|
68 |
'description' => __( 'The read more text if the description is trimmed.', 'super-rss-reader' )
|
@@ -104,6 +108,10 @@ class SRR_Options{
|
|
104 |
'default' => '64px',
|
105 |
'description' => __( 'The size of the thumbnail including the units. Example: 64px, 10%', 'super-rss-reader' )
|
106 |
),
|
|
|
|
|
|
|
|
|
107 |
'color_style' => array(
|
108 |
'default' => 'none',
|
109 |
'description' => __( 'The style of the feed display.', 'super-rss-reader' ),
|
63 |
'default' => 0,
|
64 |
'description' => __( 'Trim the title text to certain number of words.', 'super-rss-reader' )
|
65 |
),
|
66 |
+
'date_format' => array(
|
67 |
+
'default' => 'j F Y',
|
68 |
+
'description' => __( 'The format of the feed item date.', 'super-rss-reader' )
|
69 |
+
),
|
70 |
'read_more' => array(
|
71 |
'default' => '[...]',
|
72 |
'description' => __( 'The read more text if the description is trimmed.', 'super-rss-reader' )
|
108 |
'default' => '64px',
|
109 |
'description' => __( 'The size of the thumbnail including the units. Example: 64px, 10%', 'super-rss-reader' )
|
110 |
),
|
111 |
+
'thumbnail_default' => array(
|
112 |
+
'default' => '',
|
113 |
+
'description' => __( 'The URL of the default thumbnail image if not present. Leave empty to not display any thumbnail.', 'super-rss-reader' )
|
114 |
+
),
|
115 |
'color_style' => array(
|
116 |
'default' => 'none',
|
117 |
'description' => __( 'The style of the feed display.', 'super-rss-reader' ),
|
includes/widget-admin.php
CHANGED
@@ -56,12 +56,14 @@ class super_rss_reader_widget extends WP_Widget{
|
|
56 |
$instance[ 'show_thumb' ] = intval( isset( $new_instance['show_thumb'] ) ? $new_instance['show_thumb'] : 0 );
|
57 |
$instance[ 'strip_desc' ] = intval( $new_instance['strip_desc'] );
|
58 |
$instance[ 'strip_title' ] = intval( $new_instance['strip_title'] );
|
|
|
59 |
$instance[ 'read_more' ] = stripslashes( $new_instance['read_more'] );
|
60 |
$instance[ 'add_nofollow' ] = intval( isset( $new_instance['add_nofollow'] ) ? $new_instance['add_nofollow'] : 0 );
|
61 |
$instance[ 'open_newtab' ] = intval( isset( $new_instance['open_newtab'] ) ? $new_instance['open_newtab'] : 0 );
|
62 |
$instance[ 'rich_desc' ] = intval( isset( $new_instance['rich_desc'] ) ? $new_instance['rich_desc'] : 0 );
|
63 |
$instance[ 'thumbnail_position' ] = stripslashes( $new_instance['thumbnail_position'] );
|
64 |
$instance[ 'thumbnail_size' ] = stripslashes( $new_instance['thumbnail_size'] );
|
|
|
65 |
|
66 |
$instance[ 'color_style' ] = stripslashes( $new_instance['color_style']);
|
67 |
$instance[ 'display_type' ] = stripslashes( $new_instance['display_type']);
|
@@ -89,10 +91,12 @@ class super_rss_reader_widget extends WP_Widget{
|
|
89 |
$add_nofollow = intval($instance['add_nofollow']);
|
90 |
$strip_desc = intval($instance['strip_desc']);
|
91 |
$strip_title = intval($instance['strip_title']);
|
|
|
92 |
$read_more = htmlspecialchars($instance['read_more']);
|
93 |
$rich_desc = intval($instance['rich_desc']);
|
94 |
$thumbnail_position = htmlspecialchars($instance['thumbnail_position']);
|
95 |
$thumbnail_size = htmlspecialchars($instance['thumbnail_size']);
|
|
|
96 |
|
97 |
$color_style = stripslashes($instance['color_style']);
|
98 |
$display_type = stripslashes($instance['display_type']);
|
@@ -177,6 +181,11 @@ class super_rss_reader_widget extends WP_Widget{
|
|
177 |
<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>
|
178 |
</div>
|
179 |
|
|
|
|
|
|
|
|
|
|
|
180 |
<h4><?php _e( 'Description', 'super-rss-reader' ); ?></h4>
|
181 |
|
182 |
<div class="srr_row">
|
@@ -218,6 +227,11 @@ class super_rss_reader_widget extends WP_Widget{
|
|
218 |
<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>
|
219 |
</div>
|
220 |
|
|
|
|
|
|
|
|
|
|
|
221 |
</section>
|
222 |
|
223 |
<section data-tab-id="display">
|
@@ -283,7 +297,7 @@ class super_rss_reader_widget extends WP_Widget{
|
|
283 |
</div>
|
284 |
|
285 |
<div class="srr_info">
|
286 |
-
<p><a href="https://www.aakashweb.com/docs/super-rss-reader/
|
287 |
</div>
|
288 |
|
289 |
<?php
|
56 |
$instance[ 'show_thumb' ] = intval( isset( $new_instance['show_thumb'] ) ? $new_instance['show_thumb'] : 0 );
|
57 |
$instance[ 'strip_desc' ] = intval( $new_instance['strip_desc'] );
|
58 |
$instance[ 'strip_title' ] = intval( $new_instance['strip_title'] );
|
59 |
+
$instance[ 'date_format' ] = stripslashes( $new_instance['date_format'] );
|
60 |
$instance[ 'read_more' ] = stripslashes( $new_instance['read_more'] );
|
61 |
$instance[ 'add_nofollow' ] = intval( isset( $new_instance['add_nofollow'] ) ? $new_instance['add_nofollow'] : 0 );
|
62 |
$instance[ 'open_newtab' ] = intval( isset( $new_instance['open_newtab'] ) ? $new_instance['open_newtab'] : 0 );
|
63 |
$instance[ 'rich_desc' ] = intval( isset( $new_instance['rich_desc'] ) ? $new_instance['rich_desc'] : 0 );
|
64 |
$instance[ 'thumbnail_position' ] = stripslashes( $new_instance['thumbnail_position'] );
|
65 |
$instance[ 'thumbnail_size' ] = stripslashes( $new_instance['thumbnail_size'] );
|
66 |
+
$instance[ 'thumbnail_default' ] = stripslashes( $new_instance['thumbnail_default'] );
|
67 |
|
68 |
$instance[ 'color_style' ] = stripslashes( $new_instance['color_style']);
|
69 |
$instance[ 'display_type' ] = stripslashes( $new_instance['display_type']);
|
91 |
$add_nofollow = intval($instance['add_nofollow']);
|
92 |
$strip_desc = intval($instance['strip_desc']);
|
93 |
$strip_title = intval($instance['strip_title']);
|
94 |
+
$date_format = htmlspecialchars($instance['date_format']);
|
95 |
$read_more = htmlspecialchars($instance['read_more']);
|
96 |
$rich_desc = intval($instance['rich_desc']);
|
97 |
$thumbnail_position = htmlspecialchars($instance['thumbnail_position']);
|
98 |
$thumbnail_size = htmlspecialchars($instance['thumbnail_size']);
|
99 |
+
$thumbnail_default = htmlspecialchars($instance['thumbnail_default']);
|
100 |
|
101 |
$color_style = stripslashes($instance['color_style']);
|
102 |
$display_type = stripslashes($instance['display_type']);
|
181 |
<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>
|
182 |
</div>
|
183 |
|
184 |
+
<div class="srr_row">
|
185 |
+
<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>
|
186 |
+
<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" /><div><a href="https://wordpress.org/support/article/formatting-date-and-time/" target="_blank"><?php _e( 'Refer format codes here', 'super-rss-reader' ); ?></a></div></div>
|
187 |
+
</div>
|
188 |
+
|
189 |
<h4><?php _e( 'Description', 'super-rss-reader' ); ?></h4>
|
190 |
|
191 |
<div class="srr_row">
|
227 |
<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>
|
228 |
</div>
|
229 |
|
230 |
+
<div class="srr_row">
|
231 |
+
<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>
|
232 |
+
<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>
|
233 |
+
</div>
|
234 |
+
|
235 |
</section>
|
236 |
|
237 |
<section data-tab-id="display">
|
297 |
</div>
|
298 |
|
299 |
<div class="srr_info">
|
300 |
+
<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>
|
301 |
</div>
|
302 |
|
303 |
<?php
|
readme.txt
CHANGED
@@ -7,8 +7,8 @@ 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.
|
11 |
-
Stable tag: 4.
|
12 |
|
13 |
Display any RSS feed(s) in widget with news ticker effect in multiple tabs, thumbnails, customizable color themes and more.
|
14 |
|
@@ -126,6 +126,12 @@ The additional effect needs only 2.5 KB of additional JavaScript file which is v
|
|
126 |
|
127 |
## Changelog
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
### 4.0.1
|
130 |
* Fix: Added hover style for the tabs and on active style when no theme is selected.
|
131 |
* New: Tested with WordPress 5.6
|
7 |
Donate Link: https://www.paypal.me/vaakash
|
8 |
Requires at least: 2.8
|
9 |
Requires PHP: 5.3
|
10 |
+
Tested up to: 5.7
|
11 |
+
Stable tag: 4.1
|
12 |
|
13 |
Display any RSS feed(s) in widget with news ticker effect in multiple tabs, thumbnails, customizable color themes and more.
|
14 |
|
126 |
|
127 |
## Changelog
|
128 |
|
129 |
+
### 4.1
|
130 |
+
* New: Option to change date format
|
131 |
+
* New: Date will now be in the same language as the site.
|
132 |
+
* New: Option to set default thumbnail image if not present.
|
133 |
+
* New: Filter hook to customize the feed item's HTML.
|
134 |
+
|
135 |
### 4.0.1
|
136 |
* Fix: Added hover style for the tabs and on active style when no theme is selected.
|
137 |
* New: Tested with WordPress 5.6
|
super-rss-reader.php
CHANGED
@@ -5,12 +5,12 @@
|
|
5 |
* Description: Display any RSS feed(s) in widget with news ticker effect in multiple tabs, thumbnails, customizable color themes and more.
|
6 |
* Author: Aakash Chakravarthy
|
7 |
* Author URI: https://www.aakashweb.com/
|
8 |
-
* Version: 4.
|
9 |
* Text Domain: super-rss-reader
|
10 |
* Domain Path: /languages
|
11 |
*/
|
12 |
|
13 |
-
define( 'SRR_VERSION', '4.
|
14 |
define( 'SRR_PATH', plugin_dir_path( __FILE__ ) ); // All have trailing slash
|
15 |
define( 'SRR_URL', plugin_dir_url( __FILE__ ) );
|
16 |
define( 'SRR_BASE_NAME', plugin_basename( __FILE__ ) );
|
5 |
* Description: Display any RSS feed(s) in widget with news ticker effect in multiple tabs, thumbnails, customizable color themes and more.
|
6 |
* Author: Aakash Chakravarthy
|
7 |
* Author URI: https://www.aakashweb.com/
|
8 |
+
* Version: 4.1
|
9 |
* Text Domain: super-rss-reader
|
10 |
* Domain Path: /languages
|
11 |
*/
|
12 |
|
13 |
+
define( 'SRR_VERSION', '4.1' );
|
14 |
define( 'SRR_PATH', plugin_dir_path( __FILE__ ) ); // All have trailing slash
|
15 |
define( 'SRR_URL', plugin_dir_url( __FILE__ ) );
|
16 |
define( 'SRR_BASE_NAME', plugin_basename( __FILE__ ) );
|