[wp-trac] [WordPress Trac] #47428: Site Health: Remove duplicate code in VCS test

WordPress Trac noreply at wordpress.org
Wed May 29 14:05:53 UTC 2019


#47428: Site Health: Remove duplicate code in VCS test
----------------------------+----------------------------
 Reporter:  desrosj         |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Future Release
Component:  Administration  |    Version:  5.2
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+----------------------------
 In `WP_Site_Health_Auto_Updates::test_vcs_abspath()`, almost the entire
 `WP_Upgrader::is_vcs_checkout()` function is duplicated. This test should
 be updated to use `WP_Upgrader::is_vcs_checkout()` instead. There are a
 few issues with this that would need to be solved, though.

 In the message to the user, the directory under version control and the
 type of version control used are specified. This currently can't be
 determined without duplicating the logic. Also, in order to determine if
 the `automatic_updates_is_vcs_checkout` filter is overriding the
 function's result to allow updates, the filter would need to be run twice.

 Props @johnbillion for the suggestion in #47388.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47428>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list