• Resolved mikefolsom

    (@mikefolsom)


    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/"
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author drmikegreen

    (@drmikegreen)

    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?

    Thread Starter mikefolsom

    (@mikefolsom)

    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.

    Plugin Author Dave Smith

    (@sophoservices)

    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.

    Plugin Author Dave Smith

    (@sophoservices)

    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.

    Plugin Author Dave Smith

    (@sophoservices)

    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.

    Plugin Author Dave Smith

    (@sophoservices)

    Mike, We have resolved this issue in 3.0.4.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.