josantonius/wp_plugin-info

Get and save plugin information from WordPress API to be consumed by other modules.


Keywords
php, plugin, wordpress, component, info, hhvm, Eliasis, WordPress-API, eliasis-plugin, wordpress-plugin, wp-plugin
License
GPL-2.0+

Documentation

WP Plugin Info · Eliasis module

Latest Stable Version Total Downloads Latest Unstable Version License Travis

Versión en español

Get and save plugin information from WordPress API to be consumed by other modules.



Installation

Install plugin module from Composer. In the root folder of plugin run:

$ composer require Josantonius/WP_Plugin-Info

The previous command will only install the necessary files, if you prefer to download the entire source code (including tests, vendor folder, sass files, docs...) you can use:

$ composer require Josantonius/WP_Plugin-Info --prefer-source

Or you can also clone the complete repository with Git:

$ git clone https://github.com/Josantonius/WP_Plugin-Info.git

Requirements

This pluggin is supported by PHP versions 5.6 or higher and is compatible with HHVM versions 3.0 or higher.

Usage

Get plugin information:

<?php
use Eliasis\Complement\Type\Plugin\Plugin;

$Info = Plugin::WP_Plugin_Info()->instance('Info');
$name = $Info->get('name', 'plugin-slug'); //string
$slug = $Info->get('slug', 'plugin-slug'); //string
$version = $Info->get('version', 'plugin-slug'); //string
$author = $Info->get('author', 'plugin-slug'); //string
$author_profile = $Info->get('author_profile', 'plugin-slug'); //string
$contributors = $Info->get('contributors', 'plugin-slug'); //array
$requires = $Info->get('requires', 'plugin-slug'); //string
$tested = $Info->get('tested', 'plugin-slug'); //string
$compatibility = $Info->get('compatibility', 'plugin-slug'); //array
$rating = $Info->get('rating', 'plugin-slug'); //int
$ratings = $Info->get('ratings', 'plugin-slug'); //array
$num_ratings = $Info->get('num_ratings', 'plugin-slug'); //int
$support_threads = $Info->get('support_threads', 'plugin-slug'); //int
$support_threads_resolved = $Info->get('support_threads_resolved', 'plugin-slug'); //int
$downloaded = $Info->get('downloaded', 'plugin-slug'); //int
$last_updated = $Info->get('last_updated', 'plugin-slug'); //string
$added = $Info->get('added', 'plugin-slug'); //string
$homepage = $Info->get('homepage', 'plugin-slug'); //string
$download_link = $Info->get('download_link', 'plugin-slug'); //string
$tags = $Info->get('tags', 'plugin-slug'); //array
$donate_link = $Info->get('donate_link', 'plugin-slug'); //string

Tests

To run tests simply:

$ git clone https://github.com/Josantonius/WP_Plugin-Info.git

$ cd WP_Plugin-Info

$ bash bin/install-wp-tests.sh wordpress_test root '' localhost latest

$ phpunit

☑ TODO

  • Create tests
  • Improve documentation

Contribute

  1. Check for open issues or open a new issue to start a discussion around a bug or feature.
  2. Fork the repository on GitHub to start making your changes.
  3. Write one or more tests for the new feature or that expose the bug.
  4. Make code changes to implement the feature or fix the bug.
  5. Send a pull request to get your changes merged and published.

This is intended for large and long-lived objects.

License

This project is licensed under GPL-2.0+. See the LICENSE file for more info.

Copyright

2017 Josantonius, josantonius.com

If you find it useful, let me know 😉

You can contact me on Twitter or through my email.