Skip to content

Remove json2#845

Merged
fajardoleo merged 2 commits intoFreemius:developfrom
johnbillion:remove-json2
Jan 28, 2026
Merged

Remove json2#845
fajardoleo merged 2 commits intoFreemius:developfrom
johnbillion:remove-json2

Conversation

@johnbillion
Copy link

@johnbillion johnbillion commented Jan 13, 2026

In WordPress 6.9, the json2 library was no-oped as it's no longer needed by any browser. This was done as part of a larger change to remove support for old IE conditional syntax. See https://core.trac.wordpress.org/ticket/63821 and WordPress/wordpress-develop@49d1ded.

This PR removes json2 from the Freemius SDK. This should be a safe change to make because:

  • If a Freemius-powered plugin depends on json2 then it'll still get enqueued via the normal script dependency system in WordPress. The json2 script is still registered, it's just no longer enqueued manually by the Freemius SDK.
  • The json2 library provides polyfills for JSON.stringify() and JSON.parse() by pushing its implementations onto the global JSON object. No browsers need this back compat, and there is nothing provided in json2 which is not provided by JSON in the browser.

Fixes #840.

@bahiirwa bahiirwa requested a review from swashata January 18, 2026 07:20
@bahiirwa bahiirwa requested review from DanieleAlessandra, bahiirwa and fajardoleo and removed request for swashata January 25, 2026 15:40
Copy link
Collaborator

@DanieleAlessandra DanieleAlessandra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clear explanation and for referencing the WordPress core change.
The reasoning makes sense and the implementation looks solid to me.
Removing the manual enqueue of json2 in the SDK is safe and aligns with WordPress 6.9 behavior.

LGTM 👍

@DanieleAlessandra DanieleAlessandra changed the base branch from master to develop January 26, 2026 08:51
@bahiirwa
Copy link
Contributor

Thanks @johnbillion and @DanieleAlessandra
I made a force push to fix the commit history so as to match the develop branch.

@fajardoleo fajardoleo merged commit ec05354 into Freemius:develop Jan 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove json2 script dependency.

5 participants