Plugin Directory

Changeset 1453014


Ignore:
Timestamp:
07/11/2016 11:01:00 PM (10 years ago)
Author:
Insticator
Message:

Fix the issue of not covering the path/query string in the url issue

Location:
insticator/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • insticator/trunk/README.txt

    r1450918 r1453014  
    19191. Sign up for an account with Insticator- http://www.insticator.com
    20201. Verify your account from your email inbox.
    21 1. Install the Insticator plugin either via the WordPress.org plugin directory or by downloading( https://wordpress.org/plugins/insticator/installation/) and uploading the plugin to your server.
     211. Install the Insticator plugin either via the WordPress.org plugin directory or by downloading( https://wordpress.org/plugins/insticator/installation/ ) and uploading the plugin to your server.
    22221. Activate the plugin through the 'Plugins' menu in WordPress.
    23231. Visit 'Appearance > Widgets', drag & drop the plugin in your preferred menu.
  • insticator/trunk/js/admin.js

    r1305782 r1453014  
    22    "use strict";
    33    $(function () {
    4     });
     4
    55    });
    66}(jQuery));
  • insticator/trunk/plugin.php

    r1450918 r1453014  
    3030}
    3131
     32require('Insticator_function.php');
     33
    3234register_activation_hook( __FILE__ , array( 'Insticator_Embed', 'activate' ) );
    3335
     
    155157     */
    156158     public function getUUIDFromAPI() {
    157         $siteurl = get_option('siteurl');
    158         $siteurl = preg_replace("(^https?://)", "" ,$siteurl);
    159         $url = $this->getCombinedURL($siteurl, $this->getSiteInfoApiUrl);
    160 
    161         $prefix = "www.";
    162 
    163         $result = $this->callAPI($url);
    164         if (empty($result)) {
    165             if (strpos($siteurl, $prefix) === false) {
    166                 $siteurl = $prefix.$siteurl;
    167             } else {
    168                 $siteurl = substr($siteurl, 4);
    169             }
    170             $url = $this->getCombinedURL($siteurl, $this->getSiteInfoApiUrl);
    171             $result = $this->callAPI($url);
    172         }
    173         $jsonEmbedList = json_encode($result['embedList']);
    174         $result['siteURL'] = $siteurl;
    175 
    176         update_option('Insticator_clientUUID', $result['clientUUID']);
    177         update_option('Insticator_siteUUID', $result['siteUUID']);
    178         update_option('Insticator_embedList', addslashes($jsonEmbedList));
    179 
    180         return $result;
     159         $siteurl = get_option('siteurl');
     160         $url = $this->getCombinedURL($siteurl, $this->getSiteInfoApiUrl);
     161         $result = $this->callAPI($url);
     162
     163         if (empty($result)) {
     164             $result = $this->callAPI($this->getCombinedURL(getUrlForSpecialCase($siteurl), $this->getSiteInfoApiUrl));
     165         }
     166         $jsonEmbedList = json_encode($result['embedList']);
     167         $result['siteURL'] = $siteurl;
     168
     169         update_option('Insticator_clientUUID', $result['clientUUID']);
     170         update_option('Insticator_siteUUID', $result['siteUUID']);
     171         update_option('Insticator_embedList', addslashes($jsonEmbedList));
     172
     173         return $result;
    181174    }
    182175    /**
     
    204197                    $result = $this->callAPI($url);
    205198                    update_option('Insticator_headerCode', $result['headerCode']);
    206                   update_option('Insticator_bodyCode', $result['bodyCode']);
     199                    update_option('Insticator_bodyCode', $result['bodyCode']);
    207200                    return $result;
    208201            }
Note: See TracChangeset for help on using the changeset viewer.