Version Description
- New: Improved branding feature
- New: Disable Plugin and Theme changes for your clients
- New: Support Page for non-Admin Users
- New: Manage biographical info of user
- Fix: Restore backup action keeps all backup tasks and backups
- Fix: Add/delete post action uses WordPress hook
- Fix: Delete user action was not functioning properly
Download this release
Release Info
Developer | freediver |
Plugin | ManageWP Worker |
Version | 3.9.26 |
Comparing to | |
See all releases |
Code changes from version 3.9.25 to 3.9.26
- backup.class.php +62 -29
- comment.class.php +5 -5
- core.class.php +202 -6
- init.php +139 -101
- installer.class.php +16 -16
- post.class.php +32 -37
- readme.txt +11 -3
- stats.class.php +0 -1
- user.class.php +9 -0
- version +1 -1
backup.class.php
CHANGED
@@ -799,6 +799,10 @@ class MMB_Backup extends MMB_Core {
|
|
799 |
ob_start();
|
800 |
$command = "$zip -q -j $comp_level $backup_file .* * $exclude_file_data";
|
801 |
$this->_log("Executing $command");
|
|
|
|
|
|
|
|
|
802 |
$result_f = $this->mmb_exec($command, false, true);
|
803 |
if (!$result_f || $result_f == 18) { // disregard permissions error, file can't be accessed
|
804 |
$command = "$zip -q -r $comp_level $backup_file $include_data $exclude_data";
|
@@ -1044,7 +1048,38 @@ class MMB_Backup extends MMB_Core {
|
|
1044 |
global $wpdb;
|
1045 |
$paths = $this->check_mysql_paths();
|
1046 |
$brace = (substr(PHP_OS, 0, 3) == 'WIN') ? '"' : '';
|
1047 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1048 |
ob_start();
|
1049 |
$result = $this->mmb_exec($command);
|
1050 |
ob_get_clean();
|
@@ -1140,7 +1175,6 @@ class MMB_Backup extends MMB_Core {
|
|
1140 |
if (empty($args)) {
|
1141 |
return false;
|
1142 |
}
|
1143 |
-
|
1144 |
extract($args);
|
1145 |
if (isset($google_drive_token)) {
|
1146 |
$this->tasks[$task_name]['task_args']['account_info']['mwp_google_drive']['google_drive_token'] = $google_drive_token;
|
@@ -1227,7 +1261,10 @@ class MMB_Backup extends MMB_Core {
|
|
1227 |
if (!copy(ABSPATH . 'wp-config.php', ABSPATH . 'mwp-temp-wp-config.php')) {
|
1228 |
@unlink($backup_file);
|
1229 |
return array(
|
1230 |
-
'error' => 'Error creating wp-config
|
|
|
|
|
|
|
1231 |
);
|
1232 |
}
|
1233 |
|
@@ -1246,14 +1283,15 @@ class MMB_Backup extends MMB_Core {
|
|
1246 |
$clone_options['upload_path'] = get_option('upload_path');
|
1247 |
$clone_options['upload_url_path'] = get_option('upload_url_path');
|
1248 |
|
1249 |
-
$clone_options['mwp_backup_tasks'] =
|
1250 |
-
$clone_options['mwp_notifications'] =
|
1251 |
-
$clone_options['mwp_pageview_alerts'] =
|
1252 |
} else {
|
1253 |
$restore_options = array();
|
1254 |
$restore_options['mwp_notifications'] = get_option('mwp_notifications');
|
1255 |
$restore_options['mwp_pageview_alerts'] = get_option('mwp_pageview_alerts');
|
1256 |
$restore_options['user_hit_count'] = get_option('user_hit_count');
|
|
|
1257 |
}
|
1258 |
|
1259 |
chdir(ABSPATH);
|
@@ -1384,14 +1422,18 @@ class MMB_Backup extends MMB_Core {
|
|
1384 |
//Remove hit count
|
1385 |
$query = "DELETE FROM " . $new_table_prefix . "options WHERE option_name = 'user_hit_count'";
|
1386 |
$wpdb->query($query);
|
1387 |
-
|
|
|
|
|
|
|
|
|
1388 |
//Check for .htaccess permalinks update
|
1389 |
$this->replace_htaccess($home);
|
1390 |
} else {
|
1391 |
//restore worker options
|
1392 |
if (is_array($restore_options) && !empty($restore_options)) {
|
1393 |
foreach ($restore_options as $key => $option) {
|
1394 |
-
|
1395 |
}
|
1396 |
}
|
1397 |
}
|
@@ -1493,27 +1535,15 @@ class MMB_Backup extends MMB_Core {
|
|
1493 |
* @return bool optimized successfully or not
|
1494 |
*/
|
1495 |
function optimize_tables() {
|
1496 |
-
|
1497 |
-
$
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
'
|
1502 |
-
|
1503 |
-
'HEAP',
|
1504 |
-
'MEMORY',
|
1505 |
-
'ARCHIVE'
|
1506 |
-
)))
|
1507 |
-
$table_string .= $table['Name'] . ",";
|
1508 |
-
elseif ($table['Engine'] == 'InnoDB') {
|
1509 |
-
$optimize = $wpdb->query("ALTER TABLE {$table['Name']} ENGINE=InnoDB");
|
1510 |
}
|
1511 |
}
|
1512 |
-
|
1513 |
-
$table_string = rtrim($table_string);
|
1514 |
-
$optimize = $wpdb->query("OPTIMIZE TABLE $table_string");
|
1515 |
-
|
1516 |
-
return $optimize ? true : false;
|
1517 |
}
|
1518 |
|
1519 |
/**
|
@@ -2121,8 +2151,10 @@ class MMB_Backup extends MMB_Core {
|
|
2121 |
'partial' => 1
|
2122 |
);
|
2123 |
}
|
|
|
2124 |
}
|
2125 |
-
|
|
|
2126 |
/**
|
2127 |
* Deletes backup file from Amazon S3.
|
2128 |
*
|
@@ -2990,6 +3022,7 @@ class MMB_Backup extends MMB_Core {
|
|
2990 |
unset($tasks[$task_name]['task_results'][count($tasks[$task_name]['task_results']) - 1]['server']);
|
2991 |
}
|
2992 |
$this->update_tasks($tasks);
|
|
|
2993 |
} else {
|
2994 |
$return = array(
|
2995 |
'error' => 'Backup file not found on your server. Please try again.'
|
@@ -3263,4 +3296,4 @@ if (!function_exists('get_all_files_from_dir_recursive')) {
|
|
3263 |
}
|
3264 |
}
|
3265 |
|
3266 |
-
?>
|
799 |
ob_start();
|
800 |
$command = "$zip -q -j $comp_level $backup_file .* * $exclude_file_data";
|
801 |
$this->_log("Executing $command");
|
802 |
+
if($exclude_data==="-x")
|
803 |
+
{
|
804 |
+
$exclude_data="";
|
805 |
+
}
|
806 |
$result_f = $this->mmb_exec($command, false, true);
|
807 |
if (!$result_f || $result_f == 18) { // disregard permissions error, file can't be accessed
|
808 |
$command = "$zip -q -r $comp_level $backup_file $include_data $exclude_data";
|
1048 |
global $wpdb;
|
1049 |
$paths = $this->check_mysql_paths();
|
1050 |
$brace = (substr(PHP_OS, 0, 3) == 'WIN') ? '"' : '';
|
1051 |
+
//should use --result-file=file_name instead of >
|
1052 |
+
$host = '--host="';
|
1053 |
+
$hostname = '';
|
1054 |
+
$socketname = '';
|
1055 |
+
if(strpos(DB_HOST,':')!==false)
|
1056 |
+
{
|
1057 |
+
$host_sock = split(':',DB_HOST);
|
1058 |
+
$hostname = $host_sock[0];
|
1059 |
+
$socketname = $host_sock[1];
|
1060 |
+
$port = intval($host_sock[1]);
|
1061 |
+
if($port===0){
|
1062 |
+
$command = "%s --force --host=%s --socket=%s --user=%s --password=%s --add-drop-table --skip-lock-tables %s --result-file=%s";
|
1063 |
+
$command = sprintf($command, $paths['mysqldump'], escapeshellarg($hostname), escapeshellarg($socketname), escapeshellarg(DB_USER), escapeshellarg(DB_PASSWORD), escapeshellarg(DB_NAME),escapeshellarg($file));
|
1064 |
+
|
1065 |
+
}
|
1066 |
+
else
|
1067 |
+
{
|
1068 |
+
$command = "%s --force --host=%s --port=%s --user=%s --password=%s --add-drop-table --skip-lock-tables %s --result-file=%s";
|
1069 |
+
$command = sprintf($command, $paths['mysqldump'], escapeshellarg($hostname),escapeshellarg($port), escapeshellarg(DB_USER), escapeshellarg(DB_PASSWORD), escapeshellarg(DB_NAME),escapeshellarg($file));
|
1070 |
+
|
1071 |
+
}
|
1072 |
+
//$command = sprintf($command, $paths['mysqldump'], escapeshellarg($hostname), escapeshellarg($socketname), escapeshellarg(DB_USER), escapeshellarg(DB_PASSWORD), escapeshellarg(DB_NAME),escapeshellarg($file));
|
1073 |
+
}
|
1074 |
+
else
|
1075 |
+
{
|
1076 |
+
$hostname = DB_HOST;
|
1077 |
+
$command = "%s --force --host=%s --user=%s --password=%s --add-drop-table --skip-lock-tables %s --result-file=%s";
|
1078 |
+
$command = sprintf($command, $paths['mysqldump'], escapeshellarg($hostname), escapeshellarg(DB_USER), escapeshellarg(DB_PASSWORD), escapeshellarg(DB_NAME),escapeshellarg($file));
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
|
1082 |
+
//$command = $brace . $paths['mysqldump'] . $brace . ' --force --host="' . DB_HOST . '" --user="' . DB_USER . '" --password="' . DB_PASSWORD . '" --add-drop-table --skip-lock-tables "' . DB_NAME . '" > ' . $brace . $file . $brace;
|
1083 |
ob_start();
|
1084 |
$result = $this->mmb_exec($command);
|
1085 |
ob_get_clean();
|
1175 |
if (empty($args)) {
|
1176 |
return false;
|
1177 |
}
|
|
|
1178 |
extract($args);
|
1179 |
if (isset($google_drive_token)) {
|
1180 |
$this->tasks[$task_name]['task_args']['account_info']['mwp_google_drive']['google_drive_token'] = $google_drive_token;
|
1261 |
if (!copy(ABSPATH . 'wp-config.php', ABSPATH . 'mwp-temp-wp-config.php')) {
|
1262 |
@unlink($backup_file);
|
1263 |
return array(
|
1264 |
+
'error' => 'Error creating wp-config file.
|
1265 |
+
Please check if your WordPress installation folder has correct permissions to allow writing files.
|
1266 |
+
In most cases permissions should be 755 but occasionally it\'s required to put 777.
|
1267 |
+
If you are unsure on how to do this yourself, you can ask your hosting provider for help.'
|
1268 |
);
|
1269 |
}
|
1270 |
|
1283 |
$clone_options['upload_path'] = get_option('upload_path');
|
1284 |
$clone_options['upload_url_path'] = get_option('upload_url_path');
|
1285 |
|
1286 |
+
$clone_options['mwp_backup_tasks'] = maybe_serialize(get_option('mwp_backup_tasks'));
|
1287 |
+
$clone_options['mwp_notifications'] = maybe_serialize(get_option('mwp_notifications'));
|
1288 |
+
$clone_options['mwp_pageview_alerts'] = maybe_serialize(get_option('mwp_pageview_alerts'));
|
1289 |
} else {
|
1290 |
$restore_options = array();
|
1291 |
$restore_options['mwp_notifications'] = get_option('mwp_notifications');
|
1292 |
$restore_options['mwp_pageview_alerts'] = get_option('mwp_pageview_alerts');
|
1293 |
$restore_options['user_hit_count'] = get_option('user_hit_count');
|
1294 |
+
$restore_options['mwp_backup_tasks'] = get_option('mwp_backup_tasks');
|
1295 |
}
|
1296 |
|
1297 |
chdir(ABSPATH);
|
1422 |
//Remove hit count
|
1423 |
$query = "DELETE FROM " . $new_table_prefix . "options WHERE option_name = 'user_hit_count'";
|
1424 |
$wpdb->query($query);
|
1425 |
+
|
1426 |
+
//Restore previous backups
|
1427 |
+
|
1428 |
+
$wpdb->query("UPDATE " . $new_table_prefix . "options SET option_value = ".serialize($current_tasks_tmp)." WHERE option_name = 'mwp_backup_tasks'");
|
1429 |
+
|
1430 |
//Check for .htaccess permalinks update
|
1431 |
$this->replace_htaccess($home);
|
1432 |
} else {
|
1433 |
//restore worker options
|
1434 |
if (is_array($restore_options) && !empty($restore_options)) {
|
1435 |
foreach ($restore_options as $key => $option) {
|
1436 |
+
$result = $wpdb->update( $wpdb->options, array( 'option_value' => maybe_serialize($option) ), array( 'option_name' => $key ) );
|
1437 |
}
|
1438 |
}
|
1439 |
}
|
1535 |
* @return bool optimized successfully or not
|
1536 |
*/
|
1537 |
function optimize_tables() {
|
1538 |
+
$local_query = 'SHOW TABLE STATUS FROM `'. DB_NAME.'`';
|
1539 |
+
$result = mysql_query($local_query);
|
1540 |
+
if (mysql_num_rows($result)){
|
1541 |
+
while ($row = mysql_fetch_array($result))
|
1542 |
+
{
|
1543 |
+
$local_query = 'OPTIMIZE TABLE '.$row[0];
|
1544 |
+
$resultat = mysql_query($local_query);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1545 |
}
|
1546 |
}
|
|
|
|
|
|
|
|
|
|
|
1547 |
}
|
1548 |
|
1549 |
/**
|
2151 |
'partial' => 1
|
2152 |
);
|
2153 |
}
|
2154 |
+
|
2155 |
}
|
2156 |
+
|
2157 |
+
|
2158 |
/**
|
2159 |
* Deletes backup file from Amazon S3.
|
2160 |
*
|
3022 |
unset($tasks[$task_name]['task_results'][count($tasks[$task_name]['task_results']) - 1]['server']);
|
3023 |
}
|
3024 |
$this->update_tasks($tasks);
|
3025 |
+
$return = $tasks[$task_name];
|
3026 |
} else {
|
3027 |
$return = array(
|
3028 |
'error' => 'Backup file not found on your server. Please try again.'
|
3296 |
}
|
3297 |
}
|
3298 |
|
3299 |
+
?>
|
comment.class.php
CHANGED
@@ -103,11 +103,11 @@ class MMB_Comment extends MMB_Core
|
|
103 |
"comment_author_url" => $comments_info->comment_author_url,
|
104 |
"comment_author_IP" => $comments_info->comment_author_IP,
|
105 |
"comment_date" => $comments_info->comment_date,
|
106 |
-
"comment_content" => $comments_info->comment_content,
|
107 |
"comment_approved" => $comments_info->comment_approved,
|
108 |
"comment_parent" => $comments_info->comment_parent,
|
109 |
"comment_parent_author" => $comment_parent_author,
|
110 |
-
"post_title" => $comments_info->post_title,
|
111 |
"post_type" => $comments_info->post_type,
|
112 |
"guid" => $comments_info->guid,
|
113 |
"comment_total_approved" => $comment_total_approved,
|
@@ -232,11 +232,11 @@ class MMB_Comment extends MMB_Core
|
|
232 |
"comment_author_url" => $admins->user_url,
|
233 |
"comment_author_IP" => $_SERVER['REMOTE_ADDR'],
|
234 |
"comment_date" => $now,
|
235 |
-
"comment_content" => $reply_text,
|
236 |
"comment_approved" => '1',
|
237 |
"comment_parent" => $comment_id,
|
238 |
"comment_parent_author" => $comment_parent_author,
|
239 |
-
"post_title" => $select_parent_author_res->post_title,
|
240 |
"post_type" => $select_parent_author_res->post_type,
|
241 |
"guid" => $select_parent_author_res->guid,
|
242 |
"comment_total_approved" => $comment_total_approved,
|
@@ -249,4 +249,4 @@ class MMB_Comment extends MMB_Core
|
|
249 |
}
|
250 |
|
251 |
}
|
252 |
-
?>
|
103 |
"comment_author_url" => $comments_info->comment_author_url,
|
104 |
"comment_author_IP" => $comments_info->comment_author_IP,
|
105 |
"comment_date" => $comments_info->comment_date,
|
106 |
+
"comment_content" => htmlspecialchars($comments_info->comment_content),
|
107 |
"comment_approved" => $comments_info->comment_approved,
|
108 |
"comment_parent" => $comments_info->comment_parent,
|
109 |
"comment_parent_author" => $comment_parent_author,
|
110 |
+
"post_title" => htmlspecialchars($comments_info->post_title),
|
111 |
"post_type" => $comments_info->post_type,
|
112 |
"guid" => $comments_info->guid,
|
113 |
"comment_total_approved" => $comment_total_approved,
|
232 |
"comment_author_url" => $admins->user_url,
|
233 |
"comment_author_IP" => $_SERVER['REMOTE_ADDR'],
|
234 |
"comment_date" => $now,
|
235 |
+
"comment_content" => htmlspecialchars($reply_text),
|
236 |
"comment_approved" => '1',
|
237 |
"comment_parent" => $comment_id,
|
238 |
"comment_parent_author" => $comment_parent_author,
|
239 |
+
"post_title" => htmlspecialchars($select_parent_author_res->post_title),
|
240 |
"post_type" => $select_parent_author_res->post_type,
|
241 |
"guid" => $select_parent_author_res->guid,
|
242 |
"comment_total_approved" => $comment_total_approved,
|
249 |
}
|
250 |
|
251 |
}
|
252 |
+
?>
|
core.class.php
CHANGED
@@ -141,10 +141,20 @@ class MMB_Core extends MMB_Helper
|
|
141 |
if ($mwp_worker_brand == false || (is_array($mwp_worker_brand) && !array_key_exists('hide_managed_remotely', $mwp_worker_brand))) {
|
142 |
add_action('rightnow_end', array( &$this, 'add_right_now_info' ));
|
143 |
}
|
144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
add_action('admin_init', array(&$this,'admin_actions'));
|
146 |
add_action('init', array( &$this, 'mmb_remote_action'), 9999);
|
147 |
add_action('setup_theme', 'mmb_run_backup_action', 1);
|
|
|
148 |
add_action('setup_theme', 'mmb_parse_request');
|
149 |
add_action('set_auth_cookie', array( &$this, 'mmb_set_auth_cookie'));
|
150 |
add_action('set_logged_in_cookie', array( &$this, 'mmb_set_logged_in_cookie'));
|
@@ -222,11 +232,197 @@ class MMB_Core extends MMB_Helper
|
|
222 |
*/
|
223 |
function add_right_now_info()
|
224 |
{
|
225 |
-
|
226 |
-
|
227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
}
|
229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
/**
|
231 |
* Get parent blog options
|
232 |
*
|
@@ -672,4 +868,4 @@ class MMB_Core extends MMB_Helper
|
|
672 |
}
|
673 |
|
674 |
}
|
675 |
-
?>
|
141 |
if ($mwp_worker_brand == false || (is_array($mwp_worker_brand) && !array_key_exists('hide_managed_remotely', $mwp_worker_brand))) {
|
142 |
add_action('rightnow_end', array( &$this, 'add_right_now_info' ));
|
143 |
}
|
144 |
+
if ($mwp_worker_brand != false && is_array($mwp_worker_brand) && isset($mwp_worker_brand['text_for_client']) && ($mwp_worker_brand['email_or_link'] != 0)) {
|
145 |
+
add_action('admin_init', array($this, 'enqueue_scripts'));
|
146 |
+
add_action('admin_init', array($this, 'enqueue_styles'));
|
147 |
+
add_action('admin_menu', array($this, 'add_support_page'));
|
148 |
+
add_action('admin_head', array($this, 'support_page_script'));
|
149 |
+
add_action('admin_footer', array($this, 'support_page_dialog'));
|
150 |
+
add_action('admin_init', array($this, 'send_email_to_admin'));
|
151 |
+
}
|
152 |
+
add_action( 'plugins_loaded', array( &$this, 'dissalow_text_editor' ) );
|
153 |
+
|
154 |
add_action('admin_init', array(&$this,'admin_actions'));
|
155 |
add_action('init', array( &$this, 'mmb_remote_action'), 9999);
|
156 |
add_action('setup_theme', 'mmb_run_backup_action', 1);
|
157 |
+
add_action('plugins_loaded', 'mmb_authenticate', 1);
|
158 |
add_action('setup_theme', 'mmb_parse_request');
|
159 |
add_action('set_auth_cookie', array( &$this, 'mmb_set_auth_cookie'));
|
160 |
add_action('set_logged_in_cookie', array( &$this, 'mmb_set_logged_in_cookie'));
|
232 |
*/
|
233 |
function add_right_now_info()
|
234 |
{
|
235 |
+
$mwp_worker_brand = get_option('mwp_worker_brand');
|
236 |
+
echo '<div class="mmb-slave-info">';
|
237 |
+
if($mwp_worker_brand && isset($mwp_worker_brand['remotely_managed_text'])){
|
238 |
+
/*$url = isset($mwp_worker_brand['author_url']) ? $mwp_worker_brand['author_url'] : null;
|
239 |
+
if($url) {
|
240 |
+
$scheme = parse_url($mwp_worker_brand['author_url'], PHP_URL_SCHEME);
|
241 |
+
if(empty($scheme)) {
|
242 |
+
$url = 'http://' . $url;
|
243 |
+
}
|
244 |
+
}
|
245 |
+
if($url) {
|
246 |
+
$managedBy = '<a target="_blank" href="'.htmlspecialchars($url).'">'
|
247 |
+
.htmlspecialchars($mwp_worker_brand['author'])
|
248 |
+
.'</a>';
|
249 |
+
} else {
|
250 |
+
$managedBy = htmlspecialchars($mwp_worker_brand['author']);
|
251 |
+
}
|
252 |
+
echo sprintf('<p>This site is managed by %s.</p>', $managedBy);*/
|
253 |
+
echo '<p>'.$mwp_worker_brand['remotely_managed_text'].'</p>';
|
254 |
+
}else{
|
255 |
+
echo '<p>This site can be managed remotely.</p>';
|
256 |
+
}
|
257 |
+
echo '</div>';
|
258 |
}
|
259 |
+
|
260 |
+
function enqueue_scripts()
|
261 |
+
{
|
262 |
+
wp_enqueue_script('jquery');
|
263 |
+
wp_enqueue_script('jquery-ui-core');
|
264 |
+
wp_enqueue_script('jquery-ui-dialog');
|
265 |
+
}
|
266 |
+
|
267 |
+
function enqueue_styles()
|
268 |
+
{
|
269 |
+
wp_enqueue_style('wp-jquery-ui');
|
270 |
+
wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.css');
|
271 |
+
}
|
272 |
+
|
273 |
+
function send_email_to_admin(){
|
274 |
+
if(!isset($_POST['support_mwp_message'])) {
|
275 |
+
return;
|
276 |
+
}
|
277 |
+
global $current_user;
|
278 |
+
if (empty($_POST['support_mwp_message'])) {
|
279 |
+
$this->mwp_send_ajax_response(false, "Please enter a message.");
|
280 |
+
}
|
281 |
+
$mwp_worker_brand = get_option('mwp_worker_brand');
|
282 |
+
if(empty($mwp_worker_brand['admin_email'])) {
|
283 |
+
$this->mwp_send_ajax_response(false, "Unable to send email to admin.");
|
284 |
+
}
|
285 |
+
$subject = 'New ticket for site '.get_bloginfo('url');
|
286 |
+
$message = <<<EOF
|
287 |
+
Hi,
|
288 |
+
User with a username {$current_user->user_login} has a new question:
|
289 |
+
{$_POST['support_mwp_message']}
|
290 |
+
EOF;
|
291 |
+
$has_been_sent = wp_mail($mwp_worker_brand['admin_email'], $subject, $message);
|
292 |
+
if(!$has_been_sent) {
|
293 |
+
$this->mwp_send_ajax_response(false, "Unable to send email. Please try again.");
|
294 |
+
}
|
295 |
+
$this->mwp_send_ajax_response(true, "Message successfully sent.");
|
296 |
+
}
|
297 |
+
|
298 |
+
function mwp_send_ajax_response($success = true, $message = '')
|
299 |
+
{
|
300 |
+
$response = json_encode(array(
|
301 |
+
'success' => $success,
|
302 |
+
'message' => $message,
|
303 |
+
));
|
304 |
+
print $response;
|
305 |
+
exit;
|
306 |
+
}
|
307 |
+
|
308 |
+
function support_page_dialog()
|
309 |
+
{
|
310 |
+
$mwp_worker_brand = get_option('mwp_worker_brand');
|
311 |
+
if($mwp_worker_brand && isset($mwp_worker_brand['text_for_client']) && ($mwp_worker_brand['text_for_client'] != ''))
|
312 |
+
{
|
313 |
+
$notification_text = $mwp_worker_brand['text_for_client'];
|
314 |
+
}
|
315 |
+
?>
|
316 |
+
<div id="support_dialog" style="display: none;">
|
317 |
+
<div>
|
318 |
+
<p><?php echo $notification_text; ?></p>
|
319 |
+
</div>
|
320 |
+
<div style="margin: 19px 0 0;">
|
321 |
+
<?php
|
322 |
+
if($mwp_worker_brand['email_or_link'] == 1)
|
323 |
+
{
|
324 |
+
?>
|
325 |
+
<form method="post" id="support_form">
|
326 |
+
<textarea name="support_mwp_message" id="support_message" style="width:500px;height:150px;display:block;margin-left:auto;margin-right:auto;"></textarea>
|
327 |
+
<button type="submit" class="button-primary" style="display:block;margin:20px auto 7px auto;border:1px solid #a1a1a1;padding:0px 31px;border-radius: 4px;">Send</button>
|
328 |
+
</form>
|
329 |
+
<div id="support_response_id" style="margin-top: 14px"></div>
|
330 |
+
<style>
|
331 |
+
.ui-widget-overlay {
|
332 |
+
background-repeat: repeat;
|
333 |
+
}
|
334 |
+
</style>
|
335 |
+
</div>
|
336 |
+
<?php
|
337 |
+
}
|
338 |
+
else
|
339 |
+
{
|
340 |
+
}
|
341 |
+
echo '</div>';
|
342 |
+
}
|
343 |
+
|
344 |
+
function support_page_script()
|
345 |
+
{
|
346 |
+
?>
|
347 |
+
<script type="text/javascript">
|
348 |
+
jQuery(document).ready(function ($) {
|
349 |
+
var $dialog = $('#support_dialog');
|
350 |
+
var $form = $('#support_form');
|
351 |
+
var $messageContainer = $('#support_response_id');
|
352 |
+
$form.submit(function (e) {
|
353 |
+
e.preventDefault();
|
354 |
+
var data = $(this).serialize();
|
355 |
+
$.ajax({
|
356 |
+
type: "POST",
|
357 |
+
url: 'index.php',
|
358 |
+
dataType: 'json',
|
359 |
+
data: data,
|
360 |
+
success: function (data, textStatus, jqXHR) {
|
361 |
+
if(data.success) {
|
362 |
+
$form.slideUp();
|
363 |
+
}
|
364 |
+
$messageContainer.html(data.message);
|
365 |
+
},
|
366 |
+
error: function (jqXHR, textStatus, errorThrown){
|
367 |
+
$messageContainer.html('An error occurred, please try again.');
|
368 |
+
}
|
369 |
+
});
|
370 |
+
});
|
371 |
+
$('.toplevel_page_mwp-support').click(function (e) {
|
372 |
+
e.preventDefault();
|
373 |
+
$form.show();
|
374 |
+
$messageContainer.empty();
|
375 |
+
$dialog.dialog({
|
376 |
+
draggable: false,
|
377 |
+
resizable: false,
|
378 |
+
modal: true,
|
379 |
+
width: '530px',
|
380 |
+
height: 'auto',
|
381 |
+
title: 'Contact Support',
|
382 |
+
close: function(){
|
383 |
+
$('#support_response_id').html('');
|
384 |
+
$( this ).dialog( "destroy" );
|
385 |
+
}
|
386 |
+
});
|
387 |
+
});
|
388 |
+
});
|
389 |
+
</script>
|
390 |
+
<?php
|
391 |
+
}
|
392 |
+
|
393 |
+
/**
|
394 |
+
* Add Support page on Top Menu
|
395 |
+
*
|
396 |
+
*/
|
397 |
+
function add_support_page()
|
398 |
+
{
|
399 |
+
$mwp_worker_brand = get_option('mwp_worker_brand');
|
400 |
+
if ($mwp_worker_brand && isset($mwp_worker_brand['text_for_client']) && ($mwp_worker_brand['text_for_client'] != '')) {
|
401 |
+
add_menu_page(__('Support', 'wp-support'), __('Support', 'wp-support'), 'read', 'mwp-support', array(&$this, 'support_function'), '');
|
402 |
+
}
|
403 |
+
}
|
404 |
+
|
405 |
+
/**
|
406 |
+
* Support page handler
|
407 |
+
*
|
408 |
+
*/
|
409 |
+
function support_function()
|
410 |
+
{
|
411 |
+
}
|
412 |
+
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Remove editor from plugins&themes submenu page
|
416 |
+
*
|
417 |
+
*/
|
418 |
+
function dissalow_text_editor(){
|
419 |
+
$mwp_worker_brand = get_option('mwp_worker_brand');
|
420 |
+
if($mwp_worker_brand && isset($mwp_worker_brand['dissalow_edit']) && ($mwp_worker_brand['dissalow_edit'] == 'checked')){
|
421 |
+
define('DISALLOW_FILE_EDIT',true);
|
422 |
+
define('DISALLOW_FILE_MODS',true);
|
423 |
+
}
|
424 |
+
}
|
425 |
+
|
426 |
/**
|
427 |
* Get parent blog options
|
428 |
*
|
868 |
}
|
869 |
|
870 |
}
|
871 |
+
?>
|
init.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: ManageWP - Worker
|
|
4 |
Plugin URI: http://managewp.com/
|
5 |
Description: Manage Multiple WordPress sites from one dashboard. Visit <a href="https://managewp.com">ManageWP.com</a> to sign up.
|
6 |
Author: ManageWP
|
7 |
-
Version: 3.9.
|
8 |
Author URI: http://managewp.com
|
9 |
*/
|
10 |
|
@@ -22,7 +22,7 @@ if(basename($_SERVER['SCRIPT_FILENAME']) == "init.php"):
|
|
22 |
exit;
|
23 |
endif;
|
24 |
if(!defined('MMB_WORKER_VERSION'))
|
25 |
-
define('MMB_WORKER_VERSION', '3.9.
|
26 |
|
27 |
if ( !defined('MMB_XFRAME_COOKIE')){
|
28 |
$siteurl = function_exists( 'get_site_option' ) ? get_site_option( 'siteurl' ) : get_option( 'siteurl' );
|
@@ -116,99 +116,101 @@ if( !function_exists ( 'hex2bin' )) {
|
|
116 |
return $r;
|
117 |
}
|
118 |
}
|
119 |
-
if( !function_exists
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
|
|
|
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
}
|
213 |
/* Main response function */
|
214 |
if( !function_exists ( 'mmb_response' )) {
|
@@ -927,12 +929,20 @@ if( !function_exists ('mmb_get_users')) {
|
|
927 |
|
928 |
if( !function_exists ('mmb_edit_users')) {
|
929 |
function mmb_edit_users($params)
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
936 |
}
|
937 |
|
938 |
if( !function_exists ('mmb_get_posts')) {
|
@@ -1266,5 +1276,33 @@ if( isset($_COOKIE[MMB_XFRAME_COOKIE]) ){
|
|
1266 |
remove_action( 'admin_init', 'send_frame_options_header');
|
1267 |
remove_action( 'login_init', 'send_frame_options_header');
|
1268 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1269 |
|
1270 |
-
|
|
|
|
|
|
|
|
4 |
Plugin URI: http://managewp.com/
|
5 |
Description: Manage Multiple WordPress sites from one dashboard. Visit <a href="https://managewp.com">ManageWP.com</a> to sign up.
|
6 |
Author: ManageWP
|
7 |
+
Version: 3.9.26
|
8 |
Author URI: http://managewp.com
|
9 |
*/
|
10 |
|
22 |
exit;
|
23 |
endif;
|
24 |
if(!defined('MMB_WORKER_VERSION'))
|
25 |
+
define('MMB_WORKER_VERSION', '3.9.26');
|
26 |
|
27 |
if ( !defined('MMB_XFRAME_COOKIE')){
|
28 |
$siteurl = function_exists( 'get_site_option' ) ? get_site_option( 'siteurl' ) : get_option( 'siteurl' );
|
116 |
return $r;
|
117 |
}
|
118 |
}
|
119 |
+
if( !function_exists('mmb_authenticate')) {
|
120 |
+
function mmb_authenticate() {
|
121 |
+
global $_mwp_data, $_mwp_auth, $mmb_core;
|
122 |
+
if (!isset($HTTP_RAW_POST_DATA)) {
|
123 |
+
$HTTP_RAW_POST_DATA = file_get_contents('php://input');
|
124 |
+
}
|
125 |
+
if(substr($HTTP_RAW_POST_DATA, 0, 7) == "action="){
|
126 |
+
$HTTP_RAW_POST_DATA = str_replace("action=", "", $HTTP_RAW_POST_DATA);
|
127 |
+
}
|
128 |
+
$_mwp_data = base64_decode($HTTP_RAW_POST_DATA);
|
129 |
+
if (!$_mwp_data){
|
130 |
+
return;
|
131 |
+
}
|
132 |
+
$_mwp_data = mmb_parse_data( @unserialize($_mwp_data) );
|
133 |
+
|
134 |
+
if(empty($_mwp_data['action'])) {
|
135 |
+
return;
|
136 |
+
}
|
137 |
+
|
138 |
+
if (!$mmb_core->check_if_user_exists($_mwp_data['params']['username'])) {
|
139 |
+
mmb_response('Username <b>' . $_mwp_data['params']['username'] . '</b> does not have administrator capabilities. Please check the Admin username.', false);
|
140 |
+
}
|
141 |
+
|
142 |
+
if($_mwp_data['action'] === 'add_site') {
|
143 |
+
$_mwp_auth = true;
|
144 |
+
} else {
|
145 |
+
$_mwp_auth = $mmb_core->authenticate_message($_mwp_data['action'] . $_mwp_data['id'], $_mwp_data['signature'], $_mwp_data['id']);
|
146 |
+
}
|
147 |
+
|
148 |
+
if($_mwp_auth !== true) {
|
149 |
+
mmb_response($_mwp_auth['error'], false);
|
150 |
+
}
|
151 |
+
|
152 |
+
if(isset($_mwp_data['params']['username']) && !is_user_logged_in()){
|
153 |
+
$user = function_exists('get_user_by') ? get_user_by('login', $_mwp_data['params']['username']) : get_userdatabylogin( $_mwp_data['params']['username'] );
|
154 |
+
wp_set_current_user($user->ID);
|
155 |
+
}
|
156 |
+
}
|
157 |
+
}
|
158 |
|
159 |
+
if( !function_exists ( 'mmb_parse_request' )) {
|
160 |
+
function mmb_parse_request(){
|
161 |
+
global $mmb_core, $wp_db_version, $wpmu_version, $_wp_using_ext_object_cache, $_mwp_data, $_mwp_auth;
|
162 |
+
if(empty($_mwp_auth)) {
|
163 |
+
MMB_Stats::set_hit_count();
|
164 |
+
return;
|
165 |
+
}
|
166 |
+
ob_start();
|
167 |
+
$_wp_using_ext_object_cache = false;
|
168 |
+
@set_time_limit(600);
|
169 |
+
|
170 |
+
if ($_mwp_data['action'] === 'add_site') {
|
171 |
+
mmb_add_site($_mwp_data['params']);
|
172 |
+
mmb_response('You should never see this.', false);
|
173 |
+
}
|
174 |
+
|
175 |
+
/* in case database upgrade required, do database backup and perform upgrade ( wordpress wp_upgrade() function ) */
|
176 |
+
if( strlen(trim($wp_db_version)) && !defined('ACX_PLUGIN_DIR') ){
|
177 |
+
if ( get_option('db_version') != $wp_db_version ) {
|
178 |
+
/* in multisite network, please update database manualy */
|
179 |
+
if (empty($wpmu_version) || (function_exists('is_multisite') && !is_multisite())){
|
180 |
+
if( ! function_exists('wp_upgrade'))
|
181 |
+
include_once(ABSPATH.'wp-admin/includes/upgrade.php');
|
182 |
+
|
183 |
+
ob_clean();
|
184 |
+
@wp_upgrade();
|
185 |
+
@do_action('after_db_upgrade');
|
186 |
+
ob_end_clean();
|
187 |
+
}
|
188 |
+
}
|
189 |
+
}
|
190 |
+
|
191 |
+
if(isset($_mwp_data['params']['secure'])){
|
192 |
+
if($decrypted = $mmb_core->_secure_data($_mwp_data['params']['secure'])){
|
193 |
+
$decrypted = maybe_unserialize($decrypted);
|
194 |
+
if(is_array($decrypted)){
|
195 |
+
foreach($decrypted as $key => $val){
|
196 |
+
if(!is_numeric($key))
|
197 |
+
$_mwp_data['params'][$key] = $val;
|
198 |
+
}
|
199 |
+
unset($_mwp_data['params']['secure']);
|
200 |
+
} else $_mwp_data['params']['secure'] = $decrypted;
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
+
if( isset($_mwp_data['setting']) ){
|
205 |
+
$mmb_core->save_options( $_mwp_data['setting'] );
|
206 |
+
}
|
207 |
+
|
208 |
+
if( !$mmb_core->register_action_params( $_mwp_data['action'], $_mwp_data['params'] ) ){
|
209 |
+
global $_mmb_plugin_actions;
|
210 |
+
$_mmb_plugin_actions[$_mwp_data['action']] = $_mwp_data['params'];
|
211 |
+
}
|
212 |
+
ob_end_clean();
|
213 |
+
}
|
214 |
}
|
215 |
/* Main response function */
|
216 |
if( !function_exists ( 'mmb_response' )) {
|
929 |
|
930 |
if( !function_exists ('mmb_edit_users')) {
|
931 |
function mmb_edit_users($params)
|
932 |
+
{
|
933 |
+
global $mmb_core;
|
934 |
+
$mmb_core->get_user_instance();
|
935 |
+
$users = $mmb_core->user_instance->edit_users($params);
|
936 |
+
$response = 'User updated.';
|
937 |
+
$check_error = false;
|
938 |
+
foreach ($users as $username => $user) {
|
939 |
+
$check_error = array_key_exists('error', $user);
|
940 |
+
if($check_error){
|
941 |
+
$response = $username.': '.$user['error'];
|
942 |
+
}
|
943 |
+
}
|
944 |
+
mmb_response($response, !$check_error);
|
945 |
+
}
|
946 |
}
|
947 |
|
948 |
if( !function_exists ('mmb_get_posts')) {
|
1276 |
remove_action( 'admin_init', 'send_frame_options_header');
|
1277 |
remove_action( 'login_init', 'send_frame_options_header');
|
1278 |
}
|
1279 |
+
function mwp_error_handler($errno, $errstr, $errfile, $errline, $errcontext)
|
1280 |
+
{
|
1281 |
+
$errorId = 'mwp_error_' . md5($errfile . $errline);
|
1282 |
+
$error = sprintf("%s\nError [%s]: %s\nIn file: %s:%s", date('Y-m-d H:i:s'), $errno, $errstr, $errfile, $errline);
|
1283 |
+
set_transient($errorId, $error, 3600);
|
1284 |
+
}
|
1285 |
+
|
1286 |
+
function mwp_fatal_error_handler()
|
1287 |
+
{
|
1288 |
+
$isError = false;
|
1289 |
+
if ($error = error_get_last()) {
|
1290 |
+
switch ($error['type']) {
|
1291 |
+
case E_ERROR:
|
1292 |
+
case E_CORE_ERROR:
|
1293 |
+
case E_COMPILE_ERROR:
|
1294 |
+
case E_USER_ERROR:
|
1295 |
+
$isError = true;
|
1296 |
+
break;
|
1297 |
+
}
|
1298 |
+
}
|
1299 |
+
if ($isError) {
|
1300 |
+
mwp_error_handler($error['type'], $error['message'], $error['file'], $error['line'], array());
|
1301 |
+
}
|
1302 |
+
}
|
1303 |
|
1304 |
+
|
1305 |
+
if (get_option('mwp_debug_enable')) {
|
1306 |
+
set_error_handler('mwp_error_handler');
|
1307 |
+
register_shutdown_function('mwp_fatal_error_handler');
|
1308 |
+
}
|
installer.class.php
CHANGED
@@ -543,22 +543,22 @@ class MMB_Installer extends MMB_Core
|
|
543 |
}
|
544 |
}
|
545 |
|
546 |
-
if(!empty($themes)){
|
547 |
-
$updatethemes = $this->upgrade_themes(array_keys($themes));
|
548 |
-
if(!empty($updatethemes) && isset($updatethemes['upgraded'])){
|
549 |
-
foreach ($premium_update as $key => $update) {
|
550 |
-
$update = array_change_key_case($update, CASE_LOWER);
|
551 |
-
foreach($updatethemes['upgraded'] as $template => $upgrade){
|
552 |
-
if( isset($update['template']) && $update['template'] == $template) {
|
553 |
-
if( $upgrade == 1 )
|
554 |
-
unset($premium_update[$key]);
|
555 |
-
|
556 |
-
$pr_update['themes']['upgraded'][md5($update['name'])] = $upgrade;
|
557 |
-
}
|
558 |
-
}
|
559 |
-
}
|
560 |
-
}
|
561 |
-
}
|
562 |
|
563 |
//try direct install with overwrite
|
564 |
if(!empty($premium_update)){
|
543 |
}
|
544 |
}
|
545 |
|
546 |
+
// if(!empty($themes)){
|
547 |
+
// $updatethemes = $this->upgrade_themes(array_keys($themes));
|
548 |
+
// if(!empty($updatethemes) && isset($updatethemes['upgraded'])){
|
549 |
+
// foreach ($premium_update as $key => $update) {
|
550 |
+
// $update = array_change_key_case($update, CASE_LOWER);
|
551 |
+
// foreach($updatethemes['upgraded'] as $template => $upgrade){
|
552 |
+
// if( isset($update['template']) && $update['template'] == $template) {
|
553 |
+
// if( $upgrade == 1 )
|
554 |
+
// unset($premium_update[$key]);
|
555 |
+
//
|
556 |
+
// $pr_update['themes']['upgraded'][md5($update['name'])] = $upgrade;
|
557 |
+
// }
|
558 |
+
// }
|
559 |
+
// }
|
560 |
+
// }
|
561 |
+
// }
|
562 |
|
563 |
//try direct install with overwrite
|
564 |
if(!empty($premium_update)){
|
post.class.php
CHANGED
@@ -418,8 +418,10 @@ class MMB_Post extends MMB_Core
|
|
418 |
$success = false;
|
419 |
|
420 |
if(in_array($status, array('draft', 'publish', 'trash'))){
|
421 |
-
|
422 |
-
|
|
|
|
|
423 |
}
|
424 |
|
425 |
return $success;
|
@@ -523,7 +525,7 @@ class MMB_Post extends MMB_Core
|
|
523 |
|
524 |
$posts[]=array(
|
525 |
'post_id'=>$post_info->ID,
|
526 |
-
'post_title'
|
527 |
'post_name'=>$post_info->post_name,
|
528 |
'post_author'=>array('author_id'=>$post_info->post_author, 'author_name'=>$user_info[$post_info->post_author]),
|
529 |
'post_date'=>$post_info->post_date,
|
@@ -545,21 +547,17 @@ class MMB_Post extends MMB_Core
|
|
545 |
}
|
546 |
|
547 |
function delete_post($args){
|
548 |
-
global $wpdb;
|
549 |
if(!empty($args['post_id']) && !empty($args['action']))
|
550 |
{
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
}
|
561 |
-
$wpdb->get_results($delete_query);
|
562 |
-
|
563 |
return 'Post deleted.';
|
564 |
}
|
565 |
else
|
@@ -569,26 +567,23 @@ class MMB_Post extends MMB_Core
|
|
569 |
}
|
570 |
|
571 |
function delete_posts($args){
|
572 |
-
global $wpdb;
|
573 |
extract($args);
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
}
|
591 |
-
}
|
592 |
return "Post deleted";
|
593 |
|
594 |
}
|
@@ -674,7 +669,7 @@ class MMB_Post extends MMB_Core
|
|
674 |
|
675 |
$posts[]=array(
|
676 |
'post_id'=>$post_info->ID,
|
677 |
-
'post_title'
|
678 |
'post_name'=>$post_info->post_name,
|
679 |
'post_author'=>array('author_id'=>$post_info->post_author, 'author_name'=>$user_info[$post_info->post_author]),
|
680 |
'post_date'=>$post_info->post_date,
|
@@ -751,4 +746,4 @@ INNER JOIN $wpdb->terms ON ( $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id
|
|
751 |
return $users_authors;
|
752 |
}
|
753 |
}
|
754 |
-
?>
|
418 |
$success = false;
|
419 |
|
420 |
if(in_array($status, array('draft', 'publish', 'trash'))){
|
421 |
+
$edited_status = array('ID' => $post_id,
|
422 |
+
'post_status' => $status
|
423 |
+
);
|
424 |
+
$success = wp_update_post($edited_status);
|
425 |
}
|
426 |
|
427 |
return $success;
|
525 |
|
526 |
$posts[]=array(
|
527 |
'post_id'=>$post_info->ID,
|
528 |
+
'post_title'=>htmlspecialchars($post_info->post_title),
|
529 |
'post_name'=>$post_info->post_name,
|
530 |
'post_author'=>array('author_id'=>$post_info->post_author, 'author_name'=>$user_info[$post_info->post_author]),
|
531 |
'post_date'=>$post_info->post_date,
|
547 |
}
|
548 |
|
549 |
function delete_post($args){
|
|
|
550 |
if(!empty($args['post_id']) && !empty($args['action']))
|
551 |
{
|
552 |
+
if($args['action']=='delete' || $args['action']=='delete_restore'){
|
553 |
+
$action = ($args['action'] == 'delete') ? 'delete' : 'publish';
|
554 |
+
$edited_status = array('ID' => $args['post_id'],
|
555 |
+
'post_status' => $action
|
556 |
+
);
|
557 |
+
$success = wp_update_post($edited_status);
|
558 |
+
}else if($args['action']=='delete_perm'){
|
559 |
+
$success = wp_delete_post($args['post_id'], true);
|
560 |
+
}
|
|
|
|
|
|
|
561 |
return 'Post deleted.';
|
562 |
}
|
563 |
else
|
567 |
}
|
568 |
|
569 |
function delete_posts($args){
|
|
|
570 |
extract($args);
|
571 |
+
if($deleteaction == 'trash' || $deleteaction == 'draft' || $deleteaction == 'publish'){
|
572 |
+
foreach($args as $key=>$val){
|
573 |
+
if(!empty($val) && is_numeric($val)){
|
574 |
+
$edited_status = array('ID' => $val,
|
575 |
+
'post_status' => $deleteaction
|
576 |
+
);
|
577 |
+
$success = wp_update_post($edited_status);
|
578 |
+
}
|
579 |
+
}
|
580 |
+
}elseif($deleteaction == 'delete'){
|
581 |
+
foreach($args as $key=>$val){
|
582 |
+
if(!empty($val) && is_numeric($val)){
|
583 |
+
$success = wp_delete_post($val, true);
|
584 |
+
}
|
585 |
+
}
|
586 |
+
}
|
|
|
|
|
587 |
return "Post deleted";
|
588 |
|
589 |
}
|
669 |
|
670 |
$posts[]=array(
|
671 |
'post_id'=>$post_info->ID,
|
672 |
+
'post_title'=>htmlspecialchars($post_info->post_title),
|
673 |
'post_name'=>$post_info->post_name,
|
674 |
'post_author'=>array('author_id'=>$post_info->post_author, 'author_name'=>$user_info[$post_info->post_author]),
|
675 |
'post_date'=>$post_info->post_date,
|
746 |
return $users_authors;
|
747 |
}
|
748 |
}
|
749 |
+
?>
|
readme.txt
CHANGED
@@ -3,14 +3,14 @@ Contributors: freediver
|
|
3 |
Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=520781390
|
4 |
Tags: admin, analytics, administration, amazon, api, google drive, authentication, automatic, dashboard, dropbox, events, integration, manage, multsite, notification, performance, s3, security, seo, stats, tracking, managewp
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to: 3.
|
7 |
Stable tag: trunk
|
8 |
|
9 |
ManageWP Worker plugin allows you to remotely manage your WordPress sites from one dashboard.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
-
[ManageWP](https://managewp.com/ "Manage Multiple Blogs") is a revolutionary
|
14 |
|
15 |
Main features:
|
16 |
|
@@ -32,6 +32,14 @@ http://vimeo.com/61268162
|
|
32 |
Check out [ManageWP.com](http://managewp.com/ "Manage Multiple Blogs").
|
33 |
|
34 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
= 3.9.25 =
|
37 |
- New: Improved Worker branding feature
|
@@ -282,4 +290,4 @@ Make sure you use the latest version of the worker plugin on the site you are tr
|
|
282 |
|
283 |
= I have problems installing new plugins or upgrading WordPress through ManageWP =
|
284 |
|
285 |
-
ManageWP Worker relies on properly set file permissions on your server. See the [user guide](https://managewp.com/user-guide#ftp "ManageWP user guide") for more tips.
|
3 |
Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=520781390
|
4 |
Tags: admin, analytics, administration, amazon, api, google drive, authentication, automatic, dashboard, dropbox, events, integration, manage, multsite, notification, performance, s3, security, seo, stats, tracking, managewp
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 3.6
|
7 |
Stable tag: trunk
|
8 |
|
9 |
ManageWP Worker plugin allows you to remotely manage your WordPress sites from one dashboard.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
+
[ManageWP](https://managewp.com/ "Manage Multiple Blogs") is a revolutionary service that automates the management of multiple WordPress websites.
|
14 |
|
15 |
Main features:
|
16 |
|
32 |
Check out [ManageWP.com](http://managewp.com/ "Manage Multiple Blogs").
|
33 |
|
34 |
== Changelog ==
|
35 |
+
= 3.9.26 =
|
36 |
+
- New: Improved branding feature
|
37 |
+
- New: Disable Plugin and Theme changes for your clients
|
38 |
+
- New: Support Page for non-Admin Users
|
39 |
+
- New: Manage biographical info of user
|
40 |
+
- Fix: Restore backup action keeps all backup tasks and backups
|
41 |
+
- Fix: Add/delete post action uses WordPress hook
|
42 |
+
- Fix: Delete user action was not functioning properly
|
43 |
|
44 |
= 3.9.25 =
|
45 |
- New: Improved Worker branding feature
|
290 |
|
291 |
= I have problems installing new plugins or upgrading WordPress through ManageWP =
|
292 |
|
293 |
+
ManageWP Worker relies on properly set file permissions on your server. See the [user guide](https://managewp.com/user-guide#ftp "ManageWP user guide") for more tips.
|
stats.class.php
CHANGED
@@ -839,4 +839,3 @@ class MMB_Stats extends MMB_Core
|
|
839 |
if (function_exists('add_filter')) {
|
840 |
add_filter('mwp_website_add', 'MMB_Stats::readd_alerts');
|
841 |
}
|
842 |
-
?>
|
839 |
if (function_exists('add_filter')) {
|
840 |
add_filter('mwp_website_add', 'MMB_Stats::readd_alerts');
|
841 |
}
|
|
user.class.php
CHANGED
@@ -61,6 +61,9 @@ class MMB_User extends MMB_Core
|
|
61 |
$args = array();
|
62 |
$args['include'] = $include;
|
63 |
$args['fields'] = 'all_with_meta';
|
|
|
|
|
|
|
64 |
$temp_users = get_users($args);
|
65 |
$user = array();
|
66 |
foreach ((array)$temp_users as $temp){
|
@@ -150,6 +153,12 @@ class MMB_User extends MMB_Core
|
|
150 |
$result = array('error' => 'No role provided.');
|
151 |
}
|
152 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
case 'delete-user':
|
154 |
if($user != $username){
|
155 |
if(!$this->last_admin($user_obj)){
|
61 |
$args = array();
|
62 |
$args['include'] = $include;
|
63 |
$args['fields'] = 'all_with_meta';
|
64 |
+
if(!empty($username_filter)){
|
65 |
+
$args['search'] = $username_filter;
|
66 |
+
}
|
67 |
$temp_users = get_users($args);
|
68 |
$user = array();
|
69 |
foreach ((array)$temp_users as $temp){
|
153 |
$result = array('error' => 'No role provided.');
|
154 |
}
|
155 |
break;
|
156 |
+
case 'change-description':
|
157 |
+
$userdata = array();
|
158 |
+
$userdata['ID'] = $user_obj->ID;
|
159 |
+
$userdata['description'] = trim( $change_description );
|
160 |
+
$result = wp_update_user($userdata);
|
161 |
+
break;
|
162 |
case 'delete-user':
|
163 |
if($user != $username){
|
164 |
if(!$this->last_admin($user_obj)){
|
version
CHANGED
@@ -1 +1 @@
|
|
1 |
-
3.9.
|
1 |
+
3.9.26
|