I already talked in my article Determine Path To Plugin and Content Directories about the possibilities how to keep functions in themes or Plugins free from error if you rename a folder, for example
Since version 2.6 you can also solve this problem pretty easy with another function.
More details and information are available in
Return the site url
Returns the ‘site_url’ option with the appropriate protocol, ‘https’ if
is_ssl() and ‘http’ otherwise.
$scheme is ‘http’ or ‘https’,
is_ssl() is overridden.
$path – Optional path relative to the site url
$scheme Optional scheme to give the site url context. Currently ‘http’,’https’, ‘login’, ‘login_post’, or ‘admin’
site_url($path = '', $scheme = null)
Return the admin url
Returns the url to the admin area.
$path – Optional path relative to the admin url
admin_url($path = '')
Return the includes url
Returns the url to the includes directory.
$path – Optional path relative to the includes url
includes_url($path = '')
Return the content url
Returns the url to the content directory
$path – Optional path relative to the content url
content_url($path = '')
Return the Plugins url
Returns the url to the Plugins directory.
$path – Optional path relative to the Plugins url
plugins_url($path = '')
At version 2.8 of WordPress you can use two parameter. Use
__FILE__ for scan your folder.
plugins_url($path = '', $plugin = '')
Example for Pluginpath
wp_enqueue_script( 'farbtastic', plugins_url('/examble_plugin_folder/includes/farbtastic/farbtastic.js'), array('jquery'), '1.2' );
I hope you enjoy this alternative. please comment for a better idea or a other ways to do it.