billerickson / Term-Menu-Order

Creates a 'menu_order' column to specify term order, allowing theme and plugin developers to sort term by menu order.
5 stars 4 forks source link

PHP 5.4 Strict Standards Error: Non-Static Method #3

Open ryanjbonnell opened 11 years ago

ryanjbonnell commented 11 years ago

Using PHP 5.4 with WP_DEBUG enabled, I get the following error:

Strict Standards: Non-static method NS_TMO_Plugin::getinstance() should not be called statically in /wp-content/plugins/term-menu-order/term-menu-order.php_ on line 63

This error did not appear when I was running PHP 5.3, but with PHP 5.4+ changing E_ALL to include E_STRICT2, I get this error in both the WordPress admin and the theme front-end.

Also, on plugin activation, I get a WordPress message that:

The plugin generated 252 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

I'm using Term Menu Order v0.4 and WordPress 3.6.1 with PHP v5.4.17.

jb510 commented 11 years ago

Came to report same warning w/ 5.4. FWIW, this isn't an error, it's just a notice. Still I hate notices...

jb510 commented 11 years ago

I didn't fork and pull request this, because frankly I'm not sure it's the "right" solution, but...

Changing line 110 in ns_tmo_plugin.class.php from `public function get_instance () { to static public function get_instance () {``

Will suppress the error.