FeedWordPress - Version 2021.0713

Version Description

  • WORDPRESS 5.6, 5.7.x COMPATIBILITY FIXES. This release introduces fixes to annoying or worse warnings resulting from the deprecation of WordPress's built-in WP_Feed_Cache class. This should resolve the problem if you are encountering annoying, worrying, or breaking problems related to the PHP warnings: "Deprecated: class-wp-feed-cache.php is deprecated since version 5.6.0", and/or "Message: ./cache is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable."

  • Fixes PHP warning for "count(): Parameter must be an array or an object that implements Countable in .../wp-content/plugins/feedwordpress/feedwordpress.php on line 1566"

  • Miscellaneous fixes for other missing variable and global warnings.

  • Code cleanup and reorganization to allow better modularization of error messages, warning dialogs, and extended text.

Download this release

Release Info

Developer radgeek
Plugin Icon wp plugin FeedWordPress
Version 2021.0713
Comparing to
See all releases

Code changes from version 2020.0818 to 2021.0713

feedwordpress-elements.css → assets/css/feedwordpress-elements.css RENAMED
File without changes
assets/images/btc-qr-128px.png ADDED
Binary file
assets/images/btc-qr-64px.png ADDED
Binary file
assets/images/btc-qr.png ADDED
Binary file
feedwordpress-tiny.png → assets/images/feedwordpress-tiny.png RENAMED
File without changes
paypal-donation-64px.png → assets/images/paypal-donation-64px.png RENAMED
File without changes
feedwordpress-elements.js → assets/js/feedwordpress-elements.js RENAMED
File without changes
btc-qr-64px.png DELETED
Binary file
extend/SimplePie/default/feedwordpie_parser.class.php CHANGED
@@ -27,6 +27,7 @@ class FeedWordPie_Parser extends SimplePie_Parser {
27
 
28
  public function parse (&$data, $encoding, $url = '')
29
  {
 
30
  $data = apply_filters('feedwordpress_parser_parse', $data, $encoding, $this, $url);
31
 
32
  if (class_exists('DOMXpath') && function_exists('Mf2\parse')) {
27
 
28
  public function parse (&$data, $encoding, $url = '')
29
  {
30
+
31
  $data = apply_filters('feedwordpress_parser_parse', $data, $encoding, $this, $url);
32
 
33
  if (class_exists('DOMXpath') && function_exists('Mf2\parse')) {
extend/SimplePie/feedwordpie_cache.class.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * FeedWordPie_Cache class. Provides customized feed caching for FeedWordPress.
4
+ * This is derived (currently, just copied and combined) from WordPress Core
5
+ * wp-includes/class-wp-feed-cache.php ("Feed API: WP_Feed_Cache_Transient class")
6
+ * and from wp-includes/SimplePie/Cache.php ("SimplePie_Cache"), pursuant to the
7
+ * terms of the GPL.
8
+ *
9
+ * The wrapper class WP_Feed_Cache was deprecated in WordPress 5.6, but its intended
10
+ * replacement, WP_Feed_Cache_Transient, is currently NOT a subclass of SimplePie_Cache
11
+ * which causes problems registering it as a cache class in some versions of SimplePie.
12
+ * Solution: For now, let's copy the class over under a new name, but this time, inherit
13
+ * from SimplePie_Cache. (I am doing it this way because I might want to make some real
14
+ * changs to the implementation of caching, in order to better support typical FeedWordPress
15
+ * use cases. In the meantime, this should at least stop the PHP warnings and the failure
16
+ * to correctly cache feed contents that users are encountering with WordPress 5.6.)
17
+ *
18
+ * @version 2021.0118
19
+ */
20
+
21
+ /**
22
+ * Core class used to implement feed cache transients.
23
+ *
24
+ * @since 2.8.0
25
+ */
26
+ class FeedWordPie_Cache extends SimplePie_Cache {
27
+
28
+ /**
29
+ * Holds the transient name.
30
+ *
31
+ * @since 2.8.0
32
+ * @var string
33
+ */
34
+ public $name;
35
+
36
+ /**
37
+ * Holds the transient mod name.
38
+ *
39
+ * @since 2.8.0
40
+ * @var string
41
+ */
42
+ public $mod_name;
43
+
44
+ /**
45
+ * Holds the cache duration in seconds.
46
+ *
47
+ * Defaults to 43200 seconds (12 hours).
48
+ *
49
+ * @since 2.8.0
50
+ * @var int
51
+ */
52
+ public $lifetime = 43200;
53
+
54
+ /**
55
+ * Constructor.
56
+ *
57
+ * @since 2.8.0
58
+ * @since 3.2.0 Updated to use a PHP5 constructor.
59
+ *
60
+ * @param string $location URL location (scheme is used to determine handler).
61
+ * @param string $filename Unique identifier for cache object.
62
+ * @param string $extension 'spi' or 'spc'.
63
+ */
64
+ public function __construct( $location, $filename, $extension ) {
65
+ $this->name = 'feed_' . $filename;
66
+ $this->mod_name = 'feed_mod_' . $filename;
67
+
68
+ $lifetime = $this->lifetime;
69
+ /**
70
+ * Filters the transient lifetime of the feed cache.
71
+ *
72
+ * @since 2.8.0
73
+ *
74
+ * @param int $lifetime Cache duration in seconds. Default is 43200 seconds (12 hours).
75
+ * @param string $filename Unique identifier for the cache object.
76
+ */
77
+ $this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename );
78
+ }
79
+
80
+ /**
81
+ * Sets the transient.
82
+ *
83
+ * @since 2.8.0
84
+ *
85
+ * @param SimplePie $data Data to save.
86
+ * @return true Always true.
87
+ */
88
+ public function save( $data ) {
89
+ if ( $data instanceof SimplePie ) {
90
+ $data = $data->data;
91
+ }
92
+
93
+ set_transient( $this->name, $data, $this->lifetime );
94
+ set_transient( $this->mod_name, time(), $this->lifetime );
95
+ return true;
96
+ }
97
+
98
+ /**
99
+ * Gets the transient.
100
+ *
101
+ * @since 2.8.0
102
+ *
103
+ * @return mixed Transient value.
104
+ */
105
+ public function load() {
106
+ return get_transient( $this->name );
107
+ }
108
+
109
+ /**
110
+ * Gets mod transient.
111
+ *
112
+ * @since 2.8.0
113
+ *
114
+ * @return mixed Transient value.
115
+ */
116
+ public function mtime() {
117
+ return get_transient( $this->mod_name );
118
+ }
119
+
120
+ /**
121
+ * Sets mod transient.
122
+ *
123
+ * @since 2.8.0
124
+ *
125
+ * @return bool False if value was not set and true if value was set.
126
+ */
127
+ public function touch() {
128
+ return set_transient( $this->mod_name, time(), $this->lifetime );
129
+ }
130
+
131
+ /**
132
+ * Deletes transients.
133
+ *
134
+ * @since 2.8.0
135
+ *
136
+ * @return true Always true.
137
+ */
138
+ public function unlink() {
139
+ delete_transient( $this->name );
140
+ delete_transient( $this->mod_name );
141
+ return true;
142
+ }
143
+
144
+ /**
145
+ * Create a new SimplePie_Cache object
146
+ *
147
+ * @param string $location URL location (scheme is used to determine handler)
148
+ * @param string $filename Unique identifier for cache object
149
+ * @param string $extension 'spi' or 'spc'
150
+ * @return SimplePie_Cache_Base Type of object depends on scheme of `$location`
151
+ */
152
+ public static function get_handler($location, $filename, $extension)
153
+ {
154
+
155
+ $type = explode(':', $location, 2);
156
+ $type = $type[0];
157
+ if (!empty(self::$handlers[$type]))
158
+ {
159
+ $class = self::$handlers[$type];
160
+ return $class($location, $filename, $extension);
161
+ }
162
+
163
+ return new FeedWordPie_Cache($location, $filename, $extension);
164
+ }
165
+
166
+ /**
167
+ * Create a new SimplePie_Cache object
168
+ *
169
+ * @deprecated Use {@see get_handler} instead
170
+ */
171
+ public function create($location, $filename, $extension)
172
+ {
173
+ trigger_error('Cache::create() has been replaced with Cache::get_handler(). Switch to the registry system to use this.', E_USER_DEPRECATED);
174
+ return self::get_handler($location, $filename, $extension);
175
+ }
176
+
177
+ }
feedwordpress.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: FeedWordPress
4
  Plugin URI: http://feedwordpress.radgeek.com/
5
  Description: simple and flexible Atom/RSS syndication for WordPress
6
- Version: 2020.0818
7
  Author: C. Johnson
8
  Author URI: https://feedwordpress.radgeek.com/contact/
9
  License: GPL
@@ -11,7 +11,7 @@ License: GPL
11
 
12
  /**
13
  * @package FeedWordPress
14
- * @version 2020.0818
15
  */
16
 
17
  # This plugin uses code derived from:
@@ -30,7 +30,7 @@ License: GPL
30
  ## CONSTANTS & DEFAULTS ############################################################
31
  ####################################################################################
32
 
33
- define ('FEEDWORDPRESS_VERSION', '2020.0818');
34
  define ('FEEDWORDPRESS_AUTHOR_CONTACT', 'http://feedwordpress.radgeek.com/contact');
35
 
36
  if (!defined('FEEDWORDPRESS_BLEG')) :
@@ -38,7 +38,8 @@ if (!defined('FEEDWORDPRESS_BLEG')) :
38
  endif;
39
 
40
  define('FEEDWORDPRESS_BLEG_BTC_pre_2020', '15EsQ9QMZtLytsaVYZUaUCmrkSMaxZBTso');
41
- define('FEEDWORDPRESS_BLEG_BTC', '1NB1ebYVb68Har4WijmE8gKnZ47NptCqtB'); // 2020.0201
 
42
 
43
  define('FEEDWORDPRESS_BLEG_PAYPAL', '22PAJZZCK5Z3W');
44
 
@@ -96,8 +97,6 @@ endif;
96
  // Dependencies: modules packaged with WordPress core
97
  $wpCoreDependencies = array(
98
  "class:SimplePie" => "class-simplepie",
99
- "class:WP_Feed_Cache" => "class-wp-feed-cache",
100
- "class:WP_Feed_Cache_Transient" => "class-wp-feed-cache-transient",
101
  "class:WP_SimplePie_File" => "class-wp-simplepie-file",
102
  "class:WP_SimplePie_Sanitize_KSES" => "class-wp-simplepie-sanitize-kses",
103
  "function:wp_insert_user" => "registration",
@@ -141,6 +140,7 @@ require_once("${dir}/feedwordpresshtml.class.php");
141
  require_once("${dir}/inspectpostmeta.class.php");
142
  require_once("${dir}/syndicationdataqueries.class.php");
143
  require_once("${dir}/extend/SimplePie/feedwordpie.class.php");
 
144
  require_once("${dir}/extend/SimplePie/feedwordpie_item.class.php");
145
  require_once("${dir}/extend/SimplePie/feedwordpie_file.class.php");
146
  require_once("${dir}/extend/SimplePie/feedwordpie_parser.class.php");
@@ -650,7 +650,7 @@ class FeedWordPress {
650
  $menu_cap,
651
  $syndicationMenu,
652
  NULL,
653
- plugins_url( '/'.FeedWordPress::path('feedwordpress-tiny.png') )
654
  );
655
 
656
  do_action('feedwordpress_admin_menu_pre_feeds', $menu_cap, $settings_cap);
@@ -708,17 +708,8 @@ class FeedWordPress {
708
  else :
709
  $feedwordpress_debug = get_option('feedwordpress_debug');
710
  endif;
711
- if ($feedwordpress_debug==='yes') :
712
- ?>
713
- <div class="error">
714
- <p><strong>FeedWordPress warning.</strong> Debugging mode is <strong>ON</strong>.
715
- While it remains on, FeedWordPress displays many diagnostic error messages,
716
- warnings, and notices that are ordinarily suppressed, and also turns off all
717
- caching of feeds. Use with caution: this setting is absolutely inappropriate
718
- for a production server.</p>
719
- </div>
720
- <?php
721
- endif;
722
  } /* function FeedWordPress::check_debug () */
723
 
724
  /**
@@ -1216,12 +1207,11 @@ for a production server.</p>
1216
  } /* FeedWordPress::feedwordpress_cleanup () */
1217
 
1218
  public function init () {
1219
- global $fwp_path;
1220
 
1221
  // If this is a FeedWordPress admin page, queue up scripts for AJAX
1222
  // functions that FWP uses. If it is a display page or a non-FWP admin
1223
  // page, don't.
1224
- wp_register_style('feedwordpress-elements', plugins_url( '/'.$fwp_path.'/feedwordpress-elements.css') );
1225
  if (FeedWordPressSettingsUI::is_admin()) :
1226
  // For JavaScript that needs to be generated dynamically
1227
  add_action('admin_print_scripts', array('FeedWordPressSettingsUI', 'admin_scripts'));
@@ -1574,7 +1564,7 @@ for a production server.</p>
1574
 
1575
  $this->update($this->update_requested_url());
1576
 
1577
- if (FEEDWORDPRESS_DEBUG and count($wpdb->queries) > 0) :
1578
  $mysqlTime = 0.0;
1579
  $byTime = array();
1580
  foreach ($wpdb->queries as $query) :
@@ -1938,7 +1928,7 @@ for a production server.</p>
1938
  $timeout = intval($timeout);
1939
 
1940
  $pie_class = apply_filters('feedwordpress_simplepie_class', 'FeedWordPie');
1941
- $cache_class = apply_filters('feedwordpress_cache_class', 'WP_Feed_Cache');
1942
  $file_class = apply_filters('feedwordpress_file_class', 'FeedWordPie_File');
1943
  $parser_class = apply_filters('feedwordpress_parser_class', 'FeedWordPie_Parser');
1944
  $item_class = apply_filters('feedwordpress_item_class', 'FeedWordPie_Item');
@@ -1946,7 +1936,7 @@ for a production server.</p>
1946
 
1947
  $feed = new $pie_class;
1948
  $feed->set_feed_url($url);
1949
- $feed->set_cache_class($cache_class);
1950
  $feed->set_timeout($timeout);
1951
 
1952
  $feed->set_content_type_sniffer_class($sniffer_class);
@@ -2263,6 +2253,17 @@ EOMAIL;
2263
  return $cap;
2264
  } /* FeedWordPress::menu_cap () */
2265
 
 
 
 
 
 
 
 
 
 
 
 
2266
  static function path ($filename = '') {
2267
  global $fwp_path;
2268
 
@@ -2270,6 +2271,7 @@ EOMAIL;
2270
  if (strlen($filename) > 0) :
2271
  $path .= '/'.$filename;
2272
  endif;
 
2273
  return $path;
2274
  } /* FeedWordPress::path () */
2275
 
3
  Plugin Name: FeedWordPress
4
  Plugin URI: http://feedwordpress.radgeek.com/
5
  Description: simple and flexible Atom/RSS syndication for WordPress
6
+ Version: 2021.0713
7
  Author: C. Johnson
8
  Author URI: https://feedwordpress.radgeek.com/contact/
9
  License: GPL
11
 
12
  /**
13
  * @package FeedWordPress
14
+ * @version 2021.0713
15
  */
16
 
17
  # This plugin uses code derived from:
30
  ## CONSTANTS & DEFAULTS ############################################################
31
  ####################################################################################
32
 
33
+ define ('FEEDWORDPRESS_VERSION', '2021.0713');
34
  define ('FEEDWORDPRESS_AUTHOR_CONTACT', 'http://feedwordpress.radgeek.com/contact');
35
 
36
  if (!defined('FEEDWORDPRESS_BLEG')) :
38
  endif;
39
 
40
  define('FEEDWORDPRESS_BLEG_BTC_pre_2020', '15EsQ9QMZtLytsaVYZUaUCmrkSMaxZBTso');
41
+ define('FEEDWORDPRESS_BLEG_BTC_2020', '1NB1ebYVb68Har4WijmE8gKnZ47NptCqtB'); // 2020.0201
42
+ define('FEEDWORDPRESS_BLEG_BTC', '1HCDdeGcR66EPxkPT2rbdTd1ezh27pmjPR'); // 2021.0713
43
 
44
  define('FEEDWORDPRESS_BLEG_PAYPAL', '22PAJZZCK5Z3W');
45
 
97
  // Dependencies: modules packaged with WordPress core
98
  $wpCoreDependencies = array(
99
  "class:SimplePie" => "class-simplepie",
 
 
100
  "class:WP_SimplePie_File" => "class-wp-simplepie-file",
101
  "class:WP_SimplePie_Sanitize_KSES" => "class-wp-simplepie-sanitize-kses",
102
  "function:wp_insert_user" => "registration",
140
  require_once("${dir}/inspectpostmeta.class.php");
141
  require_once("${dir}/syndicationdataqueries.class.php");
142
  require_once("${dir}/extend/SimplePie/feedwordpie.class.php");
143
+ require_once("${dir}/extend/SimplePie/feedwordpie_cache.class.php");
144
  require_once("${dir}/extend/SimplePie/feedwordpie_item.class.php");
145
  require_once("${dir}/extend/SimplePie/feedwordpie_file.class.php");
146
  require_once("${dir}/extend/SimplePie/feedwordpie_parser.class.php");
650
  $menu_cap,
651
  $syndicationMenu,
652
  NULL,
653
+ $this->plugin_dir_url( 'assets/images/feedwordpress-tiny.png' )
654
  );
655
 
656
  do_action('feedwordpress_admin_menu_pre_feeds', $menu_cap, $settings_cap);
708
  else :
709
  $feedwordpress_debug = get_option('feedwordpress_debug');
710
  endif;
711
+
712
+ FeedWordPressSettingsUI::get_template_part('notice-debug-mode', $feedwordpress_debug, 'html');
 
 
 
 
 
 
 
 
 
713
  } /* function FeedWordPress::check_debug () */
714
 
715
  /**
1207
  } /* FeedWordPress::feedwordpress_cleanup () */
1208
 
1209
  public function init () {
 
1210
 
1211
  // If this is a FeedWordPress admin page, queue up scripts for AJAX
1212
  // functions that FWP uses. If it is a display page or a non-FWP admin
1213
  // page, don't.
1214
+ wp_register_style('feedwordpress-elements', $this->plugin_dir_url( 'assets/css/feedwordpress-elements.css') );
1215
  if (FeedWordPressSettingsUI::is_admin()) :
1216
  // For JavaScript that needs to be generated dynamically
1217
  add_action('admin_print_scripts', array('FeedWordPressSettingsUI', 'admin_scripts'));
1564
 
1565
  $this->update($this->update_requested_url());
1566
 
1567
+ if (FEEDWORDPRESS_DEBUG and is_array($wpdb->queries) and count($wpdb->queries) > 0) :
1568
  $mysqlTime = 0.0;
1569
  $byTime = array();
1570
  foreach ($wpdb->queries as $query) :
1928
  $timeout = intval($timeout);
1929
 
1930
  $pie_class = apply_filters('feedwordpress_simplepie_class', 'FeedWordPie');
1931
+ $cache_class = apply_filters('feedwordpress_cache_class', 'FeedWordPie_Cache');
1932
  $file_class = apply_filters('feedwordpress_file_class', 'FeedWordPie_File');
1933
  $parser_class = apply_filters('feedwordpress_parser_class', 'FeedWordPie_Parser');
1934
  $item_class = apply_filters('feedwordpress_item_class', 'FeedWordPie_Item');
1936
 
1937
  $feed = new $pie_class;
1938
  $feed->set_feed_url($url);
1939
+ $feed->registry->register('Cache', $cache_class);
1940
  $feed->set_timeout($timeout);
1941
 
1942
  $feed->set_content_type_sniffer_class($sniffer_class);
2253
  return $cap;
2254
  } /* FeedWordPress::menu_cap () */
2255
 
2256
+ public function plugin_dir_path ($path = '') {
2257
+ $dir = plugin_dir_path( __FILE__ );
2258
+ $file_path = "${dir}${path}";
2259
+ return apply_filters( "feedwordpress_plugin_dir_path", $file_path );
2260
+ } /* FeedWordPress::plugin_dir_path () */
2261
+
2262
+ public function plugin_dir_url ($path = '') {
2263
+ $url_path = plugins_url( $path, __FILE__ );
2264
+ return apply_filters( "feedwordpress_plugin_dir_url", $url_path );
2265
+ } /* FeedWordPRess::plugin_dir_url () */
2266
+
2267
  static function path ($filename = '') {
2268
  global $fwp_path;
2269
 
2271
  if (strlen($filename) > 0) :
2272
  $path .= '/'.$filename;
2273
  endif;
2274
+
2275
  return $path;
2276
  } /* FeedWordPress::path () */
2277
 
feedwordpress.pings.functions.php CHANGED
@@ -44,6 +44,8 @@ function fwp_release_pings () {
44
  }
45
 
46
  function fwp_do_pings () {
 
 
47
  if (!is_null($fwp_held_ping) and $post_id) : // Defer until we're done updating
48
  $fwp_held_ping = $post_id;
49
 
44
  }
45
 
46
  function fwp_do_pings () {
47
+ global $fwp_held_ping;
48
+
49
  if (!is_null($fwp_held_ping) and $post_id) : // Defer until we're done updating
50
  $fwp_held_ping = $post_id;
51
 
feedwordpressboilerplatereformatter.class.php CHANGED
@@ -61,7 +61,8 @@ class FeedWordPressBoilerplateReformatter {
61
  return get_syndication_source_link($param['original'], $this->id);
62
  }
63
  function source_link ($atts) {
64
- switch (strtolower($atts[0])) :
 
65
  case '-name' :
66
  $ret = $this->source_name($atts);
67
  break;
@@ -80,6 +81,7 @@ class FeedWordPressBoilerplateReformatter {
80
  endswitch;
81
  return $ret;
82
  }
 
83
  function source_setting ($atts) {
84
  $param = shortcode_atts(array(
85
  'key' => NULL,
@@ -97,7 +99,8 @@ class FeedWordPressBoilerplateReformatter {
97
  return get_the_author();
98
  }
99
  function source_author_link ($atts) {
100
- switch (strtolower($atts[0])) :
 
101
  case '-name' :
102
  $ret = $this->source_author($atts);
103
  break;
61
  return get_syndication_source_link($param['original'], $this->id);
62
  }
63
  function source_link ($atts) {
64
+ $arg0 = (( is_array($atts) and isset($atts[0]) ) ? strtolower($atts[0]) : '' );
65
+ switch ($arg0) :
66
  case '-name' :
67
  $ret = $this->source_name($atts);
68
  break;
81
  endswitch;
82
  return $ret;
83
  }
84
+
85
  function source_setting ($atts) {
86
  $param = shortcode_atts(array(
87
  'key' => NULL,
99
  return get_the_author();
100
  }
101
  function source_author_link ($atts) {
102
+ $arg0 = (( is_array($atts) and isset($atts[0]) ) ? strtolower($atts[0]) : '' );
103
+ switch ($arg0) :
104
  case '-name' :
105
  $ret = $this->source_author($atts);
106
  break;
feedwordpresssettingsui.class.php CHANGED
@@ -5,25 +5,23 @@
5
  */
6
  class FeedWordPressSettingsUI {
7
  static function is_admin () {
8
- global $fwp_path;
9
-
10
  $admin_page = false; // Innocent until proven guilty
11
- if (isset($_REQUEST['page'])) :
 
12
  $admin_page = (
13
  is_admin()
14
- and preg_match("|^{$fwp_path}/|", $_REQUEST['page'])
15
  );
16
  endif;
17
  return $admin_page;
18
  }
19
 
20
  static function admin_scripts () {
21
- global $fwp_path;
22
-
23
  wp_enqueue_script('post'); // for magic tag and category boxes
24
  wp_enqueue_script('admin-forms'); // for checkbox selection
25
 
26
- wp_register_script('feedwordpress-elements', plugins_url('/' . $fwp_path . '/feedwordpress-elements.js') );
27
  wp_enqueue_script('feedwordpress-elements');
28
  }
29
 
@@ -85,6 +83,53 @@ class FeedWordPressSettingsUI {
85
  <?php
86
  } /* FeedWordPressSettingsUI::fix_toggles_js () */
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  static function magic_input_tip_js ($id) {
89
  if (!preg_match('/^[.#]/', $id)) :
90
  $id = '#'.$id;
5
  */
6
  class FeedWordPressSettingsUI {
7
  static function is_admin () {
8
+
 
9
  $admin_page = false; // Innocent until proven guilty
10
+ if (!is_null(MyPHP::request('page'))) :
11
+ $fwp = preg_quote(FeedWordPress::path());
12
  $admin_page = (
13
  is_admin()
14
+ and preg_match("|^${fwp}/|", MyPHP::request('page'))
15
  );
16
  endif;
17
  return $admin_page;
18
  }
19
 
20
  static function admin_scripts () {
 
 
21
  wp_enqueue_script('post'); // for magic tag and category boxes
22
  wp_enqueue_script('admin-forms'); // for checkbox selection
23
 
24
+ wp_register_script('feedwordpress-elements', plugins_url( 'assets/js/feedwordpress-elements.js', __FILE__ ) );
25
  wp_enqueue_script('feedwordpress-elements');
26
  }
27
 
83
  <?php
84
  } /* FeedWordPressSettingsUI::fix_toggles_js () */
85
 
86
+ /**
87
+ * get_template_part: load a template (usually templated HTML) from the FeedWordPress plugins
88
+ * directory, in a way similar to the WordPress theme function get_template_part() loads a
89
+ * template module from the theme directory.
90
+ *
91
+ * @param string $slug The slug name for the generic template
92
+ * @param string $name The name of the specialized template
93
+ * @param array $args Additional arguments passed to the template.
94
+ */
95
+ static public function get_template_part ( $slug, $name = null, $type = null, $args = array() ) {
96
+ global $feedwordpress;
97
+
98
+ do_action( "feedwordpress_get_template_part_${slug}", $slug, $name, $type, $args );
99
+
100
+ $templates = array();
101
+ $name = (string) $name;
102
+ $type = (string) $type;
103
+
104
+ $ext = ".php";
105
+ if ( strlen($type) > 0 ):
106
+ $ext = ".${type}${ext}";
107
+ endif;
108
+
109
+ if ( strlen($name) > 0 ) :
110
+ $templates[] = "${slug}-${name}${ext}";
111
+ endif;
112
+ $templates[] = "${slug}${ext}";
113
+
114
+ do_action( "feedwordpress_get_template_part", $slug, $name, $type, $args );
115
+
116
+ // locate_template
117
+ $located = '';
118
+ foreach ( $templates as $template_name ) :
119
+ if ( !! $template_name ) :
120
+ $templatePath = $feedwordpress->plugin_dir_path('templates/' . $template_name);
121
+ if ( is_readable( $templatePath ) ) :
122
+ $located = $templatePath;
123
+ break;
124
+ endif;
125
+ endif;
126
+ endforeach;
127
+
128
+ if ( strlen($located) > 0 ) :
129
+ load_template( $located, /*require_once=*/ false, /*args=*/ $args );
130
+ endif;
131
+ } /* FeedWordPressSettingsUI::get_template_part () */
132
+
133
  static function magic_input_tip_js ($id) {
134
  if (!preg_match('/^[.#]/', $id)) :
135
  $id = '#'.$id;
feedwordpresssyndicationpage.class.php CHANGED
@@ -718,22 +718,13 @@ support, and documentation.</p>
718
 
719
  <div id="flattr-paypal">
720
 
721
- <div style="display: inline-block; vertical-align: middle; ">
722
- <a class="FlattrButton" style="display:none;" href="http://feedwordpress.radgeek.com/"></a>
723
- <noscript>
724
- <a href="https://flattr.com/thing/1380856/FeedWordPress" target="_blank"><img src="https://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a>
725
- </noscript>
726
- <div>via Flattr</div>
727
-
728
- </div> <!-- style="display: inline-block" -->
729
-
730
  <div class="hovered-component" style="display: inline-block; vertical-align: bottom">
731
- <a href="bitcoin:<?php print esc_attr(FEEDWORDPRESS_BLEG_BTC); ?>"><img src="<?php print esc_url( plugins_url('/'.FeedWordPress::path('btc-qr-64px.png') ) ); ?>" alt="Donate" /></a>
732
  <div><a href="bitcoin:<?php print esc_attr(FEEDWORDPRESS_BLEG_BTC); ?>">via bitcoin<span class="hover-on pop-over" style="background-color: #ddffdd; padding: 5px; color: black; border-radius: 5px;">bitcoin:<?php print esc_html(FEEDWORDPRESS_BLEG_BTC); ?></span></a></div>
733
  </div>
734
 
735
  <div style="display: inline-block; vertical-align: bottom">
736
- <input type="image" name="submit" src="<?php print esc_url(plugins_url('/' . FeedWordPress::path('paypal-donation-64px.png' ) ) ); ?>" alt="Donate through PayPal" />
737
  <input type="hidden" name="business" value="<?php print esc_attr(FEEDWORDPRESS_BLEG_PAYPAL); ?>" />
738
  <input type="hidden" name="cmd" value="_xclick" />
739
  <input type="hidden" name="item_name" value="FeedWordPress donation" />
@@ -1138,6 +1129,7 @@ function fwp_syndication_manage_page_update_box ($object = NULL, $box = NULL) {
1138
  or (is_numeric($bleg_box_hidden) and $bleg_box_hidden < time())
1139
  ));
1140
 
 
1141
  if (isset($_REQUEST['paid']) and $_REQUEST['paid']) :
1142
  $object->bleg_thanks($subject, $box);
1143
  elseif ($bleg_box_ready) :
718
 
719
  <div id="flattr-paypal">
720
 
 
 
 
 
 
 
 
 
 
721
  <div class="hovered-component" style="display: inline-block; vertical-align: bottom">
722
+ <a href="bitcoin:<?php print esc_attr(FEEDWORDPRESS_BLEG_BTC); ?>"><img src="<?php print esc_url( plugins_url('/'.FeedWordPress::path('assets/images/btc-qr-128px.png') ) ); ?>" alt="Donate" /></a>
723
  <div><a href="bitcoin:<?php print esc_attr(FEEDWORDPRESS_BLEG_BTC); ?>">via bitcoin<span class="hover-on pop-over" style="background-color: #ddffdd; padding: 5px; color: black; border-radius: 5px;">bitcoin:<?php print esc_html(FEEDWORDPRESS_BLEG_BTC); ?></span></a></div>
724
  </div>
725
 
726
  <div style="display: inline-block; vertical-align: bottom">
727
+ <input type="image" name="submit" src="<?php print esc_url(plugins_url('/' . FeedWordPress::path('assets/images/paypal-donation-64px.png' ) ) ); ?>" style="width: 128px; height: 128px;" alt="Donate via PayPal" />
728
  <input type="hidden" name="business" value="<?php print esc_attr(FEEDWORDPRESS_BLEG_PAYPAL); ?>" />
729
  <input type="hidden" name="cmd" value="_xclick" />
730
  <input type="hidden" name="item_name" value="FeedWordPress donation" />
1129
  or (is_numeric($bleg_box_hidden) and $bleg_box_hidden < time())
1130
  ));
1131
 
1132
+ $bleg_box_ready = apply_filters( 'feedwordpress_bleg_box_ready', $bleg_box_ready );
1133
  if (isset($_REQUEST['paid']) and $_REQUEST['paid']) :
1134
  $object->bleg_thanks($subject, $box);
1135
  elseif ($bleg_box_ready) :
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: C. Johnson
3
  Donate link: http://feedwordpress.radgeek.com/donate/
4
  Tags: syndication, aggregation, feed, atom, rss
5
  Requires at least: 4.5
6
- Tested up to: 5.5
7
- Stable tag: 2020.0818
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -65,9 +65,24 @@ FeedWordPress has many options which can be accessed through the WordPress Dashb
65
 
66
  == Changelog ==
67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  = 2020.0818 =
69
 
70
- * WORDPRESS 5.5 COMPATIBILITY FIXES, RESOLVES WARNING NOTICES OR WP-ADMIN LOCKOUT. WordPress 5.5 incorporated a newer release of SimplePie, version 1.5.5, which is pretty rad, but FeedWordPress classes that relied on SimplePie 1.3.1's method signatures would then produce PHP warning notices. That should be pretty innocuous, but depending on web server configurations, some users could get locked out of their own wp-admin interface by the display of error notices in the browser at inopportune times. In any case, I have
71
 
72
  * PHP 7.4 COMPATIBILITY FIX: Magic quotes were deprecated and then removed back in PHP 5.x, and in PHP 7.4 the vestigial `get_magic_quotes_gpc()` function has been deprecated. We don't need to worry about it anymore for versions of PHP still supported by WordPress. The reference to the function in the MyPHP utility class caused PHP warnings in more recent versions of PHP; so it has now been removed.
73
 
3
  Donate link: http://feedwordpress.radgeek.com/donate/
4
  Tags: syndication, aggregation, feed, atom, rss
5
  Requires at least: 4.5
6
+ Tested up to: 5.7.2
7
+ Stable tag: 2021.0713
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
65
 
66
  == Changelog ==
67
 
68
+ = 2021.0713 =
69
+
70
+ * WORDPRESS 5.6, 5.7.x COMPATIBILITY FIXES. This release introduces fixes to annoying or worse warnings resulting from
71
+ the deprecation of WordPress's built-in WP_Feed_Cache class. This should resolve the problem if you are encountering
72
+ annoying, worrying, or breaking problems related to the PHP warnings: "Deprecated: class-wp-feed-cache.php is
73
+ <strong>deprecated</strong> since version 5.6.0", and/or "Message: ./cache is not writable. Make sure you've set the
74
+ correct relative or absolute path, and that the location is server-writable."
75
+
76
+ * Fixes PHP warning for "count(): Parameter must be an array or an object that implements Countable in
77
+ .../wp-content/plugins/feedwordpress/feedwordpress.php on line 1566"
78
+
79
+ * Miscellaneous fixes for other missing variable and global warnings.
80
+
81
+ * Code cleanup and reorganization to allow better modularization of error messages, warning dialogs, and extended text.
82
+
83
  = 2020.0818 =
84
 
85
+ * WORDPRESS 5.5 COMPATIBILITY FIXES, RESOLVES WARNING NOTICES OR WP-ADMIN LOCKOUT. WordPress 5.5 incorporated a newer release of SimplePie, version 1.5.5, which is pretty rad, but FeedWordPress classes that relied on SimplePie 1.3.1's method signatures would then produce PHP warning notices. That should be pretty innocuous, but depending on web server configurations, some users could get locked out of their own wp-admin interface by the display of error notices in the browser at inopportune times. In any case, I have added code to switch between backward-compatible modules for SimplePie 1.3.1 or updated modules compatible with SimplePie 1.5.5, based on the version available in your WordPress installation; so these notices and their untoward effects should be eliminated.
86
 
87
  * PHP 7.4 COMPATIBILITY FIX: Magic quotes were deprecated and then removed back in PHP 5.x, and in PHP 7.4 the vestigial `get_magic_quotes_gpc()` function has been deprecated. We don't need to worry about it anymore for versions of PHP still supported by WordPress. The reference to the function in the MyPHP utility class caused PHP warnings in more recent versions of PHP; so it has now been removed.
88
 
templates/notice-debug-mode-yes.html.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <div class="error">
2
+ <p><strong>FeedWordPress warning.</strong> Debugging mode is <strong>ON</strong>.
3
+ While it remains on, FeedWordPress displays many diagnostic error messages,
4
+ warnings, and notices that are ordinarily suppressed, and also turns off all
5
+ caching of feeds. Use with caution: this setting is absolutely inappropriate
6
+ for a production server.</p>
7
+ </div>