• Resolved camya

    (@ecc)


    I have an error and a suggestion. 🙂

    In my error logs, I permanently get “failed to open stream” warnings from Rank Math.

    It’s really strange, because it looks like Rank Math tries to write files in the /wp-content/plugins/seo-by-rank-math/sitemap-cache/ folder. I’m not sure, if this is “WordPress Best Practice”.

    Other plugins like the “EWWW Image Optimizer” or “LiteSpeed Cache” generated their files (e.g. cache files, tmp files, …), which are needed to operate the plugins correctly, in a own subfolder of /wp-content.

    • /wp-content/ewww
    • /wp-content/litespeed

    Maybe it’s possible, that Rank Math follow this scheme too?

    • /wp-content/rankmath

    Best,
    Andreas

    Below my error from the debug.log:

    [17-Jun-2020 07:23:55 UTC] Array
    (
        [type] => 2
        [message] => file_get_contents(/wp-content/plugins/seo-by-rank-math/sitemap-cache/rank_math_626232be5ff42a970fad4c5d1b3be31b.xml): failed to open stream: No such file or directory
        [file] => /wp-admin/includes/class-wp-filesystem-direct.php
        [line] => 39
    )
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Rank Math

    (@rankmath)

    Hello @ecc

    Thank you for your message.

    For now, you can use the following filter to change the cache’s directory:
    https://rankmath.com/kb/filters-hooks-api-developer/#change-sitemap-cache-folder

    We will see how we can improve this in one of the upcoming updates.

    Appreciate your feedback. If there’s anything else we can help you with, please let us know. We are here to assist.

    Plugin Author Rank Math

    (@rankmath)

    Hello @ecc

    Hope you are doing well while reading this message.

    Please update to the latest version, 1.0.45

    We have implemented your suggested feature in it.

    Hope that helps. If not, please let us know. We are here to assist.

    We appreciate your patience and understanding in this matter.

    Thank you.

    Thread Starter camya

    (@ecc)

    Hi,

    the warnings are still present in my debug.log. I saw, that the file() function calls are silenced by @. Strange, that I still get the warnings in the log.

    Plugin Author Rank Math

    (@rankmath)

    Hello @ecc

    Extremely sorry for missing out on your reply.

    Rank Math now stores cache data in wp-content/uploads/rank-math folder.

    Can you please check if the new folder has the permissions to read and write. You can also check if there is any data in this cache folder.

    Also, if the error is still showing up, please share the complete error log. The error you shared before was in the file_get_contents() function, now you is getting error in file()

    Looking forward to helping you. Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error: Rank Math cache – Failed to open stream (sitemap xml)’ is closed to new replies.