Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbPress Advanced Statistics v1.5


  • Chuckie
    Participant

    @ajtruckle

    Recently upgraded to WP 6.1 and this plugin bbPress Advanced Statistics gives deprecation warnings when I have debug mode enabled:

    The official website for the plugin seems dead now.

    The warnings:

    Deprecated: Required parameter $version follows optional parameter $file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/wp-content/plugins/bbpress-improved-statistics-users-online/includes/core/class.utils.php on line 25 
    Deprecated: Required parameter $version follows optional parameter $file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/wp-content/plugins/bbpress-improved-statistics-users-online/includes/core/class.utils.php on line 64 
    Deprecated: Required parameter $version follows optional parameter $file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/wp-content/plugins/bbpress-improved-statistics-users-online/includes/core/class.statistics.php on line 153 
    Deprecated: Required parameter $version follows optional parameter $file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/wp-content/plugins/bbpress-improved-statistics-users-online/includes/core/class.statistics.php on line 332 
    Deprecated: Required parameter $version follows optional parameter $file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/wp-content/plugins/bbpress-improved-statistics-users-online/includes/core/class.activity.php on line 98 
    Deprecated: Required parameter $version follows optional parameter $file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/wp-content/plugins/bbpress-improved-statistics-users-online/includes/public/class.online.php on line 86 
    Deprecated: Required parameter $version follows optional parameter $file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/wp-content/plugins/bbpress-improved-statistics-users-online/includes/public/class.extras.php on line 47

    One example:

        public function __construct ( $file = '', $version ) {
            
            $this->init();
    
        } // End __construct ()

    I understand what it means, and I see that the parameter is ot used in the function. Dos that mean we just delete the parameter?

    Another example:

        public static function instance ( $file = '', $version ) {
            if ( is_null( self::$_instance ) ) {
                    self::$_instance = new self( $file, $version );
            }
            return self::$_instance;
        } // End instance ()

    Problem here is that the version value is being used.

    Advice appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)

  • Chuckie
    Participant

    @ajtruckle

    I noticed for another plug-in with similar issue it said:

    PHP8.0 has deprecated the use of optional parameters before required parameters.
    When running this plugin on a website that runs PHP8.0 or higher, there is constant stream of errors about this.

    I confirm I am using PHP8.


    Chuckie
    Participant

    @ajtruckle

    I see:

    https://stackoverflow.com/q/65297279/2287576

    I think easiest is to drop the defaultness of first parameter in function declaration.


    Robin W
    Moderator

    @robin-w

    I don’t have a copy of this plugin, but given that calling these functions does by necessity involve specifying all the variables, I’d suggest you simply take out the='' in the function where it is erroring.

    so in your example change

    public function __construct ( $file = '', $version ) {

    to

    public function __construct ( $file, $version ) {

    and do this for all the ones erroring


    Chuckie
    Participant

    @ajtruckle

    Hi Robin

    That sems to have done the trick!


    Robin W
    Moderator

    @robin-w

    🙂

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