[wp-trac] [WordPress Trac] #61314: Uncaught exception 'Error' with multiple messages in wp-include directory files during direct access

WordPress Trac noreply at wordpress.org
Wed Jan 22 19:18:52 UTC 2025


#61314: Uncaught exception 'Error' with multiple messages in wp-include directory
files during direct access
-----------------------------------------+-----------------------
 Reporter:  deepakrohilla                |       Owner:  audrasjb
     Type:  defect (bug)                 |      Status:  accepted
 Priority:  normal                       |   Milestone:  6.8
Component:  General                      |     Version:
 Severity:  major                        |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:
-----------------------------------------+-----------------------

Comment (by flixos90):

 Thanks @audrasjb for taking this one, I was just about to take a look at
 it :)

 I agree with your feedback that we should add the conditional check on
 every file that shouldn't be directly accessible, except files that have
 only a single class. I think for all other files there is no clear
 guidance on whether or not to include any function calls or hook additions
 directly in the root of the file, so it's safer to always have them.

 FWIW this aligns with plugin directory guidelines that any non-class (or
 non-interface or non-trait) file should have such a check.

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


More information about the wp-trac mailing list