0 ) { foreach ( $snippets as $code ) { MainWP_Helper::execute_snippet( $code ); } } } } public static function fix_for_custom_themes() { if ( file_exists( ABSPATH . '/wp-admin/includes/screen.php' ) ) { include_once ABSPATH . '/wp-admin/includes/screen.php'; } if ( function_exists( 'et_register_updates_component' ) ) { et_register_updates_component(); } } /** * * To support maintenance alert * */ public function maintenance_alert() { if ( ! is_404() ) { return; } if ( 1 !== (int) get_option( 'mainwp_maintenance_opt_alert_404' ) ) { return; } $email = get_option( 'mainwp_maintenance_opt_alert_404_email' ); if ( empty( $email ) || ! preg_match( '/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/is', $email ) ) { return; } // set status. header( 'HTTP/1.1 404 Not Found' ); header( 'Status: 404 Not Found' ); // site info. $blog = get_bloginfo( 'name' ); $site = get_bloginfo( 'url' ) . '/'; $from_email = get_bloginfo( 'admin_email' ); // referrer. if ( isset( $_SERVER['HTTP_REFERER'] ) ) { $referer = MainWP_Helper::clean( $_SERVER['HTTP_REFERER'] ); } else { $referer = 'undefined'; } $protocol = isset( $_SERVER['HTTPS'] ) && strcasecmp( $_SERVER['HTTPS'], 'off' ) ? 'https://' : 'http://'; // request URI. if ( isset( $_SERVER['REQUEST_URI'] ) && isset( $_SERVER['HTTP_HOST'] ) ) { $request = MainWP_Helper::clean( $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); } else { $request = 'undefined'; } // query string. if ( isset( $_SERVER['QUERY_STRING'] ) ) { $string = MainWP_Helper::clean( $_SERVER['QUERY_STRING'] ); } else { $string = 'undefined'; } // IP address. if ( isset( $_SERVER['REMOTE_ADDR'] ) ) { $address = MainWP_Helper::clean( $_SERVER['REMOTE_ADDR'] ); } else { $address = 'undefined'; } // user agent. if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) { $agent = MainWP_Helper::clean( $_SERVER['HTTP_USER_AGENT'] ); } else { $agent = 'undefined'; } // identity. if ( isset( $_SERVER['REMOTE_IDENT'] ) ) { $remote = MainWP_Helper::clean( $_SERVER['REMOTE_IDENT'] ); } else { $remote = 'undefined'; } // log time. $time = MainWP_Helper::clean( date( 'F jS Y, h:ia', time() ) ); // phpcs:ignore -- local time. $mail = '