get_current_screen() ) { // translators: Site Name return sprintf( esc_html__( 'ElasticPress Setup ‹ %s — WordPress', 'elasticpress' ), esc_html( get_bloginfo( 'name' ) ) ); } return $admin_title; } /** * Determine current install status * * @since 3.0 */ public function calculate_install_status() { if ( defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) { $skip_install = get_site_option( 'ep_skip_install', false ); } else { $skip_install = get_option( 'ep_skip_install', false ); } if ( $skip_install ) { $this->install_status = true; return; } $host = Utils\get_host(); $last_sync = ( defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) ? get_site_option( 'ep_last_sync', false ) : get_option( 'ep_last_sync', false ); if ( ! empty( $last_sync ) ) { $this->install_status = true; return; } if ( empty( $host ) ) { $this->install_status = 2; if ( ! empty( $_POST['ep_host'] ) ) { // phpcs:ignore $this->install_status = 3; } return; } else { $this->install_status = 3; } } /** * Get installation status * * false - not installed * 2 - On step two of install * 3 - On step three of install * true - Install complete * * @return bool|int */ public function get_install_status() { /** * Filter install status * * @hook ep_install_status * @param {string} $install_status Current install status * @return {string} New install status * @since 3.0 */ return apply_filters( 'ep_install_status', $this->install_status ); } /** * Return singleton instance of class * * @return self * @since 3.0 */ public static function factory() { static $instance = false; if ( ! $instance ) { $instance = new self(); $instance->setup(); } return $instance; } }