Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP errors #766

Open
ccharacter opened this issue Jun 24, 2024 · 35 comments
Open

PHP errors #766

ccharacter opened this issue Jun 24, 2024 · 35 comments
Assignees
Labels

Comments

@ccharacter
Copy link

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
Copy link
Author

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

@ccharacter
Copy link
Author

ccharacter commented Jun 24, 2024

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
Copy link
Author

ccharacter commented Jun 24, 2024

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
Copy link
Collaborator

Hi @ccharacter,
Could you please provide:

  • PHP Version;
  • ALPS Theme version;
  • WordPress version;

Thanks!

@ccharacter
Copy link
Author

  • ALPS theme version is 3.15.2.3 (latest, just downloaded)
  • PHP version is 8.2.20 (latest)
  • WordPress version is 6.5.4 (latest)

@ccharacter
Copy link
Author

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
Copy link
Collaborator

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

@ccharacter
Copy link
Author

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

@ccharacter
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Author

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

@YauheniKapliarchuk
Copy link
Collaborator

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

@ccharacter
Copy link
Author

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
Copy link
Author

Surprise, surprise: here are the errors I mentioned!

image

@ccharacter
Copy link
Author

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

@YauheniKapliarchuk
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@YauheniKapliarchuk
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Collaborator

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

Thanks!

@ccharacter
Copy link
Author

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
Copy link
Collaborator

Yes, nice!

@YauheniKapliarchuk
Copy link
Collaborator

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

@YauheniKapliarchuk
Copy link
Collaborator

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
Copy link
Author

ccharacter commented Sep 19, 2024

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
Copy link
Author

. . . 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
Copy link
Collaborator

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

@ccharacter
Copy link
Author

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
Copy link
Author

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

@ccharacter
Copy link
Author

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

@ccharacter
Copy link
Author

ccharacter commented Sep 19, 2024

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants