Cherry pick 51664 into release/9.4 (#51849)

* Add core feature for site visibility badge (#51664)

* Add site_visibility_badge feature

* Update feature check on badge

Previously the WooCommerce Admin LYS feature flag was used, however this is slated to be removed in an upcoming release. This is updated to use the core level feature flag for the badge.

* Add changelog

* Fix lint issues

* Revert "Fix lint issues"

This reverts commit cf05d2b74f.

* Lint fixes

* lint

* Prep for cherry pick 51664

---------

Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>
Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
This commit is contained in:
github-actions[bot] 2024-10-02 06:43:53 -07:00 committed by GitHub
parent 135f6c9389
commit 820cb1c308
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 10 deletions

View File

@ -220,6 +220,7 @@ WooCommerce comes with some sample data you can use to see how products look; im
* Fix - Use `get_filtered_ids` consistently in `reports/taxes` and `reports/taxes/stats` datastores [#51219](https://github.com/woocommerce/woocommerce/pull/51219)
* Fix - wc_get_cart_url should only return current URL if on the cart page. This excludes the usage of WOOCOMMERCE_CART. [#51384](https://github.com/woocommerce/woocommerce/pull/51384)
* Fix - Wrap parse_str under a check to resolve deprecation notice [#51474](https://github.com/woocommerce/woocommerce/pull/51474)
* Add - Add core feature for site visibility badge [#51664](https://github.com/woocommerce/woocommerce/pull/51664)
* Add - Added a Load More button to product lists on the Extensions page, to request additional search results from WooCommerce.com. [#51413](https://github.com/woocommerce/woocommerce/pull/51413)
* Add - Add endpoint title to the document title. [#50900](https://github.com/woocommerce/woocommerce/pull/50900)
* Add - Add global_unique_id parameter to products REST API [#51264](https://github.com/woocommerce/woocommerce/pull/51264)

View File

@ -4,7 +4,8 @@ declare( strict_types = 1 );
namespace Automattic\WooCommerce\Internal\ComingSoon;
use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Utilities\FeaturesUtil;
/**
* Adds hooks to add a badge to the WordPress admin bar showing site visibility.
@ -30,7 +31,7 @@ class ComingSoonAdminBarBadge {
*/
public function site_visibility_badge( $wp_admin_bar ) {
// Early exit if LYS feature is disabled.
if ( ! Features::is_enabled( 'launch-your-store' ) ) {
if ( ! FeaturesUtil::feature_is_enabled( 'site_visibility_badge' ) ) {
return;
}
@ -68,7 +69,7 @@ class ComingSoonAdminBarBadge {
*/
public function output_css() {
// Early exit if LYS feature is disabled.
if ( ! Features::is_enabled( 'launch-your-store' ) ) {
if ( ! FeaturesUtil::feature_is_enabled( 'site_visibility_badge' ) ) {
return;
}

View File

@ -164,7 +164,7 @@ class FeaturesController {
private function get_feature_definitions() {
if ( empty( $this->features ) ) {
$legacy_features = array(
'analytics' => array(
'analytics' => array(
'name' => __( 'Analytics', 'woocommerce' ),
'description' => __( 'Enable WooCommerce Analytics', 'woocommerce' ),
'option_key' => Analytics::TOGGLE_OPTION_NAME,
@ -173,7 +173,7 @@ class FeaturesController {
'disable_ui' => false,
'is_legacy' => true,
),
'product_block_editor' => array(
'product_block_editor' => array(
'name' => __( 'New product editor', 'woocommerce' ),
'description' => __( 'Try the new product editor (Beta)', 'woocommerce' ),
'is_experimental' => true,
@ -194,13 +194,13 @@ class FeaturesController {
return $string;
},
),
'cart_checkout_blocks' => array(
'cart_checkout_blocks' => array(
'name' => __( 'Cart & Checkout Blocks', 'woocommerce' ),
'description' => __( 'Optimize for faster checkout', 'woocommerce' ),
'is_experimental' => false,
'disable_ui' => true,
),
'marketplace' => array(
'marketplace' => array(
'name' => __( 'Marketplace', 'woocommerce' ),
'description' => __(
'New, faster way to find extensions and themes for your WooCommerce store',
@ -213,7 +213,7 @@ class FeaturesController {
),
// Marked as a legacy feature to avoid compatibility checks, which aren't really relevant to this feature.
// https://github.com/woocommerce/woocommerce/pull/39701#discussion_r1376976959.
'order_attribution' => array(
'order_attribution' => array(
'name' => __( 'Order Attribution', 'woocommerce' ),
'description' => __(
'Enable this feature to track and credit channels and campaigns that contribute to orders on your site',
@ -224,7 +224,19 @@ class FeaturesController {
'is_legacy' => true,
'is_experimental' => false,
),
'hpos_fts_indexes' => array(
'site_visibility_badge' => array(
'name' => __( 'Site visibility badge', 'woocommerce' ),
'description' => __(
'Enable the site visibility badge in the WordPress admin bar',
'woocommerce'
),
'enabled_by_default' => true,
'disable_ui' => false,
'is_legacy' => true,
'is_experimental' => false,
'disabled' => false,
),
'hpos_fts_indexes' => array(
'name' => __( 'HPOS Full text search indexes', 'woocommerce' ),
'description' => __(
'Create and use full text search indexes for orders. This feature only works with high-performance order storage.',
@ -235,7 +247,7 @@ class FeaturesController {
'is_legacy' => true,
'option_key' => CustomOrdersTableController::HPOS_FTS_INDEX_OPTION,
),
'remote_logging' => array(
'remote_logging' => array(
'name' => __( 'Remote Logging', 'woocommerce' ),
'description' => __(
'Enable this feature to log errors and related data to Automattic servers for debugging purposes and to improve WooCommerce',