WCS_Admin_Meta_Boxes->enqueue_styles_scripts() attempts to load non-subscription as subscription. #772
Labels
category: performance
The issue/PR is related to performance.
priority: high
The issue/PR is high priority—it affects lots of customers substantially, but not critically.
type: enhancement
The issue is a request for an enhancement.
Describe the bug
WCS_Admin_Meta_Boxes->enqueue_styles_scripts()
attempts to load a subscription on any admin page that has a global$post
at the time ofadmin_enqueue_scripts
executing, i.e./wp-admin/edit.php
or/wp-admin/edit.php?post_type=aw_workflow
.This doesn't appear to break anything specific as the default datastores do not return a data object, but does cause an extra query to be run on those pages when HPOS is enabled. I have not yet tested what occurs if HPOS is not enabled.
To Reproduce
SELECT id, type FROM wp_wc_orders WHERE id IN ( 1103554 )
Expected behavior
It isn't expected that the
WCS_Admin_Meta_Boxes
would attempt to load a non-subscription.It is expected that the styles wouldn't attempt to be loaded for the metabox unless the metabox is actually added to the screen. Or at least verify that this is a screen that needs the subscription before attempting to load the subscription of the global
$post
.Product impact
This is a core issue that affects both extensions, but the impact is minor.
The text was updated successfully, but these errors were encountered: