Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the WP_HTML_Tag_Processor object? #397

Open
jdevalk opened this issue Dec 7, 2023 · 1 comment
Open

Use the WP_HTML_Tag_Processor object? #397

jdevalk opened this issue Dec 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@jdevalk
Copy link
Collaborator

jdevalk commented Dec 7, 2023

Perhaps we could use the WP class for parsing the DOM instead of including simple_html_dom.php (which has non-namespaced functions and is thus a pretty big risk)? The WP_HTML_Tag_Processor class was introduced in 6.2.

@jdevalk jdevalk added the enhancement New feature or request label Dec 7, 2023
@SteveJonesDev
Copy link
Member

SteveJonesDev commented Dec 7, 2023

This is interesting for PHP-based scans. I'll do some more research on it. PHP's built-in DOM parser DOMDocument is another choice. In hindsight, I would have chosen DOMDocument over Simple HTML DOM. But I also like the idea of a WordPress way of parsing.

We're working towards scanning the full rendered page with JavaScript instead of PHP. This allows us to utilize the axe-core library and reduces false positives. We've set the plugin up to allow for both PHP and JS scans so we can migrate checks over time. There is a beta release with JS scanning implemented on the color contrast check.

Once all checks are converted to JavaScript we can remove Simple HTML DOM entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants