Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ryanjbonnell opened this issue Oct 14, 2013 · 2 comments
Open

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

ryanjbonnell opened this issue Oct 14, 2013 · 2 comments

Comments

@ryanjbonnell
Copy link

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

Strict Standards: Non-static method NS_TMO_Plugin::get_instance() 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
Copy link

jb510 commented Oct 22, 2013

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

@jb510
Copy link

jb510 commented Oct 31, 2013

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 () {tostatic public function get_instance () {``

Will suppress the error.

jdoubleu pushed a commit to jdoubleu/Term-Menu-Order that referenced this issue Mar 24, 2016
The singleton `get_instance` function caused warnings in PHP strict mode.
For more see here: billerickson/Term-Menu-Order#3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants