I've been putting together a simple WordPress plugin that employs a sidebar widget and shortcode. One user has reported the following error when trying to activate the plugin on their local WP installation:
Plugin could not be activated because it triggered a fatal error.
Fatal error: Class 'Example_Widget' not found in /Applications/MAMP/htdocs/wordpress/wp-content/plugins/exampleplugin/exampleplugin.php on line 30
Here's the code in exampleplugin.php
, beginning with line 29:
$example_plugin = new Example_Plugin;
$example_widget = new Example_Widget;
class Example_Plugin {
...
}
I'm fairly new to OOP in PHP, and can't figure out what's causing a fatal error for this user. The plugin works fine for me, making this all the more mysterious.