Plugin Directory

Changeset 3084635


Ignore:
Timestamp:
05/10/2024 03:40:43 PM (20 months ago)
Author:
NextScripts
Message:

Version 4.4.4

Location:
social-networks-auto-poster-facebook-twitter-g/trunk
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • social-networks-auto-poster-facebook-twitter-g/trunk/NextScripts_SNAP.php

    r3004433 r3084635  
    55Description: This plugin automatically publishes posts from your blog to your social media accounts on Twitter, FB, Telegram, LinkedIn, and 25 more networks.
    66Author: NextScripts
    7 Version: 4.4.3
     7Version: 4.4.4
    88Author URI: https://www.nextscripts.com
    99Text Domain: social-networks-auto-poster-facebook-twitter-g
     
    1111*/
    1212
    13 const NextScripts_SNAP_Version = '4.4.3'; const NextScripts_SNAP_Version_Date = 'Dec 1, 2023';
     13const NextScripts_SNAP_Version = '4.4.4'; const NextScripts_SNAP_Version_Date = 'May 10, 2024';
    1414require_once "inc/nxs_functions_wp.php"; if(!defined( 'NXSSNAP_BASENAME' ) ) define( 'NXSSNAP_BASENAME', plugin_basename( __FILE__ ) );
    1515
    1616if (true===nxs_doSystemInitCheck()) { //  error_reporting(E_ALL); ini_set('display_errors', '1');
    17     //$vb = get_site_option('_nxs_v5b', 0); if ($vb==1) require_once "src/smsync.php"; //## V5 Beta
     17//  $vb = get_site_option('_nxs_v5b', 0); if ($vb==1) require_once "src/smsync.php"; //## V5 Beta
    1818    require_once "inc/nxs_functions.php"; require_once "inc/nxs_functions_adv.php"; require_once "inc/nxs_functions_engine.php"; require_once "inc/nxs_class_http.php"; require_once "inc/nxs_class_addns.php";
    1919    require_once "inc/nxs_class_snap.php"; require_once "inc/nxs_class_flt.php"; require_once "inc/nxs_class_mgmt.php"; require_once "inc/nxs_class_ntlist.php"; require_once "inc/nxs_class_oauth.php";
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/bg.php

    r2757212 r3084635  
    2525  function checkIfSetupFinished($options) { return !empty($options['accessToken']) || !empty($options['uPass']); }
    2626  public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL;     
    27     if ( isset($_GET['code']) && $_GET['code']!='' && isset($_GET['state']) && substr($_GET['state'], 0, 7) == 'nxs-bg-'){  $at = sanitize_text_field($_GET['code']);  $ii = str_replace('nxs-bg-','',sanitize_text_field($_GET['state']));
     27    if ( isset($_GET['code']) && $_GET['code']!='' && isset($_GET['state']) && substr($_GET['state'], 0, 7) == 'nxs-bg-'){
     28      $at = sanitize_text_field($_GET['code']);  $ii = sanitize_text_field(str_replace('nxs-bg-','',sanitize_text_field($_GET['state'])));
    2829      echo "----=={ oAuth 2.0 Wordflow }==----<br/>-= This is normal technical authorization info that will dissapear (Unless you get some errors) =- <br/><br/><br/>";
    2930      $gGet = $_GET; unset($gGet['code']); unset($gGet['state']); unset($gGet['scope']); unset($gGet['post_type']); unset($gGet['post']); //prr($nxs_snapSetPgURL);
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/fb.php

    r2804148 r3084635  
    3838  public function makeUName($options, $ii) { return !empty($options['pgName'])?$options['pgName']: $this->ntInfo['name'].' #'.$ii; }
    3939  public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL;
    40     if ( !empty($_GET['code']) && isset($_GET['state']) && substr($_GET['state'], 0, 7) == 'nxs-fb-'){ $this->showAuthTop(); echo "--== Auth ==--"; $at = sanitize_text_field($_GET['code']);  $ii = str_replace('nxs-fb-','',$_GET['state']); $gGet = array();
     40    if ( !empty($_GET['code']) && isset($_GET['state']) && substr($_GET['state'], 0, 7) == 'nxs-fb-'){
     41      $this->showAuthTop(); echo "--== Auth ==--"; $at = sanitize_text_field($_GET['code']);  $ii = sanitize_text_field(str_replace('nxs-fb-','',$_GET['state'])); $gGet = array();
    4142      if (!empty($_SERVER['QUERY_STRING'])) parse_str($_SERVER['QUERY_STRING'], $gGet); elseif (!empty($_SERVER['argv'][0])) parse_str($_SERVER['argv'][0], $gGet); else { $gGet = $_GET; unset($gGet['post_type']);}  unset($gGet['code']); unset($gGet['state']); prr($gGet);
    4243      $sturl = explode('?',$nxs_snapSetPgURL); $nxs_snapSetPgURL = $sturl[0].((!empty($gGet))?'?'.http_build_query($gGet):''); $fbo = $this->nt[$ii]; $advSet = nxs_mkRemOptsArr(nxs_getNXSHeaders()); prr($fbo); $fbo['uMsg'] = '';
    43       $tknURL = 'https://graph.facebook.com/oauth/access_token?client_id='.nxs_gak($fbo['appKey']).'&state=nxs-fb-'.$ii.'&redirect_uri='.urlencode($nxs_snapSetPgURL).'&client_secret='.nxs_gas($fbo['appSec']).'&code='.$at; $response  = nxs_remote_get($tknURL, $advSet); echo "<br/>TKN URL: "; prr($tknURL);   
     44      $tknURL = 'https://graph.facebook.com/oauth/access_token?client_id='.nxs_gak($fbo['appKey']).'&state=nxs-fb-'.esc_attr($ii).'&redirect_uri='.urlencode($nxs_snapSetPgURL).'&client_secret='.nxs_gas($fbo['appSec']).'&code='.esc_attr($at); $response  = nxs_remote_get($tknURL, $advSet); echo "<br/>TKN URL: "; prr($tknURL);
    4445      if ( (is_object($response) && (isset($response->errors))) || (is_array($response) && stripos($response['body'],'"error":')!==false )) { prr($response); die('</div></div>'); }     
    4546      if (substr($response['body'],0,1)=='{') $params = json_decode($response['body'], true); else parse_str($response['body'], $params);  $at = $params['access_token']; echo "<br/>TKN PARAMS: "; prr($params); echo "<br/>TKN RESP: "; prr($response); 
     
    119120  }
    120121 
    121   function getListOfPagesNX(){  $opVal = array(); $opNm = 'nxs_snap_fb_'.sha1('nxs_snap_fb'.$_POST['u'].$_POST['p']); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']);
     122  function getListOfPagesNX(){  $opVal = array(); $u = sanitize_text_field($_POST['u']); $p = sanitize_text_field($_POST['p']);
     123     $opNm = 'nxs_snap_fb_'.sha1('nxs_snap_fb'.$u.$p); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']);
    122124     global $nxs_SNAP; $networks = (!current_user_can( 'manage_options' ) && current_user_can( 'haveown_snap_accss' ) ) ? $nxs_SNAP->nxs_acctsU : $nxs_SNAP->nxs_accts;  $options = $networks['fb'][$ii];
    123125     if ($options['apiToUse'] =='nxv2') return $this->getListOfPages($networks);
    124126     $pgsA = array('id'=>'', 't'=>'u', 'l'=>'Profile');
    125      $pgs = '<option class="nxsBlue" '.($options['pgID']=='u' ? 'selected="selected"':'').' value="u">&nbsp;&nbsp;&nbsp;Profile</option>';  $currPstAs = !empty($_POST['pgID'])?$_POST['pgID']:(!empty($options)?$options['pgID']:'');
     127     $pgs = '<option class="nxsBlue" '.($options['pgID']=='u' ? 'selected="selected"':'').' value="u">&nbsp;&nbsp;&nbsp;Profile</option>';  $currPstAs = !empty($_POST['pgID'])?sanitize_text_field($_POST['pgID']):(!empty($options)?$options['pgID']:'');
    126128     if (empty($_POST['force']) && !empty($opVal['pageList']) ) $pgs = $opVal['pageList']; else {
    127129        //## Groups
    128         $nt = new nxsAPI_FB(); if (!empty($options['proxy'])&&!empty($options['proxyOn'])){ $nt->proxy['proxy'] = $options['proxy']['proxy']; if (!empty($options['proxy']['up'])) $nt->proxy['up'] = $options['proxy']['up'];};  $nt->sid = array('cn'=>$_POST['u'],'xs'=>$_POST['p']);
     130        $nt = new nxsAPI_FB(); if (!empty($options['proxy'])&&!empty($options['proxyOn'])){ $nt->proxy['proxy'] = $options['proxy']['proxy'];
     131        if (!empty($options['proxy']['up'])) $nt->proxy['up'] = $options['proxy']['up'];};  $nt->sid = array('cn'=>$u,'xs'=>$p);
    129132        $lpg = $nt->getPages();  if (!empty($nt->errMsg)) { echo $nt->errMsg; return; }
    130133        if (!empty($lpg)) {  $pgs .= '<option disabled>'.__('Pages', 'social-networks-auto-poster-facebook-twitter-g').'</option>';
     
    139142     $opVal['pageList'] = $pgs; array_walk_recursive($opVal,'nxs_uarr_string'); nxs_saveOption($opNm, $opVal); return $opVal;     
    140143  }
    141   function getListOfPages($networks){  $opVal = array(); $opNm = 'nxs_snap_fb_'.sha1('nxs_snap_fb'.$_POST['u'].$_POST['p']); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $pgs = '';
    142      $currPstAs = !empty($_POST['pgID'])?$_POST['pgID']:(!empty($networks['fb'][$ii])?$networks['fb'][$ii]['pgID']:'');
     144  function getListOfPages($networks){  $opVal = array(); $u = sanitize_text_field($_POST['u']); $p = sanitize_text_field($_POST['p']); $isOut = !empty($_POST['isOut']);
     145     $opNm = 'nxs_snap_fb_'.sha1('nxs_snap_fb'.$u.$p); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $pgs = '';
     146     $currPstAs = !empty($_POST['pgID'])?sanitize_text_field($_POST['pgID']):(!empty($networks['fb'][$ii])?$networks['fb'][$ii]['pgID']:'');
    143147     if (empty($_POST['force']) && !empty($opVal['pageList']) ) $pgs = $opVal['pageList']; else { $options = $networks['fb'][$ii]; 
    144148       if ($options['apiToUse'] =='nxv2') {$nt = new nxsAPI_FB();       
    145149       if (!empty($options['proxy'])&&!empty($options['proxyOn'])){ $nt->proxy['proxy'] = $options['proxy']['proxy']; if (!empty($options['proxy']['up'])) $nt->proxy['up'] = $options['proxy']['up'];};       
    146        $ui = $nt->_authUP($_POST['u'],$_POST['p']); if (!empty($ui)) { $opVal['uInfo'] = $nt->uInfo; $opVal['tpt'] = $nt->uInfo['access_token']; $opVal['accessToken'] = $nt->uInfo['access_token']; $opVal['authUser'] = 'me'; }}
     150       $ui = $nt->_authUP($u,$p); if (!empty($ui)) { $opVal['uInfo'] = $nt->uInfo; $opVal['tpt'] = $nt->uInfo['access_token']; $opVal['accessToken'] = $nt->uInfo['access_token']; $opVal['authUser'] = 'me'; }}
    147151       if (!empty($opVal) & is_array($opVal)) $options = array_merge($options, $opVal); if (empty($options['pgID'])) $options['pgID'] = '';
    148152       $advSet = nxs_mkRemOptsArr(nxs_getNXSHeaders()); $aacct = array('access_token'=>$options['accessToken']); if (empty($options['tpt'])) $aacct['appsecret_proof'] = hash_hmac('sha256', $options['accessToken'], nxs_gas($options['appSec']));
     
    150154       $ua = 'Mozilla/5.0 (iPhone; CPU iPhone OS 4_3_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iOS;FBSV/4.3.3;FBSS/3;FBID/phone;FBLC/en_US;FBOP/5;FBCR/AT&T]'; $advSet['headers']['User-Agent'] = $ua; $advSet['user-agent'] = $ua;
    151155       $resP = nxs_remote_get('https://graph.facebook.com/'.$options['authUser'].'/?'.http_build_query($aacct, null, '&'), $advSet); //prr('https://graph.facebook.com/'.$options['authUser'].'/?'.http_build_query($aacct, null, '&')); //prr($resP); // die(); //prr($resP, 'ACCOUNT');
    152        if (is_nxs_error($resP) || empty($resP['body'])) { $outMsg= 'Auth Error Account #1: '.print_r($resP, true);  if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; }
    153        $accInfo = json_decode($resP['body'], true); if ((is_array($accInfo) && !empty($accInfo['error']))) { $outMsg = 'Auth Error Account #2: '.print_r($accInfo['error'], true); if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; }       
     156       if (is_nxs_error($resP) || empty($resP['body'])) { $outMsg= 'Auth Error Account #1: '.print_r($resP, true);  if ($isOut) echo $outMsg; return $outMsg; }
     157       $accInfo = json_decode($resP['body'], true); if ((is_array($accInfo) && !empty($accInfo['error']))) { $outMsg = 'Auth Error Account #2: '.print_r($accInfo['error'], true); if ($isOut) echo $outMsg; return $outMsg; }
    154158       if ($options['apiToUse'] =='nxv2') $pgs .= '<option class="nxsTeal" '.($options['pgID']==$accInfo['id'] ? 'selected="selected"':'').' value="'.$accInfo['id'].'">Profile: '.$accInfo['name'].' ('.$accInfo['id'].')</option>';
    155159       $nxPgL = array( array('id'=>(!empty($accInfo)&&!empty($accInfo['id']))?$accInfo['id']:$options['authUser'], 't'=>'u', 'nm'=>'Profile - '.(!empty($accInfo)&&!empty($accInfo['name']))?$accInfo['name']:$options['authUserName']) );
    156160       //## List of pages       
    157161       $resP = nxs_remote_get('https://graph.facebook.com/'.$options['authUser'].'/accounts?fields=about,description,access_token,name&'.http_build_query($aacct, null, '&'), $advSet); // prr($resP, 'PAGES'); echo 'https://graph.facebook.com/'.$options['authUser'].'/accounts?'.http_build_query($aacct, null, '&');
    158        if (is_nxs_error($resP) || empty($resP['body'])) { $outMsg= 'Auth Error #1: '.print_r($resP, true);  if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; }
    159        $pages = json_decode($resP['body'], true); if ((is_array($pages) && !empty($pages['error']))) { $outMsg = 'Auth Error #2: '.print_r($pages['error'], true); if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; }       
     162       if (is_nxs_error($resP) || empty($resP['body'])) { $outMsg= 'Auth Error #1: '.print_r($resP, true);  if ($isOut) echo $outMsg; return $outMsg; }
     163       $pages = json_decode($resP['body'], true); if ((is_array($pages) && !empty($pages['error']))) { $outMsg = 'Auth Error #2: '.print_r($pages['error'], true); if ($isOut) echo $outMsg; return $outMsg; }
    160164       if (!empty($pages['data'])) { $pages = $pages['data']; if (empty($opVal)) $opVal = array(); //prr($pages);
    161165         foreach ($pages as $pg) $nxPgL[] = array('id'=>$pg['id'], 't'=>'p', 'nm'=>$pg['name'], 'tk'=>$pg['access_token']);           
     
    164168         }
    165169       }
    166        //## List of Groups   
    167        
     170       //## List of Groups
    168171       $resP = nxs_remote_get('https://graph.facebook.com/'.$options['authUser'].'/groups?'.http_build_query($aacct, null, '&'), $advSet); // prr($resP, 'GROUPS');
    169        if (is_nxs_error($resP) || empty($resP['body'])) { $outMsg= 'Auth Error #1: '.print_r($resP, true);  if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; } $pages = json_decode($resP['body'], true);
     172       if (is_nxs_error($resP) || empty($resP['body'])) { $outMsg= 'Auth Error #1: '.print_r($resP, true);  if ($isOut) echo $outMsg; return $outMsg; } $pages = json_decode($resP['body'], true);
    170173       
    171174       if ((is_array($pages) && !empty($pages['error'])) && !empty($pages['error']['message']) && stripos($pages['error']['message'],'endpoint')>0) {
     
    176179          }
    177180       }
    178        
    179        //if ((is_array($pages) && !empty($pages['error']))) { $outMsg = 'Auth Error #2 (GPP): '.print_r($pages['error'], true); if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; }       
    180        
    181181       if (!empty($pages['data'])) { $pages = $pages['data']; if (empty($opVal)) $opVal = array();
    182182         $nxGpO = array(); $nxGpC = array(); $nxGpS = array(); foreach ($pages as $pg) { $arr = array('id'=>$pg['id'], 'nm'=>$pg['name']); $nxPgL[] = array('id'=>$pg['id'], 't'=>'g', 'nm'=>$pg['name'], 'prv'=>$pg['privacy']);            //prr($pg);
     
    192192           foreach ($nxGpS as $pg) $pgs .= '<option class="nxsDarkOrange" '.($options['pgID']==$pg['id'] ? 'selected="selected"':'').' value="'.$pg['id'].'">&nbsp;&nbsp;&nbsp;'.$pg['nm'].' ('.$pg['id'].')</option>';
    193193         }
    194        }       
    195        
    196        $opVal['pageListArr'] = $nxPgL; // $opVal['pageList'] = $pgs;   
    197        
     194       }
     195       $opVal['pageListArr'] = $nxPgL; // $opVal['pageList'] = $pgs;
    198196     } $pgCust = (!empty($pgs) && !empty($currPstAs) && stripos($pgs,$currPstAs)===false)?'<option selected="selected" value="'.$currPstAs.'">'.$currPstAs.'</option>':'';     
    199      if (!empty($_POST['isOut'])) echo $pgCust.$pgs.'<option style="color:#BD5200" value="a">'.__('...enter the Page ID').'</option>'; // .'<option style="color:#BD5200" value="a">'.__('...enter the SubReddit ID').'</option>';
     197     if ($isOut) echo $pgCust.$pgs.'<option style="color:#BD5200" value="a">'.__('...enter the Page ID').'</option>'; // .'<option style="color:#BD5200" value="a">'.__('...enter the SubReddit ID').'</option>';
    200198     $opVal['pageList'] = $pgs; array_walk_recursive($opVal,'nxs_uarr_string'); nxs_saveOption($opNm, $opVal); return $opVal;
    201199  }
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/ig.api.php

    r2757212 r3084635  
    99   
    1010    function nxsCptCheck(){ if (function_exists('nxs_getOption')) { $opVal = array(); $opNm = sanitize_key($_POST['svc']); $opVal = nxs_getOption($opNm); $nt = new nxsAPI_IG(); if(!empty($opVal['ck'])) $nt->ck = $opVal['ck'];
    11       if (!empty($opVal['proxy'])&&!empty($opVal['proxyOn'])){ $nt->proxy['proxy'] = $opVal['proxy']['proxy']; if (!empty($opVal['proxy']['up'])) $nt->proxy['up'] = $opVal['proxy']['up']; }; $ck = $nt->checkCode($opVal['url'], $_POST['code']); 
     11      if (!empty($opVal['proxy'])&&!empty($opVal['proxyOn'])){ $nt->proxy['proxy'] = $opVal['proxy']['proxy']; if (!empty($opVal['proxy']['up'])) $nt->proxy['up'] = $opVal['proxy']['up']; }; $ck = $nt->checkCode($opVal['url'], sanitize_text_field($_POST['code']));
    1212      if ($ck!==false){ $opVal['ck'] = $ck;  nxs_saveOption($opNm, $opVal);
    1313        echo '<br/><br/> Your Code has been accepted. You can post to this account now. Reloading the page.....<script type="text/javascript">setTimeout(function(){ window.location = window.location; }, 3000);</script>'; die('All OK');
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/li.php

    r3004433 r3084635  
    3838  public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL;     
    3939    // V2 Auth Error
    40     if ( isset($_GET['page']) && $_GET['page']=='nxssnap' && !empty($_GET['error_description']) && isset($_GET['state']) && substr($_GET['state'], 0, 7) == 'nxs-li-'){ $this->showAuthTop();  $ii = str_replace('nxs-li-','',$_GET['state']); $nt = $this->ntInfo['lcode']; $ntU = $this->ntInfo['code']; $isNew = false;
     40    if ( isset($_GET['page']) && $_GET['page']=='nxssnap' && !empty($_GET['error_description']) && isset($_GET['state']) && substr($_GET['state'], 0, 7) == 'nxs-li-'){
     41        $this->showAuthTop();  $ii = sanitize_text_field(str_replace('nxs-li-','',$_GET['state'])); $nt = $this->ntInfo['lcode']; $ntU = $this->ntInfo['code']; $isNew = false;
    4142        $nto = $this->nt[$ii];
    4243        echo '----=={ oAuth 2.0 LinkedIn ERROR }==----<br/><br/><div style="color:red;">';
     
    5354    }
    5455    // V2 Auth
    55     if ( isset($_GET['code']) && $_GET['code']!='' && isset($_GET['state']) && substr($_GET['state'], 0, 7) == 'nxs-li-'){ $this->showAuthTop(); $at = sanitize_text_field($_GET['code']);  $ii = str_replace('nxs-li-','',$_GET['state']);
     56    if ( isset($_GET['code']) && $_GET['code']!='' && isset($_GET['state']) && substr($_GET['state'], 0, 7) == 'nxs-li-'){
     57      $this->showAuthTop(); $at = sanitize_text_field($_GET['code']);  $ii = sanitize_text_field(str_replace('nxs-li-','',$_GET['state']));
    5658      echo "----=={ oAuth 2.0 Wordflow }==----<br/><br/>";
    5759      $gGet = $_GET; unset($gGet['code']); unset($gGet['state']); unset($gGet['post_type']); unset($gGet['activated']); unset($gGet['stylesheet']);  $sturl = explode('?',$nxs_snapSetPgURL); $nxs_snapSetPgURL = $sturl[0].((!empty($gGet))?'?'.http_build_query($gGet):'');       
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/pn.api.php

    r2469838 r3084635  
    2121      //## Format
    2222      if (!empty($message['pTitle'])) $msgT = $message['pTitle']; else $msgT = nxs_doFormatMsg($options['msgTFormat'], $message);
    23       if (!empty($message['pText'])) $msg = $message['pText']; else $msg = nxs_doFormatMsg($options['msgFormat'], $message); $boardID = $options['pnBoard'];  // prr($boardID); prr($_POST); die();   
     23      if (!empty($message['pText'])) $msg = $message['pText']; else $msg = nxs_doFormatMsg($options['msgFormat'], $message); $boardID = $options['pnBoard'];
    2424      if (isset($message['imageURL'])) $imgURL = trim(nxs_getImgfrOpt($message['imageURL'], $options['imgSize'])); else $imgURL = ''; if ($imgURL=='') $badOut['Error'] .= 'NO Image.';
    2525      $urlToGo = (!empty($message['url']))?$message['url']:'';
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/rd.php

    r2757212 r3084635  
    129129  }
    130130   //## RD Specific
    131   function getListOfSubReddits($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_rd_'.sha1('nxs_snap_rd'.sanitize_user($_POST['u']).$pass); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $nt = new nxsAPI_RD();  // prr($opVal);
    132      $currPstAs = !empty($_POST['rdSR'])?$_POST['rdSR']:(!empty($networks['rd'][$ii])?$networks['rd'][$ii]['rdSubReddit']:'');
     131  function getListOfSubReddits($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode(sanitize_text_field($_POST['p'])); $opNm = 'nxs_snap_rd_'.sha1('nxs_snap_rd'.sanitize_user(sanitize_text_field($_POST['u'])).$pass);
     132     $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $nt = new nxsAPI_RD();  // prr($opVal);
     133     $currPstAs = !empty($_POST['rdSR'])?sanitize_text_field($_POST['rdSR']):(!empty($networks['rd'][$ii])?$networks['rd'][$ii]['rdSubReddit']:'');
    133134     if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['rdSubRedditsList']) ) $pgs = $opVal['rdSubRedditsList']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck'];
    134135       if (!empty($networks['rd'][$ii]['proxy'])&&!empty($networks['rd'][$ii]['proxyOn'])){ $nt->proxy['proxy'] = $networks['rd'][$ii]['proxy']['proxy']; if (!empty($networks['rd'][$ii]['proxy']['up'])) $nt->proxy['up'] = $networks['rd'][$ii]['proxy']['up']; } $loginError=$nt->connect(sanitize_user($_POST['u']),$_POST['p']);// var_dump($loginError);
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/tr.php

    r2757212 r3084635  
    5656  }   
    5757 
    58   function getListOfBlogs($networks){ $opVal = array(); $opNm = 'nxs_snap_tr_'.sha1('nxs_snap_tr'.$_POST['u'].$_POST['p']); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']);
    59      $currPstAs = !empty($_POST['cBlog'])?$_POST['cBlog']:(!empty($networks['tr'][$ii])?$networks['tr'][$ii]['pgID']:'');
     58  function getListOfBlogs($networks){ $opVal = array(); $opNm = 'nxs_snap_tr_'.sha1('nxs_snap_tr'.sanitize_text_field($_POST['u']).sanitize_text_field($_POST['p'])); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']);
     59     $currPstAs = !empty($_POST['cBlog'])?sanitize_text_field($_POST['cBlog']):(!empty($networks['tr'][$ii])?$networks['tr'][$ii]['pgID']:'');
    6060     if (empty($_POST['force']) && !empty($opVal['blogList']) ) $pgs = $opVal['blogList']; else { $options = $networks['tr'][$ii]; require_once('apis/trOAuth.php');
    6161       $tum_oauth = new TumblrOAuth(nxs_gak($options['appKey']), nxs_gas($options['appSec']),  $options['accessToken'], $options['accessTokenSec']); $userinfo = $tum_oauth->get('https://api.tumblr.com/v2/user/info');// prr($userinfo);
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/tw.php

    r2760471 r3084635  
    289289    }
    290290
    291     function importComments($options='', $postID='', $po='') { if (empty($postID)) $postID = $_POST['pid']; $ci = 0;
    292         if (empty($options)) {  global $nxs_SNAP; $options = $nxs_SNAP->nxs_options; }
    293         if (empty($po)) { $po =  maybe_unserialize(get_post_meta($postID, 'snap'.strtoupper($_POST['nt']), true)); $po = $po[sanitize_key($_POST['ii'])]; }
    294         if (isset($_POST['ii'])) $options = $options[$_POST['nt']][sanitize_key($_POST['ii'])];
     291    function importComments($options='', $postID='', $po='') { if (empty($postID)) $postID = sanitize_key($_POST['pid']); $ci = 0; $ii = sanitize_key($_POST['ii']);  $nt = sanitize_key($_POST['nt']);
     292        if (empty($options)) {  global $nxs_SNAP; $options = $nxs_SNAP->nxs_options; }
     293        if (empty($po)) { $po =  maybe_unserialize(get_post_meta($postID, 'snap'.strtoupper($nt), true)); $po = $po[$ii]; }
     294        if (!empty($ii)) $options = $options[$nt][$ii];
    295295
    296296        $appi = new nxsAPI_TW_Native(); $appi->conn = $options;  $rplL = [];
     
    310310        }
    311311        delete_post_meta($postID, 'snapImportedComments'); add_post_meta($postID, 'snapImportedComments', $impCmnts );
    312         if ( isset($_POST['pid']) && $_POST['pid']!='') printf( _n('%d comment has been imported.', '%d comments has been imported.', $ci, 'social-networks-auto-poster-facebook-twitter-g'), $ci );
     312        if ( !empty($_POST['pid']) ) printf( _n('%d comment has been imported.', '%d comments has been imported.', $ci, 'social-networks-auto-poster-facebook-twitter-g'), $ci );
    313313    }
    314314
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/wl.php

    r2760471 r3084635  
    491491}}
    492492if (!function_exists("nxs_rePostToWL_ajax")) {
    493   function nxs_rePostToWL_ajax() { check_ajax_referer('nxsSsPageWPN');  $postID = $_POST['id']; $options = get_option('NS_SNAutoPoster'); 
    494     foreach ($options['wl'] as $ii=>$two) if ($ii==$_POST['nid']) {    $two['ii'] = $ii; $two['pType'] = 'aj'; //if ($two['gpPageID'].$two['gpUName']==$_POST['nid']) { 
     493  function nxs_rePostToWL_ajax() { check_ajax_referer('nxsSsPageWPN');  $postID = sanitize_key($_POST['id']); $options = get_option('NS_SNAutoPoster');
     494    foreach ($options['wl'] as $ii=>$two) if ($ii==sanitize_key($_POST['nid'])) {    $two['ii'] = $ii; $two['pType'] = 'aj'; //if ($two['gpPageID'].$two['gpUName']==$_POST['nid']) {
    495495      $po =  get_post_meta($postID, 'snapWL', true); $po =  maybe_unserialize($po);// prr($gppo);
    496496      if (is_array($po) && isset($po[$ii]) && is_array($po[$ii])){ $ntClInst = new nxs_snapClassWL(); $two = $ntClInst->adjMetaOpt($two, $po[$ii]); }
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/xi.php

    r2757212 r3084635  
    4646  }
    4747 
    48   function getPgsList($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_xi_'.sha1('nxs_snap_xi'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $nt = new nxsAPI_XI();// $nt->debug = true; // prr($opVal);
     48  function getPgsList($networks){ $opVal = array(); $u = sanitize_text_field($_POST['u']); $p = sanitize_text_field($_POST['p']);
     49     $pass = 'g9c1a'.nsx_doEncode($p); $opNm = 'nxs_snap_xi_'.sha1('nxs_snap_xi'.$u.$pass); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $nt = new nxsAPI_XI();// $nt->debug = true; // prr($opVal);
    4950     $currPstAs = !empty($_POST['pgcID'])?$_POST['pgcID']:(!empty($networks['xi'][$ii])?$networks['xi'][$ii]['pgcID']:'');
    50      if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['pgsList']) ) $pgs = $opVal['pgsList']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; $loginError=$nt->connect(sanitize_user($_POST['u']),$_POST['p']);
     51     if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['pgsList']) ) $pgs = $opVal['pgsList']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; $loginError=$nt->connect(sanitize_user($u),$p);
    5152       if (!$loginError){ $opVal['ck'] = $nt->ck;  $pgs = $nt->getPgsList($currPstAs); }
    5253         else { $outMsg = '<b style="color:red;">'.__('Login Problem').'&nbsp;-&nbsp;'.$loginError.'</b>'; if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; }
     
    5556     $opVal['pgsList'] = $pgs; nxs_saveOption($opNm, $opVal); return $opVal;
    5657  }
    57   function getGrpList($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_xi_'.sha1('nxs_snap_xi'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $nt = new nxsAPI_XI(); // prr($opVal);
    58      $currPstAs = !empty($_POST['pggID'])?$_POST['pggID']:(!empty($networks['xi'][$ii]['pggID'])?$networks['xi'][$ii]['pggID']:'');
    59      if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['grpList']) ) $pgs = $opVal['grpList']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; $loginError=$nt->connect(sanitize_user($_POST['u']),$_POST['p']);
     58  function getGrpList($networks){ $opVal = array(); $u = sanitize_text_field($_POST['u']); $p = sanitize_text_field($_POST['p']);
     59     $pass = 'g9c1a'.nsx_doEncode($p); $opNm = 'nxs_snap_xi_'.sha1('nxs_snap_xi'.$u.$pass); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $nt = new nxsAPI_XI(); // prr($opVal);
     60     $currPstAs = !empty($_POST['pggID'])?sanitize_text_field($_POST['pggID']):(!empty($networks['xi'][$ii]['pggID'])?$networks['xi'][$ii]['pggID']:'');
     61     if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['grpList']) ) $pgs = $opVal['grpList']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; $loginError=$nt->connect(sanitize_user($u),$p);
    6062       if (!$loginError){ $opVal['ck'] = $nt->ck;  $pgs = $nt->getGrpList($currPstAs); }
    6163         else { $outMsg = '<b style="color:red;">'.__('Login Problem').'&nbsp;-&nbsp;'.$loginError.'</b>'; if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; }
     
    6466     $opVal['grpList'] = $pgs; nxs_saveOption($opNm, $opVal); return $opVal;
    6567  }
    66   function getGrpForums($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_xi_'.sha1('nxs_snap_xi'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $nt = new nxsAPI_XI();  $nt->debug = true;// prr($opVal);
    67      $currPstAs = !empty($_POST['pggID'])?$_POST['pggID']:(!empty($networks['xi'][$ii]['pggID'])?$networks['xi'][$ii]['pggID']:''); $currForum = !empty($_POST['gpfID'])?$_POST['gpfID']:(!empty($networks['xi'][$ii]['gpfID'])?$networks['xi'][$ii]['gpfID']:'');
    68      if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['grpForums']) ) $pgs = $opVal['grpForums']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; $loginError=$nt->connect(sanitize_user($_POST['u']),$_POST['p']);
     68  function getGrpForums($networks){ $opVal = array(); $u = sanitize_text_field($_POST['u']); $p = sanitize_text_field($_POST['p']);
     69     $pass = 'g9c1a'.nsx_doEncode($p); $opNm = 'nxs_snap_xi_'.sha1('nxs_snap_xi'.$u.$pass); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $nt = new nxsAPI_XI();  $nt->debug = true;// prr($opVal);
     70     $currPstAs = !empty($_POST['pggID'])?sanitize_text_field($_POST['pggID']):(!empty($networks['xi'][$ii]['pggID'])?$networks['xi'][$ii]['pggID']:''); $currForum = !empty($_POST['gpfID'])?sanitize_text_field($_POST['gpfID']):(!empty($networks['xi'][$ii]['gpfID'])?$networks['xi'][$ii]['gpfID']:'');
     71     if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['grpForums']) ) $pgs = $opVal['grpForums']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; $loginError=$nt->connect(sanitize_user($u),$p);
    6972       if (!$loginError){ $opVal['ck'] = $nt->ck;  $pgs = $nt->getGrpForums('https://www.xing.com/communities/groups/'.$currPstAs, $currForum); }
    7073         else { $outMsg = '<b style="color:red;">'.__('Login Problem').'&nbsp;-&nbsp;'.$loginError.'</b>'; if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; }
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/yo.api.php

    r2760471 r3084635  
    5252     
    5353      global $wpdb; $gCnt = 0; $bCnt = 0;
    54       $sql = "SELECT meta_value, user_id FROM $wpdb->usermeta WHERE meta_key = 'nxs_yo'";       
    55       $users = $wpdb->get_results($sql);
     54      $sql = $wpdb->prepare("SELECT meta_value, user_id FROM {$wpdb->usermeta} WHERE meta_key = %s", 'nxs_yo' ); $users = $wpdb->get_results($sql);
    5655      foreach ($users as $user) { $data['username'] = $user->meta_value;
    5756        $advSet = nxs_mkRemOptsArr($hdrsArr, '', $data); $rep = nxs_remote_post('http://api.justyo.co/yo/', $advSet); // prr($advSet); prr($rep);     
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_class_flt.php

    r3004433 r3084635  
    119119
    120120    public static function save_filter( $post_id ) {
    121         if ( !isset( $_POST['nxs_metabox_nonce'] ) || !wp_verify_nonce( $_POST['nxs_metabox_nonce'], basename( __FILE__ ) ) ) return $post_id;
     121        if ( !isset( $_POST['nxs_metabox_nonce'] ) || !wp_verify_nonce( sanitize_text_field( wp_unslash ($_POST['nxs_metabox_nonce'])), basename( __FILE__ ) ) ) return $post_id;
    122122        $pvData = self::sanitize_data($_POST);
    123123        if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return $post_id;
     
    578578       
    579579        $user_names = array(); //$users = get_users();     //   prr($users); //## Not Good when we have a lot of subscribers.
    580         global $wpdb; $users = $wpdb->get_results("SELECT ID, user_login, display_name FROM $wpdb->users WHERE 1=1 AND {$wpdb->users}.ID IN (SELECT {$wpdb->usermeta}.user_id FROM $wpdb->usermeta WHERE {$wpdb->usermeta}.meta_key = '{$wpdb->prefix}capabilities' AND {$wpdb->usermeta}.meta_value NOT LIKE '%subscriber%') ORDER BY display_name ASC"); //prr($users);
     580        global $wpdb;
     581
     582        $sql = $wpdb->prepare(
     583            "SELECT ID, user_login, display_name FROM {$wpdb->users} WHERE 1=1
     584                AND {$wpdb->users}.ID IN (
     585                    SELECT {$wpdb->usermeta}.user_id FROM {$wpdb->usermeta} WHERE {$wpdb->usermeta}.meta_key = %s AND {$wpdb->usermeta}.meta_value NOT LIKE %s
     586                ) ORDER BY display_name ASC",
     587            $wpdb->prefix . 'capabilities', '%subscriber%'
     588        );
     589        $users = $wpdb->get_results($sql);
     590
     591         //prr($users);
    581592       
    582593        if( $users ) foreach( $users as $user )  $user_names[$user->ID] = $user->display_name." (".$user->user_login.")";
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_class_mgmt.php

    r2804148 r3084635  
    5151           if (defined('NXSAPIVER')){ ?>&nbsp;&nbsp;|&nbsp;&nbsp; <img id="checkAPI2xLoadingImg" style="display: none;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' /><a href="" id="checkAPI2x">[Check for API Update]</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="" class="showLic">[Change Activation Key]</a><?php } echo '<br/><br/>';         
    5252         
    53             if (!empty($_POST['nxs_ntsiteid']) && check_admin_referer('nxsSsPageWPN', 'nxsSsPageWPN_wpnonce') ) { $csN = (int)$_POST['nxs_ntsiteid'];
     53            if (!empty($_POST['nxs_ntsiteid']) && check_admin_referer('nxsSsPageWPN', 'nxsSsPageWPN_wpnonce') ) { $csN = (int)sanitize_key($_POST['nxs_ntsiteid']);
    5454              if (!empty($cs) && $csN!=$cs) { switch_to_blog($cs); delete_option('nxsSNAPNetworks'); delete_option('nxsSNAPOptions');restore_current_blog();} $cs = $csN; update_site_option('nxs_nts', $cs);
    5555            } foreach ( $sites as $i => $site ) { $blog = get_blog_details($site['blog_id']); $sites[$i]['name'] = $blog->blogname; if ( $sites[$i]['blog_id']==$cs) $cSite = $sites[$i]; } 
     
    206206             </div>
    207207             <div style="padding-top: 8px; padding-bottom: 8px;"> <a id="nxsFltAddButton" href="#" class="NXSButton"><?php _e( 'Add new Reposter Action', 'social-networks-auto-poster-facebook-twitter-g' ); ?></a> </div>
    208              <form method="get"> <input type="hidden" name="page" value="nxssnap-reposter" /><?php $itemsTable->display(); ?></form>       
     208             <form method="get"> <input type="hidden" name="page" value="nxssnap-reposter" />
     209             <?php
     210             echo '<input type="hidden" name="my_bulk_action_nonce" value="' . wp_create_nonce( 'my_bulk_action_nonce' ) . '" />';
     211             $itemsTable->display(); ?>
     212             </form>
    209213            </div> <div id="nxs_spFltPopup"><span class="nxspButton bClose"><span>X</span></span><div id="nxs_spFltPopupU" style="min-height: 300px;"><?php nxs_rpstPopupCode(); ?></div></div><?php
    210214           
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_class_ntlist.php

    r2804148 r3084635  
    440440    public function adjMetaOpt($optMt, $pMeta) { return $this->adjMetaOptG($optMt, $pMeta); }
    441441   
    442     public function ajaxPost($options) { check_ajax_referer('nxsSsPageWPN');  $postID = $_POST['id'];  $nt = $this->ntInfo['lcode']; $ntU = $this->ntInfo['code']; $ntName = $this->ntInfo['name'];
     442    public function ajaxPost($options) { check_ajax_referer('nxsSsPageWPN');  $postID = sanitize_key($_POST['id']);  $nt = $this->ntInfo['lcode']; $ntU = $this->ntInfo['code']; $ntName = $this->ntInfo['name'];
    443443      foreach ($options[$nt] as $ii=>$nto) if ($ii==$_POST['nid']) {  $nto['ii'] = $ii; $nto['pType'] = 'aj';  $po =  get_post_meta($postID, 'snap'.$ntU, true); $po =  maybe_unserialize($po); $clName = 'nxs_snapClass'.$ntU; $ntClInst = new $clName();
    444444        if (is_array($po) && isset($po[$ii]) && is_array($po[$ii])){ $nto = $ntClInst->adjMetaOpt($nto, $po[$ii]); }
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_class_snap.php

    r3004433 r3084635  
    172172    //## Import Settings           
    173173    if (isset($_POST['upload_NS_SNAutoPoster_settings'])) { if (!empty($_POST['nxs_mqTest']) && $_POST['nxs_mqTest']=="\'") {array_walk_recursive($_POST, 'nsx_stripSlashes');}  array_walk_recursive($_POST, 'nsx_fixSlashes');             
    174       $secCheck =  wp_verify_nonce($_POST['nxsChkUpl_wpnonce'], 'nxsChkUpl');
     174      $secCheck =  wp_verify_nonce(sanitize_text_field( wp_unslash ($_POST['nxsChkUpl_wpnonce'])), 'nxsChkUpl');
    175175      if ($secCheck!==false && isset($_FILES['impFileSettings_button']) && is_uploaded_file($_FILES['impFileSettings_button']['tmp_name'])) { $fileData = trim(file_get_contents($_FILES['impFileSettings_button']['tmp_name']));
    176176        while (substr($fileData, 0,1)!=='a') $fileData = substr($fileData, 1); 
     
    916916  function showQueryTab() { global $wpdb, $nxs_snapAvNts, $nxsOne, $nxs_isWPMU, $nxs_tpWMPU; $nxsOne = ''; $options = $this->nxs_options;
    917917          $uidQ = (!current_user_can( 'manage_options' ) && current_user_can( 'haveown_snap_accss' ) ) ? ' WHERE uid = '.get_current_user_id().' ' : ''; //echo "SELECT * FROM ". $wpdb->prefix . "nxs_query ".$uidQ." ORDER BY timetorun DESC";
    918           $quPosts = $wpdb->get_results( "SELECT * FROM ". $wpdb->prefix . "nxs_query ".$uidQ." ORDER BY timetorun DESC", ARRAY_A );     
     918          $sql = $wpdb->prepare("SELECT * FROM %s ORDER BY timetorun DESC", $wpdb->prefix.'nxs_query'.$uidQ);
     919          $quPosts = $wpdb->get_results($sql, ARRAY_A);
    919920        ?>
    920921         <div style="width:99%;">
     
    14321433        return $actions;
    14331434    }
    1434     function process_bulk_action() {
    1435         if( 'delete'===$this->current_action() ) { $items = is_array($_REQUEST['nxs_filter'])?$_REQUEST['nxs_filter']:[]; $jj = 0;  //prr($_REQUEST);
    1436            foreach ($items as $item ) { $item = sanitize_key($item); wp_delete_post( $item, true ); $jj++; }
    1437             wp_die($jj.' Items deleted.');
    1438         }
    1439         if( 'activate'===$this->current_action() ) { $items = is_array($_REQUEST['nxs_filter'])?$_REQUEST['nxs_filter']:[]; $jj = 0;  //prr($_REQUEST);
    1440            foreach ($items as $item ) { $item = sanitize_key($item); $o = maybe_unserialize(get_post_meta( $item, 'nxs_rpstr', true ));  $o['rpstOn']='1'; nxs_Filters::save_meta( $item, 'nxs_rpstr', $o ); $jj++; }
    1441            wp_die($jj.' Items activated.');
    1442         }
    1443         if( 'deactivate'===$this->current_action() ) { $items = is_array($_REQUEST['nxs_filter'])?$_REQUEST['nxs_filter']:[]; $jj = 0;  //prr($_REQUEST);
    1444            foreach ($items as $item ) { $item = sanitize_key($item); $o = maybe_unserialize(get_post_meta( $item, 'nxs_rpstr', true ));  $o['rpstOn']='0'; nxs_Filters::save_meta( $item, 'nxs_rpstr', $o ); $jj++; }
    1445            wp_die($jj.' Items deactivated.');
    1446         }
     1435    function process_bulk_action() { $ca = $this->current_action(); $items = is_array($_REQUEST['nxs_filter'])?$_REQUEST['nxs_filter']:[]; $jj = 0;
     1436
     1437        if (!empty($ca) && !empty($items)) {
     1438            $nonce = isset( $_REQUEST['my_bulk_action_nonce'] ) ? $_REQUEST['my_bulk_action_nonce'] : '';
     1439            if ( ! wp_verify_nonce( $nonce, 'my_bulk_action_nonce' ) ) {
     1440                wp_die( 'Security check failed!' );
     1441            }
     1442
     1443            if ( 'delete' === $ca ) {   //prr($_REQUEST);
     1444                foreach ( $items as $item ) {
     1445                    $item = sanitize_key( $item );
     1446                    wp_delete_post( $item, true );
     1447                    $jj ++;
     1448                }
     1449                wp_die( $jj . ' Items deleted.' );
     1450            }
     1451            if ( 'activate' === $ca ) {
     1452                foreach ( $items as $item ) {
     1453                    $item        = sanitize_key( $item );
     1454                    $o           = maybe_unserialize( get_post_meta( $item, 'nxs_rpstr', true ) );
     1455                    $o['rpstOn'] = '1';
     1456                    nxs_Filters::save_meta( $item, 'nxs_rpstr', $o );
     1457                    $jj ++;
     1458                }
     1459                wp_die( $jj . ' Items activated.' );
     1460            }
     1461            if ( 'deactivate' === $ca ) {
     1462                foreach ( $items as $item ) {
     1463                    $item        = sanitize_key( $item );
     1464                    $o           = maybe_unserialize( get_post_meta( $item, 'nxs_rpstr', true ) );
     1465                    $o['rpstOn'] = '0';
     1466                    nxs_Filters::save_meta( $item, 'nxs_rpstr', $o );
     1467                    $jj ++;
     1468                }
     1469                wp_die( $jj . ' Items deactivated.' );
     1470            }
     1471        }
    14471472    }
    14481473
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_functions_adv.php

    r3004433 r3084635  
    7070      $post = array(
    7171        // 'ID'             => [ <post id> ] // Are you updating an existing post?
    72         'post_name'      => sanitize_title($_POST['post_title']),
     72        'post_name'      => sanitize_text_field($_POST['post_title']),
    7373        'post_title'     => $_POST['post_title'],
    7474        'post_status'    => 'publish',
     
    8282     if (!empty($pid)) { $flt = nxs_Filters::save_filter($pid);  $rpstrOpts = nxs_Filters::save_schinfo($pid);
    8383       if (!empty($_POST['resetStats'])) { delete_post_meta($pid, 'nxs_rpstr_stats'); global $wpdb;
    84            $wpdb->query( "DELETE FROM ". $wpdb->postmeta ." WHERE meta_key = 'snap_isRpstd".$pid."'" );
     84           $wpdb->query(
     85               $wpdb->prepare(
     86                   "DELETE FROM %s WHERE meta_key = %s",
     87                   $wpdb->postmeta,
     88                   'snap_isRpstd' . $pid
     89               )
     90           );
    8591       }
    8692       
     
    112118  }
    113119  //### Evil Buttons
    114   if ($_POST['nxsact']=='resetSNAPInfoPosts') { global $wpdb; $wpdb->query( "DELETE FROM ". $wpdb->postmeta ." WHERE meta_key LIKE 'snap%'" ); $wpdb->query( "DELETE FROM ". $wpdb->postmeta ." WHERE meta_key LIKE '_nxs_slinks'" );
     120  if ($_POST['nxsact']=='resetSNAPInfoPosts') {
     121      global $wpdb;
     122      $wpdb->query(
     123          $wpdb->prepare(
     124              "DELETE FROM %s WHERE meta_key LIKE %s",
     125              $wpdb->postmeta,
     126              'snap%'
     127          )
     128      );
     129
     130      $wpdb->query(
     131          $wpdb->prepare(
     132              "DELETE FROM %s WHERE meta_key LIKE %s",
     133              $wpdb->postmeta,
     134              '_nxs_slinks'
     135          )
     136      );
    115137      _e('Done. All SNAP data has been removed from posts.', 'social-networks-auto-poster-facebook-twitter-g');
    116138  }
    117   if ($_POST['nxsact']=='deleteAllSNAPInfo') { global $wpdb; $wpdb->query( "DELETE FROM ". $wpdb->options ." WHERE option_name = 'nxsSNAPOptions'" );  $wpdb->query( "DELETE FROM ". $wpdb->options ." WHERE option_name = 'nxsSNAPNetworks'" ); 
    118     $wpdb->query( "DELETE FROM ". $wpdb->options ." WHERE option_name = 'NS_SNriPosts'" );  $wpdb->query( "DELETE FROM ". $wpdb->postmeta ." WHERE meta_key LIKE 'snap%'" ); $wpdb->query( "DELETE FROM ". $wpdb->prefix . "nxs_query" );
    119     $wpdb->query( "DELETE FROM ". $wpdb->posts ." WHERE post_type = 'nxs_filter'" ); $wpdb->query( "DELETE FROM ". $wpdb->posts ." WHERE post_type = 'nxs_qp'" );   
    120     $wpdb->query( "DELETE FROM ". $wpdb->postmeta ." WHERE meta_key LIKE '_nxs_slinks'" );
     139  if ($_POST['nxsact']=='deleteAllSNAPInfo') { global $wpdb; $wpdb->query( "DELETE FROM ". $wpdb->options ." WHERE option_name = 'nxsSNAPOptions'" );  $wpdb->query( "DELETE FROM ". $wpdb->options ." WHERE option_name = 'nxsSNAPNetworks'" );
     140      $wpdb->query(
     141          $wpdb->prepare(
     142              "DELETE FROM %s WHERE option_name = %s",
     143              $wpdb->options,
     144              'NS_SNriPosts'
     145          )
     146      );
     147
     148      $wpdb->query(
     149          $wpdb->prepare(
     150              "DELETE FROM %s WHERE meta_key LIKE %s",
     151              $wpdb->postmeta,
     152              'snap%'
     153          )
     154      );
     155
     156      $wpdb->query(
     157          $wpdb->prepare(
     158              "DELETE FROM %s",
     159              $wpdb->prefix . 'nxs_query'
     160          )
     161      );
     162
     163      $wpdb->query(
     164          $wpdb->prepare(
     165              "DELETE FROM %s WHERE post_type = %s",
     166              $wpdb->posts,
     167              'nxs_filter'
     168          )
     169      );
     170
     171      $wpdb->query(
     172          $wpdb->prepare(
     173              "DELETE FROM %s WHERE post_type = %s",
     174              $wpdb->posts,
     175              'nxs_qp'
     176          )
     177      );
     178
     179      $wpdb->query(
     180          $wpdb->prepare(
     181              "DELETE FROM %s WHERE meta_key LIKE %s",
     182              $wpdb->postmeta,
     183              '_nxs_slinks'
     184          )
     185      );
    121186    if (((defined('MULTISITE') && MULTISITE!=false && !empty($_POST['nt']) && $_POST['nt']=='mu' && current_user_can('manage_network_options'))) || !defined('MULTISITE') || MULTISITE!=true){
    122187        delete_site_option('nxsSNAPOptions');  delete_site_option('__plugins_cache_242'); delete_site_option('__plugins_cache_244');         
     
    315380  $cronCheckArray = get_option('NXS_cronCheck'); if (empty($cronCheckArray)) $cronCheckArray = array('cronCheckStartTime'=>time(), 'cronChecks'=>array());   
    316381  if (($cronCheckArray['cronCheckStartTime']+900)>time()) {  ( $offset = get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
    317     $cronCheckArray['cronChecks'][] = '['.date_i18n('Y-m-d H:i:s', $_SERVER["REQUEST_TIME"]+$offset).'] - WP Cron called from '.(!empty($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:'Unknown IP').' ('.(!empty($_SERVER["HTTP_USER_AGENT"])?$_SERVER["HTTP_USER_AGENT"]:'Unknown UA').')';
     382    $cronCheckArray['cronChecks'][] = '['.date_i18n('Y-m-d H:i:s', $_SERVER["REQUEST_TIME"]+$offset).'] - WP Cron called from '.(!empty($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:'Unknown IP').' ('.(!empty($_SERVER["HTTP_USER_AGENT"])?esc_html(strip_tags($_SERVER["HTTP_USER_AGENT"])):'Unknown UA').')';
    318383    //nxs_addToLogN('S', 'Cron Check', '', 'WP Cron called from '.(!empty($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:'Unknown IP').' ('.$_SERVER["HTTP_USER_AGENT"].')', date_i18n('Y-m-d H:i:s', $_SERVER["REQUEST_TIME"]+$offset));
    319384  } elseif (empty($cronCheckArray['status']) &&  is_array($cronCheckArray['cronChecks'])) $cronCheckArray['status'] = (count($cronCheckArray['cronChecks'])<17 && count($cronCheckArray['cronChecks'])>1)?1:0;
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_functions_engine.php

    r2760471 r3084635  
    8080//## Recount Query/Timeline
    8181if (!function_exists("nxs_recountQueryTimes")) { function nxs_recountQueryTimes($force=false){ global $wpdb, $nxs_SNAP; if (!isset($nxs_SNAP)) return; $options = $nxs_SNAP->nxs_options; $currTime = nxs_getCurrTime();
    82     $quPosts = $wpdb->get_results( "SELECT * FROM ". $wpdb->prefix . "nxs_query WHERE type='Q' ORDER BY timetorun ASC", ARRAY_A );  // var_dump($quPosts);   prr($quPosts);
     82    $sql = $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}nxs_query WHERE type = %s ORDER BY timetorun ASC",'Q' );
     83    $quPosts = $wpdb->get_results($sql, ARRAY_A);  // var_dump($quPosts);   prr($quPosts);
    8384    if (count($quPosts)>0) { $pstEvrySec = $options['quDays']*86400+$options['quHrs']*3600+$options['quMins']*60; $rndSec = $options['quLimitRndMins']*60; $ttr = time(); //$ttr = strtotime('2050-10-15 10:10:10');
    8485        //$ttr = $quPosts[0]['timetorun']; $quNxTime = ($ttr>'2050-10-15 10:10:00')?(time()+(get_option('gmt_offset')*HOUR_IN_SECONDS)):strtotime($ttr); //## ????? why did I do that row?
     
    8990            $rndTime = rand(0-$rndSec, $rndSec); $quNxTime = $quNxTime + $pstEvrySec + $rndTime;
    9091        }
    91     } $quPosts = $wpdb->get_results( "SELECT * FROM ". $wpdb->prefix . "nxs_query WHERE type='R' ORDER BY timetorun ASC", ARRAY_A ); // prr($quPosts, 'KKKKKKKKKKKKKKKKKKKK');  // var_dump($quPosts);   
     92    } $sql = $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}nxs_query WHERE type = %s ORDER BY timetorun ASC", 'R' );
     93    $quPosts = $wpdb->get_results($sql, ARRAY_A); // prr($quPosts, 'KKKKKKKKKKKKKKKKKKKK');  // var_dump($quPosts);
    9294    if (count($quPosts)>0) foreach ($quPosts as $row){ $id = $row['id'];  if ($force || $row['timetorun'] > date_i18n('Y-m-d H:i:s', $currTime-600)) {
    9395        $rpstrOpts = maybe_unserialize(get_post_meta( $id, 'nxs_rpstr', true ));
     
    121123        nxs_addToLogN('L','NXS Cron Request (Forced)','',number_format(($tm-$tmL), 2,'.','').'s after the previous one. ', 'CNT: '.$_GET['nxs-cronrun'].'('.$contCron.')');
    122124    } else { //## Cron request from WP itself
    123         if ($tm<$tmL2) { nxs_addToLogN('W', '**WARNING. Unhealthy Cron Request**', ' [<a target="_blank" href="https://nxs.fyi/uhcr">More info</a>] ', 'Too close ('.number_format(($tm-$tmL), 2,'.','').'s) to the previous one. ', 'Now - '.date_i18n('H:i:s',$currTime).' | Previous - '.date_i18n('H:i:s',$tmL+$tmCorr).  '| Cron called from '.(!empty($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:'Unknown IP').' ('.nsTrnc((!empty($_SERVER["HTTP_USER_AGENT"])?$_SERVER["HTTP_USER_AGENT"]:'Unknown UA'), 70).')', 'cron');  /* return; */ }
    124         elseif ($tm>$tmL3) { nxs_addToLogN('W', '**WARNING. Unhealthy Cron Request**', ' [<a target="_blank" href="https://nxs.fyi/uhcr">More info</a>] ', 'Too far ('.number_format(($tm-$tmL), 2,'.','').'s) from the previous one. ', 'Now - '.date_i18n('H:i:s',$currTime).' | Previous - '.date_i18n('H:i:s',$tmL+$tmCorr).  '| Cron called from '.(!empty($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:'Unknown IP').' ('.nsTrnc((!empty($_SERVER["HTTP_USER_AGENT"])?$_SERVER["HTTP_USER_AGENT"]:'Unknown UA'), 70).')', 'cron');  /* return; */ }
    125         else nxs_addToLogN('L','Cron Request','',number_format(($tm-$tmL), 2,'.','').'s after the previous one. ', '| Cron called from '.(!empty($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:'Unknown IP').' ('.nsTrnc((!empty($_SERVER["HTTP_USER_AGENT"])?$_SERVER["HTTP_USER_AGENT"]:'Unknown UA'), 70).')', 'cron');
     125        if ($tm<$tmL2) { nxs_addToLogN('W', '**WARNING. Unhealthy Cron Request**', ' [<a target="_blank" href="https://nxs.fyi/uhcr">More info</a>] ', 'Too close ('.number_format(($tm-$tmL), 2,'.','').'s) to the previous one. ', 'Now - '.date_i18n('H:i:s',$currTime).' | Previous - '.date_i18n('H:i:s',$tmL+$tmCorr).  '| Cron called from '.(!empty($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:'Unknown IP').' ('.nsTrnc((!empty($_SERVER["HTTP_USER_AGENT"])?esc_html(strip_tags($_SERVER["HTTP_USER_AGENT"])):'Unknown UA'), 70).')', 'cron');  /* return; */ }
     126        elseif ($tm>$tmL3) { nxs_addToLogN('W', '**WARNING. Unhealthy Cron Request**', ' [<a target="_blank" href="https://nxs.fyi/uhcr">More info</a>] ', 'Too far ('.number_format(($tm-$tmL), 2,'.','').'s) from the previous one. ', 'Now - '.date_i18n('H:i:s',$currTime).' | Previous - '.date_i18n('H:i:s',$tmL+$tmCorr).  '| Cron called from '.(!empty($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:'Unknown IP').' ('.nsTrnc((!empty($_SERVER["HTTP_USER_AGENT"])?esc_html(strip_tags($_SERVER["HTTP_USER_AGENT"])):'Unknown UA'), 70).')', 'cron');  /* return; */ }
     127        else nxs_addToLogN('L','Cron Request','',number_format(($tm-$tmL), 2,'.','').'s after the previous one. ', '| Cron called from '.(!empty($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:'Unknown IP').' ('.nsTrnc((!empty($_SERVER["HTTP_USER_AGENT"])?esc_html(strip_tags($_SERVER["HTTP_USER_AGENT"])):'Unknown UA'), 70).')', 'cron');
    126128    }
    127129
     
    136138
    137139    //## Debug only - delete later - shows all reords in the Query
    138     $sqql = "SELECT * FROM ". $wpdb->prefix . "nxs_query ORDER BY timetorun DESC LIMIT ".$options['numOfTasks']; $quPosts = $wpdb->get_results( $sqql, ARRAY_A ); if ($isDebug) { prr($sqql); prr($quPosts); prr(date_i18n('Y-m-d H:i:s')); }
     140    $sqql = $wpdb->prepare("SELECT * FROM {$wpdb->prefix}nxs_query ORDER BY timetorun DESC LIMIT %d", $options['numOfTasks']);
     141    $quPosts = $wpdb->get_results($sqql, ARRAY_A);
     142    if ($isDebug) { prr($sqql); prr($quPosts); prr(date_i18n('Y-m-d H:i:s')); }
    139143    //## / Debug only - delete later - shows all reords in the Query
    140144
    141145    //## Get count of tasks
    142     $ttr = "FROM ". $wpdb->prefix . "nxs_query WHERE timetorun<'".date_i18n('Y-m-d H:i:s')."'"; $quPostsCnt = $wpdb->get_var( "SELECT COUNT(id) ".$ttr ); if ($isDebug) prr($ttr, 'TTR:'); if ($isDebug) prr($quPostsCnt, 'COUNT:'); if ((int)$quPostsCnt<1) return; //## Nothing in Query - return;
     146    $ttr = "FROM ". $wpdb->prefix . "nxs_query WHERE timetorun<'".date_i18n('Y-m-d H:i:s')."'";
     147    $quPostsCnt = $wpdb->get_var($wpdb->prepare("SELECT COUNT(id) %s", $ttr));
     148    if ($isDebug) prr($ttr, 'TTR:');
     149    if ($isDebug) prr($quPostsCnt, 'COUNT:');
     150    if ((int)$quPostsCnt<1) return; //## Nothing in Query - return;
    143151    //## Get 20 tasks
    144     $quPosts = $wpdb->get_results( "SELECT * ".$ttr." ORDER BY timetorun DESC LIMIT ".$options['numOfTasks'], ARRAY_A );  if ($isDebug) { var_dump($quPosts); prr($quPosts); } $quPosts = array_reverse($quPosts);
     152    $sql = $wpdb->prepare( "SELECT * %s ORDER BY timetorun DESC LIMIT %d", $ttr, $options['numOfTasks'] );
     153    $quPosts = $wpdb->get_results($sql, ARRAY_A);
     154
     155    // Assuming you have access to the $wpdb object and $options array
     156
     157    $current_datetime = date_i18n('Y-m-d H:i:s');
     158    $ttr = "FROM {$wpdb->prefix}nxs_query WHERE timetorun < %s";
     159    $prepared_count_query = $wpdb->prepare("SELECT COUNT(id) {$ttr}", $current_datetime);
     160    $quPostsCnt = $wpdb->get_var($prepared_count_query);
     161    if ($isDebug) {
     162        prr($ttr, 'TTR:');
     163        prr($quPostsCnt, 'COUNT:');
     164    }
     165    if ((int)$quPostsCnt < 1) {
     166        return; // Nothing in Query - return
     167    }
     168// Define the query to get 20 tasks
     169    $sql = $wpdb->prepare( "SELECT * %s ORDER BY timetorun DESC LIMIT %d", $ttr, $options['numOfTasks'] );
     170    $quPosts = $wpdb->get_results($sql, ARRAY_A);
     171
     172    $current_time = date_i18n('Y-m-d H:i:s');
     173    $sql_count = $wpdb->prepare("SELECT COUNT(id) FROM {$wpdb->prefix}nxs_query WHERE timetorun < %s", $current_time);
     174    $quPostsCnt = $wpdb->get_var($sql_count);
     175
     176    if ($isDebug) {
     177        prr($sql_count, 'TTR:');
     178        prr($quPostsCnt, 'COUNT:');
     179    }
     180
     181    if ((int) $quPostsCnt < 1) {
     182        return; // Nothing in query - return
     183    }
     184
     185// Get 20 tasks with prepared query
     186    $sql_select = $wpdb->prepare(
     187        "SELECT * FROM {$wpdb->prefix}nxs_query WHERE timetorun < %s ORDER BY timetorun DESC LIMIT %d",
     188        $current_time,
     189        $options['numOfTasks']
     190    );
     191    $quPosts = $wpdb->get_results($sql_select, ARRAY_A);
     192
     193
     194
     195
     196
     197
     198
     199
     200
     201    if ($isDebug) { var_dump($quPosts); prr($quPosts); } $quPosts = array_reverse($quPosts);
    145202    if (count($quPosts)>0) {
    146203        foreach ($quPosts as $row){ $id = $row['id']; if (!empty($row['postid'])) $postID = $row['postid']; else $postID = ''; //prr($row); prr($row['type']);
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_functions_wp.php

    r2804148 r3084635  
    527527    echo "| ".$whOut." |<br/>"; */
    528528  }
    529   $log = $wpdb->get_results( "SELECT * FROM ". $wpdb->prefix . "nxs_log ".$whOut." ORDER BY id DESC LIMIT ".$pg.",300", ARRAY_A );  if (!is_array($log)) return array(); else return $log;
     529    $sql = $wpdb->prepare( "SELECT * FROM %s ORDER BY id DESC LIMIT %d, 300", $wpdb->prefix.'nxs_log'.$whOut, $pg);
     530    $log = $wpdb->get_results($sql, ARRAY_A);  if (!is_array($log)) return array(); else return $log;
    530531}}
    531532
    532533if (!function_exists('nxs_do_this_hourly')){ function nxs_do_this_hourly() { global $wpdb, $nxs_SNAP; // nxsLogIt('Hourly Event');
    533   if (isset($nxs_SNAP)) $options = $nxs_SNAP->nxs_options;  if (!empty($options) && !empty($options['numLogRows'])) $numLogRows = $options['numLogRows']; else $numLogRows = 1000; 
    534   $wpdb->query( 'UPDATE '.$wpdb->prefix . 'nxs_log SET flt="snap" WHERE flt IS NULL OR flt=""'); // prr($wpdb->last_query); prr($wpdb->last_error);
    535   $wpdb->query( 'DELETE FROM '.$wpdb->prefix . 'nxs_log WHERE flt="cron" AND id NOT IN (SELECT id FROM (SELECT id FROM `'.$wpdb->prefix . 'nxs_log` ORDER BY id DESC LIMIT 360) foo)'); // prr($wpdb->last_query); prr($wpdb->last_error);
    536   $wpdb->query( 'DELETE FROM '.$wpdb->prefix . 'nxs_log WHERE id <=(SELECT id FROM (SELECT id FROM `'.$wpdb->prefix . 'nxs_log` ORDER BY id DESC LIMIT 1 OFFSET '.$numLogRows.') foo)'); //  prr($wpdb->last_query); prr($wpdb->last_error); 
     534  if (isset($nxs_SNAP)) $options = $nxs_SNAP->nxs_options;  if (!empty($options) && !empty($options['numLogRows'])) $numLogRows = $options['numLogRows']; else $numLogRows = 1000;
     535    // Update the 'flt' column to "snap" where 'flt' is NULL or empty
     536    $wpdb->query(
     537        $wpdb->prepare(
     538            'UPDATE %s SET flt = %s WHERE flt IS NULL OR flt = %s',
     539            $wpdb->prefix . 'nxs_log',
     540            'snap',
     541            ''
     542        )
     543    );
     544// prr($wpdb->last_query);
     545// prr($wpdb->last_error);
     546
     547// Delete rows where 'flt' is "cron" and 'id' is not in the last 360 records
     548    $wpdb->query(
     549        $wpdb->prepare(
     550            'DELETE FROM %s WHERE flt = %s AND id NOT IN (
     551            SELECT id FROM (
     552                SELECT id FROM %s ORDER BY id DESC LIMIT 360
     553            ) foo
     554        )',
     555            $wpdb->prefix . 'nxs_log',
     556            'cron',
     557            $wpdb->prefix . 'nxs_log'
     558        )
     559    );
     560// prr($wpdb->last_query);
     561// prr($wpdb->last_error);
     562
     563// Delete rows where 'id' is less than or equal to the 'id' at the offset specified by $numLogRows
     564    $wpdb->query(
     565        $wpdb->prepare(
     566            'DELETE FROM %s WHERE id <= (
     567            SELECT id FROM (
     568                SELECT id FROM %s ORDER BY id DESC LIMIT 1 OFFSET %d
     569            ) foo
     570        )',
     571            $wpdb->prefix . 'nxs_log',
     572            $wpdb->prefix . 'nxs_log',
     573            $numLogRows
     574        )
     575    );
     576// prr($wpdb->last_query);
     577// prr($wpdb->last_error);
    537578  //## ErrorLog to Email
    538579  if (isset($options['errNotifEmailCB']) && (int)$options['errNotifEmailCB'] == 1 && isset($options['errNotifEmail']) && trim($options['errNotifEmail']) != '') { $logToSend = maybe_unserialize(get_option('NSX_LogToEmail')); //  prr($logToSend);
     
    577618if (!function_exists("nxs_clLgo_ajax")) { function nxs_clLgo_ajax() { check_ajax_referer('nxsSsPageWPN'); global $wpdb; $uidQ = (!current_user_can( 'manage_options' ) && current_user_can( 'haveown_snap_accss' ) ) ? ' WHERE uid = '.get_current_user_id().' ' : '';
    578619  //update_option('NS_SNAutoPosterLog', '');
    579   $wpdb->query( 'DELETE FROM '.$wpdb->prefix . 'nxs_log'.$uidQ ); echo "OK";
     620    $wpdb->query(
     621        $wpdb->prepare(
     622            'DELETE FROM %s %s',
     623            $wpdb->prefix . 'nxs_log',
     624            $uidQ
     625        )
     626    );
     627    echo "OK";
    580628}}
    581629if (!function_exists("nxs_rfLgo_ajax")) { function nxs_rfLgo_ajax() { check_ajax_referer('nxsSsPageWPN');  echo "Y:"; $prm = $_POST['prm'];
     
    618666//## Settings Export
    619667if (!function_exists("nxs_noR")) { function nxs_noR(&$item, &$key){ $item = is_string($item)?(str_replace("\r","\n",str_replace("\n\r","\n",str_replace("\r\n","\n",$item)))):$item; }}
    620 if (!function_exists("nxs_getExpSettings_ajax")) { function nxs_getExpSettings_ajax() { /* check_ajax_referer('nsDN'); */  $filename = preg_replace('/[^a-z0-9\-\_\.]/i','',$_POST['filename']);
     668if (!function_exists("nxs_getExpSettings_ajax")) { function nxs_getExpSettings_ajax() {  check_ajax_referer('nxsSsPageWPN');
     669 $filename = preg_replace('/[^a-z0-9\-\_\.]/i','',$_POST['filename']);
    621670 header("Cache-Control: "); header("Content-type: text/plain"); header('Content-Disposition: attachment; filename="'.$filename.'"');
    622671 global $nxs_SNAP;  if (!isset($nxs_SNAP)) return;  $exp['u'] = (!current_user_can( 'manage_options' ) && current_user_can( 'haveown_snap_accss' ) ) ? $nxs_SNAP->nxs_acctsU : $nxs_SNAP->nxs_accts; 
    623  if (!empty($_POST['chN'])) { $arr = explode(',',$_POST['chN']); 
     672 if (!empty($_POST['chN'])) { $arr = explode(',',$_POST['chN']);
    624673   if (!empty($arr)) { $outArr = array(); foreach ($exp['u'] as $ntN=>$nt) foreach ($nt as $ii=>$dt) if (in_array($ntN.'-'.$ii,$arr)) $outArr[$ntN][$ii] = $dt; $exp['u'] = $outArr; }
    625674 } if (current_user_can( 'manage_options' )) $exp['o'] = $nxs_SNAP->nxs_options; array_walk_recursive($exp,"nxs_noR");  $ser = serialize($exp); echo $ser;  die();
  • social-networks-auto-poster-facebook-twitter-g/trunk/readme.txt

    r3004433 r3084635  
    55Tags: automation, autopost, auto-post, auto post, socialnetworks, socialnetwork, social networks, social network, Flipboard, google,  Flickr, twitter, pinterest, google my business, 500px, tumblr, blogger, blogspot, linkedin, reddit, reddit.com, plugin, links, Post, posts, api, automatic, seo, scoop.it, integration, bookmark, bookmarks, admin, images, image, social, sharing, share, repost, re-post, wordpress.com, Diigo, vBulletin, Plurk, forums, vKontakte, open graph, LiveJournal, SETT, YouTube, Telegram, xing, medium, yo, Weibo, mailchimp, line, Odnoklassniki, ok.ru
    66Requires at least: 5.0
    7 Tested up to: 6.4.1
    8 Stable tag: 4.4.3
     7Tested up to: 6.5.3
     8Stable tag: 4.4.4
    99License: GPLv2 or later
    1010
     
    178178== Changelog ==
    179179
     180= 4.4.4 [10/05/2024] =
     181
     182* Bug Fix - Possible security issue [CVE-2024-2088]
     183* Bug Fix - Possible security issue [CVE-2024-1762]
     184* Bug Fix - Possible security issue [CVE-2024-1446]
     185* Bug Fix - Possible XSS security issue [PS-e8dc2137-b88e-4916-a46d-d85a0e33c40b]
     186* Bug Fix - Other possible security issues/unsafe SQL Calls
     187
    180188= 4.4.3 [12/01/2023] =
    181189
Note: See TracChangeset for help on using the changeset viewer.