| @@ -32,9 +32,9 @@ | ||
| 32 | 32 | * @since 3.0 |
| 33 | 33 | */ |
| 34 | 34 | public function setup() { |
| 35 | 35 | add_action( 'admin_init', [ $this, 'calculate_install_status' ], 9 ); |
| 36 | - add_filter( 'admin_title', [ $this, 'filter_admin_title' ], 10, 2 ); | |
| 36 | + add_filter( 'admin_title', [ $this, 'filter_admin_title' ], 10 ); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * Filter admin title for install page |
| @@ -39,13 +39,12 @@ | ||
| 39 | 39 | /** |
| 40 | 40 | * Filter admin title for install page |
| 41 | 41 | * |
| 42 | 42 | * @param string $admin_title Current title |
| 43 | - * @param string $title Original title | |
| 44 | 43 | * @since 3.0 |
| 45 | 44 | * @return string |
| 46 | 45 | */ |
| 47 | - public function filter_admin_title( $admin_title, $title ) { | |
| 46 | + public function filter_admin_title( $admin_title ) { | |
| 48 | 47 | if ( 'install' === Screen::factory()->get_current_screen() ) { |
| 49 | 48 | // translators: Site Name |
| 50 | 49 | return sprintf( esc_html__( 'ElasticPress Setup ‹ %s — WordPress', 'elasticpress' ), esc_html( get_bloginfo( 'name' ) ) ); |
| 51 | 50 | } |
| @@ -58,13 +57,9 @@ | ||
| 58 | 57 | * |
| 59 | 58 | * @since 3.0 |
| 60 | 59 | */ |
| 61 | 60 | public function calculate_install_status() { |
| 62 | - if ( defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) { | |
| 63 | - $skip_install = get_site_option( 'ep_skip_install', false ); | |
| 64 | - } else { | |
| 65 | - $skip_install = get_option( 'ep_skip_install', false ); | |
| 66 | - } | |
| 61 | + $skip_install = Utils\get_option( 'ep_skip_install', false ); | |
| 67 | 62 | |
| 68 | 63 | if ( $skip_install ) { |
| 69 | 64 | $this->install_status = true; |
| 70 | 65 | |
| @@ -70,9 +65,9 @@ | ||
| 70 | 65 | |
| 71 | 66 | return; |
| 72 | 67 | } |
| 73 | 68 | |
| 74 | - $last_sync = ( defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) ? get_site_option( 'ep_last_sync', false ) : get_option( 'ep_last_sync', false ); | |
| 69 | + $last_sync = Utils\get_option( 'ep_last_sync', false ); | |
| 75 | 70 | if ( ! empty( $last_sync ) ) { |
| 76 | 71 | $this->install_status = true; |
| 77 | 72 | |
| 78 | 73 | return; |
| @@ -79,9 +74,9 @@ | ||
| 79 | 74 | } |
| 80 | 75 | |
| 81 | 76 | $host = Utils\get_host(); |
| 82 | 77 | |
| 83 | - if ( empty( $host ) && empty( $_POST['ep_host'] ) ) { // phpcs:ignore | |
| 78 | + if ( empty( $host ) && empty( $_POST['ep_host'] ) ) { | |
| 84 | 79 | $this->install_status = 2; |
| 85 | 80 | |
| 86 | 81 | return; |
| 87 | 82 | } |
| @@ -116,9 +111,9 @@ | ||
| 116 | 111 | /** |
| 117 | 112 | * Check if it should use the features selected during the install to update the settings. |
| 118 | 113 | */ |
| 119 | 114 | public function maybe_set_features() { |
| 120 | - if ( empty( $_POST['ep_install_page_nonce'] ) || ! wp_verify_nonce( $_POST['ep_install_page_nonce'], 'ep_install_page' ) ) { | |
| 115 | + if ( empty( $_POST['ep_install_page_nonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['ep_install_page_nonce'] ), 'ep_install_page' ) ) { | |
| 121 | 116 | return; |
| 122 | 117 | } |
| 123 | 118 | |
| 124 | 119 | if ( ! isset( $_POST['features'] ) || ! is_array( $_POST['features'] ) ) { |