Proposed Fix: Version 2.1 causes a site-wide fatal error for sites using PHP 7.2

[ad_1]

I had a site that happens to still be on PHP 7.2.x, and the new version 2.1 release of this plugin caused a site-wide fatal server error.

Thankfully, it was a quick fix of going to inc/Builder/CTF_Feed_Builder.php in this plugin, go to line 1093 (see , and remove the trailing comma at the end of the parameters in the sprintf function call (PHP is okay with trailing commas in arrays & things, but PHP 7.2 [and possibly others] doesn’t like it when that’s done with attributes of a function being called.) That comma isn’t doing anything other than potentially breaking things so it’s a quick & easy thing to remove.

So…

'disabledFeedTypeTooltipNotice' =>  sprintf(
    __( '%sThis feed is disabled%s
        %s Due to Twitter API changes, we can no longer support Search, Home Timeline, Hashtag, Mentions and Lists feeds.%s', 'custom-twitter-feeds' ),
    '<strong>',
    '</strong>',
    '<span>',
    '</span>',
),

becomes…

'disabledFeedTypeTooltipNotice' =>  sprintf(
    __( '%sThis feed is disabled%s
        %s Due to Twitter API changes, we can no longer support Search, Home Timeline, Hashtag, Mentions and Lists feeds.%s', 'custom-twitter-feeds' ),
    '<strong>',
    '</strong>',
    '<span>',
    '</span>'
),

Yes, it really is just the one comma potentially breaking sites so hopefully a new version can be released with this fixed sooner than later (catching it before more PHP 7.2 based sites update to the broken version.)

Also giving a mention that this plugin currently has PHP Version: 5.6 or higher in the plugin’s details which might warrant being updated at some point if testing of those older PHP versions isn’t being done anymore & could be letting PHP incompatibilities slip by (potentially resulting in the site breaking [like it did here]) when it otherwise states it should support that version of PHP.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer