Moving wp-content folder to public_html

I was able to fix this problem by using this code instead of the one above: define(‘WP_CONTENT_DIR’, $_SERVER[‘DOCUMENT_ROOT’] . ‘/wp-content’); define(‘WP_CONTENT_URL’, ‘http://’ . $_SERVER[‘HTTP_HOST’] . ‘/wp-content’);

Hide obj path in source code

You could use admin-ajax.php to create a simple file proxy: add_action(‘wp_ajax_proxy_for_object1’, ‘proxy_for_object1’); add_action(‘wp_ajax_no_priv_proxy_for_object1’, ‘proxy_for_object1’); function proxy_for_object1() { $mimetype=””; // set to matching file MIME type header(“Content-type: “.$mimetype.”;”); echo file_get_contents(‘/wp-content/uploads/xx/thenameofmyfile.ext’); exit; } Then set the object resource URL to admin-ajax.php?action=proxy_for_object1 It will of course be fully accessible through the provided URL anyway, so this is really … Read more

Soflyy WP All Import Custom File Download Issue

Instead of custom curl HTTP request I’ll recommend you to use the wp_remote_post() or wp_remote_get() which internally call the HTTP request and handle all possible errors. Also use download_url() to download the file and media_handle_sideload() to upload the downloaded file into uploads directory.