• Resolved swinggraphics

    (@swinggraphics)


    Warning: file_get_contents(/public_html/wordpress/wordpress/wp-content/plugins/paid-memberships-pro/css/frontend.css): failed to open stream: No such file or directory in /public_html/wordpress/wp-content/plugins/merge-minify-refresh/merge-minify-refresh.php on line 825

    When I load a page, I get warning like this for every CSS and JS file. The files BWP Minify creates are empty.

    The problem is it is trying to access files under “/wordpress/wordpress/”

    I edited the plugin to get it to work.

    $path = $this->root.$script_path['path'];
    $path = preg_replace( '#wordpress/wordpress#', 'wordpress', $path );
    $contents = file_get_contents( $path );

    and similar for the other 3 places.

    https://ww.wp.xz.cn/plugins/merge-minify-refresh/

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author launchinteractive

    (@launchinteractive)

    Hi swinggraphics,

    Are you using BWP Minify and MMR? Its possible there is a conflict. I’ve never tried to use both together and I think they could slow your site down if they run together as you would be processing everything twice. I’d recommend choosing one or the other.

    Thread Starter swinggraphics

    (@swinggraphics)

    No, only MMR.

    Plugin Author launchinteractive

    (@launchinteractive)

    Are you able to try disabling the paid-memberships-pro plugin and see if you still get the error?

    Thread Starter swinggraphics

    (@swinggraphics)

    It happens even with all plugins other than MMR disabled. I don’t see how it could possibly be the fault of anything but the plugin itself. Clearly $this->root.$script_path['path'] and $this->root.$style_path['path'] are the problem.

    Plugin Author launchinteractive

    (@launchinteractive)

    It could be. Is your WordPress site running from the root of your domain or is it on a folder called WordPress? I’ve never tried mmr with an installation in a sub folder.

    Thread Starter swinggraphics

    (@swinggraphics)

    Yes, and $this->root.$script_path[‘path’] and $this->root.$style_path[‘path’] are duplicating that folder name.

    Plugin Author launchinteractive

    (@launchinteractive)

    Hi swinggraphics. We have just uploaded a new version of MMR that should resolve this issue. Let me know if you have any issues.

    Thread Starter swinggraphics

    (@swinggraphics)

    Nope. Same exact problem still exists.

    Plugin Author launchinteractive

    (@launchinteractive)

    any chance you can send me the link to your site so I can have a look? You can send it using https://launchinteractive.com.au/enquiry if you don’t want to put it here.

    Plugin Author launchinteractive

    (@launchinteractive)

    Alternatively, could you try this version of merge-minify-refresh.php?
    https://www.dropbox.com/s/hja54fx4s3lyvdt/merge-minify-refresh.php?dl=0

    Thread Starter swinggraphics

    (@swinggraphics)

    I updated the plugin, got the same error messages, and put my same edits into the new version to fix it. Looking at the front end of the site will not provide any information.

    $this->root.$script_path and $this->root.$style_path concatenate two strings that both include the WordPress directory name, yielding a nonexistent path.

    Similar problem here:

    Warning: file_get_contents(/kunden/homepages/x/y/htdocs/hoech/wp-testing/homepages/x/y/htdocs/hoech/wp-testing/wp-content/plugins/buddypress/bp-core/js/jquery-query.min.js): failed to open stream: No such file or directory in /homepages/x/y/htdocs/hoech/wp-testing/wp-content/plugins/merge-minify-refresh/merge-minify-refresh.php on line 407

    /kunden/homepages/x/y/htdocs/ is the DOCUMENT_ROOT.
    /homepages/x/y/htdocs/hoech/wp-testing/ is the WordPress directory (ABSPATH). As you can see, the WordPress directory is repeated above in the path the plugin tries to access.

    The underlying problem seems to be the line untrailingslashit(str_replace($_SERVER["DOCUMENT_ROOT"], '', ABSPATH)); in merge-minify-refresh.php (version 1.6.5). It seems that ABSPATH starting with DOCUMENT_ROOT is not guaranteed. I can’t influence this either because it’s shared hosting.
    I’m not sure what the line is for either, i.e. it’s trying to figure out where WordPress is installed relative to DOCUMENT_ROOT, but the purpose of this is unclear to me.

    I downgraded to 1.6.3 as a work-around.

    Plugin Author launchinteractive

    (@launchinteractive)

    Hi swing and fhoech, have you tried the version of merge-minify-refresh.php I have linked to in dropbox above? On my test setup it seems to fix this issue but I don’t want to commit it until I’m sure it does.

    Thread Starter swinggraphics

    (@swinggraphics)

    Yes, that new version works perfectly!

    Doesn’t work for me unfortunately because of ABSPATH not starting with DOCUMENT_ROOT (Edit: plugin version from DropBox).

Viewing 15 replies - 1 through 15 (of 21 total)

The topic ‘Generates blank/empty files; file_get_contents errors’ is closed to new replies.