Blog

WordPress

Posted on — Last updated on June 4, 2021

Recently 3.0 has been released!

This new version introduces some Quality-of-Life changes, widget themes, and improved Polylang/WPML support.

WordPress 5.7 was released a couple of days ago and so I though this was a good chance to release a new version of Recently which hasn’t seen an official update in a while now.

Recently 3.0 is a full rewrite of the plugin, using WordPress Popular Posts‘ code structure as its base. This will make maintenance a lot easier for me since both Recently’s and WPP’s codebases are quite similar now.

This code rewrite for Recently also inherited some goodies from WPP!

Image Lazing Loading

Site speed has been one of the main search ranking factors since 2010 (see Using site speed in web search ranking). Back in 2018 Google doubled down on this, including mobile loading times as part of the key indicators that the search engine giant keeps track of for its search results.

A new major update to Google’s core algorithm will land in May 2021, putting even more emphasis on site performance as an key ranking factor so you want to make sure that your site’s speed is as good as it can be in order to rank well in Google search results.

With all this in mind, Recently 3.0 introduces Thumbnail Lazy Loading, a feature that tells the browser to defer the loading of Recently’s thumbnails if they’re off-screen. The browser will then only load the images if/when the visitor scrolls near them.

This is helpful is because the less resources the browser has to load for the initial render of a page the faster the page will load. Good loading times = better chances at getting higher search results positions. This also improves the overall user experience, after all nobody likes browsing slow websites, right?

This feature is enabled by default with this release. If for some reason you don’t want Recently to lazy load its thumbnail images (eg. you already have installed another plugin to lazy load images) there’s an option available on Settings > Recently > Tools that you can use to disable it.

Browser support

The image lazing loading feature is currently supported by most Chromium-based browsers (Google Chrome, Microsoft Edge, and Opera) and Mozilla Firefox. You can check caniuse.com for a more up-to-date list.

For browsers that don’t support the feature (like Internet Explorer and -at the time of writing- Safari) images will load normally.

Themes!

WordPress Popular Posts version 5.0 introduced Widget Themes, a feature that allows you to apply predefined designs to the Popular Posts widget. This is especially helpful if you’re not a web developer / designer yourself but want a popular posts list that looks good out-of-the-box without having to tinker with code.

And now with the release of version 3.0 Recently can also use themes!

Recently Widget: Theme Selector

Recently 3.0 includes 10 themes in total. More themes may be added in future releases so stay tuned!

Browser support

These themes are Self-Contained Web Components which allows Recently to style them in a way that won’t affect other components on the web page and, more importantly, the themes themselves won’t be affected by global CSS rules either. Note that this is true for web browsers that support the Shadow DOM: Google Chrome, Mozilla Firefox, Safari, Opera, Microsoft Edge, etc.

This doesn’t mean that themes won’t work at all on older browsers/browsers that don’t support the Shadow DOM. There’s a good chance that the themes will still work, however expect some visual artifacts and/or (minor) issues.

Retina Display support

Another feature inherited from the upcoming WordPress Popular Posts version 5.3: Retina display support!

Retina displays are displays have a higher pixel density than regular displays. This allows the screen to display text and images in more detail, improving the viewing experience.

Here’s how Recently’s thumbnail looks on a Retina display before adding this feature vs how it looks after:

Image Retina Support Off vs On

Quite the difference, huh?

(The screen capture looks a bit pixelated due to the plugin I’m using to optimize images.)

This feature is enabled by default. If you want to disable it there’s a new filter hook called recently_retina_support that you can use to do so.

Note that you may need to clear Recently’s thumbnail cache first (Settings > Recently > Tools, under Thumbnails) so the widget can generate the images needed to provide retina support.

Improved compatibility with Content Security Policy

Content Security Policy (CSP) is an HTTP Header that provides an additional layer of protection against Cross-Site Scripting (XSS), Clickjacking, and other forms of code injection attacks. You can read more about it here: Content Security Policy – An Introduction.

Starting version 3.0, Recently will remove all instances of inline JS code from your site’s front-end, helping make your website more secure and CSP compatible.

Important: as a side effect of this change Recently may have compatibility issues with some plugins that minify/combine JavaScript code. Read here for more details: Is Recently compatible with plugins that minify / bundle JavaScript code?

Improved Polylang/WPML support

Polylang and WPML are two of the most well-known multilingual plugins for WordPress out there. When present, Recently’s widget will attempt to automatically translate the recent posts list into the currently active language.

This release includes some compatibility improvements to make sure Recently continues to work as expected on sites that rely on Polylang/WPML to distribute their content in several languages.

Other Quality-of-Life Improvements

  • The widget will no longer strip the URL of the current post/page/custom-post-type on the list. Now it can be clicked just like the rest of the posts. This also fixes some usability issues, like for example where right clicking on the link would not allow the user to copy its URL to use it elsewhere as there was no URL to copy.
  • New Content Tags available: {total_items} displays the total number of items on the list; {item_position} displays the position of the post on the list.
  • Thumbnails will attempt to use the original ALT text as set by the user. I say “attempt” because there’s a long-standing accessibility / backward compatibility issue introduced with the new Block Editor (a.k.a. Gutenberg) which prevents Recently from retrieving it. At the time of writing this hasn’t been resolved yet.
  • The title attribute in links will be added only when necessary to avoid redundancy and for accessibility reasons.

Minor Updates & Hotfixes

3.0.5

Version 3.0.5, released on June 4th, 2021, patches two potential security vulnerabilities and so if you’re using Recently 3.0.4 or older you should update to version 3.0.5 (or newer) as soon as possible (here’s how to update a WordPress plugin in case you need assistance with this).

The JPCERT/CC Vulnerability Coordination Group reported a potential Cross Site Scripting (XSS) vulnerability discovered by researcher Yu Iwama (Secure Sky Technology Inc.) Said vulnerability can be exploited only if the attacker is logged in and has at least Author privileges along with other conditions.

A potential Code Injection vulnerability was reported by Jerome from NinTechNet. To take advantage of it the attacker must be logged in and have at least Contributor privileges, and also additional specific conditions must be met as well making this specific vulnerability more difficult to exploit (but not impossible).

Version 3.0.5 also fixes a couple of issues that prevented the correct loading of posts thumbnails when SSL/HTTPS isn’t correctly installed on the website or when using specific PHP locales. If you’re using a caching plugin (or if your hosting provider, eg. SiteGround/WPengine, provides their own page caching mechanism) you should clear its cache so these fixes can be applied to your website right away.

A PHP fatal error that could occur when using stock thumbnail sizes has been fixed on version 3.0.5.

Lastly, this version also fixes a views/comments translation issue that affects some languages. Note that if you’re affected by this issue translation packs for your language need to be updated for you to get this fix. This unfortunately is out of the control of the plugin.

As a side note, this is likely the last version of the plugin that will support Internet Explorer 11. The WordPress team plans to drop IE support entirely once version WP 5.8 is released and so it makes little sense for Recently to continue providing support for it. If you have strong reasons why I should reconsider this feel free to leave a comment below so we and anyone interested can talk about it.

3.0.4

Version 3.0.4, released on April 24, 2020, fixes an issue where if you used multiple instances of the widget on the same page (eg. the homepage) the second (and third, and so on) would duplicate the posts from the previous instance. Many thanks to @rianovost for reporting this issue! This release also enables the Ajaxify Widget option by default (new installs only) for better out-of-the-box compatibility with caching plugins.

3.0.3

Version 3.0.3, released on April 20, 2020, fixes a fatal PHP error that would occur when setting Recently to generate thumbnails using any source than Featured Images. Many thanks to @rianovost for reporting this!

3.0.2

Version 3.0.2, released on April 5, 2020, fixes an issue where post thumbnails couldn’t be displayed under certain conditions. Also, fixes an issue where the Tiny thumbnail would change the widget title to “Trending”.

3.0.1

Version 3.0.1, released on April 4, 2020, fixes an issue where post thumbnails couldn’t be disabled. Also, when using the widget with Polylang the former would display the original post URL instead of the one from the translation which this release fixes. The widget now reports the right views count when using WordPress Popular Posts in conjunction with Polylang or WPML. The default data cache TTL is now 1 minute (this affects new installs only.) Finally, some code maintenance was done to make things easier for plugin development.

Support the project!

If you’d like to support my work and efforts to creating and maintaining more open source projects your donations and messages of support mean a lot!

Please check out my Buy Me a Coffee page or consider making a donation via PayPal to help keep me caffeinated 🙂