adventistchurch / alps-wordpress

This Wordpress theme is an implementation of the Adventist Living Pattern System (ALPS) designed to support the work of the Seventh-day Adventist Church.
Other
43 stars 38 forks source link

PHP errors #766

Open ccharacter opened 5 months ago

ccharacter commented 5 months ago

Version of ALPS for Wordpress v3

Describe the bug ERROR LOGS: [24-Jun-2024 15:25:52 UTC] PHP Deprecated: Creation of dynamic property Roots\Acorn\Sage\Sage::$files is deprecated in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/Sage/Sage.php on line 65 [24-Jun-2024 15:26:56 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 67 [24-Jun-2024 15:26:56 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 75 [24-Jun-2024 15:26:56 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 114 [24-Jun-2024 15:26:56 UTC] PHP Deprecated: Creation of dynamic property Roots\Acorn\Sage\Sage::$files is deprecated in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/Sage/Sage.php on line 65 [24-Jun-2024 15:26:57 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 67 [24-Jun-2024 15:26:57 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 75 [24-Jun-2024 15:26:57 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 114 [24-Jun-2024 15:26:57 UTC] PHP Deprecated: Creation of dynamic property Roots\Acorn\Sage\Sage::$files is deprecated in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/Sage/Sage.php on line 65

Having all that stuff show up every single time a page loads 1) blows up my error logs, and 2) makes troubleshooting anything else a nightmare.

To Reproduce load any page with ALPS3 active

Expected behavior Fewer PHP errors!

Additional context Because I'm sick of looking at it, I'm manually editing the theme files as prompted by the error messages. This is something I'd hope y'all would take care of prior to releasing. Many of us depend heavily on error logging and can't afford to have it clogged up by the theme.

ccharacter commented 5 months ago

I understand that some of this is bundled 3rd-party stuff. But it's still creating issues. . .

ccharacter commented 5 months ago

This code block appears to take care of some of the errors:

/**
 * Use the fully-qualified AllowDynamicProperties, otherwise the #[AllowDynamicProperties] attribute on "MyClass" WILL NOT WORK.
 */
use \AllowDynamicProperties;

#[AllowDynamicProperties]
ccharacter commented 5 months ago

This code block seems to solve the errors generated in /app/template-helpers.php, 134-137, when no header image is present

$headerImages = array('s'=>array(0),'m'=>array(500),'l'=>array(800),'xl'=>array(1100));

        if (wp_get_attachment_image_src($thumbId)) {
            $headerImages = [
                's'  => wp_get_attachment_image_src($thumbId, 'horiz__4x3--s'),
                'm'  => wp_get_attachment_image_src($thumbId, 'horiz__4x3--m'),
                'l'  => wp_get_attachment_image_src($thumbId, 'horiz__4x3--l'),
                'xl' => wp_get_attachment_image_src($thumbId, 'horiz__4x3--xl'),
            ];
        }
YauheniKapliarchuk commented 5 months ago

Hi @ccharacter, Could you please provide:

Thanks!

ccharacter commented 5 months ago
ccharacter commented 5 months ago

Since I'm working on a dev site, I'm going to deactivate all plugins just for kicks--though I can't imagine that the errors I mentioned would be affected by a plugin.

YauheniKapliarchuk commented 5 months ago

Hm, this is strange... I let me please reproduce it. Where did you find this errors?

ccharacter commented 5 months ago

In the error log on the server. (I have logging turned on for my own purposes.)

ccharacter commented 5 months ago

I'm going to spin up another dev site that's completely uncluttered and install ALPS there--see if same thing happens right off.

YauheniKapliarchuk commented 5 months ago

Could you please spin up a new dev server and don't install theme with checking logs?

I wanna check, that it happens with our theme.

ccharacter commented 5 months ago

So, checking logs with default theme and zero plugins, yes?

YauheniKapliarchuk commented 5 months ago

I mean, just empty server without installed theme and check logs.

ccharacter commented 5 months ago

FWIW, I'm working on the NAD Cloud. This test site is a single site, whereas the other one I was working on was a multi-site.

Okay, I have set up this dev site: https://yyy.ccharacter.com/ It is running the TwentyTwentytwo theme, with zero active plugins. Log is presently empty.

I installed/activated the aforementioned version of ALPS3, as well as the plugins it wants: Rank Math SEO, Spectra - WordPress Gutenberg Blocks, and Stackable - Page Builder Gutenberg Blocks (also apparently wants SVG Support). NOTHING ELSE IS ACTIVE.

image

ccharacter commented 5 months ago

Surprise, surprise: here are the errors I mentioned!

image

ccharacter commented 5 months ago

Just double-checked: when I deactivate ALPS and reactivate the default theme, there are no additional errors. Yup, ALPS is generating errors!

YauheniKapliarchuk commented 5 months ago

Got it, we have to migrate whole code to the new version of PHP, there are syntax errors. I am going to update our dependencies.

Thanks for your request!

ccharacter commented 5 months ago

Do you know for sure that these errors did not show up with PHP 8.1? Because that's the version REQUIRED BY ALPS!

ccharacter commented 5 months ago

I appreciate you taking care of the problem. It's nice to work with someone who responds in a timely fashion. (I understand that this will be something that might make it into the next version, not something I'll see fixed tomorrow or next week.)

ccharacter commented 5 months ago

Any reason on your end that I should not shut down my yyy dev site? I don't like to leave it open.

YauheniKapliarchuk commented 5 months ago

Do you know for sure that these errors did not show up with PHP 8.1? Because that's the version REQUIRED BY ALPS!

This is minimal version of PHP

YauheniKapliarchuk commented 5 months ago

Any reason on your end that I should not shut down my yyy dev site? I don't like to leave it open.

No, you can close it. I am going to prepare some fix of this problem, first will try to reproduce it and we will release it asap.

Thanks!

ccharacter commented 5 months ago

FWIW, I set the php version back to 8.1, and most of the errors disappeared. Unfortunately, that is not the case on the site I'm actively working on. Still getting these few--but they are based on a dynamically generated file and not so easy to track down. :-(

image

YauheniKapliarchuk commented 5 months ago

Could you please send here all of these errors, because this is also syntax errors which reproduced just with new versions.

Thanks!

ccharacter commented 5 months ago

Is this what you wanted? To have it in not-just-graphic form?

[24-Jun-2024 17:42:45 UTC] PHP Warning:  Undefined variable $post in /var/www/vhosts/communityservices.org/plum/ag3ieS/cache/acorn/framework/views/68f3e4d35185037f075f624cc25ddfc1397c8b03.php on line 15
[24-Jun-2024 17:42:45 UTC] PHP Warning:  Attempt to read property "ID" on null in /var/www/vhosts/communityservices.org/plum/ag3ieS/cache/acorn/framework/views/68f3e4d35185037f075f624cc25ddfc1397c8b03.php on line 15
[24-Jun-2024 17:42:45 UTC] PHP Warning:  Undefined variable $post in /var/www/vhosts/communityservices.org/plum/ag3ieS/cache/acorn/framework/views/68f3e4d35185037f075f624cc25ddfc1397c8b03.php on line 22
[24-Jun-2024 17:42:45 UTC] PHP Warning:  Attempt to read property "ID" on null in /var/www/vhosts/communityservices.org/plum/ag3ieS/cache/acorn/framework/views/68f3e4d35185037f075f624cc25ddfc1397c8b03.php on line 22
YauheniKapliarchuk commented 5 months ago

Yes, nice!

YauheniKapliarchuk commented 5 months ago

Will be in a contact, I am going to notify you about new release!

YauheniKapliarchuk commented 3 months ago

Hi @ccharacter,

Could you please check out latest version of ALPS Theme 3.15.2.5: https://github.com/adventistchurch/alps-wordpress/releases/tag/v3.15.2.5

Thanks!

ccharacter commented 2 months ago

Hi, sorry it took me so long to think about this. Now the newest version is still blowing up my logs:

`[19-Sep-2024 18:05:09 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/nadstewardship.org/plum/aiQu9o/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 67

[19-Sep-2024 18:05:09 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/nadstewardship.org/plum/aiQu9o/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 75

[19-Sep-2024 18:05:09 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/nadstewardship.org/plum/aiQu9o/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 114

[19-Sep-2024 18:05:09 UTC] PHP Deprecated: Creation of dynamic property Roots\Acorn\Sage\Sage::$files is deprecated in /var/www/vhosts/nadstewardship.org/plum/aiQu9o/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/Sage/Sage.php on line 65`

ccharacter commented 2 months ago

. . . and I assumed (wrongly) that you had an auto-update working. That was still 3.15.2.3. When I attempt to install 3.15.2.5, I get Error locating autoloader. Please run composer install. . . . which I am reasonably certain I cannot do in the jail-shell environment on NAD cloud.

YauheniKapliarchuk commented 2 months ago

Hm, could you please write your environment. Php version, wp version

ccharacter commented 2 months ago

So. . . the auto-update DID kick in. I just hadn't clicked around enough. Update successful. Disregard previous!

Will get back to you after checking on the new version--which I am running in php 8.2.23 (latest) and WordPress 6.6.2 (also latest).

ccharacter commented 2 months ago

Yep--same set of errors as above. :-(

ccharacter commented 2 months ago

Over and over and multiple times for Every. Single. Page. Load!

ccharacter commented 2 months ago

Also, your "multiple SEO plugins" nag doesn't work. I deactivated Yoast, and it still shows up. I dismiss it and it still shows up. And the CLICK HERE TO DEACTIVATE link does nothing.

hans-olson commented 2 months ago

@designerbrent Who from NAD Cloud can I add to the ticket to try and find a solution?