[wp-trac] [WordPress Trac] #38874: Change include of "includes/plugin-install.php" to include_once

WordPress Trac noreply at wordpress.org
Sat Nov 19 20:43:57 UTC 2016


#38874: Change include of "includes/plugin-install.php" to include_once
----------------------------+-----------------------------
 Reporter:  engelen         |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  4.6.1
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 The file `wp-admin/includes/plugin-install.php`, which contains only
 functions and does not directly execute anything, is included from 4
 different files:
  1. wp-admin/includes/ajax-actions.php - using `include_once`
  1. wp-admin/includes/class-wp-plugin-install-list-table.php - using
 `include`
  1. wp-admin/update-core.php - using `require_once`
  1. wp-admin/update.php - using `include_once`

 The second yields problems when including `wp-admin/includes/plugin-
 install.php` using custom code, as the unconditional include will then
 yield a fatal error ("Cannot redeclare plugins_api()").

 The `include` should be changed to `include_once`.

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


More information about the wp-trac mailing list