[wp-trac] [WordPress Trac] #56127: WP_Widget constructor throws fatal ArgumentCountError

WordPress Trac noreply at wordpress.org
Mon Aug 7 22:49:27 UTC 2023


#56127: WP_Widget constructor throws fatal ArgumentCountError
-------------------------------------------+-------------------------------
 Reporter:  firefly2000                    |       Owner:  (none)
     Type:  defect (bug)                   |      Status:  closed
 Priority:  normal                         |   Milestone:
Component:  Widgets                        |     Version:  6.0
 Severity:  normal                         |  Resolution:  invalid
 Keywords:  needs-patch reporter-feedback  |     Focuses:  coding-standards
-------------------------------------------+-------------------------------
Changes (by hellofromTonya):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 I'm closing this ticket. Why?

 * I suspect the root cause is in a plugin, theme, or must-use script.
 * I can't reproduce the reported issue.
 * The audit of Core's widgets shows they are correct and not contributing
 to the reported issue.
 * Core's `WP_Widget` and `WP_Widget_Factory::register( $widget )` code is
 from WP 2.8.0.
 * Widgets are required to have a constructor without parameters and call
 the parent (`WP_Widget`) constructor passing the correct args to its
 parameters ([https://developer.wordpress.org/themes/functionality/widgets/
 see the docs]).

 Why is this happening with WP 6.0 and beyond?
 Hmm I'm not sure.
 [https://core.trac.wordpress.org/query?status=closed&component=Widgets&milestone=6.0&col=id&col=summary&col=status&col=owner&col=type&col=priority&col=milestone&order=priority
 There was only 1 Trac ticket in 6.0]: #54561 / [53158]. But the call to
 parent's constructor is correct.

 If however the problem does appear to be a Core issue, please reopen and
 share your findings (after the following the steps below) and additional
 information (see Step 5 below).

 === To discover where the root cause, please follow these steps in order:

 **Step 1: Clear all site and hosting caches.**
 Is the problem gone?
    * If yes, woohoo!
    * If no, go to the next step.

 **Step 2: Please deactivate all plugins.**
 Is the problem gone?
    * If yes, then the issue is in one or more of the plugins.
      How to find which ones? Reactivate each plugin one-by-one, refreshing
 and rechecking. When the problem reoccurs, the last plugin activated is
 causing the issue. Reach out to its author to report the issue.
    * If no, go to the next step.

 **Step 3: Switch to a default theme such as Twenty Twenty-Two (TT2).**
 Is the problem gone?
    * If yes, then the theme (before the Twenty Twenty-Two theme) is
 causing the issue. Reach out to its author to report the issue.
    * If no, go to the next step.

 **Step 4: Check the must-use scripts for any widgets.**
 Note: This step may require reaching out to the web host. Some hosts add
 must-use scripts for things like migration, debug, and admin tasks. One or
 more of these scripts may be adding a widget.

 Is the problem gone?
    * If yes, then please reach out to the must-use script's author to
 report the issue.
    * If no, go to the next step.

 **Step 5: Share findings and how to reproduce here.**
 If the problem persists after following all the above steps, then please
 reopen this ticket and share your findings and how to reproduce, such as
 what widgets, WordPress version, theme, and plugins the site is using. A
 backtrace of the error is helpful too.

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


More information about the wp-trac mailing list