Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8834541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:02:37+00:00 2026-06-14T09:02:37+00:00

WordPress plugins and themes have comments like these at the top: /** * @package

  • 0

WordPress plugins and themes have comments like these at the top:

/**
 * @package Akismet
 */
/*
Plugin Name: Akismet
Plugin URI: http://akismet.com/?return=true
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and trackback spam</strong>. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://akismet.com/get/?return=true">Sign up for an Akismet API key</a>, and 3) Go to your <a href="admin.php?page=akismet-key-config">Akismet configuration</a> page, and save your API key.
Version: 2.5.6
Author: Automattic
Author URI: http://automattic.com/wordpress-plugins/
License: GPLv2 or later
*/

And when you visit the plugins’ page in the admin interface, the plugins are listed like this:

screenshot-with-shadow.png http://img854.imageshack.us/img854/4526/screenshotwithshadow.png

Is that a standard syntax for documentation? I’m assuming it does a file_get_contents on the plugin files to read them, but how does WordPress parse that into manipulatable, standardized information to be used in PHP?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:02:38+00:00Added an answer on June 14, 2026 at 9:02 am

    See get_plugin_data() in wp-admin/includes/plugin.php for the WordPress parser.
    More specifically the extraction happens in get_file_data() of wp-includes/functions.php:

    function get_file_data( $file, $default_headers, $context = '' ) {
            // We don't need to write to the file, so just open for reading.
            $fp = fopen( $file, 'r' );
    
            // Pull only the first 8kiB of the file in.
            $file_data = fread( $fp, 8192 );
    
            // PHP will close file handle, but we are good citizens.
            fclose( $fp );
    
            // Make sure we catch CR-only line endings.
            $file_data = str_replace( "\r", "\n", $file_data );
    
            if ( $context && $extra_headers = apply_filters( "extra_{$context}_headers", array() ) ) {
                    $extra_headers = array_combine( $extra_headers, $extra_headers ); // keys equal values
                    $all_headers = array_merge( $extra_headers, (array) $default_headers );
            } else {
                    $all_headers = $default_headers;
            }
    
            foreach ( $all_headers as $field => $regex ) {
                    if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $ma
                            $all_headers[ $field ] = _cleanup_header_comment( $match[1] );
                    else
                            $all_headers[ $field ] = '';
            }
    

    There are similar implementations outside of WP. See How can plugin systems be designed so they don't waste so many resources? for an example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following WordPress plugin to send email. http://coffee2code.com/wp-plugins/configure-smtp/ I have done configuration,
I am running a plugin called Category Posts Widget for WordPress: http://wordpress.org/extend/plugins/category-posts/ It uses
I have a Wordpress blog at http://themes.visualise.ca/visualise and when a user clicks on a
I want to use AMember to have people purchase WordPress plugins and themes. However,
I have a wordpress website (buddypress plugin/themes). I'm using a plugin that requires access
I have been using wordpress plugins and I have customized one of my plugin
I'm using: jQuery Bubble Popup v.2.3.1 http://maxvergelli.wordpress.com/jquery-bubble-popup/ You are meant to have this in
How can I changing/ adding code of the Themes with a wordpress plugin? Example:
i have installed wordpress and i i have installed couple of plugins and i
I have to upgrade a running wordpress site's wordpress CMS and some installed plugins.and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.