WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 months ago

#14752 closed feature request (wontfix)

Warn after theme activation if wp_head/footer is missing

Reported by: nacin Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords: 2nd-opinion health-check
Focuses: Cc:

Description

After theme activation, we can reliably test for wp_head() and wp_footer() with an HTTP call to the front page.

We should do that and check for two things:

  1. That wp_head() and wp_footer() are present in the theme.
  1. That they are in the correct location, immediately before </head> and </body>.

Then throw a warning that the theme may not function properly (with a link to a Codex page?) because it is not using the API correctly.

Is this core material?

Change History (9)

comment:1 nacin4 years ago

  • Type changed from defect (bug) to feature request

comment:2 hakre4 years ago

Looks like testing material to me. Something a theme author can verify it's stuff prior to release in quality control. Better to educate a theme-author then the user who might just does not get what this all is about (too technical).

The workflow suggested is making the user the tester when it's already too late: Theme distributed and the error thrown means a full roundtrip from user -> themer -> user.

comment:3 TobiasBg4 years ago

As a plugin developer, I'd love this.

There are just so many users with themes which are lacking one of the two hooks.
Then they blame my plugin, when the JavaScript is not working...
Which is no surprise, as it is never included without the hooks, as it is included using wp_enqueue_script().

comment:4 nacin4 years ago

  • Keywords health-check added

Might be better as part of the health check plugin.

comment:5 filosofo4 years ago

I think hakre has a good point: at that point it's too late. This feedback expects too much of the end user. When confronted with such an error message, he has to then decide what it means, whether it's worth doing anything about, and if so, what to do.

Also, I have a hard time believing this is a widespread problem, which I remember coming across a few times in 2005 and 2006, but not much since. Haven't we won the war by now?

comment:6 kretzschmar4 years ago

Themes are automatically checked after upload and reviewed. This is be the place to check for things like that.

comment:7 nacin3 years ago

  • Milestone changed from Awaiting Review to Future Release

comment:8 ocean903 months ago

Related: #12839

comment:9 nacin3 months ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.