Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/woocomme.../src/Internal/Features
File: FeaturesController.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* FeaturesController class file
[2] Fix | Delete
*/
[3] Fix | Delete
[4] Fix | Delete
declare( strict_types=1 );
[5] Fix | Delete
[6] Fix | Delete
namespace Automattic\WooCommerce\Internal\Features;
[7] Fix | Delete
[8] Fix | Delete
use Automattic\WooCommerce\Internal\Admin\EmailPreview\EmailPreview;
[9] Fix | Delete
use WC_Tracks;
[10] Fix | Delete
use WC_Site_Tracking;
[11] Fix | Delete
use Automattic\Jetpack\Constants;
[12] Fix | Delete
use Automattic\WooCommerce\Internal\Admin\Analytics;
[13] Fix | Delete
use Automattic\WooCommerce\Internal\Caches\ProductCacheController;
[14] Fix | Delete
use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
[15] Fix | Delete
use Automattic\WooCommerce\Internal\CostOfGoodsSold\CostOfGoodsSoldController;
[16] Fix | Delete
use Automattic\WooCommerce\Internal\PushNotifications\PushNotifications;
[17] Fix | Delete
use Automattic\WooCommerce\Proxies\LegacyProxy;
[18] Fix | Delete
use Automattic\WooCommerce\Utilities\ArrayUtil;
[19] Fix | Delete
use Automattic\WooCommerce\Utilities\PluginUtil;
[20] Fix | Delete
use Automattic\WooCommerce\Enums\FeaturePluginCompatibility;
[21] Fix | Delete
[22] Fix | Delete
defined( 'ABSPATH' ) || exit;
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* Class to define the WooCommerce features that can be enabled and disabled by admin users,
[26] Fix | Delete
* provides also a mechanism for WooCommerce plugins to declare that they are compatible
[27] Fix | Delete
* (or incompatible) with a given feature.
[28] Fix | Delete
*
[29] Fix | Delete
* Note: the 'woocommerce_register_feature_definitions' hook allows registering new features
[30] Fix | Delete
* externally. This hook is deprecated, features should be registered from within get_feature_definitions.
[31] Fix | Delete
* However, in case you use it for testing purposes, keep in mind that the hook is fired from inside 'init';
[32] Fix | Delete
* therefore, features that need to be queried, enabled, or disabled before 'init' (e.g. during WP CLI initialization)
[33] Fix | Delete
* can't be registered using the hook.
[34] Fix | Delete
*/
[35] Fix | Delete
class FeaturesController {
[36] Fix | Delete
[37] Fix | Delete
public const FEATURE_ENABLED_CHANGED_ACTION = 'woocommerce_feature_enabled_changed';
[38] Fix | Delete
[39] Fix | Delete
public const PLUGINS_COMPATIBLE_BY_DEFAULT_OPTION = 'woocommerce_plugins_are_compatible_with_features_by_default';
[40] Fix | Delete
[41] Fix | Delete
/**
[42] Fix | Delete
* The existing feature definitions.
[43] Fix | Delete
*
[44] Fix | Delete
* @var array[]
[45] Fix | Delete
*/
[46] Fix | Delete
private $features = array();
[47] Fix | Delete
[48] Fix | Delete
/**
[49] Fix | Delete
* The registered compatibility info for WooCommerce plugins, with plugin names as keys.
[50] Fix | Delete
*
[51] Fix | Delete
* @var array
[52] Fix | Delete
*/
[53] Fix | Delete
private $compatibility_info_by_plugin = array();
[54] Fix | Delete
[55] Fix | Delete
/**
[56] Fix | Delete
* The registered compatibility info for WooCommerce plugins, with feature ids as keys.
[57] Fix | Delete
*
[58] Fix | Delete
* @var array
[59] Fix | Delete
*/
[60] Fix | Delete
private $compatibility_info_by_feature = array();
[61] Fix | Delete
[62] Fix | Delete
/**
[63] Fix | Delete
* Pending compatibility declarations. Format is [feature_id, plugin_file, positive_compatibility].
[64] Fix | Delete
*
[65] Fix | Delete
* @var array
[66] Fix | Delete
*/
[67] Fix | Delete
private $pending_declarations = array();
[68] Fix | Delete
[69] Fix | Delete
/**
[70] Fix | Delete
* The LegacyProxy instance to use.
[71] Fix | Delete
*
[72] Fix | Delete
* @var LegacyProxy
[73] Fix | Delete
*/
[74] Fix | Delete
private $proxy;
[75] Fix | Delete
[76] Fix | Delete
/**
[77] Fix | Delete
* The PluginUtil instance to use.
[78] Fix | Delete
*
[79] Fix | Delete
* @var PluginUtil
[80] Fix | Delete
*/
[81] Fix | Delete
private $plugin_util;
[82] Fix | Delete
[83] Fix | Delete
/**
[84] Fix | Delete
* Flag indicating that features will be enableable from the settings page
[85] Fix | Delete
* even when they are incompatible with active plugins.
[86] Fix | Delete
*
[87] Fix | Delete
* @var bool
[88] Fix | Delete
*/
[89] Fix | Delete
private $force_allow_enabling_features = false;
[90] Fix | Delete
[91] Fix | Delete
/**
[92] Fix | Delete
* Flag indicating that plugins will be activable from the plugins page
[93] Fix | Delete
* even when they are incompatible with enabled features.
[94] Fix | Delete
*
[95] Fix | Delete
* @var bool
[96] Fix | Delete
*/
[97] Fix | Delete
private $force_allow_enabling_plugins = false;
[98] Fix | Delete
[99] Fix | Delete
/**
[100] Fix | Delete
* List of plugins excluded from feature compatibility warnings in UI.
[101] Fix | Delete
*
[102] Fix | Delete
* @var string[]
[103] Fix | Delete
*/
[104] Fix | Delete
private $plugins_excluded_from_compatibility_ui;
[105] Fix | Delete
[106] Fix | Delete
/**
[107] Fix | Delete
* Flag indicating if additional features have been registered already
[108] Fix | Delete
* via woocommerce_register_feature_definitions action.
[109] Fix | Delete
*
[110] Fix | Delete
* @var bool
[111] Fix | Delete
*/
[112] Fix | Delete
private bool $registered_additional_features_via_action = false;
[113] Fix | Delete
[114] Fix | Delete
/**
[115] Fix | Delete
* Flag indicating if additional features have been registered already
[116] Fix | Delete
* via calls to other classes.
[117] Fix | Delete
*
[118] Fix | Delete
* @var bool
[119] Fix | Delete
*/
[120] Fix | Delete
private bool $registered_additional_features_via_class_calls = false;
[121] Fix | Delete
[122] Fix | Delete
/**
[123] Fix | Delete
* Flag indicating if we are currently delaying plugin normalization.
[124] Fix | Delete
*
[125] Fix | Delete
* @var bool
[126] Fix | Delete
*/
[127] Fix | Delete
private bool $lazy = true;
[128] Fix | Delete
[129] Fix | Delete
/**
[130] Fix | Delete
* Creates a new instance of the class.
[131] Fix | Delete
*/
[132] Fix | Delete
public function __construct() {
[133] Fix | Delete
// In principle, register_additional_features is triggered manually from within class-woocommerce
[134] Fix | Delete
// right before before_woocommerce_init is fired (this is needed for the features to be visible
[135] Fix | Delete
// to plugins executing declare_compatibility).
[136] Fix | Delete
// However we add additional checks/hookings here to support unit tests and possible overlooked/future
[137] Fix | Delete
// DI container/class instantiation nuances.
[138] Fix | Delete
if ( ! $this->registered_additional_features_via_action ) {
[139] Fix | Delete
if ( did_action( 'before_woocommerce_init' ) ) {
[140] Fix | Delete
// Needed for unit tests, where 'before_woocommerce_init' will have been fired already at this point.
[141] Fix | Delete
$this->register_additional_features();
[142] Fix | Delete
} else {
[143] Fix | Delete
// This needs to have a higher $priority than the 'before_woocommerce_init' hooked by plugins that declare compatibility.
[144] Fix | Delete
add_filter( 'before_woocommerce_init', array( $this, 'register_additional_features' ), -9999, 0 );
[145] Fix | Delete
}
[146] Fix | Delete
}
[147] Fix | Delete
[148] Fix | Delete
if ( did_action( 'init' ) ) {
[149] Fix | Delete
// Needed for unit tests, where 'init' will have been fired already at this point.
[150] Fix | Delete
$this->start_listening_for_option_changes();
[151] Fix | Delete
} else {
[152] Fix | Delete
add_filter( 'init', array( $this, 'start_listening_for_option_changes' ), 10, 0 );
[153] Fix | Delete
}
[154] Fix | Delete
[155] Fix | Delete
add_filter( 'woocommerce_get_sections_advanced', array( $this, 'add_features_section' ), 10, 1 );
[156] Fix | Delete
add_filter( 'woocommerce_get_settings_advanced', array( $this, 'add_feature_settings' ), 10, 2 );
[157] Fix | Delete
add_filter( 'deactivated_plugin', array( $this, 'handle_plugin_deactivation' ), 10, 1 );
[158] Fix | Delete
add_filter( 'all_plugins', array( $this, 'filter_plugins_list' ), 10, 1 );
[159] Fix | Delete
add_action( 'admin_notices', array( $this, 'display_notices_in_plugins_page' ), 10, 0 );
[160] Fix | Delete
add_action( 'load-plugins.php', array( $this, 'maybe_invalidate_cached_plugin_data' ) );
[161] Fix | Delete
add_action( 'after_plugin_row', array( $this, 'handle_plugin_list_rows' ), 10, 2 );
[162] Fix | Delete
add_action( 'current_screen', array( $this, 'enqueue_script_to_fix_plugin_list_html' ), 10, 1 );
[163] Fix | Delete
add_filter( 'views_plugins', array( $this, 'handle_plugins_page_views_list' ), 10, 1 );
[164] Fix | Delete
add_filter( 'woocommerce_admin_shared_settings', array( $this, 'set_change_feature_enable_nonce' ), 20, 1 );
[165] Fix | Delete
add_action( 'admin_init', array( $this, 'change_feature_enable_from_query_params' ), 20, 0 );
[166] Fix | Delete
add_action( self::FEATURE_ENABLED_CHANGED_ACTION, array( $this, 'display_email_improvements_feedback_notice' ), 10, 2 );
[167] Fix | Delete
}
[168] Fix | Delete
[169] Fix | Delete
/**
[170] Fix | Delete
* Register a feature.
[171] Fix | Delete
*
[172] Fix | Delete
* This used to be called during the `woocommerce_register_feature_definitions` action hook,
[173] Fix | Delete
* now it's called directly from get_feature_definitions as needed.
[174] Fix | Delete
*
[175] Fix | Delete
* @param string $slug The ID slug of the feature.
[176] Fix | Delete
* @param string $name The name of the feature that will appear on the Features screen and elsewhere.
[177] Fix | Delete
* @param array $args {
[178] Fix | Delete
* Properties that make up the feature definition. Each of these properties can also be set as a
[179] Fix | Delete
* callback function, as long as that function returns the specified type.
[180] Fix | Delete
*
[181] Fix | Delete
* @type string $default_plugin_compatibility The default plugin compatibility for the feature: either 'compatible' or 'incompatible'. Required.
[182] Fix | Delete
* @type array[] $additional_settings An array of definitions for additional settings controls related to
[183] Fix | Delete
* the feature that will display on the Features screen. See the Settings API
[184] Fix | Delete
* for the schema of these props.
[185] Fix | Delete
* @type string $description A brief description of the feature, used as an input label if the feature
[186] Fix | Delete
* setting is a checkbox.
[187] Fix | Delete
* @type bool $disabled True to disable the setting field for this feature on the Features screen,
[188] Fix | Delete
* so it can't be changed.
[189] Fix | Delete
* @type bool $disable_ui Set to true to hide the setting field for this feature on the
[190] Fix | Delete
* Features screen. Defaults to false.
[191] Fix | Delete
* @type bool $enabled_by_default Set to true to have this feature by opt-out instead of opt-in.
[192] Fix | Delete
* Defaults to false.
[193] Fix | Delete
* @type bool $is_experimental Set to true to display this feature under the "Experimental" heading on
[194] Fix | Delete
* the Features screen. Features set to experimental are also omitted from
[195] Fix | Delete
* the features list in some cases. Defaults to true.
[196] Fix | Delete
* @type bool $skip_compatibility_checks Set to true if the feature should not produce warnings about incompatible plugins.
[197] Fix | Delete
* Defaults to false.
[198] Fix | Delete
* @type string $learn_more_url The URL to the learn more page for the feature.
[199] Fix | Delete
* @type string $option_key The key name for the option that enables/disables the feature.
[200] Fix | Delete
* @type int $order The order that the feature will appear in the list on the Features screen.
[201] Fix | Delete
* Higher number = higher in the list. Defaults to 10.
[202] Fix | Delete
* @type array $setting The properties used by the Settings API to render the setting control on
[203] Fix | Delete
* the Features screen. See the Settings API for the schema of these props.
[204] Fix | Delete
* @type string $deprecated_since The WooCommerce version since which this feature is deprecated.
[205] Fix | Delete
* When set, feature_is_enabled() will force feature value to the deprecated_value
[206] Fix | Delete
* instead of reading from the database.
[207] Fix | Delete
* @type bool $deprecated_value The value to return for deprecated features when feature_is_enabled()
[208] Fix | Delete
* is called. Defaults to false.
[209] Fix | Delete
* }
[210] Fix | Delete
*
[211] Fix | Delete
* @return void
[212] Fix | Delete
*/
[213] Fix | Delete
public function add_feature_definition( $slug, $name, array $args = array() ) {
[214] Fix | Delete
$defaults = array(
[215] Fix | Delete
'disable_ui' => false,
[216] Fix | Delete
'enabled_by_default' => false,
[217] Fix | Delete
'is_experimental' => true,
[218] Fix | Delete
'default_plugin_compatibility' => FeaturePluginCompatibility::COMPATIBLE,
[219] Fix | Delete
'skip_compatibility_checks' => false,
[220] Fix | Delete
'name' => $name,
[221] Fix | Delete
'order' => 10,
[222] Fix | Delete
'learn_more_url' => '',
[223] Fix | Delete
);
[224] Fix | Delete
[225] Fix | Delete
if ( empty( $args['default_plugin_compatibility'] ) ) {
[226] Fix | Delete
wc_doing_it_wrong(
[227] Fix | Delete
__FUNCTION__,
[228] Fix | Delete
sprintf(
[229] Fix | Delete
'Assuming positive compatibility by default will be deprecated in the future. Please set \'default_plugin_compatibility\' for feature "%s".',
[230] Fix | Delete
esc_html( $slug )
[231] Fix | Delete
),
[232] Fix | Delete
'10.3.0'
[233] Fix | Delete
);
[234] Fix | Delete
}
[235] Fix | Delete
[236] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[237] Fix | Delete
[238] Fix | Delete
// Sanitize 'default_plugin_compatibility'.
[239] Fix | Delete
if ( ! in_array( $args['default_plugin_compatibility'], FeaturePluginCompatibility::VALID_REGISTRATION_VALUES, true ) ) {
[240] Fix | Delete
$args['default_plugin_compatibility'] = wc_string_to_bool( $args['default_plugin_compatibility'] ) ? FeaturePluginCompatibility::COMPATIBLE : FeaturePluginCompatibility::INCOMPATIBLE;
[241] Fix | Delete
}
[242] Fix | Delete
[243] Fix | Delete
// Support 'is_legacy' flag for backwards compatibility.
[244] Fix | Delete
if ( ! empty( $args['is_legacy'] ) ) {
[245] Fix | Delete
$args['skip_compatibility_checks'] = true;
[246] Fix | Delete
}
[247] Fix | Delete
[248] Fix | Delete
$this->features[ $slug ] = $args;
[249] Fix | Delete
}
[250] Fix | Delete
[251] Fix | Delete
/**
[252] Fix | Delete
* Generate and cache the feature definitions.
[253] Fix | Delete
*
[254] Fix | Delete
* @return array[]
[255] Fix | Delete
*/
[256] Fix | Delete
private function get_feature_definitions() {
[257] Fix | Delete
if ( empty( $this->features ) ) {
[258] Fix | Delete
$this->init_feature_definitions();
[259] Fix | Delete
}
[260] Fix | Delete
[261] Fix | Delete
if ( ! $this->registered_additional_features_via_class_calls ) {
[262] Fix | Delete
// This needs to be set to true *before* additional feature definition calls are made,
[263] Fix | Delete
// to prevent infinite loops in case one of these calls ends up calling here again.
[264] Fix | Delete
$this->registered_additional_features_via_class_calls = true;
[265] Fix | Delete
[266] Fix | Delete
// Additional feature definitions.
[267] Fix | Delete
// These used to be tied to the now deprecated woocommerce_register_feature_definitions action,
[268] Fix | Delete
// and aren't processed in init_feature_definitions to avoid circular calls in the dependency injection container.
[269] Fix | Delete
$container = wc_get_container();
[270] Fix | Delete
$container->get( CustomOrdersTableController::class )->add_feature_definition( $this );
[271] Fix | Delete
$container->get( CostOfGoodsSoldController::class )->add_feature_definition( $this );
[272] Fix | Delete
[273] Fix | Delete
$this->init_compatibility_info_by_feature();
[274] Fix | Delete
}
[275] Fix | Delete
[276] Fix | Delete
return $this->features;
[277] Fix | Delete
}
[278] Fix | Delete
[279] Fix | Delete
/**
[280] Fix | Delete
* Initialize the hardcoded feature definitions array.
[281] Fix | Delete
* This doesn't include:
[282] Fix | Delete
* - Features that get initialized via the (deprecated) woocommerce_register_feature_definitions.
[283] Fix | Delete
* - Features whose definition comes from another class. These are initialized directly in get_feature_definitions
[284] Fix | Delete
* to avoid circular calls in the dependency injection container.
[285] Fix | Delete
*/
[286] Fix | Delete
private function init_feature_definitions(): void {
[287] Fix | Delete
$alpha_feature_testing_is_enabled = Constants::is_true( 'WOOCOMMERCE_ENABLE_ALPHA_FEATURE_TESTING' );
[288] Fix | Delete
$tracking_enabled = WC_Site_Tracking::is_tracking_enabled();
[289] Fix | Delete
[290] Fix | Delete
$legacy_features = array(
[291] Fix | Delete
'analytics' => array(
[292] Fix | Delete
'name' => __( 'Analytics', 'woocommerce' ),
[293] Fix | Delete
'description' => __( 'Enable WooCommerce Analytics', 'woocommerce' ),
[294] Fix | Delete
'option_key' => Analytics::TOGGLE_OPTION_NAME,
[295] Fix | Delete
'is_experimental' => false,
[296] Fix | Delete
'enabled_by_default' => true,
[297] Fix | Delete
'disable_ui' => false,
[298] Fix | Delete
'skip_compatibility_checks' => true,
[299] Fix | Delete
'default_plugin_compatibility' => FeaturePluginCompatibility::COMPATIBLE,
[300] Fix | Delete
),
[301] Fix | Delete
'product_block_editor' => array(
[302] Fix | Delete
'name' => __( 'New product editor', 'woocommerce' ),
[303] Fix | Delete
'description' => __( 'Try the new product editor (Beta)', 'woocommerce' ),
[304] Fix | Delete
'is_experimental' => true,
[305] Fix | Delete
'disable_ui' => false,
[306] Fix | Delete
'skip_compatibility_checks' => true,
[307] Fix | Delete
'default_plugin_compatibility' => FeaturePluginCompatibility::COMPATIBLE,
[308] Fix | Delete
),
[309] Fix | Delete
'cart_checkout_blocks' => array(
[310] Fix | Delete
'name' => __( 'Cart & Checkout Blocks', 'woocommerce' ),
[311] Fix | Delete
'description' => __( 'Optimize for faster checkout', 'woocommerce' ),
[312] Fix | Delete
'is_experimental' => false,
[313] Fix | Delete
'disable_ui' => true,
[314] Fix | Delete
'default_plugin_compatibility' => FeaturePluginCompatibility::COMPATIBLE,
[315] Fix | Delete
),
[316] Fix | Delete
'rate_limit_checkout' => array(
[317] Fix | Delete
'name' => __( 'Rate limit Checkout', 'woocommerce' ),
[318] Fix | Delete
'description' => sprintf(
[319] Fix | Delete
// translators: %s is the URL to the rate limiting documentation.
[320] Fix | Delete
__( 'Enables rate limiting for Checkout place order and Store API /checkout endpoint. To further control this, refer to <a href="%s" target="_blank">rate limiting documentation</a>.', 'woocommerce' ),
[321] Fix | Delete
'https://developer.woocommerce.com/docs/apis/store-api/rate-limiting/'
[322] Fix | Delete
),
[323] Fix | Delete
'is_experimental' => false,
[324] Fix | Delete
'disable_ui' => false,
[325] Fix | Delete
'enabled_by_default' => false,
[326] Fix | Delete
'skip_compatibility_checks' => true,
[327] Fix | Delete
'default_plugin_compatibility' => FeaturePluginCompatibility::COMPATIBLE,
[328] Fix | Delete
),
[329] Fix | Delete
'marketplace' => array(
[330] Fix | Delete
'name' => __( 'Marketplace', 'woocommerce' ),
[331] Fix | Delete
'description' => __(
[332] Fix | Delete
'New, faster way to find extensions and themes for your WooCommerce store',
[333] Fix | Delete
'woocommerce'
[334] Fix | Delete
),
[335] Fix | Delete
'is_experimental' => false,
[336] Fix | Delete
'enabled_by_default' => true,
[337] Fix | Delete
'disable_ui' => true,
[338] Fix | Delete
'skip_compatibility_checks' => true,
[339] Fix | Delete
'default_plugin_compatibility' => FeaturePluginCompatibility::COMPATIBLE,
[340] Fix | Delete
'deprecated_since' => '10.5.0',
[341] Fix | Delete
'deprecated_value' => true,
[342] Fix | Delete
),
[343] Fix | Delete
// Marked as a legacy feature to avoid compatibility checks, which aren't really relevant to this feature.
[344] Fix | Delete
// https://github.com/woocommerce/woocommerce/pull/39701#discussion_r1376976959.
[345] Fix | Delete
'order_attribution' => array(
[346] Fix | Delete
'name' => __( 'Order Attribution', 'woocommerce' ),
[347] Fix | Delete
'description' => __(
[348] Fix | Delete
'Enable this feature to track and credit channels and campaigns that contribute to orders on your site',
[349] Fix | Delete
'woocommerce'
[350] Fix | Delete
),
[351] Fix | Delete
'enabled_by_default' => true,
[352] Fix | Delete
'disable_ui' => false,
[353] Fix | Delete
'skip_compatibility_checks' => true,
[354] Fix | Delete
'default_plugin_compatibility' => FeaturePluginCompatibility::COMPATIBLE,
[355] Fix | Delete
'is_experimental' => false,
[356] Fix | Delete
),
[357] Fix | Delete
'site_visibility_badge' => array(
[358] Fix | Delete
'name' => __( 'Site visibility badge', 'woocommerce' ),
[359] Fix | Delete
'description' => __(
[360] Fix | Delete
'Enable the site visibility badge in the WordPress admin bar',
[361] Fix | Delete
'woocommerce'
[362] Fix | Delete
),
[363] Fix | Delete
'enabled_by_default' => true,
[364] Fix | Delete
'disable_ui' => false,
[365] Fix | Delete
'skip_compatibility_checks' => true,
[366] Fix | Delete
'default_plugin_compatibility' => FeaturePluginCompatibility::COMPATIBLE,
[367] Fix | Delete
'is_experimental' => false,
[368] Fix | Delete
'disabled' => false,
[369] Fix | Delete
),
[370] Fix | Delete
'hpos_fts_indexes' => array(
[371] Fix | Delete
'name' => __( 'HPOS Full text search indexes', 'woocommerce' ),
[372] Fix | Delete
'description' => __(
[373] Fix | Delete
'Create and use full text search indexes for orders. This feature only works with high-performance order storage.',
[374] Fix | Delete
'woocommerce'
[375] Fix | Delete
),
[376] Fix | Delete
'is_experimental' => true,
[377] Fix | Delete
'enabled_by_default' => false,
[378] Fix | Delete
'skip_compatibility_checks' => true,
[379] Fix | Delete
'default_plugin_compatibility' => FeaturePluginCompatibility::COMPATIBLE,
[380] Fix | Delete
'option_key' => CustomOrdersTableController::HPOS_FTS_INDEX_OPTION,
[381] Fix | Delete
),
[382] Fix | Delete
'hpos_datastore_caching' => array(
[383] Fix | Delete
'name' => __( 'HPOS Data Caching', 'woocommerce' ),
[384] Fix | Delete
'description' => __(
[385] Fix | Delete
'Enable order data caching in the datastore. This feature only works with high-performance order storage and is recommended for stores using object caching.',
[386] Fix | Delete
'woocommerce'
[387] Fix | Delete
),
[388] Fix | Delete
'is_experimental' => false,
[389] Fix | Delete
'enabled_by_default' => false,
[390] Fix | Delete
'skip_compatibility_checks' => true,
[391] Fix | Delete
'default_plugin_compatibility' => FeaturePluginCompatibility::COMPATIBLE,
[392] Fix | Delete
'disable_ui' => false,
[393] Fix | Delete
'option_key' => CustomOrdersTableController::HPOS_DATASTORE_CACHING_ENABLED_OPTION,
[394] Fix | Delete
),
[395] Fix | Delete
'remote_logging' => array(
[396] Fix | Delete
'name' => __( 'Remote Logging', 'woocommerce' ),
[397] Fix | Delete
'description' => sprintf(
[398] Fix | Delete
/* translators: %1$s: opening link tag, %2$s: closing link tag */
[399] Fix | Delete
__( 'Allow WooCommerce to send error logs and non-sensitive diagnostic data to help improve WooCommerce. This feature requires %1$susage tracking%2$s to be enabled.', 'woocommerce' ),
[400] Fix | Delete
'<a href="' . admin_url( 'admin.php?page=wc-settings&tab=advanced&section=woocommerce_com' ) . '">',
[401] Fix | Delete
'</a>'
[402] Fix | Delete
),
[403] Fix | Delete
'enabled_by_default' => true,
[404] Fix | Delete
'disable_ui' => false,
[405] Fix | Delete
[406] Fix | Delete
/*
[407] Fix | Delete
* This is not truly a legacy feature (it is not a feature that pre-dates the FeaturesController),
[408] Fix | Delete
* but we wish to handle compatibility checking in a similar fashion to legacy features. The
[409] Fix | Delete
* rational for setting legacy to true is therefore similar to that of the 'order_attribution'
[410] Fix | Delete
* feature.
[411] Fix | Delete
*
[412] Fix | Delete
* @see https://github.com/woocommerce/woocommerce/pull/39701#discussion_r1376976959
[413] Fix | Delete
*/
[414] Fix | Delete
'skip_compatibility_checks' => true,
[415] Fix | Delete
'default_plugin_compatibility' => FeaturePluginCompatibility::COMPATIBLE,
[416] Fix | Delete
'is_experimental' => false,
[417] Fix | Delete
'setting' => array(
[418] Fix | Delete
'disabled' => function () use ( $tracking_enabled ) {
[419] Fix | Delete
return ! $tracking_enabled;
[420] Fix | Delete
},
[421] Fix | Delete
'desc_tip' => function () use ( $tracking_enabled ) {
[422] Fix | Delete
if ( ! $tracking_enabled ) {
[423] Fix | Delete
return __( '⚠ Usage tracking must be enabled to use remote logging.', 'woocommerce' );
[424] Fix | Delete
}
[425] Fix | Delete
[426] Fix | Delete
return '';
[427] Fix | Delete
},
[428] Fix | Delete
),
[429] Fix | Delete
),
[430] Fix | Delete
'email_improvements' => array(
[431] Fix | Delete
'name' => __( 'Email improvements', 'woocommerce' ),
[432] Fix | Delete
'description' => __(
[433] Fix | Delete
'Enable modern email design for transactional emails',
[434] Fix | Delete
'woocommerce'
[435] Fix | Delete
),
[436] Fix | Delete
[437] Fix | Delete
/*
[438] Fix | Delete
* This is not truly a legacy feature (it is not a feature that pre-dates the FeaturesController),
[439] Fix | Delete
* but as this feature doesn't affect all extensions, and the rollout is fairly short,
[440] Fix | Delete
* we'll skip the compatibility check by marking this as legacy. This is a workaround until
[441] Fix | Delete
* we can implement a more sophisticated compatibility checking system.
[442] Fix | Delete
*
[443] Fix | Delete
* @see https://github.com/woocommerce/woocommerce/issues/39147
[444] Fix | Delete
* @see https://github.com/woocommerce/woocommerce/issues/55540
[445] Fix | Delete
*/
[446] Fix | Delete
'skip_compatibility_checks' => true,
[447] Fix | Delete
'default_plugin_compatibility' => FeaturePluginCompatibility::COMPATIBLE,
[448] Fix | Delete
'is_experimental' => false,
[449] Fix | Delete
),
[450] Fix | Delete
'blueprint' => array(
[451] Fix | Delete
'name' => __( 'Blueprint (beta)', 'woocommerce' ),
[452] Fix | Delete
'description' => __(
[453] Fix | Delete
'Enable blueprint to import and export settings in bulk',
[454] Fix | Delete
'woocommerce'
[455] Fix | Delete
),
[456] Fix | Delete
'enabled_by_default' => true,
[457] Fix | Delete
'disable_ui' => false,
[458] Fix | Delete
[459] Fix | Delete
/*
[460] Fix | Delete
* This is not truly a legacy feature (it is not a feature that pre-dates the FeaturesController),
[461] Fix | Delete
* but we wish to handle compatibility checking in a similar fashion to legacy features. The
[462] Fix | Delete
* rational for setting legacy to true is therefore similar to that of the 'order_attribution'
[463] Fix | Delete
* feature.
[464] Fix | Delete
*
[465] Fix | Delete
* @see https://github.com/woocommerce/woocommerce/pull/39701#discussion_r1376976959
[466] Fix | Delete
*/
[467] Fix | Delete
'skip_compatibility_checks' => true,
[468] Fix | Delete
'default_plugin_compatibility' => FeaturePluginCompatibility::COMPATIBLE,
[469] Fix | Delete
'is_experimental' => false,
[470] Fix | Delete
),
[471] Fix | Delete
'block_email_editor' => array(
[472] Fix | Delete
'name' => __( 'Block Email Editor (alpha)', 'woocommerce' ),
[473] Fix | Delete
'description' => __(
[474] Fix | Delete
'Enable the block-based email editor for transactional emails.',
[475] Fix | Delete
'woocommerce'
[476] Fix | Delete
),
[477] Fix | Delete
'learn_more_url' => 'https://github.com/woocommerce/woocommerce/discussions/52897#discussioncomment-11630256',
[478] Fix | Delete
[479] Fix | Delete
/*
[480] Fix | Delete
* This is not truly a legacy feature (it is not a feature that pre-dates the FeaturesController),
[481] Fix | Delete
* but we wish to handle compatibility checking in a similar fashion to legacy features. The
[482] Fix | Delete
* rational for setting legacy to true is therefore similar to that of the 'order_attribution'
[483] Fix | Delete
* feature.
[484] Fix | Delete
*
[485] Fix | Delete
* @see https://github.com/woocommerce/woocommerce/pull/39701#discussion_r1376976959
[486] Fix | Delete
*/
[487] Fix | Delete
'skip_compatibility_checks' => true,
[488] Fix | Delete
'default_plugin_compatibility' => FeaturePluginCompatibility::COMPATIBLE,
[489] Fix | Delete
'enabled_by_default' => false,
[490] Fix | Delete
),
[491] Fix | Delete
'point_of_sale' => array(
[492] Fix | Delete
'name' => __( 'Point of Sale', 'woocommerce' ),
[493] Fix | Delete
'description' => __(
[494] Fix | Delete
'Enable Point of Sale functionality in the WooCommerce mobile apps.',
[495] Fix | Delete
'woocommerce'
[496] Fix | Delete
),
[497] Fix | Delete
'enabled_by_default' => true,
[498] Fix | Delete
'disable_ui' => false,
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function