# wpsso/22.7.0/lib/admin-head-suggest-options.php

WPSSO Core – Complete Schema Markup and Meta Tags, version 22.7.0. 160 lines.

- Page: https://pluginprobe.com/plugins/wpsso/22.7.0/code/lib/admin-head-suggest-options.php
- Raw: https://pluginprobe.com/plugins/wpsso/22.7.0/raw/lib/admin-head-suggest-options.php
- Modified: 2026-03-25T12:08:02+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wpsso/22.7.0/code/lib/admin-head-suggest-options.php#L10-L20`.

```php
<?php
/*
 * License: GPLv3
 * License URI: https://www.gnu.org/licenses/gpl.txt
 * Copyright 2012-2026 Jean-Sebastien Morisset (https://wpsso.com/)
 */

if ( ! defined( 'ABSPATH' ) ) {

	die( 'These aren\'t the droids you\'re looking for.' );
}

if ( ! defined( 'WPSSO_PLUGINDIR' ) ) {

	die( 'Do. Or do not. There is no try.' );
}

if ( ! class_exists( 'WpssoAdminHeadSuggestOptions' ) ) {

	class WpssoAdminHeadSuggestOptions {

		private $p;	// Wpsso class object.

		/*
		 * Instantiated by WpssoAdminHeadSuggest->__construct().
		 */
		public function __construct( &$plugin ) {

			$this->p =& $plugin;
		}

		public function suggest( $suggest_max = 2 ) {

			if ( $this->p->debug->enabled ) {

				$this->p->debug->log_args( array(
					'suggest_max' => $suggest_max,
				) );
			}

			$suggested = 0;

			if ( ! current_user_can( 'manage_options' ) ) return $suggested;

			/*
			 * Suggest integration and seo options, in that order.
			 */
			foreach ( array( 'integration', 'seo' ) as $suffix ) {

				$methodname = 'suggest_options_' . $suffix;
				$suggested  = $suggested + $this->$methodname( $suggest_max - $suggested );

				if ( $this->p->debug->enabled ) {

					$this->p->debug->log( $methodname . ' suggested = ' . $suggested );
				}

				if ( $suggested >= $suggest_max ) break;
			}

			if ( $this->p->debug->enabled ) {

				$this->p->debug->log( 'return suggested = ' . $suggested );
			}

			return $suggested;
		}

		private function suggest_options_integration( $suggest_max ) {

			$suggested = 0;

			/*
			 * Image Dimension Checks.
			 */
			if ( empty( $this->p->options[ 'plugin_check_img_dims' ] ) ) {

				$notice_key = 'notice-check-img-dims-disabled';

				if ( $this->p->notice->is_admin_pre_notices( $notice_key ) ) {

					if ( $notice_msg = $this->p->msgs->get( $notice_key ) ) {

						$this->p->notice->inf( $notice_msg, null, $notice_key, $dismiss_time = true );

						if ( ++$suggested >= $suggest_max ) return $suggested;
					}
				}
			}

			/*
			 * Inherit Featured Image for WooCommerce.
			 */
			if ( ! empty( $this->p->avail[ 'ecom' ][ 'woocommerce' ] ) ) {	// WooCommerce plugin is active.

				if ( empty( $this->p->options[ 'plugin_inherit_featured' ] ) ) {

					$notice_key = 'notice-wc-inherit-featured-disabled';

					if ( $this->p->notice->is_admin_pre_notices( $notice_key ) ) {

						if ( $notice_msg = $this->p->msgs->get( $notice_key ) ) {

							$this->p->notice->inf( $notice_msg, null, $notice_key, $dismiss_time = true );

							if ( ++$suggested >= $suggest_max ) return $suggested;
						}
					}
				}
			}

			return $suggested;
		}

		private function suggest_options_seo( $suggest_max ) {

			$suggested = 0;

			if ( empty( $this->p->avail[ 'seo' ][ 'any' ] ) ) {	// An SEO plugin is not active.

				/*
				 * If the option is not checked and not disabled, then show a notice and return.
				 */
				foreach ( array(
					'add_link_rel_canonical'    => 'link rel canonical',
					'add_link_rel_shortlink'    => 'link rel shortlink',
					'add_meta_name_description' => 'meta name description',
					'add_meta_name_robots'      => 'meta name robots',
				) as $opt_key => $tag_name ) {

					$notice_key = 'suggest-options-seo-' . $opt_key;

					if ( ! empty( $this->p->options[ $opt_key ] ) ) continue;

					if ( ! empty( $this->p->options[ $opt_key . ':disabled' ] ) ) continue;

					if ( ! $this->p->notice->is_admin_pre_notices( $notice_key ) ) continue;

					$seo_other_tab_link = $this->p->util->get_admin_url( 'advanced#sucom-tabset_head_tags-tab_seo_other',
						_x( 'SSO', 'menu title', 'wpsso' ) . ' &gt; ' .
						_x( 'Advanced Settings', 'lib file description', 'wpsso' ) . ' &gt; ' .
						_x( 'HTML Tags', 'metabox title', 'wpsso' ) . ' &gt; ' .
						_x( 'SEO / Other', 'metabox tab', 'wpsso' ) );

					$notice_msg = sprintf( __( 'Please note that the %s HTML tag is currently disabled and a known SEO plugin has not been detected.',
						'wpsso' ), '<code>' . $tag_name . '</code>' ) . ' ';

					$notice_msg .= sprintf( __( 'If another SEO plugin or your theme templates are not adding the %1$s HTML tag to your webpages, you should enable this option under the %2$s tab.', 'wpsso' ), '<code>' . $tag_name . '</code>', $seo_other_tab_link ) . ' ';

					$this->p->notice->inf( $notice_msg, null, $notice_key, $dismiss_time = true );

					if ( ++$suggested >= $suggest_max ) return $suggested;
				}
			}

			return $suggested;
		}
	}
}

```
