Repository navigation
False positives for VCS plugin and theme installs #537
Description
Activity
Thanks for your report!
We use the
is_vcs_checkout()function provided by WordPress for this detection, as defined here:It checks for
.gitfolders, not.gitignorefiles. There is aautomatic_updates_is_vcs_checkoutfilter in there though, so maybe a plugin of yours or your hosting provider uses that to exclude more plugins more strictly. I'd recommend looking into that. Trying--skip-pluginsmight help too.And if there's a flaw in
is_vcs_checkout(), it can be reported at https://core.trac.wordpress.org/Reacted by Chris CroomeThanks @swissspidy that is really helpful, next time I hit this issue I'll report it upstream.
Sounds good, I'm closing this for now then
Here is an example of this issue:
wp plugin update --all Warning: woocommerce: Skipped update because a VCS checkout was detected. Use --include-vcs to override. Warning: wordpress-seo: Skipped update because a VCS checkout was detected. Use --include-vcs to override. Error: No plugins updated.
Neither plugin has a top-level
.gitdirectory:ls -lah wp-content/plugins/woocommerce/ total 124K drwxr-xr-x 12 wordpress wordpress 4.0K Jul 20 23:03 . drwxr-xr-x 15 wordpress wordpress 4.0K Aug 5 12:19 .. drwxr-xr-x 7 wordpress wordpress 4.0K Jul 20 23:03 assets drwxr-xr-x 3 wordpress wordpress 4.0K Jul 20 23:03 i18n drwxr-xr-x 30 wordpress wordpress 12K Jul 20 23:03 includes drwxr-xr-x 4 wordpress wordpress 4.0K Jul 20 23:03 lib -rw-r--r-- 1 wordpress wordpress 36K Jul 20 23:03 license.txt drwxr-xr-x 6 wordpress wordpress 4.0K Jul 20 23:03 packages drwxr-xr-x 2 wordpress wordpress 4.0K Jul 20 23:03 patterns -rw-r--r-- 1 wordpress wordpress 20K Jul 20 23:03 readme.txt drwxr-xr-x 2 wordpress wordpress 4.0K Jul 20 23:03 sample-data drwxr-xr-x 17 wordpress wordpress 4.0K Jul 20 23:03 src drwxr-xr-x 17 wordpress wordpress 4.0K Jul 20 23:03 templates -rw-r--r-- 1 wordpress wordpress 6.2K Jul 20 23:03 uninstall.php drwxr-xr-x 9 wordpress wordpress 4.0K Jul 20 23:03 vendor -rw-r--r-- 1 wordpress wordpress 1.9K Jul 20 23:03 woocommerce.php ls -lah wp-content/plugins/wordpress-seo total 144K drwxr-xr-x 13 wordpress wordpress 4.0K Jul 24 15:37 . drwxr-xr-x 15 wordpress wordpress 4.0K Aug 5 12:19 .. drwxr-xr-x 22 wordpress wordpress 4.0K Jul 24 15:37 admin drwxr-xr-x 4 wordpress wordpress 4.0K Jul 24 15:37 blocks -rw-r--r-- 1 wordpress wordpress 1010 Jul 24 15:37 changelog.md drwxr-xr-x 3 wordpress wordpress 4.0K Jul 24 15:37 css drwxr-xr-x 4 wordpress wordpress 4.0K Jul 24 15:37 images drwxr-xr-x 5 wordpress wordpress 4.0K Jul 24 15:37 inc -rw-r--r-- 1 wordpress wordpress 38 Jul 24 15:37 index.php drwxr-xr-x 3 wordpress wordpress 4.0K Jul 24 15:37 js drwxr-xr-x 4 wordpress wordpress 4.0K Jul 24 15:37 lib -rw-r--r-- 1 wordpress wordpress 33K Jul 24 15:37 license.txt drwxr-xr-x 3 wordpress wordpress 4.0K Jul 24 15:37 packages -rw-r--r-- 1 wordpress wordpress 18K Jul 24 15:37 readme.txt drwxr-xr-x 55 wordpress wordpress 4.0K Jul 24 15:37 src drwxr-xr-x 3 wordpress wordpress 4.0K Jul 24 15:37 vendor drwxr-xr-x 6 wordpress wordpress 4.0K Jul 24 15:37 vendor_prefixed -rw-r--r-- 1 wordpress wordpress 2.1K Jul 24 15:37 wpml-config.xml -rw-r--r-- 1 wordpress wordpress 18K Jul 24 15:37 wp-seo-main.php -rw-r--r-- 1 wordpress wordpress 1.7K Jul 24 15:37 wp-seo.php
Why does WP-CLI think these plugins were installed using
git?Because
WP_Automatic_Updater::is_vcs_checkout()from WordPress core said so. It's not WP-CLI. Again, that function has a filter, so it's possible that something is hooking into this filter to make the check more strict.Try using
--skip-pluginsas I suggested above.If it's coming from a mu-plugin (for example one added by your hosting provider), you could also try something like this (untested):
test.phpfile:<?php WP_CLI::add_wp_hook( 'automatic_updates_is_vcs_checkout', '__return_false', PHP_INT_MAX );
Then run
wp --require=test.php plugin update --allReacted by Chris Croome
Bug Report
Describe the current, buggy behavior
The code that detects VCS plugin installs is buggy, often on sites that don't have any plugins installed using
git checkoutthe flag--include-vcsis required to update plugins.For example wp-piwik includes a empty
.gitignorefile and I think this might trigger the need for--include-vcs?Describe what you would expect as the correct outcome
Better detection of git checked out plugins.
Let us know what environment you are running this on