Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to guess the relative scripts/styles paths in WP subfolder installs #34

Closed
nash-ye opened this issue Sep 15, 2013 · 4 comments
Closed

Comments

@nash-ye
Copy link
Contributor

nash-ye commented Sep 15, 2013

This is something I notice while I am working on PR #31 , WordPress register most of their scripts/styles that included in wp-includes folder with relative paths.

So a script like comment-reply can't be optimized successfully, when I dig more into this it seems that our way of guessing the URL/Path is wrong.

see this codes:

        $has_host = (bool) parse_url( $src, PHP_URL_HOST );
        if ( ! $has_host ) {
          $src = 'http://' . $host_domain . $src;
        } 

and

        // First attempt to get the file from the filesystem
        $contents = false;
        $is_self_hosted = self::is_self_hosted_src( $src );
        if ( $is_self_hosted ) {
          $src_abspath = ABSPATH . parse_url( $src, PHP_URL_PATH );
          $contents = file_get_contents( $src_abspath );
        } 
@nash-ye
Copy link
Contributor Author

nash-ye commented Sep 26, 2013

I think this issue is ready to go!

@westonruter
Copy link
Contributor

@nash-ye awesome! Could you open a PR to the x-team/develop branch?

@nash-ye
Copy link
Contributor Author

nash-ye commented Sep 27, 2013

@westonruter done 👍

westonruter added a commit that referenced this issue Sep 29, 2013
Fixes #34
Closes #39

Merge branch 'nash-ye-develop' into develop
@westonruter
Copy link
Contributor

Released in v0.9.7: http://wordpress.org/plugins/dependency-minification/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants