Failed to Parse the Package Metadata: How to Fix

Table of Contents
    square-for-kb1
    access-to-phpmyadmin

    Typically, if you see “Failed to Parse the Package Metadata“, this is because you’ve probably created your own custom plugin and you’ve tried uploading it via:

    • Staq Panel of the site > Plugins > Add Plugin;
    • Staq Panel of the site > Theme > Add Theme
    • Bitbucket/Github integration via Staq Panel

    The cause of the issue relates the header metadata of a WordPress plugin/theme. Properly configuring these headers is essential for WordPress to recognize and handle the plugin appropriately.

    Correct plugin header metadata

    The following are best practice steps based on the official WordPress documentation to ensure you have the correct plugin header metadata:

    1. Plugin Name: This is a mandatory field. Make sure your plugin has a unique name specified that will be displayed in the WordPress Admin’s Plugins list.
    2. Plugin URI: This should be a unique URL, ideally on your own website, representing the homepage of the plugin. Remember, a WordPress.org URL is not acceptable here.
    3. Description: Keep a concise description (under 140 characters) for the plugin. This description is what appears in the Plugins section in the WordPress Admin.
    4. Version: Clearly mention the current version number of your plugin (e.g., 1.0 or 1.0.3).
    5. Requires at least: Specify the minimum WordPress version that your plugin supports.
    6. Requires PHP: State the minimum required PHP version for your plugin to operate.
    7. Author: List the name or names of the plugin’s authors. For multiple authors, separate their names with commas.
    8. Author URI: Provide a link to the author’s website or their profile on another platform, such as WordPress.org.
    9. License & License URI: Mention the short name of your plugin’s license (e.g., GPLv2). Also, provide a link to the full text of this license.
    10. Text Domain & Domain Path: If your plugin is to be translated or internationalized, it’s crucial to define the text domain and domain path correctly.
    11. Network: If your plugin can only be activated across a network, set this to true. If not needed, simply omit this field.
    12. Update URI: This is especially important to prevent third-party plugins from being accidentally overwritten during updates. Always specify a unique update URI for your plugin.

    Below is an example of a well-formatted plugin header:

    /*
     * Plugin Name:       My Basics Plugin
     * Plugin URI:        https://example.com/plugins/the-basics/
     * Description:       Handle the basics with this plugin.
     * Version:           1.10.3
     * Requires at least: 5.2
     * Requires PHP:      7.2
     * Author:            John Smith
     * Author URI:        https://author.example.com/
     * License:           GPL v2 or later
     * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
     * Update URI:        https://example.com/my-plugin/
     * Text Domain:       my-basics-plugin
     * Domain Path:       /languages
     */
    

    Always ensure that the header comment is placed at the top of your main plugin file. After making the necessary corrections to your plugin header, try activating the plugin again to see if the error is resolved.

    For more detailed information on WordPress plugin header requirements, visit the official WordPress documentation: WordPress Plugin Header Requirements.

    Try Staq
    Everything WordPress in one place. Simplify WordPress, streamline your flow
    square-for-kb3