WPIntell

Source evidence

BWP using deprecated constructor

Better WordPress Recent Comments · support · 2015-12-28T19:02:00+00:00

complaintsentiment
mediumseverity
0.86relevance
5replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 30 rows with source links

20.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

24 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
cadfile unresolved
Upgraded to 4.4 and getting the following error: Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use __construct() instead. When I deactivate the plugin the error message goes away. I tried to find the error in the code but could not. https://wordpress.org/plugins/bwp-recent-comments/ Hi there, That’s a known issue and will be fixed in the next version. If you want to use the current version, you can change the following line: https://github.com/OddOneOut/bwp-recent-comments/blob/master/includes/class-bwp-rc-widget.php#L12 to function __construct() and it should work. class BWP_RC_Widget extends WP_Widget { function BWP_RC_Widget() { $widget_ops = array('classname' => 'bwp-rc-widget', 'description' => __( 'Show a list of recent comments/trackbacks generated by the BWP Recent Comments plugin.', 'bwp-rc') ); $control_ops = array('width' => 350); $this->WP_Widget('bwp_recent_comments', __('BWP Recent Comments', 'bwp-rc'), $widget_ops, $control_ops); } Won’t that overwrite the class BWP_RC_Widget and give me a different error No you only have to replace line 12 (should be highlighted in the link I posted above). I replaced function BWP_RC_Widget() with function __construct() and still get the same depreciated error message Sorry for my late reply. That’s weird, I’ve applied the patch and it’s working for me: https://github.com/OddOneOut/bwp-recent-comments/commit/379d9b6513d75fa455f890dcf51e2e9b6f8348f2

Comments

5 shown
Khang Minh 2015-12-28T19:25:00+00:00

Hi there, That’s a known issue and will be fixed in the next version. If you want to use the current version, you can change the following line: https://github.com/OddOneOut/bwp-recent-comments/blob/master/includes/class-bwp-rc-widget.php#L12 to function __construct() and it should work.

cadfile 2015-12-28T19:34:00+00:00

class BWP_RC_Widget extends WP_Widget { function BWP_RC_Widget() { $widget_ops = array('classname' => 'bwp-rc-widget', 'description' => __( 'Show a list of recent comments/trackbacks generated by the BWP Recent Comments plugin.', 'bwp-rc') ); $control_ops = array('width' => 350); $this->WP_Widget('bwp_recent_comments', __('BWP Recent Comments', 'bwp-rc'), $widget_ops, $control_ops); } Won’t that overwrite the class BWP_RC_Widget and give me a different error

Khang Minh 2015-12-28T19:35:00+00:00

No you only have to replace line 12 (should be highlighted in the link I posted above).

cadfile 2015-12-28T19:42:00+00:00

I replaced function BWP_RC_Widget() with function __construct() and still get the same depreciated error message

Khang Minh 2016-01-03T17:08:00+00:00

Sorry for my late reply. That’s weird, I’ve applied the patch and it’s working for me: https://github.com/OddOneOut/bwp-recent-comments/commit/379d9b6513d75fa455f890dcf51e2e9b6f8348f2