How WordPress Actually Works Behind the Scenes

Ever wondering how WordPress actually works behind the scenes? Most of the users today thinks that it is simple because all you have to do is type a URL as well as page loads in just a few seconds. However, there are actually lots of work behind the scenes. This guide will show you through infographics how the WordPress team actually works behind the scene.

  1. Load theWp-config.php File

It is the WordPress configuration file. This file sets global variables for WordPresssites, it also contains the WordPress data info. For a very obvious reason, this is the first file that WordPress loads.

 

  1. Set-up default constants

After the load of wp-config.php file, WordPress will then move to set the default constants. Default constants includes all the information needed such as the default upload location, maximum file sizes as well as other default constant sets.

 

  1. Load the advanced-cache.php file

Once the advanced-cache.php file already exists on your website, then WordPress will load it next. Advanced-cache-.php file is a file that acts like a drop-in file. It is used by a number of popular WordPress plugins. If your website is suing this type of file, you will then notice a new item on plugins display called Drop-ins.

 

  1. Load the wp-content/db.php file

WordPress allow developers to make or create their own database attraction layer as well as load them in a db.php file. These files are placed inside the wp-content folder.

 

  1. Connect the MySQL. Select Database

After WordPress had enough info it needs to proceed further, it will now move or connect to the MySQL server. It will also select the database, however, if WordPress isn’t able to connect to the database, you will see the sign “establishing database connection” the error sign. From this point, WordPress will now quit. If everything worked fine, then WordPress will now move on to the next set of steps.

  1. Load the object-cache.php or the wp-includes/cache.php file

 

  1. Load the wp-content/sunrise.php file.

 

  1. Load the Localization library.

 

  1. Load the Multiple Plugins.

 

  1. “muplugins_loaded” do action

This action is only available to those network activated plugins on WordPress multisite.

 

  1. Load the Active Plugins

 

  1. Load the pluggable.php file

This file contains all the functions WordPress plugins can be redefined. If WordPress cannot see the files inside that are already defined by another plugin, then it will define those functions itself.

  1. “plugins_loaded” do action

 

  1. Load the rewrite rules

  1. $wp_query, $wp_rewrite, $wp

WordPress will now load the 3 following objects:

$wp_query – it holds the WP_Query class and tells WordPress the contents requester in a usual WP query format.

$wp_rewrite – another global instance which holds the WP_Rewrite class. This file contains the rewrite rules and functions.

$wp – it contains the function which will parse the request and performs the main query.

 

  1. “set_up theme”

This action typically runs before the WordPres theme is actually loaded.

 

  1. Load the child theme’s functions.php file

 

  1. Load the parent theme’s functions.php file

 

  1. “after_setup_theme”

After WordPress has already set-up the theme and all the theme functions, it will now action the “after_setup_theme”.

 

  1. Set-up the Current User Object

 

  1. “init” action

“init” action allows the developer to add codes they needed to execute after WordPress has already loaded all information needed.

  1. “widget_init” do action
  2. Run the wp()

It is located in the wp-includes/functions.php file

  1. Request parse
  2. Run Query
  3. Do the action “template_redirect”

  1. Load the Feed Template.
  2. Then Load Template
  3. “Shutdown” action

The last action is called the shutdown. At this point, the WordPress will now stop working since it already ran the code and the generated user’s requested webpage.

That’s it. That is how WordPress actually works behind the scene. And what is more amazing is that all of these things actually happen within milliseconds.

We hope that this article will help you a lot in learning how WordPress works behind the scenes. If you have comments, suggestions or ideas, please write in the comment box below.

 

 

 

 

 

 

 

 

 

Posted in WordPress.

Leave a Reply

Your email address will not be published. Required fields are marked *