Latest plugin update break PHP 5.3.x support
-
Updated PublishPress Embeds plugin from version 1.7.5 to 2.0.1. Web site is running on PHP 5.3. This latest plugin update broke site with a syntax error on line 166 of this file:
wp-content/plugins/embedpress/EmbedPress/Core.php
Turns out that the line in question is providing an array using short array notation, which is not supported until PHP 5.4. I fixed my local copy by changing this line:
add_filter('pp_embed_parsed_content', ['\EmbedPress\AMP\EmbedHandler', 'processParsedContent'], 10, 3);
to this PHP 5.3 compatible syntax:
add_filter('pp_embed_parsed_content', array('\EmbedPress\AMP\EmbedHandler', 'processParsedContent'), 10, 3);
As noted this fixed the plugin and brought my site back on-line!
Could you please update your code to avoid the short array syntax so that future updates of this plugin do not break sites running PHP 5.3? That would be greatly appreciated! (I am aware our PHP is old! Rest assured we are working on upgrade to latest PHP versions.)
Otherwise, if you are going to require PHP 5.4 or higher, please note that in your plugin overview and readme.txt file.
- The topic ‘Latest plugin update break PHP 5.3.x support’ is closed to new replies.