bradyvercher / gistpress

WordPress plugin to add Gist oEmbed and shortcode support with caching.
GNU General Public License v2.0
143 stars 28 forks source link

Fatal error: Uncaught Error: Call to a member function set_logger() #72

Closed robneu closed 7 years ago

robneu commented 7 years ago

When using WP-CLI on a PHP 7 Pagely VPS the above error error causes WP-CLI to fail completely.

Possible Solution

Checking $gistpress instanceof GistPress in gistpress_init seems to resolve the issue.

Your Environment

bradyvercher commented 7 years ago

Looks good to me. I'll try to merge and release a new version this afternoon or tomorrow.

GaryJones commented 7 years ago

In what circumstance is this error being triggered? How is gistpress_init() being called without the global being populated without it being an instance of GistPress?

robneu commented 7 years ago

It happens when attempting to run any WP-CLI command on a box running PHP 7+. The only way I was able to avoid it was to tell WP-CLI to skip loading plugins.

I haven't investigated any further than that.