Skip to content

Calls enableMustUsePlugin as an instance method #75

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

Merged
merged 1 commit into from
Feb 20, 2019

Conversation

ffflabs
Copy link

@ffflabs ffflabs commented Feb 20, 2019

Currently, the default value for the enable_must_use_plugin setting is obtained as

'default'      => \Rollbar\Wordpress\Defaults::enableMustUsePlugin(),

'type' => UI::getSettingType('enable_must_use_plugin'),
'default' => \Rollbar\Wordpress\Defaults::enableMustUsePlugin(),
'description' => __('Allows Rollbar plugin to be loaded as early ' .

But enableMustUsePlugin is an instance method, as shown on:

public function enableMustUsePlugin()
{
return false;
}

So it throws a deprecation warning:

PHP Deprecated:  Non-static method Rollbar\Wordpress\Defaults::enableMustUsePlugin() 
should not be called statically  in 
/var/www/blog.example.com/wp-content/plugins/rollbar/src/Settings.php on line 207

In this PR I'm fixing said warning by using:

'default'      => \Rollbar\Wordpress\Defaults::instance()->enableMustUsePlugin(),

I hope it helps.

@jessewgibbs
Copy link

@amenadiel thanks for the PR.

@ArturMoczulski can you review when you get a chance?

@ArturMoczulski ArturMoczulski merged commit fc2a0fd into rollbar:master Feb 20, 2019
@ArturMoczulski
Copy link

@amenadiel great. thanks for catching this. releasing now as 2.5.1

@ffflabs ffflabs deleted the patch-static-muplugin branch February 21, 2019 05:51
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 this pull request may close these issues.

3 participants