[wp-hackers] "Plugin could not be activated because it triggered a fatal error." But what is the error?
James Nachlin
jnachlin at sixapart.com
Thu Mar 11 18:49:00 UTC 2010
Hi WP Hackers,
I am writing my first plugin (pasted below) using WP 2.9.2, PHP 5.2.11,
Apache/2.2.13 on OS X. I am accessing WordPress on localhost.
When I attempt to activate the plugin on the Manage Plugins screen of
the admin, I get "Plugin could not be activated because it triggered a
fatal error."
How can I view this fatal error?
I have set php.ini to "error_reporting = E_ALL".
I have turned on debug mode in my wp-config.php.
The plugin code is pasted below. It is trivial, but to get much further
I must be able to see what my errors are, because surely there will be
many more of them.
Thanks for your help!
-Jim
$ cat wp-content/plugins/jim-plugin/jim-plugin.php
<?php
/*
Plugin Name: Jim the Plugin
Plugin URI: http://localhost/~jnacho/
Description: This is Jim's first plugin
Version: 0.01
Author: James N
License: GPL2
*/
function widget($args, $instance) {
//extract( $args );
$title = apply_filters('Jimz Widget', $instance['title']);
?>
<?php echo $before_widget; ?>
<?php if( $title ) echo $before_title . $title . $after_title; ?>
Hello, Widget!
<?php echo $after_widget ?>
<?php
}
function stick_on_dashboard() {
wp_add_dashboard_widget('SomeWidget', 'Some Widget Jim', 'widget');
}
add_action('wp_dashboard_setup', 'stick_on_dashboard' );
?>
More information about the wp-hackers
mailing list