WordPress at Your Fingertips
function is not described

Core_Upgrader::check_files() public WP 3.7.0

Compare the disk file checksums against the expected checksums.

{} It's a method of the class: Core_Upgrader{}

No Hooks.

Return

true|false. True if the checksums match, otherwise false.

Usage

$Core_Upgrader = new Core_Upgrader();
$Core_Upgrader->check_files();

Notes

  • Global. String. $wp_version The WordPress version string.
  • Global. String. $wp_local_package Locale code of the package.

Changelog

Since 3.7.0 Introduced.

Code of Core_Upgrader::check_files() WP 5.8.2

public function check_files() {
	global $wp_version, $wp_local_package;

	$checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' );

	if ( ! is_array( $checksums ) ) {
		return false;
	}

	foreach ( $checksums as $file => $checksum ) {
		// Skip files which get updated.
		if ( 'wp-content' === substr( $file, 0, 10 ) ) {
			continue;
		}
		if ( ! file_exists( ABSPATH . $file ) || md5_file( ABSPATH . $file ) !== $checksum ) {
			return false;
		}
	}

	return true;
}