Support » Plugin: Use Google Libraries » Fix for PHP 5 strict warning

  • Resolved johanee


    With a new PHP 5 the plugin gives the following warning:

    Strict Standards: Redefining already defined constructor for class JCP_UseGoogleLibraries in [...]/wp-content/plugins/use-google-libraries/use-google-libraries.php on line 123

    The solution is to move the PHP 5 constructor before the PHP 4 compatible constructor, see for example trac #20801.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jason Penney


    This is on the tracker at and I’ve fixed it in the development branch.

    WordPress 3.6 introduced some changes I have yet figure out that triggers some new strict warnings using PHP 5.4+ (see ).

    Hopefully I can fix them all at one. Sorry about the delay.

    Ok, though as noted you can fix it while keeping PHP 4 compatability by switching the constructors around.

    Plugin Author Jason Penney


    Oh, wow.

    I apologize for not reading your post carefully enough, I didn’t catch that.

    I’d have to double check what the final version of WordPress that supported PHP4 was, because I’m not sure it makes sense to put it back, but I do appreciate you bringing it to my attention.


    On the same topic I notice that line 338 generates strict “Only variables should be passed by reference” errors.

    Assigning wp_remote_head( "http:$url" ) to a variable and then passing that variable as an argument should resolve the issue. For example:

    $remotehead = wp_remote_head( "http:$url" );
    wp_remote_retrieve_response_code( $remote_head )

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fix for PHP 5 strict warning’ is closed to new replies.