Skip to content

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