You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plugin currently isn't compatible with WP Offload Media (light or Pro).
WP Offload Media runs its the_content filters with priority 100, while SLB's filter is hooked at 99. This means that in cases where the original URL is in the raw content and being replaced by WP Offload Media, the lightbox will try to grab the original URL instead of the CDN version.
Can be fixed by updating SLB's priority to 101. Classified this as feedback rather than an issue because:
Feels sort of arbitrary
Hard to guarantee compatibility with everything out there
Here's exactly what I did since there weren't any filters that let me change the priority (you can imply what the action wrapper class does, not super important):
<?php
namespace XWalk\Plugin\Actions;
use SternerStuff\WordPressUtils\PluginsAPI\ActionHookSubscriber;
class UpdateSimpleLightboxFilterPriority implements ActionHookSubscriber {
public static function get_actions()
{
return [
'init' => 'init',
];
}
/**
* WP Offload Media filters the_content to replace CDN-stored image URLs
* SLB filters the_content to add lightbox stuff
*
* WP Offload Media replaces image URLs with priority 100, while SLB activates at 99.
* This means SLB uses the original URLs and not the updated ones.
* Lowering SLB's priority fixes it.
*
* Could be other instances of this happening.
*/
public static function init()
{
$slb = $GLOBALS['slb'];
remove_filter('the_content', $slb->m('activate_links'), $slb->util->priority('low'));
add_filter( 'the_content', $slb->m('activate_links'), 101);
}
}
The text was updated successfully, but these errors were encountered:
Yes, this is a classic The Price is Right Predicament, where another plugin simply needs have a priority value 1 higher and it gets processed after yours. As a result, there's only so much you can do to avoid clashes like this with other plugins using the same hook.
I'll look into changing the priority, but I'll also need to evaluate whether the current priority was selected to avoid other conflicts.
That said, if WP Offload Media is updating the links on every page load rather than updating the attachment URLs in WP's media library, then using the CDN-based URLs may break SLB's ability to pull captions, etc. from the media library. If so, then full support for WP Offload Media may require an extension.
It appears that WP Offload Media (WPOM) may have been updated recently, as the offloaded URL is used regardless of whether SLB runs on the the_content filter before or after WPOM does. This is because WPOM filters post content multiple times at different points in the loading process.
Further, WPOM's URL rewriting does indeed break the connection between the files and WP's media library. This means that the offloaded URLs are used in the lightbox (rather than the local files), but media library metadata (captions, descriptions, etc.) cannot be retrieved for offloaded files.
As a result, an extension will be required to restore access to media library metadata for files offloaded by WPOM. You can track the status and add feedback on this extension in the SLB's Extensions repo: [Plugin/Compatibility]: WP Offload Media.
The plugin currently isn't compatible with WP Offload Media (light or Pro).
WP Offload Media runs its
the_content
filters with priority 100, while SLB's filter is hooked at 99. This means that in cases where the original URL is in the raw content and being replaced by WP Offload Media, the lightbox will try to grab the original URL instead of the CDN version.Can be fixed by updating SLB's priority to 101. Classified this as feedback rather than an issue because:
Here's exactly what I did since there weren't any filters that let me change the priority (you can imply what the action wrapper class does, not super important):
The text was updated successfully, but these errors were encountered: