• Resolved dimitrov.adrian

    (@dimitrovadrian)


    Get a lot of errors in 1.9.2 with wp4.1

    PHP Notice:  Undefined variable: base64data in ...wp-content/plugins/autoptimize/classes/autoptimizeStyles.php on line 311
    PHP Notice:  Undefined property: autoptimizeStyles::$already_minified in ...wp-content/plugins/autoptimize/classes/autoptimizeStyles.php on line 329

    https://wordpress.org/plugins/autoptimize/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Frank Goossens

    (@futtta)

    darn those notices! 🙂

    the 2nd one is a type, can you on line 391 change

    if (($this->already_minified!==true) && (apply_filters("autoptimize_css_do_minify", true))) {

    into

    if (($this->alreadyminified!==true) && (apply_filters("autoptimize_css_do_minify", true))) {

    the first one is slightly more difficult, I’ll look into that one of the following days.

    thanks for reporting!
    frank

    Plugin Author Frank Goossens

    (@futtta)

    OK, for the base64data notice, on line 270 replace;

    if($icheck->check()) {
         // we have the base64 image in cache
         $headAndData=$icheck->retrieve();
    } else {

    with

    if($icheck->check()) {
         // we have the base64 image in cache
         $headAndData=$icheck->retrieve();
         $_base64data=explode(";base64,",$headAndData);
         $base64data=$_base64data[1];
    } else {

    Could you confirm if these two fixes make the notices go away? I’ll make sure both go in the next AO-version.

    Have a nice Sunday,
    frank

    Thread Starter dimitrov.adrian

    (@dimitrovadrian)

    Thanks for the support. Patches seems to work fine, or at least i have no warnings last few hours.

    About the second patch, are you sure that there will be no case that ‘;base64,’ will be not in the $icheck->retrieve();

    because then $_base64data[1] could be undefined.

    Plugin Author Frank Goossens

    (@futtta)

    About the second patch, are you sure that there will be no case that ‘;base64,’ will be not in the $icheck->retrieve();

    yep; a couple of lines later (if $icheck->check is false), you can see $dataurihead (which is the first part of $headAndData) being set in a switch-case block and each of the values there, including the default one, ends with “;base64,”.

    frank

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP errors’ is closed to new replies.