Ticket #20987: 20987.3.patch
File 20987.3.patch, 29.9 KB (added by , 13 years ago) |
---|
-
wp-admin/credits.php
30 30 if ( ! is_array( $results ) ) 31 31 return false; 32 32 33 set_site_transient( 'wordpress_credits_' . $locale, $results, 86400 ); // One day33 set_site_transient( 'wordpress_credits_' . $locale, $results, DAY_IN_SECONDS ); 34 34 } 35 35 36 36 return $results; -
wp-admin/includes/class-wp-comments-list-table.php
330 330 $the_comment_status = wp_get_comment_status( $comment->comment_ID ); 331 331 332 332 $ptime = date( 'G', strtotime( $comment->comment_date ) ); 333 if ( ( abs( time() - $ptime ) ) < 86400)333 if ( ( abs( time() - $ptime ) ) < DAY_IN_SECONDS ) 334 334 $ptime = sprintf( __( '%s ago' ), human_time_diff( $ptime ) ); 335 335 else 336 336 $ptime = mysql2date( __( 'Y/m/d \a\t g:i A' ), $comment->comment_date ); -
wp-admin/includes/class-wp-media-list-table.php
279 279 $t_time = get_the_time( __( 'Y/m/d g:i:s A' ) ); 280 280 $m_time = $post->post_date; 281 281 $time = get_post_time( 'G', true, $post, false ); 282 if ( ( abs( $t_diff = time() - $time ) ) < 86400) {282 if ( ( abs( $t_diff = time() - $time ) ) < DAY_IN_SECONDS ) { 283 283 if ( $t_diff < 0 ) 284 284 $h_time = sprintf( __( '%s from now' ), human_time_diff( $time ) ); 285 285 else -
wp-admin/includes/class-wp-plugins-list-table.php
69 69 } 70 70 } 71 71 72 set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), 86400);72 set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), DAY_IN_SECONDS ); 73 73 74 74 if ( ! $screen->is_network ) { 75 75 $recently_activated = get_option( 'recently_activated', array() ); 76 76 77 $one_week = 7*24*60*60;78 77 foreach ( $recently_activated as $key => $time ) 79 if ( $time + $one_week< time() )78 if ( $time + WEEK_IN_SECONDS < time() ) 80 79 unset( $recently_activated[$key] ); 81 80 update_option( 'recently_activated', $recently_activated ); 82 81 } -
wp-admin/includes/class-wp-posts-list-table.php
573 573 574 574 $time_diff = time() - $time; 575 575 576 if ( $time_diff > 0 && $time_diff < 24*60*60)576 if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) 577 577 $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) ); 578 578 else 579 579 $h_time = mysql2date( __( 'Y/m/d' ), $m_time ); -
wp-admin/includes/dashboard.php
913 913 914 914 if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) { 915 915 $plugin_slugs = array_keys( get_plugins() ); 916 set_transient( 'plugin_slugs', $plugin_slugs, 86400);916 set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS ); 917 917 } 918 918 919 919 foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Plugins') ) as $feed => $label ) { … … 1021 1021 array_unshift( $args, $widget_id ); 1022 1022 ob_start(); 1023 1023 call_user_func_array( $callback, $args ); 1024 set_transient( $cache_key, ob_get_flush(), 43200); // Default lifetime in cache of 12 hours (same as the feeds)1024 set_transient( $cache_key, ob_get_flush(), 12 * HOUR_IN_SECONDS ); // Default lifetime in cache of 12 hours (same as the feeds) 1025 1025 } 1026 1026 1027 1027 return true; … … 1212 1212 if ( ! is_array( $response ) ) 1213 1213 return false; 1214 1214 1215 set_site_transient( 'browser_' . $key, $response, 604800 ); // cache for 1 week1215 set_site_transient( 'browser_' . $key, $response, WEEK_IN_SECONDS ); 1216 1216 } 1217 1217 1218 1218 return $response; -
wp-admin/includes/import.php
89 89 $id = wp_insert_attachment( $object, $file ); 90 90 91 91 // schedule a cleanup for one day from now in case of failed import or missing wp_import_cleanup() call 92 wp_schedule_single_event( time() + 86400, 'importer_scheduled_cleanup', array( $id ) );92 wp_schedule_single_event( time() + DAY_IN_SECONDS, 'importer_scheduled_cleanup', array( $id ) ); 93 93 94 94 return array( 'file' => $file, 'id' => $id ); 95 95 } -
wp-admin/includes/nav-menu.php
1150 1150 */ 1151 1151 function _wp_delete_orphaned_draft_menu_items() { 1152 1152 global $wpdb; 1153 $delete_timestamp = time() - ( 60*60*24*EMPTY_TRASH_DAYS);1153 $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS ); 1154 1154 1155 1155 // delete orphaned draft menu items 1156 1156 $menu_items_to_delete = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts AS p LEFT JOIN $wpdb->postmeta AS m ON p.ID = m.post_id WHERE post_type = 'nav_menu_item' AND post_status = 'draft' AND meta_key = '_menu_item_orphaned' AND meta_value < '%d'", $delete_timestamp ) ); -
wp-admin/includes/plugin-install.php
74 74 if ( is_wp_error($tags) ) 75 75 return $tags; 76 76 77 set_site_transient( 'poptags_' . $key, $tags, 10800); // 3 * 60 * 60 = 1080077 set_site_transient( 'poptags_' . $key, $tags, 3 * HOUR_IN_SECONDS ); 78 78 79 79 return $tags; 80 80 } -
wp-admin/includes/upgrade.php
567 567 $time_difference = $all_options->time_difference; 568 568 569 569 $server_time = time()+date('Z'); 570 $weblogger_time = $server_time + $time_difference *3600;570 $weblogger_time = $server_time + $time_difference * HOUR_IN_SECONDS; 571 571 $gmt_time = time(); 572 572 573 $diff_gmt_server = ($gmt_time - $server_time) / 3600;574 $diff_weblogger_server = ($weblogger_time - $server_time) / 3600;573 $diff_gmt_server = ($gmt_time - $server_time) / HOUR_IN_SECONDS; 574 $diff_weblogger_server = ($weblogger_time - $server_time) / HOUR_IN_SECONDS; 575 575 $diff_gmt_weblogger = $diff_gmt_server - $diff_weblogger_server; 576 576 $gmt_offset = -$diff_gmt_weblogger; 577 577 -
wp-admin/load-scripts.php
125 125 126 126 $compress = ( isset($_GET['c']) && $_GET['c'] ); 127 127 $force_gzip = ( $compress && 'gzip' == $_GET['c'] ); 128 $expires_offset = 31536000;128 $expires_offset = YEAR_IN_SECONDS; 129 129 $out = ''; 130 130 131 131 $wp_scripts = new WP_Scripts(); -
wp-admin/load-styles.php
104 104 $compress = ( isset($_GET['c']) && $_GET['c'] ); 105 105 $force_gzip = ( $compress && 'gzip' == $_GET['c'] ); 106 106 $rtl = ( isset($_GET['dir']) && 'rtl' == $_GET['dir'] ); 107 $expires_offset = 31536000;107 $expires_offset = YEAR_IN_SECONDS; 108 108 $out = ''; 109 109 110 110 $wp_styles = new WP_Styles(); -
wp-includes/bookmark-template.php
79 79 if ( $show_updated ) 80 80 if ( '00' != substr($bookmark->link_updated_f, 0, 2) ) { 81 81 $title .= ' ('; 82 $title .= sprintf(__('Last updated: %s'), date(get_option('links_updated_date_format'), $bookmark->link_updated_f + (get_option('gmt_offset') * 3600)));82 $title .= sprintf(__('Last updated: %s'), date(get_option('links_updated_date_format'), $bookmark->link_updated_f + (get_option('gmt_offset') * HOUR_IN_SECONDS))); 83 83 $title .= ')'; 84 84 } 85 85 -
wp-includes/class-feed.php
18 18 class WP_Feed_Cache_Transient { 19 19 var $name; 20 20 var $mod_name; 21 var $lifetime = 43200; //Default lifetime in cache of 12 hours21 var $lifetime = 12 * HOUR_IN_SECONDS; //Default lifetime in cache of 12 hours 22 22 23 23 function __construct($location, $filename, $extension) { 24 24 $this->name = 'feed_' . $filename; -
wp-includes/class-http.php
806 806 if ( ! function_exists( 'fsockopen' ) ) 807 807 return false; 808 808 809 if ( false !== ( $option = get_option( 'disable_fsockopen' )) && time()-$option < 43200 ) // 12 hours809 if ( false !== ( $option = get_option( 'disable_fsockopen' ) ) && time() - $option < 12 * HOUR_IN_SECONDS ) 810 810 return false; 811 811 812 812 $is_ssl = isset( $args['ssl'] ) && $args['ssl']; -
wp-includes/comment.php
694 694 global $wpdb; 695 695 if ( current_user_can( 'manage_options' ) ) 696 696 return; // don't throttle admins 697 $hour_ago = gmdate( 'Y-m-d H:i:s', time() - 3600);697 $hour_ago = gmdate( 'Y-m-d H:i:s', time() - HOUR_IN_SECONDS ); 698 698 if ( $lasttime = $wpdb->get_var( $wpdb->prepare( "SELECT `comment_date_gmt` FROM `$wpdb->comments` WHERE `comment_date_gmt` >= %s AND ( `comment_author_IP` = %s OR `comment_author_email` = %s ) ORDER BY `comment_date_gmt` DESC LIMIT 1", $hour_ago, $ip, $email ) ) ) { 699 699 $time_lastcomment = mysql2date('U', $lasttime, false); 700 700 $time_newcomment = mysql2date('U', $date, false); … … 1976 1976 if ( ! $days_old ) 1977 1977 return $posts; 1978 1978 1979 if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( $days_old * 24 * 60 * 60) ) {1979 if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) ) { 1980 1980 $posts[0]->comment_status = 'closed'; 1981 1981 $posts[0]->ping_status = 'closed'; 1982 1982 } … … 2011 2011 if ( ! in_array( $post->post_type, $post_types ) ) 2012 2012 return $open; 2013 2013 2014 if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * 24 * 60 * 60) )2014 if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) ) 2015 2015 return false; 2016 2016 2017 2017 return $open; -
wp-includes/cron.php
206 206 */ 207 207 $lock = get_transient('doing_cron'); 208 208 209 if ( $lock > $local_time + 10 *60)209 if ( $lock > $local_time + 10 * MINUTE_IN_SECONDS ) 210 210 $lock = 0; 211 211 212 212 // don't run if another process is currently running it or more than once every 60 sec. … … 313 313 */ 314 314 function wp_get_schedules() { 315 315 $schedules = array( 316 'hourly' => array( 'interval' => 3600, 'display' => __('Once Hourly') ),317 'twicedaily' => array( 'interval' => 43200, 'display' => __('Twice Daily') ),318 'daily' => array( 'interval' => 86400, 'display' => __('Once Daily') ),316 'hourly' => array( 'interval' => HOUR_IN_SECONDS, 'display' => __('Once Hourly') ), 317 'twicedaily' => array( 'interval' => 12 * HOUR_IN_SECONDS, 'display' => __('Twice Daily') ), 318 'daily' => array( 'interval' => DAY_IN_SECONDS, 'display' => __('Once Daily') ), 319 319 ); 320 320 return array_merge( apply_filters( 'cron_schedules', array() ), $schedules ); 321 321 } -
wp-includes/default-constants.php
299 299 define( 'WP_DEFAULT_THEME', 'twentyeleven' ); 300 300 301 301 } 302 303 /** 304 * Defines time-related WordPress constants 305 * 306 * @since 3.5.0 307 */ 308 function wp_time_constants( ) { 309 /** 310 * Constants for expressing human-interval intervals in their 311 * respective number of seconds 312 */ 313 define( 'MINUTE_IN_SECONDS', 60 ); 314 define( 'HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS ); 315 define( 'DAY_IN_SECONDS', 24 * HOUR_IN_SECONDS ); 316 define( 'WEEK_IN_SECONDS', 7 * DAY_IN_SECONDS ); 317 define( 'MONTH_IN_SECONDS', 30 * DAY_IN_SECONDS ); 318 define( 'YEAR_IN_SECONDS', 365 * DAY_IN_SECONDS ); 319 320 /** 321 * Constants for expressing human-interval intervals in their 322 * respective number of minutes 323 */ 324 define( 'HOUR_IN_MINUTES', 60 ); 325 define( 'DAY_IN_MINUTES', 24 * HOUR_IN_MINUTES ); 326 define( 'WEEK_IN_MINUTES', 7 * DAY_IN_MINUTES ); 327 define( 'MONTH_IN_MINUTES', 30 * DAY_IN_MINUTES ); 328 define( 'YEAR_IN_MINUTES', 365 * DAY_IN_MINUTES ); 329 } -
wp-includes/deprecated.php
984 984 985 985 if ( $show_updated ) 986 986 if (substr($row->link_updated_f, 0, 2) != '00') 987 $title .= ' ('.__('Last updated') . ' ' . date(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * 3600)) . ')';987 $title .= ' ('.__('Last updated') . ' ' . date(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * HOUR_IN_SECONDS)) . ')'; 988 988 989 989 if ( '' != $title ) 990 990 $title = ' title="' . $title . '"'; -
wp-includes/feed.php
534 534 $feed->set_feed_url($url); 535 535 $feed->set_cache_class('WP_Feed_Cache'); 536 536 $feed->set_file_class('WP_SimplePie_File'); 537 $feed->set_cache_duration( apply_filters('wp_feed_cache_transient_lifetime', 43200, $url));537 $feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) ); 538 538 do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) ); 539 539 $feed->init(); 540 540 $feed->handle_content_type(); -
wp-includes/formatting.php
1872 1872 $datetime = new DateTime( $string ); 1873 1873 $datetime->setTimezone( new DateTimeZone('UTC') ); 1874 1874 $offset = $datetime->getOffset(); 1875 $datetime->modify( '+' . $offset / 3600. ' hours');1875 $datetime->modify( '+' . $offset / HOUR_IN_SECONDS . ' hours'); 1876 1876 $string_gmt = gmdate($format, $datetime->format('U')); 1877 1877 1878 1878 date_default_timezone_set('UTC'); 1879 1879 } else { 1880 1880 $string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); 1881 $string_gmt = gmdate($format, $string_time - get_option('gmt_offset') * 3600);1881 $string_gmt = gmdate($format, $string_time - get_option('gmt_offset') * HOUR_IN_SECONDS); 1882 1882 } 1883 1883 return $string_gmt; 1884 1884 } … … 1898 1898 function get_date_from_gmt($string, $format = 'Y-m-d H:i:s') { 1899 1899 preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches); 1900 1900 $string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); 1901 $string_localtime = gmdate($format, $string_time + get_option('gmt_offset') *3600);1901 $string_localtime = gmdate($format, $string_time + get_option('gmt_offset') * HOUR_IN_SECONDS); 1902 1902 return $string_localtime; 1903 1903 } 1904 1904 … … 1918 1918 $sign = (substr($timezone, 0, 1) == '+') ? 1 : -1; 1919 1919 $hours = intval(substr($timezone, 1, 2)); 1920 1920 $minutes = intval(substr($timezone, 3, 4)) / 60; 1921 $offset = $sign * 3600* ($hours + $minutes);1921 $offset = $sign * HOUR_IN_SECONDS * ($hours + $minutes); 1922 1922 } 1923 1923 return $offset; 1924 1924 } … … 1942 1942 if (!empty($date_bits[7])) { // we have a timezone, so let's compute an offset 1943 1943 $offset = iso8601_timezone_to_offset($date_bits[7]); 1944 1944 } else { // we don't have a timezone, so we assume user local timezone (not server's!) 1945 $offset = 3600* get_option('gmt_offset');1945 $offset = HOUR_IN_SECONDS * get_option('gmt_offset'); 1946 1946 } 1947 1947 1948 1948 $timestamp = gmmktime($date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1]); … … 2067 2067 * @return string Human readable time difference. 2068 2068 */ 2069 2069 function human_time_diff( $from, $to = '' ) { 2070 if ( empty( $to) )2070 if ( empty( $to ) ) 2071 2071 $to = time(); 2072 $diff = (int) abs( $to - $from);2073 if ( $diff <= 3600) {2074 $mins = round( $diff / 60);2075 if ( $mins <= 1) {2072 $diff = (int) abs( $to - $from ); 2073 if ( $diff <= HOUR_IN_SECONDS ) { 2074 $mins = round( $diff / 60 ); 2075 if ( $mins <= 1 ) { 2076 2076 $mins = 1; 2077 2077 } 2078 2078 /* translators: min=minute */ 2079 $since = sprintf( _n('%s min', '%s mins', $mins), $mins);2080 } else if (($diff <= 86400) && ($diff > 3600)) {2081 $hours = round( $diff / 3600);2082 if ( $hours <= 1) {2079 $since = sprintf( _n( '%s min', '%s mins', $mins ), $mins ); 2080 } elseif ( ( $diff <= DAY_IN_SECONDS ) && ( $diff > HOUR_IN_SECONDS ) ) { 2081 $hours = round( $diff / HOUR_IN_SECONDS ); 2082 if ( $hours <= 1 ) { 2083 2083 $hours = 1; 2084 2084 } 2085 $since = sprintf( _n('%s hour', '%s hours', $hours), $hours);2086 } elseif ( $diff >= 86400) {2087 $days = round( $diff / 86400);2088 if ( $days <= 1) {2085 $since = sprintf( _n( '%s hour', '%s hours', $hours ), $hours ); 2086 } elseif ( $diff >= DAY_IN_SECONDS ) { 2087 $days = round( $diff / DAY_IN_SECONDS ); 2088 if ( $days <= 1 ) { 2089 2089 $days = 1; 2090 2090 } 2091 $since = sprintf( _n('%s day', '%s days', $days), $days);2091 $since = sprintf( _n( '%s day', '%s days', $days ), $days ); 2092 2092 } 2093 2093 return $since; 2094 2094 } -
wp-includes/functions.php
59 59 function current_time( $type, $gmt = 0 ) { 60 60 switch ( $type ) { 61 61 case 'mysql': 62 return ( $gmt ) ? gmdate( 'Y-m-d H:i:s' ) : gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * 3600) ) );62 return ( $gmt ) ? gmdate( 'Y-m-d H:i:s' ) : gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) ); 63 63 break; 64 64 case 'timestamp': 65 return ( $gmt ) ? time() : time() + ( get_option( 'gmt_offset' ) * 3600);65 return ( $gmt ) ? time() : time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ); 66 66 break; 67 67 } 68 68 } … … 214 214 if ( $weekday < $start_of_week ) 215 215 $weekday += 7; 216 216 217 $start = $day - 86400* ( $weekday - $start_of_week ); // The most recent week start day on or before $day218 $end = $start + 604799; // $start + 7 days - 1 second217 $start = $day - DAY_IN_SECONDS * ( $weekday - $start_of_week ); // The most recent week start day on or before $day 218 $end = $start + 7 * DAY_IN_SECONDS - 1; // $start + 7 days - 1 second 219 219 return compact( 'start', 'end' ); 220 220 } 221 221 … … 930 930 * @since 2.1.0 931 931 */ 932 932 function cache_javascript_headers() { 933 $expiresOffset = 864000; // 10 days933 $expiresOffset = 10 * DAY_IN_SECONDS; 934 934 header( "Content-Type: text/javascript; charset=" . get_bloginfo( 'charset' ) ); 935 935 header( "Vary: Accept-Encoding" ); // Handle proxies 936 936 header( "Expires: " . gmdate( "D, d M Y H:i:s", time() + $expiresOffset ) . " GMT" ); … … 3020 3020 if ( false === $timezone_object || false === $datetime_object ) { 3021 3021 return false; 3022 3022 } 3023 return round( timezone_offset_get( $timezone_object, $datetime_object ) / 3600, 2 );3023 return round( timezone_offset_get( $timezone_object, $datetime_object ) / HOUR_IN_SECONDS, 2 ); 3024 3024 } 3025 3025 3026 3026 /** … … 3220 3220 function wp_scheduled_delete() { 3221 3221 global $wpdb; 3222 3222 3223 $delete_timestamp = time() - ( 60*60*24*EMPTY_TRASH_DAYS);3223 $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS ); 3224 3224 3225 3225 $posts_to_delete = $wpdb->get_results($wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < '%d'", $delete_timestamp), ARRAY_A); 3226 3226 -
wp-includes/js/tinymce/wp-tinymce.php
19 19 return @file_get_contents($path); 20 20 } 21 21 22 $expires_offset = 31536000;22 $expires_offset = YEAR_IN_SECONDS; 23 23 24 24 header('Content-Type: application/x-javascript; charset=UTF-8'); 25 25 header('Vary: Accept-Encoding'); // Handle proxies -
wp-includes/ms-functions.php
1417 1417 1418 1418 $dirsize[ $directory ][ 'size' ] = recurse_dirsize( $directory ); 1419 1419 1420 set_transient( 'dirsize_cache', $dirsize, 3600);1420 set_transient( 'dirsize_cache', $dirsize, HOUR_IN_SECONDS ); 1421 1421 return $dirsize[ $directory ][ 'size' ]; 1422 1422 } 1423 1423 -
wp-includes/option.php
560 560 } 561 561 } 562 562 563 setcookie( 'wp-settings-' . $user->ID, $settings, time() + 31536000, SITECOOKIEPATH );564 setcookie( 'wp-settings-time-' . $user->ID, time(), time() + 31536000, SITECOOKIEPATH );563 setcookie( 'wp-settings-' . $user->ID, $settings, time() + YEAR_IN_SECONDS, SITECOOKIEPATH ); 564 setcookie( 'wp-settings-time-' . $user->ID, time(), time() + YEAR_IN_SECONDS, SITECOOKIEPATH ); 565 565 $_COOKIE['wp-settings-' . $user->ID] = $settings; 566 566 } 567 567 … … 724 724 return; 725 725 726 726 update_user_option( $user->ID, 'user-settings', '', false ); 727 setcookie('wp-settings-' . $user->ID, ' ', time() - 31536000, SITECOOKIEPATH);727 setcookie('wp-settings-' . $user->ID, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH); 728 728 } 729 729 730 730 /** -
wp-includes/pluggable.php
529 529 530 530 // Allow a grace period for POST and AJAX requests 531 531 if ( defined('DOING_AJAX') || 'POST' == $_SERVER['REQUEST_METHOD'] ) 532 $expired += 3600;532 $expired += HOUR_IN_SECONDS; 533 533 534 534 // Quick check to see if an honest cookie has expired 535 535 if ( $expired < time() ) { … … 694 694 function wp_clear_auth_cookie() { 695 695 do_action('clear_auth_cookie'); 696 696 697 setcookie(AUTH_COOKIE, ' ', time() - 31536000, ADMIN_COOKIE_PATH, COOKIE_DOMAIN);698 setcookie(SECURE_AUTH_COOKIE, ' ', time() - 31536000, ADMIN_COOKIE_PATH, COOKIE_DOMAIN);699 setcookie(AUTH_COOKIE, ' ', time() - 31536000, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN);700 setcookie(SECURE_AUTH_COOKIE, ' ', time() - 31536000, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN);701 setcookie(LOGGED_IN_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);702 setcookie(LOGGED_IN_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);697 setcookie(AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN); 698 setcookie(SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN); 699 setcookie(AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN); 700 setcookie(SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN); 701 setcookie(LOGGED_IN_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN); 702 setcookie(LOGGED_IN_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN); 703 703 704 704 // Old cookies 705 setcookie(AUTH_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);706 setcookie(AUTH_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);707 setcookie(SECURE_AUTH_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);708 setcookie(SECURE_AUTH_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);705 setcookie(AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN); 706 setcookie(AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN); 707 setcookie(SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN); 708 setcookie(SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN); 709 709 710 710 // Even older cookies 711 setcookie(USER_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);712 setcookie(PASS_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);713 setcookie(USER_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);714 setcookie(PASS_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);711 setcookie(USER_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN); 712 setcookie(PASS_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN); 713 setcookie(USER_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN); 714 setcookie(PASS_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN); 715 715 } 716 716 endif; 717 717 … … 1234 1234 * @return int 1235 1235 */ 1236 1236 function wp_nonce_tick() { 1237 $nonce_life = apply_filters('nonce_life', 86400);1237 $nonce_life = apply_filters('nonce_life', DAY_IN_SECONDS); 1238 1238 1239 1239 return ceil(time() / ( $nonce_life / 2 )); 1240 1240 } -
wp-includes/taxonomy.php
1384 1384 } 1385 1385 1386 1386 if ( empty($terms) ) { 1387 wp_cache_add( $cache_key, array(), 'terms', 86400 ); // one day1387 wp_cache_add( $cache_key, array(), 'terms', DAY_IN_SECONDS ); 1388 1388 $terms = apply_filters('get_terms', array(), $taxonomies, $args); 1389 1389 return $terms; 1390 1390 } … … 1435 1435 $terms = array_slice($terms, $offset, $number); 1436 1436 } 1437 1437 1438 wp_cache_add( $cache_key, $terms, 'terms', 86400 ); // one day1438 wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS ); 1439 1439 1440 1440 $terms = apply_filters('get_terms', $terms, $taxonomies, $args); 1441 1441 return $terms; -
wp-includes/update.php
155 155 // Check for update on a different schedule, depending on the page. 156 156 switch ( current_filter() ) { 157 157 case 'load-update-core.php' : 158 $timeout = 60; // 1 min158 $timeout = MINUTE_IN_SECONDS; 159 159 break; 160 160 case 'load-plugins.php' : 161 161 case 'load-update.php' : 162 $timeout = 3600; // 1 hour162 $timeout = HOUR_IN_SECONDS; 163 163 break; 164 164 default : 165 $timeout = 43200; // 12 hours165 $timeout = 12 * HOUR_IN_SECONDS; 166 166 } 167 167 168 168 $time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked ); … … 264 264 // Check for update on a different schedule, depending on the page. 265 265 switch ( current_filter() ) { 266 266 case 'load-update-core.php' : 267 $timeout = 60; // 1 min267 $timeout = MINUTE_IN_SECONDS; 268 268 break; 269 269 case 'load-themes.php' : 270 270 case 'load-update.php' : 271 $timeout = 3600; // 1 hour271 $timeout = HOUR_IN_SECONDS; 272 272 break; 273 273 default : 274 $timeout = 43200; // 12 hours274 $timeout = 12 * HOUR_IN_SECONDS; 275 275 } 276 276 277 277 $time_not_changed = isset( $last_update->last_checked ) && $timeout > ( time( ) - $last_update->last_checked ); … … 371 371 $current = get_site_transient( 'update_core' ); 372 372 373 373 if ( isset( $current->last_checked ) && 374 43200> ( time() - $current->last_checked ) &&374 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) && 375 375 isset( $current->version_checked ) && 376 376 $current->version_checked == $wp_version ) 377 377 return; … … 390 390 */ 391 391 function _maybe_update_plugins() { 392 392 $current = get_site_transient( 'update_plugins' ); 393 if ( isset( $current->last_checked ) && 43200> ( time() - $current->last_checked ) )393 if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) ) 394 394 return; 395 395 wp_update_plugins(); 396 396 } … … 406 406 */ 407 407 function _maybe_update_themes( ) { 408 408 $current = get_site_transient( 'update_themes' ); 409 if ( isset( $current->last_checked ) && 43200> ( time( ) - $current->last_checked ) )409 if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time( ) - $current->last_checked ) ) 410 410 return; 411 411 412 412 wp_update_themes(); -
wp-login.php
390 390 } 391 391 392 392 // 10 days 393 setcookie( 'wp-postpass_' . COOKIEHASH, $wp_hasher->HashPassword( stripslashes( $_POST['post_password'] ) ), time() + 864000, COOKIEPATH );393 setcookie( 'wp-postpass_' . COOKIEHASH, $wp_hasher->HashPassword( stripslashes( $_POST['post_password'] ) ), time() + 10 * DAY_IN_SECONDS, COOKIEPATH ); 394 394 395 395 wp_safe_redirect( wp_get_referer() ); 396 396 exit(); -
wp-mail.php
30 30 31 31 set_transient('mailserver_last_checked', true, WP_MAIL_INTERVAL); 32 32 33 $time_difference = get_option('gmt_offset') * 3600;33 $time_difference = get_option('gmt_offset') * HOUR_IN_SECONDS; 34 34 35 35 $phone_delim = '::'; 36 36 -
wp-settings.php
23 23 require( ABSPATH . WPINC . '/version.php' ); 24 24 25 25 // Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE. 26 wp_initial_constants( ); 26 wp_initial_constants(); 27 // Define time-related constants. 28 wp_time_constants(); 27 29 28 30 // Check for the required PHP version and for the MySQL extension or a database drop-in. 29 31 wp_check_php_mysql_versions();