Support » Plugin: Send Images to RSS » Cache issues?

  • Hi Robin,

    I have been trying to get your plugin working to no avail. I change things and do not see them reflected back in my MailChimp email’s output or in preview.

    This is for a blog post notification email… specifically have been trying to change the “Continue Reading” text but no change I make in the plugin settings seems to take effect.

    I figure this is a cache issue? I tried adding some of the functionality from your blog (https://robincornett.com/call-to-action-button/) and that changed the color of the button and put it into a table. I have since deleted that table button code in MC and then added it to my functions.php by doing what is described here: https://samelh.com/blog/2017/10/12/mailchimp-wordpress-feed-adding-featured-image-read-button/ (there seem to be commonalities between your and his instructions because you both used the same background color for the button)… anyway, that button seems to be cached in my RSS feed now even though I have removed it from functions.php.

    Is there an easy way to flush the RSS cache perhaps? This client is on the dreaded GoDaddy, Linux/Cpanel, which I’m sure isn’t helping. I see no way to flush GoDaddy cache. An article I saw suggested updating a post and rechecking the feed, but the table button is still in there so doesn’t seem like it worked.

    Thanks, any help or advice appreciated. Seems like a great plugin, if I could only get it working!

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

    (@littlerchicken)

    If your current feed is using the code from the second tutorial, that is probably overwriting anything coming from this plugin. You could be experiencing a caching issue, as RSS feeds are notoriously difficult to test and refresh.

    Can you clarify the current state of your modifications to your feed? I’m not sure which option you used from my tutorial, or if that’s still in effect at all, or if you are using the second tutorial (which I do think would override the plugin).

    Also, if you can share the link to your RSS feed, I may be able to offer more insight as to what’s going on.

    Yes, current feed is using code from the second tutorial, which I had added to functions.php. I removed that a while ago, but it persists.

    Currently the only modifications to the feed that are not from your plugin are a few that you suggested for functions.php, that came either from your blog or from other comment threads on the plugin here at wordpress.org:

    send_images_rss_excerpt_read_more,
    send_images_rss_email_image_style, and
    send_images_rss_other_image_style

    none of which seem to be doing anything either. 🙁

    Feed is https://thesavvydiabetic.com/feed

    Thanks for the reply.

    Plugin Author Robin Cornett

    (@littlerchicken)

    Can you share the functions you’re using to modify the feed? Specifically the one on the send_images_rss_excerpt_read_morefilter.

    In your raw feed, I see the plugin at work. The images are being output in the description at what looks like the MailChimp named size (560px wide), aligned center. The excerpt is being processed correctly, but there is no link in the description at all. This could be explained if you are using the code snippet from the end of the first option in my tutorial–that was intended to disable the read more link from the plugin, assuming that you want to add it by hand to your MailChimp template.

    If this is the code snippet you’re using in your functions.php file, you would just need to update your MailChimp template with the code shared in the tutorial (above the one to disable the read more link).

    The cache must have expired. I’ve re-added the button in the MC interface and it’s good now.

    Only thing left I’d like to do to the MC template at this point is some styling on the featured image it’s pulling to maybe create a little margin around it and possibly a border.

    These are the functions that I got either your blog or your comments here that I’m trying to use on the image to do this, but they don’t seem to be getting applied when I check the feed validator:

    //
    add_filter( 'send_images_rss_email_image_style', 'rgc_email_images', 10, 2 );
    function rgc_email_images( $style, $maxwidth ) {
        return sprintf( 'display:block;margin:30px auto;border:1px solid #ccc;max-width:%spx;', $maxwidth );
    }
    //
    add_filter( 'send_images_rss_other_image_style', 'rgc_change_other_images', 10, 6 );
    function rgc_change_other_images( $style, $width, $maxwidth, $halfwidth, $alignright, $alignleft ) {
    
        $style = sprintf( 'display:block;margin:30px auto;border:1px solid #ccc;max-width:%spx;', $maxwidth );
    
        if ( $width < $maxwidth ) {
            $style = sprintf( 'maxwidth:%spx;', $halfwidth );
        }
    
        return $style;
    }

    Thanks again, Robin

    Plugin Author Robin Cornett

    (@littlerchicken)

    Those two filters are for images in the full post content, which is why you’re not seeing the changes you want to see. Since your feed is set for summaries, you want something like this instead, on the send_images_rss_excerpt_image_style:

    
    add_filter( 'send_images_rss_excerpt_image_style', 'prefix_modify_excerpt_image_style', 10, 3 );
    /**
     * Modify the image style for RSS excerpts.
     *
     * @param $style
     * @param $alignment
     * @param $margin
     *
     * @return string
     */
    function prefix_modify_excerpt_image_style( $style, $alignment, $margin ) {
    	if ( 'center' === $alignment ) {
    		return 'display:block;margin:30px auto;border:1px solid #ccc;';
    	}
    
    	return $style;
    }
    

    I have not tested this, but I think this should be what you need. Since your feed is set to summaries, you can remove the other two filters.

    Sorry for the confusion–hope this helps!

    OK thanks Robin. I’ve added the new code here but probably have to wait again for cache to expire. I don’t see it showing up yet in the validator. Will check again tomorrow.
    Appreciate the help.

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