WPIntell

Source evidence

Error after upgrading to PHP 8

Bible Reading Plans · support · 2024-11-11T21:25:00+00:00

mixedsentiment
highseverity
0.95relevance
6replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 29 rows with source links

20.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

23 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
mikefolsom resolved
It seems that any version of PHP from 8.0 upwards is causing an error. Things work as expected on PHP 7.4 and have for a long time. The output on the front end shows: TIMEOUT ERROR: Could not retrieve Scriptures from ESV.org APIbible-reading-plans . WordPress version 6.6.2 Bible Reading Plans version 3.0.3 Reproducible on PHP 8.0, 8.1, 8.2, 8.3 Nginx running on DigitalOcean droplet provisioned via Laravel Forge The shortcode: [bible-reading-plan source="ESV" reading_plan="through-the-bible" version="WEB-P"] The error log (I replaced the actual domain with sitename.com ): 2024/11/11 21:02:40 [error] 2888#2888: *265 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /path/to/sitename.com/public/wp-content/plugins/bible-reading-plans/bible-reading-plans-class.inc.php:1204 Stack trace: #0 /path/to/sitename.com/public/wp-content/plugins/bible-reading-plans/bible-reading-plans-class.inc.php(1681): BibleReadingPlans->add_date_picker_ui() #1 /path/to/sitename.com/public/wp-content/plugins/bible-reading-plans/bible-reading-plans-class.inc.php(1982): BibleReadingPlans->date_picker() #2 /path/to/sitename.com/public/wp-content/plugins/bible-reading-plans/bible-reading-plans-class.inc.php(1103): BibleReadingPlans->get_bible_reading_plan() #3 /path/to/sitename.com/public/wp-includes/class-wp-hook.php(324): BibleReadingPlans->putBibleReadingPlan() #4 /path/to/sitename.com/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #5 /path/to/sitename.com/public/wp-includes/pl" while reading response header from upstream, client: 104.190.135.127, server: sitename.com, request: "GET /wp-admin/admin-ajax.php?action=put_bible_reading_plan&language_code=ENG&reading_plan=through-the-bible&version=ESV&source=ESV&requested_date=Mon%20Nov%2011%202024&device_screen_width=1920 HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.0-fpm.sock:", host: "sitename.com", referrer: "https://sitename.com/bible-reading/" My test site ( https://test-brp.saesolved.com/ ) uses PHP 8.3. The plugin seems to be working alright there. So, I’m unsure of what is causing that error. Are you using the latest version of the plugin? Hmm, yes I am using version 3.0.3 with WordPress 6.6.2. The log for the error indicates that it originates at line 1204 of bible-reading-plans-class.inc.php : $language_name = $this->dbp_versions[$this->lng_code_iso][0]['language_name']; Is it possible that $this->dbp_versions[$this->lng_code_iso][0] is returning a string rather than an array? I’m not sure how to troubleshoot it but it definitely works in PHP 7.4 but not in 8 for me. Mike, That’s super helpful that posting that. I’ll need to investigate. It may be that the API is returning an error, instead of an array. As to PHP 7 vs 8, I know that handling in this area is something that changed, so assume there’s an error, and I’ll try to get the code to surface this error. Have you tried the Bible Brain API? We had someone else recently have a problem with the esv api. Mike, I’m still looking into this. I realized I didn’t have an ESV api key, so am obtaining one to get this resolved for you. It’s also possible that if you switched off the date picker, it would probably work in PHP 8, but as Dr Mike said, it does work in 8 with the picker switched on. Mike, We have resolved this issue in 3.0.4.

Comments

6 shown
drmikegreen 2024-11-11T21:59:00+00:00

My test site ( https://test-brp.saesolved.com/ ) uses PHP 8.3. The plugin seems to be working alright there. So, I’m unsure of what is causing that error. Are you using the latest version of the plugin?

mikefolsom 2024-11-11T23:09:00+00:00

Hmm, yes I am using version 3.0.3 with WordPress 6.6.2. The log for the error indicates that it originates at line 1204 of bible-reading-plans-class.inc.php : $language_name = $this->dbp_versions[$this->lng_code_iso][0]['language_name']; Is it possible that $this->dbp_versions[$this->lng_code_iso][0] is returning a string rather than an array? I’m not sure how to troubleshoot it but it definitely works in PHP 7.4 but not in 8 for me.

Dave Smith 2024-11-13T15:02:00+00:00

Mike, That’s super helpful that posting that. I’ll need to investigate. It may be that the API is returning an error, instead of an array. As to PHP 7 vs 8, I know that handling in this area is something that changed, so assume there’s an error, and I’ll try to get the code to surface this error. Have you tried the Bible Brain API? We had someone else recently have a problem with the esv api.

Dave Smith 2024-11-15T20:26:00+00:00

Mike, I’m still looking into this. I realized I didn’t have an ESV api key, so am obtaining one to get this resolved for you.

Dave Smith 2024-11-15T20:27:00+00:00

It’s also possible that if you switched off the date picker, it would probably work in PHP 8, but as Dr Mike said, it does work in 8 with the picker switched on.

Dave Smith 2025-01-20T15:40:00+00:00

Mike, We have resolved this issue in 3.0.4.