fix(pay): break enqueue cycle that exhausted memory on the post editor
aksrt_icon_picker_assets() registers the icon-picker script as depending on the caller's handle, so passing 'aksrt-pay-meta-box' already creates the edge aksrt-icon-picker -> aksrt-pay-meta-box. Declaring the reverse on the script and style closed a cycle, and WP_Dependencies' recursive resolver never terminated, taking down every post editor and edit.php request. Drop the reverse edge so the picker depends on the pay-meta script, not the other way round, and contract-lock the direction. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,15 +43,17 @@ class ResourceMetaBox {
|
||||
|
||||
wp_enqueue_media();
|
||||
if (function_exists('aksrt_icon_picker_assets')) {
|
||||
// Declares aksrt-icon-picker -> aksrt-pay-meta-box; the reverse edge
|
||||
// must not be added here or WP's resolver recurses until OOM.
|
||||
aksrt_icon_picker_assets(['aksrt-pay-meta-box']);
|
||||
}
|
||||
$css = AKSRT_DIR . '/assets/css/admin/pay-meta-box.css';
|
||||
$js = AKSRT_DIR . '/assets/js/admin-pay-meta-box.js';
|
||||
if (is_file($css)) {
|
||||
wp_enqueue_style('aksrt-pay-meta-box', AKSRT_URI . '/assets/css/admin/pay-meta-box.css', ['aksrt-icon-picker'], (string) filemtime($css));
|
||||
wp_enqueue_style('aksrt-pay-meta-box', AKSRT_URI . '/assets/css/admin/pay-meta-box.css', ['aksrt-font-awesome'], (string) filemtime($css));
|
||||
}
|
||||
if (is_file($js)) {
|
||||
wp_enqueue_script('aksrt-pay-meta-box', AKSRT_URI . '/assets/js/admin-pay-meta-box.js', ['aksrt-icon-picker'], (string) filemtime($js), true);
|
||||
wp_enqueue_script('aksrt-pay-meta-box', AKSRT_URI . '/assets/js/admin-pay-meta-box.js', [], (string) filemtime($js), true);
|
||||
}
|
||||
wp_localize_script('aksrt-pay-meta-box', 'aksrtPayMetaBox', [
|
||||
'buttonClasses' => DomainModel::DOWNLOAD_BUTTON_CLASSES,
|
||||
|
||||
Reference in New Issue
Block a user