✘✘ 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.224
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/tdhomesa/public_html/wp-content/plugins/woocommerce/src/Admin/API//Options.php
<?php
/**
 * REST API Options Controller
 *
 * Handles requests to get and update options in the wp_options table.
 *
 * IMPORTANT: This API is for legacy support only. DO NOT add new options here. See p90Yrv-2vK-p2#comment-6482 for more details.
 * For new settings/options, use Settings REST API (https://woocommerce.github.io/woocommerce-rest-api-docs/#setting-option-properties) or create dedicated endpoints instead.
 *
 * Example:
 * - Use register_rest_route() to create a new endpoint
 * - Follow WooCommerce REST API standards
 * - Implement proper permission checks
 * - Add proper documentation
 * See Automattic\WooCommerce\Admin\API\OnboardingProfile for examples.
 */

declare(strict_types=1);

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * Options Controller.
 *
 * @deprecated since 6.2.0
 *
 * @extends WC_REST_Data_Controller
 */
class Options extends \WC_REST_Data_Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'options';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_options' ),
					'permission_callback' => array( $this, 'get_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'update_options' ),
					'permission_callback' => array( $this, 'update_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_item_schema' ),
			)
		);
	}

	/**
	 * Check if a given request has access to get options.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_item_permissions_check( $request ) {
		$params = ( isset( $request['options'] ) && is_string( $request['options'] ) ) ? explode( ',', $request['options'] ) : array();

		if ( ! $params ) {
			return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'You must supply an array of options.', 'woocommerce' ), 500 );
		}

		foreach ( $params as $option ) {
			if ( ! $this->user_has_permission( $option, $request ) ) {
				return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot view these options.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
			}
		}

		return true;
	}

	/**
	 * Check if the user has permission given an option name.
	 *
	 * @param  string          $option Option name.
	 * @param  WP_REST_Request $request Full details about the request.
	 * @param  bool            $is_update If the request is to update the option.
	 * @return boolean
	 */
	public function user_has_permission( $option, $request, $is_update = false ) {
		$permissions = $this->get_option_permissions( $request );

		if ( isset( $permissions[ $option ] ) ) {
			return $permissions[ $option ];
		}

		wc_deprecated_function( 'Automattic\WooCommerce\Admin\API\Options::' . ( $is_update ? 'update_options' : 'get_options' ), '6.3' );

		// Disallow option updates in non-production environments unless the option is whitelisted, prompting developers to create specific endpoints in case they miss the deprecation notice.
		if ( 'production' !== wp_get_environment_type() ) {
			return false;
		}

		return current_user_can( 'manage_options' );
	}

	/**
	 * Check if a given request has access to update options.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function update_item_permissions_check( $request ) {
		$params = $request->get_json_params();

		if ( ! is_array( $params ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'You must supply an array of options and values.', 'woocommerce' ), 500 );
		}

		foreach ( $params as $option_name => $option_value ) {
			if ( ! $this->user_has_permission( $option_name, $request, true ) ) {
				return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage these options.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
			}
		}

		return true;
	}

	/**
	 * Get an array of options and respective permissions for the current user.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return array
	 */
	public function get_option_permissions( $request ) {
		$permissions = self::get_default_option_permissions();
		return apply_filters_deprecated( 'woocommerce_rest_api_option_permissions', array( $permissions, $request ), '6.3.0' );
	}

	/**
	 * Get the default available option permissions.
	 *
	 * @return array
	 */
	public static function get_default_option_permissions() {
		$is_woocommerce_admin = \Automattic\WooCommerce\Internal\Admin\Homescreen::is_admin_user();

		/**
		 * IMPORTANT: This list is frozen for legacy support.
		 * New options MUST use dedicated endpoints instead of being added here.
		 */
		$legacy_whitelisted_options = array(
			'woocommerce_setup_jetpack_opted_in',
			'woocommerce_stripe_settings',
			'woocommerce-ppcp-settings',
			'woocommerce_ppcp-gateway_setting',
			'woocommerce_demo_store',
			'woocommerce_demo_store_notice',
			'woocommerce_ces_tracks_queue',
			'woocommerce_navigation_intro_modal_dismissed',
			'woocommerce_shipping_dismissed_timestamp',
			'woocommerce_allow_tracking',
			'woocommerce_task_list_keep_completed',
			'woocommerce_default_homepage_layout',
			'woocommerce_setup_jetpack_opted_in',
			'woocommerce_no_sales_tax',
			'woocommerce_calc_taxes',
			'woocommerce_bacs_settings',
			'woocommerce_bacs_accounts',
			'woocommerce_settings_shipping_recommendations_hidden',
			'woocommerce_task_list_dismissed_tasks',
			'woocommerce_setting_payments_recommendations_hidden',
			'woocommerce_navigation_favorites_tooltip_hidden',
			'woocommerce_admin_transient_notices_queue',
			'woocommerce_task_list_hidden',
			'woocommerce_task_list_complete',
			'woocommerce_extended_task_list_hidden',
			'woocommerce_ces_shown_for_actions',
			'woocommerce_clear_ces_tracks_queue_for_page',
			'woocommerce_admin_install_timestamp',
			'woocommerce_task_list_tracked_completed_tasks',
			'woocommerce_show_marketplace_suggestions',
			'woocommerce_task_list_reminder_bar_hidden',
			'wc_connect_options',
			'woocommerce_admin_created_default_shipping_zones',
			'woocommerce_admin_reviewed_default_shipping_zones',
			'woocommerce_admin_reviewed_store_location_settings',
			'woocommerce_ces_product_feedback_shown',
			'woocommerce_marketing_overview_multichannel_banner_dismissed',
			'woocommerce_manage_stock',
			'woocommerce_dimension_unit',
			'woocommerce_weight_unit',
			'woocommerce_product_editor_show_feedback_bar',
			'woocommerce_single_variation_notice_dismissed',
			'woocommerce_product_tour_modal_hidden',
			'woocommerce_block_product_tour_shown',
			'woocommerce_revenue_report_date_tour_shown',
			'woocommerce_orders_report_date_tour_shown',
			'woocommerce_show_prepublish_checks_enabled',
			'woocommerce_date_type',
			'date_format',
			'time_format',
			'woocommerce_onboarding_profile',
			'woocommerce_default_country',
			'blogname',
			'wcpay_welcome_page_incentives_dismissed',
			'wcpay_welcome_page_viewed_timestamp',
			'wcpay_welcome_page_exit_survey_more_info_needed_timestamp',
			'woocommerce_customize_store_onboarding_tour_hidden',
			'woocommerce_customize_store_ai_suggestions',
			'woocommerce_admin_customize_store_completed',
			'woocommerce_admin_customize_store_completed_theme_id',
			'woocommerce_admin_customize_store_survey_completed',
			'woocommerce_coming_soon',
			'woocommerce_store_pages_only',
			'woocommerce_private_link',
			'woocommerce_share_key',
			'woocommerce_show_lys_tour',
			'woocommerce_remote_variant_assignment',
			'woocommerce_gateway_order',
			'woocommerce_woopayments_nox_profile',
			// WC Test helper options.
			'wc-admin-test-helper-rest-api-filters',
			'wc_admin_helper_feature_values',
		);

		$theme_permissions = array(
			'theme_mods_' . get_stylesheet() => current_user_can( 'edit_theme_options' ),
			'stylesheet'                     => current_user_can( 'edit_theme_options' ),
		);

		return array_merge(
			array_fill_keys( $theme_permissions, current_user_can( 'edit_theme_options' ) ),
			array_fill_keys( $legacy_whitelisted_options, $is_woocommerce_admin )
		);
	}

	/**
	 * Gets an array of options and respective values.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return array Options object with option values.
	 */
	public function get_options( $request ) {
		$options = array();

		if ( empty( $request['options'] ) || ! is_string( $request['options'] ) ) {
			return $options;
		}

		$params = explode( ',', $request['options'] );
		foreach ( $params as $option ) {
			$options[ $option ] = get_option( $option );
		}

		return $options;
	}

	/**
	 * Updates an array of objects.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return array Options object with a boolean if the option was updated.
	 */
	public function update_options( $request ) {
		$params  = $request->get_json_params();
		$updated = array();

		if ( ! is_array( $params ) ) {
			return array();
		}

		foreach ( $params as $key => $value ) {
			$updated[ $key ] = update_option( $key, $value );
		}

		return $updated;
	}

	/**
	 * Get the schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'options',
			'type'       => 'object',
			'properties' => array(
				'options' => array(
					'type'        => 'array',
					'description' => __( 'Array of options with associated values.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}
}


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


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
AI
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Reports
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Templates
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
AnalyticsImports.php
9.086 KB
19 Jan 2026 2.46 PM
tdhomesa / tdhomesa
0644
Coupons.php
2.15 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
CustomAttributeTraits.php
3.402 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
Customers.php
2.112 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
Data.php
0.917 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
DataCountries.php
1.122 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
DataDownloadIPs.php
4.148 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
Experiments.php
1.82 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
Features.php
1.699 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
Init.php
10.569 KB
19 Jan 2026 2.46 PM
tdhomesa / tdhomesa
0644
LaunchYourStore.php
5.149 KB
18 Dec 2024 10.19 PM
tdhomesa / tdhomesa
0644
Leaderboards.php
18.223 KB
30 Jul 2024 7.31 PM
tdhomesa / tdhomesa
0644
Marketing.php
4.896 KB
5 May 2026 2.26 PM
tdhomesa / tdhomesa
0644
MarketingCampaignTypes.php
6.016 KB
25 Jan 2023 3.19 AM
tdhomesa / tdhomesa
0644
MarketingCampaigns.php
9.637 KB
26 Mar 2024 4.56 PM
tdhomesa / tdhomesa
0644
MarketingChannels.php
5.74 KB
25 Jan 2023 3.19 AM
tdhomesa / tdhomesa
0644
MarketingOverview.php
3.414 KB
5 May 2026 2.26 PM
tdhomesa / tdhomesa
0644
MarketingRecommendations.php
5.942 KB
30 Jan 2024 11.24 PM
tdhomesa / tdhomesa
0644
MobileAppMagicLink.php
2.097 KB
20 Sep 2022 10.53 PM
tdhomesa / tdhomesa
0644
NoteActions.php
2.392 KB
21 Mar 2023 8.45 PM
tdhomesa / tdhomesa
0644
Notes.php
25.317 KB
23 Feb 2026 5.58 PM
tdhomesa / tdhomesa
0644
Notice.php
2.38 KB
3 Mar 2025 10.28 PM
tdhomesa / tdhomesa
0644
OnboardingFreeExtensions.php
2.577 KB
30 Jul 2024 7.31 PM
tdhomesa / tdhomesa
0644
OnboardingPlugins.php
10.768 KB
5 May 2026 2.26 PM
tdhomesa / tdhomesa
0644
OnboardingProductTypes.php
1.797 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
OnboardingProducts.php
1.937 KB
30 Jan 2024 11.24 PM
tdhomesa / tdhomesa
0644
OnboardingProfile.php
18.376 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
OnboardingTasks.php
32.021 KB
6 Oct 2025 5.56 PM
tdhomesa / tdhomesa
0644
OnboardingThemes.php
5.488 KB
6 Oct 2025 5.56 PM
tdhomesa / tdhomesa
0644
Options.php
9.996 KB
26 May 2025 7.11 PM
tdhomesa / tdhomesa
0644
Orders.php
10.133 KB
30 Jul 2024 7.31 PM
tdhomesa / tdhomesa
0644
PaymentGatewaySuggestions.php
5.909 KB
5 May 2026 2.26 PM
tdhomesa / tdhomesa
0644
Plugins.php
21.271 KB
5 May 2026 2.26 PM
tdhomesa / tdhomesa
0644
ProductAttributeTerms.php
4.362 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
ProductAttributes.php
4.461 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
ProductCategories.php
0.447 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
ProductForm.php
3.063 KB
22 Feb 2023 7.17 AM
tdhomesa / tdhomesa
0644
ProductReviews.php
1.299 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
ProductVariations.php
6.033 KB
21 Jan 2025 6.53 PM
tdhomesa / tdhomesa
0644
Products.php
9.729 KB
21 Oct 2024 11.53 PM
tdhomesa / tdhomesa
0644
ProductsLowInStock.php
17.623 KB
23 Feb 2026 5.58 PM
tdhomesa / tdhomesa
0644
SettingOptions.php
0.857 KB
21 Mar 2023 8.45 PM
tdhomesa / tdhomesa
0644
Settings.php
4.198 KB
3 Mar 2025 10.28 PM
tdhomesa / tdhomesa
0644
ShippingPartnerSuggestions.php
6.328 KB
11 May 2026 5.17 PM
tdhomesa / tdhomesa
0644
Taxes.php
4.902 KB
20 Apr 2022 6.50 AM
tdhomesa / tdhomesa
0644
Themes.php
6.116 KB
27 Feb 2024 6.59 PM
tdhomesa / tdhomesa
0644

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