InfiniteWP Client - Version 1.3.2

Version Description

  • Fix: Dropbox backup upload in single call more then 50MB file not uploading issue.
Download this release

Release Info

Developer infinitewp
Plugin Icon 128x128 InfiniteWP Client
Version 1.3.2
Comparing to
See all releases

Code changes from version 1.2.15 to 1.3.2

Files changed (73) hide show
  1. addons/backup_repository/backup_repository.class.php +5 -47
  2. addons/brokenlinks/brokenlinks.class.php +7 -7
  3. addons/file_editor/file_editor.class.php +9 -9
  4. addons/google_webmasters/google_webmasters.class.php +1 -0
  5. addons/manage_users/user.class.php +12 -12
  6. addons/post_links/link.class.php +1 -1
  7. addons/post_links/post.class.php +8 -8
  8. addons/wordfence/wordfence.class.php +1 -1
  9. backup.class.multicall.php +6114 -0
  10. backup.class.php → backup.class.singlecall.php +1057 -916
  11. core.class.php +64 -11
  12. helper.class.php +21 -21
  13. init.php +251 -68
  14. installer.class.php +37 -37
  15. lib/Google/Auth/Abstract.php +41 -41
  16. lib/Google/Auth/AssertionCredentials.php +133 -133
  17. lib/Google/Auth/Exception.php +22 -22
  18. lib/Google/Auth/LoginTicket.php +69 -69
  19. lib/Google/Auth/OAuth2.php +587 -587
  20. lib/Google/Auth/Simple.php +92 -92
  21. lib/Google/Cache/Abstract.php +53 -53
  22. lib/Google/Cache/Apc.php +73 -73
  23. lib/Google/Cache/Exception.php +21 -21
  24. lib/Google/Cache/File.php +145 -145
  25. lib/Google/Cache/Memcache.php +137 -137
  26. lib/Google/Cache/Null.php +56 -56
  27. lib/Google/Client.php +608 -608
  28. lib/Google/Collection.php +94 -94
  29. lib/Google/Config.php +315 -315
  30. lib/Google/Exception.php +20 -20
  31. lib/Google/Http/Batch.php +143 -143
  32. lib/Google/Http/CacheParser.php +184 -184
  33. lib/Google/Http/MediaFileUpload.php +304 -305
  34. lib/Google/Http/REST.php +139 -139
  35. lib/Google/Http/Request.php +476 -476
  36. lib/Google/IO/Abstract.php +312 -312
  37. lib/Google/IO/Curl.php +135 -135
  38. lib/Google/IO/Exception.php +22 -22
  39. lib/Google/IO/Stream.php +182 -182
  40. lib/Google/IO/cacerts.pem +2183 -2183
  41. lib/Google/Model.php +250 -250
  42. lib/Google/Service.php +39 -39
  43. lib/Google/Service/Drive.php +5732 -5732
  44. lib/Google/Service/Exception.php +53 -53
  45. lib/Google/Service/Oauth2.php +412 -412
  46. lib/Google/Service/Resource.php +210 -210
  47. lib/Google/Signer/Abstract.php +29 -29
  48. lib/Google/Signer/P12.php +91 -91
  49. lib/Google/Utils.php +135 -135
  50. lib/Google/Utils/URITemplate.php +333 -333
  51. lib/Google/Verifier/Abstract.php +30 -30
  52. lib/Google/Verifier/Pem.php +74 -74
  53. lib/amazon_s3/extensions/dynamodbsessionhandler.class.php +513 -513
  54. lib/amazon_s3/extensions/s3browserupload.class.php +172 -172
  55. lib/amazon_s3/extensions/s3streamwrapper.class.php +606 -606
  56. lib/amazon_s3/lib/requestcore/LICENSE +25 -25
  57. lib/amazon_s3/lib/requestcore/README.md +15 -15
  58. lib/amazon_s3/lib/requestcore/cacert.pem +3390 -3390
  59. lib/amazon_s3/lib/requestcore/requestcore.class.php +1033 -1033
  60. lib/amazon_s3/services/s3.class.php +4307 -4307
  61. lib/amazon_s3/utilities/array.class.php +312 -312
  62. lib/amazon_s3/utilities/batchrequest.class.php +126 -126
  63. lib/amazon_s3/utilities/credential.class.php +157 -157
  64. lib/amazon_s3/utilities/credentials.class.php +134 -134
  65. lib/amazon_s3/utilities/mimetypes.class.php +223 -223
  66. lib/amazon_s3/utilities/request.class.php +70 -70
  67. lib/amazon_s3/utilities/response.class.php +30 -30
  68. lib/amazon_s3/utilities/simplexml.class.php +272 -272
  69. lib/amazon_s3/utilities/utilities.class.php +399 -399
  70. lib/dropbox.php +49 -3
  71. pclzip.class.php +892 -203
  72. readme.txt +16 -2
  73. stats.class.php +1 -1
addons/backup_repository/backup_repository.class.php CHANGED
@@ -1,5 +1,5 @@
1
<?php
2
- class IWP_MMB_Backup_Repository extends IWP_MMB_Backup
3
{
4
/*var $site_name;
5
var $statuses;
@@ -33,7 +33,7 @@ class IWP_MMB_Backup_Repository extends IWP_MMB_Backup
33
}*/
34
35
function backup_repository($args){
36
-
37
if (!empty($args))
38
extract($args);
39
@@ -53,6 +53,7 @@ class IWP_MMB_Backup_Repository extends IWP_MMB_Backup
53
$backup_file = $results[count($results) - 1]['server']['file_path'];
54
}
55
56
if ($backup_file && file_exists($backup_file)) {
57
//FTP, Amazon S3 or Dropbox
58
if (isset($account_info['iwp_ftp']) && !empty($account_info)) {
@@ -80,50 +81,7 @@ class IWP_MMB_Backup_Repository extends IWP_MMB_Backup
80
$return = $this->dropbox_backup($account_info['iwp_dropbox']);
81
$this->update_status($task_name, 'dropbox', true);
82
iwp_mmb_print_flush('Dropbox upload: End');
83
- }
84
-
85
- if (isset($account_info['iwp_gdrive']) && !empty($account_info['iwp_gdrive'])) {
86
-
87
- $this->update_status($task_name,'gDrive');
88
- $account_info['iwp_gdrive']['backup_file'] = $backup_file;
89
- iwp_mmb_print_flush('google Drive upload: Start');
90
- $gdrive_result = $this->google_drive_backup($account_info['iwp_gdrive']);
91
- $this->update_status($task_name, 'gDrive', true);
92
- iwp_mmb_print_flush('google Drive upload: End');
93
-
94
- if ($gdrive_result == false && $del_host_file) {
95
- @unlink($backup_file);
96
- $return = false;
97
- }
98
-
99
- if (is_array($gdrive_result) && isset($gdrive_result['error'])) {
100
- return $gdrive_result;
101
- }
102
-
103
- //update the tasks different method for gDrive
104
-
105
- if(!empty($gdrive_result))
106
- {
107
- $tasks = $this->tasks;
108
- $task = $tasks['Backup Now'];
109
- $results = $task['task_results'];
110
- if (is_array($results) && count($results)) {
111
- $results[count($results) - 1]['gDrive'] = $gdrive_result;
112
- //$results[count($results) - 1]['gDriveOrgFileName'] = basename($backup_url); //not required
113
- unset($results[count($results) - 1]['server']);
114
- }
115
-
116
- /* $paths['gDrive'] = $gdrive_result; //different from other upload ; storing the gDrive backupfile ID in the paths array for delete operation
117
- $paths['gDriveOrgFileName'] = basename($backup_url); */
118
-
119
- $tasks['Backup Now']['task_results'] = $results;
120
- $this->tasks = $tasks;
121
-
122
- $this->update_status($task_name,'gDrive', true);
123
- unset($paths['server']);
124
- $return = true;
125
- }
126
- }
127
128
if ($return == true && $del_host_file) {
129
@unlink($backup_file);
@@ -135,7 +93,7 @@ class IWP_MMB_Backup_Repository extends IWP_MMB_Backup
135
136
} else {
137
$return = array(
138
- 'error' => 'Backup file not found on your server. Please try again.'
139
);
140
}
141
1
<?php
2
+ class IWP_MMB_Backup_Repository extends IWP_MMB_Backup_Singlecall
3
{
4
/*var $site_name;
5
var $statuses;
33
}*/
34
35
function backup_repository($args){
36
+
37
if (!empty($args))
38
extract($args);
39
53
$backup_file = $results[count($results) - 1]['server']['file_path'];
54
}
55
56
+
57
if ($backup_file && file_exists($backup_file)) {
58
//FTP, Amazon S3 or Dropbox
59
if (isset($account_info['iwp_ftp']) && !empty($account_info)) {
81
$return = $this->dropbox_backup($account_info['iwp_dropbox']);
82
$this->update_status($task_name, 'dropbox', true);
83
iwp_mmb_print_flush('Dropbox upload: End');
84
+ }
85
86
if ($return == true && $del_host_file) {
87
@unlink($backup_file);
93
94
} else {
95
$return = array(
96
+ 'error' => 'Backup file not found on your server. Please try again.', 'error_code' => 'backup_file_not_found_on_server'
97
);
98
}
99
addons/brokenlinks/brokenlinks.class.php CHANGED
@@ -105,7 +105,7 @@ class IWP_MMB_BLC extends IWP_MMB_Core
105
}
106
return $success;
107
} else {
108
- return array('error'=>"Broken Link Checker plugin is not activated");
109
}
110
}
111
@@ -118,7 +118,7 @@ class IWP_MMB_BLC extends IWP_MMB_Core
118
$rez['linkType']=$params['linkType'];
119
return $rez;
120
} else {
121
- return array('error'=>"Broken Link Checker plugin is not activated");
122
}
123
}
124
@@ -133,7 +133,7 @@ class IWP_MMB_BLC extends IWP_MMB_Core
133
$rez['linkType']=$params['linkType'];
134
return $rez;
135
} else {
136
- return array('error'=>"Broken Link Checker plugin is not activated");
137
}
138
}
139
@@ -153,11 +153,11 @@ class IWP_MMB_BLC extends IWP_MMB_Core
153
if ( $link->save() ){
154
$rez = array('old_link_id'=>$params['linkID'],'linkType'=>$params['linkType'],'marked'=>1);
155
} else {
156
- $rez = array('error'=>'Action couldn\'t be completed');
157
}
158
return $rez;
159
} else {
160
- return array('error'=>"Broken Link Checker plugin is not activated");
161
}
162
}
163
function blc_dismiss_link($params){
@@ -179,11 +179,11 @@ class IWP_MMB_BLC extends IWP_MMB_Core
179
if ( $link->save() ){
180
$rez = array('old_link_id'=>$params['linkID'],'linkType'=>$params['linkType'],'dismissvalue_set'=>1);
181
} else {
182
- $rez = array('error'=>'Action couldn\'t be completed');
183
}
184
return $rez;
185
} else {
186
- return array('error'=>"Broken Link Checker plugin is not activated");
187
}
188
}
189
105
}
106
return $success;
107
} else {
108
+ return array('error'=>"Broken Link Checker plugin is not activated", 'error_code' => 'blc_plugin_not_activated_blc_get_all_links');
109
}
110
}
111
118
$rez['linkType']=$params['linkType'];
119
return $rez;
120
} else {
121
+ return array('error'=>"Broken Link Checker plugin is not activated", 'error_code' => 'blc_plugin_not_activated_blc_update_link');
122
}
123
}
124
133
$rez['linkType']=$params['linkType'];
134
return $rez;
135
} else {
136
+ return array('error'=>"Broken Link Checker plugin is not activated", 'error_code' => 'blc_plugin_not_activated_blc_unlink');
137
}
138
}
139
153
if ( $link->save() ){
154
$rez = array('old_link_id'=>$params['linkID'],'linkType'=>$params['linkType'],'marked'=>1);
155
} else {
156
+ $rez = array('error'=>'Action couldn\'t be completed', 'error_code' => 'blc_plugin_action_couldnt_completed_blc_mark_as_not_broken');
157
}
158
return $rez;
159
} else {
160
+ return array('error'=>"Broken Link Checker plugin is not activated", 'error_code' => 'blc_plugin_not_activated_blc_mark_as_not_broken');
161
}
162
}
163
function blc_dismiss_link($params){
179
if ( $link->save() ){
180
$rez = array('old_link_id'=>$params['linkID'],'linkType'=>$params['linkType'],'dismissvalue_set'=>1);
181
} else {
182
+ $rez = array('error'=>'Action couldn\'t be completed', 'error_code' => 'blc_plugin_action_couldnt_completed_blc_set_dismiss_status');
183
}
184
return $rez;
185
} else {
186
+ return array('error'=>"Broken Link Checker plugin is not activated", 'error_code' => 'blc_plugin_not_activated_blc_set_dismiss_status');
187
}
188
}
189
addons/file_editor/file_editor.class.php CHANGED
@@ -193,14 +193,14 @@ function iwp_mmb_direct_to_any_copy($source, $destination, $overwrite = false, $
193
extract($params);
194
if (!function_exists('gzinflate')) {
195
return array(
196
- 'error' => 'Gzip library functions are not available.'
197
);
198
}else{
199
$fileContent = gzinflate($fileContent);
200
}
201
if (!$this->is_server_writable()) {
202
return array(
203
- 'error' => 'Failed, please add FTP details'
204
);
205
}
206
@@ -208,14 +208,14 @@ function iwp_mmb_direct_to_any_copy($source, $destination, $overwrite = false, $
208
ob_start();
209
if (false === ($creds = request_filesystem_credentials($url, '', false, ABSPATH, null) ) ) {
210
return array(
211
- 'error' => 'Unable to get file system credentials'
212
); // stop processing here
213
}
214
ob_end_clean();
215
216
if ( ! WP_Filesystem($creds, ABSPATH) ) {
217
return array(
218
- 'error' => 'Unable to initiate file system. Please check you have entered valid FTP credentials.'
219
); // stop processing here
220
}
221
@@ -229,7 +229,7 @@ function iwp_mmb_direct_to_any_copy($source, $destination, $overwrite = false, $
229
$is_dir_created = mkdir($new_temp_folder);// new folder should be empty
230
if(!$is_dir_created){
231
return array(
232
- 'error' => 'Unable to create a temporary directory.'
233
);
234
}
235
@@ -238,19 +238,19 @@ function iwp_mmb_direct_to_any_copy($source, $destination, $overwrite = false, $
238
$remote_abspath = trailingslashit($remote_abspath);
239
}else{
240
return array(
241
- 'error' => 'Unable to locate WP root directory using file system.'
242
);
243
}
244
245
if($folderPath == 'root' && ($filePath == 'wp-config' || $filePath == 'wp-config.php' ) ){
246
return array(
247
- 'error' => 'wp-config file is not allowed.'
248
);
249
}
250
251
$file = $this->get_file_editor_vars($remote_abspath,$folderPath,$filePath,$ext);
252
if($file === false){
253
- return array('error' => 'File path given is invalid.');
254
}
255
256
$new_temp_subfolders = $new_temp_folder;
@@ -259,7 +259,7 @@ function iwp_mmb_direct_to_any_copy($source, $destination, $overwrite = false, $
259
$is_subdir_created = mkdir($new_temp_subfolders);// new folder should be empty
260
if(!$is_subdir_created){
261
return array(
262
- 'error' => 'Unable to create a temporary directory.'
263
);
264
}
265
}
193
extract($params);
194
if (!function_exists('gzinflate')) {
195
return array(
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
if (!$this->is_server_writable()) {
202
return array(
203
+ 'error' => 'Failed, please add FTP details', 'error_code' => 'failed_please_add_FTP_details_file_editor_upload'
204
);
205
}
206
208
ob_start();
209
if (false === ($creds = request_filesystem_credentials($url, '', false, ABSPATH, null) ) ) {
210
return array(
211
+ 'error' => 'Unable to get file system credentials', 'error_code' => 'unable_to_get_file_system_credentials_file_editor_upload'
212
); // stop processing here
213
}
214
ob_end_clean();
215
216
if ( ! WP_Filesystem($creds, ABSPATH) ) {
217
return array(
218
+ 'error' => 'Unable to initiate file system. Please check you have entered valid FTP credentials.', 'error_code' => 'unable_to_initiate_file_system_check_ftp_credentials_file_editor_upload'
219
); // stop processing here
220
}
221
229
$is_dir_created = mkdir($new_temp_folder);// new folder should be empty
230
if(!$is_dir_created){
231
return array(
232
+ 'error' => 'Unable to create a temporary directory.', 'error_code' => 'unable_to_create_temporary_directory_file_editor_upload'
233
);
234
}
235
238
$remote_abspath = trailingslashit($remote_abspath);
239
}else{
240
return array(
241
+ 'error' => 'Unable to locate WP root directory using file system.', 'error_code' => 'unable_to_locate_root_directory_remote_abspath_file_editor_upload'
242
);
243
}
244
245
if($folderPath == 'root' && ($filePath == 'wp-config' || $filePath == 'wp-config.php' ) ){
246
return array(
247
+ 'error' => 'wp-config file is not allowed.', 'error_code' => 'config_file_is_not_allowed_file_editor_upload'
248
);
249
}
250
251
$file = $this->get_file_editor_vars($remote_abspath,$folderPath,$filePath,$ext);
252
if($file === false){
253
+ return array('error' => 'File path given is invalid.', 'error_code' => 'file_path_given_is_invalid_file_editor_upload');
254
}
255
256
$new_temp_subfolders = $new_temp_folder;
259
$is_subdir_created = mkdir($new_temp_subfolders);// new folder should be empty
260
if(!$is_subdir_created){
261
return array(
262
+ 'error' => 'Unable to create a temporary directory.', 'error_code' => 'unable_to_locate_wp_root_directory_using_file_system_file_editor_upload'
263
);
264
}
265
}
addons/google_webmasters/google_webmasters.class.php CHANGED
@@ -9,6 +9,7 @@ if(!function_exists('iwp_mmb_create_webmasters_redirect_table')){
9
global $wpdb;
10
11
$IWP_MMB_WEBMASTERS_REDIRECT_TABLE_VERSION = get_site_option( 'iwp_webmasters_redirect_table_version' );
12
if(version_compare($IWP_MMB_WEBMASTERS_REDIRECT_TABLE_VERSION, '1.0') == -1){
13
14
$table_name = $wpdb->base_prefix . "iwp_redirects";
9
global $wpdb;
10
11
$IWP_MMB_WEBMASTERS_REDIRECT_TABLE_VERSION = get_site_option( 'iwp_webmasters_redirect_table_version' );
12
+
13
if(version_compare($IWP_MMB_WEBMASTERS_REDIRECT_TABLE_VERSION, '1.0') == -1){
14
15
$table_name = $wpdb->base_prefix . "iwp_redirects";
addons/manage_users/user.class.php CHANGED
@@ -81,10 +81,10 @@ class IWP_MMB_User extends IWP_MMB_Core
81
include_once(ABSPATH . WPINC . '/registration.php');
82
83
if(username_exists($args['user_login']))
84
- return array('error' => 'Username already exists');
85
86
if (email_exists($args['user_email']))
87
- return array('error' => 'Email already exists');
88
89
if(!function_exists('wp_insert_user'))
90
include_once (ABSPATH . 'wp-admin/includes/user.php');
@@ -99,7 +99,7 @@ class IWP_MMB_User extends IWP_MMB_Core
99
}
100
return $user_id;
101
}else{
102
- return array('error' => 'User not added. Please try again.');
103
}
104
105
}
@@ -130,7 +130,7 @@ class IWP_MMB_User extends IWP_MMB_Core
130
$userdata['ID'] = $user_obj->ID;
131
$result = wp_update_user($userdata);
132
} else {
133
- $result = array('error' => 'No password provided.');
134
}
135
break;
136
case 'change-role':
@@ -142,13 +142,13 @@ class IWP_MMB_User extends IWP_MMB_Core
142
$userdata['role'] = strtolower($new_role);
143
$result = wp_update_user($userdata);
144
} else {
145
- $result = array('error' => 'Cannot change role to the only one left admin user.');
146
}
147
} else {
148
- $result = array('error' => 'Cannot change role to user assigned for InfiniteWP.');
149
}
150
} else {
151
- $result = array('error' => 'No role provided.');
152
}
153
break;
154
case 'delete-user':
@@ -159,25 +159,25 @@ class IWP_MMB_User extends IWP_MMB_Core
159
if($to_user != false){
160
$result = wp_delete_user($user_obj->ID, $to_user->ID);
161
} else {
162
- $result = array('error' => 'User not deleted. User to reassign posts doesn\'t exist.');
163
}
164
} else {
165
$result = wp_delete_user($user_obj->ID);
166
}
167
} else {
168
- $result = array('error' => 'Cannot delete the only one left admin user.');
169
}
170
} else {
171
- $result = array('error' => 'Cannot delete user assigned for InfiniteWP.');
172
}
173
174
break;
175
default:
176
- $result = array('error' => 'Wrong action provided. Please try again.');
177
break;
178
}
179
} else {
180
- $result = array('error' => 'User not found.');
181
}
182
183
if(is_wp_error($result)){
81
include_once(ABSPATH . WPINC . '/registration.php');
82
83
if(username_exists($args['user_login']))
84
+ return array('error' => 'Username already exists', 'error_code' => 'username_already_exists');
85
86
if (email_exists($args['user_email']))
87
+ return array('error' => 'Email already exists', 'error_code' => 'email_already_exists');
88
89
if(!function_exists('wp_insert_user'))
90
include_once (ABSPATH . 'wp-admin/includes/user.php');
99
}
100
return $user_id;
101
}else{
102
+ return array('error' => 'User not added. Please try again.', 'error_code' => 'user_not_added_please_try_again');
103
}
104
105
}
130
$userdata['ID'] = $user_obj->ID;
131
$result = wp_update_user($userdata);
132
} else {
133
+ $result = array('error' => 'No password provided.', 'error_code' => 'no_password_provided');
134
}
135
break;
136
case 'change-role':
142
$userdata['role'] = strtolower($new_role);
143
$result = wp_update_user($userdata);
144
} else {
145
+ $result = array('error' => 'Cannot change role to the only one left admin user.', 'error_code' => 'cannot_change_role_to_the_only_one_left_admin_user');
146
}
147
} else {
148
+ $result = array('error' => 'Cannot change role to user assigned for InfiniteWP.', 'error_code' => 'cannot_change_role_to_user_assigned_to_InfiniteWP');
149
}
150
} else {
151
+ $result = array('error' => 'No role provided.', 'error_code' => 'no_role_provided');
152
}
153
break;
154
case 'delete-user':
159
if($to_user != false){
160
$result = wp_delete_user($user_obj->ID, $to_user->ID);
161
} else {
162
+ $result = array('error' => 'User not deleted. User to reassign posts doesn\'t exist.', 'error_code' => 'user_not_deleted_user_to_reassign_posts_doesnt_exist');
163
}
164
} else {
165
$result = wp_delete_user($user_obj->ID);
166
}
167
} else {
168
+ $result = array('error' => 'Cannot delete the only one left admin user.', 'error_code' => 'cannot_delete_the_only_one_left_admin_user');
169
}
170
} else {
171
+ $result = array('error' => 'Cannot delete user assigned for InfiniteWP.', 'error_code' => 'cannot_delete_user_assigned_for_InfiniteWP');
172
}
173
174
break;
175
default:
176
+ $result = array('error' => 'Wrong action provided. Please try again.', 'error_code' => 'wrong_action_provided_please_try_again');
177
break;
178
}
179
} else {
180
+ $result = array('error' => 'User not found.', 'error_code' => 'user_not_found');
181
}
182
183
if(is_wp_error($result)){
addons/post_links/link.class.php CHANGED
@@ -68,7 +68,7 @@ class IWP_MMB_Link extends IWP_MMB_Core
68
69
$is_success = wp_insert_link($params);
70
71
- return $is_success ? true : array('error' => 'Failed to add link.');
72
}
73
74
function remove_element($arr, $val){
68
69
$is_success = wp_insert_link($params);
70
71
+ return $is_success ? true : array('error' => 'Failed to add link.', 'error_code' => 'failed_to_add_link');
72
}
73
74
function remove_element($arr, $val){
addons/post_links/post.class.php CHANGED
@@ -152,13 +152,13 @@ class IWP_MMB_Post extends IWP_MMB_Core
152
}
153
154
if(isset($upload['error']) && !empty($upload['error'])){
155
- return array('error' => $upload['error']);
156
}
157
$file_name = basename($no_thumb);
158
$tmp_file = download_url($no_thumb);
159
160
if(is_wp_error($tmp_file)){
161
- return array('error' => $tmp_file->get_error_message());
162
}
163
164
$attach_upload['url'] = $upload['url'] . '/' . $file_name;
@@ -234,7 +234,7 @@ class IWP_MMB_Post extends IWP_MMB_Core
234
}
235
} else {
236
@unlink($tmp_file);
237
- return array('error' => "Cannot create attachment file in ".$attach_upload['path']." Please set correct permissions.");
238
239
}
240
@unlink($tmp_file);
@@ -250,12 +250,12 @@ class IWP_MMB_Post extends IWP_MMB_Core
250
$file_name = basename($img['src']);
251
252
if(isset($upload['error']) && !empty($upload['error'])){
253
- return array('error' => $upload['error']);
254
}
255
256
$tmp_file = download_url($img['src']);
257
if(is_wp_error($tmp_file)){
258
- return array('error' => $tmp_file->get_error_message());
259
}
260
261
$attach_upload['url'] = $upload['url'] . '/' . $file_name;
@@ -295,7 +295,7 @@ class IWP_MMB_Post extends IWP_MMB_Core
295
296
} else {
297
@unlink($tmp_file);
298
- return array('error' => "Cannot create attachment file in ".$attach_upload['path']." Please set correct permissions.");
299
}
300
@unlink($tmp_file);
301
}
@@ -344,7 +344,7 @@ class IWP_MMB_Post extends IWP_MMB_Core
344
if($post_data['iwp_post_edit'] && $post_data['iwp_force_publish']){
345
$post_id = wp_insert_post($post_data);
346
} elseif($post_data['iwp_post_edit'] && !$post_data['iwp_force_publish']) {
347
- return array('error' => "Post not found.");
348
} else {
349
$post_id = wp_insert_post($post_data);
350
}
@@ -369,7 +369,7 @@ class IWP_MMB_Post extends IWP_MMB_Core
369
if ($post_featured_img != '') {
370
$file_name = basename($post_featured_img);
371
if(isset($upload['error']) && !empty($upload['error'])){
372
- return array('error' => $upload['error']);
373
}
374
$tmp_file = download_url($post_featured_img);
375
if(is_wp_error($tmp_file)){
152
}
153
154
if(isset($upload['error']) && !empty($upload['error'])){
155
+ return array('error' => $upload['error'], 'error_code' => 'upload_error');
156
}
157
$file_name = basename($no_thumb);
158
$tmp_file = download_url($no_thumb);
159
160
if(is_wp_error($tmp_file)){
161
+ return array('error' => $tmp_file->get_error_message(), 'error_code' => 'error_download_img_thumb_url');
162
}
163
164
$attach_upload['url'] = $upload['url'] . '/' . $file_name;
234
}
235
} else {
236
@unlink($tmp_file);
237
+ return array('error' => "Cannot create attachment file in ".$attach_upload['path']." Please set correct permissions.", 'error_code' =>'cannot_create_attachment_file_set_correct_permissions' );
238
239
}
240
@unlink($tmp_file);
250
$file_name = basename($img['src']);
251
252
if(isset($upload['error']) && !empty($upload['error'])){
253
+ return array('error' => $upload['error'], 'error_code' => 'upload_error_post_atta_img');
254
}
255
256
$tmp_file = download_url($img['src']);
257
if(is_wp_error($tmp_file)){
258
+ return array('error' => $tmp_file->get_error_message(), 'error_code' => 'download_url_wp_error_post_atta_img');
259
}
260
261
$attach_upload['url'] = $upload['url'] . '/' . $file_name;
295
296
} else {
297
@unlink($tmp_file);
298
+ return array('error' => "Cannot create attachment file in ".$attach_upload['path']." Please set correct permissions.", 'error_code' => 'cannot_create_attachment_post_featured_img');
299
}
300
@unlink($tmp_file);
301
}
344
if($post_data['iwp_post_edit'] && $post_data['iwp_force_publish']){
345
$post_id = wp_insert_post($post_data);
346
} elseif($post_data['iwp_post_edit'] && !$post_data['iwp_force_publish']) {
347
+ return array('error' => "Post not found.", 'error_code' => 'post_not_found');
348
} else {
349
$post_id = wp_insert_post($post_data);
350
}
369
if ($post_featured_img != '') {
370
$file_name = basename($post_featured_img);
371
if(isset($upload['error']) && !empty($upload['error'])){
372
+ return array('error' => $upload['error'], 'error_code' => 'error_post_featured_img');
373
}
374
$tmp_file = download_url($post_featured_img);
375
if(is_wp_error($tmp_file)){
addons/wordfence/wordfence.class.php CHANGED
@@ -32,7 +32,7 @@ class IWP_WORDFENCE extends IWP_MMB_Core
32
if($this->_checkWordFence()) {
33
return wordfence::ajax_scan_callback();
34
} else {
35
- return array('error'=>"Word Fence plugin is not activated");
36
}
37
}
38
32
if($this->_checkWordFence()) {
33
return wordfence::ajax_scan_callback();
34
} else {
35
+ return array('error'=>"Word Fence plugin is not activated", 'error_code' => 'wordfence_plugin_is_not_activated');
36
}
37
}
38
backup.class.multicall.php ADDED
@@ -0,0 +1,6114 @@