Blog

WordPress

Posted on — Last updated on August 22, 2024

WordPress Popular Posts 6.0: PHP 5 Support Dropped, Minimum Supported WordPress Version Changed

PHP 7.2 and WordPress 5.3 are now the minimum required versions to use the plugin

Back in November 2021 it was announced that WordPress Popular Posts was dropping support for PHP 5. The time has finally come.

Let’s start by paraphrasing a quote from one of my all-time favorite movies, Interstellar (2014):

To move forward we have to leave something behind.

PHP 5 Support Dropped

Over the last few years the WordPress team has been updating WordPress’ codebase to support newer versions of PHP. At the time of writing, the minimum required PHP version to run WordPress is 5.6.

PHP 5.6 stopped receiving official support from php.net back in January 2019. WordPress still supports it nowadays because the WP team wants to give users enough time to migrate to newer versions of PHP. On the other hand though users generally won’t upgrade to newer versions of PHP unless they have to so neither will move forward unless someone takes that first step.

As of today, June 26th 2022, 85.7% of the WordPress-powered websites out there are using PHP 7.2 or newer. Only 8.6% are still using PHP 5.6 or older.

PHP usage statistics, June 2022.

With these numbers in mind now seems like a good time to bump the minimum required PHP version to 7.2 so WordPress Popular Posts can finally take advantage of new~ish PHP features and performance improvements that have been introduced since the release of PHP 7, and also to help push the community toward safer, more performant PHP versions.

So, if your site is using PHP 5.6 you really should consider updating soon. Don’t know how to update PHP? See Get a faster, more secure website: update your PHP today for more details.

Minimum Supported WordPress Version is Now 5.3

WordPress 4.9, released in November 2017, has been supported by WordPress Popular Posts for the past 17 releases: since plugin version 5.2, launched in July 2020, until plugin version 5.5.1 which was released at the beginning of this year.

New features, functionalities and APIs have been added to WordPress since 4.9. This release, WordPress Popular Posts 6.0, takes advantage of some of these additions and so the minimum required version to use the plugin is now WordPress version 5.3.

If you’re using an older version of WordPress on your website you’ll need to update to at least WordPress 5.3 first so you can get the latest version of the plugin.

Attention Developers: Deprecated Code Has Been Removed

Up to WordPress Popular Posts 5.5.1 the plugin supported two features that had been marked as deprecated for quite some time now:

  1. The get_mostpopular() function, deprecated since 2.0.3 (April 2010) and replaced with wpp_get_mostpopular().
  2. The WPP_Query class, deprecated since 5.0.0 (October 2019) and replaced with \WordPressPopularPosts\Query.

Please review your code and update it accordingly if needed before upgrading to WordPress Popular Posts 6.0.

The Statistics Screen Now Lists Only Posts by Default

Traditionally the Statistics dashboard has by default listed the most popular posts and pages from your site.

This behavior, however, has been somewhat confusing to some users because the popular posts list they see on their Statistics dashboard may be different from the popular posts list they see on their website: by default the popular posts widget/block lists posts only.

Stats screen, options popup

To keep things consistent, version 6.0 changes this behavior and now the Stats screen will list posts only as well so it’s more in line with what’s being shown on the front-end of your website.

If you want / need to have the Stats screen lists both posts and pages again then please click on the little cog icon located at the top left of the Stats screen, then set the Post type field to “post, page” (without quotes) and click on Apply to save changes.

Minor Updates & Hotfixes

6.0.5

Version 6.0.5, released on September 4, 2022, fixes yet another issue where the post excerpt might render broken HTML code under certain conditions affecting how the popular posts list is displayed on screen. Props to @dxylott54 for reporting the issue!

6.0.4

Version 6.0.4, released on August 8, 2022, includes some improvements to the WordPress Popular Posts block. Namely, improved the logic behind enabling/disabling certain settings/features so that sane defaults are applied in some cases.

Also, the WPP block now supports Lester Chan’s WP-PostRatings too. Only the classic widget provided support for it up until now. I just sort of forgot to add this feature to the WPP block but don’t tell anyone, let’s keep this a secret between us.

This release also updates the wpp_get_views() function so it’s compatible with WPML/Polylang. Basically, when you pass a post/page ID to the function it’ll now return the views count of the original post which is in line with how the widget renders views count when using either of these two plugins.

Finally, version 6.0.4 updates WPP’s development dependencies and also its .pot file so people interested in translating WPP into their languages can do so without problems.

6.0.3

Version 6.0.3, released on July 24, 2022, fixes an issue where the post excerpt might render broken HTML code under certain conditions affecting how the popular posts list is displayed on screen.

This version also includes some WPCS related changes.

6.0.2

Version 6.0.2, released shortly after version 6.0.1, fixes an issue that prevented Linux users from seeing their popular posts on the Stats dashboard.

6.0.1

Version 6.0.1, released on July 8, 2022, fixes two PHP fatal errors that can occur under specific circumstances & configurations (thanks Senri Miura and Finn Jackson for the reports!)

Included with this release there are also some code improvements to make WPP’s admin screens more secure so please update as soon as you can.