.3
* @codeCoverageIgnore
*
* @return bool Whether or not WooCommerce is active.
*/
public static function is_woocommerce_active() {
_deprecated_function( __METHOD__, 'WPSEO 15.3' );
return YoastSEO()->helpers->woocommerce->is_active();
}
/**
* Outputs a Schema blob.
*
* @deprecated 15.5
* @codeCoverageIgnore
*
* @param array $graph The Schema graph array to output.
* @param string $class_to_add The (optional) class to add to the script tag.
*
* @return bool
*/
public static function schema_output( $graph, $class_to_add = 'yoast-schema-graph' ) {
_deprecated_function( __METHOD__, 'WPSEO 15.5' );
if ( ! is_array( $graph ) || empty( $graph ) ) {
return false;
}
// phpcs:ignore WordPress.Security.EscapeOutput -- Escaping happens in WPSEO_Utils::schema_tag, which should be whitelisted.
echo self::schema_tag( $graph, $class_to_add );
return true;
}
/**
* Returns a script tag with Schema blob.
*
* @deprecated 15.5
* @codeCoverageIgnore
*
* @param array $graph The Schema graph array to output.
* @param string $class_to_add The (optional) class to add to the script tag.
*
* @return false|string A schema blob with script tags.
*/
public static function schema_tag( $graph, $class_to_add = 'yoast-schema-graph' ) {
_deprecated_function( __METHOD__, 'WPSEO 15.5' );
if ( ! is_array( $graph ) || empty( $graph ) ) {
return false;
}
$output = [
'@context' => 'https://schema.org',
'@graph' => $graph,
];
return "' . "\n";
}
/**
* Returns the SVG for the traffic light in the metabox.
*
* @deprecated 15.5
* @codeCoverageIgnore
*
* @return string
*/
public static function traffic_light_svg() {
_deprecated_function( __METHOD__, 'WPSEO 15.5' );
return <<<'SVG'
SVG;
}
/**
* Gets the plugin name from file.
*
* @since 2.3.3
* @deprecated 15.5
* @codeCoverageIgnore
*
* @param string $plugin Plugin path relative to plugins directory.
*
* @return string|bool
*/
public static function get_plugin_name( $plugin ) {
_deprecated_function( __METHOD__, 'WPSEO 15.5' );
$plugin_details = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
if ( $plugin_details['Name'] !== '' ) {
return $plugin_details['Name'];
}
return false;
}
/**
* Returns a base64 URL for the svg for use in the menu.
*
* @since 3.3.0
* @deprecated 15.5
* @codeCoverageIgnore
*
* @param bool $base64 Whether or not to return base64'd output.
*
* @return string
*/
public static function get_icon_svg( $base64 = true ) {
_deprecated_function( __METHOD__, 'WPSEO 15.5' );
$svg = '';
if ( $base64 ) {
//phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode -- This encoding is intended.
return 'data:image/svg+xml;base64,' . base64_encode( $svg );
}
return $svg;
}
/**
* Checks whether the current user is allowed to access the configuration.
*
* @since 1.8.0
* @deprecated 15.5
* @codeCoverageIgnore
*
* @return bool
*/
public static function grant_access() {
_deprecated_function( __METHOD__, 'WPSEO 15.5' );
if ( ! is_multisite() ) {
return true;
}
$options = get_site_option( 'wpseo_ms' );
if ( empty( $options['access'] ) || $options['access'] === 'admin' ) {
return current_user_can( 'wpseo_manage_options' );
}
return is_super_admin();
}
}