WordPress.org

Ready to get started?Download WordPress

Forums

WP Smush.it
[resolved] path type error (9 posts)

  1. CashOff
    Member
    Posted 2 months ago #

    i am using current versions of WP and smush it. I am very familiar with smush it and never had this issue. it seems i have a path type issue. here is the debug info;

    DEBUG: attachment_file_path=[/mnt/stor12-wc1-ord1/895425/898207/www.destinyracingusa.com/web/content/wp-content/uploads/2014/05/10x3-7.jpg]
    DEBUG: attachment_file_url=[/wp-content/uploads/2014/05/10x3-7.jpg]
    DEBUG: Calling API: [http://www.smushit.com/ysmush.it/ws.php?img=%2Fwp-content%2Fuploads%2F2014%2F05%2F10x3-7.jpg]
    DEBUG: return from API: data

    i am able to upload images to the media section but smush it fails with an error. the images are arranged by year/month etc

    https://wordpress.org/plugins/wp-smushit/

  2. WPMU DEV
    Member
    Posted 2 months ago #

    Hi @CashOff,

    Sorry to hear of the problem you are having.

    Have you added / updated / edited anything recently that caused this issue as you never had this issue?

    Could you please tell me exactly what error you are getting by copy pasting it here?

    Also please temporary add the following code in either page.php or post.php template file of your theme and let me know the output by copy pasting it here.

    <?php $upload_dir = wp_upload_dir(); ?>
    <?php print_r($upload_dir); ?>

    Kind Regards,
    WPMU DEV

  3. CashOff
    Member
    Posted 2 months ago #

    if the box is checked on media settings to only allow images from this domain - then i get:
    ERROR: /wp-content/uploads/2014/05/10x3-7.jpg must be within the website home URL (http://www.destinyracingusa.com)
    Re-smush

    if the box is unchecked then i get a bad response error

    i added the code on page.php ands also single.php but i do not see it being output anyplace?

  4. CashOff
    Member
    Posted 2 months ago #

    also i never updated anything - i never had this plugin working ON THIS SITE .......... i have used it on many other without issues

  5. WPMUDEV
    WPMU DEV Support Staff
    Plugin Author

    Posted 2 months ago #

    @CashOff,

    One clue might be from the DEBUG output. See the line:

    DEBUG: Calling API: [http://www.smushit.com/ysmush.it/ws.php?img=%2Fwp-content%2Fuploads%2F2014%2F05%2F10x3-7.jpg]

    Notice the part ?img=%2Fwp-content%2Fuploads%2F2014%2F05%2F10x3-7.jpg. It appears for whatever reason the URL is not complete. This should contain the entire http://www.somesite.com/... but for some reason your site is building the URL starting only with the path /wp-content/...

    In wp-admin can you please go to Settings > General and verify you have the complete http:// version of your domain in the WordPress Address and Site Address fields (assuming you are running regular WordPress and not Multisite).

    Basically how Smush.it works is it calls the Yahoo Smush.it API. IT passes the URL to your images. This is so the Yahoo service can download the image and process it. The plugin does not process the image directly on your site. So what I'm getting at is the Yahoo service must be able to access the image via a public URL.

  6. CashOff
    Member
    Posted 2 months ago #

    thx - i am came to the same conclusion ........... i already checked both fields under settings and they have the full URL

    http://www.destinyracingusa.com

    any other suggestions?

    also - does smush it actually alter the image? ............. please explain how it works as i am concerned it might be bad for my SEO ...... although maybe it literally changes the images on my site?

  7. CashOff
    Member
    Posted 2 months ago #

    i figured out what was happening. turns out somebody had installed a plugin called root relative urls and even though it was no longer installed it made a change to the wp-config file. once i deleted this:

    define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
    define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
    define('WP_CONTENT_URL', '/wp-content');
    define('DOMAIN_CURRENT_SITE', $_SERVER['HTTP_HOST']);

    the site works fine with smush it!

    thx a ton

  8. WPMUDEV
    WPMU DEV Support Staff
    Plugin Author

    Posted 2 months ago #

    @CashOff,

    i figured out what was happening. turns out somebody had installed a plugin called root relative urls...

    Yeah, always something. :)

    also - does smush it actually alter the image? ............. please explain how it works as i am concerned it might be bad for my SEO ...... although maybe it literally changes the images on my site?

    Well as I mentioned the plugin simply calls the Yahoo Smush.it API passing the public URL for the image to be processed. As a reply to that API call Yahoo will return a URL for the smushed image back to the plugin. Once this is done the plugin downloads the processed image and renames it to replace the original image on your site.

    The image filename is not changed. So not sure if will effect SEO at all.

  9. WPMU DEV
    Member
    Posted 2 months ago #

    Hi @CashOff,

    Awesome, great to see you got that resolved and sorry for the delay here.

    I also thought this might be an issue therefore i have suggested to add the code in your site to troubleshoot it that i have provided in my previous reply which uses wp_upload_dir function to output the configured uploads directory paths but you might have added in the wrong place.

    That's nice that the issue is resolved now.

    Have a great day!

    Cheers,
    WPMU DEV

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.