Hello,
In my case I am basically trying the plugin on my own-developed theme, which is at the moment really basic.
I have WordPress 5.6 installed and the deprecation notices show up:
Deprecated: Required parameter $thumbnail follows optional parameter $public_options in C:\xampp\htdocs\wordpress\wp-content\plugins\wordpress-popular-posts\src\Output.php on line 88
Deprecated: Required parameter $translate follows optional parameter $public_options in C:\xampp\htdocs\wordpress\wp-content\plugins\wordpress-popular-posts\src\Output.php on line 88
Deprecated: Required parameter $themer follows optional parameter $public_options in C:\xampp\htdocs\wordpress\wp-content\plugins\wordpress-popular-posts\src\Output.php on line 88
Deprecated: Required parameter $rating follows optional parameter $data in C:\xampp\htdocs\wordpress\wp-content\plugins\wordpress-popular-posts\src\Output.php on line 789
I am not using AMP, I am basically using no plugins at all.
The only plugin used is this one.
It seems to come from new PHP requirements, especially from PHP 8.0.
Copied and pasted here:
When declaring a function or a method, adding a required parameter after optional parameters is deprecated since PHP 8.0.
I applied the following solution. Instead of this line of code:
public function __construct(array $public_options = [], array $admin_options = [], Image $thumbnail, Translate $translate, \WordPressPopularPosts\Themer $themer)
{ .. }
I used this one:
public function __construct(array $public_options = null, array $admin_options = null, Image $thumbnail, Translate $translate, \WordPressPopularPosts\Themer $themer)
{ .. }
The same applies to the line of code number 789. However, I coudn’t make it work. So, since it is called just once, I change the order of the parameters and now it works.
Maybe it’s worth changing the parameters from their place to other within the interface of the function.
I hope this helps.
Great job with this plugin.
Regards,
Alicia