I am trying to create a plugin in my WP local and it does not appear in the plugin installed

What issue or error are you experiencing?

I am trying to build a custom menu (I called it Best Menu).
I have already tried several troubleshooting steps:

  1. Check the Plugin Header Information

Make sure that the plugin header information in your 3d-interactive-menu.php file is correctly formatted. It should look like this:

php

Copia codice

<?php
/**
 * Plugin Name: Best Menu
 * Plugin URI: http://example.com
 * Description: A custom menu plugin for WordPress.
 * Version: 1.0
 * Author: Your Name
 * Author URI: http://example.com
 * License: GPL2
 */

Ensure that there are no typos, and the spacing is correct.

  1. File Permissions

Check the file permissions of the plugin folder and files. On Windows, make sure that:

  • The plugin folder (Best Menu) and the PHP files inside it are not marked as “Read-Only.”
  • You have the necessary permissions to read and execute the files.
  1. Check for Errors in wp-content/debug.log

Since you have enabled debugging in your wp-config.php, check the debug.log file in the wp-content directory. Look for any errors related to plugin loading, which might give clues about what’s going wrong.

  1. Plugin Folder Structure

Double-check that your plugin is located correctly:

  • The structure should be:

css

Copia codice

wp-content/
    plugins/
        Best Menu/
            3d-interactive-menu.php
            (any other necessary files)
  • Make sure that the Best Menu folder name matches exactly with what you have referenced in WordPress (case-sensitive).
  1. WordPress Version Compatibility

While you’re using WordPress 6.6.2, ensure your plugin code is compatible with this version. If you are using any deprecated functions or code, it could cause the plugin not to load.

  1. PHP Installation

Even though your LocalWP installation includes PHP, if there are global path issues with PHP on your system, it can lead to unexpected behavior. While LocalWP should manage this, you can try checking your PHP installation:

  • Check PHP in LocalWP: Go to LocalWP > Site > Overview > Check the PHP version used by your local site.
  • If it’s not configured, you may need to check LocalWP’s settings or reinstall it if necessary.
  1. Clear Cache

If you’re using any caching mechanism or if your browser is caching the dashboard, try:

  • Clearing your browser cache.
  • If you have a caching plugin active, clear its cache.
  1. Manual Activation

If everything seems fine but the plugin still doesn’t appear:

  • Temporarily rename the 3d-interactive-menu.php file to index.php and see if it appears.
  • Rename the Best Menu folder to something else (e.g., Best-Menu-Test) and check if it appears in the plugins list.
  1. Try with a Minimal Plugin

As a last resort, create a minimal plugin to check if it appears. Create a new folder, say Test Plugin, and inside it, create a file named test-plugin.php with the following content:

php

Copia codice

<?php
/**
 * Plugin Name: Test Plugin
 * Description: A test plugin to check if it appears.
 * Version: 1.0
 * Author: Your Name
 */

function test_plugin_function() {
    error_log('Test Plugin Loaded.');
}
add_action('init', 'test_plugin_function');

I really don’t know what else I can do to sort it out. Do you have any solution?

I don’t believe “Best Menu” can have spaces and the accepted format is all lowercase. I would change to “best-menu”.

FWIW this isn’t really an issue with Local.

2 Likes

Thank you @afragen! :green_heart:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.