Plugin Directory

Changeset 1902037


Ignore:
Timestamp:
07/01/2018 03:33:47 PM (8 years ago)
Author:
daniel1088
Message:

version 2.5.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pixnet/trunk/pixnet_plugin.php

    r1898985 r1902037  
    44Description: This is PIXNET PA code Wordpress plugin
    55Author: Daniel
    6 Version: 2.5.7
     6Version: 2.5.8
    77*/
    88
     
    2121        $this->verify_code = (null != get_option('verify')) ? get_option('verify') : '';
    2222
    23         $result = wp_remote_get('https://api-smartranking.pixplug.in/api/personalrank?domain=' . $this->plugin->site_url .'/');
    24         $rank_response = json_decode($result['body']);
     23        // Retry three times
     24        for ($i=0; $i<3; $i++) {
     25            $result = wp_remote_get('https://api-smartranking.pixplug.in/api/personalrank?domain=' . $this->plugin->site_url .'/');
     26            if (is_wp_error($result)) {
     27                continue;
     28            }
    2529
    26         $this->is_onrank = ($rank_response->error) ? false : $rank_response->data->is_ranking;
     30            $rank_response = json_decode($result['body']);
     31            $this->is_onrank = ($rank_response->error) ? false : $rank_response->data->is_ranking;
    2732
    28         //Hooks
     33            break;
     34        }
     35 
     36        // Hooks
    2937        add_action('admin_menu', array(&$this, 'paCodeVenue'));
    3038        add_action('wp_head', array(&$this, 'paCode'));
Note: See TracChangeset for help on using the changeset viewer.