[wp-trac] [WordPress Trac] #58380: Setting time limit for updates doesn't always work.

WordPress Trac noreply at wordpress.org
Thu Jun 22 09:05:33 UTC 2023


#58380: Setting time limit for updates doesn't always work.
-----------------------------+-----------------------
 Reporter:  NekoJonez        |       Owner:  pbiron
     Type:  enhancement      |      Status:  accepted
 Priority:  normal           |   Milestone:  6.3
Component:  Upgrade/Install  |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  needs-dev-note   |     Focuses:
-----------------------------+-----------------------

Comment (by NekoJonez):

 So, @costdev gave me this PHP code to test as a plugin for the result:

 {{{#!php
 <?php
 ​
 /**
  * Plugin Name: Check whether <code>set_time_limit()</code> is available.
  * Description: Checks whether <code>set_time_limit()</code> is available.
  * Author:      WordPress Core Contributors
  * Author URI:  https://make.wordpress.org/core
  * License:     GPLv2 or later
  * Version:     1.0.0
  */
 ​
 add_action(
     'admin_notices',
     function() {
         $result = '';
 ​
         if ( function_exists( 'set_time_limit' ) ) {
             $result .= '<code>set_time_limit()</code> is available.';
         } else {
             $result .= '<code>set_time_limit()</code> is not available.';
             if ( ! function_exists( 'ini_get' ) ) {
                 $result .= ' Could not retrieve the
 <code>disable_functions</code> directive.';
             } elseif ( str_contains( ini_get( 'disable_functions' ),
 'set_time_limit' ) ) {
                 $result .= ' <code>set_time_limit()</code> is disabled.';
             } else {
                 $result .= ' <code>set_time_limit()</code> is not
 disabled.';
             }
         }
 ​
         echo '<div class="notice notice-info"><p>' . $result .
 '</p></div>';
     }
 );
 }}}

 This places a notice in the admin dashboard whether or not the module is
 available.
 I tested this on three accounts I have with that hoster and all gave as
 result back:

 set_time_limit() is available.

 --> I think that at the core of this issue is most likely due to system
 policies, the module is present on the server but can't be interacted with
 by end users or customers of that host.
 I think we should add an additional check if the module can be interacted
 with? But writing or investigating that is above my PHP skills. I can
 print hello world and that's it.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58380#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list