Skip to content

wpcept: Fully disable update checks #141

Description

@JDGrimes

Right now we attempt to disable the core/plugin/theme update checks in WordPress when running Codeception acceptance tests, because these cause a request to be made to WordPress.org, which is just a waste of time and resources.

However, while doing local testing, I've come to the conclusion that we may not actually be fully disabling at least the plugin and theme updates. It's possible that we aren't disabling the core updates entirely either, although I can't see how.

Anyway, I think that maybe we should add something like this to the disable update checks method, although we should do some more investigation to be sure:

            if ( 'update_themes' === $transient ) {

                $themes = wp_get_themes();

                foreach ( $themes as $theme ) {

                    $stylesheet = $theme->get_stylesheet();

                    $array['response'][ $stylesheet ] = array();
                    $array['checked'][ $stylesheet ]  = $theme->get( 'Version' );
                }
            }

            if ( 'update_plugins' === $transient ) {

                $plugins = get_plugins();

                foreach ( $plugins as $file => $plugin ) {
                    $array['response'][ $file ] = array();
                    $array['checked'][ $file ] = $plugin['Version'];
                }
            }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions