PluginProbe
ManageWP Worker / 3.9.11
ManageWP Worker v3.9.11
4.9.38 4.9.37 4.9.36 4.9.35 4.9.34 3.8.7 3.8.8 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.18 3.9.19 3.9.2 3.9.20 3.9.21 3.9.22 3.9.23 3.9.24 All 73 releases
worker / init.php

init.php in ManageWP Worker 3.9.11, at init.php

763 lines 20.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
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.11
8 Author URI: http://www.prelovac.com
9 */
10
11 /*************************************************************
12 *
13 * init.php
14 *
15 * Initialize the communication with master
16 *
17 *
18 * Copyright (c) 2011 Prelovac Media
19 * www.prelovac.com
20 **************************************************************/
21
22 if(!defined('MMB_WORKER_VERSION'))
23 define('MMB_WORKER_VERSION', '3.9.11');
24
25 if ( !defined('MMB_XFRAME_COOKIE')){
26 $siteurl = function_exists('get_site_option') ? get_site_option( 'siteurl' ) : get_option('siteurl');
27 define('MMB_XFRAME_COOKIE', $xframe = 'wordpress_'.md5($siteurl).'_xframe');
28 }
29 global $wpdb, $mmb_plugin_dir, $mmb_plugin_url, $wp_version, $mmb_filters, $_mmb_item_filter;
30
31 if (version_compare(PHP_VERSION, '5.0.0', '<')) // min version 5 supported
32 exit("<p>ManageWP Worker plugin requires PHP 5 or higher.</p>");
33
34
35 $mmb_wp_version = $wp_version;
36 $mmb_plugin_dir = WP_PLUGIN_DIR . '/' . basename(dirname(__FILE__));
37 $mmb_plugin_url = WP_PLUGIN_URL . '/' . basename(dirname(__FILE__));
38
39 require_once("$mmb_plugin_dir/helper.class.php");
40 require_once("$mmb_plugin_dir/core.class.php");
41 require_once("$mmb_plugin_dir/post.class.php");
42 require_once("$mmb_plugin_dir/comment.class.php");
43 require_once("$mmb_plugin_dir/stats.class.php");
44 require_once("$mmb_plugin_dir/backup.class.php");
45 require_once("$mmb_plugin_dir/installer.class.php");
46 require_once("$mmb_plugin_dir/link.class.php");
47 require_once("$mmb_plugin_dir/user.class.php");
48 require_once("$mmb_plugin_dir/api.php");
49
50 require_once("$mmb_plugin_dir/plugins/search/search.php");
51 require_once("$mmb_plugin_dir/plugins/cleanup/cleanup.php");
52
53
54 if( !function_exists ( 'mmb_parse_request' )) {
55 function mmb_parse_request()
56 {
57
58 if (!isset($HTTP_RAW_POST_DATA)) {
59 $HTTP_RAW_POST_DATA = file_get_contents('php://input');
60 }
61 ob_start();
62
63 global $current_user, $mmb_core, $new_actions, $wp_db_version, $wpmu_version, $_wp_using_ext_object_cache;
64 $data = base64_decode($HTTP_RAW_POST_DATA);
65 if ($data)
66 $num = @extract(unserialize($data));
67
68 if (isset($action)) {
69 $_wp_using_ext_object_cache = false;
70 @set_time_limit(600);
71
72 if (!$mmb_core->check_if_user_exists($params['username']))
73 mmb_response('Username <b>' . $params['username'] . '</b> does not have administrator capabilities. Enter the correct username in the site options.', false);
74
75 if ($action == 'add_site') {
76 mmb_add_site($params);
77 mmb_response('You should never see this.', false);
78 }
79
80 $auth = $mmb_core->authenticate_message($action . $id, $signature, $id);
81 if ($auth === true) {
82
83 if(isset($params['username']) && !is_user_logged_in()){
84 $user = function_exists('get_user_by') ? get_user_by('login', $params['username']) : get_userdatabylogin( $params['username'] );
85 wp_set_current_user($user->ID);
86 }
87
88 /* in case database upgrade required, do database backup and perform upgrade ( wordpress wp_upgrade() function ) */
89 if( strlen(trim($wp_db_version)) && !defined('ACX_PLUGIN_DIR') ){
90 if ( get_option('db_version') != $wp_db_version ) {
91 /* in multisite network, please update database manualy */
92 if (empty($wpmu_version) || (function_exists('is_multisite') && !is_multisite())){
93 if( ! function_exists('wp_upgrade'))
94 include_once(ABSPATH.'wp-admin/includes/upgrade.php');
95
96 ob_clean();
97 @wp_upgrade();
98 @do_action('after_db_upgrade');
99 ob_end_clean();
100 }
101 }
102 }
103
104 if(isset($params['secure'])){
105 if($decrypted = $mmb_core->_secure_data($params['secure'])){
106 $decrypted = maybe_unserialize($decrypted);
107 if(is_array($decrypted)){
108 foreach($decrypted as $key => $val){
109 if(!is_numeric($key))
110 $params[$key] = $val;
111 }
112 unset($params['secure']);
113 } else $params['secure'] = $decrypted;
114 }
115 }
116
117 if( !$mmb_core->register_action_params( $action, $params ) ){
118 global $_mmb_plugin_actions;
119 $_mmb_plugin_actions[$action] = $params;
120 }
121
122
123 } else {
124 mmb_response($auth['error'], false);
125 }
126 }
127 ob_end_clean();
128 }
129 }
130 /* Main response function */
131 if( !function_exists ( 'mmb_response' )) {
132
133 function mmb_response($response = false, $success = true)
134 {
135 $return = array();
136
137 if ((is_array($response) && empty($response)) || (!is_array($response) && strlen($response) == 0))
138 $return['error'] = 'Empty response.';
139 else if ($success)
140 $return['success'] = $response;
141 else
142 $return['error'] = $response;
143
144 if( !headers_sent() ){
145 header('HTTP/1.0 200 OK');
146 header('Content-Type: text/plain');
147 }
148 exit("<MWPHEADER>" . base64_encode(serialize($return))."<ENDMWPHEADER>");
149 }
150 }
151
152
153
154 if( !function_exists ( 'mmb_add_site' )) {
155 function mmb_add_site($params)
156 {
157 global $mmb_core;
158 $num = extract($params);
159
160 if ($num) {
161 if (!get_option('_action_message_id') && !get_option('_worker_public_key')) {
162 $public_key = base64_decode($public_key);
163
164 if (function_exists('openssl_verify')) {
165 $verify = openssl_verify($action . $id, base64_decode($signature), $public_key);
166 if ($verify == 1) {
167 $mmb_core->set_master_public_key($public_key);
168 $mmb_core->set_worker_message_id($id);
169 $mmb_core->get_stats_instance();
170 if(is_array($notifications) && !empty($notifications)){
171 $mmb_core->stats_instance->set_notifications($notifications);
172 }
173 if(is_array($brand) && !empty($brand)){
174 update_option('mwp_worker_brand',$brand);
175 }
176
177 mmb_response($mmb_core->stats_instance->get_initial_stats(), true);
178 } else if ($verify == 0) {
179 mmb_response('Invalid message signature. Please contact us if you see this message often.', false);
180 } else {
181 mmb_response('Command not successful. Please try again.', false);
182 }
183 } else {
184 if (!get_option('_worker_nossl_key')) {
185 srand();
186
187 $random_key = md5(base64_encode($public_key) . rand(0, getrandmax()));
188
189 $mmb_core->set_random_signature($random_key);
190 $mmb_core->set_worker_message_id($id);
191 $mmb_core->set_master_public_key($public_key);
192 $mmb_core->get_stats_instance();
193 $mmb_core->get_stats_instance();
194 if(is_array($notifications) && !empty($notifications)){
195 $mmb_core->stats_instance->set_notifications($notifications);
196 }
197
198 if(is_array($brand) && !empty($brand)){
199 update_option('mwp_worker_brand',$brand);
200 }
201
202 mmb_response($mmb_core->stats_instance->get_initial_stats(), true);
203 } else
204 mmb_response('Please deactivate & activate ManageWP Worker plugin on your site, then re-add the site to your dashboard.', false);
205 }
206 } else {
207 mmb_response('Please deactivate & activate ManageWP Worker plugin on your site and re-add the site to your dashboard.', false);
208 }
209 } else {
210 mmb_response('Invalid parameters received. Please try again.', false);
211 }
212 }
213 }
214
215 if( !function_exists ( 'mmb_remove_site' )) {
216 function mmb_remove_site($params)
217 {
218 extract($params);
219 global $mmb_core;
220 $mmb_core->uninstall( $deactivate );
221
222 include_once(ABSPATH . 'wp-admin/includes/plugin.php');
223 $plugin_slug = basename(dirname(__FILE__)) . '/' . basename(__FILE__);
224
225 if ($deactivate) {
226 deactivate_plugins($plugin_slug, true);
227 }
228
229 if (!is_plugin_active($plugin_slug))
230 mmb_response(array(
231 'deactivated' => 'Site removed successfully. <br /><br />ManageWP Worker plugin successfully deactivated.'
232 ), true);
233 else
234 mmb_response(array(
235 'removed_data' => 'Site removed successfully. <br /><br /><b>ManageWP Worker plugin was not deactivated.</b>'
236 ), true);
237
238 }
239 }
240 if( !function_exists ( 'mmb_stats_get' )) {
241 function mmb_stats_get($params)
242 {
243 global $mmb_core;
244 $mmb_core->get_stats_instance();
245 mmb_response($mmb_core->stats_instance->get($params), true);
246 }
247 }
248
249 if( !function_exists ( 'mmb_worker_header' )) {
250 function mmb_worker_header()
251 { global $mmb_core, $current_user;
252
253 if(!headers_sent()){
254 if(isset($current_user->ID))
255 $expiration = time() + apply_filters('auth_cookie_expiration', 10800, $current_user->ID, false);
256 else
257 $expiration = time() + 10800;
258
259 setcookie(MMB_XFRAME_COOKIE, md5(MMB_XFRAME_COOKIE), $expiration, COOKIEPATH, COOKIE_DOMAIN, false, true);
260 $_COOKIE[MMB_XFRAME_COOKIE] = md5(MMB_XFRAME_COOKIE);
261 }
262 }
263 }
264
265 if( !function_exists ( 'mmb_pre_init_stats' )) {
266 function mmb_pre_init_stats( $params )
267 {
268 global $mmb_core;
269 $mmb_core->get_stats_instance();
270 return $mmb_core->stats_instance->pre_init_stats($params);
271 }
272 }
273
274 //post
275 if( !function_exists ( 'mmb_post_create' )) {
276 function mmb_post_create($params)
277 {
278 global $mmb_core;
279 $mmb_core->get_post_instance();
280 $return = $mmb_core->post_instance->create($params);
281 if (is_int($return))
282 mmb_response($return, true);
283 else
284 mmb_response($return, false);
285 }
286 }
287
288 if( !function_exists ( 'mmb_change_post_status' )) {
289 function mmb_change_post_status($params)
290 {
291 global $mmb_core;
292 $mmb_core->get_post_instance();
293 $return = $mmb_core->post_instance->change_status($params);
294 //mmb_response($return, true);
295
296 }
297 }
298
299 //comments
300 if( !function_exists ( 'mmb_change_comment_status' )) {
301 function mmb_change_comment_status($params)
302 {
303 global $mmb_core;
304 $mmb_core->get_comment_instance();
305 $return = $mmb_core->comment_instance->change_status($params);
306 //mmb_response($return, true);
307 if ($return){
308 $mmb_core->get_stats_instance();
309 mmb_response($mmb_core->stats_instance->get_comments_stats($params), true);
310 }else
311 mmb_response('Comment not updated', false);
312 }
313
314 }
315 if( !function_exists ( 'mmb_comment_stats_get' )) {
316 function mmb_comment_stats_get($params)
317 {
318 global $mmb_core;
319 $mmb_core->get_stats_instance();
320 mmb_response($mmb_core->stats_instance->get_comments_stats($params), true);
321 }
322 }
323
324 if( !function_exists ( 'mmb_backup_now' )) {
325 //backup
326 function mmb_backup_now($params)
327 {
328 global $mmb_core;
329
330 $mmb_core->get_backup_instance();
331 $return = $mmb_core->backup_instance->backup($params);
332
333 if (is_array($return) && array_key_exists('error', $return))
334 mmb_response($return['error'], false);
335 else {
336 mmb_response($return, true);
337 }
338 }
339 }
340
341 if( !function_exists ( 'mmb_email_backup' )) {
342 function mmb_email_backup($params)
343 {
344 global $mmb_core;
345 $mmb_core->get_backup_instance();
346 $return = $mmb_core->backup_instance->email_backup($params);
347
348 if (is_array($return) && array_key_exists('error', $return))
349 mmb_response($return['error'], false);
350 else {
351 mmb_response($return, true);
352 }
353 }
354 }
355
356 if( !function_exists ( 'mmb_check_backup_compat' )) {
357 function mmb_check_backup_compat($params)
358 {
359 global $mmb_core;
360 $mmb_core->get_backup_instance();
361 $return = $mmb_core->backup_instance->check_backup_compat($params);
362
363 if (is_array($return) && array_key_exists('error', $return))
364 mmb_response($return['error'], false);
365 else {
366 mmb_response($return, true);
367 }
368 }
369 }
370
371 if( !function_exists ( 'mmb_get_backup_req' )) {
372 function mmb_get_backup_req( $params )
373 {
374 global $mmb_core;
375 $mmb_core->get_stats_instance();
376 $return = $mmb_core->stats_instance->get_backup_req($params);
377
378 mmb_response($return, true);
379 }
380 }
381
382 if( !function_exists ( 'mmb_scheduled_backup' )) {
383 function mmb_scheduled_backup($params)
384 {
385 global $mmb_core;
386 $mmb_core->get_backup_instance();
387 $return = $mmb_core->backup_instance->set_backup_task($params);
388 mmb_response($return, $return);
389 }
390 }
391
392 if( !function_exists ( 'mmm_delete_backup' )) {
393 function mmm_delete_backup($params)
394 {
395 global $mmb_core;
396 $mmb_core->get_backup_instance();
397 $return = $mmb_core->backup_instance->delete_backup($params);
398 mmb_response($return, $return);
399 }
400 }
401
402 if( !function_exists ( 'mmb_optimize_tables' )) {
403 function mmb_optimize_tables($params)
404 {
405 global $mmb_core;
406 $mmb_core->get_backup_instance();
407 $return = $mmb_core->backup_instance->optimize_tables();
408 if ($return)
409 mmb_response($return, true);
410 else
411 mmb_response(false, false);
412 }
413 }
414 if( !function_exists ( 'mmb_restore_now' )) {
415 function mmb_restore_now($params)
416 {
417 global $mmb_core;
418 $mmb_core->get_backup_instance();
419 $return = $mmb_core->backup_instance->restore($params);
420 if (is_array($return) && array_key_exists('error', $return))
421 mmb_response($return['error'], false);
422 else
423 mmb_response($return, true);
424
425 }
426 }
427
428 if( !function_exists ( 'mmb_remote_backup_now' )) {
429 function mmb_remote_backup_now($params)
430 {
431 global $mmb_core;
432 $backup_instance = $mmb_core->get_backup_instance();
433 $return = $mmb_core->backup_instance->remote_backup_now($params);
434 if (is_array($return) && array_key_exists('error', $return))
435 mmb_response($return['error'], false);
436 else
437 mmb_response($return, true);
438 }
439 }
440
441
442 if( !function_exists ( 'mmb_clean_orphan_backups' )) {
443 function mmb_clean_orphan_backups()
444 {
445 global $mmb_core;
446 $backup_instance = $mmb_core->get_backup_instance();
447 $return = $mmb_core->backup_instance->cleanup();
448 if(is_array($return))
449 mmb_response($return, true);
450 else
451 mmb_response($return, false);
452 }
453 }
454
455 if( !function_exists ( 'mmb_update_worker_plugin' )) {
456 function mmb_update_worker_plugin($params)
457 {
458 global $mmb_core;
459 mmb_response($mmb_core->update_worker_plugin($params), true);
460 }
461 }
462
463 if( !function_exists ( 'mmb_wp_checkversion' )) {
464 function mmb_wp_checkversion($params)
465 {
466 include_once(ABSPATH . 'wp-includes/version.php');
467 global $mmb_wp_version, $mmb_core;
468 mmb_response($mmb_wp_version, true);
469 }
470 }
471 if( !function_exists ( 'mmb_search_posts_by_term' )) {
472 function mmb_search_posts_by_term($params)
473 {
474 global $mmb_core;
475 $mmb_core->get_search_instance();
476
477 $search_type = trim($params['search_type']);
478 $search_term = strtolower(trim($params['search_term']));
479
480 switch ($search_type){
481 case 'page_post':
482 $return = $mmb_core->search_instance->search_posts_by_term($params);
483 if($return){
484 $return = serialize($return);
485 mmb_response($return, true);
486 }else{
487 mmb_response('No posts found', false);
488 }
489 break;
490
491 case 'plugin':
492 $plugins = get_option('active_plugins');
493
494 $have_plugin = false;
495 foreach ($plugins as $plugin) {
496 if(strpos($plugin, $search_term)>-1){
497 $have_plugin = true;
498 }
499 }
500 if($have_plugin){
501 mmb_response(serialize($plugin), true);
502 }else{
503 mmb_response(false, false);
504 }
505 break;
506 case 'theme':
507 $theme = strtolower(get_option('template'));
508 if(strpos($theme, $search_term)>-1){
509 mmb_response($theme, true);
510 }else{
511 mmb_response(false, false);
512 }
513 break;
514 default: mmb_response(false, false);
515 }
516 $return = $mmb_core->search_instance->search_posts_by_term($params);
517
518
519
520 if ($return_if_true) {
521 mmb_response($return_value, true);
522 } else {
523 mmb_response($return_if_false, false);
524 }
525 }
526 }
527
528 if( !function_exists ( 'mmb_install_addon' )) {
529 function mmb_install_addon($params)
530 {
531 global $mmb_core;
532 $mmb_core->get_installer_instance();
533 $return = $mmb_core->installer_instance->install_remote_file($params);
534 mmb_response($return, true);
535
536 }
537 }
538
539 if( !function_exists ( 'mmb_do_upgrade' )) {
540 function mmb_do_upgrade($params)
541 {
542 global $mmb_core, $mmb_upgrading;
543 $mmb_core->get_installer_instance();
544 $return = $mmb_core->installer_instance->do_upgrade($params);
545 mmb_response($return, true);
546
547 }
548 }
549 if( !function_exists ( 'mmb_add_link' )) {
550 function mmb_add_link($params)
551 {
552 global $mmb_core;
553 $mmb_core->get_link_instance();
554 $return = $mmb_core->link_instance->add_link($params);
555 if (is_array($return) && array_key_exists('error', $return))
556
557 mmb_response($return['error'], false);
558 else {
559 mmb_response($return, true);
560 }
561
562 }
563 }
564
565 if( !function_exists ( 'mmb_add_user' )) {
566 function mmb_add_user($params)
567 {
568 global $mmb_core;
569 $mmb_core->get_user_instance();
570 $return = $mmb_core->user_instance->add_user($params);
571 if (is_array($return) && array_key_exists('error', $return))
572
573 mmb_response($return['error'], false);
574 else {
575 mmb_response($return, true);
576 }
577
578 }
579 }
580
581 if( !function_exists ('mmb_get_users')) {
582 function mmb_get_users($params)
583 {
584 global $mmb_core;
585 $mmb_core->get_user_instance();
586 $return = $mmb_core->user_instance->get_users($params);
587 if (is_array($return) && array_key_exists('error', $return))
588 mmb_response($return['error'], false);
589 else {
590 mmb_response($return, true);
591 }
592 }
593 }
594
595 if( !function_exists ('mmb_edit_users')) {
596 function mmb_edit_users($params)
597 {
598 global $mmb_core;
599 $mmb_core->get_user_instance();
600 $return = $mmb_core->user_instance->edit_users($params);
601 mmb_response($return, true);
602 }
603 }
604
605 if( !function_exists ( 'mmb_iframe_plugins_fix' )) {
606 function mmb_iframe_plugins_fix($update_actions)
607 {
608 foreach($update_actions as $key => $action)
609 {
610 $update_actions[$key] = str_replace('target="_parent"','',$action);
611 }
612
613 return $update_actions;
614
615 }
616 }
617 if( !function_exists ( 'mmb_execute_php_code' )) {
618 function mmb_execute_php_code($params)
619 {
620 ob_start();
621 eval($params['code']);
622 $return = ob_get_flush();
623 mmb_response(print_r($return, true), true);
624 }
625 }
626
627 if( !function_exists ( 'mmb_set_notifications' )) {
628 function mmb_set_notifications($params)
629 {
630 global $mmb_core;
631 $mmb_core->get_stats_instance();
632 $return = $mmb_core->stats_instance->set_notifications($params);
633 if (is_array($return) && array_key_exists('error', $return))
634 mmb_response($return['error'], false);
635 else {
636 mmb_response($return, true);
637 }
638
639 }
640 }
641
642 if(!function_exists('mmb_more_reccurences')){
643 //Backup Tasks
644 add_filter('cron_schedules', 'mmb_more_reccurences');
645 function mmb_more_reccurences($schedules) {
646
647 $schedules['minutely'] = array('interval' => 60, 'display' => 'Once in a minute');
648 $schedules['fiveminutes'] = array('interval' => 300, 'display' => 'Once every five minutes');
649 $schedules['tenminutes'] = array('interval' => 600, 'display' => 'Once every ten minutes');
650
651 return $schedules;
652 }
653 }
654
655
656 if (!wp_next_scheduled('mwp_backup_tasks')) {
657 wp_schedule_event( time(), 'tenminutes', 'mwp_backup_tasks' );
658 }
659 add_action('mwp_backup_tasks', 'mwp_check_backup_tasks');
660
661
662
663 if( !function_exists('mwp_check_backup_tasks') ){
664 function mwp_check_backup_tasks() {
665 global $mmb_core, $_wp_using_ext_object_cache;
666 $_wp_using_ext_object_cache = false;
667
668 $mmb_core->get_backup_instance();
669 $mmb_core->backup_instance->check_backup_tasks();
670 }
671 }
672
673 if (!wp_next_scheduled('mwp_notifications')) {
674 wp_schedule_event( time(), 'daily', 'mwp_notifications' );
675 }
676 add_action('mwp_notifications', 'mwp_check_notifications');
677
678
679
680 if( !function_exists('mwp_check_notifications') ){
681 function mwp_check_notifications() {
682 global $mmb_core, $_wp_using_ext_object_cache;
683 $_wp_using_ext_object_cache = false;
684
685 $mmb_core->get_stats_instance();
686 $mmb_core->stats_instance->check_notifications();
687 }
688 }
689
690
691 if( !function_exists('mmb_get_plugins_themes') ){
692 function mmb_get_plugins_themes($params) {
693 global $mmb_core;
694 $mmb_core->get_installer_instance();
695 $return = $mmb_core->installer_instance->get($params);
696 mmb_response($return, true);
697 }
698 }
699
700 if( !function_exists('mmb_edit_plugins_themes') ){
701 function mmb_edit_plugins_themes($params) {
702 global $mmb_core;
703 $mmb_core->get_installer_instance();
704 $return = $mmb_core->installer_instance->edit($params);
705 mmb_response($return, true);
706 }
707 }
708
709 if( !function_exists('mmb_worker_brand')){
710 function mmb_worker_brand($params) {
711 update_option("mwp_worker_brand",$params['brand']);
712 mmb_response(true, true);
713 }
714 }
715
716 if( !function_exists('mmb_plugin_actions') ){
717 function mmb_plugin_actions() {
718 global $mmb_actions, $mmb_core;
719
720 if(!empty($mmb_actions)){
721 global $_mmb_plugin_actions;
722 if(!empty($_mmb_plugin_actions)){
723 $failed = array();
724 foreach($_mmb_plugin_actions as $action => $params){
725 if(isset($mmb_actions[$action]))
726 call_user_func($mmb_actions[$action], $params);
727 else
728 $failed[] = $action;
729 }
730 if(!empty($failed)){
731 $f = implode(', ', $failed);
732 $s = count($f) > 1 ? 'Actions "' . $f . '" do' : 'Action "' . $f . '" does';
733 mmb_response($s.' not exist. Please update your Worker plugin.', false);
734 }
735
736 }
737 }
738 }
739 }
740
741 $mmb_core = new MMB_Core();
742
743 if(isset($_GET['auto_login']))
744 $mmb_core->automatic_login();
745
746 if (function_exists('register_activation_hook'))
747 register_activation_hook( __FILE__ , array( $mmb_core, 'install' ));
748
749 if (function_exists('register_deactivation_hook'))
750 register_deactivation_hook(__FILE__, array( $mmb_core, 'uninstall' ));
751
752 if (function_exists('add_action'))
753 add_action('init', 'mmb_plugin_actions', 99999);
754
755 if (function_exists('add_filter'))
756 add_filter('install_plugin_complete_actions','mmb_iframe_plugins_fix');
757
758 if( isset($_COOKIE[MMB_XFRAME_COOKIE]) ){
759 remove_action( 'admin_init', 'send_frame_options_header');
760 remove_action( 'login_init', 'send_frame_options_header');
761 }
762
763 ?>