admin管理员组文章数量:1122832
I took over the management of a website, and this message appears on the admin update page:
This site appears to be under version control. Automatic updates are disabled
I dont have version control. I've checked and there's no .git, .subversion folders in my hierarchy. Where can I look to find this?
Thanks, Stephan
I took over the management of a website, and this message appears on the admin update page:
This site appears to be under version control. Automatic updates are disabled
I dont have version control. I've checked and there's no .git, .subversion folders in my hierarchy. Where can I look to find this?
Thanks, Stephan
Share Improve this question asked Apr 3, 2024 at 8:59 Stephan BurlotStephan Burlot 1032 bronze badges 1 |2 Answers
Reset to default 1This is because WordPress considers the location stored in ABSPATH
or a folder higher up to be version controlled:
if ( $updater->is_vcs_checkout( ABSPATH ) ) {
_e( 'This site appears to be under version control. Automatic updates are disabled.' );
And in the phpdco for is_vcs_checkout
:
* Checks for version control checkouts.
*
* Checks for Subversion, Git, Mercurial, and Bazaar. It recursively looks up the
* filesystem to the top of the drive, erring on the side of detecting a VCS
* checkout somewhere.
*
* ABSPATH is always checked in addition to whatever `$context` is (which may be the
* wp-content directory, for example). The underlying assumption is that if you are
* using version control *anywhere*, then you should be making decisions for
* how things get updated.
So check the location stored in ABSPATH
for one of these folders:
$vcs_dirs = array( '.svn', '.git', '.hg', '.bzr' );
If it does not contain one of those, go 1 folder up and check again. Note that these dot folders do not normally get displayed in folder listings unless you explicitly ask for them to be shown, nor will they be included in backup files.
If you still cannot find the VCS dot folder then you will need to ask your host. It's possible that the filesystem you have access to is mapped on to the server using mounts so that only portions of it are in production, and the version controlled folder is elsewhere, but this is extremely unlikely to be the cause of your problem, and heavily implies a managed WordPress host. A very quick or even cursory glance at the hosts docs would reveal this, possibly even by reputation alone. E.g. WP Engine or WPVIP sites are always version controlled, and you have no control over updates from within the admin UI (and for very good reasons, the improved security of using version control being the biggest).
I found it: In the file
/wp-admin/includes/class-wp-automatic-updater.php
In function is_vcs_checkout
, I added an error_log
in the loop looking for version control dirs which are:
'.svn', '.git', '.hg', '.bzr'
I found the hosting company has a .svn folder at the root directory, but I dont have access to this folder.
[03-Apr-2024 09:40:00 UTC] checking dir /var/www/vhosts/example.com
[03-Apr-2024 09:40:00 UTC] checking dir /var/www/vhosts
[03-Apr-2024 09:40:00 UTC] checking dir /var/www
[03-Apr-2024 09:40:00 UTC] checking dir /var
[03-Apr-2024 09:40:00 UTC] checking dir /
[03-Apr-2024 09:40:00 UTC] Found / .svn
Thanks @tom-j-nowell !
本文标签: WP says quotThis site appears to be under version controlquot but I dont have version control
版权声明:本文标题:WP says "This site appears to be under version control" but I dont have version control 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736311842a1934885.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
.git
and.subversion
folders won't show normally and aren't included in backups by most tools by default. The easiest answer is to ask your host otherwise it's not possible to answer this without direct access to your server or a long list of questions back and forth since this would be highly specific and unique to your situation – Tom J Nowell ♦ Commented Apr 3, 2024 at 9:27