H
H
HolmesInc2015-10-16 22:30:05
WordPress
HolmesInc, 2015-10-16 22:30:05

How to fix an error when activating the plugin?

Good day!
I'm trying to learn the basics of creating plugins for Wordpress, but I ran into this error when I activate the planig:
"Plugin produced 325 characters of unexpected output when activated. If you notice a "headers already sent" error, problems with RSS feeds, or other problems, try deactivating or remove this plugin."
Actually, I tried to google, various options like "change the encoding to UTF-8 without BOM" did not help. The funny thing is that even if the plugin only leaves the table of contents (plugin description), the error will not disappear. The engine is based on Denver, Wordpress version 4.1.3
Kod:

<?php
/*
Plugin Name: Category Adder
Plugin URI: http://wp-example.com
Description: This plugin add new category
Author: Andrew 
Version: 1.0
Author URI: 
*/

register_activation_hook(__FILE__, 'activate_options');

register_deactivation_hook(__FILE__, 'deactivate_options');

add_action('admin_menu', 'plugin_setting_menu_item');

function plugin_setting_menu_item() 
{
    add_options_page('RDolls Category Adder', 'RDolls Category Setting', 8, __FILE__, 'plugin_setting_page');
}

function plugin_setting_page()
{
  
}
?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2015-10-17
@HolmesInc

one.

register_activation_hook(__FILE__, 'activate_options');

respectively searches and does not find - warning one
2.
add_options_page('RDolls Category Adder', 'RDolls Category Setting', 8, __FILE__, 'plugin_setting_page');

The use of levels is considered obsolete since the time of the king of peas. Gotta seize the opportunity, that's how
3. If you do not use any debuggers, at least look at the server logs, it will be much easier to live

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question