[wp-trac] [WordPress Trac] #52765: Fatal error: Maximum execution time exceeded in _upgrade_422_find_genericons_files_in_folder()

WordPress Trac noreply at wordpress.org
Thu Mar 18 18:43:02 UTC 2021


#52765: Fatal error: Maximum execution time exceeded in
_upgrade_422_find_genericons_files_in_folder()
-----------------------------+---------------------
 Reporter:  bobbingwide      |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  5.8
Component:  Upgrade/Install  |     Version:
 Severity:  minor            |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+---------------------

Comment (by bobbingwide):

 I changed my test routine and ran it again. I realised I'd chosen the
 wrong development site but let it run.

 It took 813 seconds for 175,875 folders.
 That's for 177 plugins, of which 17 build blocks.

 Today, running it on the original site, it took 360 seconds for 70779
 directories.
 28 seconds slower for an additional 152 directories.


 Perhaps there should be a test for a local development environment.

 Personally I've never set WP_ENVIRONMENT_TYPE, so
 wp_get_environment_type() returns 'production'
 but if necessary I would be prepared to set it to 'development'.

 Or we could just quit if we find a node_modules folder.
 I made a simple change that continued to look in folders which weren't
 node_modules.

 Adding the following into the foreach loop in
 _upgrade_422_find_genericons_files_in_folder()
 {{{
 if ( 'node_modules' === basename( $dir) ) {

                                 break;
                         }
 }}}

 reduced the execution time to 3 seconds for the original environment and
 10 for the one with 177 plugins (which also had 44 themes).

 That's just about acceptable.

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


More information about the wp-trac mailing list