Plugin Directory

Changeset 1801414


Ignore:
Timestamp:
01/11/2018 10:49:32 PM (8 years ago)
Author:
scottsweb
Message:

Release 2.0.2, see readme.txt for the changelog.

Location:
wp-instagram-widget
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wp-instagram-widget/tags/2.0.2/readme.md

    r1800557 r1801414  
    8484
    8585## Changelog
     86
     87#### 2.0.2
     88* Use image sizes from JSON due to errors loading images
    8689
    8790#### 2.0.1
  • wp-instagram-widget/tags/2.0.2/readme.txt

    r1800557 r1801414  
    44Requires at least: 4.4
    55Tested up to: 4.9.1
    6 Stable tag: 2.0.1
     6Stable tag: 2.0.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8080
    8181== Changelog ==
     82
     83= 2.0.2 =
     84* Use image sizes from JSON due to errors loading images
    8285
    8386= 2.0.1 =
  • wp-instagram-widget/tags/2.0.2/wp-instagram-widget.php

    r1800557 r1801414  
    44Plugin URI: https://github.com/scottsweb/wp-instagram-widget
    55Description: A WordPress widget for showing your latest Instagram photos.
    6 Version: 2.0.1
     6Version: 2.0.2
    77Author: Scott Evans
    88Author URI: https://scott.ee
     
    189189        $username = trim( strtolower( $username ) );
    190190
    191         if ( false === ( $instagram = get_transient( 'instagram-a8-' . sanitize_title_with_dashes( $username ) ) ) ) {
     191        if ( false === ( $instagram = get_transient( 'instagram-a9-' . sanitize_title_with_dashes( $username ) ) ) ) {
    192192
    193193            switch ( substr( $username, 0, 1 ) ) {
     
    234234
    235235            foreach ( $images as $image ) {
    236                 // the hashtag json is now completely different
     236                // Note: keep hashtag support different until these JSON changes stabalise
     237                // these are mostly the same again now
    237238                switch ( substr( $username, 0, 1 ) ) {
    238239                    case '#':
     
    254255                            'comments'      => $image['node']['edge_media_to_comment']['count'],
    255256                            'likes'         => $image['node']['edge_liked_by']['count'],
    256                             'thumbnail'     => str_replace( 's150x150', 's160x160', preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][0]['src'] ) ),
     257                            'thumbnail'     => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][0]['src'] ),
    257258                            'small'         => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][2]['src'] ),
    258259                            'large'         => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][4]['src'] ),
     
    262263                        break;
    263264                    default:
    264                         $image['thumbnail_src'] = preg_replace( '/^https?\:/i', '', $image['thumbnail_src'] );
    265                         $image['display_src'] = preg_replace( '/^https?\:/i', '', $image['display_src'] );
    266 
    267                         // handle both types of CDN url.
    268                         if ( ( strpos( $image['thumbnail_src'], 's640x640' ) !== false ) ) {
    269                             $image['thumbnail'] = str_replace( 's640x640', 's160x160', $image['thumbnail_src'] );
    270                             $image['small'] = str_replace( 's640x640', 's320x320', $image['thumbnail_src'] );
    271                         } else {
    272                             $urlparts = wp_parse_url( $image['thumbnail_src'] );
    273                             $pathparts = explode( '/', $urlparts['path'] );
    274                             array_splice( $pathparts, 3, 0, array( 's160x160' ) );
    275                             $image['thumbnail'] = '//' . $urlparts['host'] . implode( '/', $pathparts );
    276                             $pathparts[3] = 's320x320';
    277                             $image['small'] = '//' . $urlparts['host'] . implode( '/', $pathparts );
    278                         }
    279 
    280                         $image['large'] = $image['thumbnail_src'];
    281 
    282265                        if ( true === $image['is_video'] ) {
    283266                            $type = 'video';
     
    297280                            'comments'      => $image['comments']['count'],
    298281                            'likes'         => $image['likes']['count'],
    299                             'thumbnail'     => $image['thumbnail'],
    300                             'small'         => $image['small'],
    301                             'large'         => $image['large'],
    302                             'original'      => $image['display_src'],
     282                            'thumbnail'     => preg_replace( '/^https?\:/i', '', $image['thumbnail_resources'][0]['src'] ),
     283                            'small'         => preg_replace( '/^https?\:/i', '', $image['thumbnail_resources'][2]['src'] ),
     284                            'large'         => preg_replace( '/^https?\:/i', '', $image['thumbnail_resources'][4]['src'] ),
     285                            'original'      => preg_replace( '/^https?\:/i', '', $image['display_src'] ),
    303286                            'type'          => $type,
    304287                        );
     
    311294            if ( ! empty( $instagram ) ) {
    312295                $instagram = base64_encode( serialize( $instagram ) );
    313                 set_transient( 'instagram-a8-' . sanitize_title_with_dashes( $username ), $instagram, apply_filters( 'null_instagram_cache_time', HOUR_IN_SECONDS * 2 ) );
     296                set_transient( 'instagram-a9-' . sanitize_title_with_dashes( $username ), $instagram, apply_filters( 'null_instagram_cache_time', HOUR_IN_SECONDS * 2 ) );
    314297            }
    315298        }
  • wp-instagram-widget/trunk/readme.md

    r1800557 r1801414  
    8484
    8585## Changelog
     86
     87#### 2.0.2
     88* Use image sizes from JSON due to errors loading images
    8689
    8790#### 2.0.1
  • wp-instagram-widget/trunk/readme.txt

    r1800557 r1801414  
    44Requires at least: 4.4
    55Tested up to: 4.9.1
    6 Stable tag: 2.0.1
     6Stable tag: 2.0.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8080
    8181== Changelog ==
     82
     83= 2.0.2 =
     84* Use image sizes from JSON due to errors loading images
    8285
    8386= 2.0.1 =
  • wp-instagram-widget/trunk/wp-instagram-widget.php

    r1800557 r1801414  
    44Plugin URI: https://github.com/scottsweb/wp-instagram-widget
    55Description: A WordPress widget for showing your latest Instagram photos.
    6 Version: 2.0.1
     6Version: 2.0.2
    77Author: Scott Evans
    88Author URI: https://scott.ee
     
    189189        $username = trim( strtolower( $username ) );
    190190
    191         if ( false === ( $instagram = get_transient( 'instagram-a8-' . sanitize_title_with_dashes( $username ) ) ) ) {
     191        if ( false === ( $instagram = get_transient( 'instagram-a9-' . sanitize_title_with_dashes( $username ) ) ) ) {
    192192
    193193            switch ( substr( $username, 0, 1 ) ) {
     
    234234
    235235            foreach ( $images as $image ) {
    236                 // the hashtag json is now completely different
     236                // Note: keep hashtag support different until these JSON changes stabalise
     237                // these are mostly the same again now
    237238                switch ( substr( $username, 0, 1 ) ) {
    238239                    case '#':
     
    254255                            'comments'      => $image['node']['edge_media_to_comment']['count'],
    255256                            'likes'         => $image['node']['edge_liked_by']['count'],
    256                             'thumbnail'     => str_replace( 's150x150', 's160x160', preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][0]['src'] ) ),
     257                            'thumbnail'     => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][0]['src'] ),
    257258                            'small'         => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][2]['src'] ),
    258259                            'large'         => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][4]['src'] ),
     
    262263                        break;
    263264                    default:
    264                         $image['thumbnail_src'] = preg_replace( '/^https?\:/i', '', $image['thumbnail_src'] );
    265                         $image['display_src'] = preg_replace( '/^https?\:/i', '', $image['display_src'] );
    266 
    267                         // handle both types of CDN url.
    268                         if ( ( strpos( $image['thumbnail_src'], 's640x640' ) !== false ) ) {
    269                             $image['thumbnail'] = str_replace( 's640x640', 's160x160', $image['thumbnail_src'] );
    270                             $image['small'] = str_replace( 's640x640', 's320x320', $image['thumbnail_src'] );
    271                         } else {
    272                             $urlparts = wp_parse_url( $image['thumbnail_src'] );
    273                             $pathparts = explode( '/', $urlparts['path'] );
    274                             array_splice( $pathparts, 3, 0, array( 's160x160' ) );
    275                             $image['thumbnail'] = '//' . $urlparts['host'] . implode( '/', $pathparts );
    276                             $pathparts[3] = 's320x320';
    277                             $image['small'] = '//' . $urlparts['host'] . implode( '/', $pathparts );
    278                         }
    279 
    280                         $image['large'] = $image['thumbnail_src'];
    281 
    282265                        if ( true === $image['is_video'] ) {
    283266                            $type = 'video';
     
    297280                            'comments'      => $image['comments']['count'],
    298281                            'likes'         => $image['likes']['count'],
    299                             'thumbnail'     => $image['thumbnail'],
    300                             'small'         => $image['small'],
    301                             'large'         => $image['large'],
    302                             'original'      => $image['display_src'],
     282                            'thumbnail'     => preg_replace( '/^https?\:/i', '', $image['thumbnail_resources'][0]['src'] ),
     283                            'small'         => preg_replace( '/^https?\:/i', '', $image['thumbnail_resources'][2]['src'] ),
     284                            'large'         => preg_replace( '/^https?\:/i', '', $image['thumbnail_resources'][4]['src'] ),
     285                            'original'      => preg_replace( '/^https?\:/i', '', $image['display_src'] ),
    303286                            'type'          => $type,
    304287                        );
     
    311294            if ( ! empty( $instagram ) ) {
    312295                $instagram = base64_encode( serialize( $instagram ) );
    313                 set_transient( 'instagram-a8-' . sanitize_title_with_dashes( $username ), $instagram, apply_filters( 'null_instagram_cache_time', HOUR_IN_SECONDS * 2 ) );
     296                set_transient( 'instagram-a9-' . sanitize_title_with_dashes( $username ), $instagram, apply_filters( 'null_instagram_cache_time', HOUR_IN_SECONDS * 2 ) );
    314297            }
    315298        }
Note: See TracChangeset for help on using the changeset viewer.