• Resolved realtebo4dma

    (@realtebo4dma)


    We migrate a wordpress with your plugin into a serverless (AWS, Fargate) environment.

    Now posts in the most viewed page has no more images.

    This happens because your plugin is saving _on disk_ thumbnail.

    Could we avoid this? Or, can we setup a different folders to generate thumbnails?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hey @realtebo4dma,

    Honestly, no idea. WordPress itself also stores its image files on disk by default. I guess you already figured out a way to serve WP generated images from an external source, maybe a similar approach can work here as well? If you ever figure it out please consider posting your solution here, it might help someone else in the future.

    Thread Starter realtebo4dma

    (@realtebo4dma)

    Narrowing the problem

    Your plugin creates thumbnails and save into a folder.

    Can we avoid this using configurations? Or can we use another folder instead of the hardcoded one?

    Plugin Author Hector Cabrera

    (@hcabrera)

    Can we avoid this using configurations?

    Well, yes, there is one potential solution. You can instruct WordPress Popular Posts to use the stock WordPress images instead of its own. To do so, and assuming that you’re using the WordPress Popular Posts block:

    1. Go to Appearance > Widgets > [Your Sidebar] > WordPress Popular Posts (or wherever your block is.)
    2. Under “Display Post Thumbnail”, select the “Use predefined size” option, pick a thumbnail size from the available options (if none of the options match your desired size you may need to register a new image size first), and save changes.

    With this, WPP will attempt to load images from wherever your WordPress images are.

    Thread Starter realtebo4dma

    (@realtebo4dma)

    We have an homepage where, before of the footer, we are displaying top 3 popular posts.

    and also a page with only all popular posts

    in home we are using this block of html

    [wpp post_type=post excerpt_by_words=1 excerpt_length=30 freshness=1 range=last30days limit=3 order_by=avg thumbnail_width=356 thumbnail_height=220 stats_date_format="j F Y" stats_date=1 wpp_start='<span style="background-color: rgba(30, 30, 30, 0.2); font-family: inherit; font-size: inherit;">' wpp_end='' post_html='
    {thumb}<h3 class="entry-title td-module-title">{title}<span class="td-post-date">{date}</span>{excerpt}</h3>
    </span>

    '

    ]
    Now it's not showing any of the thumbnails.

    It's looking for thumb in

    https://www.mydomain.ext/wp-content/uploads/wordpress-popular-posts/9008129-featured-356x220.jpeg

    We absolutely need to
    – force plugin to create thumb into temp folder, the only writable and permanent storage
    – or forcing plugin to use images from the post

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hey @realtebo4dma,

    With thumbnail_build=’predefined’ you can force the shortcode to use stock WordPress images, like so:

    [wpp post_type='post' excerpt_by_words=1 excerpt_length=30 freshness=1 range='last30days' limit=3 order_by='avg' thumbnail_build='predefined' thumbnail_width=356 thumbnail_height=220 stats_date_format='j F Y' stats_date=1 wpp_start='<span style="background-color: rgba(30, 30, 30, 0.2); font-family: inherit; font-size: inherit;">' wpp_end='' post_html='<div class="td_module_86 td_module_wrap td-animation-stack"><div class="td-module-thumb"><a title="{text_title}" href="{url}" rel="nofollow ugc">{thumb}</a><h3 class="entry-title td-module-title">{title}<span class="td-post-date">{date}</span>{excerpt}</h3></div></div></span>']

    (Fixed your shortcode a bit btw.)

    Thread Starter realtebo4dma

    (@realtebo4dma)

    src="https://www.mydomain.ext/wp-content/uploads/wordpress-popular-posts/9008129-featured-356x220.jpeg"

    sorry, nothing changed using the following syntax

    thumbnail_build='predefined'  thumbnail_width=356 thumbnail_height=220
    Plugin Author Hector Cabrera

    (@hcabrera)

    There’s a problem on your end. I tried the exact same shortcode I posted above on a test site and I am seeing that thumbnails are being pulled from the stock uploads folder as expected.

    Double check things on your end (eg. make sure that the shortcode is not breaking, caching, etc.)

    Plugin Author Hector Cabrera

    (@hcabrera)

    Marking topic as resolved due to inactivity.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Serveless instances – How to avoid broken images?’ is closed to new replies.