You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plugin currently has about 2,000 lines of code. A lot of it is hard to follow and change safely:
webspellchecker.php is a 798-line class with 18+ mixed responsibilities (bootstrap, context detection, enqueue, AJAX, content cleanup, config builder, etc.).
should_enable_in_context() is 116 lines with 41 conditionals and the same arrays of screen IDs repeated three times.
Service endpoints (svc.webspellchecker.net, spellcheck31/api, the bundle URL) are hard-coded in five places across PHP and JS. On-premises customers cannot point the plugin at a private WSC instance without editing the source.
Content cleanup runs a regex over HTML with a length-ratio safety check — fragile.
Four JavaScript files with duplicated constants and no module structure.
Plan
6–8 small classes with a single responsibility each.
Non-goals
No new features.
No PHP version bump (stays 7.4).
No Composer, no React admin page, no build step for PHP.
No breaking changes to the wsc_proofreader option or public filter names.
Goal
The plugin currently has about 2,000 lines of code. A lot of it is hard to follow and change safely:
webspellchecker.phpis a 798-line class with 18+ mixed responsibilities (bootstrap, context detection, enqueue, AJAX, content cleanup, config builder, etc.).should_enable_in_context()is 116 lines with 41 conditionals and the same arrays of screen IDs repeated three times.vendor/and contains a deprecatedcreate_function()call — see Fix deprecated create_function() call (fatal on PHP 8.0+) #30.svc.webspellchecker.net,spellcheck31/api, the bundle URL) are hard-coded in five places across PHP and JS. On-premises customers cannot point the plugin at a private WSC instance without editing the source.Plan
Non-goals
wsc_proofreaderoption or public filter names.Related