How Wordpress Updates Are Made

1

Hello, I'm researching Wordpress related topics, and I looked for something that was embarrassing. How wordpress updates are made and it gets installed on our server. That is, I down wordpress, I upload to my domain, install everything correctly, and sometimes I see that there are updates available. How can this be? What file inside wordpress does this service?

    
asked by anonymous 20.03.2017 / 11:57

3 answers

2

The WordPress update system works locally using the same mechanism used to schedule posts and other tasks on the site, called wp-cron .

Cron is the name of the task scheduler built into Unix systems, and wp-cron is a " adaptation "of the same functionality to run on systems that are not always running, such as a PHP site.

PHP only runs when the server receives a request, that is, in the case of WordPress, when a user accesses the site. What wp-cron does is check, with each access, if there is a scheduled task to be fulfilled, and if yes, start this task. This check starts with an action linked to init , triggered in the wp-includes/default-filters.php file.

OneofthetasksincludedbydefaultistochecktwiceadaywhetherthereisanewversionofWordPresspostedonthecentralsite.Thischeckisdoneinthe wp_version_check() function, which is in the wp-includes/update.php file. This function makes a request POST to http://api.wordpress.org/core/version-check/1.7/ sending details of your system, and this API responds with the newest version available for automatic updating (not all sites can be upgraded directly to the newer versions, so it checks the versions of your PHP, mySQL, etc, and then he checks to see which version is right for you.

Once this check is done, WordPress stores this information in transient called update_core .

From there, every time you access wp-admin it checks whether the version stored in transient is higher than the current version, and if you have automatic updates enabled, it already triggers the update. If not, it shows you the message asking to upgrade.

    
20.03.2017 / 13:45
0

Usually the security updates are done automatically, this is whenever you have connected to an Internet, but this happens to be a direct connection to the wordpress server that it has.

    
20.03.2017 / 12:16
-1

First of all you should always have a backup of your wordpress. Some security updates are automatic and Wordpress does it automatically.

Wordpress has a connection to the wordpress server, and shows these updates available whenever you have an internet connection.

The update code is embedded in the following page

  

wp-admin / options.php

    
20.03.2017 / 12:06