WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 21 months ago

#14519 closed enhancement (wontfix)

Random Twenty Ten Default Header

Reported by: nickmomrik Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch dev-reviewed
Focuses: Cc:

Description

Twenty Ten uses path.jpg for the default header image everywhere. This patch randomizes the default header based on site_url so we don't end up with the same header image everywhere on the web.

Attachments (2)

14519.diff (911 bytes) - added by nickmomrik 4 years ago.
14519-2.diff (924 bytes) - added by nickmomrik 4 years ago.
Set the scheme to 'http' so there aren't different headers for http and https

Download all attachments as: .zip

Change History (14)

nickmomrik4 years ago

comment:1 nacin4 years ago

  • Keywords close added

We went with path.jpg as the default fully knowing that we also built a pretty slick custom header tool loaded with 7 other default images and the ability to upload and crop your own. This is unnecessary code.

comment:2 Denis-de-Bernardy4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

agreed

comment:3 follow-ups: matt4 years ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

I think it's worthwhile -- the whole point of having 700k+ of bundled headers is so every time someone does a WP install it doesn't look 100% the same. I had assumed that we were rotating, but recently realized we always defaulted to the road one. This is in line with the original intention of 2010.

comment:4 in reply to: ↑ 3 markmcwilliams4 years ago

  • Keywords close removed

To a point I agree, and at the end of the day, the user can change the image if they don't like it, so a win-win situation for everyone right? :)

comment:5 in reply to: ↑ 3 ; follow-up: nacin4 years ago

  • Milestone set to Awaiting Review

Replying to matt:

I think it's worthwhile -- the whole point of having 700k+ of bundled headers is so every time someone does a WP install it doesn't look 100% the same. I had assumed that we were rotating, but recently realized we always defaulted to the road one.

I agree, but it isn't really feasible without hacking in a theme activation hook, or at least not without avoiding the database by checking if there's a header image defined, and if not, set one at random.

I think this code would rotate the image on every page load until a header is chosen from the admin, versus simply provide the install with a single default header chosen at random from the 8 images? I first interpreted the intent of the ticket as the former, but now I'm unsure.

comment:6 in reply to: ↑ 5 ; follow-up: mdawaffe4 years ago

Replying to nacin:

I think this code would rotate the image on every page load until a header is chosen from the admin, versus simply provide the install with a single default header chosen at random from the 8 images?

Other way around. crc32 is an old school hashing algorithm, not a random number generator. The code hashes the site_url(), then grabs a header image based on the hash. Same header for every page load.

Caveat: the current patch doesn't set a scheme in the site_url() call so you'll have a different (but consistent) header for each scheme (http, https).

comment:7 in reply to: ↑ 6 nacin4 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to WordPress.org site

Replying to mdawaffe:

Other way around. crc32 is an old school hashing algorithm, not a random number generator. The code hashes the site_url(), then grabs a header image based on the hash. Same header for every page load.

Caveat: the current patch doesn't set a scheme in the site_url() call so you'll have a different (but consistent) header for each scheme (http, https).

Clever. Didn't notice that. +1

nickmomrik4 years ago

Set the scheme to 'http' so there aren't different headers for http and https

comment:8 follow-up: westi4 years ago

  • Keywords dev-reviewed added

Patch looks great.

Is there a specific reason we don't do this on activation and just set the setting to a random value?

Won't this affect all existing unconfigured sites and randomise there headers after all?

comment:9 in reply to: ↑ 8 RanYanivHartstein4 years ago

Replying to westi:

Patch looks great.

Is there a specific reason we don't do this on activation and just set the setting to a random value?

Won't this affect all existing unconfigured sites and randomise there headers after all?

Changing headers on already installed sites sounds like a bad idea. Many users may not necessarily like the default header image, but just by leaving the default they still made a choice there. Having their header image change all of a sudden will feel intrusive.

I think doing this for all new installs from now on should be good enough - no need to force it on pepole who already installed and gotten used to path.jpg. Even if they didn't pick it themselves, it was still their choice not to change it. We will be effectively going over their heads and reaching in to their sites to change something they like, just because we don't.

comment:10 mrmist4 years ago

-1 to changing pre-existing headers without warning. I forsee a raft of support topics asking why their header has suddenly changed, and worrying that they've been hacked.
To add to that, there's the set of folk who would see it as invasive. The last thing needed now is another capital P fiasco.
So i'd say either new installs only, or publicise the change widely in advance, with info on how to keep the same header.

comment:11 nickmomrik21 months ago

Suggest closing since we have random images built in now and Twenty Eleven used it as the default.

comment:12 nacin21 months ago

  • Milestone WordPress.org deleted
  • Resolution set to wontfix
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.