wppaste
WordPress

WP_Automatic_Updater

Since
3.7.0, 4.6.0
Source
wp-admin/includes/class-wp-automatic-updater.php:16
Core class used for handling automatic background updates.

Compatibility

WordPress
since 4.6.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Hooks and filters fired · 14

Every hook that fires from inside WP_Automatic_Updater, in the order it appears in the class, grouped by the method that fires it.

Properties · 1

$update_resultsarrayprotected
Tracks update results during processing.

Methods · 13

Source code

#[AllowDynamicProperties]class WP_Automatic_Updater { 	/**	 * Tracks update results during processing.	 *	 * @var array	 */	protected $update_results = array(); 	/**	 * Determines whether the entire automatic updater is disabled.	 *	 * @since 3.7.0	 *	 * @return bool True if the automatic updater is disabled, false otherwise.	 */	public function is_disabled() {		// Background updates are disabled if you don't want file changes.		if ( ! wp_is_file_mod_allowed( 'automatic_updater' ) ) {			return true;		} 		if ( wp_installing() ) {			return true;		} 		// More fine grained control can be done through the WP_AUTO_UPDATE_CORE constant and filters.		$disabled = defined( 'AUTOMATIC_UPDATER_DISABLED' ) && AUTOMATIC_UPDATER_DISABLED; 		/**		 * Filters whether to entirely disable background updates.		 *		 * There are more fine-grained filters and controls for selective disabling.		 * This filter parallels the AUTOMATIC_UPDATER_DISABLED constant in name.		 *		 * This also disables update notification emails. That may change in the future.		 *		 * @since 3.7.0		 *		 * @param bool $disabled Whether the updater should be disabled.		 */		return apply_filters( 'automatic_updater_disabled', $disabled );	} 	/**	 * Checks whether access to a given directory is allowed.	 *	 * This is used when detecting version control checkouts. Takes into account	 * the PHP `open_basedir` restrictions, so that WordPress does not try to access	 * directories it is not allowed to.	 *	 * @since 6.2.0	 *	 * @param string $dir The directory to check.	 * @return bool True if access to the directory is allowed, false otherwise.	 */	public function is_allowed_dir( $dir ) {		if ( is_string( $dir ) ) {			$dir = trim( $dir );		} 		if ( ! is_string( $dir ) || '' === $dir ) {			_doing_it_wrong(				__METHOD__,				sprintf(					/* translators: %s: The "$dir" argument. */					__( 'The "%s" argument must be a non-empty string.' ),					'$dir'				),				'6.2.0'			); 			return false;		} 		$open_basedir = ini_get( 'open_basedir' ); 		if ( empty( $open_basedir ) ) {			return true;

Changelog

Introduced in 3.7.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

4.6.0
Moved to its own file from wp-admin/includes/class-wp-upgrader.php.from the docblock
3.7.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-admin/includes/class-wp-automatic-updater.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.