Please don't hardcode the wp-content, uploads, or plugins directories

edited September 2012 in Newsletter plugin
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.

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', '');
define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/files/plugins' );
define( 'WP_PLUGIN_URL', '');
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


  • 9 Comments sorted by
  • Vote Up0Vote Down
    Well it's Monday and I am trying to finish up my client site for delivery tonight. I was hoping to hear back on this by now but haven't yet.

    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.

    Quote: ( )

    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: for more details.

    Quote: ( )

    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....
  • Vote Up0Vote Down
    Thank you for your message and follow-up on this.

    Yes, the plugin does have 'wp-content/uploads/' hardcoded in some places.

    We have updated this in our latest development build and we can send you a copy of the build.
    If you're interested in this, please let me know and I'll share it with you.
  • Vote Up0Vote Down
    We see that you submitted a ticket and replied to that.
    We shared the build with the replaced "wp-content" as well.

    Let us know on the ticket if you need any changes or assistance please.
  • Vote Up0Vote Down
    Sorry, I created this forum post prior to seeing your answer to my ticket. I'll keep conversation on this topic to my trouble ticket. I did respond back on the ticket with the version you sent me.
  • Vote Up0Vote Down
    Thank you for your response.

    No problem at all.
    Let us know in the ticket if the build is fine and according to your needs.
  • Vote Up0Vote Down
    I let you know.. wp-content is fixed, but plugins is still hardcoded. I had to revert the site back to 'stock' in order to do more testing, but we are NOT going to keep it this way. I had to show the client what it is capable of, so had to do it this way for now. Just waiting for the fixed vs. from you so we can fix it and truly go live.
  • Vote Up0Vote Down
    it's been quite a while 2 weeks now.. have you fixed this problem yet so we can use the plugin?
  • Vote Up0Vote Down
    checking back in again. Is there any news on the fixed vs?

    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?
  • Vote Up0Vote Down
    Thank you for your follow-ups.
    We see that you submitted a reply to your ticket as well and we replied to that.

    Please note that the plugin was sold as is.
    You needed changes to it to accommodate your custom wp-content, plugins, uploads, etc... folders.
    We've made those changes for you without hesitation and we're willing to help you further.
    Let's not go into the technical details as you are right about the conventions, we are aware of that.

    Will you please reply to the ticket? I gave you my Skype ID as well so that you can text me there.

    I look forward to hearing from you.
Sign In or Register to comment.