Solution 1:
Try using plugin_dir_path( __FILE__ ):
class Maintenance {
public function init()
{
add_action( 'wp_loaded', array( $this, 'maintenance_mode' ) );
// add_action( 'admin_init', array( $this, 'maintenance_settings' ) );
}
public function maintenance_mode()
{
global $pagenow;
if ( $pagenow !== 'wp-login.php' && ! current_user_can( 'manage_options' ) && ! is_admin() ) {
header( $_SERVER['SERVER_PROTOCOL'] . ' 503 Service Temporarily Unavailable', true, 503 );
header( 'Content-Type: text/html; charset=utf-8' );
require_once plugin_dir_path( __FILE__ ) . 'assets/maintenance.php';
die();
}
}
}