PHP Class The_SEO_Framework\Detect

Detects other plugins and themes
Since: 2.7.1
Inheritance: extends Render
Afficher le fichier Open project: sybrew/the-seo-framework

Méthodes publiques

Méthode Description
active_plugins ( ) : array Returns list of active plugins.
can_do_sitemap_robots ( ) : boolean Determines whether to add a line within robots based by plugin detection, or sitemap output option.
can_get_term_meta ( ) : boolean Determines whether we can use the new WordPress core term meta functionality.
can_i_use ( array $plugins = [], boolean $use_cache = true ) Detect if you can use the given constants, functions and classes.
can_manipulate_title ( ) : boolean Checks whether we can use special manipulation filters.
check_wp_locale ( string $locale = '', boolean $use_cache = true ) : boolean Detect WordPress language.
conflicting_plugins ( ) : array Filterable list of conflicting plugins.
current_theme_supports_title_tag ( ) : boolean Checks a theme's support for title-tag.
detect_og_plugin ( ) : boolean Determines if other Open Graph or SEO plugins are active.
detect_plugin ( array $plugins ) : boolean Detect active plugin by constant, class or function existence.
detect_plugin_multi ( array $plugins ) : boolean Detect active plugin by constant, class or function existence.
detect_seo_plugins ( ) : boolean Determines if other SEO plugins are active.
detect_sitemap_plugin ( ) : boolean Determines if other Sitemap plugins are active.
detect_theme_support ( $features, boolean $use_cache = true ) : boolean Checks for current theme support.
detect_twitter_card_plugin ( ) : boolean Determines if other Twitter Card plugins are active.
get_conflicting_plugins ( string $type = 'seo_tools' ) : array Fetches type of conflicting plugins.
get_supported_post_type ( boolean $public = true, string $post_type = '' ) : boolean | string Checks (current) Post Type for if this plugin may use it.
has_json_ld_plugin ( ) : boolean Determines if other Schema.org LD+Json plugins are active.
has_page_on_front ( ) : boolean Determines whether a page or blog is on front.
has_robots_txt ( ) : boolean Detects presence of robots.txt in root folder.
has_sitemap_xml ( ) : boolean Detects presence of sitemap.xml in root folder.
is_domainmapping_active ( ) : boolean Detects WPMUdev Domain Mapping plugin.
is_donncha_domainmapping_active ( ) : boolean Detects Donncha Domain Mapping plugin.
is_post_type_page ( string $type ) : boolean Detect if the current screen type is a page or taxonomy.
is_qtranslate_active ( ) : boolean Detect qTranslate X plugin.
is_theme ( string | array $themes = '' ) : boolean Checks if the (parent) theme name is loaded.
is_wpml_active ( ) : boolean Detects WPML plugin.
post_type_supports_custom_seo ( string $post_type = '' ) : boolean Check if post type supports The SEO Framework.
post_type_supports_inpost ( string | null $post_type = null ) : boolean Determines if the post type is compatible with The SEO Framework inpost metabox.
set_tell_title_doing_it_wrong ( null | string $title = null, null | string $sep = null, null | string $seplocation = null ) : void Sets up doing it wrong html code for in the footer.
tell_title_doing_it_wrong ( null | string $title = null, null | string $sep = null, null | string $seplocation = null, boolean $output = true ) : void Adds doing it wrong html code in the footer.
theme_title_doing_it_right ( ) : boolean Determines whether the theme is outputting the title correctly based on transient.
theme_title_fix_active ( ) : boolean Detect theme title fix extension plugin.
wp_version ( string $version = '4.3.0', string $compare = '>=' ) : boolean Determines if WP is above or below a version

Méthodes protégées

Méthode Description
__construct ( ) Constructor, load parent constructor

Method Details

__construct() protected méthode

Constructor, load parent constructor
protected __construct ( )

active_plugins() public méthode

Returns list of active plugins.
Since: 2.6.1
public active_plugins ( ) : array
Résultat array List of active plugins.

can_do_sitemap_robots() public méthode

Determines whether to add a line within robots based by plugin detection, or sitemap output option.
Since: 2.6.0
public can_do_sitemap_robots ( ) : boolean
Résultat boolean True when no conflicting plugins are detected or when The SEO Framework's Sitemaps are output.

can_get_term_meta() public méthode

Determines whether we can use the new WordPress core term meta functionality.
Since: 2.7.0
public can_get_term_meta ( ) : boolean
Résultat boolean True when WordPress is at version 4.4 or higher and has an accordingly upgraded database.

can_i_use() public méthode

All must be available to return true.
Since: 2.5.2
public can_i_use ( array $plugins = [], boolean $use_cache = true )
$plugins array Array of array for constants, classes and / or functions to check for plugin existence.
$use_cache boolean Bypasses cache if false

can_manipulate_title() public méthode

Checks whether we can use special manipulation filters.
Since: 2.6.0
public can_manipulate_title ( ) : boolean
Résultat boolean True if we can manipulate title.

check_wp_locale() public méthode

Considers en_UK, en_US, en, etc.
Since: 2.6.0
public check_wp_locale ( string $locale = '', boolean $use_cache = true ) : boolean
$locale string Required, the locale.
$use_cache boolean Set to false to bypass the cache.
Résultat boolean Whether the locale is in the WordPress locale.

conflicting_plugins() public méthode

Applies filters 'the_seo_framework_conflicting_plugins' : array
Since: 2.6.0
public conflicting_plugins ( ) : array
Résultat array List of conflicting plugins.

current_theme_supports_title_tag() public méthode

Checks a theme's support for title-tag.
Since: 2.6.0

detect_og_plugin() public méthode

Determines if other Open Graph or SEO plugins are active.
Since: 1.3.0 Applies filters 'the_seo_framework_og_plugin_detected' : bool
Since: 2.6.1
public detect_og_plugin ( ) : boolean
Résultat boolean True if OG or SEO plugin detected.

detect_plugin() public méthode

Detect active plugin by constant, class or function existence.
Since: 1.3.0
public detect_plugin ( array $plugins ) : boolean
$plugins array Array of array for constants, classes and / or functions to check for plugin existence.
Résultat boolean True if plugin exists or false if plugin constant, class or function not detected.

detect_plugin_multi() public méthode

All parameters must match and return true.
Since: 2.5.2
public detect_plugin_multi ( array $plugins ) : boolean
$plugins array Array of array for constants, classes and / or functions to check for plugin existence.
Résultat boolean True if ALL functions classes and constants exists or false if plugin constant, class or function not detected.

detect_seo_plugins() public méthode

Determines if other SEO plugins are active.
Since: 1.3.0 Applies filters 'the_seo_framework_seo_plugin_detected' : bool
Since: 2.6.1
public detect_seo_plugins ( ) : boolean
Résultat boolean SEO plugin detected.

detect_sitemap_plugin() public méthode

Determines if other Sitemap plugins are active.
Since: 2.1.0
public detect_sitemap_plugin ( ) : boolean
Résultat boolean

detect_theme_support() public méthode

Maintains detection cache, array and strings are mixed through foreach loops.
Since: 2.2.5
public detect_theme_support ( $features, boolean $use_cache = true ) : boolean
$use_cache boolean If set to false don't use cache.
Résultat boolean theme support.

detect_twitter_card_plugin() public méthode

Determines if other Twitter Card plugins are active.
Since: 2.6.0
public detect_twitter_card_plugin ( ) : boolean
Résultat boolean Twitter Card plugin detected.

get_conflicting_plugins() public méthode

Fetches type of conflicting plugins.
Since: 2.6.0
public get_conflicting_plugins ( string $type = 'seo_tools' ) : array
$type string The Key from $this->conflicting_plugins()
Résultat array

get_supported_post_type() public méthode

Checks (current) Post Type for if this plugin may use it.
Since: 2.6.0
public get_supported_post_type ( boolean $public = true, string $post_type = '' ) : boolean | string
$public boolean Whether to only get Public Post types.
$post_type string Optional. The post type to check.
Résultat boolean | string The Allowed Post Type.

has_json_ld_plugin() public méthode

Determines if other Schema.org LD+Json plugins are active.
Since: 1.3.0
Since: 2.6.1 Always return false. Let other plugin authors decide its value.
public has_json_ld_plugin ( ) : boolean
Résultat boolean Whether another Schema.org plugin is active.

has_page_on_front() public méthode

Determines whether a page or blog is on front.
Since: 2.6.0
public has_page_on_front ( ) : boolean
Résultat boolean

has_robots_txt() public méthode

Detects presence of robots.txt in root folder.
Since: 2.5.2
public has_robots_txt ( ) : boolean
Résultat boolean Whether the robots.txt file exists.

has_sitemap_xml() public méthode

Detects presence of sitemap.xml in root folder.
Since: 2.5.2
public has_sitemap_xml ( ) : boolean
Résultat boolean Whether the sitemap.xml file exists.

is_domainmapping_active() public méthode

Detects WPMUdev Domain Mapping plugin.
Since: 2.3.0
public is_domainmapping_active ( ) : boolean
Résultat boolean

is_donncha_domainmapping_active() public méthode

Detects Donncha Domain Mapping plugin.
Since: 2.4.0

is_post_type_page() public méthode

Detect if the current screen type is a page or taxonomy.
Since: 2.3.1
public is_post_type_page ( string $type ) : boolean
$type string the Screen type
Résultat boolean true if post type is a page or post

is_qtranslate_active() public méthode

Detect qTranslate X plugin.
Since: 2.6.0
public is_qtranslate_active ( ) : boolean
Résultat boolean

is_theme() public méthode

Checks if the (parent) theme name is loaded.
Since: 2.1.0
public is_theme ( string | array $themes = '' ) : boolean
$themes string | array the current theme name.
Résultat boolean is theme active.

is_wpml_active() public méthode

Detects WPML plugin.
Since: 2.6.0
public is_wpml_active ( ) : boolean
Résultat boolean

post_type_supports_custom_seo() public méthode

Doesn't work on admin_init.
Since: 2.3.9
public post_type_supports_custom_seo ( string $post_type = '' ) : boolean
$post_type string The current post type.
Résultat boolean true of post type is supported.

post_type_supports_inpost() public méthode

Determines if the post type is compatible with The SEO Framework inpost metabox.
Since: 2.3.5
public post_type_supports_inpost ( string | null $post_type = null ) : boolean
$post_type string | null
Résultat boolean True if post type is supported.

set_tell_title_doing_it_wrong() public méthode

Sets up doing it wrong html code for in the footer.
Since: 2.7.0
public set_tell_title_doing_it_wrong ( null | string $title = null, null | string $sep = null, null | string $seplocation = null ) : void
$title null | string The given title
$sep null | string The separator
$seplocation null | string Whether the blogname is left or right.
Résultat void

tell_title_doing_it_wrong() public méthode

Adds doing it wrong html code in the footer.
Since: 2.5.2.1
public tell_title_doing_it_wrong ( null | string $title = null, null | string $sep = null, null | string $seplocation = null, boolean $output = true ) : void
$title null | string The given title
$sep null | string The separator
$seplocation null | string Whether the blogname is left or right.
$output boolean Whether to store cache values or echo the output in the footer.
Résultat void

theme_title_doing_it_right() public méthode

Determines whether the theme is outputting the title correctly based on transient.
Since: 2.5.2
public theme_title_doing_it_right ( ) : boolean
Résultat boolean True theme is doing it right.

theme_title_fix_active() public méthode

Detect theme title fix extension plugin.
Since: 2.6.0
public theme_title_fix_active ( ) : boolean
Résultat boolean True theme will do it right.

wp_version() public méthode

Determines if WP is above or below a version
Since: 2.2.1
Since: 2.3.8
public wp_version ( string $version = '4.3.0', string $compare = '>=' ) : boolean
$version string the three part version to compare to WordPress
$compare string the comparing operator, default "$version >= Current WP Version"
Résultat boolean True if the WordPress version comparison passes. Note: When using $compare = '>' it will be false when they are equal.