GSC custom search plugin - wp debug error

getting error on admin panel, and posts, with debug on

Notice: The called constructor method for WP_Widget in CGS_Widget is deprecated since version 4.3.0! Use
instead. in /var/www/vhosts/ on line 3718 Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'CustomGoogleSearch' does not have a method 'add_js_css' in /var/www/vhosts/ on line 525

Since I'm not actually using the widget, will plugin still work for the rest if I disable the line 12 in plugin

include_once( dirname( __FILE__ ) . '/widget.php' );

so as to not load the widget setup coding?

  • Adam Czajczyk

    Hello neotrope,

    I hope you're well today and thank you for your question!

    This is a notice, not an error so you may safely ignore it. It's an information for plugin developers that they should consider updating plugins code for compatibility reasons as soon as possible. Furthermore, this will not come up on all WP installs because it depends on PHP error notification settings (if "notices" are not enabled this won't come up).

    For a "live" site WP debugging shouldn't be enabled (except when you troubleshoot the site) and this message should be ignored. It shouldn't affect plugin's performance at all.

    As for commenting out that part of plugins code. That's not advised practice because it may break some other parts of the plugin (even though you don't use widget) and also would be overwritten with first update.

    You may give it a try and if it doesn't "break anything" you should be "good to go" but please note that it would be safer and better simply to ignore that message for now.

    Kind regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.