WordPress recommendations for the register_activation_hook
hook are:
- Don’t do
echo
directly in theregister_activation_hook
callback function. Do it other hooks likeinit
oradmin_init
- Make sure you are closing the PHP tag
?>
. Otherwise, you will get theHeader already sent notifications
.
I have tested your code, I think you are closing the PHP tag ?>
at the end of the file.
Related Posts:
- No Error Log File, no debug info
- How should one implement add_settings_error on custom menu pages?
- Prevent notice and warnings in error_reporting?
- How to log plugin errors to plugin error_log file
- Catch own Exceptions
- Throw 403 in a plugin [duplicate]
- why don’t I get error messages in admin when developing?
- WP_Error handles errors, but how can I show success with a message?
- Settings API – Undefined Index when unchecking checkbox
- Error : “Updating failed: The response is not a valid JSON response” with custom shortcode
- How can I display an error message after post has been saved?
- Execution limit and Memory limit errors even i changed to 1024M and 600(cache.php,load.php)?
- Proper way to pass credentials in a custom login form to avoid “headers already sent”
- Two functions utilizing registration_errors filter
- How can I gracefully escape an error condition?
- WordPress debug messages not displaying
- Custom Post Type Object – Undefined Variables
- Reporting errors in a shortcode plugin
- What might be the reason of Couldn’t fetch mysqli_result on another domain?
- Plugin can’t be activated [closed]
- How do I debug an error that a plugin is causing?
- Need Help Determining Where Header Error is Happening
- “Rendering of admin template [path to template] failed”
- Is there any way to pass messages from a script to a redirect target in a hidden fashion?
- Import images remotly run through timeout error
- Error code when migrate
- WPGut – Updating failed and shortcode?
- GET request return value as error instead of success
- WP_Fatal_Error_Handler OR WP_Error OR try/catch
- Custom Plugin activation error in Multisite
- Warning: Illegal string offset – on homepage
- Plugin error on activation – breaks page encoding and prints the code of plugin php files
- Getting error of unexpected output during activation
- Trying to build a plugin – Cannot modify header information
- WordPress custom block error: Content generated by `save` function triples
- Objective Best Practices for Plugin Development? [closed]
- add_menu_page() with different name for first submenu item
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- How to include PHP files in plugins the correct way
- How can I add an image upload field directly to a custom write panel?
- A tool to analyze rewrite rules? [closed]
- Difference Between Filter and Action Hooks?
- framework for plugin/theme options panel? [closed]
- Creating a table in the admin-style?
- How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page?
- Settings API with arrays example
- How to get the path to the current theme?
- How to make a plugin require another plugin?
- ajaxurl not defined on front end
- What process do you use for WordPress development? [closed]
- What’s the difference between term_id and term_taxonomy_id
- Should I use wpdb prepare?
- Why does WordPress use outdated jQuery v1.12.4?
- Post meta vs separate database tables
- Is there any plugin development framework
- Is it possible to reuse wp.media.editor Modal for dialogs other than media
- How to add a javascript snippet to the footer that requires jQuery
- Enhance Media Manager for Gallery
- How do I create a custom role capability?
- How do I add CSS options to my plugin without using inline styles?
- How do i best handle custom plugin page actions?
- Adding Custom Text Patterns in the WP 4.5 Visual Editor
- Automatically determine minimum WordPress version required for a plugin?
- What is the advantage of using wp_mail?
- How to make a WordPress plugin translation ready?
- How many times will this code run? (or, how rich is grandma?)
- How to create an API for my plugin?
- Is it ever okay to include inline CSS in plugins?
- Plugins in symlinked directories?
- How to override existing plugin action with new action
- How to include a file using get_template_part() in a plugin?
- Add custom TinyMCE 4 Button, Usable since WordPress 3.9-beta1
- How to store username and password to API in wordpress option DB?
- body_class hook for admin pages
- “Error: Options Page Not Found” on Settings Page Submission for an OOP Plugin
- Is it mandatory to use $wpdb->prefix in custom tables
- Which hook should be used to add an action containing a redirect?
- add_action hook for completely new post?
- Why does WordPress add 0 (zero) to an Ajax response?
- What should I use instead of WP_CONTENT_DIR and WP_PLUGIN_DIR?
- How to enqueue JavaScripts in a plugin
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- Plugin Form Submission Best Practice
- How to redirect to settings page once the plugin is activated?
- Is get_option function cached?
- Should Plugin Folders Include a Blank index.php File?
- Unit testing for plugin development
- Methods of Integrating Plugin Data with Themes
- What is the wordpress wp-includes folder for?
- WordPress Update Plugin Hook/Action? Since 3.9
- How to include jQuery and JavaScript files correctly?
- How come `wp_options` table does not have an index on `autoload`?
- PHP error with shortcode handler from a class
- Update Option Stored in Multi-Dimensional Array
- check if Gutenberg is currently in use
- Best way to abort plugin in case of insufficient PHP version?
- WordPress Plugin Development – Headers Already Sent Message
- WP 3.3 How to Add Menu Items to the Admin Bar?
- dbDelta not creating tables
- Custom Widget function in Plugin not working?