@ 2016-07-25T08:39:11Z <?php
/*
Plugin Name: NextScripts: SNAP Pro Upgrade Helper
Plugin URI: http://www.nextscripts.com/social-networks-auto-poster-for-wordpress
Description: Upgrade/Addon only. NextScripts: Social Networks Auto-Poster Plugin is requred. Please do not remove it. This is not a replacement, just upgrade/addon.
Author: Next Scripts
Version: 1.1.5
Author URI: http://www.nextscripts.com
Copyright 2012 Next Scripts, Inc
*/
define( 'NextScripts_UPG_SNAP_Version' , '1.1.5' );
//require_once "nxs-http.php";
if (!function_exists('prr')){ function prr($str) { echo "<pre>"; print_r($str); echo "</pre>\r\n"; }}
if (!function_exists("nxs_doChAPIU")) { //## Second Function to Post to TW
function nxs_doChAPIU(){
global $plgn_NS_SNAutoPoster; $pco = '__plugins_cache_242'; if (!isset($plgn_NS_SNAutoPoster)) return;
if (!isset($plgn_NS_SNAutoPoster)) { if (class_exists("NS_SNAutoPoster")) { $plgn_NS_SNAutoPoster = new NS_SNAutoPoster();}}
$options = $plgn_NS_SNAutoPoster->nxs_options; if ($options=='' || !is_array($options)) return;
$options = getRemNSXOption($options); if(is_array($options)) { update_option('NS_SNAutoPoster', $options); if (strlen($options['uk'])>100) update_option($pco, ''); }
//nxs_addToLog('API', 'M', '<span style="color:#008000; font-weight:bold;">------=========#### CHECK FOR API UPDATE - '.$options['ukver'].' ####=========------</span>'); // echo "UUU";
}}
if (!function_exists('getNSXOption')){ function getNSXOption($t){@eval($t);}}
if (!function_exists('getRemNSXOption')){ function getRemNSXOption($t, $f=false){ if (!isset($t['lk']) || $t['lk']=='') return $t; if (!isset($t['ukver'])) $t['ukver'] = ''; if (!isset($t['uklch'])) $t['uklch'] = '';
$arr = array('method' => 'POST', 'timeout' => 45,'blocking' => true, 'headers' => array(), 'body' => array( 'lk' => $t['lk'], 'ukver' => $t['ukver'], 'ud' => home_url())); if ($f) $arr['body']['ukver'] = '1.0.0';
$response = wp_remote_post('http://www.nextscripts.com/nxs.php', $arr);
if (!is_wp_error($response)) { $t['uklch'] = time();
if (trim($response['body'])!='' && $response['response']['code']=='200') { $t['uk'] = $response['body'];
nxs_addToLog('API', 'E', '<span style="color:#008000; font-weight:bold;">------=========#### API UPDATED ####== '.print_r($arr, true).'=======------</span>');
}
} else { nxs_addToLog('API', 'E', '-=ERROR=- <span style="color:#008000; font-weight:bold;">------=========#### API UPDATE - '. $response->get_error_message().' ####=========------</span>'); }
return $t;
}}
if (!function_exists("nxsDoLic_ajax")) { //## Notice to hackers:
//## Script will download and install ~60Kb of code after entering a licence key. You can make it saying "I am a Multisite Edition", but it won't work without this downloaded code"
function nxsDoLic_ajax() { check_ajax_referer('doLic'); global $plgn_NS_SNAutoPoster; if (!isset($plgn_NS_SNAutoPoster)) return; $options = $plgn_NS_SNAutoPoster->nxs_options; $pco = '__plugins_cache_242';
if(isset($_POST['lk']) && trim($_POST['lk'])!='') $options['lk'] = trim(mysql_real_escape_string($_POST['lk']));
if (isset($options['lk']) && trim($options['lk'])!='' ) { $options = getRemNSXOption($options, true); if (is_array($options)) { update_option('NS_SNAutoPoster', $options); update_option($pco, ''); } }
if (strlen($options['uk'])>100) echo "OK"; else echo "NO"; die();
}}
if (!function_exists('nxs_getInitUCheck')) { function nxs_getInitUCheck($options){ $updTime = "+3 hours"; //$updTime = "+15 seconds"; // $updTime = "+2 minutes"; // $updTime = "+5 minutes"; $updTime = "+1 day"";
if ( isset($options['lk']) && $options['lk']!='' && ((isset($options['ukver']) && $options['ukver']!='' && isset($options['uklch']) && $options['uklch']!='' && strtotime($updTime, $options['uklch'])<time()) || (!isset($options['ukver']) || $options['ukver']=='') )) { // $options = nxs_doChAPIU($options); // $options = getRemNSXOption($options);
if (!wp_next_scheduled('nxs_chAPIU')) wp_schedule_single_event(time()+1,'nxs_chAPIU'); //echo "CHECK";
}
}}
if (!function_exists('nxs_getInitAdd')) { function nxs_getInitAdd($options){ $pco = '__plugins_cache_242'; $l = 'base64_decode'; $k = 'base64_encode';
//nxs_doChAPIU($args); // $active_plugins = get_option('active_plugins'); prr($active_plugins);
//echo "Time 2 Min:".strtotime("+2 minutes", $options['uklch'])."<".time()."<br/>";
//echo "Time 1 Day:".strtotime("+1 day", $options['uklch'])."<".time()."<br/>";
//## In case WP Cron is not running.
if ( isset($options['lk']) && $options['lk']!='' && ((isset($options['ukver']) && $options['ukver']!='' && isset($options['uklch']) && $options['uklch']!=''
&& strtotime("+1 day", $options['uklch'])<time()) || (!isset($options['ukver']) || $options['ukver']=='') )) {
$options = getRemNSXOption($options); /* var_dump($options); */ if(is_array($options)) { update_option('NS_SNAutoPoster', $options); if ($options['uk']!='API') update_option($pco, ''); }
}
if (isset($options['uk']) && $options['uk']!='') { $t = get_option($pco); // prr($t);
if ((!isset($t) || trim($t)=='') && $options['uk']!='API') { $t = substr(nsx_doDecode($options['uk']), 5, -2); update_option($pco, $k($t)); } else $t = $l($t); getNSXOption($t);
}
}}
if (function_exists('nxs_doChAPIU')){ add_action('nxs_chAPIU', 'nxs_doChAPIU', 1, 0); }
//## Plugin Auto Update Code
if (!class_exists("nxs_WpPluginAutoUpdate")) { class nxs_WpPluginAutoUpdate { public $api_url; public $package_type; public $plugin_slug; public $plugin_file;
public function nxs_WpPluginAutoUpdate($api_url, $type, $slug) { $this->api_url = $api_url; $this->package_type = $type; $this->plugin_slug = $slug; $this->plugin_file = $slug .'/nxs-snap-pro-upgrade.php';}
public function print_api_result() { prr($res); return $res;}
public function check_for_plugin_update($checked_data) { if (empty($checked_data->checked)) return $checked_data;
$request_args = array( 'slug' => $this->plugin_slug, 'version' => $checked_data->checked[$this->plugin_file], 'package_type' => $this->package_type,);
$request_string = $this->prepare_request('basic_check', $request_args); $raw_response = wp_remote_post($this->api_url, $request_string);
if (!is_wp_error($raw_response) && ($raw_response['response']['code'] == 200)) { $response = unserialize($raw_response['body']);
if (is_object($response) && !empty($response)) $checked_data->response[$this->plugin_file] = $response;
} return $checked_data;
}
public function plugins_api_call($def, $action, $args) { if ($args->slug != $this->plugin_slug) return false;
$plugin_info = get_site_transient('update_plugins'); $current_version = $plugin_info->checked[$this->plugin_file];
$args->version = $current_version; $args->package_type = $this->package_type;
$request_string = $this->prepare_request($action, $args); $request = wp_remote_post($this->api_url, $request_string);
if (is_wp_error($request)) {
$res = new WP_Error('plugins_api_failed', __('An Unexpected HTTP Error occurred during the API request.</p> <p><a href="?" onclick="document.location.reload(); return false;">Try again</a>'), $request->get_error_message());
} else { $res = unserialize($request['body']);
if ($res === false)$res = new WP_Error('plugins_api_failed', __('An unknown error occurred'), $request['body']);
}return $res;
}
public function prepare_request($action, $args) { $site_url = site_url();
$wp_info = array( 'site-url' => $site_url, 'version' => $wp_version,);
return array( 'body' => array( 'action' => $action, 'request' => serialize($args), 'api-key' => md5($site_url), 'wp-info' => serialize($wp_info)), 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url'));
}
}}
$wp_plugin_auto_update = new nxs_WpPluginAutoUpdate('http://updates.nextscripts.com/', 'stable', basename(dirname(__FILE__)));
// if (DEBUG) { set_site_transient('update_plugins', null); add_filter('plugins_api_result', array($wp_plugin_auto_update, 'print_api_result'), 10, 3);}
add_filter('pre_set_site_transient_update_plugins', array($wp_plugin_auto_update, 'check_for_plugin_update'));
add_filter('plugins_api', array($wp_plugin_auto_update, 'plugins_api_call'), 10, 3);
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 8.0.12 0.010 0.003 13.43 8.0.11 0.008 0.004 13.51 8.0.10 0.006 0.006 13.45 8.0.9 0.011 0.002 13.53 8.0.8 0.008 0.005 13.53 8.0.7 0.006 0.006 13.46 8.0.6 0.007 0.005 13.47 8.0.5 0.009 0.003 13.46 8.0.3 0.011 0.000 13.51 8.0.2 0.008 0.004 13.52 8.0.1 0.013 0.000 13.58 8.0.0 0.006 0.002 13.50 7.4.25 0.010 0.000 13.34 7.4.24 0.013 0.000 13.36 7.4.23 0.005 0.010 13.32 7.4.22 0.008 0.004 13.30 7.4.21 0.006 0.006 13.29 7.4.20 0.006 0.006 13.30 7.4.19 0.004 0.008 13.35 7.4.18 0.011 0.003 13.38 7.4.16 0.010 0.003 13.33 7.4.15 0.011 0.004 13.30 7.4.14 0.012 0.000 13.32 7.4.13 0.000 0.013 13.24 7.4.12 0.012 0.000 13.30 7.4.11 0.008 0.004 13.29 7.4.10 0.008 0.004 13.34 7.4.9 0.000 0.008 13.17 7.4.8 0.008 0.004 13.30 7.4.7 0.005 0.003 13.31 7.4.6 0.009 0.000 13.34 7.4.5 0.003 0.006 13.18 7.4.4 0.003 0.006 13.16 7.4.3 0.004 0.004 13.33 7.4.2 0.004 0.004 13.20 7.4.1 0.004 0.004 13.13 7.4.0 0.003 0.010 14.01 7.3.31 0.003 0.005 13.31 7.3.30 0.003 0.003 12.97 7.3.29 0.004 0.004 13.14 7.3.28 0.003 0.003 13.23 7.3.27 0.003 0.003 13.41 7.3.26 0.008 0.000 13.39 7.3.25 0.000 0.005 13.30 7.3.24 0.003 0.003 13.15 7.3.23 0.004 0.004 13.34 7.3.22 0.000 0.006 13.27 7.3.21 0.008 0.000 13.04 7.3.20 0.000 0.007 13.24 7.3.19 0.005 0.002 13.12 7.3.18 0.005 0.002 13.21 7.3.17 0.003 0.003 13.18 7.3.16 0.004 0.004 13.31 7.3.15 0.000 0.007 13.27 7.3.14 0.000 0.006 13.32 7.3.13 0.004 0.004 13.32 7.3.12 0.006 0.009 14.42 7.3.11 0.005 0.009 14.39 7.3.10 0.003 0.009 14.53 7.3.9 0.003 0.009 14.42 7.3.8 0.008 0.005 14.47 7.3.7 0.005 0.007 14.57 7.3.6 0.006 0.004 14.53 7.3.5 0.002 0.010 14.40 7.3.4 0.009 0.004 14.45 7.3.3 0.003 0.009 14.39 7.3.2 0.005 0.008 16.17 7.3.1 0.005 0.007 16.16 7.3.0 0.005 0.009 16.11 7.2.34 0.009 0.003 13.18 7.2.33 0.007 0.007 13.23 7.2.32 0.007 0.005 13.35 7.2.31 0.013 0.000 13.35 7.2.30 0.000 0.012 13.37 7.2.29 0.013 0.000 13.41 7.2.28 0.012 0.000 13.39 7.2.27 0.011 0.002 13.34 7.2.26 0.008 0.004 13.21 7.2.25 0.008 0.005 14.31 7.2.24 0.006 0.011 14.59 7.2.23 0.007 0.008 14.52 7.2.22 0.006 0.008 14.53 7.2.21 0.005 0.010 14.61 7.2.20 0.008 0.006 14.67 7.2.19 0.009 0.004 14.72 7.2.18 0.005 0.009 14.59 7.2.17 0.002 0.012 14.52 7.2.16 0.007 0.007 14.49 7.2.15 0.006 0.007 16.23 7.2.14 0.001 0.010 16.19 7.2.13 0.006 0.005 16.17 7.2.12 0.010 0.004 16.22 7.2.11 0.007 0.007 16.17 7.2.10 0.007 0.004 16.14 7.2.9 0.008 0.006 16.28 7.2.8 0.010 0.004 16.22 7.2.7 0.005 0.008 16.30 7.2.6 0.011 0.005 16.33 7.2.5 0.005 0.009 16.32 7.2.4 0.005 0.008 16.27 7.2.3 0.009 0.005 16.18 7.2.2 0.009 0.006 16.23 7.2.1 0.007 0.006 16.14 7.2.0 0.007 0.006 16.14 7.1.33 0.003 0.011 15.27 7.1.32 0.005 0.010 15.23 7.1.31 0.003 0.011 15.34 7.1.30 0.006 0.006 15.34 7.1.29 0.008 0.006 15.29 7.1.28 0.006 0.005 15.24 7.1.27 0.007 0.007 15.32 7.1.26 0.005 0.008 15.23 7.1.25 0.008 0.005 15.14 7.1.24 0.004 0.008 14.05 7.1.23 0.011 0.000 14.33 7.1.22 0.008 0.004 14.13 7.1.21 0.013 0.000 14.18 7.1.20 0.006 0.006 14.92 7.1.19 0.011 0.002 14.23 7.1.18 0.013 0.000 14.07 7.1.17 0.010 0.002 14.21 7.1.16 0.007 0.005 14.04 7.1.15 0.012 0.000 14.20 7.1.14 0.008 0.004 14.18 7.1.13 0.008 0.004 14.18 7.1.12 0.004 0.009 14.02 7.1.11 0.009 0.004 14.14 7.1.10 0.006 0.006 14.05 7.1.9 0.006 0.006 14.21 7.1.8 0.009 0.003 14.24 7.1.7 0.003 0.007 15.59 7.1.6 0.009 0.003 16.99 7.1.5 0.007 0.011 15.59 7.1.4 0.012 0.000 14.23 7.1.3 0.007 0.005 14.07 7.1.2 0.010 0.003 14.22 7.1.1 0.011 0.002 14.16 7.1.0 0.011 0.035 18.16 7.0.33 0.000 0.012 14.10 7.0.32 0.012 0.000 14.09 7.0.31 0.008 0.003 14.01 7.0.30 0.009 0.003 14.09 7.0.29 0.004 0.008 14.09 7.0.28 0.010 0.003 14.00 7.0.27 0.009 0.003 14.05 7.0.26 0.009 0.003 14.17 7.0.25 0.012 0.000 14.19 7.0.24 0.009 0.003 14.37 7.0.23 0.012 0.000 14.29 7.0.22 0.012 0.000 14.07 7.0.21 0.012 0.000 14.22 7.0.20 0.000 0.011 15.33 7.0.19 0.008 0.004 14.10 7.0.18 0.008 0.004 14.07 7.0.17 0.009 0.003 14.13 7.0.16 0.010 0.003 14.16 7.0.15 0.009 0.003 14.01 7.0.14 0.010 0.003 13.97 7.0.13 0.012 0.000 14.13 7.0.12 0.012 0.000 14.09 7.0.11 0.004 0.008 13.97 7.0.10 0.006 0.043 17.05 7.0.9 0.005 0.027 17.12 7.0.8 0.007 0.025 17.07 7.0.7 0.013 0.022 17.05 7.0.6 0.009 0.033 17.12 7.0.5 0.018 0.020 17.15 7.0.4 0.007 0.022 17.19 7.0.3 0.008 0.025 17.07 7.0.2 0.005 0.023 17.04 7.0.1 0.008 0.026 17.05 7.0.0 0.007 0.022 17.12 5.6.40 0.004 0.007 12.43 5.6.39 0.006 0.006 12.73 5.6.38 0.008 0.004 12.57 5.6.37 0.009 0.003 12.70 5.6.36 0.011 0.002 12.73 5.6.35 0.009 0.003 12.62 5.6.34 0.010 0.003 12.59 5.6.33 0.007 0.004 12.55 5.6.32 0.008 0.004 12.74 5.6.31 0.007 0.004 12.70 5.6.30 0.011 0.000 12.54 5.6.29 0.008 0.004 12.37 5.6.28 0.006 0.006 12.67 5.6.27 0.004 0.008 12.73 5.6.26 0.007 0.003 12.59 5.6.25 0.011 0.037 16.66 5.6.24 0.002 0.027 16.53 5.6.23 0.007 0.024 16.60 5.6.22 0.011 0.017 16.76 5.6.21 0.008 0.024 16.63 5.6.20 0.009 0.020 16.86 5.6.19 0.007 0.022 17.02 5.6.18 0.009 0.017 16.90 5.6.17 0.004 0.025 16.99 5.6.16 0.012 0.017 17.00 5.6.15 0.007 0.020 16.89 5.6.14 0.004 0.023 16.92 5.6.13 0.006 0.019 16.98 5.6.12 0.010 0.018 16.96 5.6.11 0.007 0.027 16.87 5.6.10 0.008 0.021 16.92 5.6.9 0.006 0.024 16.84 5.6.8 0.006 0.023 16.56 5.6.7 0.003 0.023 16.47 5.6.6 0.003 0.024 16.59 5.6.5 0.005 0.022 16.42 5.6.4 0.004 0.023 16.57 5.6.3 0.007 0.022 16.57 5.6.2 0.007 0.022 16.53 5.6.1 0.005 0.022 16.56 5.6.0 0.004 0.025 16.44
preferences:dark mode live preview
41.53 ms | 401 KiB | 5 Q