• Resolved unklee

    (@unklee)


    I have two WordPress sites that use the same minimalist theme (Arke). I have made a child theme for each to add features I want. (That may sound like I know what I’m doing, but I’m really still a novice.) One site still uses the classic editor and I write in HTML and the other I use the block editor. I copied the block site child theme from the successful HTML site. Of course there are differences because their layouts aren’t the same, but I have checked the both main child theme files and they appear to be fundamentally the same.

    Both sites used to run on php 7.4, but some time back I upgraded to php 8.1, as recommended by my host (Inmotion). The HTML site was fine, but the block editor site totally crashed, wouldn’t load at all. I contacted the Arke theme author (see https://wordpress.org/support/topic/updates-292/) and he made some modifications to the Arke theme, and that meant I was able to load the site, but incompletely. I tried disabling all plugins, but that made no difference. So I remained on php 7.4.

    So the current situation is when I use php 8.1, the block site only loads only part of the header, in a narrower format, and no content. The site title appears, the header menu shows and works, but not much else. So I’m guessing the fault must be in the header.php file, but I can’t find it so far.

    I’d really like to update the php version, but I really don’t know what to look for. Can anyone help me with the following questions please:

    (1) Do you agree that if the header only partially shows and nothing else, then it is likely to be the header.php file that is faulty?

    (2) It used to work, and still works on php 7.4. This suggests some aspect of php was updated to be more stringent, and bad code which was passed in 7.4 is no longer accepted in 8.1. Does anyone have any suggestions what this might be?

    (3) Could there be anything in the php that is treated differently in the classic editor compared to the block editor?

    Thanks for any suggestions.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • The site works for me with this theme using PHP 8.3, so I suspect there is a plugin at fault.

    The narrow display is typical of an error, although in cases like this there isn’t usually a nice message that helps diagnose what is happening. If you could enable debugging and check the logs that would help narrow down the problem

    This may just require updating WordPress and plugins as well for versions that support PHP 8

    Hi @unklee ,

    Enabling debug mode would help in ruling out what might be causing the issue.

    Please check this link for more info about enabling debug mode:
    https://learn.wordpress.org/tutorial/debugging-in-wordpress/

    In short, once you enable debug mode, you’ll have to replicate the issue so that the critical error occurs. Once the error occurs, the related logs will be saved to the debug.log file, where it will mention what exactly is causing the issue.

    The error should provide a better indication of whether it’s an issue related to the plugin or the server. This would help in moving in the right direction.

    If you could share the error in the next response it would give a better idea.

    Please do let us know that goes or the content of the logs so that we could advise further if needed.

    Regards,

    Nithin

    Thread Starter unklee

    (@unklee)

    Hi bvbaked & Nithin , and many thanks. With your help, I appear to have resolved this.

    It was simple in the end. It was the content.php file, and it contained a variable that was defined without parentheses. php 7.4 warned that future versions of php would pick this up as an error, which indeed was the case. When I checked the code of the two sites, I missed that small difference. So all seems to be running well in php 8.1.

    But a couple of curious things:

    (1) I couldn’t get the error to log in the debug.log file. No such file existed initially, and even when I created one nothing was written there. I checked the load.php file and it appeared to be as your references said they should be. But I amended the config.php code to log on screen and that was fine.

    (2) I got another error “Translation loading for the subscribe-to-comments-reloaded domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early.” But this error doesn’t stop the plugin working or the site not functioning, so I guess it’s no problem (for now).

    Thanks again, it was simple, but your help got me there.

    • This reply was modified 2 months, 3 weeks ago by unklee.
    Thread Starter unklee

    (@unklee)

    Correction: it was quotes, not parentheses.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.