• I’m seeing the following errors related to json_decode. Based on the other threads about PHP 8 compatibility, this shouldn’t be an issue anymore? I tried switching my site back to PHP 7.4 but I’m still seeing a similar error there.

    Zotpress Plugin Version: 7.3.7
    WordPress Version: 6.4.1

    With PHP 7.4.33:
    AH01071: Got error ‘PHP message: PHP Warning: json_decode() expects parameter 1 to be string, object given in /path/to/httpdocs/wp-content/plugins/zotpress/lib/shortcode/shortcode.request.php on line 340PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /path/to/httpdocs/wp-content/plugins/zotpress/lib/shortcode/shortcode.request.php on line 403’, referer: https://domain.de/wp-admin/admin.php?page=Zotpress

    With PHP 8.1.26:
    AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught TypeError: json_decode(): Argument #1 ($json) must be of type string, WpOrg\Requests\Utility\CaseInsensitiveDictionary given in /path/to/httpdocs/wp-content/plugins/zotpress/lib/shortcode/shortcode.request.php:340\nStack trace:\n#0 /path/to/httpdocs/wp-content/plugins/zotpress/lib/shortcode/shortcode.request.php(340): json_decode()\n#1 /path/to/httpdocs/wp-includes/class-wp-hook.php(324): Zotpress_shortcode_request()\n#2 /path/to/httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()\n#3 /path/to/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action()\n#4 /path/to/httpdocs/wp-admin/admin-ajax.php(188): do_action()\n#5 {main}\n thrown in /path/to/httpdocs/wp-content/plugins/zotpress/lib/shortcode/shortcode.request.php on line 340’, referer: https://domain.de/wp-admin/admin.php?page=Zotpress

    The same thing happens if I view the relevant frontend page. I’m not actually sure when this problem started as I only noticed it after clearing the cache in the plugin settings. Apparently it was happily using the cached data up until now.

    The shortcode I’m using:
    [zotpress userid="12345" collection="1234ABCD" sortby="date" order="desc" cite="yes" target="new"]

  • The topic ‘More PHP issues’ is closed to new replies.