[wp-trac] [WordPress Trac] #41078: Detect if someone’s site is under version control, and suggest better ways to edit their sites

WordPress Trac noreply at wordpress.org
Mon May 13 20:43:59 UTC 2024


#41078: Detect if someone’s site is under version control, and suggest better ways
to edit their sites
----------------------------+-------------------------
 Reporter:  karmatosed      |       Owner:  (none)
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  Administration  |     Version:
 Severity:  normal          |  Resolution:  maybelater
 Keywords:                  |     Focuses:
----------------------------+-------------------------

Comment (by eaxywowt1):

 I'm looking for a way to detect if a WordPress site is under version
 control and, if so, suggest better ways to edit the site rather than using
 the built-in Code Editor.

 Currently, WordPress detects version control for updates using the
 `\WP_Automatic_Updater::is_vcs_checkout()` method. This method works by
 checking for version control system (VCS) directories like `.svn` or
 `.git` in the site's root directory. However, this approach has
 limitations:

 1. It doesn't reliably indicate if a specific theme or plugin is under
 version control, just the entire site.
 2. Different VCS versions and configurations handle their metadata
 differently, making detection inconsistent.
 3. Parsing each VCS's data store to determine which files are under
 version control is not a viable option due to the complexity and
 variability of VCS implementations.

 Although there is now a warning when editing files (#31779), the need for
 reliable detection remains important. The ideal solution would involve:

 - Checking for the presence of VCS directories in the root and setting a
 flag indicating partial or full VCS management.
 - Providing an interface for users to confirm which files/folders are
 under version control.
 - Avoiding expensive background tasks to detect VCS status, as those
 familiar with VCS will likely avoid using the Code Editor.

 Given these constraints, what would be the best approach to detect if a
 WordPress site or specific components are under version control? How can
 we effectively suggest alternative editing practices to users, considering
 the diverse ways SVN and Git are used?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/41078#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list