Skip to content
This repository was archived by the owner on Jul 12, 2024. It is now read-only.
This repository was archived by the owner on Jul 12, 2024. It is now read-only.

Update Cache Busting Key for Core Merge #8294

@adrianduffell

Description

@adrianduffell

Is your feature request related to a problem? Please describe.

Presently, the WooCommerce Admin version number is used as the key when cache busting assets. However, with the upcoming merge to Core, WooCommerce Admin will no longer have a version number.

Describe the solution you'd like

Switch to using the Core version number for cache busting by using the WC_VERSION constant instead of WC_ADMIN_VERSION_NUMBER.

Describe alternatives you've considered

n/a

Should this be prioritized? Why?

Yes, merge is happening soon.

Additional context

I'm aware of the following areas of code needing to be updated:

wp_enqueue_script(
'onboarding-product-notice',
Loader::get_url( 'wp-admin-scripts/onboarding-product-notice', 'js' ),
array_merge( array( WC_ADMIN_APP ), $script_assets ['dependencies'] ),
WC_ADMIN_VERSION_NUMBER,
true
);

wp_enqueue_script(
'onboarding-product-import-notice',
Loader::get_url( 'wp-admin-scripts/onboarding-product-import-notice', 'js' ),
array_merge( array( WC_ADMIN_APP ), $script_assets ['dependencies'] ),
WC_ADMIN_VERSION_NUMBER,
true
);

wp_enqueue_script(
'onboarding-homepage-notice',
Loader::get_url( 'wp-admin-scripts/onboarding-homepage-notice', 'js' ),
array_merge( array( WC_ADMIN_APP ), $script_assets ['dependencies'] ),
WC_ADMIN_VERSION_NUMBER,
true
);
}

public static function get_file_version( $ext ) {
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
return filemtime( WC_ADMIN_ABSPATH . self::get_path( $ext ) );
}
return WC_ADMIN_VERSION_NUMBER;
}

Metadata

Metadata

Assignees

Labels

priority: highThe issue/PR is high priority—it affects lots of customers substantially, but not critically.type: taskThe issue is an internally driven task (e.g. from another A8c team).

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions