Problem
js/plugin-report.js uses deprecated jQuery methods and outdated JS patterns:
jQuery.parseJSON() (line 58) — deprecated since jQuery 3.0, removed in jQuery 4.0. WordPress ships jQuery 3.x.
- All variable declarations use
var instead of const/let (lines 3–7, 12, 20, 50, 72, 73, 105, 119, 120)
Proposed changes
- Replace
jQuery.parseJSON(response) with JSON.parse(response)
- Replace
var with const or let as appropriate
- Leave
jQuery.post() as-is — jQuery is already loaded by WP admin, no benefit to switching to fetch()
No browser compatibility concern: const/let and JSON.parse() are ES6 (2015), supported by every browser WordPress still targets (IE11 was dropped in WP 5.8).
Problem
js/plugin-report.jsuses deprecated jQuery methods and outdated JS patterns:jQuery.parseJSON()(line 58) — deprecated since jQuery 3.0, removed in jQuery 4.0. WordPress ships jQuery 3.x.varinstead ofconst/let(lines 3–7, 12, 20, 50, 72, 73, 105, 119, 120)Proposed changes
jQuery.parseJSON(response)withJSON.parse(response)varwithconstorletas appropriatejQuery.post()as-is — jQuery is already loaded by WP admin, no benefit to switching tofetch()No browser compatibility concern:
const/letandJSON.parse()are ES6 (2015), supported by every browser WordPress still targets (IE11 was dropped in WP 5.8).