Automattic / Automattic/jetpack

General: review w3c validator output

Open
#32,818 1 comment 0 reactions 0 assignees View on GitHub
[Plugin] Jetpack [Pri] Low Bug General Good For Community
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

### Impacted plugin

Jetpack

### Quick summary

Recently, I wanted to see in the W3C validator how my blog code looks like in terms of compliance of the html code with the W3C guidelines.

Unfortunately, Wordpress and many plugins generate a lot of warnings and errors in this regard. Also Jetpack has a lot to fix here.
Please look at the results of searching your code only in PHP files for the " />" (or "/>") fargment, which is indicated by the validator as "Trailing slash on void elements has no effect and interacts badly with unquoted attribute values."

I searched all *.php files for the phrase " />" and found 585 of them in 125 of your files:
![0yrqJy0hI0F21Mn4](https://github.com/Automattic/jetpack/assets/143954937/dc053c9d-495c-4483-aeb7-3252b270d259)

Would there be a chance for you to take a look at the W3C validator results during the next plugin update and clean up the html code generated by your php files (and perhaps also by javascript) so that the validation results do not contain so many unnecessary warnings or validation errors?

Now, in each new version of Jetpack, I manually replace the strings " />" and "/>" with ">" in all *.phyp files of the plugin so as not to see hundreds of warnings in the W3C validator. It's just one operation in the editor type replace in all *.php files in the selected folder and its subfolders, so it's not completely laborious.
Can you do the same thing once and for all in your php files so that there are no more of these redundant characters in the code generated by the plugin?

Thank you very much in advance for the positive consideration of my request and cleaning the html code.

### Steps to reproduce

1.use the W3C validator at https://validator.w3.org/

### A clear and concise description of what you expected to happen.

_No response_

### What actually happened

_No response_

### Impact

All

### Available workarounds?

No and the platform is unusable

### Platform (Simple and/or Atomic)

_No response_

### Logs or notes

_No response_

Contributor guide

Open the contributing guide

Research direction

Search Jetpack's PHP files for the reported " />" and "/>" fragments, then inspect the generated HTML with the W3C validator at validator.w3.org. Done means reviewing the affected output and removing redundant trailing slashes where appropriate so the validator reports fewer related warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, php
Domain
frontend, web-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.