Version Description
- Jan 4th 2017 =
- Improvement: JSON communication between Admin Panel and Client plugin has been implemented.
- Improvement: If the PHP version of WordPress site is less than 5.4.0 then the single call backups will fail with "Fatal error: Cannot use string offset as an array in /home/asogerb6/public_html/wp-content/plugins/iwp-client/backup.class.singlecall.php on line 340".
- Improvement: Debug files DE_clMemoryPeak.php, DE_clMemoryUsage.php and DE_clTimeTaken.php have been removed.
- Improvement: Security patches have been applied for sites backed up to Amazon S3 storage.
- Fix: Backups having size greater than 2GB could not be uploaded to Google Drive in certain scenarios throwing a bad request error.
- Fix: "Failed to zip files. pclZip error (-4): File '/wp-content/plugins/wordfence/tmp/configCache.php' does not exist" has been fixed.
- Fix: Pluggable.php shouldn't be included before loading all plugins.
- Fix: MySQL error wouldn't show accurately during failed table creation.
- Fix: If the default auto_increment_increment value is set to 2 in the user's server the backup will fail for all sites on that server.
- Fix: If the value for integer field is EMPTY then instead of considering default value as NULL, the plugin creates a duplicate entry during cloning.
Download this release
Release Info
Developer | infinitewp |
Plugin | InfiniteWP Client |
Version | 1.6.3.2 |
Comparing to | |
See all releases |
Code changes from version 1.6.1.1 to 1.6.3.2
- activities_log.class.php +1 -0
- addons/file_editor/file_editor.class.php +1 -0
- backup.class.multicall.php +60 -14
- backup.class.singlecall.php +1 -0
- helper.class.php +1 -1
- init.php +428 -25
- installer.class.php +6 -3
- lib/amazon/s3IWPBackup.php +4 -4
- pclzip.class.php +6 -1
- readme.txt +12 -1
activities_log.class.php
CHANGED
@@ -143,6 +143,7 @@ class IWP_MMB_Activities_log {
|
|
143 |
break;
|
144 |
case 'now':
|
145 |
case 'schedule':
|
|
|
146 |
switch($iwp_type) {
|
147 |
case 'backup':
|
148 |
case 'scheduleBackup':
|
143 |
break;
|
144 |
case 'now':
|
145 |
case 'schedule':
|
146 |
+
case 'multiCallNow':
|
147 |
switch($iwp_type) {
|
148 |
case 'backup':
|
149 |
case 'scheduleBackup':
|
addons/file_editor/file_editor.class.php
CHANGED
@@ -196,6 +196,7 @@ function iwp_mmb_direct_to_any_copy($source, $destination, $overwrite = false, $
|
|
196 |
'error' => 'Gzip library functions are not available.', 'error_code' => 'gzip_library_functions_are_not_available'
|
197 |
);
|
198 |
}else{
|
|
|
199 |
$fileContent = gzinflate($fileContent);
|
200 |
}
|
201 |
|
196 |
'error' => 'Gzip library functions are not available.', 'error_code' => 'gzip_library_functions_are_not_available'
|
197 |
);
|
198 |
}else{
|
199 |
+
$fileContent = base64_decode($fileContent);
|
200 |
$fileContent = gzinflate($fileContent);
|
201 |
}
|
202 |
|
backup.class.multicall.php
CHANGED
@@ -85,7 +85,7 @@ class IWP_MMB_Backup_Multicall extends IWP_MMB_Core
|
|
85 |
var $backup_url;
|
86 |
var $backup_settings_vals = array();
|
87 |
var $iwpScriptStartTime;
|
88 |
-
|
89 |
function __construct()
|
90 |
{
|
91 |
|
@@ -741,7 +741,8 @@ class IWP_MMB_Backup_Multicall extends IWP_MMB_Core
|
|
741 |
{
|
742 |
$count = 1;
|
743 |
}
|
744 |
-
|
|
|
745 |
for($i = 0; $i < $count; $i++){
|
746 |
if($done_count > 0)
|
747 |
{
|
@@ -757,7 +758,7 @@ class IWP_MMB_Backup_Multicall extends IWP_MMB_Core
|
|
757 |
$qry = "SELECT * FROM $table[0] LIMIT $low_limit, 100";
|
758 |
$rows = $wpdb->get_results($qry, ARRAY_A);
|
759 |
|
760 |
-
|
761 |
if (is_array($rows)) {
|
762 |
foreach ($rows as $row) {
|
763 |
manual_debug('', 'eachRow', 1000);
|
@@ -781,10 +782,38 @@ class IWP_MMB_Backup_Multicall extends IWP_MMB_Core
|
|
781 |
$total_time_part = $finish_part - $this->iwpScriptStartTime;
|
782 |
|
783 |
//$dump_data .= $count_field;
|
784 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
785 |
$value = addslashes($value);
|
786 |
$value = preg_replace("/\n/Ui", "\\n", $value);
|
|
|
|
|
787 |
$num_values == $j ? $dump_data .= "'" . $value . "'" : $dump_data .= "'" . $value . "', ";
|
|
|
788 |
|
789 |
$j++;
|
790 |
unset($value);
|
@@ -1098,7 +1127,6 @@ class IWP_MMB_Backup_Multicall extends IWP_MMB_Core
|
|
1098 |
return $result;
|
1099 |
}
|
1100 |
|
1101 |
-
|
1102 |
function backupFilesZIP($historyID)
|
1103 |
{
|
1104 |
$this -> hisID = $historyID;
|
@@ -5137,7 +5165,7 @@ function ftp_backup($historyID,$args = '')
|
|
5137 |
$requestParams = $this -> getRequiredData($historyID,"requestParams");
|
5138 |
$upload_loop_break_time = $requestParams['account_info']['upload_loop_break_time']; //darkcode changed
|
5139 |
$upload_file_block_size = $requestParams['account_info']['upload_file_block_size'];
|
5140 |
-
$upload_file_block_size =
|
5141 |
$del_host_file = $requestParams['args']['del_host_file'];
|
5142 |
$iwp_folder_id = '';
|
5143 |
$sub_folder_id = '';
|
@@ -5983,6 +6011,10 @@ function ftp_backup($historyID,$args = '')
|
|
5983 |
|
5984 |
if( !function_exists('initialize_manual_debug') ){
|
5985 |
function initialize_manual_debug($conditions = ''){
|
|
|
|
|
|
|
|
|
5986 |
global $debug_count, $every_count;
|
5987 |
$debug_count = 0;
|
5988 |
$every_count = 0;
|
@@ -6058,7 +6090,7 @@ function ftp_backup($historyID,$args = '')
|
|
6058 |
|
6059 |
if( !function_exists('refresh_iwp_files_db') ){
|
6060 |
function refresh_iwp_files_db($this_file_id = 0, $field = 'thisFileDetails' ){
|
6061 |
-
global $wpdb;
|
6062 |
$this_table_name = $wpdb->base_prefix . 'iwp_file_list'; //in case, if we are changing table name.
|
6063 |
$result = true;
|
6064 |
|
@@ -6067,15 +6099,15 @@ function ftp_backup($historyID,$args = '')
|
|
6067 |
//write in db and refresh for_every_count, all_files_detail;
|
6068 |
if($wpdb->get_var("SHOW TABLES LIKE '$this_table_name'") == $this_table_name) {
|
6069 |
$result = $wpdb->query('TRUNCATE TABLE ' . $this_table_name );
|
6070 |
-
$error_msg = 'Unable to empty File list table : ' . $wpdb->last_error ;
|
6071 |
if(version_compare($IWP_FILE_LIST_TABLE_VERSION, '1.1') == -1){
|
6072 |
$result = iwp_create_file_list_table();
|
6073 |
-
$error_msg = 'Unable to update File list table : ' . $
|
6074 |
}
|
6075 |
}
|
6076 |
else{
|
6077 |
$result = iwp_create_file_list_table();
|
6078 |
-
$error_msg = 'Unable to create File list table : '
|
6079 |
}
|
6080 |
|
6081 |
if($result === false){
|
@@ -6087,7 +6119,7 @@ function ftp_backup($historyID,$args = '')
|
|
6087 |
|
6088 |
if(!function_exists('iwp_create_file_list_table')){
|
6089 |
function iwp_create_file_list_table(){
|
6090 |
-
global $wpdb;
|
6091 |
if(method_exists($wpdb, 'get_charset_collate')){
|
6092 |
$charset_collate = $wpdb->get_charset_collate();
|
6093 |
}
|
@@ -6118,7 +6150,9 @@ function ftp_backup($historyID,$args = '')
|
|
6118 |
";
|
6119 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
6120 |
dbDelta($sql);
|
6121 |
-
|
|
|
|
|
6122 |
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name){
|
6123 |
$table_created = true;
|
6124 |
update_option( "iwp_file_list_table_version", '1.1');
|
@@ -6221,6 +6255,7 @@ function ftp_backup($historyID,$args = '')
|
|
6221 |
if($action == 'insert'){
|
6222 |
$is_already = $wpdb->get_row("SELECT * FROM " . $wpdb->base_prefix. $this_table_name . " WHERE thisFileName = '". $v['stored_filename'].$v['splitFilename']."' AND thisFileNameHash = '".md5($v['stored_filename'].$v['splitFilename'])."'" );
|
6223 |
if(empty($is_already)){
|
|
|
6224 |
$result = $wpdb->insert($wpdb->base_prefix . $this_table_name, array('thisFileDetails' => serialize($v), 'thisFileCount' => $k, 'thisFileName' => $v['stored_filename'].$v['splitFilename'],'thisFileNameHash'=>md5($v['stored_filename'].$v['splitFilename'])), array( '%s', '%d', '%s', '%s' ));
|
6225 |
}
|
6226 |
}
|
@@ -6314,7 +6349,7 @@ function ftp_backup($historyID,$args = '')
|
|
6314 |
|
6315 |
if(!function_exists('alter_iwp_filelisttable_1_1')){
|
6316 |
function alter_iwp_filelisttable_1_1(){
|
6317 |
-
global $wpdb;
|
6318 |
if(method_exists($wpdb, 'get_charset_collate')){
|
6319 |
$charset_collate = $wpdb->get_charset_collate();
|
6320 |
}
|
@@ -6344,6 +6379,7 @@ function ftp_backup($historyID,$args = '')
|
|
6344 |
foreach($sql as $v){
|
6345 |
if(!$wpdb->query($v)){
|
6346 |
$failed_alter = true;
|
|
|
6347 |
}
|
6348 |
}
|
6349 |
if(!$failed_alter){
|
@@ -6354,7 +6390,17 @@ function ftp_backup($historyID,$args = '')
|
|
6354 |
}
|
6355 |
}
|
6356 |
}
|
6357 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6358 |
/*if( function_exists('add_filter') ){
|
6359 |
add_filter( 'iwp_website_add', 'IWP_MMB_Backup::readd_tasks' );
|
6360 |
}*/
|
85 |
var $backup_url;
|
86 |
var $backup_settings_vals = array();
|
87 |
var $iwpScriptStartTime;
|
88 |
+
|
89 |
function __construct()
|
90 |
{
|
91 |
|
741 |
{
|
742 |
$count = 1;
|
743 |
}
|
744 |
+
$table_description = $wpdb->get_results("DESCRIBE $table[0]", ARRAY_A);
|
745 |
+
$table_description = iwp_modify_table_description($table_description);
|
746 |
for($i = 0; $i < $count; $i++){
|
747 |
if($done_count > 0)
|
748 |
{
|
758 |
$qry = "SELECT * FROM $table[0] LIMIT $low_limit, 100";
|
759 |
$rows = $wpdb->get_results($qry, ARRAY_A);
|
760 |
|
761 |
+
$number_data_types = 'tinyint, smallint, mediumint, bigint, int, decimal, numeric, real, float, double';
|
762 |
if (is_array($rows)) {
|
763 |
foreach ($rows as $row) {
|
764 |
manual_debug('', 'eachRow', 1000);
|
782 |
$total_time_part = $finish_part - $this->iwpScriptStartTime;
|
783 |
|
784 |
//$dump_data .= $count_field;
|
785 |
+
/****************New method starts here********************/
|
786 |
+
// if (empty($value) && $value != 0 || $value == '') {
|
787 |
+
// $default_value = isset($table_description[$key]['Default']) ? $table_description[$key]['Default']: NULL;
|
788 |
+
// if (@strstr(strtolower($number_data_types), substr($table_description[$key]['Type'], 0, strpos($table_description[$key]['Type'], '('))) !== false && ($default_value === NULL && $default_value != '') ) {
|
789 |
+
// if ($default_value === NULL) {
|
790 |
+
// $num_values == $j ? $dump_data .= "NULL " : $dump_data .= "NULL, ";
|
791 |
+
// } else {
|
792 |
+
// $num_values == $j ? $dump_data .= "'$default_value'" : $dump_data .= "'$default_value', ";
|
793 |
+
// }
|
794 |
+
// } else if($default_value === NULL){
|
795 |
+
// $num_values == $j ? $dump_data .= "NULL " : $dump_data .= "NULL, ";
|
796 |
+
// } else {
|
797 |
+
// $num_values == $j ? $dump_data .= "$default_value" : $dump_data .= "$default_value,";
|
798 |
+
// }
|
799 |
+
// } else if (@strstr(strtolower($number_data_types), substr($table_description[$key]['Type'], 0, strpos($table_description[$key]['Type'], '('))) !== false) {
|
800 |
+
// $num_values == $j ? $dump_data .= "'$value'" : $dump_data .= "'$value',";
|
801 |
+
// } else {
|
802 |
+
// $value = addslashes($value);
|
803 |
+
// $value = str_replace("\n", "\\n", $value);
|
804 |
+
// $value = str_replace("\r", "\\r", $value);
|
805 |
+
// $num_values == $j ? $dump_data .= "'" . $value . "'" : $dump_data .= "'" . $value . "', ";
|
806 |
+
// }
|
807 |
+
//$num_values = $dump_data;
|
808 |
+
/*********New Method ends Here******************/
|
809 |
+
|
810 |
+
/**********Old Method start here ************/
|
811 |
$value = addslashes($value);
|
812 |
$value = preg_replace("/\n/Ui", "\\n", $value);
|
813 |
+
$value = str_replace("\n", "\\n", $value);
|
814 |
+
$value = str_replace("\r", "\\r", $value);
|
815 |
$num_values == $j ? $dump_data .= "'" . $value . "'" : $dump_data .= "'" . $value . "', ";
|
816 |
+
/*************** Old Method ends here ********/
|
817 |
|
818 |
$j++;
|
819 |
unset($value);
|
1127 |
return $result;
|
1128 |
}
|
1129 |
|
|
|
1130 |
function backupFilesZIP($historyID)
|
1131 |
{
|
1132 |
$this -> hisID = $historyID;
|
5165 |
$requestParams = $this -> getRequiredData($historyID,"requestParams");
|
5166 |
$upload_loop_break_time = $requestParams['account_info']['upload_loop_break_time']; //darkcode changed
|
5167 |
$upload_file_block_size = $requestParams['account_info']['upload_file_block_size'];
|
5168 |
+
$upload_file_block_size = 5 *1024 *1024;
|
5169 |
$del_host_file = $requestParams['args']['del_host_file'];
|
5170 |
$iwp_folder_id = '';
|
5171 |
$sub_folder_id = '';
|
6011 |
|
6012 |
if( !function_exists('initialize_manual_debug') ){
|
6013 |
function initialize_manual_debug($conditions = ''){
|
6014 |
+
if(file_exists(WP_CONTENT_DIR . '/DE_clMemoryPeak.php')){ @unlink(WP_CONTENT_DIR . '/DE_clMemoryPeak.php');}
|
6015 |
+
if(file_exists(WP_CONTENT_DIR . '/DE_clMemoryUsage.php')){ @unlink(WP_CONTENT_DIR . '/DE_clMemoryUsage.php');}
|
6016 |
+
if(file_exists(WP_CONTENT_DIR . '/DE_clTimeTaken.php')){ @unlink(WP_CONTENT_DIR . '/DE_clTimeTaken.php');}
|
6017 |
+
return true;
|
6018 |
global $debug_count, $every_count;
|
6019 |
$debug_count = 0;
|
6020 |
$every_count = 0;
|
6090 |
|
6091 |
if( !function_exists('refresh_iwp_files_db') ){
|
6092 |
function refresh_iwp_files_db($this_file_id = 0, $field = 'thisFileDetails' ){
|
6093 |
+
global $wpdb, $iwp_db_upgrade_error;
|
6094 |
$this_table_name = $wpdb->base_prefix . 'iwp_file_list'; //in case, if we are changing table name.
|
6095 |
$result = true;
|
6096 |
|
6099 |
//write in db and refresh for_every_count, all_files_detail;
|
6100 |
if($wpdb->get_var("SHOW TABLES LIKE '$this_table_name'") == $this_table_name) {
|
6101 |
$result = $wpdb->query('TRUNCATE TABLE ' . $this_table_name );
|
6102 |
+
$error_msg = 'Unable to empty File list table : <span style="font-weight:700;">' . $wpdb->last_error.'</span>' ;
|
6103 |
if(version_compare($IWP_FILE_LIST_TABLE_VERSION, '1.1') == -1){
|
6104 |
$result = iwp_create_file_list_table();
|
6105 |
+
$error_msg = 'Unable to update File list table : <span style="font-weight:700;">' . $iwp_db_upgrade_error.'</span>' ;
|
6106 |
}
|
6107 |
}
|
6108 |
else{
|
6109 |
$result = iwp_create_file_list_table();
|
6110 |
+
$error_msg = 'Unable to create File list table : <span style="font-weight:700;">'.$iwp_db_upgrade_error.'</span>';
|
6111 |
}
|
6112 |
|
6113 |
if($result === false){
|
6119 |
|
6120 |
if(!function_exists('iwp_create_file_list_table')){
|
6121 |
function iwp_create_file_list_table(){
|
6122 |
+
global $wpdb, $iwp_db_upgrade_error;
|
6123 |
if(method_exists($wpdb, 'get_charset_collate')){
|
6124 |
$charset_collate = $wpdb->get_charset_collate();
|
6125 |
}
|
6150 |
";
|
6151 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
6152 |
dbDelta($sql);
|
6153 |
+
if($wpdb->last_error !== '') {
|
6154 |
+
$iwp_db_upgrade_error = $wpdb->last_error;
|
6155 |
+
}
|
6156 |
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name){
|
6157 |
$table_created = true;
|
6158 |
update_option( "iwp_file_list_table_version", '1.1');
|
6255 |
if($action == 'insert'){
|
6256 |
$is_already = $wpdb->get_row("SELECT * FROM " . $wpdb->base_prefix. $this_table_name . " WHERE thisFileName = '". $v['stored_filename'].$v['splitFilename']."' AND thisFileNameHash = '".md5($v['stored_filename'].$v['splitFilename'])."'" );
|
6257 |
if(empty($is_already)){
|
6258 |
+
$wpdb->query("SET @@auto_increment_increment=1");
|
6259 |
$result = $wpdb->insert($wpdb->base_prefix . $this_table_name, array('thisFileDetails' => serialize($v), 'thisFileCount' => $k, 'thisFileName' => $v['stored_filename'].$v['splitFilename'],'thisFileNameHash'=>md5($v['stored_filename'].$v['splitFilename'])), array( '%s', '%d', '%s', '%s' ));
|
6260 |
}
|
6261 |
}
|
6349 |
|
6350 |
if(!function_exists('alter_iwp_filelisttable_1_1')){
|
6351 |
function alter_iwp_filelisttable_1_1(){
|
6352 |
+
global $wpdb, $iwp_db_upgrade_error;
|
6353 |
if(method_exists($wpdb, 'get_charset_collate')){
|
6354 |
$charset_collate = $wpdb->get_charset_collate();
|
6355 |
}
|
6379 |
foreach($sql as $v){
|
6380 |
if(!$wpdb->query($v)){
|
6381 |
$failed_alter = true;
|
6382 |
+
$iwp_db_upgrade_error = $wpdb->last_error;
|
6383 |
}
|
6384 |
}
|
6385 |
if(!$failed_alter){
|
6390 |
}
|
6391 |
}
|
6392 |
}
|
6393 |
+
if (!function_exists('iwp_modify_table_description')) {
|
6394 |
+
|
6395 |
+
function iwp_modify_table_description($table_data){
|
6396 |
+
$temp_table = array();
|
6397 |
+
foreach ($table_data as $key => $value) {
|
6398 |
+
$temp = $table_data[$key];
|
6399 |
+
$temp_table[$value['Field']] = $table_data[$key];
|
6400 |
+
}
|
6401 |
+
return $temp_table;
|
6402 |
+
}
|
6403 |
+
}
|
6404 |
/*if( function_exists('add_filter') ){
|
6405 |
add_filter( 'iwp_website_add', 'IWP_MMB_Backup::readd_tasks' );
|
6406 |
}*/
|
backup.class.singlecall.php
CHANGED
@@ -2056,6 +2056,7 @@ function ftp_backup($args)
|
|
2056 |
CFCredentials::set(array('development' => array('key' => trim($as3_access_key), 'secret' => trim(str_replace(' ', '+', $as3_secure_key)), 'default_cache_config' => '', 'certificate_authority' => true, 'use_ssl'=>false, 'ssl_verification'=>false), '@default' => 'development'));
|
2057 |
$s3 = new AmazonS3();
|
2058 |
$response = $s3->create_object($as3_bucket, $as3_file, array('fileUpload' => $backup_file));
|
|
|
2059 |
$upload = $response->isOk();
|
2060 |
if($upload) {
|
2061 |
return true;
|
2056 |
CFCredentials::set(array('development' => array('key' => trim($as3_access_key), 'secret' => trim(str_replace(' ', '+', $as3_secure_key)), 'default_cache_config' => '', 'certificate_authority' => true, 'use_ssl'=>false, 'ssl_verification'=>false), '@default' => 'development'));
|
2057 |
$s3 = new AmazonS3();
|
2058 |
$response = $s3->create_object($as3_bucket, $as3_file, array('fileUpload' => $backup_file));
|
2059 |
+
$s3->set_object_acl($as3_bucket, $as3_file, AmazonS3::ACL_PRIVATE);
|
2060 |
$upload = $response->isOk();
|
2061 |
if($upload) {
|
2062 |
return true;
|
helper.class.php
CHANGED
@@ -427,7 +427,7 @@ class IWP_MMB_Helper
|
|
427 |
if( !function_exists('username_exists') )
|
428 |
include_once(ABSPATH . WPINC . '/registration.php');
|
429 |
|
430 |
-
include_once(ABSPATH . 'wp-includes/pluggable.php');
|
431 |
|
432 |
if (username_exists($username) == null) {
|
433 |
return false;
|
427 |
if( !function_exists('username_exists') )
|
428 |
include_once(ABSPATH . WPINC . '/registration.php');
|
429 |
|
430 |
+
//include_once(ABSPATH . 'wp-includes/pluggable.php');
|
431 |
|
432 |
if (username_exists($username) == null) {
|
433 |
return false;
|
init.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: InfiniteWP - Client
|
|
4 |
Plugin URI: http://infinitewp.com/
|
5 |
Description: This is the client plugin of InfiniteWP that communicates with the InfiniteWP Admin panel.
|
6 |
Author: Revmakx
|
7 |
-
Version: 1.6.
|
8 |
Author URI: http://www.revmakx.com
|
9 |
*/
|
10 |
/************************************************************
|
@@ -28,7 +28,7 @@ if(basename($_SERVER['SCRIPT_FILENAME']) == "init.php"):
|
|
28 |
exit;
|
29 |
endif;
|
30 |
if(!defined('IWP_MMB_CLIENT_VERSION'))
|
31 |
-
define('IWP_MMB_CLIENT_VERSION', '1.6.
|
32 |
|
33 |
|
34 |
|
@@ -104,26 +104,49 @@ if( !function_exists ('iwp_mmb_parse_request')) {
|
|
104 |
ob_start();
|
105 |
|
106 |
global $current_user, $iwp_mmb_core, $new_actions, $wp_db_version, $wpmu_version, $_wp_using_ext_object_cache;
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
$
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
if(isset($unserialized_data['is_save_activity_log'])) {
|
122 |
-
$is_save_activity_log = $unserialized_data['is_save_activity_log'];
|
123 |
}
|
124 |
-
|
|
|
125 |
}
|
126 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
|
128 |
if (isset($iwp_action)) {
|
129 |
|
@@ -195,9 +218,13 @@ if( !function_exists ('iwp_mmb_parse_request')) {
|
|
195 |
}
|
196 |
|
197 |
if(isset($params['secure'])){
|
198 |
-
|
|
|
|
|
199 |
if($decrypted = $iwp_mmb_core->_secure_data($params['secure'])){
|
200 |
-
|
|
|
|
|
201 |
if(is_array($decrypted)){
|
202 |
|
203 |
foreach($decrypted as $key => $val){
|
@@ -246,7 +273,7 @@ if( !function_exists('iwp_mmb_convert_wperror_obj_to_arr')){
|
|
246 |
return $obj;
|
247 |
}
|
248 |
if($state == 'initial' ){
|
249 |
-
if(is_wp_error($obj['error'])){
|
250 |
$errMsgTemp = $result['error']['errors'];
|
251 |
$errCodesTemp = $result['error']['error_codes'];
|
252 |
if(!empty($result['error']['error_data']) ){
|
@@ -272,7 +299,7 @@ if( !function_exists('iwp_mmb_convert_wperror_obj_to_arr')){
|
|
272 |
/* Main response function */
|
273 |
if( !function_exists ( 'iwp_mmb_response' )) {
|
274 |
|
275 |
-
function iwp_mmb_response($response = false, $success = true)
|
276 |
{
|
277 |
$return = array();
|
278 |
|
@@ -294,8 +321,14 @@ if( !function_exists ( 'iwp_mmb_response' )) {
|
|
294 |
header('HTTP/1.0 200 OK');
|
295 |
header('Content-Type: text/plain');
|
296 |
}
|
297 |
-
|
298 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
}
|
300 |
}
|
301 |
|
@@ -2138,4 +2171,374 @@ if(!function_exists('iwp_mmb_get_site_option')) {
|
|
2138 |
if ( !get_option('iwp_client_public_key') && function_exists('add_action')){
|
2139 |
add_action('admin_enqueue_scripts', 'iwp_mmb_add_zero_clipboard_scripts');
|
2140 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2141 |
?>
|
4 |
Plugin URI: http://infinitewp.com/
|
5 |
Description: This is the client plugin of InfiniteWP that communicates with the InfiniteWP Admin panel.
|
6 |
Author: Revmakx
|
7 |
+
Version: 1.6.3.2
|
8 |
Author URI: http://www.revmakx.com
|
9 |
*/
|
10 |
/************************************************************
|
28 |
exit;
|
29 |
endif;
|
30 |
if(!defined('IWP_MMB_CLIENT_VERSION'))
|
31 |
+
define('IWP_MMB_CLIENT_VERSION', '1.6.3.2');
|
32 |
|
33 |
|
34 |
|
104 |
ob_start();
|
105 |
|
106 |
global $current_user, $iwp_mmb_core, $new_actions, $wp_db_version, $wpmu_version, $_wp_using_ext_object_cache;
|
107 |
+
if (strrpos($HTTP_RAW_POST_DATA_LOCAL, '_IWP_JSON_PREFIX_') !== false) {
|
108 |
+
$request_data_array = explode('_IWP_JSON_PREFIX_', $HTTP_RAW_POST_DATA_LOCAL);
|
109 |
+
$request_raw_data = $request_data_array[1];
|
110 |
+
$data = trim(base64_decode($request_raw_data));
|
111 |
+
$request_data = NULL;
|
112 |
+
$GLOBALS['IWP_JSON_COMMUNICATION'] = 1;
|
113 |
+
} else{
|
114 |
+
$request_raw_data = $HTTP_RAW_POST_DATA_LOCAL;
|
115 |
+
$data = trim(base64_decode($request_raw_data));
|
116 |
+
if (is_serialized($data)) {
|
117 |
+
if ((strpos($data, 'get_stats') || strpos($data, 'add_site') || strpos($data, 'remove_site')) && (strpos($data,'2.10.1') || strpos($data,'2.10.0') || strpos($data,'2.10.0.1'))) {
|
118 |
+
$request_data = iwp_mmb_safe_unserialize($data);
|
119 |
+
}else{
|
120 |
+
iwp_mmb_response(array('error' => 'Please update your IWP Admin Panel to version 2.10.1', 'error_code' => 'update_panel'), false, true);
|
|
|
|
|
121 |
}
|
122 |
+
}else{
|
123 |
+
return false;
|
124 |
}
|
125 |
}
|
126 |
+
if ($data){
|
127 |
+
|
128 |
+
//$num = @extract(unserialize($data));
|
129 |
+
if (!isset($request_data) && $request_data['iwp_action'] != 'add_site' && $request_data['iwp_action'] != 'get_stats' && $request_data['iwp_action'] != 'remove_site') {
|
130 |
+
$request_data = json_decode($data, true);
|
131 |
+
}
|
132 |
+
|
133 |
+
if(isset($request_data['params'])){
|
134 |
+
$request_data['params'] = iwp_mmb_filter_params($request_data['params']);
|
135 |
+
}
|
136 |
+
if (isset($GLOBALS['IWP_JSON_COMMUNICATION']) && $GLOBALS['IWP_JSON_COMMUNICATION']) {
|
137 |
+
$signature = base64_decode($request_data['signature']);
|
138 |
+
}else{
|
139 |
+
$signature = $request_data['signature'];
|
140 |
+
}
|
141 |
+
|
142 |
+
$iwp_action = $request_data['iwp_action'];
|
143 |
+
$params = $request_data['params'];
|
144 |
+
$id = $request_data['id'];
|
145 |
+
if(isset($request_data['is_save_activity_log'])) {
|
146 |
+
$is_save_activity_log = $request_data['is_save_activity_log'];
|
147 |
+
}
|
148 |
+
$GLOBALS['activities_log_datetime'] = $request_data['activities_log_datetime'];
|
149 |
+
}
|
150 |
|
151 |
if (isset($iwp_action)) {
|
152 |
|
218 |
}
|
219 |
|
220 |
if(isset($params['secure'])){
|
221 |
+
if (isset($GLOBALS['IWP_JSON_COMMUNICATION']) && $GLOBALS['IWP_JSON_COMMUNICATION']) {
|
222 |
+
$params['secure'] = iwp_mmb_safe_unserialize(base64_decode($params['secure']));
|
223 |
+
}
|
224 |
if($decrypted = $iwp_mmb_core->_secure_data($params['secure'])){
|
225 |
+
if (is_serialized($decrypted)) {
|
226 |
+
$decrypted = iwp_mmb_safe_unserialize($decrypted);
|
227 |
+
}
|
228 |
if(is_array($decrypted)){
|
229 |
|
230 |
foreach($decrypted as $key => $val){
|
273 |
return $obj;
|
274 |
}
|
275 |
if($state == 'initial' ){
|
276 |
+
if(isset($obj['error']) && is_wp_error($obj['error'])){
|
277 |
$errMsgTemp = $result['error']['errors'];
|
278 |
$errCodesTemp = $result['error']['error_codes'];
|
279 |
if(!empty($result['error']['error_data']) ){
|
299 |
/* Main response function */
|
300 |
if( !function_exists ( 'iwp_mmb_response' )) {
|
301 |
|
302 |
+
function iwp_mmb_response($response = false, $success = true, $send_serialize_response=false)
|
303 |
{
|
304 |
$return = array();
|
305 |
|
321 |
header('HTTP/1.0 200 OK');
|
322 |
header('Content-Type: text/plain');
|
323 |
}
|
324 |
+
if (!$send_serialize_response) {
|
325 |
+
$GLOBALS['IWP_RESPONSE_SENT'] = true;
|
326 |
+
$response_data = '_IWP_JSON_PREFIX_'.base64_encode(iwp_mmb_json_encode($return));
|
327 |
+
}else{
|
328 |
+
$GLOBALS['IWP_RESPONSE_SENT'] = true;
|
329 |
+
$response_data = base64_encode(serialize($return));
|
330 |
+
}
|
331 |
+
exit("<IWPHEADER>" .$response_data."<ENDIWPHEADER>");
|
332 |
}
|
333 |
}
|
334 |
|
2171 |
if ( !get_option('iwp_client_public_key') && function_exists('add_action')){
|
2172 |
add_action('admin_enqueue_scripts', 'iwp_mmb_add_zero_clipboard_scripts');
|
2173 |
}
|
2174 |
+
|
2175 |
+
if (!function_exists('iwp_mmb_json_encode')) {
|
2176 |
+
function iwp_mmb_json_encode($data, $options = 0, $depth = 512){
|
2177 |
+
if ( version_compare( PHP_VERSION, '5.5', '>=' ) ) {
|
2178 |
+
$args = array( $data, $options, $depth );
|
2179 |
+
} elseif ( version_compare( PHP_VERSION, '5.3', '>=' ) ) {
|
2180 |
+
$args = array( $data, $options );
|
2181 |
+
} else {
|
2182 |
+
$args = array( $data );
|
2183 |
+
}
|
2184 |
+
$json = @call_user_func_array( 'json_encode', $args );
|
2185 |
+
|
2186 |
+
if ( false !== $json && ( version_compare( PHP_VERSION, '5.5', '>=' ) || false === strpos( $json, 'null' ) ) ) {
|
2187 |
+
return $json;
|
2188 |
+
}
|
2189 |
+
|
2190 |
+
$args[0] = iwp_mmb_json_compatible_check( $data, $depth );
|
2191 |
+
return @call_user_func_array( 'json_encode', $args );
|
2192 |
+
}
|
2193 |
+
}
|
2194 |
+
|
2195 |
+
if (!function_exists('json_encode'))
|
2196 |
+
{
|
2197 |
+
function json_encode($a=false)
|
2198 |
+
{
|
2199 |
+
if (is_null($a)) return 'null';
|
2200 |
+
if ($a === false) return 'false';
|
2201 |
+
if ($a === true) return 'true';
|
2202 |
+
if (is_scalar($a))
|
2203 |
+
{
|
2204 |
+
if (is_float($a))
|
2205 |
+
{
|
2206 |
+
// Always use "." for floats.
|
2207 |
+
return floatval(str_replace(",", ".", strval($a)));
|
2208 |
+
}
|
2209 |
+
|
2210 |
+
if (is_string($a))
|
2211 |
+
{
|
2212 |
+
static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
|
2213 |
+
return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"';
|
2214 |
+
}
|
2215 |
+
else
|
2216 |
+
return $a;
|
2217 |
+
}
|
2218 |
+
$isList = true;
|
2219 |
+
for ($i = 0, reset($a); $i < count($a); $i++, next($a))
|
2220 |
+
{
|
2221 |
+
if (key($a) !== $i)
|
2222 |
+
{
|
2223 |
+
$isList = false;
|
2224 |
+
break;
|
2225 |
+
}
|
2226 |
+
}
|
2227 |
+
$result = array();
|
2228 |
+
if ($isList)
|
2229 |
+
{
|
2230 |
+
foreach ($a as $v) $result[] = iwp_mmb_json_encode($v);
|
2231 |
+
return '[' . join(',', $result) . ']';
|
2232 |
+
}
|
2233 |
+
else
|
2234 |
+
{
|
2235 |
+
foreach ($a as $k => $v) $result[] = iwp_mmb_json_encode($k).':'.iwp_mmb_json_encode($v);
|
2236 |
+
return '{' . join(',', $result) . '}';
|
2237 |
+
}
|
2238 |
+
}
|
2239 |
+
}
|
2240 |
+
if (!function_exists('iwp_mmb_json_compatible_check')) {
|
2241 |
+
function iwp_mmb_json_compatible_check( $data, $depth ) {
|
2242 |
+
if ( $depth < 0 ) {
|
2243 |
+
return false;
|
2244 |
+
}
|
2245 |
+
|
2246 |
+
if ( is_array( $data ) ) {
|
2247 |
+
$output = array();
|
2248 |
+
foreach ( $data as $key => $value ) {
|
2249 |
+
if ( is_string( $key ) ) {
|
2250 |
+
$id = iwp_mmb_json_convert_string( $key );
|
2251 |
+
} else {
|
2252 |
+
$id = $key;
|
2253 |
+
}
|
2254 |
+
if ( is_array( $value ) || is_object( $value ) ) {
|
2255 |
+
$output[ $id ] = iwp_mmb_json_compatible_check( $value, $depth - 1 );
|
2256 |
+
} elseif ( is_string( $value ) ) {
|
2257 |
+
$output[ $id ] = iwp_mmb_json_convert_string( $value );
|
2258 |
+
} else {
|
2259 |
+
$output[ $id ] = $value;
|
2260 |
+
}
|
2261 |
+
}
|
2262 |
+
} elseif ( is_object( $data ) ) {
|
2263 |
+
$output = new stdClass;
|
2264 |
+
foreach ( $data as $key => $value ) {
|
2265 |
+
if ( is_string( $key ) ) {
|
2266 |
+
$id = iwp_mmb_json_convert_string( $key );
|
2267 |
+
} else {
|
2268 |
+
$id = $key;
|
2269 |
+
}
|
2270 |
+
|
2271 |
+
if ( is_array( $value ) || is_object( $value ) ) {
|
2272 |
+
$output->$id = iwp_mmb_json_compatible_check( $value, $depth - 1 );
|
2273 |
+
} elseif ( is_string( $value ) ) {
|
2274 |
+
$output->$id = iwp_mmb_json_convert_string( $value );
|
2275 |
+
} else {
|
2276 |
+
$output->$id = $value;
|
2277 |
+
}
|
2278 |
+
}
|
2279 |
+
} elseif ( is_string( $data ) ) {
|
2280 |
+
return iwp_mmb_json_convert_string( $data );
|
2281 |
+
} else {
|
2282 |
+
return $data;
|
2283 |
+
}
|
2284 |
+
|
2285 |
+
return $output;
|
2286 |
+
}
|
2287 |
+
}
|
2288 |
+
if (!function_exists('iwp_mmb_json_convert_string')) {
|
2289 |
+
function iwp_mmb_json_convert_string( $string ) {
|
2290 |
+
if ( function_exists( 'mb_convert_encoding' ) ) {
|
2291 |
+
$encoding = mb_detect_encoding( $string, mb_detect_order(), true );
|
2292 |
+
if ( $encoding ) {
|
2293 |
+
return mb_convert_encoding( $string, 'UTF-8', $encoding );
|
2294 |
+
} else {
|
2295 |
+
return mb_convert_encoding( $string, 'UTF-8', 'UTF-8' );
|
2296 |
+
}
|
2297 |
+
} else {
|
2298 |
+
return check_invalid_UTF8( $string, $true);
|
2299 |
+
}
|
2300 |
+
}
|
2301 |
+
}
|
2302 |
+
|
2303 |
+
if ( !function_exists('mb_detect_encoding') ) {
|
2304 |
+
function mb_detect_encoding ($string, $enc=null, $ret=null) {
|
2305 |
+
|
2306 |
+
static $enclist = array(
|
2307 |
+
'UTF-8',
|
2308 |
+
// 'ASCII',
|
2309 |
+
// 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4', 'ISO-8859-5',
|
2310 |
+
// 'ISO-8859-6', 'ISO-8859-7', 'ISO-8859-8', 'ISO-8859-9', 'ISO-8859-10',
|
2311 |
+
// 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15', 'ISO-8859-16',
|
2312 |
+
// 'Windows-1251', 'Windows-1252', 'Windows-1254',
|
2313 |
+
);
|
2314 |
+
|
2315 |
+
$result = false;
|
2316 |
+
|
2317 |
+
foreach ($enclist as $item) {
|
2318 |
+
$sample = $string;
|
2319 |
+
if(function_exists('iconv'))
|
2320 |
+
$sample = iconv($item, $item, $string);
|
2321 |
+
if (md5($sample) == md5($string)) {
|
2322 |
+
if ($ret === NULL) { $result = $item; } else { $result = true; }
|
2323 |
+
break;
|
2324 |
+
}
|
2325 |
+
}
|
2326 |
+
|
2327 |
+
return $result;
|
2328 |
+
}
|
2329 |
+
}
|
2330 |
+
|
2331 |
+
if (!function_exists('check_invalid_UTF8')) {
|
2332 |
+
function check_invalid_UTF8( $string, $strip = false ) {
|
2333 |
+
$string = (string) $string;
|
2334 |
+
|
2335 |
+
if ( 0 === strlen( $string ) ) {
|
2336 |
+
return '';
|
2337 |
+
}
|
2338 |
+
|
2339 |
+
// Check for support for utf8 in the installed PCRE library once and store the result in a static
|
2340 |
+
static $utf8_pcre = null;
|
2341 |
+
if ( ! isset( $utf8_pcre ) ) {
|
2342 |
+
$utf8_pcre = @preg_match( '/^./u', 'a' );
|
2343 |
+
}
|
2344 |
+
// We can't demand utf8 in the PCRE installation, so just return the string in those cases
|
2345 |
+
if ( !$utf8_pcre ) {
|
2346 |
+
return $string;
|
2347 |
+
}
|
2348 |
+
|
2349 |
+
// preg_match fails when it encounters invalid UTF8 in $string
|
2350 |
+
if ( 1 === @preg_match( '/^./us', $string ) ) {
|
2351 |
+
return $string;
|
2352 |
+
}
|
2353 |
+
|
2354 |
+
// Attempt to strip the bad chars if requested (not recommended)
|
2355 |
+
if ( $strip && function_exists( 'iconv' ) ) {
|
2356 |
+
return iconv( 'utf-8', 'utf-8', $string );
|
2357 |
+
}
|
2358 |
+
|
2359 |
+
return '';
|
2360 |
+
}
|
2361 |
+
}
|
2362 |
+
|
2363 |
+
define('MAX_SERIALIZED_INPUT_LENGTH', 8192);
|
2364 |
+
define('MAX_SERIALIZED_ARRAY_LENGTH', 512);
|
2365 |
+
define('MAX_SERIALIZED_ARRAY_DEPTH', 20);
|
2366 |
+
function _iwp_mmb_safe_unserialize($str)
|
2367 |
+
{
|
2368 |
+
if(strlen($str) > MAX_SERIALIZED_INPUT_LENGTH)
|
2369 |
+
{
|
2370 |
+
// input exceeds MAX_SERIALIZED_INPUT_LENGTH
|
2371 |
+
return false;
|
2372 |
+
}
|
2373 |
+
if(empty($str) || !is_string($str))
|
2374 |
+
{
|
2375 |
+
return false;
|
2376 |
+
}
|
2377 |
+
$stack = array();
|
2378 |
+
$expected = array();
|
2379 |
+
/*
|
2380 |
+
* states:
|
2381 |
+
* 0 - initial state, expecting a single value or array
|
2382 |
+
* 1 - terminal state
|
2383 |
+
* 2 - in array, expecting end of array or a key
|
2384 |
+
* 3 - in array, expecting value or another array
|
2385 |
+
*/
|
2386 |
+
$state = 0;
|
2387 |
+
while($state != 1)
|
2388 |
+
{
|
2389 |
+
$type = isset($str[0]) ? $str[0] : '';
|
2390 |
+
if($type == '}')
|
2391 |
+
{
|
2392 |
+
$str = substr($str, 1);
|
2393 |
+
}
|
2394 |
+
else if($type == 'N' && $str[1] == ';')
|
2395 |
+
{
|
2396 |
+
$value = null;
|
2397 |
+
$str = substr($str, 2);
|
2398 |
+
}
|
2399 |
+
else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))
|
2400 |
+
{
|
2401 |
+
$value = $matches[1] == '1' ? true : false;
|
2402 |
+
$str = substr($str, 4);
|
2403 |
+
}
|
2404 |
+
else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
|
2405 |
+
{
|
2406 |
+
$value = (int)$matches[1];
|
2407 |
+
$str = $matches[2];
|
2408 |
+
}
|
2409 |
+
else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
|
2410 |
+
{
|
2411 |
+
$value = (float)$matches[1];
|
2412 |
+
$str = $matches[3];
|
2413 |
+
}
|
2414 |
+
else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";')
|
2415 |
+
{
|
2416 |
+
$value = substr($matches[2], 0, (int)$matches[1]);
|
2417 |
+
$str = substr($matches[2], (int)$matches[1] + 2);
|
2418 |
+
}
|
2419 |
+
else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches) && $matches[1] < MAX_SERIALIZED_ARRAY_LENGTH)
|
2420 |
+
{
|
2421 |
+
$expectedLength = (int)$matches[1];
|
2422 |
+
$str = $matches[2];
|
2423 |
+
}
|
2424 |
+
else
|
2425 |
+
{
|
2426 |
+
// object or unknown/malformed type
|
2427 |
+
return false;
|
2428 |
+
}
|
2429 |
+
switch($state)
|
2430 |
+
{
|
2431 |
+
case 3: // in array, expecting value or another array
|
2432 |
+
if($type == 'a')
|
2433 |
+
{
|
2434 |
+
if(count($stack) >= MAX_SERIALIZED_ARRAY_DEPTH)
|
2435 |
+
{
|
2436 |
+
// array nesting exceeds MAX_SERIALIZED_ARRAY_DEPTH
|
2437 |
+
return false;
|
2438 |
+
}
|
2439 |
+
$stack[] = &$list;
|
2440 |
+
$list[$key] = array();
|
2441 |
+
$list = &$list[$key];
|
2442 |
+
$expected[] = $expectedLength;
|
2443 |
+
$state = 2;
|
2444 |
+
break;
|
2445 |
+
}
|
2446 |
+
if($type != '}')
|
2447 |
+
{
|
2448 |
+
$list[$key] = $value;
|
2449 |
+
$state = 2;
|
2450 |
+
break;
|
2451 |
+
}
|
2452 |
+
// missing array value
|
2453 |
+
return false;
|
2454 |
+
case 2: // in array, expecting end of array or a key
|
2455 |
+
if($type == '}')
|
2456 |
+
{
|
2457 |
+
if(count($list) < end($expected))
|
2458 |
+
{
|
2459 |
+
// array size less than expected
|
2460 |
+
return false;
|
2461 |
+
}
|
2462 |
+
unset($list);
|
2463 |
+
$list = &$stack[count($stack)-1];
|
2464 |
+
array_pop($stack);
|
2465 |
+
// go to terminal state if we're at the end of the root array
|
2466 |
+
array_pop($expected);
|
2467 |
+
if(count($expected) == 0) {
|
2468 |
+
$state = 1;
|
2469 |
+
}
|
2470 |
+
break;
|
2471 |
+
}
|
2472 |
+
if($type == 'i' || $type == 's')
|
2473 |
+
{
|
2474 |
+
if(count($list) >= MAX_SERIALIZED_ARRAY_LENGTH)
|
2475 |
+
{
|
2476 |
+
// array size exceeds MAX_SERIALIZED_ARRAY_LENGTH
|
2477 |
+
return false;
|
2478 |
+
}
|
2479 |
+
if(count($list) >= end($expected))
|
2480 |
+
{
|
2481 |
+
// array size exceeds expected length
|
2482 |
+
return false;
|
2483 |
+
}
|
2484 |
+
$key = $value;
|
2485 |
+
$state = 3;
|
2486 |
+
break;
|
2487 |
+
}
|
2488 |
+
// illegal array index type
|
2489 |
+
return false;
|
2490 |
+
case 0: // expecting array or value
|
2491 |
+
if($type == 'a')
|
2492 |
+
{
|
2493 |
+
if(count($stack) >= MAX_SERIALIZED_ARRAY_DEPTH)
|
2494 |
+
{
|
2495 |
+
// array nesting exceeds MAX_SERIALIZED_ARRAY_DEPTH
|
2496 |
+
return false;
|
2497 |
+
}
|
2498 |
+
$data = array();
|
2499 |
+
$list = &$data;
|
2500 |
+
$expected[] = $expectedLength;
|
2501 |
+
$state = 2;
|
2502 |
+
break;
|
2503 |
+
}
|
2504 |
+
if($type != '}')
|
2505 |
+
{
|
2506 |
+
$data = $value;
|
2507 |
+
$state = 1;
|
2508 |
+
break;
|
2509 |
+
}
|
2510 |
+
// not in array
|
2511 |
+
return false;
|
2512 |
+
}
|
2513 |
+
}
|
2514 |
+
if(!empty($str))
|
2515 |
+
{
|
2516 |
+
// trailing data in input
|
2517 |
+
return false;
|
2518 |
+
}
|
2519 |
+
return $data;
|
2520 |
+
}
|
2521 |
+
/**
|
2522 |
+
* Wrapper for _safe_unserialize() that handles exceptions and multibyte encoding issue
|
2523 |
+
*
|
2524 |
+
* @param string $str
|
2525 |
+
* @return mixed
|
2526 |
+
*/
|
2527 |
+
function iwp_mmb_safe_unserialize( $str )
|
2528 |
+
{
|
2529 |
+
// ensure we use the byte count for strings even when strlen() is overloaded by mb_strlen()
|
2530 |
+
if (function_exists('mb_internal_encoding') &&
|
2531 |
+
(((int) ini_get('mbstring.func_overload')) & 2))
|
2532 |
+
{
|
2533 |
+
$mbIntEnc = mb_internal_encoding();
|
2534 |
+
mb_internal_encoding('ASCII');
|
2535 |
+
}
|
2536 |
+
$out = _iwp_mmb_safe_unserialize($str);
|
2537 |
+
if (isset($mbIntEnc))
|
2538 |
+
{
|
2539 |
+
mb_internal_encoding($mbIntEnc);
|
2540 |
+
}
|
2541 |
+
return $out;
|
2542 |
+
}
|
2543 |
+
|
2544 |
?>
|
installer.class.php
CHANGED
@@ -202,12 +202,14 @@ class IWP_MMB_Installer extends IWP_MMB_Core
|
|
202 |
if (!empty($upgrade_plugins)) {
|
203 |
$plugin_files = $plugin_details = $premium_plugin_details = array();
|
204 |
foreach ($upgrade_plugins as $plugin) {
|
205 |
-
|
|
|
|
|
206 |
$plugin_details[] = $plugin;
|
207 |
-
$plugin_files[$
|
208 |
} else {
|
209 |
$premium_plugin_details[] = $plugin;
|
210 |
-
$premium_upgrades[md5($
|
211 |
}
|
212 |
}
|
213 |
if (!empty($plugin_files)) {
|
@@ -290,6 +292,7 @@ class IWP_MMB_Installer extends IWP_MMB_Core
|
|
290 |
{
|
291 |
global $iwp_activities_log_post_type, $iwp_mmb_activities_log;
|
292 |
ob_start();
|
|
|
293 |
|
294 |
if (!function_exists('wp_version_check') || !function_exists('get_core_checksums'))
|
295 |
include_once(ABSPATH . '/wp-admin/includes/update.php');
|
202 |
if (!empty($upgrade_plugins)) {
|
203 |
$plugin_files = $plugin_details = $premium_plugin_details = array();
|
204 |
foreach ($upgrade_plugins as $plugin) {
|
205 |
+
$file_path = $plugin['file'];
|
206 |
+
$plugin_name = $plugin['name'];
|
207 |
+
if (isset($file_path)) {
|
208 |
$plugin_details[] = $plugin;
|
209 |
+
$plugin_files[$file_path] = $plugin->old_version;
|
210 |
} else {
|
211 |
$premium_plugin_details[] = $plugin;
|
212 |
+
$premium_upgrades[md5($plugin_name)] = $plugin;
|
213 |
}
|
214 |
}
|
215 |
if (!empty($plugin_files)) {
|
292 |
{
|
293 |
global $iwp_activities_log_post_type, $iwp_mmb_activities_log;
|
294 |
ob_start();
|
295 |
+
$current = (object)$current;
|
296 |
|
297 |
if (!function_exists('wp_version_check') || !function_exists('get_core_checksums'))
|
298 |
include_once(ABSPATH . '/wp-admin/includes/update.php');
|
lib/amazon/s3IWPBackup.php
CHANGED
@@ -154,7 +154,7 @@ class IWP_MMB_S3_MULTICALL extends IWP_MMB_Backup_Multicall
|
|
154 |
'Bucket' => $as3_bucket,
|
155 |
'SourceFile' => $backup_file,
|
156 |
'Key' => $as3_file,
|
157 |
-
'ACL' => '
|
158 |
));
|
159 |
$current_file_num += 1;
|
160 |
$resArray = array (
|
@@ -207,7 +207,7 @@ class IWP_MMB_S3_MULTICALL extends IWP_MMB_Backup_Multicall
|
|
207 |
$result = $s3->createMultipartUpload(array(
|
208 |
'Bucket' => $as3_bucket,
|
209 |
'Key' => $as3_file,
|
210 |
-
'ACL' => '
|
211 |
|
212 |
));
|
213 |
|
@@ -619,7 +619,7 @@ class IWP_MMB_S3_SINGLECALL extends IWP_MMB_Backup_Multicall
|
|
619 |
'Bucket' => $as3_bucket,
|
620 |
'SourceFile' => $backup_file,
|
621 |
'Key' => $as3_file,
|
622 |
-
'ACL' => '
|
623 |
));
|
624 |
return true;
|
625 |
}catch (Exception $e){
|
@@ -642,7 +642,7 @@ class IWP_MMB_S3_SINGLECALL extends IWP_MMB_Backup_Multicall
|
|
642 |
$result = $s3->createMultipartUpload(array(
|
643 |
'Bucket' => $as3_bucket,
|
644 |
'Key' => $as3_file,
|
645 |
-
'ACL' => '
|
646 |
|
647 |
));
|
648 |
|
154 |
'Bucket' => $as3_bucket,
|
155 |
'SourceFile' => $backup_file,
|
156 |
'Key' => $as3_file,
|
157 |
+
'ACL' => 'authenticated-read'
|
158 |
));
|
159 |
$current_file_num += 1;
|
160 |
$resArray = array (
|
207 |
$result = $s3->createMultipartUpload(array(
|
208 |
'Bucket' => $as3_bucket,
|
209 |
'Key' => $as3_file,
|
210 |
+
'ACL' => 'authenticated-read',
|
211 |
|
212 |
));
|
213 |
|
619 |
'Bucket' => $as3_bucket,
|
620 |
'SourceFile' => $backup_file,
|
621 |
'Key' => $as3_file,
|
622 |
+
'ACL' => 'authenticated-read'
|
623 |
));
|
624 |
return true;
|
625 |
}catch (Exception $e){
|
642 |
$result = $s3->createMultipartUpload(array(
|
643 |
'Bucket' => $as3_bucket,
|
644 |
'Key' => $as3_file,
|
645 |
+
'ACL' => 'authenticated-read',
|
646 |
|
647 |
));
|
648 |
|
pclzip.class.php
CHANGED
@@ -3580,7 +3580,12 @@ endif;
|
|
3580 |
//$timeTak = microtime(true) - $tempLoopStart;
|
3581 |
|
3582 |
// ----- Check the minimum file size
|
3583 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
3584 |
echo "Check the minimum file size error";
|
3585 |
IWPPclZip::privErrorLog(IWP_PCLZIP_ERR_BAD_FORMAT, 'gzip temporary file \''.$v_gzip_temp_name.'\' has invalid filesize - should be minimum 18 bytes');
|
3586 |
//return array( 'error' => 'Zip-error: Error compressing the file "'.$p_filedescr['filename'].'".Try excluding this file and try again.');
|
3580 |
//$timeTak = microtime(true) - $tempLoopStart;
|
3581 |
|
3582 |
// ----- Check the minimum file size
|
3583 |
+
if (version_compare(phpversion(), '7','<')) {
|
3584 |
+
$version_bytes = 18;
|
3585 |
+
}else{
|
3586 |
+
$version_bytes = 0;
|
3587 |
+
}
|
3588 |
+
if (iwp_mmb_get_file_size($v_gzip_temp_name) < $version_bytes) {
|
3589 |
echo "Check the minimum file size error";
|
3590 |
IWPPclZip::privErrorLog(IWP_PCLZIP_ERR_BAD_FORMAT, 'gzip temporary file \''.$v_gzip_temp_name.'\' has invalid filesize - should be minimum 18 bytes');
|
3591 |
//return array( 'error' => 'Zip-error: Error compressing the file "'.$p_filedescr['filename'].'".Try excluding this file and try again.');
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: infinitewp
|
3 |
Tags: admin, administration, amazon, api, authentication, automatic, dashboard, dropbox, events, integration, manage, multisite, multiple, notification, performance, s3, security, seo, stats, tracking, infinitewp, updates, backup, restore, iwp, infinite
|
4 |
Requires at least: 3.1
|
5 |
-
Tested up to: 4.
|
6 |
Stable tag: trunk
|
7 |
|
8 |
Install this plugin on unlimited sites and manage them all from a central dashboard.
|
@@ -47,6 +47,17 @@ Credits: [Vladimir Prelovac](http://prelovac.com/vladimir) for his worker plugin
|
|
47 |
5. One-click updates
|
48 |
|
49 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
= 1.6.1.1 - August 12th 2016 =
|
52 |
* Fix: Bug Fix.
|
2 |
Contributors: infinitewp
|
3 |
Tags: admin, administration, amazon, api, authentication, automatic, dashboard, dropbox, events, integration, manage, multisite, multiple, notification, performance, s3, security, seo, stats, tracking, infinitewp, updates, backup, restore, iwp, infinite
|
4 |
Requires at least: 3.1
|
5 |
+
Tested up to: 4.7
|
6 |
Stable tag: trunk
|
7 |
|
8 |
Install this plugin on unlimited sites and manage them all from a central dashboard.
|
47 |
5. One-click updates
|
48 |
|
49 |
== Changelog ==
|
50 |
+
= 1.6.3.2 - Jan 4th 2017 =
|
51 |
+
* Improvement: JSON communication between Admin Panel and Client plugin has been implemented.
|
52 |
+
* Improvement: If the PHP version of WordPress site is less than 5.4.0 then the single call backups will fail with "Fatal error: Cannot use string offset as an array in /home/asogerb6/public_html/wp-content/plugins/iwp-client/backup.class.singlecall.php on line 340".
|
53 |
+
* Improvement: Debug files DE_clMemoryPeak.php, DE_clMemoryUsage.php and DE_clTimeTaken.php have been removed.
|
54 |
+
* Improvement: Security patches have been applied for sites backed up to Amazon S3 storage.
|
55 |
+
* Fix: Backups having size greater than 2GB could not be uploaded to Google Drive in certain scenarios throwing a bad request error.
|
56 |
+
* Fix: "Failed to zip files. pclZip error (-4): File '/wp-content/plugins/wordfence/tmp/configCache.php' does not exist" has been fixed.
|
57 |
+
* Fix: Pluggable.php shouldn't be included before loading all plugins.
|
58 |
+
* Fix: MySQL error wouldn't show accurately during failed table creation.
|
59 |
+
* Fix: If the default auto_increment_increment value is set to 2 in the user's server the backup will fail for all sites on that server.
|
60 |
+
* Fix: If the value for integer field is EMPTY then instead of considering default value as NULL, the plugin creates a duplicate entry during cloning.
|
61 |
|
62 |
= 1.6.1.1 - August 12th 2016 =
|
63 |
* Fix: Bug Fix.
|