Plugin Directory

Changeset 864461


Ignore:
Timestamp:
02/25/2014 03:27:56 AM (12 years ago)
Author:
transcendev
Message:

minor bug fix update

Location:
td-instagram-import/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • td-instagram-import/trunk/readme.txt

    r854502 r864461  
    55Requires at least: 3.0
    66Tested up to: 3.8.1
    7 Stable tag: 1.0.1
     7Stable tag: 1.0.2
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4444
    4545== Changelog ==
     46= 1.0.2 =
     47* several bugs fixed
    4648
    4749= 1.0.1 =
     
    6163
    6264== Upgrade Notice ==
     65= 1.0.2 =
     66A minor bug fixing update
    6367
    6468= 1.0.1 =
  • td-instagram-import/trunk/td-instagram-import.php

    r854502 r864461  
    44 * Plugin URI: http://www.transcendevelopment.com/td-instagram-import/
    55 * Description: Import your instagram pics
    6  * Version: 1.0.1
     6 * Version: 1.0.2
    77 * Author: TranscenDevelopment
    88 * Author URI: http://www.transcendevelopment.com
     
    2929
    3030define('DIRURL', plugin_dir_url( __FILE__ ));
    31 define('TDIIVER', '1.0.1');
     31define('TDIIVER', '1.0.2');
    3232define('TDIIICON', '../wp-content/plugins/td-instagram-import/images/td_ii_icon.png');
    3333
     
    4848global $wpdb;
    4949
    50 if ($_POST[td_ii_action] == 'removeCID') {
     50if (isset($_POST['td_ii_action'])) {$td_ii_action = filter_var($_POST['td_ii_action'], FILTER_SANITIZE_STRING);} else {$td_ii_action='';}
     51
     52if ($td_ii_action == 'removeCID') {
    5153    delete_option('td_ii_clientID');
    5254    delete_option('td_ii_clientSEC');
     
    6062}
    6163
    62 if ($_POST[td_ii_clientID]) {
    63     $theID  = filter_var($_POST[td_ii_clientID], FILTER_SANITIZE_STRING);
    64     $theSEC = filter_var($_POST[td_ii_clientSEC], FILTER_SANITIZE_STRING);
     64if (isset($_POST['td_ii_clientID'])) {$clientID = filter_var($_POST['td_ii_clientID'], FILTER_SANITIZE_STRING);} else {$clientID='';}
     65if (isset($_POST['td_ii_clientSEC'])) {$clientSEC = filter_var($_POST['td_ii_clientSEC'], FILTER_SANITIZE_STRING);} else {$clientSEC='';}
     66if ($clientID) {
     67    $theID  = $clientID;
     68    $theSEC = $clientSEC;
    6569    add_option('td_ii_clientID', $theID, '', 'yes');
    6670    add_option('td_ii_clientSEC', $theSEC, '', 'yes');
     
    7478$td_ii_clientSEC = get_option('td_ii_clientSEC');
    7579
    76 if ($_GET[code]) {
    77     td_ii_getAuthorization($_GET[code], $reURLnoEnc, $td_ii_clientID, $td_ii_clientSEC);
     80if (isset($_GET['code'])) {$code = filter_var($_GET['code'], FILTER_SANITIZE_STRING);} else {$code='';}
     81if ($code) {
     82    if (($td_ii_clientID) && ($td_ii_clientSEC)) {
     83        td_ii_getAuthorization($code, $reURLnoEnc, $td_ii_clientID, $td_ii_clientSEC);
     84    }
    7885}
    7986
     
    140147}
    141148
    142 
    143 if ($_GET[action] == 'showfeed') {
     149$showFeed='';
     150if (isset($_GET['action'])) {$action = filter_var($_GET['action'], FILTER_SANITIZE_STRING);} else {$action='';}
     151if ($action == 'showfeed') {
    144152    if ($td_ii_AccessToken) {
    145153        $showFeed = td_ii_getUsersFeed(0, 0);
    146154    }
    147 } elseif ($_GET[action] == 'bulkimport') {
     155} elseif ($action == 'bulkimport') {
    148156    $showFeed = "
    149157    <h3>Bulk Import</h3>
     
    189197//---------------------------------------------------------//
    190198global $wpdb;
    191 
     199    $retVal='';
    192200    $td_ii_AccessToken  = get_option('td_ii_AccessToken');
    193     $td_ii_uID          = get_option('td_ii_uID'); 
    194     $whichURL           = filter_var($_GET[i], FILTER_SANITIZE_STRING);
     201    $td_ii_uID          = get_option('td_ii_uID');
     202    if (isset($_GET['i'])) {$whichURL = filter_var($_GET['i'], FILTER_SANITIZE_STRING);} else {$whichURL='';}
    195203   
    196204    $extraQuery = "&count=10000";
     
    215223    $instAr = json_decode($output, true);
    216224   
    217     $nextPage = $instAr['pagination']['next_url'];
     225    if (isset($instAr['pagination']['next_url'])) {$nextPage = $instAr['pagination']['next_url'];} else {$nextPage='';}
    218226    if ($nextPage) {$nextPage = urlencode($nextPage);}
    219227   
    220228    foreach ($instAr['data'] as $key => $value) {
    221229        unset($tags);
     230        $tags='';
    222231        if ($value['tags']) {
    223232            foreach ($value['tags'] as $tag => $tagVal) {
     
    281290function td_ii_loadMore() {
    282291//---------------------------------------------------------//
    283     $count  = filter_var($_POST[count], FILTER_SANITIZE_STRING);
    284     $page   = filter_var($_POST[page], FILTER_SANITIZE_STRING);
     292    $count  = filter_var($_POST['count'], FILTER_SANITIZE_STRING);
     293    $page   = filter_var($_POST['page'], FILTER_SANITIZE_STRING);
    285294    $page   = urldecode($page);
    286295    echo td_ii_getUsersFeed($page, $count);
     
    462471    $instObj = json_decode($output);
    463472   
    464     $td_ii_AccessToken  = $instObj->access_token;
    465     $td_ii_username     = $instObj->user->username;
    466     $td_ii_bio          = $instObj->user->bio;
    467     $td_ii_website      = $instObj->user->website;
    468     $td_ii_picture      = $instObj->user->profile_picture;
    469     $td_ii_fullname     = $instObj->user->fullname;
    470     $td_ii_uID          = $instObj->user->id;
    471    
    472     delete_option('td_ii_AccessToken'); add_option('td_ii_AccessToken', $td_ii_AccessToken,'', 'yes');
    473     delete_option('td_ii_username');    add_option('td_ii_username', $td_ii_username,'', 'yes');
    474     delete_option('td_ii_bio');         add_option('td_ii_bio', $td_ii_bio,'', 'yes');
    475     delete_option('td_ii_website');     add_option('td_ii_website', $td_ii_website,'', 'yes');
    476     delete_option('td_ii_picture');     add_option('td_ii_picture', $td_ii_picture,'', 'yes');
    477     delete_option('td_ii_fullname');    add_option('td_ii_fullname', $td_ii_fullname,'', 'yes');
    478     delete_option('td_ii_uID');         add_option('td_ii_uID', $td_ii_uID,'', 'yes');
     473        $td_ii_AccessToken  = $instObj->access_token;
     474        $td_ii_username     = $instObj->user->username;
     475        $td_ii_bio          = $instObj->user->bio;
     476        $td_ii_website      = $instObj->user->website;
     477        $td_ii_picture      = $instObj->user->profile_picture;
     478        $td_ii_fullname     = '';
     479        $td_ii_uID          = $instObj->user->id;
     480        delete_option('td_ii_AccessToken'); add_option('td_ii_AccessToken', $td_ii_AccessToken,'', 'yes');
     481        delete_option('td_ii_username');    add_option('td_ii_username', $td_ii_username,'', 'yes');
     482        delete_option('td_ii_bio');         add_option('td_ii_bio', $td_ii_bio,'', 'yes');
     483        delete_option('td_ii_website');     add_option('td_ii_website', $td_ii_website,'', 'yes');
     484        delete_option('td_ii_picture');     add_option('td_ii_picture', $td_ii_picture,'', 'yes');
     485        delete_option('td_ii_fullname');    add_option('td_ii_fullname', $td_ii_fullname,'', 'yes');
     486        delete_option('td_ii_uID');         add_option('td_ii_uID', $td_ii_uID,'', 'yes');
     487
    479488}
    480489//---------------------------------------------------------//
    481490function td_ii_settings() {
    482491//---------------------------------------------------------//
    483 $action = $_POST[action];
    484 
     492if (isset($_POST['action'])) {$action = filter_var($_POST['action'], FILTER_SANITIZE_STRING);} else {$action='';}
    485493if ($action == 'td_ii_saveSettings') {
    486 $td_ii_importTags       = filter_var($_POST[td_ii_importTags], FILTER_SANITIZE_STRING);
    487 $td_ii_cat              = filter_var($_POST[td_ii_cat], FILTER_SANITIZE_STRING);
    488 $td_ii_postType         = filter_var($_POST[td_ii_postType], FILTER_SANITIZE_STRING);
    489 $td_ii_theTemplate      = filter_var($_POST[td_ii_theTemplate], FILTER_SANITIZE_SPECIAL_CHARS);
     494if (isset($_POST['td_ii_importTags'])) {$td_ii_importTags = filter_var($_POST['td_ii_importTags'], FILTER_SANITIZE_STRING);}
     495    else {$td_ii_importTags='';}
     496$td_ii_cat              = filter_var($_POST['td_ii_cat'], FILTER_SANITIZE_STRING);
     497$td_ii_postType         = filter_var($_POST['td_ii_postType'], FILTER_SANITIZE_STRING);
     498$td_ii_theTemplate      = filter_var($_POST['td_ii_theTemplate'], FILTER_SANITIZE_SPECIAL_CHARS);
    490499
    491500delete_option('td_ii_importTags');
     
    502511}
    503512
     513$select1=''; $select2='';
    504514$td_ii_importTags       = get_option('td_ii_importTags');
    505 if ($td_ii_importTags == 1) {$checkBox1='checked';}
     515if ($td_ii_importTags == 1) {$checkBox1='checked';} else {$checkBox1='';}
    506516$td_ii_cat              = get_option('td_ii_cat');
    507517$td_ii_postType         = get_option('td_ii_postType');
     
    582592    ';
    583593    add_option( "td_ii_theTemplate", $theTemplate, '', 'yes');
    584     add_option( "td_ii_db_version", "1.0.1" );
     594    add_option( "td_ii_db_version", "1.0.2" );
    585595   
    586596}
Note: See TracChangeset for help on using the changeset viewer.