Version Description
Download this release
Release Info
Developer | vaakash |
Plugin | Super RSS Reader |
Version | 4.7 |
Comparing to | |
See all releases |
Code changes from version 4.6 to 4.7
- includes/feed.php +45 -46
- includes/widget-admin.php +119 -119
- includes/widget.php +1 -1
- readme.txt +8 -3
- super-rss-reader.php +2 -2
includes/feed.php
CHANGED
@@ -18,31 +18,31 @@ class SRR_Feed{
|
|
18 |
|
19 |
public function html(){
|
20 |
|
21 |
-
$urls =
|
22 |
-
$tab_titles =
|
23 |
$count = intval( $this->options['count'] );
|
24 |
|
25 |
$show_date = intval( $this->options['show_date'] );
|
26 |
$show_desc = intval( $this->options['show_desc'] );
|
27 |
$show_author = intval( $this->options['show_author'] );
|
28 |
-
$show_thumb =
|
29 |
$open_newtab = intval( $this->options['open_newtab'] );
|
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 =
|
34 |
-
$date_timezone =
|
35 |
-
$order_by =
|
36 |
-
$read_more =
|
37 |
$rich_desc = intval( $this->options['rich_desc'] );
|
38 |
-
$desc_type =
|
39 |
-
$thumbnail_position =
|
40 |
-
$thumbnail_size =
|
41 |
-
$thumbnail_default =
|
42 |
-
$no_feed_text =
|
43 |
-
|
44 |
-
$color_theme =
|
45 |
-
$display_type =
|
46 |
$visible_items = intval( $this->options['visible_items'] );
|
47 |
$ticker_speed = intval( $this->options['ticker_speed'] ) * 1000;
|
48 |
|
@@ -59,7 +59,7 @@ class SRR_Feed{
|
|
59 |
|
60 |
$feeds = array();
|
61 |
$html = '';
|
62 |
-
$no_feed_html = '<div>' . $no_feed_text . '</div>';
|
63 |
|
64 |
$classes = array( 'srr-wrap', 'srr-style-' . $color_theme );
|
65 |
if( $display_type == 'vertical_ticker' ) array_push( $classes, 'srr-vticker' );
|
@@ -68,12 +68,18 @@ class SRR_Feed{
|
|
68 |
// Fetch the feed
|
69 |
for( $i=0; $i < $url_count; $i++ ){
|
70 |
$feed_url = trim( $urls[$i] );
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
$feed = fetch_feed( $feed_url );
|
72 |
|
73 |
if( is_wp_error( $feed ) ){
|
74 |
-
$feed_title = 'Error';
|
75 |
}else{
|
76 |
-
$feed_title = ( isset( $tab_titles[$i] ) && !empty( $tab_titles[$i] ) ) ? $tab_titles[$i] :
|
77 |
}
|
78 |
|
79 |
$feeds[ $feed_url ] = array(
|
@@ -85,15 +91,11 @@ class SRR_Feed{
|
|
85 |
|
86 |
// Generate tabs
|
87 |
if( $url_count > 1 ){
|
88 |
-
$html .= '<ul class="srr-tab-wrap srr-tab-style-' . $color_theme . ' srr-clearfix">';
|
89 |
foreach( $feeds as $url => $data ){
|
90 |
$id = $data[ 'id' ];
|
91 |
$feed = $data[ 'feed' ];
|
92 |
-
|
93 |
-
$html .= '<li data-tab="srr-tab-' . $id . '">Error</li>';
|
94 |
-
}else{
|
95 |
-
$html .= '<li data-tab="srr-tab-' . $id . '">' . $data[ 'title' ] . '</li>';
|
96 |
-
}
|
97 |
}
|
98 |
$html .= '</ul>';
|
99 |
}
|
@@ -106,7 +108,7 @@ class SRR_Feed{
|
|
106 |
|
107 |
// Check for feed errors
|
108 |
if ( is_wp_error( $feed ) ){
|
109 |
-
$html .= '<div class="srr-wrap srr-style-' . $color_theme .'" data-id="srr-tab-' . $id . '"><p>RSS Error: ' . $feed->get_error_message() . '</p></div>';
|
110 |
continue;
|
111 |
}
|
112 |
|
@@ -119,7 +121,7 @@ class SRR_Feed{
|
|
119 |
}
|
120 |
|
121 |
// Outer wrap start
|
122 |
-
$html .= '<div class="' . $class . '" data-visible="' . $visible_items . '" data-speed="' . $ticker_speed . '" data-id="srr-tab-' . $id . '">';
|
123 |
$html .= '<div>';
|
124 |
|
125 |
$max_items = $feed->get_item_quantity();
|
@@ -139,10 +141,10 @@ class SRR_Feed{
|
|
139 |
// Link
|
140 |
$link = $item->get_link();
|
141 |
while ( stristr( $link, 'http' ) != $link ){ $link = substr( $link, 1 ); }
|
142 |
-
$link =
|
143 |
|
144 |
// Title
|
145 |
-
$title =
|
146 |
$title_full = $title;
|
147 |
|
148 |
if ( empty( $title ) ){
|
@@ -166,7 +168,7 @@ class SRR_Feed{
|
|
166 |
|
167 |
// Date
|
168 |
$date = '';
|
169 |
-
$date_full =
|
170 |
|
171 |
if( strtolower( $date_format ) == 'relative' ){
|
172 |
$item_date = $item->get_date( 'U' );
|
@@ -193,7 +195,7 @@ class SRR_Feed{
|
|
193 |
foreach( $thumb_styles as $prop => $val ){
|
194 |
$thumb_style .= "$prop:$val;";
|
195 |
}
|
196 |
-
$thumb = '<a href="' . $link . '" class="srr-thumb srr-thumb-' . $thumbnail_position . '" style="' . $thumb_style . '" ' . $new_tab . $no_follow . '><img src="' . $thumb_url . '" alt="' . $title_full . '" align="left" /></a>';
|
197 |
}
|
198 |
}
|
199 |
|
@@ -202,27 +204,22 @@ class SRR_Feed{
|
|
202 |
if( $show_desc ){
|
203 |
$desc_content = ( $desc_type == 'summary' ) ? $item->get_description() : $item->get_content();
|
204 |
if( $rich_desc ){
|
205 |
-
$desc = strip_tags( $desc_content, '<p><a><img><em><strong><font><strike><s><u><i><br>' );
|
206 |
}else{
|
207 |
-
|
208 |
-
$desc = str_replace( array( "\n", "\r" ), ' ', esc_attr( strip_tags( @html_entity_decode( $desc_content, ENT_QUOTES, get_option('blog_charset') ) ) ) );
|
209 |
-
$read_more_link = '';
|
210 |
|
211 |
if( $strip_desc != 0 ){
|
212 |
$desc = wp_trim_words( $desc, $strip_desc );
|
213 |
-
$read_more_link = !empty( $read_more ) ? ' <a href="' . $link . '" title="' . __( 'Read more', 'super-rss-reader' ) . '"' . $new_tab . $no_follow . ' class="srr-read-more">' . $read_more . '</a>' : '';
|
214 |
-
|
215 |
if ( '[...]' == substr( $desc, -5 ) ){
|
216 |
$desc = substr( $desc, 0, -5 );
|
217 |
}elseif ( '[…]' != substr( $desc, -10 ) ){
|
218 |
$desc .= '';
|
219 |
}
|
220 |
-
|
221 |
-
$desc = esc_html( $desc );
|
222 |
}
|
223 |
|
224 |
-
$desc = trim( $desc );
|
225 |
if( !empty( $desc ) ){
|
|
|
226 |
$desc = $desc . $read_more_link;
|
227 |
}
|
228 |
|
@@ -230,10 +227,12 @@ class SRR_Feed{
|
|
230 |
}
|
231 |
|
232 |
// Author
|
233 |
-
$author =
|
234 |
-
if
|
235 |
-
$author = $
|
236 |
-
|
|
|
|
|
237 |
}
|
238 |
|
239 |
$t_title = '';
|
@@ -241,17 +240,17 @@ class SRR_Feed{
|
|
241 |
$t_thumb = '';
|
242 |
$t_desc = '';
|
243 |
|
244 |
-
$t_title .= '<div class="srr-title"><a href="' . $link . '"' . $new_tab . $no_follow . ' title="' . $title_full . '">' . $title . '</a></div>';
|
245 |
|
246 |
// Metadata
|
247 |
if( $show_date || $show_author ){
|
248 |
$t_meta .= '<div class="srr-meta">';
|
249 |
if( $show_date && !empty( $date ) ){
|
250 |
-
$t_meta .= '<time class="srr-date" title="' . $date_full . ' UTC">' . $date . '</time>';
|
251 |
}
|
252 |
|
253 |
if( $show_author && !empty( $author ) ){
|
254 |
-
$t_meta .= ' - <cite class="srr-author">' . $author . '</cite>';
|
255 |
}
|
256 |
$t_meta .= '</div>'; // End meta
|
257 |
}
|
18 |
|
19 |
public function html(){
|
20 |
|
21 |
+
$urls = trim( $this->options['urls'] );
|
22 |
+
$tab_titles = $this->options['tab_titles'];
|
23 |
$count = intval( $this->options['count'] );
|
24 |
|
25 |
$show_date = intval( $this->options['show_date'] );
|
26 |
$show_desc = intval( $this->options['show_desc'] );
|
27 |
$show_author = intval( $this->options['show_author'] );
|
28 |
+
$show_thumb = intval( $this->options['show_thumb'] );
|
29 |
$open_newtab = intval( $this->options['open_newtab'] );
|
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 = $this->options['date_format'];
|
34 |
+
$date_timezone = $this->options['date_timezone'];
|
35 |
+
$order_by = $this->options['order_by'];
|
36 |
+
$read_more = $this->options['read_more'];
|
37 |
$rich_desc = intval( $this->options['rich_desc'] );
|
38 |
+
$desc_type = $this->options['desc_type'];
|
39 |
+
$thumbnail_position = $this->options['thumbnail_position'];
|
40 |
+
$thumbnail_size = $this->options['thumbnail_size'];
|
41 |
+
$thumbnail_default = $this->options['thumbnail_default'];
|
42 |
+
$no_feed_text = $this->options['no_feed_text'];
|
43 |
+
|
44 |
+
$color_theme = $this->options['color_style'];
|
45 |
+
$display_type = $this->options['display_type'];
|
46 |
$visible_items = intval( $this->options['visible_items'] );
|
47 |
$ticker_speed = intval( $this->options['ticker_speed'] ) * 1000;
|
48 |
|
59 |
|
60 |
$feeds = array();
|
61 |
$html = '';
|
62 |
+
$no_feed_html = '<div>' . wp_kses_post( $no_feed_text ) . '</div>';
|
63 |
|
64 |
$classes = array( 'srr-wrap', 'srr-style-' . $color_theme );
|
65 |
if( $display_type == 'vertical_ticker' ) array_push( $classes, 'srr-vticker' );
|
68 |
// Fetch the feed
|
69 |
for( $i=0; $i < $url_count; $i++ ){
|
70 |
$feed_url = trim( $urls[$i] );
|
71 |
+
|
72 |
+
// Skip if the RSS feed URL is same as the site URL
|
73 |
+
if ( in_array( untrailingslashit( $feed_url ), array( site_url(), home_url() ), true ) ) {
|
74 |
+
continue;
|
75 |
+
}
|
76 |
+
|
77 |
$feed = fetch_feed( $feed_url );
|
78 |
|
79 |
if( is_wp_error( $feed ) ){
|
80 |
+
$feed_title = __( 'Error' );
|
81 |
}else{
|
82 |
+
$feed_title = ( isset( $tab_titles[$i] ) && !empty( $tab_titles[$i] ) ) ? $tab_titles[$i] : strip_tags( $feed->get_title() );
|
83 |
}
|
84 |
|
85 |
$feeds[ $feed_url ] = array(
|
91 |
|
92 |
// Generate tabs
|
93 |
if( $url_count > 1 ){
|
94 |
+
$html .= '<ul class="srr-tab-wrap srr-tab-style-' . esc_attr( $color_theme ) . ' srr-clearfix">';
|
95 |
foreach( $feeds as $url => $data ){
|
96 |
$id = $data[ 'id' ];
|
97 |
$feed = $data[ 'feed' ];
|
98 |
+
$html .= '<li data-tab="srr-tab-' . esc_attr( $id ) . '">' . wp_kses_post( $data[ 'title' ] ) . '</li>';
|
|
|
|
|
|
|
|
|
99 |
}
|
100 |
$html .= '</ul>';
|
101 |
}
|
108 |
|
109 |
// Check for feed errors
|
110 |
if ( is_wp_error( $feed ) ){
|
111 |
+
$html .= '<div class="srr-wrap srr-style-' . esc_attr( $color_theme ) .'" data-id="srr-tab-' . esc_attr( $id ) . '"><p>RSS Error: ' . wp_kses_post( $feed->get_error_message() ) . '</p></div>';
|
112 |
continue;
|
113 |
}
|
114 |
|
121 |
}
|
122 |
|
123 |
// Outer wrap start
|
124 |
+
$html .= '<div class="' . esc_attr( $class ) . '" data-visible="' . esc_attr( $visible_items ) . '" data-speed="' . esc_attr( $ticker_speed ) . '" data-id="srr-tab-' . esc_attr( $id ) . '">';
|
125 |
$html .= '<div>';
|
126 |
|
127 |
$max_items = $feed->get_item_quantity();
|
141 |
// Link
|
142 |
$link = $item->get_link();
|
143 |
while ( stristr( $link, 'http' ) != $link ){ $link = substr( $link, 1 ); }
|
144 |
+
$link = strip_tags($link);
|
145 |
|
146 |
// Title
|
147 |
+
$title = strip_tags( $item->get_title() );
|
148 |
$title_full = $title;
|
149 |
|
150 |
if ( empty( $title ) ){
|
168 |
|
169 |
// Date
|
170 |
$date = '';
|
171 |
+
$date_full = strip_tags( $item->get_date() );
|
172 |
|
173 |
if( strtolower( $date_format ) == 'relative' ){
|
174 |
$item_date = $item->get_date( 'U' );
|
195 |
foreach( $thumb_styles as $prop => $val ){
|
196 |
$thumb_style .= "$prop:$val;";
|
197 |
}
|
198 |
+
$thumb = '<a href="' . esc_url( $link ) . '" class="srr-thumb srr-thumb-' . esc_attr( $thumbnail_position ) . '" style="' . esc_attr( $thumb_style ) . '" ' . $new_tab . $no_follow . '><img src="' . esc_url( $thumb_url ) . '" alt="' . esc_attr( $title_full ) . '" align="left"' . ( wp_lazy_loading_enabled( 'img', 'srr-thumbnail' ) ? ' loading="lazy"' : '' ) . ' /></a>';
|
199 |
}
|
200 |
}
|
201 |
|
204 |
if( $show_desc ){
|
205 |
$desc_content = ( $desc_type == 'summary' ) ? $item->get_description() : $item->get_content();
|
206 |
if( $rich_desc ){
|
207 |
+
$desc = wp_kses_post( strip_tags( $desc_content, '<p><a><img><em><strong><font><strike><s><u><i><br>' ) );
|
208 |
}else{
|
209 |
+
$desc = str_replace( array( "\n", "\r" ), ' ', strip_tags( @html_entity_decode( $desc_content, ENT_QUOTES, get_option('blog_charset') ) ) );
|
|
|
|
|
210 |
|
211 |
if( $strip_desc != 0 ){
|
212 |
$desc = wp_trim_words( $desc, $strip_desc );
|
|
|
|
|
213 |
if ( '[...]' == substr( $desc, -5 ) ){
|
214 |
$desc = substr( $desc, 0, -5 );
|
215 |
}elseif ( '[…]' != substr( $desc, -10 ) ){
|
216 |
$desc .= '';
|
217 |
}
|
|
|
|
|
218 |
}
|
219 |
|
220 |
+
$desc = trim( esc_html( $desc ) );
|
221 |
if( !empty( $desc ) ){
|
222 |
+
$read_more_link = !empty( $read_more ) ? ' <a href="' . esc_url( $link ) . '" title="' . esc_attr__( 'Read more', 'super-rss-reader' ) . '"' . $new_tab . $no_follow . ' class="srr-read-more">' . esc_html( $read_more ) . '</a>' : '';
|
223 |
$desc = $desc . $read_more_link;
|
224 |
}
|
225 |
|
227 |
}
|
228 |
|
229 |
// Author
|
230 |
+
$author = '';
|
231 |
+
if( $show_author ){
|
232 |
+
$author = $item->get_author();
|
233 |
+
if ( is_object( $author ) ) {
|
234 |
+
$author = strip_tags( $author->get_name() );
|
235 |
+
}
|
236 |
}
|
237 |
|
238 |
$t_title = '';
|
240 |
$t_thumb = '';
|
241 |
$t_desc = '';
|
242 |
|
243 |
+
$t_title .= '<div class="srr-title"><a href="' . esc_url( $link ) . '"' . $new_tab . $no_follow . ' title="' . esc_attr( $title_full ) . '">' . esc_html( $title ) . '</a></div>';
|
244 |
|
245 |
// Metadata
|
246 |
if( $show_date || $show_author ){
|
247 |
$t_meta .= '<div class="srr-meta">';
|
248 |
if( $show_date && !empty( $date ) ){
|
249 |
+
$t_meta .= '<time class="srr-date" title="' . esc_attr( $date_full ) . ' UTC">' . esc_html( $date ) . '</time>';
|
250 |
}
|
251 |
|
252 |
if( $show_author && !empty( $author ) ){
|
253 |
+
$t_meta .= ' - <cite class="srr-author">' . esc_html( $author ) . '</cite>';
|
254 |
}
|
255 |
$t_meta .= '</div>'; // End meta
|
256 |
}
|
includes/widget-admin.php
CHANGED
@@ -45,9 +45,9 @@ class super_rss_reader_widget extends WP_Widget{
|
|
45 |
|
46 |
$instance = $old_instance;
|
47 |
|
48 |
-
$instance[ 'title' ] =
|
49 |
-
$instance[ 'urls' ] =
|
50 |
-
$instance[ 'tab_titles' ] =
|
51 |
|
52 |
$instance[ 'count' ] = intval( $new_instance['count'] );
|
53 |
$instance[ 'show_date' ] = intval( isset( $new_instance['show_date'] ) ? $new_instance['show_date'] : 0 );
|
@@ -56,23 +56,23 @@ 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[ 'date_format' ] =
|
60 |
-
$instance[ 'date_timezone' ] =
|
61 |
-
$instance[ 'order_by' ] =
|
62 |
-
$instance[ 'read_more' ] =
|
63 |
$instance[ 'add_nofollow' ] = intval( isset( $new_instance['add_nofollow'] ) ? $new_instance['add_nofollow'] : 0 );
|
64 |
$instance[ 'open_newtab' ] = intval( isset( $new_instance['open_newtab'] ) ? $new_instance['open_newtab'] : 0 );
|
65 |
$instance[ 'rich_desc' ] = intval( isset( $new_instance['rich_desc'] ) ? $new_instance['rich_desc'] : 0 );
|
66 |
-
$instance[ 'desc_type' ] =
|
67 |
-
$instance[ 'thumbnail_position' ] =
|
68 |
-
$instance[ 'thumbnail_size' ] =
|
69 |
-
$instance[ 'thumbnail_default' ] =
|
70 |
-
$instance[ 'no_feed_text' ] =
|
71 |
-
|
72 |
-
$instance[ 'color_style' ] =
|
73 |
-
$instance[ 'display_type' ] =
|
74 |
-
$instance[ 'visible_items' ] = intval( $new_instance['visible_items']);
|
75 |
-
$instance[ 'ticker_speed' ] = intval( $new_instance['ticker_speed']);
|
76 |
|
77 |
return $instance;
|
78 |
}
|
@@ -82,35 +82,35 @@ class super_rss_reader_widget extends WP_Widget{
|
|
82 |
|
83 |
$instance = wp_parse_args( (array) $instance, SRR_Options::defaults() );
|
84 |
|
85 |
-
$title =
|
86 |
-
$urls =
|
87 |
-
$tab_titles =
|
88 |
|
89 |
-
$count =
|
90 |
-
$show_date =
|
91 |
-
$show_desc =
|
92 |
-
$show_author =
|
93 |
-
$show_thumb =
|
94 |
-
$open_newtab =
|
95 |
-
$add_nofollow =
|
96 |
-
$strip_desc =
|
97 |
-
$strip_title =
|
98 |
-
$date_format =
|
99 |
-
$date_timezone =
|
100 |
-
$order_by =
|
101 |
-
$read_more =
|
102 |
-
$rich_desc =
|
103 |
-
$desc_type =
|
104 |
-
$thumbnail_position =
|
105 |
-
$thumbnail_size =
|
106 |
-
$thumbnail_default =
|
107 |
-
$no_feed_text =
|
108 |
-
|
109 |
-
$color_style = stripslashes($instance['color_style']);
|
110 |
-
$display_type = stripslashes($instance['display_type']);
|
111 |
-
$visible_items = intval($instance['visible_items']);
|
112 |
-
$ticker_speed = intval($instance['ticker_speed']);
|
113 |
|
|
|
|
|
|
|
|
|
|
|
114 |
$option_lists = SRR_Options::select_options();
|
115 |
|
116 |
// Replacing commas with new lines
|
@@ -122,76 +122,76 @@ class super_rss_reader_widget extends WP_Widget{
|
|
122 |
<div class="srr_settings">
|
123 |
|
124 |
<div class="srr_row">
|
125 |
-
<div class="srr_label srr_xsm"><label for="<?php echo $this->get_field_id('title'); ?>"><?php
|
126 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('title')
|
127 |
</div>
|
128 |
|
129 |
<div class="srr_row">
|
130 |
-
<div class="srr_label srr_xsm"><label for="<?php echo $this->get_field_id('urls'); ?>"><?php
|
131 |
-
<div class="srr_field"><textarea id="<?php echo $this->get_field_id('urls')
|
132 |
-
<small class="srr_small_text"><?php
|
133 |
</div>
|
134 |
|
135 |
<div class="srr_row">
|
136 |
-
<div class="srr_label srr_xsm"><label for="<?php echo $this->get_field_id('tab_titles'); ?>"><?php
|
137 |
-
<div class="srr_field"><textarea id="<?php echo $this->get_field_id('tab_titles')
|
138 |
-
<small class="srr_small_text"><?php
|
139 |
</div>
|
140 |
|
141 |
<ul class="srr_tab_list">
|
142 |
-
<li><a href="#" data-tab="general" class="active"><?php
|
143 |
-
<li><a href="#" data-tab="content"><?php
|
144 |
-
<li><a href="#" data-tab="display"><?php
|
145 |
-
<li><a href="#" data-tab="filter"><?php
|
146 |
</ul>
|
147 |
|
148 |
<section data-tab-id="general" class="active">
|
149 |
|
150 |
<div class="srr_row">
|
151 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('count')
|
152 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('count')
|
153 |
</div>
|
154 |
|
155 |
<div class="srr_row">
|
156 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('show_desc'); ?>"><?php
|
157 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('show_desc'); ?>" type="checkbox"
|
158 |
</div>
|
159 |
|
160 |
<div class="srr_row">
|
161 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('show_date'); ?>"><?php
|
162 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('show_date'); ?>" type="checkbox"
|
163 |
</div>
|
164 |
|
165 |
<div class="srr_row">
|
166 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('show_author'); ?>"><?php
|
167 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('show_author'); ?>" type="checkbox"
|
168 |
</div>
|
169 |
|
170 |
<div class="srr_row">
|
171 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('show_thumb'); ?>"><?php
|
172 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('show_thumb'); ?>" type="checkbox"
|
173 |
</div>
|
174 |
</section>
|
175 |
|
176 |
<section data-tab-id="content">
|
177 |
|
178 |
<div class="srr_row">
|
179 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('add_nofollow'); ?>"><?php
|
180 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('add_nofollow'); ?>" type="checkbox" name="<?php echo $this->get_field_name('add_nofollow'); ?>" value="1" <?php echo $add_nofollow == "1" ? 'checked="checked"' : ""; ?> /></div>
|
181 |
</div>
|
182 |
|
183 |
<div class="srr_row">
|
184 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('open_newtab'); ?>"><?php
|
185 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('open_newtab'); ?>" type="checkbox" name="<?php echo $this->get_field_name('open_newtab'); ?>" value="1" <?php echo $open_newtab == "1" ? 'checked="checked"' : ""; ?> /></div>
|
186 |
</div>
|
187 |
|
188 |
<div class="srr_row">
|
189 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('strip_title'); ?>"><?php
|
190 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('strip_title')
|
191 |
</div>
|
192 |
|
193 |
<div class="srr_row">
|
194 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('order_by')
|
195 |
<div class="srr_field">
|
196 |
<?php
|
197 |
echo '<select name="' . $this->get_field_name('order_by') . '" id="' . $this->get_field_id('order_by') . '">';
|
@@ -204,21 +204,21 @@ class super_rss_reader_widget extends WP_Widget{
|
|
204 |
</div>
|
205 |
|
206 |
<div class="srr_row">
|
207 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('date_format'); ?>"><?php
|
208 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('date_format'); ?>" name="<?php echo $this->get_field_name('date_format'); ?>" type="text" value="<?php echo $date_format; ?>" class="widefat" />
|
209 |
-
<small class="srr_small_text"><a href="https://wordpress.org/support/article/formatting-date-and-time/" target="_blank"><?php
|
210 |
</div>
|
211 |
</div>
|
212 |
|
213 |
-
<h4><?php
|
214 |
|
215 |
<div class="srr_row">
|
216 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('desc_type')
|
217 |
<div class="srr_field">
|
218 |
<?php
|
219 |
-
echo '<select name="' . $this->get_field_name('desc_type') . '" id="' . $this->get_field_id('desc_type') . '">';
|
220 |
foreach( $option_lists[ 'desc_type' ] as $k => $v ){
|
221 |
-
echo '<option value="' . $k . '" ' . selected( $desc_type, $k, false ) . '>' . $v . '</option>';
|
222 |
}
|
223 |
echo '</select>';
|
224 |
?>
|
@@ -226,33 +226,33 @@ class super_rss_reader_widget extends WP_Widget{
|
|
226 |
</div>
|
227 |
|
228 |
<div class="srr_row">
|
229 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('strip_desc')
|
230 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('strip_desc')
|
231 |
</div>
|
232 |
|
233 |
<div class="srr_row">
|
234 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('read_more'); ?>"><?php
|
235 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('read_more'); ?>" name="<?php echo $this->get_field_name('read_more'); ?>" type="text" value="<?php echo $read_more; ?>" class="widefat" /></div>
|
236 |
</div>
|
237 |
|
238 |
<div class="srr_row">
|
239 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('rich_desc'); ?>"><?php
|
240 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('rich_desc'); ?>" type="checkbox" name="<?php echo $this->get_field_name('rich_desc'); ?>" value="1" <?php echo $rich_desc == "1" ? 'checked="checked"' : ""; ?> /></div>
|
241 |
</div>
|
242 |
|
243 |
<?php if( $rich_desc == 1 ): ?>
|
244 |
-
<span class="srr_note"><?php
|
245 |
<?php endif; ?>
|
246 |
|
247 |
-
<h4><?php
|
248 |
|
249 |
<div class="srr_row">
|
250 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('thumbnail_position')
|
251 |
<div class="srr_field">
|
252 |
<?php
|
253 |
-
echo '<select name="' . $this->get_field_name('thumbnail_position') . '" id="' . $this->get_field_id('thumbnail_position') . '">';
|
254 |
foreach( $option_lists[ 'thumbnail_position' ] as $k => $v ){
|
255 |
-
echo '<option value="' . $k . '" ' . selected( $thumbnail_position, $k, false ) . '>' . $v . '</option>';
|
256 |
}
|
257 |
echo '</select>';
|
258 |
?>
|
@@ -260,12 +260,12 @@ class super_rss_reader_widget extends WP_Widget{
|
|
260 |
</div>
|
261 |
|
262 |
<div class="srr_row">
|
263 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('thumbnail_size'); ?>"><?php
|
264 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('thumbnail_size')
|
265 |
</div>
|
266 |
|
267 |
<div class="srr_row">
|
268 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('thumbnail_force')
|
269 |
<div class="srr_field">
|
270 |
<select>
|
271 |
<option disabled selected>No</option>
|
@@ -277,22 +277,22 @@ class super_rss_reader_widget extends WP_Widget{
|
|
277 |
</div>
|
278 |
|
279 |
<div class="srr_row">
|
280 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('thumbnail_default'); ?>"><?php
|
281 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('thumbnail_default')
|
282 |
</div>
|
283 |
|
284 |
-
<h4><?php
|
285 |
|
286 |
<div class="srr_row">
|
287 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('date_timezone'); ?>"><?php
|
288 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('date_timezone')
|
289 |
-
<small class="srr_small_text"><a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones" target="_blank"><?php
|
290 |
</div>
|
291 |
</div>
|
292 |
|
293 |
<div class="srr_row">
|
294 |
-
<div class="srr_label"><label for="<?php echo $this->get_field_id('no_feed_text'); ?>"><?php
|
295 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('no_feed_text')
|
296 |
</div>
|
297 |
|
298 |
</section>
|
@@ -300,12 +300,12 @@ class super_rss_reader_widget extends WP_Widget{
|
|
300 |
<section data-tab-id="display">
|
301 |
|
302 |
<div class="srr_row">
|
303 |
-
<div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('color_style')
|
304 |
<div class="srr_field">
|
305 |
<?php
|
306 |
-
echo '<select name="' . $this->get_field_name('color_style') . '" id="' . $this->get_field_id('color_style') . '">';
|
307 |
foreach( $option_lists[ 'color_style' ] as $k => $v ){
|
308 |
-
echo '<option value="' . $k . '" ' . selected( $color_style, $k, false ) . '>' . $v . '</option>';
|
309 |
}
|
310 |
echo '</select>';
|
311 |
?>
|
@@ -313,12 +313,12 @@ class super_rss_reader_widget extends WP_Widget{
|
|
313 |
</div>
|
314 |
|
315 |
<div class="srr_row">
|
316 |
-
<div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('display_type')
|
317 |
<div class="srr_field">
|
318 |
<?php
|
319 |
-
echo '<select name="' . $this->get_field_name('display_type') . '" id="' . $this->get_field_id('display_type') . '">';
|
320 |
foreach( $option_lists[ 'display_type' ] as $k => $v ){
|
321 |
-
echo '<option value="' . $k . '" ' . selected( $display_type, $k, false ) . '>' . $v . '</option>';
|
322 |
}
|
323 |
echo '</select>';
|
324 |
?>
|
@@ -326,15 +326,15 @@ class super_rss_reader_widget extends WP_Widget{
|
|
326 |
</div>
|
327 |
|
328 |
<div class="srr_row">
|
329 |
-
<div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('ticker_speed')
|
330 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('ticker_speed')
|
331 |
</div>
|
332 |
|
333 |
<div class="srr_row">
|
334 |
-
<div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('visible_items')
|
335 |
-
<div class="srr_field"><input id="<?php echo $this->get_field_id('visible_items')
|
336 |
-
<small class="srr_small_text"><?php
|
337 |
-
<small class="srr_small_text"><?php
|
338 |
</div>
|
339 |
|
340 |
</section>
|
@@ -344,10 +344,10 @@ class super_rss_reader_widget extends WP_Widget{
|
|
344 |
<p>You can build rules to show/hide feed items based on feed title, URL and description. This feature is available in the <a href="https://www.aakashweb.com/wordpress-plugins/super-rss-reader/?utm_source=admin&utm_medium=filter&utm_campaign=srr-pro#pro" target="_blank">PRO version</a>.</p>
|
345 |
|
346 |
<div>
|
347 |
-
<h4><?php
|
348 |
|
349 |
<div class="srr_row">
|
350 |
-
<div class="srr_label"><label><?php
|
351 |
<div class="srr_field">
|
352 |
<?php
|
353 |
echo '<select disabled="disabled">';
|
@@ -358,8 +358,8 @@ class super_rss_reader_widget extends WP_Widget{
|
|
358 |
</div>
|
359 |
|
360 |
<div class="srr_row">
|
361 |
-
<div class="srr_label"><label><?php
|
362 |
-
<div class="srr_field"><a href="#"><?php
|
363 |
</div>
|
364 |
</div>
|
365 |
|
@@ -395,7 +395,7 @@ class super_rss_reader_widget extends WP_Widget{
|
|
395 |
}
|
396 |
|
397 |
public function tt( $text ){
|
398 |
-
echo '<div class="srr_tt" tabindex="0"><span class="dashicons dashicons-editor-help"></span><span class="srr_tt_text"><span>' . $text . '</span></span></div>';
|
399 |
}
|
400 |
|
401 |
}
|
45 |
|
46 |
$instance = $old_instance;
|
47 |
|
48 |
+
$instance[ 'title' ] = sanitize_text_field( $new_instance['title'] );
|
49 |
+
$instance[ 'urls' ] = sanitize_textarea_field( $new_instance['urls'] ) ;
|
50 |
+
$instance[ 'tab_titles' ] = wp_kses_post( $new_instance['tab_titles'] );
|
51 |
|
52 |
$instance[ 'count' ] = intval( $new_instance['count'] );
|
53 |
$instance[ 'show_date' ] = intval( isset( $new_instance['show_date'] ) ? $new_instance['show_date'] : 0 );
|
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' ] = sanitize_text_field( $new_instance['date_format'] );
|
60 |
+
$instance[ 'date_timezone' ] = sanitize_text_field( $new_instance['date_timezone'] );
|
61 |
+
$instance[ 'order_by' ] = sanitize_text_field( $new_instance['order_by'] );
|
62 |
+
$instance[ 'read_more' ] = sanitize_text_field( $new_instance['read_more'] );
|
63 |
$instance[ 'add_nofollow' ] = intval( isset( $new_instance['add_nofollow'] ) ? $new_instance['add_nofollow'] : 0 );
|
64 |
$instance[ 'open_newtab' ] = intval( isset( $new_instance['open_newtab'] ) ? $new_instance['open_newtab'] : 0 );
|
65 |
$instance[ 'rich_desc' ] = intval( isset( $new_instance['rich_desc'] ) ? $new_instance['rich_desc'] : 0 );
|
66 |
+
$instance[ 'desc_type' ] = sanitize_text_field( $new_instance['desc_type'] );
|
67 |
+
$instance[ 'thumbnail_position' ] = sanitize_text_field( $new_instance['thumbnail_position'] );
|
68 |
+
$instance[ 'thumbnail_size' ] = sanitize_text_field( $new_instance['thumbnail_size'] );
|
69 |
+
$instance[ 'thumbnail_default' ] = sanitize_text_field( $new_instance['thumbnail_default'] );
|
70 |
+
$instance[ 'no_feed_text' ] = wp_kses_post( $new_instance['no_feed_text'] );
|
71 |
+
|
72 |
+
$instance[ 'color_style' ] = sanitize_text_field( $new_instance['color_style']);
|
73 |
+
$instance[ 'display_type' ] = sanitize_text_field( $new_instance['display_type']);
|
74 |
+
$instance[ 'visible_items' ] = intval( $new_instance['visible_items'] );
|
75 |
+
$instance[ 'ticker_speed' ] = intval( $new_instance['ticker_speed'] );
|
76 |
|
77 |
return $instance;
|
78 |
}
|
82 |
|
83 |
$instance = wp_parse_args( (array) $instance, SRR_Options::defaults() );
|
84 |
|
85 |
+
$title = isset( $instance['title'] ) ? $instance[ 'title' ] : '';
|
86 |
+
$urls = $instance['urls'];
|
87 |
+
$tab_titles = $instance['tab_titles'];
|
88 |
|
89 |
+
$count = $instance['count'];
|
90 |
+
$show_date = $instance['show_date'];
|
91 |
+
$show_desc = $instance['show_desc'];
|
92 |
+
$show_author = $instance['show_author'];
|
93 |
+
$show_thumb = $instance['show_thumb'];
|
94 |
+
$open_newtab = $instance['open_newtab'];
|
95 |
+
$add_nofollow = $instance['add_nofollow'];
|
96 |
+
$strip_desc = $instance['strip_desc'];
|
97 |
+
$strip_title = $instance['strip_title'];
|
98 |
+
$date_format = $instance['date_format'];
|
99 |
+
$date_timezone = $instance['date_timezone'];
|
100 |
+
$order_by = $instance['order_by'];
|
101 |
+
$read_more = $instance['read_more'];
|
102 |
+
$rich_desc = $instance['rich_desc'];
|
103 |
+
$desc_type = $instance['desc_type'];
|
104 |
+
$thumbnail_position = $instance['thumbnail_position'];
|
105 |
+
$thumbnail_size = $instance['thumbnail_size'];
|
106 |
+
$thumbnail_default = $instance['thumbnail_default'];
|
107 |
+
$no_feed_text = $instance['no_feed_text'];
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
+
$color_style = $instance['color_style'];
|
110 |
+
$display_type = $instance['display_type'];
|
111 |
+
$visible_items = $instance['visible_items'];
|
112 |
+
$ticker_speed = $instance['ticker_speed'];
|
113 |
+
|
114 |
$option_lists = SRR_Options::select_options();
|
115 |
|
116 |
// Replacing commas with new lines
|
122 |
<div class="srr_settings">
|
123 |
|
124 |
<div class="srr_row">
|
125 |
+
<div class="srr_label srr_xsm"><label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php esc_html_e( 'Title', 'super-rss-reader' ); ?></label></div>
|
126 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('title') ); ?>" name="<?php echo esc_attr( $this->get_field_name('title') ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" class="widefat"/></div>
|
127 |
</div>
|
128 |
|
129 |
<div class="srr_row">
|
130 |
+
<div class="srr_label srr_xsm"><label for="<?php echo esc_attr( $this->get_field_id('urls') ); ?>"><?php esc_html_e( 'URL(s)', 'super-rss-reader' ); ?></label></div>
|
131 |
+
<div class="srr_field"><textarea id="<?php echo esc_attr( $this->get_field_id('urls') ); ?>" name="<?php echo esc_attr( $this->get_field_name('urls') ); ?>" class="widefat"><?php echo esc_html( $urls ); ?></textarea>
|
132 |
+
<small class="srr_small_text"><?php esc_html_e( 'Can enter multiple RSS/atom feed URLs in new line', 'super-rss-reader' ); ?></small></div>
|
133 |
</div>
|
134 |
|
135 |
<div class="srr_row">
|
136 |
+
<div class="srr_label srr_xsm"><label for="<?php echo esc_attr( $this->get_field_id('tab_titles') ); ?>"><?php esc_html_e( 'Tab titles', 'super-rss-reader' ); ?></label></div>
|
137 |
+
<div class="srr_field"><textarea id="<?php echo esc_attr( $this->get_field_id('tab_titles') ); ?>" name="<?php echo esc_attr( $this->get_field_name('tab_titles') ); ?>" class="widefat"><?php echo esc_html( $tab_titles ); ?></textarea>
|
138 |
+
<small class="srr_small_text"><?php esc_html_e( 'Enter corresponding tab titles in new line. Leave empty to take from feed.', 'super-rss-reader' ); ?></small></div>
|
139 |
</div>
|
140 |
|
141 |
<ul class="srr_tab_list">
|
142 |
+
<li><a href="#" data-tab="general" class="active"><?php esc_html_e( 'General', 'super-rss-reader' ); ?></a></li>
|
143 |
+
<li><a href="#" data-tab="content"><?php esc_html_e( 'Content', 'super-rss-reader' ); ?></a></li>
|
144 |
+
<li><a href="#" data-tab="display"><?php esc_html_e( 'Display', 'super-rss-reader' ); ?></a></li>
|
145 |
+
<li><a href="#" data-tab="filter"><?php esc_html_e( 'Filter', 'super-rss-reader' ); ?><span class="srr_pro_tag">PRO</span></a></li>
|
146 |
</ul>
|
147 |
|
148 |
<section data-tab-id="general" class="active">
|
149 |
|
150 |
<div class="srr_row">
|
151 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('count') ); ?>"><?php esc_html_e( 'Total items to show', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'Number of feed items to be displayed', 'super-rss-reader' ) ); ?></div>
|
152 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('count') ); ?>" name="<?php echo esc_attr( $this->get_field_name('count') ); ?>" type="number" value="<?php echo esc_attr( $count ); ?>" class="widefat" /></div>
|
153 |
</div>
|
154 |
|
155 |
<div class="srr_row">
|
156 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('show_desc') ); ?>"><?php esc_html_e( 'Show Description', 'super-rss-reader' ); ?></label></div>
|
157 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('show_desc') ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name('show_desc') ); ?>" value="1" <?php echo $show_desc == "1" ? 'checked="checked"' : ""; ?> /></div>
|
158 |
</div>
|
159 |
|
160 |
<div class="srr_row">
|
161 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('show_date') ); ?>"><?php esc_html_e( 'Show Date', 'super-rss-reader' ); ?></label></div>
|
162 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('show_date') ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name('show_date') ); ?>" value="1" <?php echo $show_date == "1" ? 'checked="checked"' : ""; ?> /></div>
|
163 |
</div>
|
164 |
|
165 |
<div class="srr_row">
|
166 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('show_author') ); ?>"><?php esc_html_e( 'Show Author', 'super-rss-reader' ); ?></label></div>
|
167 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('show_author') ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name('show_author') ); ?>" value="1" <?php echo $show_author == "1" ? 'checked="checked"' : ""; ?> /></div>
|
168 |
</div>
|
169 |
|
170 |
<div class="srr_row">
|
171 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('show_thumb') ); ?>"><?php esc_html_e( 'Show thumbnail if present', 'super-rss-reader' ); ?></label></div>
|
172 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('show_thumb') ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name('show_thumb') ); ?>" value="1" <?php echo $show_thumb == "1" ? 'checked="checked"' : ""; ?> /></div>
|
173 |
</div>
|
174 |
</section>
|
175 |
|
176 |
<section data-tab-id="content">
|
177 |
|
178 |
<div class="srr_row">
|
179 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('add_nofollow') ); ?>"><?php esc_html_e( 'Add "no follow" attribute to links', 'super-rss-reader' ); ?></label></div>
|
180 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('add_nofollow') ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name('add_nofollow') ); ?>" value="1" <?php echo $add_nofollow == "1" ? 'checked="checked"' : ""; ?> /></div>
|
181 |
</div>
|
182 |
|
183 |
<div class="srr_row">
|
184 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('open_newtab') ); ?>"><?php esc_html_e( 'Open links in new tab', 'super-rss-reader' ); ?></label></div>
|
185 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('open_newtab') ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name('open_newtab') ); ?>" value="1" <?php echo $open_newtab == "1" ? 'checked="checked"' : ""; ?> /></div>
|
186 |
</div>
|
187 |
|
188 |
<div class="srr_row">
|
189 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('strip_title') ); ?>"><?php esc_html_e( 'Trim title to words', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The number of words to be displayed. Use 0 to disable trimming', 'super-rss-reader' ) ); ?></div>
|
190 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('strip_title') ); ?>" name="<?php echo esc_attr( $this->get_field_name('strip_title') ); ?>" type="number" value="<?php echo esc_attr( $strip_title ); ?>" class="widefat" /></div>
|
191 |
</div>
|
192 |
|
193 |
<div class="srr_row">
|
194 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('order_by') ); ?>"><?php esc_html_e( 'Order feed items by', 'super-rss-reader' ); ?></label></div>
|
195 |
<div class="srr_field">
|
196 |
<?php
|
197 |
echo '<select name="' . $this->get_field_name('order_by') . '" id="' . $this->get_field_id('order_by') . '">';
|
204 |
</div>
|
205 |
|
206 |
<div class="srr_row">
|
207 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('date_format') ); ?>"><?php esc_html_e( 'Date format', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The format of the feed item date.', 'super-rss-reader' ) ); ?></div>
|
208 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('date_format') ); ?>" name="<?php echo esc_attr( $this->get_field_name('date_format') ); ?>" type="text" value="<?php echo esc_attr( $date_format ); ?>" class="widefat" />
|
209 |
+
<small class="srr_small_text"><a href="https://wordpress.org/support/article/formatting-date-and-time/" target="_blank"><?php esc_html_e( 'Refer format codes here', 'super-rss-reader' ); ?></a> <?php echo wp_kses( __( 'Default: <code>j F Y</code> or type <code>relative</code> for relative format (example 2 days ago)', 'super-rss-reader' ), array( 'code' => array() ) ); ?></small>
|
210 |
</div>
|
211 |
</div>
|
212 |
|
213 |
+
<h4><?php esc_html_e( 'Description', 'super-rss-reader' ); ?></h4>
|
214 |
|
215 |
<div class="srr_row">
|
216 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('desc_type') ); ?>"><?php esc_html_e( 'Description to prefer', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'Sometimes feed items have both summary and the full post content. Select the type to prefer.', 'super-rss-reader' ) ); ?></div>
|
217 |
<div class="srr_field">
|
218 |
<?php
|
219 |
+
echo '<select name="' . esc_attr( $this->get_field_name('desc_type') ) . '" id="' . esc_attr( $this->get_field_id('desc_type') ) . '">';
|
220 |
foreach( $option_lists[ 'desc_type' ] as $k => $v ){
|
221 |
+
echo '<option value="' . esc_attr( $k ) . '" ' . selected( $desc_type, $k, false ) . '>' . esc_html( $v ) . '</option>';
|
222 |
}
|
223 |
echo '</select>';
|
224 |
?>
|
226 |
</div>
|
227 |
|
228 |
<div class="srr_row">
|
229 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('strip_desc') ); ?>"><?php esc_html_e( 'Trim description to words', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The number of words to be displayed. Use 0 to disable trimming', 'super-rss-reader' ) ); ?></div>
|
230 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('strip_desc') ); ?>" name="<?php echo esc_attr( $this->get_field_name('strip_desc') ); ?>" type="number" value="<?php echo esc_attr( $strip_desc ); ?>" class="widefat" /></div>
|
231 |
</div>
|
232 |
|
233 |
<div class="srr_row">
|
234 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('read_more') ); ?>"><?php esc_html_e( 'Read more text', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'Leave blank to hide read more text', 'super-rss-reader' ) ); ?></div>
|
235 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('read_more') ); ?>" name="<?php echo esc_attr( $this->get_field_name('read_more') ); ?>" type="text" value="<?php echo esc_attr( $read_more ); ?>" class="widefat" /></div>
|
236 |
</div>
|
237 |
|
238 |
<div class="srr_row">
|
239 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('rich_desc') ); ?>"><?php esc_html_e( 'Enable rich description', 'super-rss-reader' ); ?></label></div>
|
240 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('rich_desc') ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name('rich_desc') ); ?>" value="1" <?php echo $rich_desc == "1" ? 'checked="checked"' : ""; ?> /></div>
|
241 |
</div>
|
242 |
|
243 |
<?php if( $rich_desc == 1 ): ?>
|
244 |
+
<span class="srr_note"><?php esc_html_e( 'Note: You have enabled "Full/Rich HTML". If no description is present, then the full content will be displayed. Please make sure that the feed(s) are from trusted sources and do not contain any harmful scripts. If there are some alignment issues in the description, please use custom CSS to fix that.', 'super-rss-reader' ); ?></span>
|
245 |
<?php endif; ?>
|
246 |
|
247 |
+
<h4><?php esc_html_e( 'Thumbnail', 'super-rss-reader' ); ?></h4>
|
248 |
|
249 |
<div class="srr_row">
|
250 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('thumbnail_position') ); ?>"><?php esc_html_e( 'Thumbnail position', 'super-rss-reader' ); ?></label></div>
|
251 |
<div class="srr_field">
|
252 |
<?php
|
253 |
+
echo '<select name="' . esc_attr( $this->get_field_name('thumbnail_position') ) . '" id="' . esc_attr( $this->get_field_id('thumbnail_position') ) . '">';
|
254 |
foreach( $option_lists[ 'thumbnail_position' ] as $k => $v ){
|
255 |
+
echo '<option value="' . esc_attr( $k ) . '" ' . selected( $thumbnail_position, $k, false ) . '>' . esc_html( $v ) . '</option>';
|
256 |
}
|
257 |
echo '</select>';
|
258 |
?>
|
260 |
</div>
|
261 |
|
262 |
<div class="srr_row">
|
263 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('thumbnail_size') ); ?>"><?php esc_html_e( 'Thumbnail size', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The size of the thumbnail including the units. Example 64px, 10%', 'super-rss-reader' ) ); ?></div>
|
264 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('thumbnail_size') ); ?>" name="<?php echo esc_attr( $this->get_field_name('thumbnail_size') ); ?>" type="text" value="<?php echo esc_attr( $thumbnail_size ); ?>" class="widefat" /></div>
|
265 |
</div>
|
266 |
|
267 |
<div class="srr_row">
|
268 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('thumbnail_force') ); ?>"><?php esc_html_e( 'Fetch thumbnail from the page (feed URL) directly if not available.', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'If feed item does not have an image, then fetch it from the page directly. This feature is available in the PRO version', 'super-rss-reader' ) ); ?></div>
|
269 |
<div class="srr_field">
|
270 |
<select>
|
271 |
<option disabled selected>No</option>
|
277 |
</div>
|
278 |
|
279 |
<div class="srr_row">
|
280 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('thumbnail_default') ); ?>"><?php esc_html_e( 'Default thumbnail image', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The URL of the default thumbnail image if not present. Leave empty to skip thumbnail if not present.', 'super-rss-reader' ) ); ?></div>
|
281 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('thumbnail_default') ); ?>" name="<?php echo esc_attr( $this->get_field_name('thumbnail_default') ); ?>" type="text" value="<?php echo esc_attr( $thumbnail_default ); ?>" class="widefat" /></div>
|
282 |
</div>
|
283 |
|
284 |
+
<h4><?php esc_html_e( 'Misc', 'super-rss-reader' ); ?></h4>
|
285 |
|
286 |
<div class="srr_row">
|
287 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('date_timezone') ); ?>"><?php esc_html_e( 'Date timezone', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The timezone of the feed item date.', 'super-rss-reader' ) ); ?></div>
|
288 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('date_timezone') ); ?>" name="<?php echo esc_attr( $this->get_field_name('date_timezone') ); ?>" type="text" value="<?php echo esc_attr( $date_timezone ); ?>" class="widefat" />
|
289 |
+
<small class="srr_small_text"><a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones" target="_blank"><?php esc_html_e( 'Refer timezone name here', 'super-rss-reader' ); ?>.</a> <?php esc_html_e( 'Example: ', 'super-rss-reader' ); ?> <code>Asia/Taipei</code> <?php esc_html_e( 'Default: ', 'super-rss-reader' ); ?> <code>UTC</code></small>
|
290 |
</div>
|
291 |
</div>
|
292 |
|
293 |
<div class="srr_row">
|
294 |
+
<div class="srr_label"><label for="<?php echo esc_attr( $this->get_field_id('no_feed_text') ); ?>"><?php esc_html_e( 'No feed items text', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'Text to display when there are no feed items', 'super-rss-reader' ) ); ?></div>
|
295 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('no_feed_text') ); ?>" name="<?php echo esc_attr( $this->get_field_name('no_feed_text') ); ?>" type="text" value="<?php echo esc_attr( $no_feed_text ); ?>" class="widefat" /></div>
|
296 |
</div>
|
297 |
|
298 |
</section>
|
300 |
<section data-tab-id="display">
|
301 |
|
302 |
<div class="srr_row">
|
303 |
+
<div class="srr_label srr_sm"><label for="<?php echo esc_attr( $this->get_field_id('color_style') ); ?>"><?php esc_html_e( 'Color theme', 'super-rss-reader' ); ?></label></div>
|
304 |
<div class="srr_field">
|
305 |
<?php
|
306 |
+
echo '<select name="' . esc_attr( $this->get_field_name('color_style') ) . '" id="' . esc_attr( $this->get_field_id('color_style') ) . '">';
|
307 |
foreach( $option_lists[ 'color_style' ] as $k => $v ){
|
308 |
+
echo '<option value="' . esc_attr( $k ) . '" ' . selected( $color_style, $k, false ) . '>' . esc_html( $v ) . '</option>';
|
309 |
}
|
310 |
echo '</select>';
|
311 |
?>
|
313 |
</div>
|
314 |
|
315 |
<div class="srr_row">
|
316 |
+
<div class="srr_label srr_sm"><label for="<?php echo esc_attr( $this->get_field_id('display_type') ); ?>"><?php esc_html_e( 'Display type', 'super-rss-reader' ); ?></label></div>
|
317 |
<div class="srr_field">
|
318 |
<?php
|
319 |
+
echo '<select name="' . esc_attr( $this->get_field_name('display_type') ) . '" id="' . esc_attr( $this->get_field_id('display_type') ) . '">';
|
320 |
foreach( $option_lists[ 'display_type' ] as $k => $v ){
|
321 |
+
echo '<option value="' . esc_attr( $k ) . '" ' . selected( $display_type, $k, false ) . '>' . esc_html( $v ) . '</option>';
|
322 |
}
|
323 |
echo '</select>';
|
324 |
?>
|
326 |
</div>
|
327 |
|
328 |
<div class="srr_row">
|
329 |
+
<div class="srr_label srr_sm"><label for="<?php echo esc_attr( $this->get_field_id('ticker_speed') ); ?>"><?php esc_html_e( 'Ticker speed', 'super-rss-reader' ); ?></label></div>
|
330 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('ticker_speed') ); ?>" name="<?php echo esc_attr( $this->get_field_name('ticker_speed') ); ?>" type="number" value="<?php echo esc_attr( $ticker_speed ); ?>" title="Speed of the ticker in seconds"/> seconds</div>
|
331 |
</div>
|
332 |
|
333 |
<div class="srr_row">
|
334 |
+
<div class="srr_label srr_sm"><label for="<?php echo esc_attr( $this->get_field_id('visible_items') ); ?>"><?php esc_html_e( 'Widget height', 'super-rss-reader' ); ?><?php $this->tt( __( 'The height of the widget when display type is "ticker"', 'super-rss-reader' ) ); ?></label></div>
|
335 |
+
<div class="srr_field"><input id="<?php echo esc_attr( $this->get_field_id('visible_items') ); ?>" name="<?php echo esc_attr( $this->get_field_name('visible_items') ); ?>" type="number" value="<?php echo esc_attr( $visible_items ); ?>" /><br/>
|
336 |
+
<small class="srr_small_text"><?php esc_html_e( 'Set value less than 20 to show visible feed items. Example: 5 items', 'super-rss-reader' ); ?></small></br>
|
337 |
+
<small class="srr_small_text"><?php esc_html_e( 'Set value greater than 20 for fixed widget height. Example: 400 px', 'super-rss-reader' ); ?></small></div>
|
338 |
</div>
|
339 |
|
340 |
</section>
|
344 |
<p>You can build rules to show/hide feed items based on feed title, URL and description. This feature is available in the <a href="https://www.aakashweb.com/wordpress-plugins/super-rss-reader/?utm_source=admin&utm_medium=filter&utm_campaign=srr-pro#pro" target="_blank">PRO version</a>.</p>
|
345 |
|
346 |
<div>
|
347 |
+
<h4><?php esc_html_e( 'Filter RSS feed items', 'super-rss-reader' ); ?></h4>
|
348 |
|
349 |
<div class="srr_row">
|
350 |
+
<div class="srr_label"><label><?php esc_html_e( 'Filter type', 'super-rss-reader' ); ?></label></div>
|
351 |
<div class="srr_field">
|
352 |
<?php
|
353 |
echo '<select disabled="disabled">';
|
358 |
</div>
|
359 |
|
360 |
<div class="srr_row">
|
361 |
+
<div class="srr_label"><label><?php esc_html_e( 'Filter rules', 'super-rss-reader' ); ?></label><?php $this->tt( __( 'The rules for the keyword filters', 'super-rss-reader' ) ); ?></div>
|
362 |
+
<div class="srr_field"><a href="#"><?php esc_html_e( 'View/Edit filter rules', 'super-rss-reader' ); ?></a></div>
|
363 |
</div>
|
364 |
</div>
|
365 |
|
395 |
}
|
396 |
|
397 |
public function tt( $text ){
|
398 |
+
echo '<div class="srr_tt" tabindex="0"><span class="dashicons dashicons-editor-help"></span><span class="srr_tt_text"><span>' . esc_html( $text ) . '</span></span></div>';
|
399 |
}
|
400 |
|
401 |
}
|
includes/widget.php
CHANGED
@@ -52,7 +52,7 @@ class SRR_Widget{
|
|
52 |
}
|
53 |
|
54 |
public static function action_links( $links ){
|
55 |
-
array_unshift( $links, '<a href="https://www.aakashweb.com/wordpress-plugins/super-rss-reader/?utm_source=admin&utm_medium=plugin-list&utm_campaign=srr-pro" target="_blank"><b>' .
|
56 |
return $links;
|
57 |
}
|
58 |
|
52 |
}
|
53 |
|
54 |
public static function action_links( $links ){
|
55 |
+
array_unshift( $links, '<a href="https://www.aakashweb.com/wordpress-plugins/super-rss-reader/?utm_source=admin&utm_medium=plugin-list&utm_campaign=srr-pro" target="_blank"><b>' . esc_html__( 'Upgrade to PRO', 'super-rss-reader' ) . '</b></a>' );
|
56 |
return $links;
|
57 |
}
|
58 |
|
readme.txt
CHANGED
@@ -5,10 +5,10 @@ Plugin URI: https://www.aakashweb.com/wordpress-plugins/super-rss-reader/
|
|
5 |
Tags: rss, widget, ticker, feed, news, twitter, admin, plugin, posts, page, thumbnail, atom, shortcode
|
6 |
License: GPLv2 or later
|
7 |
Donate Link: https://www.paypal.me/vaakash
|
8 |
-
Requires at least:
|
9 |
Requires PHP: 5.3
|
10 |
-
Tested up to: 6.0
|
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 |
|
@@ -130,6 +130,11 @@ The additional effect needs only 2.5 KB of additional JavaScript file which is v
|
|
130 |
|
131 |
## Changelog
|
132 |
|
|
|
|
|
|
|
|
|
|
|
133 |
### 4.6
|
134 |
* New: Option to choose timezone for the date of feed items.
|
135 |
* Fix: Set default link URL when feed item has no link.
|
5 |
Tags: rss, widget, ticker, feed, news, twitter, admin, plugin, posts, page, thumbnail, atom, shortcode
|
6 |
License: GPLv2 or later
|
7 |
Donate Link: https://www.paypal.me/vaakash
|
8 |
+
Requires at least: 5.3
|
9 |
Requires PHP: 5.3
|
10 |
+
Tested up to: 6.0.1
|
11 |
+
Stable tag: 4.7
|
12 |
|
13 |
Display any RSS feed(s) in widget with news ticker effect in multiple tabs, thumbnails, customizable color themes and more.
|
14 |
|
130 |
|
131 |
## Changelog
|
132 |
|
133 |
+
### 4.7
|
134 |
+
* New: Support for lazy loading is enabled for thumbnails.
|
135 |
+
* New: WordPress requirement is updated.
|
136 |
+
* Fix: Enhancements to widget form and feed output sanitization.
|
137 |
+
|
138 |
### 4.6
|
139 |
* New: Option to choose timezone for the date of feed items.
|
140 |
* Fix: Set default link URL when feed item has no link.
|
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.7
|
9 |
* Text Domain: super-rss-reader
|
10 |
* Domain Path: /languages
|
11 |
*/
|
12 |
|
13 |
+
define( 'SRR_VERSION', '4.7' );
|
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__ ) );
|