Plugin Directory

Changeset 2758241


Ignore:
Timestamp:
07/18/2022 11:55:48 PM (4 years ago)
Author:
NextScripts
Message:

Version 4.3.29

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

Legend:

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

    r2757419 r2758241  
    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.3.28
     7Version: 4.3.29
    88Author URI: https://www.nextscripts.com
    99Text Domain: social-networks-auto-poster-facebook-twitter-g
     
    1111*/
    1212
    13 define( 'NextScripts_SNAP_Version' , '4.3.28' ); define( 'NextScripts_SNAP_Version_Date' , 'July 16, 2022' ); require_once "inc/nxs_functions_wp.php"; if(!defined( 'NXSSNAP_BASENAME' ) ) define( 'NXSSNAP_BASENAME', plugin_basename( __FILE__ ) );
     13define( 'NextScripts_SNAP_Version' , '4.3.29' ); define( 'NextScripts_SNAP_Version_Date' , 'July 18, 2022' ); require_once "inc/nxs_functions_wp.php"; if(!defined( 'NXSSNAP_BASENAME' ) ) define( 'NXSSNAP_BASENAME', plugin_basename( __FILE__ ) );
    1414
    15 if (true===nxs_doSystemInitCheck()) { //  error_reporting(E_ALL); ini_set('display_errors', '1');
     15if (true===nxs_doSystemInitCheck()) { // error_reporting(E_ALL); ini_set('display_errors', '1');
    1616    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";
    1717    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/apis/xmlrpc-client.php

    r2757212 r2758241  
    399399    var $debug = false;
    400400    var $timeout;
     401    var $proxy = [];
    401402
    402403    // Storage place for an error message
     
    530531        $rq = new nxsHttp2;
    531532        $url = 'https://' . $this->server . ':' . $this->port . $this->path;
    532         $argArr['flds'] = $xml; $argArr['extraHeaders']['Content-Type'] = 'text/xml';
    533         $args = nxs_mkRmReqArgs($argArr); $ret = $rq->request($url, $args);
     533        $argArr['flds'] = $xml; $argArr['extraHeaders']['Content-Type'] = 'text/xml'; if (!empty($this->proxy)) $argArr['proxy'] = $this->proxy;
     534        $args = nxs_mkRmReqArgs($argArr); $ret = $rq->request($url, $args); //prr($args);
    534535        $contents = is_array($ret)?$ret['body']:''; $err = $ret['response']['code'];
    535536
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/lj.api.php

    r1968023 r2758241  
    3030     
    3131      require_once ('apis/xmlrpc-client.php'); if (!empty($options['ljSrv']) && $options['ljSrv']=='DW') $server = 'dreamwidth.org'; else $server = 'livejournal.com';     
    32       $nxsToLJclient = new NXS_XMLRPC_Client('https://www.'.$server.'/interface/xmlrpc'); $nxsToLJclient->debug = false;             
    33      
    34       $msg = preg_replace('/<script\b[^>]*>(.*?)<\/script>/is', "", $msg);
     32      $nxsToLJclient = new NXS_XMLRPC_Client('https://www.'.$server.'/interface/xmlrpc'); $nxsToLJclient->debug = false;// prr($options);
     33      if (!empty($options['proxy'])&&!empty($options['proxyOn'])){ $nxsToLJclient->proxy['proxy'] = $options['proxy']['proxy']; if (!empty($options['proxy']['up']))  $nxsToLJclient->proxy['up'] = $options['proxy']['up']; }
     34
     35        $msg = preg_replace('/<script\b[^>]*>(.*?)<\/script>/is', "", $msg);
    3536     
    3637      $date = !empty($message['postDate']) ? strtotime($message['postDate']) : time(); $year = date("Y", $date); $mon = date("m", $date); $day = date("d", $date); $hour = date("G", $date); $min = date("i", $date);
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/lj.php

    r2757212 r2758241  
    5050    <br/ ><?php
    5151  }
    52   function advTab($ii, $options){}
     52  function advTab($ii, $options){$this->showProxies($this->ntInfo['lcode'], $ii, $options);}
    5353  //#### Set Unit Settings from POST
    5454  function setNTSettings($post, $options){
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/tg.api.php

    r1968023 r2758241  
    3131      if (substr($options['whToPost'],0,1)=='g') $options['whToPost'] = substr_replace($options['whToPost'], '-',0,1); //## Fix for Groups ID
    3232      //## Attach Image (Upload from tmp was here before version 4)     
    33       if ($options['attchImg']=='1') { $url = 'https://api.telegram.org/bot'.$options['botTkn'].'/sendPhoto';
    34         $flds = array( 'chat_id' => $options['whToPost'],'photo' => $imgURL, 'caption' => '' );
     33      if ((!empty($options['postType'])&&$options['postType']=='I') || $options['attchImg']=='1') { $url = 'https://api.telegram.org/bot'.$options['botTkn'].'/sendPhoto';
     34        $flds = array( 'chat_id' => $options['whToPost'],'photo' => $imgURL, 'caption' => (!empty($options['postType'])&&$options['postType']=='I')?$msg:'', 'parse_mode' => 'HTML', 'disable_web_page_preview' => $options['webPrev']=='0' );
    3535        $hdrsArr = $this->nxs_getHeaders('https://api.telegram.org', true);
    36         $advSet = nxs_mkRemOptsArr($hdrsArr, '', $flds, $proxy); $ret = nxs_remote_post( $url, $advSet); if (is_nxs_error($ret)) {  $badOut = print_r($ret, true)." - ERROR"; return $badOut; }       
    37       } 
    38       $msg = str_ireplace('<strong>','<b>',str_ireplace('</strong>','</b>',str_ireplace('<em>','<i>',str_ireplace('</em>','</i>',$msg)))); $msg = nsTrnc(strip_tags($msg, '<b><i><a><code><pre>'), 3000); $url = 'https://api.telegram.org/bot'.$options['botTkn'].'/sendMessage';
    39       $flds = array('chat_id' => $options['whToPost'], 'text' => $msg, 'parse_mode' => 'HTML', 'disable_web_page_preview' => $options['webPrev']=='0'); $hdrsArr = $this->nxs_getHeaders('https://api.telegram.org', true);
    40       $advSet = nxs_mkRemOptsArr($hdrsArr, '', $flds, $proxy); $ret = nxs_remote_post( $url, $advSet); if (is_nxs_error($ret)) {  $badOut = print_r($ret, true)." - ERROR"; return $badOut; }       
    41       $contents = $ret['body']; $resp = json_decode($contents, true);   //  prr($resp);
    42       if (is_array($resp) && !empty($resp['ok']) && $resp['ok'] == 1 ) { if (empty($resp['result']['chat']['username'])) $purl = 'https://web.telegram.org/#/im?p='.str_replace('-','g',$resp['result']['chat']['id']); else $purl = 'http://telegram.me/'.$resp['result']['chat']['username'];
    43           return array('postID'=>$resp['result']['message_id'], 'isPosted'=>1, 'postURL'=>$purl, 'pDate'=>date('Y-m-d H:i:s')); 
    44       } else $badOut['Error'] .= 'Something went wrong - '.print_r($ret, true);
     36        $advSet = nxs_mkRemOptsArr($hdrsArr, '', $flds, $proxy); $ret = nxs_remote_post( $url, $advSet); if (is_nxs_error($ret)) {  $badOut = print_r($ret, true)." - ERROR"; return $badOut; }
     37
     38      }
     39      if (empty($options['postType'])||$options['postType']=='T') {
     40          $msg = str_ireplace('<strong>','<b>',str_ireplace('</strong>','</b>',str_ireplace('<em>','<i>',str_ireplace('</em>','</i>',$msg)))); $msg = nsTrnc(strip_tags($msg, '<b><i><a><code><pre>'), 3000); $url = 'https://api.telegram.org/bot'.$options['botTkn'].'/sendMessage';
     41          $flds = array('chat_id' => $options['whToPost'], 'text' => $msg, 'parse_mode' => 'HTML', 'disable_web_page_preview' => $options['webPrev']=='0'); $hdrsArr = $this->nxs_getHeaders('https://api.telegram.org', true);
     42          $advSet = nxs_mkRemOptsArr($hdrsArr, '', $flds, $proxy); $ret = nxs_remote_post( $url, $advSet); if (is_nxs_error($ret)) {  $badOut = print_r($ret, true)." - ERROR"; return $badOut; }
     43      }
     44      $contents = $ret['body']; $resp = json_decode($contents, true);   //  prr($resp);
     45      if (is_array($resp) && !empty($resp['ok']) && $resp['ok'] == 1 ) { if (empty($resp['result']['chat']['username'])) $purl = 'https://web.telegram.org/#/im?p='.str_replace('-','g',$resp['result']['chat']['id']); else $purl = 'http://telegram.me/'.$resp['result']['chat']['username'];
     46          return array('postID'=>$resp['result']['message_id'], 'isPosted'=>1, 'postURL'=>$purl, 'pDate'=>date('Y-m-d H:i:s'));
     47      } else $badOut['Error'] .= 'Something went wrong - '.print_r($ret, true);
    4548      return $badOut;     
    4649   }   
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/tg.php

    r2757212 r2758241  
    1616    <div style="width:100%;"><strong><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('Channel ID, Group ID or Chat ID', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="tg[<?php echo esc_attr($ii); ?>][whToPost]" style="width: 50%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['whToPost'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>   
    1717    <br/><?php $this->elemMsgFormat($ii,'Message Format','msgFormat',$options['msgFormat']); ?>
    18     <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]"  <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>
    19     <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]"  <?php if ((int)$options['webPrev'] == 1) echo "checked"; ?> /> <strong><?php _e('Enable Web Preview', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>
     18
     19      <input type="radio" name="tg[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if (empty($options['postType']) || $options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>
     20          <div style="margin: 0px;margin-left: 20px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]"  <?php if ((int)$options['attchImg'] == 1) echo "checked";  ?>  /> <strong><?php _e('Attach Image to the Post (as a separate post)', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>
     21          <div style="margin: 0px;margin-left: 20px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]"  <?php if ((int)$options['webPrev'] == 1) echo "checked"; ?> /> <strong><?php _e('Enable Web Preview', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>
     22
     23      <input type="radio" name="tg[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if (!empty($options['postType']) && $options['postType'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Upload image along with the text message.', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>
    2024    <br/><?php
    2125  }
     
    6468       
    6569   <div class="nxsPostEd_ElemWrap">       
    66      <div class="nxsPostEd_Elem">   
    67         <div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]"/>
     70     <div class="nxsPostEd_Elem">
     71         <input type="radio" class="nxsEdElem" name="tg[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if (empty($ntOpt['postType']) || $ntOpt['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>
     72        <div style="margin: 0px;margin-left: 20px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]"/>
    6873          <input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if (!empty($ntOpt['webPrev'])) echo "checked"; ?> /> <strong><?php _e('Enable Web Preview', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>
    69         <div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]"/>
     74        <div style="margin: 0px;margin-left: 20px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]"/>
    7075          <input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if (!empty($ntOpt['attchImg'])) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>
     76
     77         <input type="radio" class="nxsEdElem" name="tg[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if (!empty($ntOpt['postType']) && $ntOpt['postType'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Upload image along with the text message.', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>
    7178     </div>
    7279   </div><?php
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/tw.api.php

    r2757419 r2758241  
    1313    }
    1414
    15     function doPostToNT($options, $message){ global $nxs_urlLen; $badOut = array('pgID'=>'', 'isPosted'=>0, 'pDate'=>date('Y-m-d H:i:s'), 'Error'=>'');
     15    function doPostToNT($options, $message){ global $nxs_urlLen; $out = array('pgID'=>'', 'isPosted'=>0, 'pDate'=>date('Y-m-d H:i:s'), 'Error'=>'');
    1616      if (!function_exists('nxs_remote_get') && function_exists('nxs_remote_get')) { function nxs_remote_get($url){return nxs_remote_get($url);} }
    1717      if (!function_exists('is_nxs_error') && function_exists('is_nxs_error')) { function is_nxs_error($a){return is_nxs_error($a);} }
    1818      //## Check settings
    19       if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; }     
    20       if (!isset($options['accessToken']) || trim($options['accessToken'])=='') { $badOut['Error'] = 'No Auth Token Found'; return $badOut; }
     19      if (!is_array($options)) { $out['Error'] = 'No Options'; return $out; }
     20      if (!isset($options['accessToken']) || trim($options['accessToken'])=='') { $out['Error'] = 'No Auth Token Found'; return $out; }
    2121      if (empty($options['imgSize'])) $options['imgSize'] = '';
    2222      //## Old Settings Fix
     
    3434      } 
    3535      $twLim = 280; if ($nxs_urlLen>0) { $msg = nsTrnc($msg, $twLim-22+$nxs_urlLen); } else $msg = nsTrnc($msg, $twLim); if (substr($msg, 0, 1)=='@') $msg = ' '.$msg;
    36       $params_array = array('text' =>$msg);  $mid = ''; $appi = new nxsAPI_TW_Native(); $appi->conn = $options; $badOut = $appi->check(); if ($badOut) {
     36      $params_array = array('text' =>$msg);  $mid = ''; $appi = new nxsAPI_TW_Native(); $appi->conn = $options; $check = $appi->check(); if ($check===true) {
    3737            if (!empty($options['in_reply_to_id'])) $params_array['in_reply_to_status_id'] = $options['in_reply_to_id']; //## ?
    3838            //## Upload image and add it to the post
     
    4848            //## Fallback in case no mo imgs allowed.
    4949            if ($code == '403' && stripos($resp, 'User is over daily photo limit') !== false && $options['attchImg'] != false && $img != '') {
    50                 $badOut['Error'] = $badOut['Error']." User is over daily photo limit. Will post without image\r\n";
     50                $out['Error'] = $out['Error']." User is over daily photo limit. Will post without image\r\n";
    5151                $ret = $appi->twReq('https://api.twitter.com/2/tweets', array('text' => $msg));
    5252                $code = $ret['response']['code']; $resp = $ret['body']; $respJ = json_decode($resp, true);
     
    6262            } else {
    6363                $je =  (is_array($respJ) && !empty($respJ['errors']))?"| Error: " . print_r($respJ['errors'], true):'';
    64                 $badOut['Error'] = $badOut['Error'] . "| Resp: " . print_r($resp, true) . $je . "| MSG: " . print_r($msg, true);
    65                 return $badOut;
     64                $out['Error'] = $out['Error'] . "| Resp: " . print_r($resp, true) . $je . "| MSG: " . print_r($msg, true);
     65                return $out;
    6666            }
    67         }
    68       return $badOut;
     67        } else $out['Error'] = $check;
     68      return $out;
    6969    } 
    7070   
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_class_http.php

    r2757212 r2758241  
    1717    function request($url, $args = array()){
    1818        //## Add Proxy to the request.
     19        if (empty($this->proxy)&&!empty($args['proxy'])) $this->proxy = $args['proxy'];
    1920        if (!empty($this->proxy)) add_action( "requests-requests.before_request", function( $url, $headers, $data, $type, &$options ){
    2021            $options['proxy'] = new Requests_Proxy_HTTP( $this->proxy['proxy'] );
    2122            if ( !empty($this->proxy['up']) ) { $up = explode(':',$this->proxy['up']);
    2223                $options['proxy']->use_authentication = true;
    23                 $options['proxy']->user = $up[0]; $options['proxy']->pass = $up[1];
     24                $options['proxy']->user = $up[0]; $options['proxy']->pass = $up[1]; //echo "Proxy has been used - ".$this->proxy['proxy'];
    2425            } $options['proxy']->register($options['hooks']);
    2526        }, 10, 5 );
  • social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_class_ntlist.php

    r2757212 r2758241  
    249249      if (isset($pval['fltrAfter'])) $o['fltrAfter'] = trim($pval['fltrAfter']); else if (isset($o['fltrAfter'])) unset($o['fltrAfter']); $o['fltrs'] = array();
    250250      //## Proxy
    251       if (isset($pval['proxyOn'])) $o['proxyOn'] = trim($pval['proxyOn']); else $o['proxyOn'] = 0;  //prr($o);
     251      if (isset($pval['proxyOn'])) $o['proxyOn'] = trim($pval['proxyOn']); else $o['proxyOn'] = 0; // prr($o);
    252252      if (isset($pval['proxy']))   $o['proxy']['proxy'] = trim($pval['proxy']);
    253253      if (isset($pval['proxyup'])) $o['proxy']['up'] = trim($pval['proxyup']);
  • social-networks-auto-poster-facebook-twitter-g/trunk/readme.txt

    r2757419 r2758241  
    66Requires at least: 3.4
    77Tested up to: 6.0.1
    8 Stable tag: 4.3.28
     8Stable tag: 4.3.29
    99License: GPLv2 or later
    1010
     
    1313== Description ==
    1414
    15 **This plugin automatically publishes posts from your blog to your Social Media accounts** such as Twitter, Google+(Google Plus), Blogger, Tumblr, Flickr, LinkedIn, ok.ru, LiveJournal, DreamWidth, Flipboard, Telegram, Line, Diigo, Instapaper, Pinterest, Plurk, VK.com (VKontakte), YouTube, Scoop.It, Wordpress, XING etc. The whole process is completely automated. Just write a new post and either entire post or it's nicely formatted announcement with backlink will be published to all your configured social networks. You can reach the most audience and tell all your friends, readers and followers about your new post. Plugin works with profiles, business pages, community pages, groups, etc. Messages are 100% customizable and adopted for each network requirements.
     15**This plugin automatically publishes posts from your blog to your Social Media accounts** such as Twitter, Blogger, Telegram, Tumblr, Flickr, LinkedIn, ok.ru, LiveJournal, DreamWidth, Flipboard, Google My Business, Line, Diigo, Instapaper, Pinterest, Plurk, VK.com (VKontakte), YouTube, Scoop.It, Wordpress, XING etc. The whole process is completely automated. Just write a new post and either entire post or it's nicely formatted announcement with backlink will be published to all your configured social networks. You can reach the most audience and tell all your friends, readers and followers about your new post. Plugin works with profiles, business pages, community pages, groups, etc. Messages are 100% customizable and adopted for each network requirements.
    1616
    1717[Great News - July 2022] After almost 2 years break, plugin is back to active development and support. Version 4.4 is coming soon...
     
    183183== Changelog ==
    184184
    185 = 4.3.28 [07/15/2022] =
     185= 4.3.29 [07/18/2022] =
     186
     187* New/Improvement - [Telegram] - "Image" post type has been added.
     188* New/Improvement - [LJ] - Added support for Proxy.
     189* Bug Fix - Proxy support was broken.
     190* Bug Fix - [Twitter] - fix for "Illegal string offset 'Error'"
     191* Bug Fix - [IG] Fix for "Value must be integer"
     192
     193= 4.3.28 [07/16/2022] =
    186194
    187195* Bug Fix - [ok.ru] - Image upload error fix.
Note: See TracChangeset for help on using the changeset viewer.