Core_Upgrader::check_files(): bool

In this article

Compares the disk file checksums against the expected checksums.

Return

bool True if the checksums match, otherwise false.

Source

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 ( str_starts_with( $file, 'wp-content' ) ) {
			continue;
		}
		if ( ! file_exists( ABSPATH . $file ) || md5_file( ABSPATH . $file ) !== $checksum ) {
			return false;
		}
	}

	return true;
}

Changelog

VersionDescription
3.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.