WORDPRESS PHP Strict Standards: Redefining already defined constructor for class error

I have a plugin released for WordPress, and a client has Strict Standards enabled. I’ve fixed most notices and warnings, but this one has me stumped. How can I fix this notification in the error reporting? What am I doing wrong for WordPress?

Error: [13-Mar-2015 17:04:41 UTC] PHP Strict Standards: Redefining already defined constructor for class GARD_PRO_CSE in D:homesitewwwrootwp-contentpluginsgard-proinsert.php on line 281

Read More

Code:

if ( strpos(@$GLOBALS['gard_pro']['CSE' ], 'cse') && !class_exists('GARD_PRO_CSE')) {
    class GARD_PRO_CSE extends WP_Widget {

        function GARD_PRO_CSE() {
            parent::WP_Widget(false, $name = "GARD Pro Custom Search Engine");
        }

        public function __construct() {
            parent::__construct(
                'GARD_PRO_CSE', // Base ID
                'GARD Pro Custom Search Engine', // Name
                array( 'description' => __( "Shows custom Google Search Engine", 'text_domain' ), ) // Args
            );
        }

        // REMOVED WP CODE TO CREATE WIDGET
    }
    add_action('widgets_init', create_function('','return register_widget("GARD_PRO_CSE");'));
}

Related posts

Leave a Reply