2017 © Pedro Peláez
 

library wp-package-parser

image

tutv95/wp-package-parser

  • Monday, June 4, 2018
  • by tutv95
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

WP Package Parser Travis GitHub issues GitHub license

A PHP library for parsing WordPress plugin and theme metadata. Point it at a ZIP package and it will:, (*1)

  • Tell you whether it contains a plugin or a theme.
  • Give you the metadata from the comment header (Version, Description, Author URI, etc).
  • Parse readme.txt into a list of headers and sections.
  • Convert readme.txt contents from Markdown to HTML.

Installation

Include wp-package-parser.php or install the composer package., (*2)

Basic usage

Extract plugin metadata:

require 'wp-package-parser/wp-package-parser.php';
$package = new Max_WP_Package('/var/path/plugin.zip');
print_r($package->get_metadata());

Sample output:, (*3)

Array
(
    [name] => Hello Dolly
    [plugin_uri] => https://wordpress.org/plugins/hello-dolly/
    [version] => 1.6
    [description] => This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from Hello, Dolly in the upper right of your admin screen on every page.
    [author] => Matt Mullenweg
    [author_profile] => http://ma.tt/
    [text_domain] => hello-dolly
    [domain_path] => 
    [network] => 
    [plugin] => hello-dolly/hello.php
    [contributors] => Array
        (
            [0] => matt
        )

    [donate] => 
    [tags] => Array
        (
        )

    [requires] => 4.6
    [tested] => 4.7
    [stable] => 1.6
    [short_description] => This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong.
    [sections] => Array
        (
            [description] => 
This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from Hello, Dolly in the upper right of your admin screen on every page.


        )

    [readme] => 1
    [slug] => hello-dolly
)

Extract theme metadata:

require 'wp-package-parser/wp-package-parser.php';
$package = new Max_WP_Package('/var/path/theme.zip');
print_r($package->get_metadata());

Sample output:, (*4)

Array
(
    [name] => Twenty Sixteen
    [theme_uri] => https://wordpress.org/themes/twentysixteen/
    [description] => Twenty Sixteen is a modernized take on an ever-popular WordPress layout — the horizontal masthead with an optional right sidebar that works perfectly for blogs and websites. It has custom color options with beautiful default color schemes, a harmonious fluid grid using a mobile-first approach, and impeccable polish in every detail. Twenty Sixteen will make your WordPress look beautiful everywhere.
    [author] => the WordPress team
    [author_uri] => https://wordpress.org/
    [version] => 1.3
    [template] => 
    [status] => 
    [tags] => Array
        (
            [0] => one-column
            [1] => two-columns
            [2] => right-sidebar
            [3] => accessibility-ready
            [4] => custom-background
            [5] => custom-colors
            [6] => custom-header
            [7] => custom-menu
            [8] => editor-style
            [9] => featured-images
            [10] => flexible-header
            [11] => microformats
            [12] => post-formats
            [13] => rtl-language-support
            [14] => sticky-post
            [15] => threaded-comments
            [16] => translation-ready
            [17] => blog
        )

    [text_domain] => twentysixteen
    [domain_path] => 
    [slug] => twentysixteen
)

Requirements

PHP 5.4., (*5)

Credits

Partially based on plugin header parsing code from the WordPress core., (*6)

The Versions

04/06 2018

dev-develop

dev-develop

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

19/06 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

19/06 2017

1.0.4

1.0.4.0

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

19/06 2017

1.0.3

1.0.3.0

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

19/06 2017

dev-revert/89e1b21fe75886a540c4bef6761b34449d8c014e

dev-revert/89e1b21fe75886a540c4bef6761b34449d8c014e

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

19/06 2017

dev-add-code-of-conduct-1

dev-add-code-of-conduct-1

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

19/06 2017

1.0.2

1.0.2.0

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

19/06 2017

dev-release/1.0.2

dev-release/1.0.2

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

16/06 2017

dev-feature/improve

dev-feature/improve

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

16/06 2017

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

16/06 2017

dev-feature/composer

dev-feature/composer

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

16/06 2017

dev-feature/metadata

dev-feature/metadata

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires

16/06 2017

1.0.0

1.0.0.0

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires