Google Custom Search is receiving errors - help!

Hello!

I installed Google Custom Search, and am receiving these errors:

Strict Standards: Redefining already defined constructor for class CustomGoogleSearch in /web/webcontent/cms/cms001/wp-content/plugins/custom-google-search/custom-google-search.php on line 46

Strict Standards: Redefining already defined constructor for class CGS_Widget in /web/webcontent/cms/cms001/wp-content/plugins/custom-google-search/widget.php on line 20

I also receive this warning: "The plugin generated 432 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin."

The widget also displays these errors when trying to select where to display results.

EDIT: Just letting you know that I corrected the issue. Please close this ticket. I had to remove the PHP4 constructor in both widget.php and custom-google-search.php in order to resolve the errors.

  • Patrick
    • Support Monkey

    Hi there @Courtney

    Welcome to the forums, glad to have you aboard!

    Now that's odd. :slight_frown:

    Have you any other plugins or scripts running on your site that may also be calling Google search and may have an identical constructor class name?

    Having removed those bits of code from the plugin, does all now function as expected? Does the search via the widget return expected results?

  • Ash
    • WordPress Hacker

    Hello @nbostic

    Remove the following from custom-google-search.php line 39:

    function CustomGoogleSearch() {
            __construct();
        }

    Remove the following from widget.php line 13:

    function CGS_Widget() {
            __construct();
        }

    Please note that, this changes will be lost in next update. So it's worth to note down this changes somewhere and apply again after your updates.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.