canShowWidget( 'seoSetup' ) && apply_filters( 'aioseo_show_seo_setup', true ) && ( aioseo()->access->isAdmin() || aioseo()->access->hasCapability( 'aioseo_setup_wizard' ) ) && ! aioseo()->standalone->setupWizard->isCompleted() ) { wp_add_dashboard_widget( 'aioseo-seo-setup', // Translators: 1 - The plugin short name ("AIOSEO"). sprintf( esc_html__( '%s Setup', 'all-in-one-seo-pack' ), AIOSEO_PLUGIN_SHORT_NAME ), [ $this, 'outputSeoSetup', ], null, null, 'normal', 'high' ); } // Add the SEO Checklist widget. if ( $this->canShowWidget( 'seoChecklist' ) && apply_filters( 'aioseo_show_seo_checklist', true ) && ( aioseo()->access->isAdmin() || aioseo()->access->hasCapability( 'aioseo_setup_wizard' ) ) && aioseo()->standalone->setupWizard->isCompleted() ) { wp_add_dashboard_widget( 'aioseo-seo-checklist', // Translators: 1 - The plugin short name ("AIOSEO"). sprintf( esc_html__( '%s Checklist', 'all-in-one-seo-pack' ), AIOSEO_PLUGIN_SHORT_NAME ), [ $this, 'outputSeoChecklist', ], null, null, 'normal', 'high' ); } // Add the Overview widget. if ( $this->canShowWidget( 'seoOverview' ) && apply_filters( 'aioseo_show_seo_overview', true ) && ( aioseo()->access->isAdmin() || aioseo()->access->hasCapability( 'aioseo_page_analysis' ) ) && aioseo()->options->advanced->truSeo ) { wp_add_dashboard_widget( 'aioseo-overview', // Translators: 1 - The plugin short name ("AIOSEO"). sprintf( esc_html__( '%s Overview', 'all-in-one-seo-pack' ), AIOSEO_PLUGIN_SHORT_NAME ), [ $this, 'outputSeoOverview', ] ); } // Add the News widget. if ( $this->canShowWidget( 'seoNews' ) && apply_filters( 'aioseo_show_seo_news', true ) && aioseo()->access->isAdmin() ) { wp_add_dashboard_widget( 'aioseo-rss-feed', esc_html__( 'SEO News', 'all-in-one-seo-pack' ), [ $this, 'displayRssDashboardWidget', ] ); } } /** * Whether or not to show the widget. * * @since 4.0.0 * @version 4.2.8 * * @param string $widget The widget to check if can show. * @return boolean True if yes, false otherwise. */ protected function canShowWidget( $widget ) { // phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable return true; } /** * Output the SEO Setup widget. * * @since 4.2.0 * * @return void */ public function outputSeoSetup() { $this->output( 'aioseo-seo-setup-app' ); } /** * Output the SEO Checklist widget. * * @since 4.2.0 * * @return void */ public function outputSeoChecklist() { $this->output( 'aioseo-seo-checklist-app' ); } /** * Output the SEO Overview widget. * * @since 4.2.0 * * @return void */ public function outputSeoOverview() { $this->output( 'aioseo-overview-app' ); } /** * Output the widget wrapper for the Vue App. * * @since 4.2.0 * * @param string $appId The App ID to print out. * @return void */ private function output( $appId ) { // Enqueue the scripts for the widget. $this->enqueue(); // Opening tag. echo '