Changeset 1801414
- Timestamp:
- 01/11/2018 10:49:32 PM (8 years ago)
- Location:
- wp-instagram-widget
- Files:
-
- 6 edited
- 1 copied
-
tags/2.0.2 (copied) (copied from wp-instagram-widget/trunk)
-
tags/2.0.2/readme.md (modified) (1 diff)
-
tags/2.0.2/readme.txt (modified) (2 diffs)
-
tags/2.0.2/wp-instagram-widget.php (modified) (7 diffs)
-
trunk/readme.md (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-instagram-widget.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-instagram-widget/tags/2.0.2/readme.md
r1800557 r1801414 84 84 85 85 ## Changelog 86 87 #### 2.0.2 88 * Use image sizes from JSON due to errors loading images 86 89 87 90 #### 2.0.1 -
wp-instagram-widget/tags/2.0.2/readme.txt
r1800557 r1801414 4 4 Requires at least: 4.4 5 5 Tested up to: 4.9.1 6 Stable tag: 2.0. 16 Stable tag: 2.0.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 80 80 81 81 == Changelog == 82 83 = 2.0.2 = 84 * Use image sizes from JSON due to errors loading images 82 85 83 86 = 2.0.1 = -
wp-instagram-widget/tags/2.0.2/wp-instagram-widget.php
r1800557 r1801414 4 4 Plugin URI: https://github.com/scottsweb/wp-instagram-widget 5 5 Description: A WordPress widget for showing your latest Instagram photos. 6 Version: 2.0. 16 Version: 2.0.2 7 7 Author: Scott Evans 8 8 Author URI: https://scott.ee … … 189 189 $username = trim( strtolower( $username ) ); 190 190 191 if ( false === ( $instagram = get_transient( 'instagram-a 8-' . sanitize_title_with_dashes( $username ) ) ) ) {191 if ( false === ( $instagram = get_transient( 'instagram-a9-' . sanitize_title_with_dashes( $username ) ) ) ) { 192 192 193 193 switch ( substr( $username, 0, 1 ) ) { … … 234 234 235 235 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 237 238 switch ( substr( $username, 0, 1 ) ) { 238 239 case '#': … … 254 255 'comments' => $image['node']['edge_media_to_comment']['count'], 255 256 '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'] ), 257 258 'small' => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][2]['src'] ), 258 259 'large' => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][4]['src'] ), … … 262 263 break; 263 264 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 282 265 if ( true === $image['is_video'] ) { 283 266 $type = 'video'; … … 297 280 'comments' => $image['comments']['count'], 298 281 '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'] ), 303 286 'type' => $type, 304 287 ); … … 311 294 if ( ! empty( $instagram ) ) { 312 295 $instagram = base64_encode( serialize( $instagram ) ); 313 set_transient( 'instagram-a 8-' . 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 ) ); 314 297 } 315 298 } -
wp-instagram-widget/trunk/readme.md
r1800557 r1801414 84 84 85 85 ## Changelog 86 87 #### 2.0.2 88 * Use image sizes from JSON due to errors loading images 86 89 87 90 #### 2.0.1 -
wp-instagram-widget/trunk/readme.txt
r1800557 r1801414 4 4 Requires at least: 4.4 5 5 Tested up to: 4.9.1 6 Stable tag: 2.0. 16 Stable tag: 2.0.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 80 80 81 81 == Changelog == 82 83 = 2.0.2 = 84 * Use image sizes from JSON due to errors loading images 82 85 83 86 = 2.0.1 = -
wp-instagram-widget/trunk/wp-instagram-widget.php
r1800557 r1801414 4 4 Plugin URI: https://github.com/scottsweb/wp-instagram-widget 5 5 Description: A WordPress widget for showing your latest Instagram photos. 6 Version: 2.0. 16 Version: 2.0.2 7 7 Author: Scott Evans 8 8 Author URI: https://scott.ee … … 189 189 $username = trim( strtolower( $username ) ); 190 190 191 if ( false === ( $instagram = get_transient( 'instagram-a 8-' . sanitize_title_with_dashes( $username ) ) ) ) {191 if ( false === ( $instagram = get_transient( 'instagram-a9-' . sanitize_title_with_dashes( $username ) ) ) ) { 192 192 193 193 switch ( substr( $username, 0, 1 ) ) { … … 234 234 235 235 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 237 238 switch ( substr( $username, 0, 1 ) ) { 238 239 case '#': … … 254 255 'comments' => $image['node']['edge_media_to_comment']['count'], 255 256 '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'] ), 257 258 'small' => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][2]['src'] ), 258 259 'large' => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][4]['src'] ), … … 262 263 break; 263 264 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 282 265 if ( true === $image['is_video'] ) { 283 266 $type = 'video'; … … 297 280 'comments' => $image['comments']['count'], 298 281 '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'] ), 303 286 'type' => $type, 304 287 ); … … 311 294 if ( ! empty( $instagram ) ) { 312 295 $instagram = base64_encode( serialize( $instagram ) ); 313 set_transient( 'instagram-a 8-' . 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 ) ); 314 297 } 315 298 }
Note: See TracChangeset
for help on using the changeset viewer.