Changeset 1902037
- Timestamp:
- 07/01/2018 03:33:47 PM (8 years ago)
- File:
-
- 1 edited
-
pixnet/trunk/pixnet_plugin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pixnet/trunk/pixnet_plugin.php
r1898985 r1902037 4 4 Description: This is PIXNET PA code Wordpress plugin 5 5 Author: Daniel 6 Version: 2.5. 76 Version: 2.5.8 7 7 */ 8 8 … … 21 21 $this->verify_code = (null != get_option('verify')) ? get_option('verify') : ''; 22 22 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 } 25 29 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; 27 32 28 //Hooks 33 break; 34 } 35 36 // Hooks 29 37 add_action('admin_menu', array(&$this, 'paCodeVenue')); 30 38 add_action('wp_head', array(&$this, 'paCode'));
Note: See TracChangeset
for help on using the changeset viewer.