HEX
Server: Apache
System: Linux cpanelx.inxs.ro 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: crowdandsafety (1041)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/cwd/wp-content/plugins/seo-by-rank-math/includes/admin/wizard/class-role.php
<?php
/**
 * The Role wizard step
 *
 * @since      0.9.0
 * @package    RankMath
 * @subpackage RankMath\Wizard
 * @author     Rank Math <support@rankmath.com>
 */

namespace RankMath\Wizard;

use RankMath\Helper;
use RankMath\Role_Manager\Capability_Manager;

defined( 'ABSPATH' ) || exit;

/**
 * Step class.
 */
class Role implements Wizard_Step {
	/**
	 * Get Localized data to be used in the Compatibility step.
	 *
	 * @return array
	 */
	public static function get_localized_data() {
		Helper::is_configured( true );

		return array_merge(
			Helper::get_roles_capabilities(),
			[
				'role_manager' => Helper::is_module_active( 'role-manager' ),
				'roles'        => Helper::get_roles(),
				'capabilities' => Capability_Manager::get()->get_capabilities(),
			]
		);
	}

	/**
	 * Save handler for step.
	 *
	 * @param array $values Values to save.
	 *
	 * @return bool
	 */
	public static function save( $values ) {
		if ( empty( $values ) ) {
			return false;
		}

		Helper::update_modules( [ 'role-manager' => $values['role_manager'] ? 'on' : 'off' ] );
		Helper::set_capabilities( $values );
		return true;
	}
}