Skip to content

Commit 7573385

Browse files
Coding Standards: Use MINUTE_IN_SECONDS where appropriate.
This aims to clarify the time units for some timeout or expiration values. Follow-up to [11823], [13177], [21996], [37747]. See #55647. git-svn-id: https://develop.svn.wordpress.org/trunk@53714 602fd350-edb4-49c9-b593-d223f7449a82
1 parent b05fbba commit 7573385

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/wp-admin/includes/class-wp-filesystem-ftpext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct( $opt = '' ) {
4040

4141
// This class uses the timeout on a per-connection basis, others use it on a per-action basis.
4242
if ( ! defined( 'FS_TIMEOUT' ) ) {
43-
define( 'FS_TIMEOUT', 240 );
43+
define( 'FS_TIMEOUT', 4 * MINUTE_IN_SECONDS );
4444
}
4545

4646
if ( empty( $opt['port'] ) ) {

src/wp-admin/includes/file.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,10 +2007,10 @@ function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_own
20072007
* to allow for per-transport overriding of the default.
20082008
*/
20092009
if ( ! defined( 'FS_CONNECT_TIMEOUT' ) ) {
2010-
define( 'FS_CONNECT_TIMEOUT', 30 );
2010+
define( 'FS_CONNECT_TIMEOUT', MINUTE_IN_SECONDS / 2 );
20112011
}
20122012
if ( ! defined( 'FS_TIMEOUT' ) ) {
2013-
define( 'FS_TIMEOUT', 30 );
2013+
define( 'FS_TIMEOUT', MINUTE_IN_SECONDS / 2 );
20142014
}
20152015

20162016
if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {

src/wp-admin/options-permalink.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
add_settings_error( 'general', 'settings_updated', $message, 'success' );
204204
}
205205

206-
set_transient( 'settings_errors', get_settings_errors(), 30 );
206+
set_transient( 'settings_errors', get_settings_errors(), MINUTE_IN_SECONDS / 2 );
207207

208208
wp_redirect( admin_url( 'options-permalink.php?settings-updated=true' ) );
209209
exit;

src/wp-admin/options.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,8 @@
344344
if ( ! count( get_settings_errors() ) ) {
345345
add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'success' );
346346
}
347-
set_transient( 'settings_errors', get_settings_errors(), 30 );
347+
348+
set_transient( 'settings_errors', get_settings_errors(), MINUTE_IN_SECONDS / 2 );
348349

349350
// Redirect back to the settings page that was submitted.
350351
$goback = add_query_arg( 'settings-updated', 'true', wp_get_referer() );

0 commit comments

Comments
 (0)