skip to Main Content
Plugin Development: Plugin Could Not Be Activated Because It Triggered A Fatal Error

When creating a plugin for WordPress it’s important to not only keep your files secure, but also discourage direct access to the files from browsers and other remote sources.

This is why it’s important to add a few lines of code to the top of each of your plugin’s files.

However, due to the simple nature of that code mistakes can happen if you’re handrolling code. For example:

If you don’t capitalize ‘ABSPATH’ you’ll end up with a blank (displayed AND/OR error logged) issue that you’ll likely spend too much time debugging.
Image of Plugin activation error display

Disclaimer

Maje Media LLC cannot be held responsible for the functionality of this code. Please make sure you test it on a development site before adding the code to your production website. There is no support available for this (and other) code snippet(s) posted on this website. If you’d like Maje Media to do custom development to help with your custom implementation please send a contact request.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top