WordPress.org

Ready to get started?Download WordPress

Forums

Dave's WordPress Live Search
[resolved] Wrong paths?! (4 posts)

  1. techouse
    Member
    Posted 2 years ago #

    I just installed your plugin and i got wrong paths to daves-wordpress-live-search.js, daves-wordpress-live-search.css and indicator.gif. Instead of a right path like

    hxxp://localhost/mywordpress/wp-content/plugins/daves-wordpress-live-search/js/daves-wordpress-live-search.js

    I got something weird like

    hxxp://localhost/mywordpress/wp-content/plugins/usr/share/wordpress/wp-content/themes/my-theme/js/daves-wordpress-live-search.js

    The latter is sort of a composition of my localhost WP url + an absolute system path to my wp-theme. Dunno why that is :/

    I sort of fixed it by replacing:

    plugin_dir_url(__FILE__)

    with

    plugin_dir_url().'daves-wordpress-live-search/

    Here's the DIFF:

    --- DavesWordPressLiveSearch.php
    +++ DavesWordPressLiveSearch.php
    @@ -29,7 +29,7 @@
             if (self::isSearchablePage()) {
                 wp_enqueue_script('jquery');
    
    -            wp_enqueue_script('daves-wordpress-live-search', plugin_dir_url(__FILE__).'js/daves-wordpress-live-search.js', 'jquery');
    +            wp_enqueue_script('daves-wordpress-live-search', plugin_dir_url().'daves-wordpress-live-search/js/daves-wordpress-live-search.js', 'jquery');
                 self::inlineSettings();
             }
    
    @@ -51,7 +51,7 @@
                     case 'default_red':
                     case 'default_blue':
                     case 'default_gray':
    -                    $style = plugin_dir_url(__FILE__).'css/daves-wordpress-live-search_'.$cssOption.'.css';
    +                    $style = plugin_dir_url().'daves-wordpress-live-search/css/daves-wordpress-live-search_'.$cssOption.'.css';
                         break;
                     case 'notheme':
                     default:
    @@ -82,7 +82,7 @@
             $minCharsToSearch = intval(get_option('daves-wordpress-live-search_minchars'));
             $xOffset = intval(get_option('daves-wordpress-live-search_xoffset'));
    
    -        $indicatorURL = plugin_dir_url(__FILE__).'indicator.gif';
    +        $indicatorURL = plugin_dir_url().'daves-wordpress-live-search/indicator.gif';
             $indicatorWidth = getimagesize(dirname(__FILE__) . "/indicator.gif");
             $indicatorWidth = $indicatorWidth[0];

    http://wordpress.org/extend/plugins/daves-wordpress-live-search/

  2. techouse
    Member
    Posted 2 years ago #

    Never mind, it was a local problem. Fixed it now :)

  3. nledez
    Member
    Posted 1 year ago #

    A idea to solve this error could be fine...

    Thanks.

  4. nledez
    Member
    Posted 1 year ago #

    Exemple:
    After WordPress 3.4 migration I have error 404 on some plugins assets.

    If you have this error, search on wp-content symlink.

    I think it's a regression from a old version.

    Found idea here:
    http://wordpress.stackexchange.com/questions/15202/plugins-in-symlinked-directories

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic