WordPress / WordPress/WordPress-Coding-Standards

Gravatar: Default image requests to the Gravatar service will result in a warning

Open
#2,426 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
2.8k
Forks
521
Avg merge
5d 20h
Merged PRs (30d)
1

Description

Gravatar is asking us to use urlencode() when requesting default images. For example

urlencode( 'https://example.com/images/avatar.jpg' )

Source: https://docs.gravatar.com/general/images/

urlencode() usage results in the following warning:

urlencode() should only be used when dealing with legacy applications rawurlencode() should now be used instead. See https://www.php.net/function.rawurlencode and http://www.faqs.org/rfcs/rfc3986.html

Related: https://github.com/WordPress/WordPress-Coding-Standards/issues/1234

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the Gravatar default-image handling in the PHP_CodeSniffer ruleset and compare its URL encoding with the linked Gravatar guidance. Reproduce the warning described here and run the relevant sniff tests; done means default-image requests no longer emit the urlencode() warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.