get_branding_options(); $child_name = ( '' === $branding_opts['branding_preserve_title'] ) ? 'MainWP Child' : $branding_opts['branding_preserve_title']; $dashboard_name = ( '' === $branding_opts['branding_preserve_title'] ) ? 'MainWP Dashboard' : $branding_opts['branding_preserve_title'] . ' Dashboard'; $msg = '

'; $msg .= __( 'Attention!', 'mainwp-child' ); $msg .= '

'; $msg .= __( 'Please add this site to your ', 'mainwp-child' ) . $dashboard_name . ' ' . __( 'NOW or deactivate the ', 'mainwp-child' ) . $child_name . __( ' plugin until you are ready to connect this site to your Dashboard in order to avoid unexpected security issues.', 'mainwp-child' ); $msg .= '

'; $msg .= '

'; $msg .= __( 'If you are not sure how to add this site to your Dashboard, please review these instructions.', 'mainwp-child' ); $msg .= '

'; if ( ! MainWP_Child_Branding::instance()->is_branding() ) { $msg .= '

'; $msg .= __( 'You can also turn on the unique security ID option in ', 'mainwp-child' ) . $child_name . __( ' settings if you would like extra security and additional time to add this site to your Dashboard.
Find out more in this help document How do I use the child unique security ID?', 'mainwp-child' ); $msg .= '

'; } $msg .= '
'; echo wp_kses_post( $msg ); } MainWP_Child_Server_Information_Render::render_warnings(); } public function admin_menu() { $branding_opts = MainWP_Child_Branding::instance()->get_branding_options(); $is_hide = isset( $branding_opts['hide'] ) ? $branding_opts['hide'] : ''; $cancelled_branding = $branding_opts['cancelled_branding']; if ( isset( $branding_opts['remove_wp_tools'] ) && $branding_opts['remove_wp_tools'] && ! $cancelled_branding ) { remove_menu_page( 'tools.php' ); $pos = stripos( $_SERVER['REQUEST_URI'], 'tools.php' ) || stripos( $_SERVER['REQUEST_URI'], 'import.php' ) || stripos( $_SERVER['REQUEST_URI'], 'export.php' ); if ( false !== $pos ) { wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); } } // if preserve branding and do not remove menus. if ( isset( $branding_opts['remove_wp_setting'] ) && $branding_opts['remove_wp_setting'] && ! $cancelled_branding ) { remove_menu_page( 'options-general.php' ); $pos = stripos( $_SERVER['REQUEST_URI'], 'options-general.php' ) || stripos( $_SERVER['REQUEST_URI'], 'options-writing.php' ) || stripos( $_SERVER['REQUEST_URI'], 'options-reading.php' ) || stripos( $_SERVER['REQUEST_URI'], 'options-discussion.php' ) || stripos( $_SERVER['REQUEST_URI'], 'options-media.php' ) || stripos( $_SERVER['REQUEST_URI'], 'options-permalink.php' ); if ( false !== $pos ) { wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); exit(); } } if ( isset( $branding_opts['remove_permalink'] ) && $branding_opts['remove_permalink'] && ! $cancelled_branding ) { remove_submenu_page( 'options-general.php', 'options-permalink.php' ); $pos = stripos( $_SERVER['REQUEST_URI'], 'options-permalink.php' ); if ( false !== $pos ) { wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); exit(); } } $remove_all_child_menu = false; if ( isset( $branding_opts['remove_setting'] ) && isset( $branding_opts['remove_restore'] ) && isset( $branding_opts['remove_server_info'] ) && $branding_opts['remove_setting'] && $branding_opts['remove_restore'] && $branding_opts['remove_server_info'] ) { $remove_all_child_menu = true; } // if preserve branding and do not hide menus. if ( ( ! $remove_all_child_menu && 'T' !== $is_hide ) || $cancelled_branding ) { $branding_header = isset( $branding_opts['branding_header'] ) ? $branding_opts['branding_header'] : array(); if ( ( is_array( $branding_header ) && ! empty( $branding_header['name'] ) ) && ! $cancelled_branding ) { self::$brandingTitle = stripslashes( $branding_header['name'] ); $child_menu_title = stripslashes( $branding_header['name'] ); $child_page_title = $child_menu_title . ' Settings'; } else { $child_menu_title = 'MainWP Child'; $child_page_title = 'MainWPSettings'; } $this->init_pages( $branding_header ); } } private function init_pages( $child_menu_title ) { $settingsPage = add_submenu_page( 'options-general.php', $child_menu_title, $child_menu_title, 'manage_options', 'mainwp_child_tab', array( &$this, 'render_pages' ) ); add_action( 'admin_print_scripts-' . $settingsPage, array( MainWP_Clone::get_class_name(), 'print_scripts' ) ); $subpageargs = array( 'child_slug' => 'options-general.php', 'branding' => ( null === self::$brandingTitle ) ? 'MainWP' : self::$brandingTitle, 'parent_menu' => $settingsPage, ); do_action_deprecated( 'mainwp-child-subpages', array( $subpageargs ), '4.0.7.1', 'mainwp_child_subpages' ); do_action( 'mainwp_child_subpages', $subpageargs ); $sub_pages = array(); $all_subpages = apply_filters_deprecated( 'mainwp-child-init-subpages', array( array() ), '4.0.7.1', 'mainwp_child_init_subpages' ); $all_subpages = apply_filters( 'mainwp_child_init_subpages', $all_subpages ); if ( ! is_array( $all_subpages ) ) { $all_subpages = array(); } if ( ! self::$subPagesLoaded ) { foreach ( $all_subpages as $page ) { $slug = isset( $page['slug'] ) ? $page['slug'] : ''; if ( empty( $slug ) ) { continue; } $subpage = array(); $subpage['slug'] = $slug; $subpage['title'] = $page['title']; $subpage['page'] = 'mainwp-' . str_replace( ' ', '-', strtolower( str_replace( '-', ' ', $slug ) ) ); if ( isset( $page['callback'] ) ) { $subpage['callback'] = $page['callback']; $created_page = add_submenu_page( 'options-general.php', $subpage['title'], '
' . $subpage['title'] . '
', 'manage_options', $subpage['page'], $subpage['callback'] ); if ( isset( $page['load_callback'] ) ) { $subpage['load_callback'] = $page['load_callback']; add_action( 'load-' . $created_page, $subpage['load_callback'] ); } } $sub_pages[] = $subpage; } self::$subPages = $sub_pages; self::$subPagesLoaded = true; } add_action( 'mainwp-child-pageheader', array( __CLASS__, 'render_header' ) ); add_action( 'mainwp-child-pagefooter', array( __CLASS__, 'render_footer' ) ); global $submenu; if ( isset( $submenu['options-general.php'] ) ) { foreach ( $submenu['options-general.php'] as $index => $item ) { if ( 'mainwp-reports-page' === $item[2] || 'mainwp-reports-settings' === $item[2] ) { unset( $submenu['options-general.php'][ $index ] ); } } } } public function plugin_row_meta( $plugin_meta, $plugin_file ) { global $mainWPChild; if ( $mainWPChild->plugin_slug !== $plugin_file ) { return $plugin_meta; } return apply_filters( 'mainwp_child_plugin_row_meta', $plugin_meta, $plugin_file, $mainWPChild->plugin_slug ); } public function render_pages( $shownPage ) { $shownPage = ''; if ( isset( $_GET['tab'] ) ) { $shownPage = $_GET['tab']; } $branding_opts = MainWP_Child_Branding::instance()->get_branding_options(); $hide_settings = isset( $branding_opts['remove_setting'] ) && $branding_opts['remove_setting'] ? true : false; $hide_restore = isset( $branding_opts['remove_restore'] ) && $branding_opts['remove_restore'] ? true : false; $hide_server_info = isset( $branding_opts['remove_server_info'] ) && $branding_opts['remove_server_info'] ? true : false; $hide_connection_detail = isset( $branding_opts['remove_connection_detail'] ) && $branding_opts['remove_connection_detail'] ? true : false; $hide_style = 'style="display:none"'; if ( '' == $shownPage ) { if ( ! $hide_settings ) { $shownPage = 'settings'; } elseif ( ! $hide_restore ) { $shownPage = 'restore-clone'; } elseif ( ! $hide_server_info ) { $shownPage = 'server-info'; } elseif ( ! $hide_connection_detail ) { $shownPage = 'connection-detail'; } } if ( ! $hide_restore ) { if ( '' === session_id() ) { session_start(); } } self::render_header( $shownPage, false ); ?>
> render_settings(); ?>
>
>
>
get_branding_options(); $hide_settings = isset( $branding_opts['remove_setting'] ) && $branding_opts['remove_setting'] ? true : false; $hide_restore = isset( $branding_opts['remove_restore'] ) && $branding_opts['remove_restore'] ? true : false; $hide_server_info = isset( $branding_opts['remove_server_info'] ) && $branding_opts['remove_server_info'] ? true : false; $hide_connection_detail = isset( $branding_opts['remove_connection_detail'] ) && $branding_opts['remove_connection_detail'] ? true : false; $sitesToClone = get_option( 'mainwp_child_clone_sites' ); ?>


/>
' . esc_html__( 'Your unique security ID is:', 'mainwp-child' ) . ' ' . esc_html( get_option( 'mainwp_child_uniqueId' ) ) . ''; } ?>