Wrong path for plugins directory

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Wrong path for plugins directory

This topic contains 2 replies, has 2 voices, and was last updated by epiphron epiphron 7 years, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4009
    epiphron
    epiphron
    Participant

    Hi, I have a WordPress Bedrock installation http://roots.io/wordpress-stack/

    Bedrock modifies the default WordPress directories. Unfortunately this means I’m having a problem with Ajax Search Pro.

    The asp.shortcode.probox.php has a number of lines (11, 28, 56) which use file_get_contents() instead of plugins_url(), which breaks the plugin.

    e.g. echo file_get_contents(ABSPATH . ‘wp-content/plugins/’ . $style[‘magnifierimage’]);

    I get an output like this:
    /var/www/wp-site/web/wp/wp-content/plugins/ajax-search-pro/img/svg/magnifiers/magn4.svg

    Instead of this:
    /var/www/wp-site/web/app/plugins/ajax-search-pro/img/svg/magnifiers/magn4.svg

    Is there any way this can be fixed? I can edit the code myself for now, but I don’t want to have to support my client’s sites every time they update the Ajax Search Pro plugin and overwrite my changes.

    Best,
    James

    #4012
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    I’m currently working on the upcoming version and if I remember correctly I fixed this as someone reported something similar with the paths.

    I think there are only 3 instances of ABSPATH there in the current version. The fixed lines look like this now:

    echo file_get_contents(WP_PLUGIN_DIR . '/' . $style['magnifierimage']);

    Would you mind checking if this solution is working in your case? A core developer suggested using the WP_PLUGIN_DIR constant as it should hold the correct plugin directory at all times.

    I will mark this path issue solved if you can confirm that this solution works, and we don’t need to worry about this in the future versions anymore 😉

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #4014
    epiphron
    epiphron
    Participant

    Hey Ernest, thanks for the quick reply. I’ve tested your code and it works fine. Thanks for the help!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.