• Resolved will-s

    (@will-s)


    I am running a couple of old WordPress websites for a client, having added nothing to either of them for at least 10 years. But the client likes visiting them occasionally to reminisce. Both run on “WRC Theme Viewer, Default Version: 1.7.2, By Michael Heilemann. The default WordPress theme that graced version 1.5 to version 2.9, based on the famous Kubrick.”

    Recently, I discovered this warning in the site cited above: “Your site is running on an outdated version of PHP (7.4.33), which does not receive security updates. It should be updated.
    The minimum recommended version of PHP is 8.3.”

    I contacted my service provider and had them update to 8.3, but apparently it was incompatible with my theme and gave me a critical warning. So I had the service provider put the 7 PHP back, for the time being.

    I found my theme listed here: https://ww.wp.xz.cn/themes/default/. It says “this theme hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.”

    Is there a free theme similar to this one that I could convert to virtually automatically? (I’m a little rusty on the mechanics.)

    I also need to change the administration email address; this old theme is inviting me to do that, but when I type the new address in, it doesn’t “take”. There is a line below where I’ve typed it in that says: There is a pending change of the admin email to . . . But when I hit save changes, it just reverts to the old email address. And, of course, I don’t get a confirming email to my new address. If this problem could be fixed without changing the theme, I’d like to do that first.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Follow these steps to fix the critical error when running the theme on PHP 8.3. Before you start ensure you backup your theme.

    File 1 of 2: functions.php

    Location: /wp-content/themes/kubrick/functions.php

    1. Open the file in your text editor.
    2. Go to line 110. Find this line:$uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0];
      Replace it with:$uc = ( strlen($uc[0]) == 3 ) ? $uc[0][0].$uc[0][0].$uc[0][1].$uc[0][1].$uc[0][2].$uc[0][2] : $uc[0];
      (Change every { to [ and every } to ].)
    3. Go to line 111. Find this line:$lc = ( strlen($lc[0]) == 3 ) ? $lc[0]{0}.$lc[0]{0}.$lc[0]{1}.$lc[0]{1}.$lc[0]{2}.$lc[0]{2} : $lc[0];
      Replace it with:$lc = ( strlen($lc[0]) == 3 ) ? $lc[0][0].$lc[0][0].$lc[0][1].$lc[0][1].$lc[0][2].$lc[0][2] : $lc[0];
    4. Save the file and upload it back to the server.

    File 2 of 2: images/header-img.php

    Location: /wp-content/themes/kubrick/images/header-img.php

    1. Open the file in your text editor.
    2. Change 1 — around line 18. Find this line:if ( isset($_GET[$var]) ) { Replace it with:if ( isset($_GET[$var]) && is_string($_GET[$var]) && in_array(strlen($_GET[$var]), array(3, 6), true) ) {
    3. Change 2 — around line 70. Find this line:$color = imagecolorallocate( $im, $r, $g, $b ); Replace it with:$color = imagecolorallocate( $im, (int) $r, (int) $g, (int) $b );
    4. Change 3 — around line 80. Find this line:imagejpeg($im, '', 92); Replace it with:imagejpeg($im, null, 92);
    5. Save the file and upload it back to the server.

    Then verify it worked.

    1. Visit the front of the site — the critical-error screen should be gone.
    2. Log in to WordPress and go to Appearance → Custom Header — the page should render normally.
    3. Try saving a new header color — it should save without errors.
    Moderator threadi

    (@threadi)

    The theme you’re using is actually 16 years old. Yes, it’s time to switch it out.

    Theoretically, you can use any other theme. I would recommend the following approach:

    • First, create a backup of everything. This is very important. If you don’t have a plugin for this, ask your hosting provider if they create backups and how to use them in an emergency.
    • Then use this plugin to create a copy of your project on your hosting: https://ww.wp.xz.cn/plugins/wp-staging/
    • In this copy, change the theme to one you want to use instead, just to test it out. For example, you could use the latest classic default theme, “TwentyTwenty-One.” This is very simple, but you can first check whether it’s generally possible with your content.
    • Once you’ve found a way to do this, you can either revert the changes using WP Staging or make the changes directly on the live site.
    • Only then should you try changing the PHP version again. However, the plugins you’re using might also cause issues. Make sure everything is up to date and that you’re not using any plugins older than 2–3 years.

    As an alternative to this approach, you can, of course, run the tests directly on your website using a new theme. Depending on how long that takes, however, your website might literally look like a construction site to visitors during that time.

    If you get stuck on anything along the way, you can also seek personal assistance. You’re sure to find someone here: https://jobs.wordpress.net/

    Thread Starter will-s

    (@will-s)

    Thanks, Threadi,
    But I think I’m going to try Albert’s solution. (See below.)

    Thanks, Albert,
    I found the two files and downloaded them and will work on duplicates, while I keep the originals just in case.
    I had a few of questions.
    The line 110 change says: “(Change every { to [ and every } to ].)” But the line 111 change doesn’t say that. So, I do not make that change to that second line?
    Your images/header-img.php file correction seems to deal with the missing top matter of the opening page. I didn’t ask about that but if that’s what this correction is fixing, thank you. The odd thing about that missing header is that I made another website for the client exactly the same way and I never lost the header on that one! (See: https://sherpspace.com)
    I noticed you didn’t address my second question, about how this old theme is balking at changing my administration email address. Did you have any thoughts about that? Or will this PHP correction miraculously solve that problem, also?

    Moderator threadi

    (@threadi)

    There are often several ways to solve a problem. If editing the code works for you, that’s fine.

    You can change the admin email address in several ways:

    Thread Starter will-s

    (@will-s)

    Hi, threadi,

    I used your PHPMyAdmin solution and it worked like a charm! Thanks!

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

You must be logged in to reply to this topic.