all_items = $this->post_query->get_totals( $this->get_post_types() ); $data = array( 'allWords' => get_terms( WPSEO_Premium_Prominent_Words_Registration::TERM_NAME, array( 'fields' => 'ids' ) ), 'allItems' => $all_items, 'totalItems' => array_sum( $all_items ), 'message' => array( 'analysisCompleted' => $this->message_already_indexed() ), 'restApi' => array( 'root' => esc_url_raw( rest_url() ), 'nonce' => wp_create_nonce( 'wp_rest' ), ), 'l10n' => array( 'calculationInProgress' => __( 'Calculation in progress...', 'wordpress-seo-premium' ), 'calculationCompleted' => __( 'Calculation completed.', 'wordpress-seo-premium' ), 'contentLocale' => get_locale(), ), ); wp_enqueue_script( WPSEO_Admin_Asset_Manager::PREFIX . 'premium-site-wide-analysis' ); wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'premium-site-wide-analysis', 'yoastSiteWideAnalysisData', array( 'data' => $data ) ); } /** * Returns the rest enabled post types. * * @return array Array with rest enabled post types. */ protected function get_post_types() { return array_filter( $this->prominent_words_support->get_supported_post_types(), array( 'WPSEO_Post_Type', 'is_rest_enabled' ) ); } /** * Returns the already indexed message. * * @return string The message to return when it is already indexed. */ private function message_already_indexed() { return '' . esc_html__( 'Good job! You\'ve optimized your internal linking suggestions. These suggestions will now appear alongside your content when you are writing or editing a post.', 'wordpress-seo-premium' ); } /** * Determines if we are on a page that can show the modal. * * @return bool True if we are on the page that should contain the modal. */ protected function is_modal_page() { return filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRING ) === 'wpseo_tools'; } }