From aed49756e0f55cd7c8655f0d0b94f62631ecad03 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 25 Oct 2024 20:26:20 +0000 Subject: [PATCH] Docs: Adjust comments about `set_time_limit()` per the documentation standards. Includes splitting long comments into multiple lines and moving a few comments above the `function_exists()` check for more consistent placement. Follow-up to [59039], [59288]. See #62281. Built from https://develop.svn.wordpress.org/trunk@59291 git-svn-id: http://core.svn.wordpress.org/trunk@58683 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 2 +- wp-admin/includes/class-wp-upgrader.php | 6 +++++- wp-admin/includes/update-core.php | 5 ++++- wp-includes/class-pop3.php | 4 ++-- wp-includes/comment.php | 2 +- wp-includes/deprecated.php | 2 +- wp-includes/version.php | 2 +- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 27ec0d8752..83b682634b 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -3556,8 +3556,8 @@ function wp_ajax_get_revision_diffs() { $return = array(); + // Increase the script timeout limit to allow ample time for diff UI setup. if ( function_exists( 'set_time_limit' ) ) { - // Increase the script timeout limit to allow ample time for diff UI setup. set_time_limit( 5 * MINUTE_IN_SECONDS ); } diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index a9784682eb..c47773569f 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -525,7 +525,11 @@ class WP_Upgrader { $destination = $args['destination']; $clear_destination = $args['clear_destination']; - // Give the upgrade an additional 300 seconds(5 minutes) to ensure the install doesn't prematurely timeout having used up the maximum script execution time upacking and downloading in WP_Upgrader->run. + /* + * Give the upgrade an additional 300 seconds (5 minutes) to ensure the install + * doesn't prematurely timeout having used up the maximum script execution time + * upacking and downloading in WP_Upgrader->run(). + */ if ( function_exists( 'set_time_limit' ) ) { set_time_limit( 300 ); } diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 297c931bc0..d5c4385c7e 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -970,8 +970,11 @@ $_new_bundled_files = array( function update_core( $from, $to ) { global $wp_filesystem, $_old_files, $_old_requests_files, $_new_bundled_files, $wpdb; + /* + * Give core update script an additional 300 seconds (5 minutes) + * to finish updating large files when running on slower servers. + */ if ( function_exists( 'set_time_limit' ) ) { - // Gives core update script time an additional 300 seconds(5 minutes) to finish updating large files or run on slower servers. set_time_limit( 300 ); } diff --git a/wp-includes/class-pop3.php b/wp-includes/class-pop3.php index b4eab75044..aec31dc7f1 100644 --- a/wp-includes/class-pop3.php +++ b/wp-includes/class-pop3.php @@ -59,8 +59,8 @@ class POP3 { if(!empty($timeout)) { settype($timeout,"integer"); $this->TIMEOUT = $timeout; + // Extend POP3 request timeout to the specified TIMEOUT property. if(function_exists("set_time_limit")){ - // Extends POP3 request timeout to specified TIMEOUT property. set_time_limit($timeout); } } @@ -75,8 +75,8 @@ class POP3 { } function update_timer () { + // Extend POP3 request timeout to the specified TIMEOUT property. if(function_exists("set_time_limit")){ - // Allows additional extension of POP3 request timeout to specified TIMEOUT property when update_timer is called. set_time_limit($this->TIMEOUT); } return true; diff --git a/wp-includes/comment.php b/wp-includes/comment.php index d1dacf243e..ce37558d04 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -3120,8 +3120,8 @@ function pingback( $content, $post ) { $pingback_server_url = discover_pingback_server_uri( $pagelinkedto ); if ( $pingback_server_url ) { + // Allow an additional 60 seconds for each pingback to complete. if ( function_exists( 'set_time_limit' ) ) { - // Allows an additional 60 seconds for each pingback to complete. set_time_limit( 60 ); } diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 0b16147d5f..1aaedd0474 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -3673,7 +3673,7 @@ function post_permalink( $post = 0 ) { function wp_get_http( $url, $file_path = false, $red = 1 ) { _deprecated_function( __FUNCTION__, '4.4.0', 'WP_Http' ); - // Adds an additional 60 seconds to the script timeout to ensure the remote request has enough time. + // Add 60 seconds to the script timeout to ensure the remote request has enough time. if ( function_exists( 'set_time_limit' ) ) { @set_time_limit( 60 ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index ad81edc0ad..00fcb3967f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59290'; +$wp_version = '6.8-alpha-59291'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.