Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#28124 closed enhancement (fixed)

Use a time constant instead of a number in get_theme_feature_list()

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.0 Priority: normal
Severity: trivial Version: 3.5
Component: Themes Keywords: good-first-bug has-patch
Focuses: Cc:

Description

We use 10800 twice in get_theme_feature_list(): tags/3.9/src/wp-admin/includes/theme.php#L240.

3 * HOUR_IN_SECONDS should be used instead, see [21996] and [23175].

Attachments (1)

28124.diff (851 bytes) - added by GaVrA 11 years ago.

Download all attachments as: .zip

Change History (4)

@GaVrA
11 years ago

#1 @GaVrA
11 years ago

  • Keywords has-patch added; needs-patch removed

Second patch, day after contributors day at WordCamp Switzerland! :)

So the 28124.diff takes care of what you wanted. :)

I did some search inside wp-admin and found following things:

File wp-admin/load-styles.php

$expires_offset = 31536000; // 1 year

File wp-admin/load-scripts.php

$expires_offset = 31536000; // 1 year

File wp-admin/includes/class-wp-upgrader.php

// schedule a cleanup for 2 hours from now in case of failed install
wp_schedule_single_event( time() + 7200, 'upgrader_scheduled_cleanup', array( $this->id ) );

Should that be updated via this ticket or a new one?

#2 @SergeyBiryukov
11 years ago

wp-admin/load-styles.php and wp-admin/load-scripts.php should be left as is, see [21997] and [22531].

Good catch on wp-admin/includes/class-wp-upgrader.php.

#3 @SergeyBiryukov
11 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 28253:

Use a time constant in get_theme_feature_list() and File_Upload_Upgrader.

props GaVrA.
fixes #28124.

Note: See TracTickets for help on using tickets.