PluginProbe
ManageWP Worker / 3.9.14
ManageWP Worker v3.9.14
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.14, at init.php

765 lines 20.7 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.14
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.14');
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 } else {
127 MMB_Stats::set_hit_count();
128 }
129 ob_end_clean();
130 }
131 }
132 /* Main response function */
133 if( !function_exists ( 'mmb_response' )) {
134
135 function mmb_response($response = false, $success = true)
136 {
137 $return = array();
138
139 if ((is_array($response) && empty($response)) || (!is_array($response) && strlen($response) == 0))
140 $return['error'] = 'Empty response.';
141 else if ($success)
142 $return['success'] = $response;
143 else
144 $return['error'] = $response;
145
146 if( !headers_sent() ){
147 header('HTTP/1.0 200 OK');
148 header('Content-Type: text/plain');
149 }
150 exit("<MWPHEADER>" . base64_encode(serialize($return))."<ENDMWPHEADER>");
151 }
152 }
153
154
155
156 if( !function_exists ( 'mmb_add_site' )) {
157 function mmb_add_site($params)
158 {
159 global $mmb_core;
160 $num = extract($params);
161
162 if ($num) {
163 if (!get_option('_action_message_id') && !get_option('_worker_public_key')) {
164 $public_key = base64_decode($public_key);
165
166 if (function_exists('openssl_verify')) {
167 $verify = openssl_verify($action . $id, base64_decode($signature), $public_key);
168 if ($verify == 1) {
169 $mmb_core->set_master_public_key($public_key);
170 $mmb_core->set_worker_message_id($id);
171 $mmb_core->get_stats_instance();
172 if(is_array($notifications) && !empty($notifications)){
173 $mmb_core->stats_instance->set_notifications($notifications);
174 }
175 if(is_array($brand) && !empty($brand)){
176 update_option('mwp_worker_brand',$brand);
177 }
178
179 mmb_response($mmb_core->stats_instance->get_initial_stats(), true);
180 } else if ($verify == 0) {
181 mmb_response('Invalid message signature. Please contact us if you see this message often.', false);
182 } else {
183 mmb_response('Command not successful. Please try again.', false);
184 }
185 } else {
186 if (!get_option('_worker_nossl_key')) {
187 srand();
188
189 $random_key = md5(base64_encode($public_key) . rand(0, getrandmax()));
190
191 $mmb_core->set_random_signature($random_key);
192 $mmb_core->set_worker_message_id($id);
193 $mmb_core->set_master_public_key($public_key);
194 $mmb_core->get_stats_instance();
195 if(is_array($notifications) && !empty($notifications)){
196 $mmb_core->stats_instance->set_notifications($notifications);
197 }
198
199 if(is_array($brand) && !empty($brand)){
200 update_option('mwp_worker_brand',$brand);
201 }
202
203 mmb_response($mmb_core->stats_instance->get_initial_stats(), true);
204 } else
205 mmb_response('Please deactivate & activate ManageWP Worker plugin on your site, then re-add the site to your dashboard.', false);
206 }
207 } else {
208 mmb_response('Please deactivate & activate ManageWP Worker plugin on your site and re-add the site to your dashboard.', false);
209 }
210 } else {
211 mmb_response('Invalid parameters received. Please try again.', false);
212 }
213 }
214 }
215
216 if( !function_exists ( 'mmb_remove_site' )) {
217 function mmb_remove_site($params)
218 {
219 extract($params);
220 global $mmb_core;
221 $mmb_core->uninstall( $deactivate );
222
223 include_once(ABSPATH . 'wp-admin/includes/plugin.php');
224 $plugin_slug = basename(dirname(__FILE__)) . '/' . basename(__FILE__);
225
226 if ($deactivate) {
227 deactivate_plugins($plugin_slug, true);
228 }
229
230 if (!is_plugin_active($plugin_slug))
231 mmb_response(array(
232 'deactivated' => 'Site removed successfully. <br /><br />ManageWP Worker plugin successfully deactivated.'
233 ), true);
234 else
235 mmb_response(array(
236 'removed_data' => 'Site removed successfully. <br /><br /><b>ManageWP Worker plugin was not deactivated.</b>'
237 ), true);
238
239 }
240 }
241 if( !function_exists ( 'mmb_stats_get' )) {
242 function mmb_stats_get($params)
243 {
244 global $mmb_core;
245 $mmb_core->get_stats_instance();
246 mmb_response($mmb_core->stats_instance->get($params), true);
247 }
248 }
249
250 if( !function_exists ( 'mmb_worker_header' )) {
251 function mmb_worker_header()
252 { global $mmb_core, $current_user;
253
254 if(!headers_sent()){
255 if(isset($current_user->ID))
256 $expiration = time() + apply_filters('auth_cookie_expiration', 10800, $current_user->ID, false);
257 else
258 $expiration = time() + 10800;
259
260 setcookie(MMB_XFRAME_COOKIE, md5(MMB_XFRAME_COOKIE), $expiration, COOKIEPATH, COOKIE_DOMAIN, false, true);
261 $_COOKIE[MMB_XFRAME_COOKIE] = md5(MMB_XFRAME_COOKIE);
262 }
263 }
264 }
265
266 if( !function_exists ( 'mmb_pre_init_stats' )) {
267 function mmb_pre_init_stats( $params )
268 {
269 global $mmb_core;
270 $mmb_core->get_stats_instance();
271 return $mmb_core->stats_instance->pre_init_stats($params);
272 }
273 }
274
275 //post
276 if( !function_exists ( 'mmb_post_create' )) {
277 function mmb_post_create($params)
278 {
279 global $mmb_core;
280 $mmb_core->get_post_instance();
281 $return = $mmb_core->post_instance->create($params);
282 if (is_int($return))
283 mmb_response($return, true);
284 else
285 mmb_response($return, false);
286 }
287 }
288
289 if( !function_exists ( 'mmb_change_post_status' )) {
290 function mmb_change_post_status($params)
291 {
292 global $mmb_core;
293 $mmb_core->get_post_instance();
294 $return = $mmb_core->post_instance->change_status($params);
295 //mmb_response($return, true);
296
297 }
298 }
299
300 //comments
301 if( !function_exists ( 'mmb_change_comment_status' )) {
302 function mmb_change_comment_status($params)
303 {
304 global $mmb_core;
305 $mmb_core->get_comment_instance();
306 $return = $mmb_core->comment_instance->change_status($params);
307 //mmb_response($return, true);
308 if ($return){
309 $mmb_core->get_stats_instance();
310 mmb_response($mmb_core->stats_instance->get_comments_stats($params), true);
311 }else
312 mmb_response('Comment not updated', false);
313 }
314
315 }
316 if( !function_exists ( 'mmb_comment_stats_get' )) {
317 function mmb_comment_stats_get($params)
318 {
319 global $mmb_core;
320 $mmb_core->get_stats_instance();
321 mmb_response($mmb_core->stats_instance->get_comments_stats($params), true);
322 }
323 }
324
325 if( !function_exists ( 'mmb_backup_now' )) {
326 //backup
327 function mmb_backup_now($params)
328 {
329 global $mmb_core;
330
331 $mmb_core->get_backup_instance();
332 $return = $mmb_core->backup_instance->backup($params);
333
334 if (is_array($return) && array_key_exists('error', $return))
335 mmb_response($return['error'], false);
336 else {
337 mmb_response($return, true);
338 }
339 }
340 }
341
342 if( !function_exists ( 'mmb_email_backup' )) {
343 function mmb_email_backup($params)
344 {
345 global $mmb_core;
346 $mmb_core->get_backup_instance();
347 $return = $mmb_core->backup_instance->email_backup($params);
348
349 if (is_array($return) && array_key_exists('error', $return))
350 mmb_response($return['error'], false);
351 else {
352 mmb_response($return, true);
353 }
354 }
355 }
356
357 if( !function_exists ( 'mmb_check_backup_compat' )) {
358 function mmb_check_backup_compat($params)
359 {
360 global $mmb_core;
361 $mmb_core->get_backup_instance();
362 $return = $mmb_core->backup_instance->check_backup_compat($params);
363
364 if (is_array($return) && array_key_exists('error', $return))
365 mmb_response($return['error'], false);
366 else {
367 mmb_response($return, true);
368 }
369 }
370 }
371
372 if( !function_exists ( 'mmb_get_backup_req' )) {
373 function mmb_get_backup_req( $params )
374 {
375 global $mmb_core;
376 $mmb_core->get_stats_instance();
377 $return = $mmb_core->stats_instance->get_backup_req($params);
378
379 mmb_response($return, true);
380 }
381 }
382
383 if( !function_exists ( 'mmb_scheduled_backup' )) {
384 function mmb_scheduled_backup($params)
385 {
386 global $mmb_core;
387 $mmb_core->get_backup_instance();
388 $return = $mmb_core->backup_instance->set_backup_task($params);
389 mmb_response($return, $return);
390 }
391 }
392
393 if( !function_exists ( 'mmm_delete_backup' )) {
394 function mmm_delete_backup($params)
395 {
396 global $mmb_core;
397 $mmb_core->get_backup_instance();
398 $return = $mmb_core->backup_instance->delete_backup($params);
399 mmb_response($return, $return);
400 }
401 }
402
403 if( !function_exists ( 'mmb_optimize_tables' )) {
404 function mmb_optimize_tables($params)
405 {
406 global $mmb_core;
407 $mmb_core->get_backup_instance();
408 $return = $mmb_core->backup_instance->optimize_tables();
409 if ($return)
410 mmb_response($return, true);
411 else
412 mmb_response(false, false);
413 }
414 }
415 if( !function_exists ( 'mmb_restore_now' )) {
416 function mmb_restore_now($params)
417 {
418 global $mmb_core;
419 $mmb_core->get_backup_instance();
420 $return = $mmb_core->backup_instance->restore($params);
421 if (is_array($return) && array_key_exists('error', $return))
422 mmb_response($return['error'], false);
423 else
424 mmb_response($return, true);
425
426 }
427 }
428
429 if( !function_exists ( 'mmb_remote_backup_now' )) {
430 function mmb_remote_backup_now($params)
431 {
432 global $mmb_core;
433 $backup_instance = $mmb_core->get_backup_instance();
434 $return = $mmb_core->backup_instance->remote_backup_now($params);
435 if (is_array($return) && array_key_exists('error', $return))
436 mmb_response($return['error'], false);
437 else
438 mmb_response($return, true);
439 }
440 }
441
442
443 if( !function_exists ( 'mmb_clean_orphan_backups' )) {
444 function mmb_clean_orphan_backups()
445 {
446 global $mmb_core;
447 $backup_instance = $mmb_core->get_backup_instance();
448 $return = $mmb_core->backup_instance->cleanup();
449 if(is_array($return))
450 mmb_response($return, true);
451 else
452 mmb_response($return, false);
453 }
454 }
455
456 if( !function_exists ( 'mmb_update_worker_plugin' )) {
457 function mmb_update_worker_plugin($params)
458 {
459 global $mmb_core;
460 mmb_response($mmb_core->update_worker_plugin($params), true);
461 }
462 }
463
464 if( !function_exists ( 'mmb_wp_checkversion' )) {
465 function mmb_wp_checkversion($params)
466 {
467 include_once(ABSPATH . 'wp-includes/version.php');
468 global $mmb_wp_version, $mmb_core;
469 mmb_response($mmb_wp_version, true);
470 }
471 }
472 if( !function_exists ( 'mmb_search_posts_by_term' )) {
473 function mmb_search_posts_by_term($params)
474 {
475 global $mmb_core;
476 $mmb_core->get_search_instance();
477
478 $search_type = trim($params['search_type']);
479 $search_term = strtolower(trim($params['search_term']));
480
481 switch ($search_type){
482 case 'page_post':
483 $return = $mmb_core->search_instance->search_posts_by_term($params);
484 if($return){
485 $return = serialize($return);
486 mmb_response($return, true);
487 }else{
488 mmb_response('No posts found', false);
489 }
490 break;
491
492 case 'plugin':
493 $plugins = get_option('active_plugins');
494
495 $have_plugin = false;
496 foreach ($plugins as $plugin) {
497 if(strpos($plugin, $search_term)>-1){
498 $have_plugin = true;
499 }
500 }
501 if($have_plugin){
502 mmb_response(serialize($plugin), true);
503 }else{
504 mmb_response(false, false);
505 }
506 break;
507 case 'theme':
508 $theme = strtolower(get_option('template'));
509 if(strpos($theme, $search_term)>-1){
510 mmb_response($theme, true);
511 }else{
512 mmb_response(false, false);
513 }
514 break;
515 default: mmb_response(false, false);
516 }
517 $return = $mmb_core->search_instance->search_posts_by_term($params);
518
519
520
521 if ($return_if_true) {
522 mmb_response($return_value, true);
523 } else {
524 mmb_response($return_if_false, false);
525 }
526 }
527 }
528
529 if( !function_exists ( 'mmb_install_addon' )) {
530 function mmb_install_addon($params)
531 {
532 global $mmb_core;
533 $mmb_core->get_installer_instance();
534 $return = $mmb_core->installer_instance->install_remote_file($params);
535 mmb_response($return, true);
536
537 }
538 }
539
540 if( !function_exists ( 'mmb_do_upgrade' )) {
541 function mmb_do_upgrade($params)
542 {
543 global $mmb_core, $mmb_upgrading;
544 $mmb_core->get_installer_instance();
545 $return = $mmb_core->installer_instance->do_upgrade($params);
546 mmb_response($return, true);
547
548 }
549 }
550 if( !function_exists ( 'mmb_add_link' )) {
551 function mmb_add_link($params)
552 {
553 global $mmb_core;
554 $mmb_core->get_link_instance();
555 $return = $mmb_core->link_instance->add_link($params);
556 if (is_array($return) && array_key_exists('error', $return))
557
558 mmb_response($return['error'], false);
559 else {
560 mmb_response($return, true);
561 }
562
563 }
564 }
565
566 if( !function_exists ( 'mmb_add_user' )) {
567 function mmb_add_user($params)
568 {
569 global $mmb_core;
570 $mmb_core->get_user_instance();
571 $return = $mmb_core->user_instance->add_user($params);
572 if (is_array($return) && array_key_exists('error', $return))
573
574 mmb_response($return['error'], false);
575 else {
576 mmb_response($return, true);
577 }
578
579 }
580 }
581
582 if( !function_exists ('mmb_get_users')) {
583 function mmb_get_users($params)
584 {
585 global $mmb_core;
586 $mmb_core->get_user_instance();
587 $return = $mmb_core->user_instance->get_users($params);
588 if (is_array($return) && array_key_exists('error', $return))
589 mmb_response($return['error'], false);
590 else {
591 mmb_response($return, true);
592 }
593 }
594 }
595
596 if( !function_exists ('mmb_edit_users')) {
597 function mmb_edit_users($params)
598 {
599 global $mmb_core;
600 $mmb_core->get_user_instance();
601 $return = $mmb_core->user_instance->edit_users($params);
602 mmb_response($return, true);
603 }
604 }
605
606 if( !function_exists ( 'mmb_iframe_plugins_fix' )) {
607 function mmb_iframe_plugins_fix($update_actions)
608 {
609 foreach($update_actions as $key => $action)
610 {
611 $update_actions[$key] = str_replace('target="_parent"','',$action);
612 }
613
614 return $update_actions;
615
616 }
617 }
618 if( !function_exists ( 'mmb_execute_php_code' )) {
619 function mmb_execute_php_code($params)
620 {
621 ob_start();
622 eval($params['code']);
623 $return = ob_get_flush();
624 mmb_response(print_r($return, true), true);
625 }
626 }
627
628 if( !function_exists ( 'mmb_set_notifications' )) {
629 function mmb_set_notifications($params)
630 {
631 global $mmb_core;
632 $mmb_core->get_stats_instance();
633 $return = $mmb_core->stats_instance->set_notifications($params);
634 if (is_array($return) && array_key_exists('error', $return))
635 mmb_response($return['error'], false);
636 else {
637 mmb_response($return, true);
638 }
639
640 }
641 }
642
643 if(!function_exists('mmb_more_reccurences')){
644 //Backup Tasks
645 add_filter('cron_schedules', 'mmb_more_reccurences');
646 function mmb_more_reccurences($schedules) {
647
648 $schedules['minutely'] = array('interval' => 60, 'display' => 'Once in a minute');
649 $schedules['fiveminutes'] = array('interval' => 300, 'display' => 'Once every five minutes');
650 $schedules['tenminutes'] = array('interval' => 600, 'display' => 'Once every ten minutes');
651
652 return $schedules;
653 }
654 }
655
656
657 if (!wp_next_scheduled('mwp_backup_tasks')) {
658 wp_schedule_event( time(), 'tenminutes', 'mwp_backup_tasks' );
659 }
660 add_action('mwp_backup_tasks', 'mwp_check_backup_tasks');
661
662
663
664 if( !function_exists('mwp_check_backup_tasks') ){
665 function mwp_check_backup_tasks() {
666 global $mmb_core, $_wp_using_ext_object_cache;
667 $_wp_using_ext_object_cache = false;
668
669 $mmb_core->get_backup_instance();
670 $mmb_core->backup_instance->check_backup_tasks();
671 }
672 }
673
674 if (!wp_next_scheduled('mwp_notifications')) {
675 wp_schedule_event( time(), 'twicedaily', 'mwp_notifications' );
676 }
677 add_action('mwp_notifications', 'mwp_check_notifications');
678
679
680
681 if( !function_exists('mwp_check_notifications') ){
682 function mwp_check_notifications() {
683 global $mmb_core, $_wp_using_ext_object_cache;
684 $_wp_using_ext_object_cache = false;
685
686 $mmb_core->get_stats_instance();
687 $mmb_core->stats_instance->check_notifications();
688 }
689 }
690
691
692 if( !function_exists('mmb_get_plugins_themes') ){
693 function mmb_get_plugins_themes($params) {
694 global $mmb_core;
695 $mmb_core->get_installer_instance();
696 $return = $mmb_core->installer_instance->get($params);
697 mmb_response($return, true);
698 }
699 }
700
701 if( !function_exists('mmb_edit_plugins_themes') ){
702 function mmb_edit_plugins_themes($params) {
703 global $mmb_core;
704 $mmb_core->get_installer_instance();
705 $return = $mmb_core->installer_instance->edit($params);
706 mmb_response($return, true);
707 }
708 }
709
710 if( !function_exists('mmb_worker_brand')){
711 function mmb_worker_brand($params) {
712 update_option("mwp_worker_brand",$params['brand']);
713 mmb_response(true, true);
714 }
715 }
716
717 if( !function_exists('mmb_plugin_actions') ){
718 function mmb_plugin_actions() {
719 global $mmb_actions, $mmb_core;
720
721 if(!empty($mmb_actions)){
722 global $_mmb_plugin_actions;
723 if(!empty($_mmb_plugin_actions)){
724 $failed = array();
725 foreach($_mmb_plugin_actions as $action => $params){
726 if(isset($mmb_actions[$action]))
727 call_user_func($mmb_actions[$action], $params);
728 else
729 $failed[] = $action;
730 }
731 if(!empty($failed)){
732 $f = implode(', ', $failed);
733 $s = count($f) > 1 ? 'Actions "' . $f . '" do' : 'Action "' . $f . '" does';
734 mmb_response($s.' not exist. Please update your Worker plugin.', false);
735 }
736
737 }
738 }
739 }
740 }
741
742 $mmb_core = new MMB_Core();
743
744 if(isset($_GET['auto_login']))
745 $mmb_core->automatic_login();
746
747 if (function_exists('register_activation_hook'))
748 register_activation_hook( __FILE__ , array( $mmb_core, 'install' ));
749
750 if (function_exists('register_deactivation_hook'))
751 register_deactivation_hook(__FILE__, array( $mmb_core, 'uninstall' ));
752
753 if (function_exists('add_action'))
754 add_action('init', 'mmb_plugin_actions', 99999);
755
756 if (function_exists('add_filter'))
757 add_filter('install_plugin_complete_actions','mmb_iframe_plugins_fix');
758
759 if( isset($_COOKIE[MMB_XFRAME_COOKIE]) ){
760 remove_action( 'admin_init', 'send_frame_options_header');
761 remove_action( 'login_init', 'send_frame_options_header');
762 }
763
764
765 ?>