shahariaazam/wp-rank-checker

Check ranks for your plugins or themes with specific keyword and check how your plugins and themes are growing in WordPress public repository.

v1.0 2020-06-03 20:21 UTC

This package is auto-updated.

Last update: 2024-10-29 05:23:13 UTC


README

Code Checks Build Code Coverage Code Rating Code Intellegence

Check ranks for your plugins or themes with specific keyword and check how your plugins and themes are growing in WordPress public repository. This library will calculate the search result ranking from WordPress.org plugin repository search page.

Installation

You can add this as a composer package. So to add this package in your application, just run the following command.

composer require shahariaazam/wp-rank-checker

Usage

Easy to use. Following code snippet will give you an idea about how to get ranking position of any specific plugin for any specific keyword.

<?php

use Http\Adapter\Guzzle6\Client;
use ShahariaAzam\WPRankChecker\RankChecker;
use ShahariaAzam\WPRankChecker\RankCheckerException;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;

require "vendor/autoload.php";

$httpClient = new Client();
$cacheProvider = new FileSystemAdapter();

$rankChecker = new RankChecker($httpClient, $cacheProvider);

try {
    $result = $rankChecker
        ->setKeyword("mail")
        ->checkRanks();

    // Get rank of your plugins for keyword "mail"
    print_r($result->getRankBySlug('wp-mail-gateway')); // will return integer

    print_r($result->getResults()); // will return a list of all plugins with search result position
} catch (RankCheckerException $e) {
    echo $e->getMessage();
}

Issues

If you find any issues, please create an issue from here

Contribution

Any kinds of help to improve this library is welcome. Do something amazing and open a PR. I would be happy to review and merge.

Contributor

Full list of contributors can be found from here