WordPress.org

Ready to get started?Download WordPress

Forums

EWWW Image Optimizer
[resolved] how do I know if plugin is working ? (13 posts)

  1. greku69
    Member
    Posted 1 year ago #

    Hi
    I run bulk optimize and when finish I end with this lines for every photo:

    Processing 1/371: img_71171…

    Warning: finfo_open() expects parameter 1 to be long, string given in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 827

    Warning: finfo_file(): supplied argument is not a valid file_info resource in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 829

    Warning: finfo_open() expects parameter 1 to be long, string given in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 827

    Warning: finfo_file(): supplied argument is not a valid file_info resource in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 829

    Warning: finfo_open() expects parameter 1 to be long, string given in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 827

    Warning: finfo_file(): supplied argument is not a valid file_info resource in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 829

    Warning: finfo_open() expects parameter 1 to be long, string given in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 827

    Warning: finfo_file(): supplied argument is not a valid file_info resource in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 829

    Warning: finfo_open() expects parameter 1 to be long, string given in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 827

    Warning: finfo_file(): supplied argument is not a valid file_info resource in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 829

    Warning: finfo_open() expects parameter 1 to be long, string given in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 827

    Warning: finfo_file(): supplied argument is not a valid file_info resource in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 829

    Warning: finfo_open() expects parameter 1 to be long, string given in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 827

    Warning: finfo_file(): supplied argument is not a valid file_info resource in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 829

    Warning: finfo_open() expects parameter 1 to be long, string given in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 827

    Warning: finfo_file(): supplied argument is not a valid file_info resource in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 829

    Warning: finfo_open() expects parameter 1 to be long, string given in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 827

    Warning: finfo_file(): supplied argument is not a valid file_info resource in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 829

    Warning: finfo_open() expects parameter 1 to be long, string given in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 827

    Warning: finfo_file(): supplied argument is not a valid file_info resource in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 829
    Full size – Unknown type:
    IMG_71171-150x150.jpg – Unknown type:
    IMG_71171-300x199.jpg – Unknown type:
    IMG_71171-1024x682.jpg – Unknown type:
    IMG_71171-388x300.jpg – Unknown type:
    IMG_71171-249x249.jpg – Unknown type:
    IMG_71171-93x57.jpg – Unknown type:
    IMG_71171-298x170.jpg – Unknown type:
    IMG_71171-555x220.jpg – Unknown type:
    IMG_71171-840x1560.jpg – Unknown type:
    Elapsed: 1 seconds

    is this correct ?
    yet after plugin done photos on site load as always ... not any faster .
    what I doing wrong ?
    thanks

    http://wordpress.org/extend/plugins/ewww-image-optimizer/

  2. nosilver4u
    Member
    Plugin Author

    Posted 1 year ago #

    No, it isn't correct. I added support for the fileinfo functions just recently, and was under the mistaken impression that PHP versions before 5.3 would not have this functionality. The PHP constant I'm using in the code doesn't exist before 5.3, so it can't determine the filetype of your images to optimize them.

    The fix should be to change lines 825 and 1719 to this:
    if (function_exists('finfo_file') && defined('FILEINFO_MIME_TYPE')) {

  3. greku69
    Member
    Posted 1 year ago #

    hi
    when I replace this two line with what you suggest I got this error and can't load website:
    Parse error: syntax error, unexpected $end in /home/greku69/domains/foresthillphotography.co.uk/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 2157

  4. nosilver4u
    Member
    Plugin Author

    Posted 1 year ago #

    make sure you are replacing the lines that are already there exactly as shown. The syntax error makes it sound like you didn't remove the lines that were there, so there is an incomplete 'if' statement.

  5. greku69
    Member
    Posted 1 year ago #

    hi
    so this 2 lines should looks like this ? :

    825 if (function_exists('finfo_file') &&
    1719 defined('FILEINFO_MIME_TYPE')) {

    please correct me if I'm wrong ...
    thanks

  6. nosilver4u
    Member
    Plugin Author

    Posted 1 year ago #

    sorry, told you the wrong lines. I was looking at the dev version. Both lines should be identical, make sure to copy everything from the 'if' to the last curly bracket '{'

    The proper lines for 1.3.7 are 825 and 1707. They are replacing this:

    if (function_exists('finfo_file')) {

    with this:

    if (function_exists('finfo_file') && defined('FILEINFO_MIME_TYPE')) {

    The first line only checks to see if the finfo_file() function exists, the new one checks for that AND it makes sure that the constant FILEINFO_MIME_TYPE exists, which is in PHP 5.3.0+. For older versions, it will fall back to other mime-type detection functions.

  7. greku69
    Member
    Posted 1 year ago #

    thanks
    this explain why was't working ...

  8. nosilver4u
    Member
    Plugin Author

    Posted 1 year ago #

    I reworked the code for 1.3.8 so that the finfo functions can be used prior to php 5.3.0, instead of just disabling them for anyone not using php 5.3.0+. It seems to work on my test box, but please let me know right away if you have any trouble with the new version and finfo errors again.

  9. greku69
    Member
    Posted 1 year ago #

    work like a charm ...
    thanks
    BTW there is worldpress 3.5.1 hope it will still work with this ver.

  10. metagrapher
    Member
    Posted 8 months ago #

    Hi there, I followed your instructions, as I was using the latest version of this plugin and it seems that there was still a missed if statement on line 463, as I was getting this error message on line 465, which is:
    $finfo = finfo_open(FILEINFO_MIME);
    So I added this to the if statement on line to 463:
    && defined('FILEINFO_MIME')

    However, this has not fixed my problem :/

    Thanks in advance for any help you can give!

  11. nosilver4u
    Member
    Plugin Author

    Posted 8 months ago #

    metagrapher, please read this:
    http://wordpress.org/support/topic/important-read-before-posting?replies=6

    ...and start a new thread.

  12. metagrapher
    Member
    Posted 8 months ago #

    Also worth noting that I'm on PHP version 5.3.27

  13. metagrapher
    Member
    Posted 8 months ago #

    Ah. Sorry nosilver4u. Will do.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.