Roots Discourse

How to improve the loading of the functions.php file

Hello, I have had this doubt for some time, if every time you visit the web, this file loads all its content, including this section:

 /**
 * Sage required files
 *
 * The mapped array determines the code library included in your theme.
 * Add or remove files to the array as needed. Supports child theme overrides.
 */
 array_map(function ($file) use ($sage_error) {
     $file = "../app/{$file}.php";
     if (!locate_template($file, true, true)) {
         $sage_error(sprintf(__('Error locating <code>%s</code> for inclusion.', 'arcux'), $file), 'File not found');
      }
  }, []);

In the project that I am carrying here, all the views of the administrator side, a migration system for databases, drivers, etc. are attached.

I am not sure the load of all this affects the performance of the site and if so, some recommendations to improve it, thanks.

This topic was automatically closed after 42 days. New replies are no longer allowed.