[wp-trac] [WordPress Trac] #59362: Display deprecated function usage in Site Health

WordPress Trac noreply at wordpress.org
Fri Sep 15 09:17:44 UTC 2023


#59362: Display deprecated function usage in Site Health
----------------------------+--------------------------------------
 Reporter:  Michi91         |      Owner:  (none)
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Site Health     |    Version:  6.3.1
 Severity:  normal          |   Keywords:  2nd-opinion dev-feedback
  Focuses:  administration  |
----------------------------+--------------------------------------
 == Enhancement Request ==
 === Summary ===

 WordPress Site Health provides valuable information about the health and
 performance of a WordPress instance. However, it does not offer any
 insights into whether the instance is using deprecated functions, classes,
 constructors, hooks, file_includes, which can be  crucial for maintaining
 the site's compatibility with future WordPress versions.

 This enhancement ticket proposes adding an additional check to Site Health
 that detects and displays information about any deprecated functions,
 classes, constructors, hooks, file_includes, being used within the
 WordPress instance.

 Adding a "Deprecated Functions" check to the Site Health tool will be a
 enhancement for WordPress administrators, helping them identify and
 replace deprecated functions, classes, constructors, hooks, file_includes,
 plugins, themes, ensuring the site's long-term stability and compatibility
 with upcoming WordPress updates.


 === Details ===

 The deprecated function check should be integrated into the existing Site
 Health tool as follows:

 1. Log: Log deprecated functions, classes, constructors, hooks,
 file_includes

 2. Display Check Results: Under a "Deprecated Functions" check, display a
 list of deprecated functions, classes, constructors, hooks and
 file_includes used in the WordPress instance. Result should
  * include the function, class, constructor, hook or file_include name
  * the version in which it was deprecated
  * which Plugin or Theme called it,
  * when in was called the last time
  * a brief explanation of the recommended action.


 === Implementation Suggestions ===

 * Utilize existing WordPress core functionality for detecting usage of
 deprecated functions
 * Add a action to 'deprecated_{[]}_run' that logs the usage of a
 deprecated functions
 * Use debug_backtrace() do indentify the source / code.
 * The check results should display the log entries with status
 'recommended'.
 * Keep the log process "stupid" and put logic etc. into the check, to
 avoid complexity and potential crashes.

 === Challenges ===

 * To provide the administrator with sufficient information so that they
 are capable of taking action.
 * Decision on how long entries stay in the log e.g. only show deprecated
 function calls of the last 30 days or allow the (administrative ) user to
 clear the log?
 * Should there be one check in Site Health of all kinds of deprecated? Or
 one for each?

 === Why It's Important ===

 WordPress is constantly evolving, and maintaining compatibility with newer
 versions is crucial for security and performance reasons. Deprecated
 functions may be removed in future releases, causing issues for sites that
 rely on them. By providing this information in Site Health, WordPress can
 empower site administrators to keep their installations future proof.

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


More information about the wp-trac mailing list