Floating Social - Non-static method Wdsb_PublicPages::serve() should not be called statically

I'm getting the following error message on every pageview. Can you assist?

Error message
Error: Non-static method Wdsb_PublicPages::serve() should not be called statically

Sample stack trace
… called at /home/hidden/public_html/wp-content/plugins/sharebox/
sharebox.php (78)
in include_once called at /home/hidden/public_html/wp-settings.php (273)
in require_once called at /home/hidden/public_html/wp-config.php (72)
in require_once called at /home/hidden/public_html/wp-load.php (39)
in require_once called at /home/hidden/public_html/wp-blog-header.php (13)
in require called at /home/hidden/public_html/index.php (17)

  • Vaughan

    Hi Davide,

    Hope you're well?

    This is just a strict notification & shouldn't affect the plugin working or not, however, I can replicate it too & it's always good to clear notifications up so I have reported this for the developer to look into, hopefully we can get these changed inthe next update.

    You should be able to hide them by adding the following to wp-config.php

    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );

    Hope this helps

  • Vaughan

    Hi,

    The 1st error

    Redefining already defined constructor for class Wdsb_PublicPages in /wp-content/plugins/sharebox/lib/class_wdsb_public_pages.php on line 11

    This can be fixed by editing the plugin code as follows:

    Open up & edit /wp-content/plugins/sharebox/lib/class_wdsb_public_pages.php

    Find & delete the following on line 9

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

    Do exactly the same in; /wp-content/plugins/sharebox/lib/class_wdsb_admin_pages.php

    Now in /wp-content/plugins/sharebox/sharebox.php

    Find the following (right near the end of the file);

    Wdsb_AdminPages::serve();
    } else {
    	require_once WDSB_PLUGIN_BASE_DIR . '/lib/class_wdsb_public_pages.php';
    	Wdsb_PublicPages::serve();
    }

    Replace the above with:

    $wdsbap = new Wdsb_AdminPages();
    	$wdsbap->serve();
    } else {
    	require_once WDSB_PLUGIN_BASE_DIR . '/lib/class_wdsb_public_pages.php';
        $wdsbpp = new Wdsb_PublicPages();
    	$wdsbpp->serve();
    }

    So the final if() looks like;

    if (is_admin()) {
    	require_once WDSB_PLUGIN_BASE_DIR . '/lib/class_wdsb_admin_form_renderer.php';
    	require_once WDSB_PLUGIN_BASE_DIR . '/lib/class_wdsb_admin_pages.php';
    
    	// Setup dashboard notices
    	if (file_exists(WDSB_PLUGIN_BASE_DIR . '/lib/wpmudev-dash-notification.php')) {
    		global $wpmudev_notices;
    		if (!is_array($wpmudev_notices)) $wpmudev_notices = array();
    		$wpmudev_notices[] = array(
    			'id' => 244,
    			'name' => 'Floating Social',
    			'screens' => array(
    				'settings_page_wdsb',
    				'settings_page_wdsb-network',
    			),
    		);
    		require_once WDSB_PLUGIN_BASE_DIR . '/lib/wpmudev-dash-notification.php';
    	}
        $wdsbap = new Wdsb_AdminPages();
    	$wdsbap->serve();
    } else {
    	require_once WDSB_PLUGIN_BASE_DIR . '/lib/class_wdsb_public_pages.php';
        $wdsbpp = new Wdsb_PublicPages();
    	$wdsbpp->serve();
    }

    The above should then fix the other notice.

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.