Plugin Directory

Changeset 1677328


Ignore:
Timestamp:
06/13/2017 09:00:28 AM (9 years ago)
Author:
CompleteWebResources
Message:

Version 1.0.1

Location:
optimized-instagram/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • optimized-instagram/trunk/inc/image_handler.php

    r1605065 r1677328  
    22
    33class 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
    427    /**
    528     * Get full local path for saved images
     
    4265        while(1) {
    4366            $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);
    4568            if (!$json) {
    4669                break;
     
    98121        $image_url = $image_info->standard_resolution->url;
    99122
    100         $remote_content = file_get_contents($image_url);
     123        $remote_content = self::get_remote_data($image_url);
    101124
    102125        if (!empty($remote_content)) {
  • optimized-instagram/trunk/optimized-instagram.php

    r1605065 r1677328  
    88Author URI: https://www.completewebresources.com/
    99Text Domain: optimized-instagram
    10 Version: 1.0
     10Version: 1.0.1
    1111License: GNU General Public License v2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1717}
    1818
    19 define("OPTIMIZED_INSTAGRAM_VERSION", "1.0");
     19define("OPTIMIZED_INSTAGRAM_VERSION", "1.0.1");
    2020
    2121if ( ! class_exists( 'OptimizedInstagram' ) ) {
  • optimized-instagram/trunk/readme.txt

    r1605065 r1677328  
    33Tags: instagram, images, instagram gallery, widget, social media
    44Requires at least: 4.2
    5 Tested up to: 4.7.2
    6 Stable tag: 1.0
     5Tested up to: 4.8
     6Stable tag: 1.0.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3636== Changelog ==
    3737
     38= 1.0.1 =
     39* Bug fix: use WordPress functions to get remote file.
     40
    3841= 1.0 =
    3942* First release of this WordPress plugin.
Note: See TracChangeset for help on using the changeset viewer.