Recent code updates from Rad Geek at github.com:
Check out the details at GitHub.com ...
To-day I released a new version of FeedWordPress, version 2017.1020. This version includes one major visible new feature in the plugin, and a lot of smaller changes, some of them bug fixes and others compatibility tweaks. Download, test it out, and enjoy.
This release includes a major new feature, in a certain sense: you can now set up Boilerplate / Credit attribution text for syndicated posts directly from the FeedWordPress admin interface, without having to touch your template or theme files. This functionality has been available for a long time by installing a separate “experimental” add-on, FWP+: Add Attribution; but after several years of recommending the same add-on to multiple correspondents, with its feature set remaining largely unchanged, I figured it was long since time to incorporate the “experiment” into the off-the-shelf code.)
FeedWordPress is now an extremely … “mature” project, at over 12 years old. I have been working on it on and off as time, academic obligations, and the rest of life allowed, but I regret that I haven’t been doing a very good job here of documenting the changes as they’ve been made, or more actively enhancing and improving the product above and beyond responding to relatively simple bug reports. In the next few months, I expect to have significantly more time and mind space to recommit to keeping this project not just functional, but useful, enjoyable and up to date with ongoing development in the WordPress world. Part of that is going to be making an effort to keep up more with documenting the progress here on this website, rather than simply syndicating in batches of geek-talk from the changes I make behind the scenes at Github or in the WordPress plugins repository SVN. So, in the interest of catching up a bit on that, here’s some of the significant changes that have occurred over the past year in FeedWordPress:
ADD BOILERPLATE / CREDITS FEATURE AVAILABLE IN POSTS & LINKS SETTINGS PANEL. I have added a new settings panel to the off-the-shelf features of FeedWordPress, under Syndication > Posts & Links (or under the Posts settings page for any individual feed), which allows you to define boilerplate text that should appear in connection with every syndicated post, or with every post syndicated from a particular feed. So, for example, if you want each syndicated post to include a byline reading “This is a syndicated post, reprinted from (LINK TO ORIGINAL SOURCE WEBSITE).”, you could set up this byline from within the FeedWordPress settings interface, by going to the Boilerplate / Credits panel, and adding a line to appear BEFORE the CONTENT of each syndicated post, using the text and shortcode “This is a syndicated post, reprinted from .” For those of you who have corresponded with me about this feature before, you may be familiar with it from the long-standing “experimental” add-on, FWP+: Add Attribution; I’ve decided that it’s been enough years, and I’ve had enough requests, that the Add Attribution feature may as well be included in the main FeedWordPress code.
Back when FeedWordPress was first created, the assumption was that a well-behaved aggregator would include boilerplate text to indicate the source of syndicated posts, but that the best way to do this was to provide a set of syndication-specific template tags so that the administrator setting up the site could edit their Theme template files with constructs like:
<?php if (is_syndicated()) : ?> <p class="byline">This post by <?php the_author(); ?> originally appeared at <a href="<?php the_syndication_source_link(); ?>"><?php the_syndication_source(); ?></a>.</p> <?php else : ?> <p class="byline">By <?php the_author(); ?>.</p> <?php endif; ?>
You can still do this, of course, and for maximum expressive power and flexibility, it is certainly the best way to do it. Template Tags are documented here: http://feedwordpress.radgeek.com/wiki/templates/ However, (1) it requires writing PHP code, which not everyone is comfortable doing; and (2) it requires altering template files within your Theme, which is not always possible, especially given the increasing role that prepackaged commercial themes have come to play in the WordPress ecosystem. So, now, you can get some basic features for adding boilerplate text and attribution credits even without touching your template files, and without having to add custom add-ons for FeedWordPress. Enjoy!
MINOR CODE MODERNIZATION, PHP 7.1 COMPATIBILITY AND BUG FIXES. This project is now 12+ years old (good lord), and there are still some places where code was written at a time when PHP was a very different language from what it is now. Props to @david-robinson-practiceweb for pointing out and sending a pull request to fix some instances where obsolete PHP reference notation (
&$q on parameters and so on) created a compatibility problem for PHP 7.1. Props to an email correspondent for pointing out a place in SyndicatedPost where excerpts should be generated from post content using encoding-aware mb_substr(), instead of naively running them through substr(). I’ve begun making some efforts throughout to begin auditing some of the creakiest old code in the project, to update what needs updating and improve documentation throughout.
PARTIAL FIX FOR 2X DUPLICATE POSTS APPEARING ON DUAL HTTP/HTTPS SITES: Some users reported an issue in which their FeedWordPress sites, which are over both insecure HTTP and over HTTPS, would pick up exactly 2 copies of every post or almost every post from certain feeds, and where the guids for each of the pair of duplicate posts would look exactly alike, except for a difference in the protocol, for example:
… where www.example.com is the server that your own copy of FeedWordPress is installed. This release of FeedWordPress normalizes post guid prefixes so as to avoid or limit the scope of this problem.
PHP 7 Compatibility: eliminate remaining sources of PHP 7 compatibility-check failures — remove the use of depreciated mysql_error() function, and make sure all classes make use of __construct() convention for constructors.
AVOID “PHP Warning: shellexec() has been disabled for security reasons in /feedwordpress/feeds-page.php on line 197″: FeedWordPress uses the PHP shellexec() function in a very narrowly limited way for information gathering, trying to find the real path to curl or wget on your system, so that it can give as realistic as possible a recommendation for the sample crontab line displayed in Syndication > Feeds & Updates. Some web hosting environments disable shellexec for security reasons (since it could in theory be used to do a lot more stuff than the very limited information gathering FWP uses it for); in which case, this part of the code in FeedWordPress could spit out a nasty-looking and potentially worrisome-looking error message. So, now this code is fenced with checks to make sure that shellexec is available, before FWP attempts to make use of it.
WORDPRESS BACKWARD COMPATIBILITY FOR VERSIONS 4.7: This change fixes a fatal PHP error (on some web server configurations you’d see the message “Fatal error: require_once(): Failed opening required ‘/wp-includes/class-wp-feed-cache.php'” on others, you might just see an HTTP 500 Internal Server Error or a blank page) when using FeedWordPress with versions of WordPress before 4.7. A change that I introduced to avoid a code module that had been deprecated in version 4.7 ended up relying on code modules that were only introduced as of version 4.7; so now, instead, FeedWordPress attempts to detect which modules the current version of the WordPress core makes available, and load the right modules depending on your WordPress version.
In theory, up to this point, FeedWordPress supported any version of WordPress from version 3.0 onward. In practice, version 3.0 was released over 6 years ago, and I can realistically commit only to testing out new releases of FeedWordPress with a few prior versions of WordPress; so I’ve updated the “Requires at least” field to version 4.5, the first major release issued in 2016. If you’ve really got to use FeedWordPress with older versions of WordPress, it will probably still work with any moderately modern release of WordPress, but I won’t promise to keep it working with releases of WordPress that are more than about a year old.
WORDPRESS COMPATIBILITY: Tested with new versions of WordPress up to 4.7.
PHP WARNINGS UNDER WP 4.7: Eliminated cause of a PHP warning under WP 4.7 “Parameter 1 to FeedWordPressHTTPAuthenticator::setauthoptions expected to be reference” Warnings were due to a change in how httpapicurl hook is sometimes called in WP 4.7; so I changed the signature of the event handling method to avoid the notice. Props to @cogdog, @froomkin, @gwynethllewelyn et al. for flagging the issue and @garymarkfuller for suggesting a preliminary fix to the issue that was fairly similar to the solution I ended up adopting.
PHP 7 and PHP Strict Standards compatibility changes: @alexiskulash @daidais and @zoul0813 all sent pull requests through Github to fix some issues from a very old code base that has made its way from PHP 3.x through 5.x to the roll-out of PHP 7. Class methods should now fare better under modern versions of PHP and generate fewer “Deprecated” notices.
IMPROVEMENTS TO SCHEDULED AND AUTOMATIC UPDATES: use wploaded hook to check for magic URL parameters and to execute updates, to do pageload-based automatic updates, etc. Ensures that anything plugins or themes need to do in init to set up custom post types, taxonomies, etc. will be done before the updatefeedwordpress updates are attempted. If you saw posts not getting put into the correct custom post type or custom taxonomies or similar problems when performing scheduled updates, but the problem seemed to go away when you manually performed updates through the wp-admin interface, then you might be able to solve those problems with this update.
If you notice any problems, have any questions, need any help, or just want to say
Hi, don’t hesitate to drop me a line via e-mail or through the comment form. If you have a specific problem that you need help with, please try to describe the circumstances and the problem you are seeing in as much detail as possible — what you expected to happen, what you see happening instead, what you are doing (if anything) when the error comes up. If the problem has to do with one or more particular feeds, it helps a lot to include the URL(s) of the feed or feeds that you’re seeing the problem with. If the problem has to do with an error message appearing that you do not understand, a screenshot of the error message would help a lot.
Now get on out there and check out the new release! Download and enjoy!