Support » Plugin: Send Images to RSS » W3TC Lazy Load

  • Resolved thevisas

    (@thevisas)


    Hi,

    If possible could you please have a look at your plugin compatibility with lazy load feature of W3TC.
    Lazy load was introduced in the latest version of W3TC and with this feature enabled RSS images are empty.
    The link to the image is coded as data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20560%20560’%3E%3C/svg%3E and cannot be opened.

    At the moment I had to disable W3TC lazy load in order to enable RSS images.
    If you can have a look at this issue it would be greatly appreciated.

    Regards, Vitali.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Robin Cornett

    (@littlerchicken)

    This may more properly be a W3TC issue, as I do not know of a reason why lazy loading would be needed on RSS feeds (Jetpack, for example, does not enable its lazy loading on RSS feeds). In the meantime, you can prevent the plugin from modifying the RSS images by using this filter:

    
    add_filter( 'w3tc_lazyload_can_process', 'prefix_w3tc_lazyload_can_process' );
    /**
     * Prevent W3TC lazy loading from running on RSS feeds
     *
     * @param array $can_process
     * @return array
     */
    function prefix_w3tc_lazyload_can_process( $can_process ) {
    	if ( is_feed() ) {
    		$can_process['enabled'] = false;
    		$can_process['reason'] = 'RSS feed';
    	}
    
    	return $can_process;
    }
    

    I’ve tested it locally and the images are no longer processed by W3TC. You can add this to your functions.php file or wherever you keep similar code–just please practice safe coding and make sure your files are backed up before making changes. HTH

    Hi Robin,

    Thank you very much for your prompt response and for providing a workaround. The code that you provided appears to be working as expected and is not impacting other lazy load functionality of W3TC.

    Thanks again for your assistance.
    Regards, Vitali.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.