• When I use this plugin in php8 I get “Fatal error”

    
    ### Nginx Log
    2021/02/18 00:35:57 [error] 13752#13752: *888 FastCGI sent in stderr: "PHP message: PHP Fatal error:  
    Uncaught TypeError: Unsupported operand types: string + int in /source/wp-content/plugins/bbpress-simple-view-counts/bbpress-simple-view-counts.php:95
    Stack trace:
    #0 /source/wp-includes/class-wp-hook.php(289): bbpress_simple_view_counts->show_views_topic_page()
    #1 /source/wp-includes/plugin.php(212): WP_Hook->apply_filters()
    #2 /source/wp-content/plugins/bbpress.new/includes/topics/template.php(3348): apply_filters()
    #3 /source/wp-content/plugins/bbpress.new/includes/topics/template.php(3278): bbp_get_single_topic_description()
    #4 /source/wp-content/plugins/bbpress.new/templates/default/bbpress/content-single-topic.php(33): bbp_single_topic_description()
    #5 /source/wp-includes/template.php(732): require('/source...')
    #6 /source/wp-content/plugins/bbpress.new/includes/core/template-functions.php(103): load_template()
    #7 /source/wp-conten" while reading response header from upstream, client: 192.168.0.1, 
       server: fedora.h2code.cf, request: "GET /forums/topic/23118 HTTP/2.0", 
       upstream: "fastcgi://unix:/run/php/php-fpm.sock:", host: "site.name"
    
    ### PHP-FPM Log
    [pool www] child 13731 said into stderr: "NOTICE: sapi_cgi_log_message(), line 611: PHP message: PHP Fatal error:  
    Uncaught TypeError: Unsupported operand types: string + int in /source/wp-content/plugins/bbpress-simple-view-counts/bbpress-simple-view-counts.php:95"
    
    [pool www] child 13731 said into stderr: "Stack trace:"
    [pool www] child 13731 said into stderr: "#0 /source/wp-includes/class-wp-hook.php(289): bbpress_simple_view_counts->show_views_topic_page()"
    [pool www] child 13731 said into stderr: "#1 /source/wp-includes/plugin.php(212): WP_Hook->apply_filters()"
    [pool www] child 13731 said into stderr: "#2 /source/wp-content/plugins/bbpress.new/includes/topics/template.php(3348): apply_filters()"
    [pool www] child 13731 said into stderr: "#3 /source/wp-content/plugins/bbpress.new/includes/topics/template.php(3278): bbp_get_single_topic_description()"
    [pool www] child 13731 said into stderr: "#4 /source/wp-content/plugins/bbpress.new/templates/default/bbpress/content-single-topic.php(33): bbp_single_topic_description()"
    [pool www] child 13731 said into stderr: "#5 /source/wp-includes/template.php(732): require('/source...')"
    [pool www] child 13731 said into stderr: "#6 /source/wp-content/plugins/bbpress.new/includes/core/template-functions.php(103): load_template()"
    [pool www] child 13731 said into stderr: "#7 /source/wp-conten..."
    

    95 line is

    $hitCount = $hitCount + 1;

    to

    $hitCount = (int)$hitCount + 1;

    Hope it helps someone

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Needs to be modified for php 8’ is closed to new replies.