wp_version_check example

    require ABSPATH . WPINC . '/version.php';

    $current = get_site_transient( 'update_core' );

    if ( isset( $current->last_checked, $current->version_checked )
        && 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked )
        && $current->version_checked === $wp_version
    ) {
        return;
    }

    wp_version_check();
}
/** * Checks the last time plugins were run before checking plugin versions. * * This might have been backported to WordPress 2.6.1 for performance reasons. * This is used for the wp-admin to check only so often instead of every page * load. * * @since 2.7.0 * @access private */

        if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {

            // Don't output the 'no signature could be found' failure message for now.             if ( 'signature_verification_no_signature' !== $download->get_error_code() || WP_DEBUG ) {
                // Output the failure error as a normal feedback, and not as an error.                 $this->skin->feedback( $download->get_error_message() );

                // Report this failure back to WordPress.org for debugging purposes.                 wp_version_check(
                    array(
                        'signature_failure_code' => $download->get_error_code(),
                        'signature_failure_data' => $download->get_error_data(),
                    )
                );
            }

            // Pretend this error didn't happen.             $download = $download->get_error_data( 'softfail-filename' );
        }

        


#[AllowDynamicProperties] class WP_Debug_Data {
    /** * Calls all core functions to check for updates. * * @since 5.2.0 */
    public static function check_for_updates() {
        wp_version_check();
        wp_update_plugins();
        wp_update_themes();
    }

    /** * Static function for generating site debug data when required. * * @since 5.2.0 * @since 5.3.0 Added database charset, database collation, * and timezone information. * @since 5.5.0 Added pretty permalinks support information. * * @throws ImagickException * @global wpdb $wpdb WordPress database abstraction object. * @global array $_wp_theme_features * * @return array The debug data for the site. */
get_current_screen()->set_help_sidebar(
    '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    '<p>' . __( '<a href="https://wordpress.org/documentation/article/dashboard-updates-screen/">Documentation on Updating WordPress</a>' ) . '</p>' .
    $help_sidebar_autoupdates .
    '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' .
    $help_sidebar_rollback
);

if ( 'upgrade-core' === $action ) {
    // Force an update check when requested.     $force_check = ! empty( $_GET['force-check'] );
    wp_version_check( array()$force_check );

    require_once ABSPATH . 'wp-admin/admin-header.php';
    ?> <div class="wrap"> <h1><?php _e( 'WordPress Updates' ); ?></h1> <p><?php _e( 'Updates may take several minutes to complete. If there is no feedback after 5 minutes, or if there are errors please refer to the Help section above.' ); ?></p> <?php     if ( $upgrade_error ) {
        if ( 'themes' === $upgrade_error ) {
            $theme_updates = get_theme_updates();
            
        wp_update_themes();  // Check for theme updates.         $theme_updates = get_site_transient( 'update_themes' );
        if ( $theme_updates && ! empty( $theme_updates->response ) ) {
            foreach ( $theme_updates->response as $theme ) {
                $this->update( 'theme', (object) $theme );
            }
            // Force refresh of theme update information.             wp_clean_themes_cache();
        }

        // Next, process any core update.         wp_version_check(); // Check for core updates.         $core_update = find_core_auto_update();

        if ( $core_update ) {
            $this->update( 'core', $core_update );
        }

        /* * Clean up, and check for any pending translations. * (Core_Upgrader checks for core updates.) */
        $theme_stats = array();
        
/* * Allow for signature soft-fail. * WARNING: This may be removed in the future. */
        if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {
            // Output the failure error as a normal feedback, and not as an error:             /** This filter is documented in wp-admin/includes/update-core.php */
            apply_filters( 'update_feedback', $download->get_error_message() );

            // Report this failure back to WordPress.org for debugging purposes.             wp_version_check(
                array(
                    'signature_failure_code' => $download->get_error_code(),
                    'signature_failure_data' => $download->get_error_data(),
                )
            );

            // Pretend this error didn't happen.             $download = $download->get_error_data( 'softfail-filename' );
        }

        if ( is_wp_error( $download ) ) {
            
Home | Imprint | This part of the site doesn't use cookies.