Changeset 1677328
- Timestamp:
- 06/13/2017 09:00:28 AM (9 years ago)
- Location:
- optimized-instagram/trunk
- Files:
-
- 3 edited
-
inc/image_handler.php (modified) (3 diffs)
-
optimized-instagram.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
optimized-instagram/trunk/inc/image_handler.php
r1605065 r1677328 2 2 3 3 class OptimizedInstagramImageHandler { 4 5 /** 6 * Get contents of the remote location 7 * @param string $url Remote location 8 */ 9 public static function get_remote_data($url) { 10 $get = wp_remote_get( $url ); 11 12 if ( $get && is_array( $get ) ) { 13 $data = wp_remote_retrieve_body( $get ); 14 15 if ( $data ) { 16 $response_code = wp_remote_retrieve_response_code( $get ); 17 18 if ( !empty( $response_code ) && ($response_code == '200' ) ) { 19 return $data; 20 } 21 } 22 } 23 24 return null; 25 } 26 4 27 /** 5 28 * Get full local path for saved images … … 42 65 while(1) { 43 66 $url = 'https://www.instagram.com/'.$username.'/media/'.( 0 != $max_id ? '?max_id='.$max_id : ''); 44 $json = @file_get_contents($url);67 $json = self::get_remote_data($url); 45 68 if (!$json) { 46 69 break; … … 98 121 $image_url = $image_info->standard_resolution->url; 99 122 100 $remote_content = file_get_contents($image_url);123 $remote_content = self::get_remote_data($image_url); 101 124 102 125 if (!empty($remote_content)) { -
optimized-instagram/trunk/optimized-instagram.php
r1605065 r1677328 8 8 Author URI: https://www.completewebresources.com/ 9 9 Text Domain: optimized-instagram 10 Version: 1.0 10 Version: 1.0.1 11 11 License: GNU General Public License v2 or later 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 17 17 } 18 18 19 define("OPTIMIZED_INSTAGRAM_VERSION", "1.0 ");19 define("OPTIMIZED_INSTAGRAM_VERSION", "1.0.1"); 20 20 21 21 if ( ! class_exists( 'OptimizedInstagram' ) ) { -
optimized-instagram/trunk/readme.txt
r1605065 r1677328 3 3 Tags: instagram, images, instagram gallery, widget, social media 4 4 Requires at least: 4.2 5 Tested up to: 4. 7.26 Stable tag: 1.0 5 Tested up to: 4.8 6 Stable tag: 1.0.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 36 36 == Changelog == 37 37 38 = 1.0.1 = 39 * Bug fix: use WordPress functions to get remote file. 40 38 41 = 1.0 = 39 42 * First release of this WordPress plugin.
Note: See TracChangeset
for help on using the changeset viewer.