WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have built a wordpress plugin (wp-content/plugins/MyPlugin) and I would to check some folders permission inside the MyPlugin directory.

My problem is that I don't what Wordpress constant or what PHP function I should use to target on of these directories.

if( !is_writable(WP_PLUGIN_URL.'MyFolder') )
    echo 'NOK'.'<hr>';  

This piece of code always returns 'NOK' whereas I am 100% sure 'MyFolder' is actually writable .

Can you give me some piece of advice here to get the right file in order to target any folder that would be in my plugin directory?


share|improve this question
up vote 2 down vote accepted

Perhaps WP_PLUGIN_DIR? WP_PLUGIN_URL is responsible for URLs.

share|improve this answer
Thanks, I was able to make it work with: plugin_dir_path(FILE).'MyFolder'; – Vincent Nov 13 '12 at 22:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.