Error: PHP Deprecated (php7)

Running my xampp with php7 and have this error in my php logs

[ 09-Sep-2016 11:01:13 UTC ] PHP Deprecated: Non-static method Wdcp_AdminPages::serve() should not be called statically in C:\xampp\htdocs\root.com\wp-content\plugins\comments-plus\comments-plus.php on line 81

line 81:
Wdcp_AdminPages::serve();

Not sure if this is related to comments + as I've a few errors for other plugins but this was listed below the above message!

[09-Sep-2016 11:01:13 UTC] PHP Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the "wp_enqueue_scripts","admin_enqueue_scripts", or "login_enqueue_scripts" hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in C:\xampp\htdocs\root.com\wp-includes\functions.php on line 3996

Had to change ` to " as it won't post the code
Dennis

  • Vaughan

    Hi Dennis,

    Hope you're well?

    To fix this you will need to edit the following files:

    Open up & edit /wp-content/plugins/comments-plus/lib/class_wdcp_admin_pages.php

    Find and Delete the following on line 10:

    function Wdcp_AdminPages () { $this->__construct(); }

    Find the following on or around line 22

    function serve () {

    replace with:

    public static function serve() {

    Open up & edit /wp-content/plugins/comments-plus/lib/class_wdcp_public_pages.php

    Find & delete the following on line 10

    function Wdcp_PublicPages () { $this->__construct(); }

    Find the following on or around line 29

    function serve () {

    Replace with:

    public static function serve() {

    Hopefully that should fix the errors :slight_smile:

    I can't tell if the other error is due to comments-plus.

    You will need to disable allother plugins & switch to default twentysixteen theme.

    Then navigate your site a few pages etc, and then check your logs again and see if that error still appears, if it does, then it's likely comments-plus, if not, then it could be another plugin. so you'd need to enable each plugin 1 at a time until the error returns again.

    Hope this helps