Use Google Libraries
[resolved] Fix for PHP 5 strict warning (5 posts)

  1. johanee
    Posted 2 years ago #

    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.


  2. Jason Penney
    Plugin Author

    Posted 2 years ago #

    This is on the tracker at https://github.com/jpenney/use-google-libraries/issues/1 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 https://github.com/jpenney/use-google-libraries/issues/6 ).

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

  3. johanee
    Posted 2 years ago #

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

  4. Jason Penney
    Plugin Author

    Posted 2 years ago #

    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.


  5. harrisric
    Posted 1 year ago #

    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 )

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Use Google Libraries
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.