• Resolved Koji

    (@koji89)


    Hello Everyone,

    We are using the newest version of WordPress and the W3 Total Cache Plugin. Some days ago we had to update to php 8.3 with the website and a forum (woltlab burning board version 6.0)

    i have added some code in the wordpress theme funcitons.php that simply doing a “require_once /some/static/path/forenapi.php”. Since the php update, the cached site is not loading correctly. (when i`m logged in its all correct, because the cache is disabled). The site breaks on the blog page after the title of the first post, but there is no php error or something else. This is just before the api code will add some comment count from the forum. Even if i dont do anything and delete all the code in my function, just the “require_once” will break the site if its cached.

    I found out it only occurs in “Page Cache Disk Enhanced” mode, not in Basic Mode.

    I don’t know what to do anymore. The debug mode from the page cache modul only tells me if the site is cached or not. Do you have any tips? Thank you very much!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @koji89

    Thank you for reaching out and I am happy to help!

    The problem may be with the Disk: Enhanced because of the output buffering. However, In order to know this for sure we would have to know the content of the file.
    Is there any chance you can share this and also the website URL?
    Thanks!

    Thread Starter Koji

    (@koji89)

    The Code in the functions.php: (But i have deleted the urls and server path)

    function worldstar_meta_comments() {
    global $post;
    if($post->post_type == 'post') {
    if(!empty(get_post_custom_values('ThreadID'))) {

    require_once "some/static/path/wcf/global.php";
    $threadid = get_post_custom_values('ThreadID')[0];
    $thread = new \wbb\data\thread\Thread($threadid);
    $comment = $thread->replies;
    $commentCount = strval($comment);
    $lastpost = $thread->lastPostID;

    if ($commentCount == 0) {
    return '<a href=".../index.php?thread/'. $threadid . '&postID=' . $lastpost . '#post' . $lastpost . '" target="_blank"><span class="meta-comments">' . $commentCount . '</span></a>';
    } else {
    return '<a href=".../index.php?thread/'. $threadid . '&postID=' . $lastpost . '#post' . $lastpost . '" target="_blank"><span class="meta-comments site-commentcount">' . $commentCount . '</span></a>';
    }
    }
    }
    }

    (And i have also a comments.php, which includes the api form the forum, but i think its the same problem.)

    Sadly, because of the error, i deactivated the api-functions in the live environment. We have a testing environment. But this is not a public site, is there a way I can send this to you personally?

    Thank you very much!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @koji89

    Thank you for your feedback.
    I need to check this more and get back to you.
    Do you have the ability on the server to use Redis or Memcached?
    Thanks!

    Thread Starter Koji

    (@koji89)

    Hello @vmarko ,

    sorry, we are on a shared hosting, so its not possible to use Redis or Memcached. The Options and PHP Modules are not available. I can only switch to Disk Basic Mode.

    thanks you

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @koji89

    Thank you for your feedback.
    Please continue to use Disk: Basic untill we can confirm this.

    Thanks!

    Thread Starter Koji

    (@koji89)

    Hello @vmarko ,

    we testet “Disk: Basic” Mode in a dev environment, but the now the error occurs here too ??

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @koji89

    Thank you for your feedback.
    Can you please check the Performance>Page Cache>REST API settings and let me know what is selected there?

    Thanks!

    Thread Starter Koji

    (@koji89)

    “Don’t cache” is selected there. The other available Option is only to disable WordPress REST API. But it makes no difference to switch it.

    • This reply was modified 6 months ago by Koji.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @koji89

    Thank you for your feedback.
    So, this happens on both caching methods available. If you purge the cache does the problem persist?
    You can reach out to us directly via the plugin in Performance>Support>bug report and share the URL

    Thanks!

    Thread Starter Koji

    (@koji89)

    Hello @vmarko ,

    i have send the bug report.

    yes, but its really strange, if i purged the cache on my device for some browser its okay. But on other devices the site is still broken ??

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @koji89

    Thank you for your feedbacm
    We’ve received yoru email and replied to it.
    Please continue the conversation there so we can avoid duplicating the answers.

    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.