• Resolved Marcoevich

    (@marcoevich)


    Hello Frank,

    I have some PHP notices related to AO in my debug.log. It is this error appearing multiple times:

    [27-Nov-2018 14:49:47 UTC] PHP Notice: Undefined index: host in /home/public_html/wp-content/plugins/autoptimize/classes/autoptimizeExtra.php on line 488

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, can you open up autoptimizeExtra.php and on line 488-490 replace

            if ( $url_parsed['host'] !== $site_host && empty( $cdn_url ) ) {
                return false;
            } elseif ( ! empty( $cdn_url ) && strpos( $url, $cdn_url ) === false && $url_parsed['host'] !== $site_host ) {
    

    with

            if ( array_key_exists( 'host', $url_parsed ) && $url_parsed['host'] !== $site_host && empty( $cdn_url ) ) {
                return false;
            } elseif ( ! empty( $cdn_url ) && strpos( $url, $cdn_url ) === false && array_key_exists( 'host', $url_parsed ) && $url_parsed['host'] !== $site_host ) {

    and check if that makes those annoying PHP notices go away? 🙂

    frank

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    any news, have you been able to make that small change @marcoevich? 🙂

    Thread Starter Marcoevich

    (@marcoevich)

    Yes sorry for the delay Frank. I’ve just looked at the debug log and there have been no more messages regarding to Autoptimize so it looks like this piece of code worked like a charm 🙂

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    thanks for the confirmation Marco 🙂

    feel free to leave a review of the plugin and support here! 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Notice: Undefined index: Host’ is closed to new replies.