Support » Plugin: WPtouch » [Plugin: WPtouch] WPTouch not working when plugins directory not undet wp-content

  • I’m using WordPress 3.1 with some modified configurations.

    1. WordPress is installed in it’s own directory (lets say it’s installed under /WP/ in my site)
    2. wp-content is renamed (lets say that it is now called wpc, so the URL would be /WP/wpc/)
    3. plugins location is moved outside the renamed wp-content (lets say its now called plgs and the URL is /WP/plgs/)

    And in this situation WPTouch is broken. As far as I can see from admin interface, WPTouch is trying to include it’s JavaScript and CSS files from plugins directory under renamed wp-content, so the URLs look like:
    <script type=’text/javascript’ src=’http://website/WP/wpc/plugins/wptouch/js/ajax_upload.js?ver=3.1′></script>
    <link rel=’stylesheet’ type=’text/css’ href=’http://website/WP/wpc/plugins/wptouch/admin-css/wptouch-admin.css’ />

    Obvioisly these files cannot be found and everything is broken. As far as I understand, the ability to move wp-content and plugins is there since WordPress 2.6 (
    And it’s pretty well documented in wp-config file documentation (

    I look at the code and I see, that WPTouch seems to be completely unaware of this WordPress possibility. 🙁
    Look at this code for example:

    if ( !function_exists( 'compat_get_base_plugin_dir' ) ) {
    	function compat_get_base_plugin_dir() {
    		if ( compat_is_wordpress_mu() && strpos( dirname( __FILE__ ), 'mu-plugins') !== false ) {
    			return compat_get_wp_content_dir() . '/mu-plugins';
    		} else {
    			return compat_get_wp_content_dir() . '/plugins';

    You should follow instructions given there:
    Hopefully this can be fixed.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author BraveNewCode Inc.


    Thanks— the core of the plugin was written prior to 2.6, actually! So it’s older.

    And the compat code we had, again, was pre-2.9. We’ve added this to the list of things to fix up.

    While you’re adding thins to be fixed, here are couple of more:
    The provided .pot file does not contain correct strings. I tried to translate WPtouch and following texts (these are the one’s I see right now, meybe there are more) are incorrectmissing in the .pot file:

    • “Select the language for WPtouch. Custom .mo files should be placed in wp-content/wptouch/lang.”
    • “WPtouch by default follows your WordPress » Reading Options.”
    • “You can change your site title (if needed) in WPtouch.”
    • “Categories by ID you want excluded everywhere in WPtouch.”
    • “Excluded Tags”
    • “Tags by ID you want excluded everywhere in WPtouch.”

    Following function:
    function bnc_get_wptouch_custom_lang_files()
    uses WP_CONTENT_DIR constant, but it must be using WP_PLUGIN_DIR constant.
    But when I fixed it, then it will mess up the language selection in admin (all the predefined languages will be doubled). So, this needs to be handled in a better way.

    Plugin Author BraveNewCode Inc.


    An update— we’re fixing these issues for 1.9.26.

    Thanks, but I did an update and unfortunately the issues are not fixed – the files concerned contain the exact same faulty code in 1.9.26.

    Please fix it in next version, because it’s kind of annoying to apply my own hack-fix to the changed files after every update.

    Plugin Author BraveNewCode Inc.


    I meant the language changes. If you have patches for WPtouch, submit them to us here:

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WPtouch] WPTouch not working when plugins directory not undet wp-content’ is closed to new replies.