Forum

Thread tagged as: Addons, Twitter

Twitter App serving insecure image

We've started using the Twitter App on our site and I've noticed that it's not serving images over HTTPS. Are you able to replicate on your end?

The Tweet template:

<perch:before>

<h3 class="tweet-feed-title text-center"><strong>Latest Tweets</strong></h3>

</perch:before>

<div class="panel panel-upsu tweet-feed">
    <div class="panel-heading">
        <img src="<perch:twitter id="tweetUserAvatar" encode="false" />" alt="<perch:twitter id="tweetUser" />" class="avatar img-circle" />
        <p class="user"><strong><perch:twitter id="tweetUserRealName" /></strong>
        <br />@<perch:twitter id="tweetUser" /></p>
        <div class="twitter-logo pull-right">
            <a href="https://twitter.com/<perch:twitter id="tweetUser" />/status/<perch:twitter id="tweetTwitterID" />" target="_blank">
                <i class="fa fa-twitter fa-2x tw-text"></i>
            </a>
        </div>
    </div>

    <div class="panel-body">
        <blockquote><p><perch:twitter id="tweetHTML" encode="false" /></p></blockquote>
    </div>

    <div class="panel-footer">
        <div class="timestamp">
            <a href="https://twitter.com/<perch:twitter id="tweetUser" />/status/<perch:twitter id="tweetTwitterID" />" target="_blank">
                <small><perch:twitter id="tweetDate" format="d/m/y H:i" /></small>
            </a>
        </div>

        <div class="intents">
            <a class="twitter-reply" href="https://twitter.com/intent/tweet?in_reply_to=<perch:twitter id="tweetTwitterID" />" style="margin-right: 15px;">
                <i class="fa fa-reply"></i>
            </a>
            <a class="twitter-retweet" href="https://twitter.com/intent/retweet?tweet_id=<perch:twitter id="tweetTwitterID" />" style="margin-right: 15px;">
                <i class="fa fa-refresh"></i>
            </a>
            <a class="twitter-fav" href="https://twitter.com/intent/favorite?tweet_id=<perch:twitter id="tweetTwitterID" />">
                <i class="fa fa-heart"></i>
            </a>
        </div>
    </div>
</div>

<perch:after>

<div class="text-center marginBottom">
    <a href="https://twitter.com/<perch:twitter id="tweetUser" />" class="twitter-follow-button" data-show-count="false" data-size="large" data-show-screen-name="false">Follow @<perch:twitter id="tweetUser" /></a>
</div>

</perch:after>

I get the same result regardless of the page, I'm just using perch_twitter_get_latest()

Diagnostic Report:

Perch Runway: 2.8.31, PHP: 5.5.9-1ubuntu4.19, MySQL: 5.5.50, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31), jw_activity_log (1.0.0), perch_blog (5.0), perch_events (1.9.3), perch_forms (1.7), perch_gallery (2.8.2), perch_comments (1.0.1), perch_members (1.0.3), perch_backup (1.2), perch_twitter (3.6.2)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_events', 'perch_forms', 'perch_gallery', 'perch_comments', 'perch_members', 'perch_twitter' );
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/domain/public_html/perch
PERCH_CORE: /home/domain/public_html/perch/core
PERCH_RESFILEPATH: /home/domain/public_html/perch/resources
Image manipulation: GD Imagick
PHP limits: Max upload 32M, Max POST 8M, Memory: 128M, Total max file upload: 8M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: www.domain.com
DOCUMENT_ROOT: /home/domain/public_html/
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Jasper Snaith

Jasper Snaith 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

No, we're using the profile_image_url_https field from the Twitter API response.

Okay thanks, any thoughts as to what might be causing it?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Were you previously running an older version?

When I initially set the app up a few months ago it was on 3.5.1 but I was getting the same behaviour then and never got to the bottom of it. We're starting to use the app on some pages now and I updated to the latest version (3.6.2) hoping that it would resolve it but no joy, so thought I'd best reach out to you guys.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you looking at tweets imported with the older version or with the current version?

I've just noticed that it hasn't fetched any new ones for a couple of days but that might be my fault as I did it manually at some point this week. I'll check the cron.

But in answer to your question, I think the ones I'm looking at were imported with the previous version. Should I clear out a table in the database and refetch?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, give that a go. I think it should resolve the issue.

If you're making good use of user images, be aware that Twitter does not maintain those image URLs when the user updates their avatar. https://docs.grabaperch.com/addons/twitter/profile-images/

Clearing out the tweets table has sorted it, cheers Drew!