Plugins really should be using the wordpress constants more effectively. It will enable their plugins to deal with the structures the wordpress website owners want to use and that wordpress now allows. Web owners can now define where they want various bits to live, by editing
- the wp-config.php file, and
- the uploads folder in miscellaneous settings
Some constants plugins should use to deal with a variety of wordpress setups are:
- WP_CONTENT_DIR – eg: www/www/something/publichtml/wp-content
- WP_CONTENT_URL – eg: http:domainname/wp-content
- WP_LANG_DIR
- WP_PLUGIN_DIR
- WP_PLUGIN_URL
- STYLESHEETPATH (in case a theme uses another as it’s template, this and the next can be different)
- TEMPLATEPATH
For the full list of the latest version,
see http://xref.yoast.com/trunk/nav.html?index.html
There are some ‘constants’ that can be defined in wp-config, but are not then defined if not set in wp-config. these are
- WP_SITEURL (where the wordpress code is – eg: http:domainname/wp)
- WP_HOME (what your website calls home – eg: http:domainname )
It would have been much simpler if wordpress would do as it does with the other others. check for defintion and if not set, then set them based on the DB options. Perhaps plugin authors can do this instead of multiple calls to bloginfo(‘siteurl’) or get_option(‘home’).
Example:
The 2.7 code has:
if ( defined( 'WP_SITEURL' ) && '' != WP_SITEURL )
$admin_dir = WP_SITEURL . '/wp-admin/';
elseif ( function_exists( 'get_bloginfo' ) && '' != get_bloginfo( 'wpurl' ) )
$admin_dir = get_bloginfo( 'wpurl' ) . '/wp-admin/';
Related posts:
- Multiple Blogs, Domains with wordpress The configuration features now available in wp-config.php now offer you a great deal of flexibility if you have multiple domains...
- Moving wordpress Step by Step Guide to Moving the wordpress admin code and optionally relocating your content directory. This facilitates sharing of...
- Amember with wordpress – a trial Install Amember Download the trial to somewhere on your web server. If re-uploading to another server, do it in binary...



