How Wordpress updates are made

Asked

Viewed 67 times

1

Hello, I am researching Wordpress related issues, and I looked for something that I was stuck. How are made the wordpress updates being that it gets installed on our server. That is, I lower the wordpress, I climb in my domain, install everything straight, and sometimes I see that has available updates. How can this? Which file within wordpress does this service?

3 answers

2


The Wordpress upgrade system works locally using the same mechanism used to make scheduling posts and other tasks on the site, called wp-cron.

Cron is the name of the task scheduler embedded in Unix systems, and the wp-cron is an "adaptation" of this same functionality to run on systems that are not permanently 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 the wp-cron does is to check, at each access, if there is a scheduled task to be accomplished, and if yes, start this task. This check is started with an action linked to init, shot into the archive wp-includes/default-filters.php.

imagem do arquivo default-filters.php com a definição da action init

One of the tasks included by default is to check, twice a day, if there is a notice of new version of Wordpress published on the central site. This check is done in the function wp_version_check(), on file wp-includes/update.php. This function makes a request POST for http://api.wordpress.org/core/version-check/1.7/ sending your system details, and this API responds with the newest version available for auto-update (not all sites can be updated directly to newer versions, so it checks the versions of your PHP, mysql, etc, and then it checks to see which version is right for you.

Made this check, Wordpress saves this information in a transient called update_core.

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

  • Damn, thanks for your help, brother.

  • 1

    Thanks, @Victorhermes. If the answer solved your question, mark there as accepted to help those who have other similar questions later.

0

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

-1

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

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

The update code is incorporated in the following page

wp-admin/options.php

Browser other questions tagged

You are not signed in. Login or sign up in order to post.