Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #59832, comment 5


Ignore:
Timestamp:
02/12/2024 06:22:28 PM (2 months ago)
Author:
charlestonsw
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59832, comment 5

    initial v1  
    1 plugins_url() allows the first param to be optionally set to '' (the default) which throws this warning for PHP 8.2.3 (probably any PHP 8 version).
     1-revised from original report - problem is not the plugins_url(''...') first parm.  My IDE (phpStorm) had an issue with rendering content from a second tab (AJAX heartbeat) in the first tab debugging session for plugins_url()
    22
    3 Plugin or theme developers SHOULD be developing with WP_DEBUG on, which then throws this error fairly early in most instances.  In my case trigger a stack of "headers already sent" messages.  
     3The problem was not stemming from plugins_url() calls but from a separate process that was calling the submenu page routine with null as a first param from another plugin.  A common practice that appeared in many dev guides on other sites, but passing null to a string should not happen. 
    44
    5 IMO WordPress Core function defaults should not lead to PHP warnings for supported/recommended versions of PHP.   At the very least the plugins_url() should be added to the exceptions list here for PHP 8.0/8.1 etc.:
    6 https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/
    7 
     5Issue is in the other plugin not WP Core and the plugins_url() stack reported here.