ManageWP Worker - Version 3.9.1

Version Description

  • Support for sub-users (limited access users)
  • Bulk add user
  • 'Select all' feature for bulk posting
  • Featured image support for bulk posting
  • Reload button on the dashboard (on the top of the Right now widget) will now refresh information about available updates
  • Fixed a problem with the import tool
  • Fixed a problem when remote dashboard would not work for some servers
Download this release

Release Info

Developer freediver
Plugin Icon 128x128 ManageWP Worker
Version 3.9.1
Comparing to
See all releases

Code changes from version 3.9.0 to 3.9.1

Files changed (11) hide show
  1. backup.class.php +25 -16
  2. core.class.php +20 -4
  3. helper.class.php +52 -11
  4. index.html +0 -0
  5. init.php +26 -8
  6. link.class.php +2 -2
  7. plugins/cleanup/cleanup.php +29 -4
  8. readme.txt +12 -2
  9. stats.class.php +13 -2
  10. user.class.php +53 -0
  11. version +1 -1
backup.class.php CHANGED
@@ -19,6 +19,7 @@ class MMB_Backup extends MMB_Core
19
 
20
  function backup($args)
21
  {
 
22
  @ini_set('memory_limit', '300M');
23
  @set_time_limit(300);
24
  //type like manual, weekly, daily
@@ -44,10 +45,10 @@ class MMB_Backup extends MMB_Core
44
  if (trim($what) == 'full') {
45
  //take wp-content backup
46
  $content_backup = $this->backup_wpcontent($type);
47
- if (!$content_backup) {
48
  @unlink($content_backup['path']);
49
  return array(
50
- 'error' => 'Failed to backup wp-content.'
51
  );
52
  }
53
  }
@@ -70,9 +71,8 @@ class MMB_Backup extends MMB_Core
70
 
71
  // Get previous backup in tmp
72
  $worker_options = get_option('mmb-worker');
73
-
74
  $tmp_file = WP_CONTENT_DIR . '/' . basename($worker_options['backups'][$type]['path']);
75
-
76
  if (rename($worker_options['backups'][$type]['path'], $tmp_file)) {
77
  @unlink($worker_options['backups'][$type]['path']);
78
  }
@@ -147,7 +147,6 @@ class MMB_Backup extends MMB_Core
147
  $worker_options['backups'][$type]['url'] = $backup_url;
148
  update_option('mmb-worker', $worker_options);
149
 
150
-
151
  //Everything went fine, return backup url to master
152
  return $worker_options['backups'][$type]['url'];
153
  }
@@ -168,25 +167,23 @@ class MMB_Backup extends MMB_Core
168
  $result = $this->mmb_exec($command);
169
  ob_get_clean();
170
  $file_url = WP_CONTENT_URL . $file;
171
-
172
- if($result)
173
- {
174
  return array(
175
  'path' => $file_path,
176
  'url' => $file_url
177
  );
178
  }
179
- else
180
- {
181
- return false;
182
  }
183
 
184
 
185
  } else {
186
  require_once ABSPATH . '/wp-admin/includes/class-pclzip.php';
187
  $archive = new PclZip($file_path);
188
- $result = $archive->add(ABSPATH, PCLZIP_OPT_REMOVE_PATH, ABSPATH);
189
- $result = $archive->delete(PCLZIP_OPT_BY_NAME, $content_dir.'/'.$sec_string.'/');
 
190
  if ($result) {
191
  $file_url = WP_CONTENT_URL . $file;
192
  return array(
@@ -194,8 +191,15 @@ class MMB_Backup extends MMB_Core
194
  'url' => $file_url
195
  );
196
  }
 
197
  @unlink($file_path);
198
- return false;
 
 
 
 
 
 
199
  }
200
  }
201
 
@@ -278,7 +282,7 @@ class MMB_Backup extends MMB_Core
278
  $j = 1;
279
  foreach ($row as $value) {
280
  $value = addslashes($value);
281
- $value = ereg_replace("\n", "\\n", $value);
282
  $num_values == $j ? $dump_data .= "'" . $value . "'" : $dump_data .= "'" . $value . "', ";
283
  $j++;
284
  unset($value);
@@ -626,6 +630,7 @@ class MMB_Backup extends MMB_Core
626
  $pass = false;
627
  }
628
 
 
629
  if(is_writable(WP_CONTENT_DIR))
630
  {
631
  $reqs['Backup Folder']['status'] = "writable";
@@ -637,6 +642,11 @@ class MMB_Backup extends MMB_Core
637
  $reqs['Backup Folder']['pass'] = false;
638
  }
639
 
 
 
 
 
 
640
  if($func = $this->check_sys())
641
  {
642
  $reqs['Execute Function']['status'] =$func;
@@ -685,7 +695,6 @@ class MMB_Backup extends MMB_Core
685
  }
686
 
687
 
688
-
689
  return $reqs;
690
  }
691
 
19
 
20
  function backup($args)
21
  {
22
+
23
  @ini_set('memory_limit', '300M');
24
  @set_time_limit(300);
25
  //type like manual, weekly, daily
45
  if (trim($what) == 'full') {
46
  //take wp-content backup
47
  $content_backup = $this->backup_wpcontent($type);
48
+ if (array_key_exists('error',$content_backup)) {
49
  @unlink($content_backup['path']);
50
  return array(
51
+ 'error' => $content_backup['error']
52
  );
53
  }
54
  }
71
 
72
  // Get previous backup in tmp
73
  $worker_options = get_option('mmb-worker');
 
74
  $tmp_file = WP_CONTENT_DIR . '/' . basename($worker_options['backups'][$type]['path']);
75
+
76
  if (rename($worker_options['backups'][$type]['path'], $tmp_file)) {
77
  @unlink($worker_options['backups'][$type]['path']);
78
  }
147
  $worker_options['backups'][$type]['url'] = $backup_url;
148
  update_option('mmb-worker', $worker_options);
149
 
 
150
  //Everything went fine, return backup url to master
151
  return $worker_options['backups'][$type]['url'];
152
  }
167
  $result = $this->mmb_exec($command);
168
  ob_get_clean();
169
  $file_url = WP_CONTENT_URL . $file;
170
+ if($result){
 
 
171
  return array(
172
  'path' => $file_path,
173
  'url' => $file_url
174
  );
175
  }
176
+ else{
177
+ return array('error' => 'Failed to backup site. Try to enable Zip Command on your server.');
 
178
  }
179
 
180
 
181
  } else {
182
  require_once ABSPATH . '/wp-admin/includes/class-pclzip.php';
183
  $archive = new PclZip($file_path);
184
+ $result = $archive->add(ABSPATH, PCLZIP_OPT_REMOVE_PATH, ABSPATH);
185
+ //$result = $archive->delete(PCLZIP_OPT_BY_NAME, $content_dir.'/'.$sec_string.'/');
186
+ $this->_log($archive);
187
  if ($result) {
188
  $file_url = WP_CONTENT_URL . $file;
189
  return array(
191
  'url' => $file_url
192
  );
193
  }
194
+ else {
195
  @unlink($file_path);
196
+ if($archive->error_code == '-10'){
197
+ return array('error' => 'Failed to zip backup file. Try increasing memory limit and/or free space on your server.');
198
+ }
199
+ else{
200
+ return array('error' => 'Failed to backup site. Try to enable Zip Command on your server.');
201
+ }
202
+ }
203
  }
204
  }
205
 
282
  $j = 1;
283
  foreach ($row as $value) {
284
  $value = addslashes($value);
285
+ $value = preg_replace("\n", "\\n", $value);
286
  $num_values == $j ? $dump_data .= "'" . $value . "'" : $dump_data .= "'" . $value . "', ";
287
  $j++;
288
  unset($value);
630
  $pass = false;
631
  }
632
 
633
+
634
  if(is_writable(WP_CONTENT_DIR))
635
  {
636
  $reqs['Backup Folder']['status'] = "writable";
642
  $reqs['Backup Folder']['pass'] = false;
643
  }
644
 
645
+ $sec_string = md5('mmb-worker');
646
+ $file = "/$sec_string/mwp_backups";
647
+ $file_path = WP_CONTENT_DIR . $file;
648
+ $reqs['Backup Folder']['status'].= ' ('.$file_path.')';
649
+
650
  if($func = $this->check_sys())
651
  {
652
  $reqs['Execute Function']['status'] =$func;
695
  }
696
 
697
 
 
698
  return $reqs;
699
  }
700
 
core.class.php CHANGED
@@ -22,14 +22,16 @@ class MMB_Core extends MMB_Helper
22
  var $post_instance;
23
  var $stats_instance;
24
  var $search_instance;
 
25
  var $user_instance;
26
  var $backup_instance;
27
  var $installer_instance;
 
28
 
29
 
30
  function __construct()
31
  {
32
- global $mmb_plugin_dir;
33
 
34
  $this->name = 'Manage Multiple Blogs';
35
  $this->slug = 'manage-multiple-blogs';
@@ -43,6 +45,15 @@ class MMB_Core extends MMB_Helper
43
  );
44
  $this->save_options();
45
  }
 
 
 
 
 
 
 
 
 
46
  add_action('rightnow_end', array(
47
  $this,
48
  'add_right_now_info'
@@ -58,14 +69,15 @@ class MMB_Core extends MMB_Helper
58
  add_action('init', array(
59
  $this,
60
  'automatic_login'
61
- ));
62
-
63
  if (!get_option('_worker_public_key'))
64
  add_action('admin_notices', array(
65
  $this,
66
  'admin_notice'
67
  ));
68
  }
 
69
  /**
70
  * Add notice to admin dashboard for security reasons
71
  *
@@ -353,15 +365,19 @@ class MMB_Core extends MMB_Helper
353
  */
354
  function automatic_login()
355
  {
 
356
  $where = ($_GET['mwp_goto']);
357
 
358
- if (!is_user_logged_in() && $_GET['auto_login']) {
 
359
  $signature = base64_decode($_GET['signature']);
360
  $message_id = trim($_GET['message_id']);
361
  $username = $_GET['username'];
362
 
363
  $auth = $this->authenticate_message($where . $message_id, $signature, $message_id);
364
  if ($auth === true) {
 
 
365
  $user = get_user_by('login', $username);
366
  $user_id = $user->ID;
367
  wp_set_current_user($user_id, $username);
22
  var $post_instance;
23
  var $stats_instance;
24
  var $search_instance;
25
+ var $links_instance;
26
  var $user_instance;
27
  var $backup_instance;
28
  var $installer_instance;
29
+ var $mmb_multisite = false;
30
 
31
 
32
  function __construct()
33
  {
34
+ global $mmb_plugin_dir, $wpmu_version, $blog_id;
35
 
36
  $this->name = 'Manage Multiple Blogs';
37
  $this->slug = 'manage-multiple-blogs';
45
  );
46
  $this->save_options();
47
  }
48
+
49
+ if (function_exists('is_multisite')){
50
+ if (is_multisite()) {
51
+ $this->mmb_multisite = $blog_id;
52
+ }
53
+ } else if (!empty($wpmu_version)) {
54
+ $this->mmb_multisite = $blog_id;
55
+ }
56
+
57
  add_action('rightnow_end', array(
58
  $this,
59
  'add_right_now_info'
69
  add_action('init', array(
70
  $this,
71
  'automatic_login'
72
+ ));
73
+
74
  if (!get_option('_worker_public_key'))
75
  add_action('admin_notices', array(
76
  $this,
77
  'admin_notice'
78
  ));
79
  }
80
+
81
  /**
82
  * Add notice to admin dashboard for security reasons
83
  *
365
  */
366
  function automatic_login()
367
  {
368
+ global $current_user;
369
  $where = ($_GET['mwp_goto']);
370
 
371
+ if ((!is_user_logged_in() || $_GET['username'] != $current_user->user_login) && $_GET['auto_login']) {
372
+
373
  $signature = base64_decode($_GET['signature']);
374
  $message_id = trim($_GET['message_id']);
375
  $username = $_GET['username'];
376
 
377
  $auth = $this->authenticate_message($where . $message_id, $signature, $message_id);
378
  if ($auth === true) {
379
+ if(isset($current_user->user_login))
380
+ do_action('wp_logout');
381
  $user = get_user_by('login', $username);
382
  $user_id = $user->ID;
383
  wp_set_current_user($user_id, $username);
helper.class.php CHANGED
@@ -31,7 +31,7 @@ class MMB_Helper
31
  fwrite($handle, $mixed . PHP_EOL);
32
  fclose($handle);
33
  }
34
-
35
  function _escape(&$array)
36
  {
37
  global $wpdb;
@@ -82,11 +82,14 @@ class MMB_Helper
82
  if (!$option_name || !$data) {
83
  return false;
84
  }
 
 
 
85
  global $mmb_wp_version;
86
 
87
- if (version_compare($mmb_wp_version, '2.8.0', '<')) {
88
  update_option($option_name, $data);
89
- } else if (version_compare($mmb_wp_version, '3.0.0', '<')) {
90
  update_option('_transient_' . $option_name, $data);
91
  } else {
92
  update_option('_site_transient_' . $option_name, $data);
@@ -98,15 +101,18 @@ class MMB_Helper
98
  if (trim($option_name) == '') {
99
  return FALSE;
100
  }
101
-
 
 
102
  global $mmb_wp_version;
 
103
 
104
- if (version_compare($mmb_wp_version, '2.8.0', '<')) {
105
- return get_option($option_name);
106
- } else if (version_compare($mmb_wp_version, '3.0.0', '<')) {
107
- return get_option('_transient_' . $option_name);
108
  } else {
109
- return get_option('_site_transient_' . $option_name);
110
  }
111
  }
112
 
@@ -118,15 +124,50 @@ class MMB_Helper
118
 
119
  global $mmb_wp_version;
120
 
121
- if (version_compare($mmb_wp_version, '2.8.0', '<')) {
122
  delete_option($option_name);
123
- } else if (version_compare($mmb_wp_version, '3.0.0', '<')) {
124
  delete_option('_transient_' . $option_name);
125
  } else {
126
  delete_option('_site_transient_' . $option_name);
127
  }
128
  }
129
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  function delete_temp_dir($directory)
131
  {
132
  if (substr($directory, -1) == "/") {
31
  fwrite($handle, $mixed . PHP_EOL);
32
  fclose($handle);
33
  }
34
+
35
  function _escape(&$array)
36
  {
37
  global $wpdb;
82
  if (!$option_name || !$data) {
83
  return false;
84
  }
85
+ if($this->mmb_multisite)
86
+ return $this->mmb_set_sitemeta_transient($option_name, $data);
87
+
88
  global $mmb_wp_version;
89
 
90
+ if (version_compare($mmb_wp_version, '2.7.9', '<=')) {
91
  update_option($option_name, $data);
92
+ } else if (version_compare($mmb_wp_version, '2.9.9', '<=')) {
93
  update_option('_transient_' . $option_name, $data);
94
  } else {
95
  update_option('_site_transient_' . $option_name, $data);
101
  if (trim($option_name) == '') {
102
  return FALSE;
103
  }
104
+ if($this->mmb_multisite)
105
+ return $this->mmb_get_sitemeta_transient($option_name);
106
+
107
  global $mmb_wp_version;
108
+
109
 
110
+ if (version_compare($mmb_wp_version, '2.7.9', '<=')) {
111
+ return get_option($option_name);
112
+ } else if (version_compare($mmb_wp_version, '2.9.9', '<=')) {
113
+ return get_option('_transient_' . $option_name);
114
  } else {
115
+ return get_option('_site_transient_' . $option_name);
116
  }
117
  }
118
 
124
 
125
  global $mmb_wp_version;
126
 
127
+ if (version_compare($mmb_wp_version, '2.7.9', '<=')) {
128
  delete_option($option_name);
129
+ } else if (version_compare($mmb_wp_version, '2.9.9', '<=')) {
130
  delete_option('_transient_' . $option_name);
131
  } else {
132
  delete_option('_site_transient_' . $option_name);
133
  }
134
  }
135
 
136
+ function mmb_get_sitemeta_transient($option_name){
137
+ global $wpdb;
138
+ $option_name = '_site_transient_'. $option_name;
139
+
140
+ $result = $wpdb->get_var( $wpdb->prepare("SELECT `meta_value` FROM `{$wpdb->sitemeta}` WHERE meta_key = '{$option_name}' AND `site_id` = '{$this->mmb_multisite}' "));
141
+ $result = maybe_unserialize($result);
142
+ return $result;
143
+ }
144
+
145
+ function mmb_set_sitemeta_transient($option_name, $option_value){
146
+ global $wpdb;
147
+ $option_name = '_site_transient_'. $option_name;
148
+
149
+ if($this->mmb_get_sitemeta_transient($option_name)){
150
+ $result = $wpdb->update( $wpdb->sitemeta,
151
+ array(
152
+ 'meta_value' => maybe_serialize($option_value)
153
+ ),
154
+ array(
155
+ 'meta_key' => $option_name,
156
+ 'site_id' => $this->mmb_multisite
157
+ )
158
+ );
159
+ }else {
160
+ $result = $wpdb->insert( $wpdb->sitemeta,
161
+ array(
162
+ 'meta_key' => $option_name,
163
+ 'meta_value' => maybe_serialize($option_value),
164
+ 'site_id' => $this->mmb_multisite
165
+ )
166
+ );
167
+ }
168
+ return $result;
169
+ }
170
+
171
  function delete_temp_dir($directory)
172
  {
173
  if (substr($directory, -1) == "/") {
index.html DELETED
File without changes
init.php CHANGED
@@ -2,9 +2,9 @@
2
  /*
3
  Plugin Name: ManageWP - Worker
4
  Plugin URI: http://managewp.com/
5
- Description: Manage all your blogs from one dashboard
6
  Author: Prelovac Media
7
- Version: 3.9.0
8
  Author URI: http://www.prelovac.com
9
  */
10
 
@@ -20,7 +20,7 @@ Author URI: http://www.prelovac.com
20
  **************************************************************/
21
 
22
 
23
- define('MMB_WORKER_VERSION', '3.9.0');
24
 
25
  global $wpdb, $mmb_plugin_dir, $mmb_plugin_url;
26
 
@@ -51,6 +51,7 @@ $mmb_actions = array(
51
  'install_addon' => 'mmb_install_addon',
52
  'do_upgrade' => 'mmb_do_upgrade',
53
  'add_link' => 'mmb_add_link',
 
54
  'email_backup' => 'mmb_email_backup',
55
  'check_backup_compat' => 'mmb_check_backup_compat',
56
  'execute_php_code' => 'mmb_execute_php_code'
@@ -64,6 +65,7 @@ require_once("$mmb_plugin_dir/stats.class.php");
64
  require_once("$mmb_plugin_dir/backup.class.php");
65
  require_once("$mmb_plugin_dir/installer.class.php");
66
  require_once("$mmb_plugin_dir/link.class.php");
 
67
  require_once("$mmb_plugin_dir/api.php");
68
 
69
  require_once("$mmb_plugin_dir/plugins/search/search.php");
@@ -75,6 +77,7 @@ require_once("$mmb_plugin_dir/plugins/cleanup/cleanup.php");
75
  $mmb_core = new MMB_Core();
76
  if( microtime(true) - (double)get_option('mwp_iframe_options_header') < 3600 ){
77
  remove_action( 'admin_init', 'send_frame_options_header');
 
78
  }
79
 
80
  add_action('init', 'mmb_parse_request');
@@ -108,10 +111,11 @@ function mmb_parse_request()
108
  $num = @extract(unserialize($data));
109
 
110
  if ($action) {
111
- global $wp_object_cache;
112
-
113
- if(!empty($wp_object_cache))
114
- @$wp_object_cache->flush();
 
115
 
116
  update_option('mwp_iframe_options_header', microtime(true));
117
  // mmb_response($mmb_actions, false);
@@ -152,7 +156,7 @@ function mmb_response($response = false, $success = true)
152
  $return['error'] = $response;
153
 
154
  if( !headers_sent() ){
155
- ob_start("ob_gzhandler");
156
  header('Content-Type: text/plain');
157
  }
158
  exit("<MWPHEADER>" . base64_encode(serialize($return))."<ENDMWPHEADER>");
@@ -443,6 +447,20 @@ function mmb_add_link($params)
443
 
444
  }
445
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
446
  function mmb_iframe_plugins_fix($update_actions)
447
  {
448
  foreach($update_actions as $key => $action)
2
  /*
3
  Plugin Name: ManageWP - Worker
4
  Plugin URI: http://managewp.com/
5
+ Description: Manage all your blogs from one dashboard. Visit <a href="http://managewp.com">ManageWP.com</a> to sign up.
6
  Author: Prelovac Media
7
+ Version: 3.9.1
8
  Author URI: http://www.prelovac.com
9
  */
10
 
20
  **************************************************************/
21
 
22
 
23
+ define('MMB_WORKER_VERSION', '3.9.1');
24
 
25
  global $wpdb, $mmb_plugin_dir, $mmb_plugin_url;
26
 
51
  'install_addon' => 'mmb_install_addon',
52
  'do_upgrade' => 'mmb_do_upgrade',
53
  'add_link' => 'mmb_add_link',
54
+ 'add_user' => 'mmb_add_user',
55
  'email_backup' => 'mmb_email_backup',
56
  'check_backup_compat' => 'mmb_check_backup_compat',
57
  'execute_php_code' => 'mmb_execute_php_code'
65
  require_once("$mmb_plugin_dir/backup.class.php");
66
  require_once("$mmb_plugin_dir/installer.class.php");
67
  require_once("$mmb_plugin_dir/link.class.php");
68
+ require_once("$mmb_plugin_dir/user.class.php");
69
  require_once("$mmb_plugin_dir/api.php");
70
 
71
  require_once("$mmb_plugin_dir/plugins/search/search.php");
77
  $mmb_core = new MMB_Core();
78
  if( microtime(true) - (double)get_option('mwp_iframe_options_header') < 3600 ){
79
  remove_action( 'admin_init', 'send_frame_options_header');
80
+ remove_action( 'login_init', 'send_frame_options_header');
81
  }
82
 
83
  add_action('init', 'mmb_parse_request');
111
  $num = @extract(unserialize($data));
112
 
113
  if ($action) {
114
+ global $w3_plugin_totalcache;
115
+ if(!empty($w3_plugin_totalcache)){
116
+ @$w3_plugin_totalcache->flush_dbcache();
117
+ @$w3_plugin_totalcache->flush_objectcache();
118
+ }
119
 
120
  update_option('mwp_iframe_options_header', microtime(true));
121
  // mmb_response($mmb_actions, false);
156
  $return['error'] = $response;
157
 
158
  if( !headers_sent() ){
159
+ header('HTTP/1.0 200 OK');
160
  header('Content-Type: text/plain');
161
  }
162
  exit("<MWPHEADER>" . base64_encode(serialize($return))."<ENDMWPHEADER>");
447
 
448
  }
449
 
450
+ function mmb_add_user($params)
451
+ {
452
+ global $mmb_core;
453
+ $mmb_core->get_user_instance();
454
+ $return = $mmb_core->user_instance->add_user($params);
455
+ if (is_array($return) && array_key_exists('error', $return))
456
+
457
+ mmb_response($return['error'], false);
458
+ else {
459
+ mmb_response($return, true);
460
+ }
461
+
462
+ }
463
+
464
  function mmb_iframe_plugins_fix($update_actions)
465
  {
466
  foreach($update_actions as $key => $action)
link.class.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*************************************************************
3
  *
4
- * link.class.php
5
  *
6
- * Add Links
7
  *
8
  *
9
  * Copyright (c) 2011 Prelovac Media
1
  <?php
2
  /*************************************************************
3
  *
4
+ * user.class.php
5
  *
6
+ * Add Users
7
  *
8
  *
9
  * Copyright (c) 2011 Prelovac Media
plugins/cleanup/cleanup.php CHANGED
@@ -96,9 +96,25 @@ function mmb_get_overhead()
96
  $tot_idx = 0;
97
  $tot_all = 0;
98
  $query = 'SHOW TABLE STATUS FROM '. DB_NAME;
99
- $tables = $wpdb->get_results($query,ARRAY_A);
100
  foreach($tables as $table)
101
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  $tot_data = $table['Data_length'];
103
  $tot_idx = $table['Index_length'];
104
  $total = $tot_data + $tot_idx;
@@ -108,18 +124,26 @@ function mmb_get_overhead()
108
  $gain = $gain / 1024 ;
109
  $total_gain += $gain;
110
  $gain = round ($gain,3);
111
-
112
  }
113
-
114
  return round($total_gain,3);
115
  }
116
 
 
117
  function mmb_clear_overhead()
118
  {
119
  global $wpdb;
120
  $tables = $wpdb->get_col("SHOW TABLES");
121
  foreach ($tables as $table_name) {
122
- $table_string .= $table_name . ",";
 
 
 
 
 
 
 
 
123
  }
124
  $table_string = substr($table_string,0,strlen($table_string)-1); //remove last ,
125
 
@@ -133,6 +157,7 @@ function mmb_clear_overhead()
133
 
134
 
135
 
 
136
  /* Spam Comments */
137
 
138
  function mmb_num_spam_comments()
96
  $tot_idx = 0;
97
  $tot_all = 0;
98
  $query = 'SHOW TABLE STATUS FROM '. DB_NAME;
99
+ $tables = $wpdb->get_results($wpdb->prepare($query),ARRAY_A);
100
  foreach($tables as $table)
101
  {
102
+ if($wpdb->base_prefix != $wpdb->prefix){
103
+ if(preg_match('/^'.$wpdb->prefix.'*/Ui', $table['Name'])){
104
+ $tot_data = $table['Data_length'];
105
+ $tot_idx = $table['Index_length'];
106
+ $total = $tot_data + $tot_idx;
107
+ $total = $total / 1024 ;
108
+ $total = round ($total,3);
109
+ $gain= $table['Data_free'];
110
+ $gain = $gain / 1024 ;
111
+ $total_gain += $gain;
112
+ $gain = round ($gain,3);
113
+ }
114
+ } else if(preg_match('/^'.$wpdb->prefix.'[0-9]{1,20}_*/Ui', $table['Name'])){
115
+ continue;
116
+ }
117
+ else {
118
  $tot_data = $table['Data_length'];
119
  $tot_idx = $table['Index_length'];
120
  $total = $tot_data + $tot_idx;
124
  $gain = $gain / 1024 ;
125
  $total_gain += $gain;
126
  $gain = round ($gain,3);
127
+ }
128
  }
 
129
  return round($total_gain,3);
130
  }
131
 
132
+
133
  function mmb_clear_overhead()
134
  {
135
  global $wpdb;
136
  $tables = $wpdb->get_col("SHOW TABLES");
137
  foreach ($tables as $table_name) {
138
+ if($wpdb->base_prefix != $wpdb->prefix){
139
+ if(preg_match('/^'.$wpdb->prefix.'*/Ui', $table_name)){
140
+ $table_string .= $table_name . ",";
141
+ }
142
+ } else if(preg_match('/^'.$wpdb->prefix.'[0-9]{1,20}_*/Ui', $table_name)){
143
+ continue;
144
+ }
145
+ else
146
+ $table_string .= $table_name . ",";
147
  }
148
  $table_string = substr($table_string,0,strlen($table_string)-1); //remove last ,
149
 
157
 
158
 
159
 
160
+
161
  /* Spam Comments */
162
 
163
  function mmb_num_spam_comments()
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: freediver
3
  Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=520781390
4
  Tags: managewp, managewp worker, admin, manage blogs, multi blog manager, manage multiple blogs, remote blog management
5
  Requires at least: 3.0
6
- Tested up to: 3.1.3
7
  Stable tag: trunk
8
 
9
  ManageWP Worker plugin allows you to remotely manage your blogs from one dashboard.
@@ -17,10 +17,11 @@ Main features:
17
  * Secure! No passwords for sites required, uses OpenSSL encrypted protocol
18
  * One click upgrades of WordPress, plugin and themes across all your sites
19
  * One click to access administration dashboard for any site
 
20
  * Bulk publish posts to multiple sites at once
21
  * Bulk upload themes and plugins to multiple sites at once
22
  * Automatic backups of your sites
23
- * Clone one site to another
24
  * Much, much more...
25
 
26
  Check out [ManageWP.com](http://managewp.com/ "Manage Multiple Blogs")
@@ -29,6 +30,15 @@ API for developers available at [ManageWP.com/API](http://managewp.com/api "Mana
29
 
30
  == Changelog ==
31
 
 
 
 
 
 
 
 
 
 
32
  = 3.9.0 =
33
  * New feature: Up to 50% faster dashboard loading
34
  * New feature: You can now ignore WordPress/plugin/theme updates
3
  Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=520781390
4
  Tags: managewp, managewp worker, admin, manage blogs, multi blog manager, manage multiple blogs, remote blog management
5
  Requires at least: 3.0
6
+ Tested up to: 3.2
7
  Stable tag: trunk
8
 
9
  ManageWP Worker plugin allows you to remotely manage your blogs from one dashboard.
17
  * Secure! No passwords for sites required, uses OpenSSL encrypted protocol
18
  * One click upgrades of WordPress, plugin and themes across all your sites
19
  * One click to access administration dashboard for any site
20
+ * Add sub-users (writes, staff..) to your account
21
  * Bulk publish posts to multiple sites at once
22
  * Bulk upload themes and plugins to multiple sites at once
23
  * Automatic backups of your sites
24
+ * Clone or migrate site to another domain
25
  * Much, much more...
26
 
27
  Check out [ManageWP.com](http://managewp.com/ "Manage Multiple Blogs")
30
 
31
  == Changelog ==
32
 
33
+ = 3.9.1 =
34
+ * Support for sub-users (limited access users)
35
+ * Bulk add user
36
+ * 'Select all' feature for bulk posting
37
+ * Featured image support for bulk posting
38
+ * Reload button on the dashboard (on the top of the Right now widget) will now refresh information about available updates
39
+ * Fixed a problem with the import tool
40
+ * Fixed a problem when remote dashboard would not work for some servers
41
+
42
  = 3.9.0 =
43
  * New feature: Up to 50% faster dashboard loading
44
  * New feature: You can now ignore WordPress/plugin/theme updates
stats.class.php CHANGED
@@ -25,7 +25,15 @@ class MMB_Stats extends MMB_Core
25
 
26
  function get($params)
27
  {
28
- global $mmb_wp_version, $mmb_plugin_dir;
 
 
 
 
 
 
 
 
29
  $stats = array();
30
 
31
  //define constants
@@ -39,6 +47,9 @@ class MMB_Stats extends MMB_Core
39
 
40
  $stats['worker_version'] = MMB_WORKER_VERSION;
41
  $stats['wordpress_version'] = $mmb_wp_version;
 
 
 
42
 
43
  $updates = $this->mmb_get_transient('update_core');
44
 
@@ -381,7 +392,7 @@ class MMB_Stats extends MMB_Core
381
 
382
  $thebot = '';
383
  foreach ($bot_list as $bot) {
384
- if (ereg($bot, $agent)) {
385
  $thebot = $bot;
386
  break;
387
  }
25
 
26
  function get($params)
27
  {
28
+ $num = extract($params);
29
+ if($refresh == 'transient'){
30
+ include_once(ABSPATH.'wp-includes/update.php');
31
+ wp_update_plugins();
32
+ wp_update_themes();
33
+ wp_version_check();
34
+ }
35
+
36
+ global $wpdb, $mmb_wp_version, $mmb_plugin_dir;
37
  $stats = array();
38
 
39
  //define constants
47
 
48
  $stats['worker_version'] = MMB_WORKER_VERSION;
49
  $stats['wordpress_version'] = $mmb_wp_version;
50
+ $stats['wp_multisite'] = $this->mmb_multisite;
51
+ $stats['php_version'] = phpversion();
52
+ $stats['mysql_version'] = $wpdb->db_version();
53
 
54
  $updates = $this->mmb_get_transient('update_core');
55
 
392
 
393
  $thebot = '';
394
  foreach ($bot_list as $bot) {
395
+ if ((boolean)strpos($bot, $agent)) {
396
  $thebot = $bot;
397
  break;
398
  }
user.class.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*************************************************************
3
+ *
4
+ * user.class.php
5
+ *
6
+ * Add Users
7
+ *
8
+ *
9
+ * Copyright (c) 2011 Prelovac Media
10
+ * www.prelovac.com
11
+ **************************************************************/
12
+
13
+ class MMB_User extends MMB_Core
14
+ {
15
+ function __construct()
16
+ {
17
+ parent::__construct();
18
+ }
19
+
20
+ function add_user($args)
21
+ {
22
+
23
+ if(!function_exists('username_exists') || !function_exists('email_exists'))
24
+ include_once(ABSPATH . WPINC . '/registration.php');
25
+
26
+ if(username_exists($args['user_login']))
27
+ return array('error' => 'Username already exists');
28
+
29
+ if (email_exists($args['user_email']))
30
+ return array('error' => 'Email already exists');
31
+
32
+ if(!function_exists('wp_insert_user'))
33
+ include_once (ABSPATH . 'wp-admin/includes/user.php');
34
+
35
+ $user_id = wp_insert_user($args);
36
+
37
+ if($user_id){
38
+
39
+ if($args['email_notify']){
40
+ //require_once ABSPATH . WPINC . '/pluggable.php';
41
+ wp_new_user_notification($user_id, $args['user_pass']);
42
+
43
+ }
44
+
45
+ return $user_id;
46
+ }else{
47
+ return array('error' => 'User not added. Please try again.');
48
+ }
49
+
50
+ }
51
+
52
+ }
53
+ ?>
version CHANGED
@@ -1 +1 @@
1
- 3.9.0
1
+ 3.9.1