PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 3.5.4
MainWP Dashboard: Self-hosted WordPress Management for Agencies v3.5.4
6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 5.2.1 5.2.2 5.3 All 153 releases
mainwp / mainwp.php

mainwp.php in MainWP Dashboard: Self-hosted WordPress Management for Agencies 3.5.4, at mainwp.php

80 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: MainWP Dashboard
4 Plugin URI: https://mainwp.com/
5 Description: Manage all of your WP sites, even those on different servers, from one central dashboard that runs off of your own self-hosted WordPress install.
6 Author: MainWP
7 Author URI: https://mainwp.com
8 Text Domain: mainwp
9 Version: 3.5.4
10 */
11
12 if ( ! defined( 'MAINWP_PLUGIN_FILE' ) ) {
13 define( 'MAINWP_PLUGIN_FILE', __FILE__ );
14 }
15
16 if ( ! defined( 'MAINWP_PLUGIN_DIR' ) ) {
17 define( 'MAINWP_PLUGIN_DIR', plugin_dir_path( MAINWP_PLUGIN_FILE ) );
18 }
19
20 if ( ! defined( 'MAINWP_PLUGIN_URL' ) ) {
21 define( 'MAINWP_PLUGIN_URL', plugin_dir_url( MAINWP_PLUGIN_FILE ) );
22 }
23
24 include_once( ABSPATH . 'wp-includes' . DIRECTORY_SEPARATOR . 'version.php' ); //Version information from wordpress
25
26 if ( ! function_exists( 'mainwp_autoload' ) ) {
27 function mainwp_autoload( $class_name ) {
28 $autoload_types = array( 'class', 'page', 'view', 'widget', 'table' );
29
30 foreach ( $autoload_types as $type ) {
31 $autoload_dir = \trailingslashit( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . $type );
32
33 $autoload_path = sprintf( '%s%s-%s.php', $autoload_dir, $type, strtolower( str_replace( '_', '-', $class_name ) ) );
34
35 if ( file_exists( $autoload_path ) ) {
36 require_once( $autoload_path );
37 }
38 }
39 }
40 }
41
42
43 spl_autoload_register( 'mainwp_autoload' );
44
45 if ( ! function_exists( 'mainwpdir' ) ) {
46 function mainwpdir() {
47 return WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . dirname( plugin_basename( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'libs' . DIRECTORY_SEPARATOR;
48 }
49 }
50
51 if ( file_exists( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . plugin_basename( __DIR__ ).DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class-mainwp-creport.php' ) ) {
52 include_once WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . plugin_basename( __DIR__ ).DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class-mainwp-creport.php';
53 }
54
55 if ( ! function_exists( 'mainwp_do_not_have_permissions' ) ) {
56 function mainwp_do_not_have_permissions( $where = '', $echo = true ) {
57 $msg = sprintf( __( 'You do not have sufficient permissions to access this page (%s).', 'mainwp' ), ucwords( $where ) );
58 if ( $echo ) {
59 echo '<div class="mainwp-permission-error"><p>' . esc_html( $msg ) . '</p>If you need access to this page please contact the dashboard administrator.</div>';
60 } else {
61 return $msg;
62 }
63
64 return false;
65 }
66 }
67
68 $mainwp_is_secupress_scanning = false;
69 if (!empty($_GET) && isset($_GET['test']) && isset($_GET['action']) && $_GET['action'] == 'secupress_scanner') {
70 $mainwp_is_secupress_scanning = true;
71 }
72
73 //to fix conflict with SecuPress plugin
74 if ( !$mainwp_is_secupress_scanning ) {
75 $mainWP = new MainWP_System( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . plugin_basename( __FILE__ ) );
76 register_activation_hook( __FILE__, array( $mainWP, 'activation' ) );
77 register_deactivation_hook( __FILE__, array( $mainWP, 'deactivation' ) );
78 add_action( 'plugins_loaded', array( $mainWP, 'update' ) );
79 }
80