• Hi,

    I have moved my media and plugins folder to subdomains on my server.
    Media -> subdomain uploads.my_domain.com and the plugins to plugins.my_domain.com,
    everything works nice and smooth except wp smushit, i keep getting an error on all images in the media folder once I try to smush them :

    /srv/www/vhosts/my_domain.org/subdomains/uploads/httpdocs/uploads/2010/05/aida20101.jpg must be within the content directory (/srv/www/vhosts/my_domain.org/httpdocs/wp-content)

    is there a workaround ? where can I change the path to my media in the wp-smushit.php

    I did this in my wp-config.php

    define( ‘WP_SMUSHIT_PLUGIN_DIR’,’/srv/www/vhosts/my_domain.org/subdomains/plugins/httpdocs/wp-smushit’ );

    but it does not change a thing, can I set the media path by hand ?

    many regards

    Joe

    https://www.ads-software.com/extend/plugins/wp-smushit/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Same here, and the beta the author posted in an older post didn’t work either…

    Hope it’s fixed soon !

    Me too looking for a solution for this… anyone listening?

    I was hoping for an upgrade, but it doesn’t seem ready yet so I modified it a bit to make it work with uploads out of the wp-content directory…

    Look for line 127

    // check that the file is within the WP_CONTENT_DIR

    Add this right after it :

    $upload_dir = wp_upload_dir();
    $wp_upload_dir = $upload_dir['basedir'];
    $wp_upload_url = $upload_dir['baseurl'];

    Replace WP_CONTENT_DIR by $wp_upload_dir
    And WP_CONTENT_URL by $wp_upload_url

    in lines 128, 129, and 135.

    This works for me ??

    Thank you ka-ri-ne, your solution worked.

    Here’s the code snippet for wp-smushit.php, from lines 127 to 135:

    // check that the file is within the WP_CONTENT_DIR
    	$upload_dir = wp_upload_dir();
    	$wp_upload_dir = $upload_dir['basedir'];
    	$wp_upload_url = $upload_dir['baseurl'];
    	if ( 0 !== stripos(realpath($file_path), realpath($wp_upload_dir)) ) {
    		$msg = sprintf(__("<span class='code'>%s</span> must be within the content directory (<span class='code'>%s</span>)", WP_SMUSHIT_DOMAIN), htmlentities($file_path), $wp_upload_dir);
    
    		return array($file, $msg);
    	}
    
    	// determine the public URL
    	$file_url = str_replace( $wp_upload_dir, $wp_upload_url, $file );
    Thread Starter diver66

    (@diver66)

    Hi guys,

    there is a little discussion going on about the integration of lazyest gallery into wp smush.it

    https://www.ads-software.com/support/topic/lazyest-gallery-wp-smushit

    any input on this

    regards

    Joe

    Klark0

    (@klark0)

    ka-ri-ne,

    Thanks.

    Thanks ka-ri-ne — your fix will be in the update released today.

    Much appreciated.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: WP Smush.it] error – must be within the content directory’ is closed to new replies.