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/
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
I'll re-add the filter with https://developer.wordpress.org/reference/functions/apply_filters_deprecated/ instead
During testing:
wp-content/debug.log as expected.define( 'WPROCKETHELPERS_LL_YT_PREVIEW_RESOLUTION', 'sddefault' );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.