2014-03-19 23:58:52 +07:00
|
|
|
<?php
|
2020-04-23 16:41:40 +02:00
|
|
|
/**
|
|
|
|
* Plugin Name: MainWP Child
|
|
|
|
* Plugin URI: https://mainwp.com/
|
|
|
|
* Description: Provides a secure connection between your MainWP Dashboard and your WordPress sites. MainWP allows you to manage WP sites from one central location. Plugin documentation and options can be found here https://mainwp.com/help/
|
|
|
|
* Author: MainWP
|
|
|
|
* Author URI: https://mainwp.com
|
|
|
|
* Text Domain: mainwp-child
|
2020-05-04 23:02:02 +07:00
|
|
|
* Version: 4.0.7.1
|
2014-03-19 23:58:52 +07:00
|
|
|
*/
|
2020-04-23 16:41:40 +02:00
|
|
|
require_once ABSPATH . 'wp-includes' . DIRECTORY_SEPARATOR . 'version.php'; // Version information from WordPress.
|
2014-03-19 23:58:52 +07:00
|
|
|
|
2020-05-12 20:19:58 +07:00
|
|
|
define( 'MAINWP_DEBUG', true );
|
2016-03-15 20:54:21 +01:00
|
|
|
|
2016-03-03 20:28:07 +01:00
|
|
|
if ( ! defined( 'MAINWP_CHILD_FILE' ) ) {
|
|
|
|
define( 'MAINWP_CHILD_FILE', __FILE__ );
|
|
|
|
}
|
|
|
|
|
2020-05-05 20:13:38 +07:00
|
|
|
if ( ! defined( 'MAINWP_CHILD_PLUGIN_DIR' ) ) {
|
|
|
|
define( 'MAINWP_CHILD_PLUGIN_DIR', plugin_dir_path( MAINWP_CHILD_FILE ) );
|
|
|
|
}
|
|
|
|
|
2016-03-03 20:28:07 +01:00
|
|
|
if ( ! defined( 'MAINWP_CHILD_URL' ) ) {
|
|
|
|
define( 'MAINWP_CHILD_URL', plugin_dir_url( MAINWP_CHILD_FILE ) );
|
|
|
|
}
|
|
|
|
|
2015-10-15 22:52:37 +10:00
|
|
|
function mainwp_child_autoload( $class_name ) {
|
2020-05-05 13:19:34 +00:00
|
|
|
|
2020-05-07 19:34:36 +07:00
|
|
|
if ( 0 === strpos( $class_name, 'MainWP\Child' ) ) {
|
|
|
|
// trip the namespace prefix: MainWP\Child\ .
|
2020-05-07 12:38:30 +00:00
|
|
|
$class_name = substr( $class_name, 13 );
|
2020-05-05 13:19:34 +00:00
|
|
|
}
|
2020-05-07 12:38:30 +00:00
|
|
|
|
2015-10-15 23:31:52 +10:00
|
|
|
$autoload_dir = \trailingslashit( dirname( __FILE__ ) . '/class' );
|
2015-10-15 22:52:37 +10:00
|
|
|
$autoload_path = sprintf( '%sclass-%s.php', $autoload_dir, strtolower( str_replace( '_', '-', $class_name ) ) );
|
|
|
|
|
|
|
|
if ( file_exists( $autoload_path ) ) {
|
2020-03-26 14:11:33 +00:00
|
|
|
require_once $autoload_path;
|
2015-10-15 22:52:37 +10:00
|
|
|
}
|
2014-03-19 23:58:52 +07:00
|
|
|
}
|
2015-10-15 22:52:37 +10:00
|
|
|
|
|
|
|
if ( function_exists( 'spl_autoload_register' ) ) {
|
|
|
|
spl_autoload_register( 'mainwp_child_autoload' );
|
2018-12-19 17:01:08 +07:00
|
|
|
}
|
2014-03-19 23:58:52 +07:00
|
|
|
|
2020-05-05 20:13:38 +07:00
|
|
|
require_once MAINWP_CHILD_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'functions.php';
|
|
|
|
|
|
|
|
$mainWPChild = new MainWP\Child\MainWP_Child( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . plugin_basename( __FILE__ ) );
|
2015-10-15 22:52:37 +10:00
|
|
|
register_activation_hook( __FILE__, array( $mainWPChild, 'activation' ) );
|
|
|
|
register_deactivation_hook( __FILE__, array( $mainWPChild, 'deactivation' ) );
|