I've been trying to create a small plugin to do some basic tasks on my website. I created the plugin which was initially working fine, I made no changes and for some reason it no longer works.

Here is the code for my main file:

 * Plugin Name: Project Keefa


class AdminBMS {

    function register() {

    function add_admin_pages() {
        add_menu_page('Admin Business Management System','AdminBMS','manage_options','adminbms',array($this,'admin_index'),'dashicons-feedback', 99);

    function admin_index() {
        echo plugin_dir_path( __FILE__) . 'inc/activate.php';
        require_once plugin_dir_path(__FILE__) . 'templates/admin.php';

    function enqueue() {


if (class_exists('AdminBMS')) {
    $adminBMS = new AdminBMS();

// Activation
require_once plugin_dir_path( __FILE__) . 'inc/activate.php';
register_activation_hook( __FILE__, array( 'AdminBMSActivate', 'activate' ) );

// Deactivation
require_once plugin_dir_path( __FILE__) . 'inc/deactivate.php';
register_deactivation_hook( __FILE__, array( 'AdminBMSDeactivate', 'deactivate' ) );

Activate (inc/activate.php)


class AdminBMSActivate {
    public static function activate() {

Deactivate (inc/deactivate.php)


class AdminBMSDeactivate {
    public static function deactivate() {

Admin Index (templates/admin.php

<h1>Admin Test</h1>

I am getting the following errors. I've been trying to debug for the past 2 hours, so any help is appreciated! I've tried 644 and 755 permissions on the files too.

Warning: require_once(/home/runcloud/webapps/wordpress/wp-content/plugins/project-keefa/inc/activate.php): failed to open stream: Permission denied in /home/runcloud/webapps/wordpress/wp-content/plugins/project-keefa/project-keefa.php on line 43

Fatal error: require_once(): Failed opening required '/home/runcloud/webapps/wordpress/wp-content/plugins/project-keefa/inc/activate.php' (include_path='.:') in /home/runcloud/webapps/wordpress/wp-content/plugins/project-keefa/project-keefa.php on line 43
  • You have to set same owner of the file activate.php as owner of main plugin file. – KAGG Design May 18 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.