Wp-rocket: Choose YouTube Preview Image Resolution helper plugin doesn't work on 3.3

Created on 22 Apr 2019  路  5Comments  路  Source: wp-media/wp-rocket

Prior to 3.3 the hook name was:
rocket_youtube_thumbnail_resolution

That was changed to:
rocket_lazyload_youtube_thumbnail_resolution
https://github.com/wp-media/wp-rocket/blob/1ffb4f447d6f6ed8f413cec1b1c88f10beb0dcc4/inc/classes/subscriber/Optimization/class-lazyload-subscriber.php#L194

which prevents the helper plugin from working when WP Rocket 3.3 or later is used:
https://github.com/wp-media/wp-rocket-helpers/blob/8e6902a6cda4db823737bcecfcc22f026b974315/lazyload/wp-rocket-lazyload-youtube-preview-image/wp-rocket-lazyload-youtube-preview-image.php#L42

Since it's not possible to have two versions of the helper plugin, it would be best to revert the hook name to the previous version.

Related Ticket
https://secure.helpscout.net/conversation/832797521/105009/

lazyload low bug

All 5 comments

I think the filter name was changed to have uniformity in the lazyload common library that we share with the standalone plugin.

I am wondering if a better solution would be to write a wrapper for the old filter for backward compatibility. Old filter filtering the new filter.

Will wait for input from @Tabrisrp

During testing:

Also:

- As per https://wp-rocket.me/changelog/ , the minimum required version of WordPress is 4.2
- But apply_filters_deprecated was introduced in 4.6 - https://developer.wordpress.org/reference/functions/apply_filters_deprecated/
~~- Would be safer to check for apply_filters_deprecated so that no fatal errors are triggered.

@arunbasillal The minimum WP version required with WP Rocket is 4.7

@GeekPress Thanks, I see it in the changelog for 3.1. Missed that earlier.

Was this page helpful?
0 / 5 - 0 ratings