WordPress.org

Ready to get started?Download WordPress

Forums

Autoptimize
[resolved] Empty Needle Warning (10 posts)

  1. CandleFOREX
    Member
    Posted 1 year ago #

    Hi,

    First of all thank you for such a great plugin. We use your plugin instead of the W3 Total Cache JS and CSS compression (it breaks the site).

    Anyway, there is a little problem with the plugin since the last update.

    The problem is that we get an empty needle warning. Here are two examples:

    [10-May-2013 19:33:09 UTC] PHP Warning: strpos() [function.strpos]: Empty needle in /home/USERNAME/public_html/wp-content/plugins/autoptimize/classes/autoptimizeScripts.php on line 229
    [10-May-2013 19:33:09 UTC] PHP Warning: strpos() [function.strpos]: Empty needle in /home/USERNAME/public_html/wp-content/plugins/autoptimize/classes/autoptimizeScripts.php on line 255

    It seems every load of the page generates 20 of these lines. This is not a lot, but when you have hundreds of people a day doing a page loads, this can end up with an error log of several hundred MB a week.

    Any chance you can put out a fix for this please?

    Our site if you need it is:
    http://MetaTraderProgramming.com

    Thanks

    http://wordpress.org/extend/plugins/autoptimize/

  2. Frank Goossens
    Member
    Plugin Author

    Posted 1 year ago #

    Don't have that error, but the dontmove-array changes with the value of the exclusion-list in the autoptimize-admin screen. What values did you configure there CandleForex? And do (or don't) you get errors complaining about the array_merge on line 31?

  3. CandleFOREX
    Member
    Posted 1 year ago #

    Wow..I wasnt expecting such a fast reply thanks!

    What I have for the "Exclude scripts from autoptimize:" area is:

    s_sid,smowtion_size,sc_project,WAU_,wau_add,comment-form-quicktags,edToolbar,ch_client,buzz,

  4. Frank Goossens
    Member
    Plugin Author

    Posted 1 year ago #

    can you remove the last comma and see what happens?

  5. Frank Goossens
    Member
    Plugin Author

    Posted 1 year ago #

    Better yet; open up wp-content/plugins/autoptimize/classes/autoptimizeScripts.php and on line 30 change

    $exclJSArr = array_map('trim',explode(",",$excludeJS));

    into

    $exclJSArr = array_filter(array_map('trim',explode(",",$excludeJS)));

    This should solve PHP warnings about empty needles/ delimiters.

  6. CandleFOREX
    Member
    Posted 1 year ago #

    My apologies on the delay.

    Thank you these changes have been made a few minutes ago.
    Will update you as to how it goes (logs run every 24 hours so we got to wait).

    Thank you!

  7. Frank Goossens
    Member
    Plugin Author

    Posted 1 year ago #

    anything in your logs CandleForex?

  8. CandleFOREX
    Member
    Posted 1 year ago #

    Thank you very much for the reminder!

    No, after I made that code change, the error went away totally.
    So again thanks!

    Maybe in the next version of your plugin, you could include this fix?
    Would probabblly cut down on support requests, or perhaps it was just us?

  9. Frank Goossens
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for your feedback, this will most certainly be included in the next version!

  10. Frank Goossens
    Member
    Plugin Author

    Posted 1 year ago #

    I just pushed out 1.6.4 with this fix in it, hope you like it :-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic