Please don't hardcode the wp-content, uploads, or plugins directories
I have a problem.
As soon as I activate the newsletter plugin on my clients live site, I get the following error:
Folder named "wp-content/uploads/" does not exist
I know why this happens, but I do not know how to fix the issue.
Reason:
For security reasons, the following settings are in the wp-config.php file.
define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/files' );
define( 'WP_CONTENT_URL', 'http://mysite.com/files');
define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/files/plugins' );
define( 'WP_PLUGIN_URL', 'http://mysite.com/files/plugins');
define( 'PLUGINDIR', $_SERVER['DOCUMENT_ROOT'] . '/files/plugins' );
/* change location of WordPress uploads */
update_option('uploads_use_yearmonth_folders', 0);
update_option('uploads_path', 'media');
I've looked around but can't find the global variables where you are setting these values so that I can change them. Or even better, if you would please release a fix.
Please advise how I fix this as I need to finish up and deliver the website complete with newsletters to the client by Monday evening.
thank you
As soon as I activate the newsletter plugin on my clients live site, I get the following error:
Folder named "wp-content/uploads/" does not exist
I know why this happens, but I do not know how to fix the issue.
Reason:
For security reasons, the following settings are in the wp-config.php file.
define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/files' );
define( 'WP_CONTENT_URL', 'http://mysite.com/files');
define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/files/plugins' );
define( 'WP_PLUGIN_URL', 'http://mysite.com/files/plugins');
define( 'PLUGINDIR', $_SERVER['DOCUMENT_ROOT'] . '/files/plugins' );
/* change location of WordPress uploads */
update_option('uploads_use_yearmonth_folders', 0);
update_option('uploads_path', 'media');
I've looked around but can't find the global variables where you are setting these values so that I can change them. Or even better, if you would please release a fix.
Please advise how I fix this as I need to finish up and deliver the website complete with newsletters to the client by Monday evening.
thank you
Comments
The problem is still that you are assuming wp-content and uploads are being used on the site installation.
I did a search in the newsletter plugin for 'wp-content' and found it used in 195 places!
This is NOT following WordPress coding standards.
http://codex.wordpress.org/Writing_a_Plugin
Quote: ( http://codex.wordpress.org/Writing_a_Plugin )
However, an installation can be configured for wp-content/plugins to be
moved, so you must use plugin_dir_path() and plugins_url() for absolute
paths and URLs. See: http://codex.wordpress.org/Determining_Plugin_and_Content_Directories for more details.
Quote: ( http://codex.wordpress.org/Determining_Plugin_and_Content_Directories )
It's important to remember that WordPress allows users to place their
wp-content directory anywhere they want, so you must never assume that
plugins will be in wp-content/plugins, or that uploads will be in
wp-content/uploads, or that themes will be in wp-content/themes.
I'm a little concerned as I only have the 7 day return policy with your plugin and I'm 3 days into it now. Most importantly I have to deliver the client site. I would much rather use your plugin than the other ones out there, but if this can't be fixed very quickly, then I need to move on. I have a number of questions in the forum here that are not answered....
We've now had this plugin for weeks and can't even begin to think about sending our first email and it's getting a little frustrating...
Think about it.. we're almost 1/3 the way through our paid period and still don't have a product we can use on the live site... It's not that big a deal to fix the problem is it?