%2$s', esc_url( admin_url( 'admin.php?page=acsseo-settings' ) ), esc_html__( 'Settings', 'acs-seo-plus' ) ); array_unshift( $links, $link ); return $links; } /** * Register the settings group. * * @return void */ public function register_settings() { register_setting( 'acsseo_settings_group', ACSSEO_Settings::OPTION, array( 'type' => 'array', 'sanitize_callback' => array( 'ACSSEO_Settings', 'sanitize' ), 'default' => ACSSEO_Settings::defaults(), ) ); } /** * Load the admin stylesheet and script on this plugin screens and the editor. * * @param string $hook Current admin page hook. * @return void */ public function enqueue_assets( $hook ) { $is_plugin_screen = ( false !== strpos( (string) $hook, 'acsseo-' ) ) || ( false !== strpos( (string) $hook, self::MENU_SLUG ) ); $is_editor = in_array( $hook, array( 'post.php', 'post-new.php' ), true ); if ( ! $is_plugin_screen && ! $is_editor ) { return; } wp_enqueue_style( 'acsseo-admin', ACSSEO_URL . 'assets/css/admin.css', array(), ACSSEO_VERSION ); if ( $is_editor ) { wp_enqueue_script( 'acsseo-admin', ACSSEO_URL . 'assets/js/admin.js', array(), ACSSEO_VERSION, true ); } } /** * Overview page: the entries with the most views. * * @return void */ public function render_overview_page() { if ( ! current_user_can( 'manage_options' ) ) { return; } $stats_on = (bool) ACSSEO_Settings::get( 'stats_enabled' ); $rows = $stats_on ? $this->top_entries() : array(); ?>

*/ private function top_entries() { $query = new WP_Query( array( 'post_type' => ACSSEO_Meta::supported_post_types(), 'post_status' => 'publish', 'posts_per_page' => 20, 'meta_key' => ACSSEO_Stats::TOTAL_KEY, // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key -- ordering by the view counter is the point of this screen. 'orderby' => 'meta_value_num', 'order' => 'DESC', 'no_found_rows' => true, 'ignore_sticky_posts' => true, 'update_post_term_cache' => false, ) ); $rows = array(); foreach ( $query->posts as $post ) { $summary = ACSSEO_Stats::summary( $post->ID ); if ( 0 === $summary['total'] ) { continue; } $rows[] = array( 'id' => (int) $post->ID, 'title' => get_the_title( $post ), 'today' => $summary['today'], 'yesterday' => $summary['yesterday'], 'month' => $summary['month'], 'total' => $summary['total'], ); } wp_reset_postdata(); return $rows; } /** * Settings screen. * * @return void */ public function render_settings_page() { if ( ! current_user_can( 'manage_options' ) ) { return; } $settings = ACSSEO_Settings::all(); $option = ACSSEO_Settings::OPTION; $post_types = ACSSEO_Settings::selectable_post_types(); ?>

__( 'Use the SEO title entered on each entry', 'acs-seo-plus' ), 'output_description' => __( 'Output the meta description', 'acs-seo-plus' ), 'output_canonical' => __( 'Output the canonical URL entered on each entry', 'acs-seo-plus' ), 'output_robots' => __( 'Output noindex and nofollow directives', 'acs-seo-plus' ), 'output_social' => __( 'Output Open Graph and Twitter Card tags', 'acs-seo-plus' ), 'output_schema' => __( 'Output JSON-LD structured data', 'acs-seo-plus' ), 'schema_all_posts' => __( 'Output JSON-LD on every post without ticking each one', 'acs-seo-plus' ), ); foreach ( $toggles as $key => $label ) : ?>

' . esc_html( ACSSEO_Sitemap::url() ) . '' ); ?>

ACS Developer' ); ?>