/** * WPSEO plugin file. * * @package WPSEO\Internals */ if ( ! defined( 'WPSEO_VERSION' ) ) { header( 'Status: 403 Forbidden' ); header( 'HTTP/1.1 403 Forbidden' ); exit(); } /** * Initializes the admin bar. * * @return void */ function wpseo_initialize_admin_bar() { $admin_bar_menu = new WPSEO_Admin_Bar_Menu(); $admin_bar_menu->register_hooks(); } add_action( 'wp_loaded', 'wpseo_initialize_admin_bar' ); /** * Allows editing of the meta fields through weblog editors like Marsedit. * * @param array $required_capabilities Capabilities that must all be true to allow action. * @param array $capabilities Array of capabilities to be checked, unused here. * @param array $args List of arguments for the specific capabilities to be checked. * * @return array $required_capabilities Filtered capabilities. */ function allow_custom_field_edits( $required_capabilities, $capabilities, $args ) { if ( ! in_array( $args[0], array( 'edit_post_meta', 'add_post_meta' ), true ) ) { return $required_capabilities; } // If this is provided, it is the post ID. if ( empty( $args[2] ) ) { return $required_capabilities; } // If this is provided, it is the custom field. if ( empty( $args[3] ) ) { return $required_capabilities; } // If the meta key is part of the plugin, grant capabilities accordingly. if ( strpos( $args[3], WPSEO_Meta::$meta_prefix ) === 0 && current_user_can( 'edit_post', $args[2] ) ) { $required_capabilities[ $args[0] ] = true; } return $required_capabilities; } add_filter( 'user_has_cap', 'allow_custom_field_edits', 0, 3 ); /* ********************* DEPRECATED FUNCTIONS ********************* */ /** * Adds an SEO admin bar menu to the site admin, with several options. * * If the current user is an admin they can also go straight to several settings menus from here. * * @deprecated 7.9 Use WPSEO_Admin_Bar_Menu::add_menu() instead. * @codeCoverageIgnore * * @return void */ function wpseo_admin_bar_menu() { _deprecated_function( __FUNCTION__, 'WPSEO 7.9', 'WPSEO_Admin_Bar_Menu::add_menu()' ); // Only use this admin bar menu for the site admin. if ( is_admin() && ! is_blog_admin() ) { return; } $options = WPSEO_Options::get_options( array( 'wpseo', 'wpseo_ms' ) ); if ( $options['enable_admin_bar_menu'] !== true ) { return; } global $wp_admin_bar; $admin_bar_menu = new WPSEO_Admin_Bar_Menu(); $admin_bar_menu->add_menu( $wp_admin_bar ); } /** * Returns the SEO score element for the admin bar. * * @deprecated 7.9 * @codeCoverageIgnore * * @return string */ function wpseo_adminbar_seo_score() { _deprecated_function( __FUNCTION__, 'WPSEO 7.9', null ); $rating = WPSEO_Meta::get_value( 'linkdex', get_the_ID() ); return wpseo_adminbar_score( $rating ); } /** * Returns the content score element for the adminbar. * * @deprecated 7.9 * @codeCoverageIgnore * * @return string */ function wpseo_adminbar_content_score() { _deprecated_function( __FUNCTION__, 'WPSEO 7.9', null ); $rating = WPSEO_Meta::get_value( 'content_score', get_the_ID() ); return wpseo_adminbar_score( $rating ); } /** * Returns the SEO score element for the adminbar. * * @deprecated 7.9 * @codeCoverageIgnore * * @return string */ function wpseo_tax_adminbar_seo_score() { _deprecated_function( __FUNCTION__, 'WPSEO 7.9', null ); $rating = 0; if ( is_tax() || is_category() || is_tag() ) { $rating = WPSEO_Taxonomy_Meta::get_meta_without_term( 'linkdex' ); } return wpseo_adminbar_score( $rating ); } /** * Returns the Content score element for the adminbar. * * @deprecated 7.9 * @codeCoverageIgnore * * @return string */ function wpseo_tax_adminbar_content_score() { _deprecated_function( __FUNCTION__, 'WPSEO 7.9', null ); $rating = 0; if ( is_tax() || is_category() || is_tag() ) { $rating = WPSEO_Taxonomy_Meta::get_meta_without_term( 'content_score' ); } return wpseo_adminbar_score( $rating ); } /** * Takes The SEO score and makes the score icon for the adminbar with it. * * @deprecated 7.9 * @codeCoverageIgnore * * @param int $score The 0-100 rating of the score. Can be either SEO score or content score. * * @return string $score_adminbar_element */ function wpseo_adminbar_score( $score ) { _deprecated_function( __FUNCTION__, 'WPSEO 7.9', null ); $score = WPSEO_Utils::translate_score( $score ); $score_adminbar_element = '
'; return $score_adminbar_element; } /** * Enqueue CSS to format the Yoast SEO adminbar item. * * @deprecated 7.9 Use WPSEO_Admin_Bar_Menu::enqueue_assets() instead. * @codeCoverageIgnore */ function wpseo_admin_bar_style() { _deprecated_function( __FUNCTION__, 'WPSEO 7.9', 'WPSEO_Admin_Bar_Menu::enqueue_assets()' ); if ( ! is_admin_bar_showing() || WPSEO_Options::get( 'enable_admin_bar_menu' ) !== true ) { return; } if ( is_admin() && ! is_blog_admin() ) { return; } $admin_bar_menu = new WPSEO_Admin_Bar_Menu(); $admin_bar_menu->enqueue_assets(); } /** * Detects if the advanced settings are enabled. * * @deprecated 7.0 * @codeCoverageIgnore */ function wpseo_advanced_settings_enabled() { _deprecated_function( __FUNCTION__, 'WPSEO 7.0', null ); } /** * WPSEO plugin file. * * @package WPSEO\Admin */ /** * Determines the location of an asset within the SEO plugin. */ final class WPSEO_Admin_Asset_SEO_Location implements WPSEO_Admin_Asset_Location { /** * Path to the plugin file. * * @var string */ protected $plugin_file; /** * The plugin file to base the asset location upon. * * @param string $plugin_file The plugin file string. */ public function __construct( $plugin_file ) { $this->plugin_file = $plugin_file; } /** * Determines the URL of the asset on the dev server. * * @param WPSEO_Admin_Asset $asset The asset to determine the URL for. * @param string $type The type of asset. Usually JS or CSS. * * @return string The URL of the asset. */ public function get_url( WPSEO_Admin_Asset $asset, $type ) { $path = $this->get_path( $asset, $type ); if ( empty( $path ) ) { return ''; } if ( YOAST_ENVIRONMENT !== 'development' && ! $asset->get_suffix() ) { $plugin_path = plugin_dir_path( $this->plugin_file ); if ( ! file_exists( $plugin_path . $path ) ) { // Give a notice to the user in the console (only once). WPSEO_Utils::javascript_console_notification( 'Development Files', sprintf( /* translators: %1$s resolves to https://github.com/Yoast/wordpress-seo */ __( 'You are trying to load non-minified files. These are only available in our development package. Check out %1$s to see all the source files.', 'wordpress-seo' ), 'https://github.com/Yoast/wordpress-seo' ), true ); // Just load the .min file. $path = $this->get_path( $asset, $type, '.min' ); } } return plugins_url( $path, $this->plugin_file ); } /** * Determines the path relative to the plugin folder of an asset. * * @param WPSEO_Admin_Asset $asset The asset to determine the path * for. * @param string $type The type of asset. * @param string|null $force_suffix The suffix to force, or null when * to use the default suffix. * * @return string The path to the asset file. */ protected function get_path( WPSEO_Admin_Asset $asset, $type, $force_suffix = null ) { $relative_path = ''; $rtl_suffix = ''; $suffix = ( $force_suffix === null ) ? $asset->get_suffix() : $force_suffix; switch ( $type ) { case WPSEO_Admin_Asset::TYPE_JS: $relative_path = 'js/dist/' . $asset->get_src() . $suffix . '.js'; break; case WPSEO_Admin_Asset::TYPE_CSS: // Path and suffix for RTL stylesheets. if ( function_exists( 'is_rtl' ) && is_rtl() && $asset->has_rtl() ) { $rtl_suffix = '-rtl'; } $relative_path = 'css/dist/' . $asset->get_src() . $rtl_suffix . $suffix . '.css'; break; } return $relative_path; } }
Fatal error: Uncaught Error: Class 'WPSEO_Admin_Asset_SEO_Location' not found in /home/giantwar/public_html/blackbadu.net/wp-content/plugins/wordpress-seo-premium/admin/class-admin-asset-manager.php:176 Stack trace: #0 /home/giantwar/public_html/blackbadu.net/wp-content/plugins/wordpress-seo-premium/admin/class-admin-asset-manager.php(45): WPSEO_Admin_Asset_Manager::create_default_location() #1 /home/giantwar/public_html/blackbadu.net/wp-content/plugins/wordpress-seo-premium/inc/class-structured-data-blocks.php(24): WPSEO_Admin_Asset_Manager->__construct() #2 /home/giantwar/public_html/blackbadu.net/wp-content/plugins/wordpress-seo-premium/wp-seo-main.php(334): WPSEO_Structured_Data_Blocks->__construct() #3 /home/giantwar/public_html/blackbadu.net/wp-includes/class-wp-hook.php(287): wpseo_init('') #4 /home/giantwar/public_html/blackbadu.net/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #5 /home/giantwar/public_html/blackbadu.net/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #6 /home/gian in /home/giantwar/public_html/blackbadu.net/wp-content/plugins/wordpress-seo-premium/admin/class-admin-asset-manager.php on line 176