├── .gitignore ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── composer.json ├── composer.lock └── php ├── WporgClient.php └── WporgService.php /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](http://keepachangelog.com/) 5 | and this project adheres to [Semantic Versioning](http://semver.org/). 6 | 7 | ## Unreleased 8 | 9 | ## 0.6 - 2022-06-20 10 | 11 | ### Added 12 | - minimum PHP 7.2.5 requirement 13 | 14 | ### Changed 15 | - dependencies (Guzzle 7, latest Guzzle Services) 16 | 17 | ### Removed 18 | - deprecated parts, related to older serialized API calls 19 | 20 | ## 0.5 - 2017-09-24 21 | 22 | ### Added 23 | - added explicit MIT license file 24 | 25 | ### Changed 26 | - updated plugins info to API version 1.1 27 | - updated themes info to API version 1.1 28 | - updated Browse Happy to API version 1.1 29 | - updated dependencies (Guzzle 6.3, Guzzle Services 1.1.2) 30 | 31 | ### Deprecated 32 | - serialized response model and to object/array helper methods 33 | 34 | ## 0.4 - 2017-07-04 35 | 36 | ### Added 37 | - support for Events API 38 | 39 | ## 0.3 - 2017-05-18 40 | 41 | ### Changed 42 | - restricted downloads history to API limit of 730 days 43 | 44 | ### Fixed 45 | - restricted services dependency version, breaks on 1.1 46 | 47 | ## 0.2 - 2016-11-24 48 | 49 | ### Changed 50 | - updated to Guzzle 6 with Services 1.0 51 | 52 | ## 0.1 - 2015-03-15 53 | 54 | ### Added 55 | - initial tagged release -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2014 Andrey Savchenko 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WPorg Client 2 | 3 | [![Current version](https://img.shields.io/packagist/v/rarst/wporg-client?label=version)](CHANGELOG.md) 4 | [![PHP required](https://img.shields.io/packagist/php-v/rarst/wporg-client)](composer.json) 5 | 6 | WPorg Client is a standalone HTTP client for public [WordPress.org API](http://codex.wordpress.org/WordPress.org_API). 7 | 8 | It aims to provide consistent centralized experience and is independent from WordPress core. 9 | 10 | ## Installation 11 | 12 | ```bash 13 | composer require rarst/wporg-client 14 | ``` 15 | 16 | ```php 17 | $wporgClient = \Rarst\Guzzle\WporgClient::getClient(); 18 | ``` 19 | 20 | ## Examples 21 | 22 | ### Core 23 | 24 | ```php 25 | $updates = $wporgClient->getUpdates(); 26 | $updatesFor = $wporgClient->getUpdates('4.0', 'en_US'); 27 | $translations = $wporgClient->getTranslations('4.1'); 28 | $credits = $wporgClient->getCredits('4.1'); 29 | $checksums = $wporgClient->getChecksums('4.1', 'en_US'); 30 | ``` 31 | 32 | ### Themes 33 | 34 | ```php 35 | $theme = $wporgClient->getTheme('twentyfifteen'); 36 | $translations = $wporgClient->getThemeTranslations('twentyfifteen', '1.0'); 37 | 38 | $popular = $wporgClient->getThemesBy('browse', 'popular'); 39 | $featured = $wporgClient->getThemesBy('browse', 'featured'); 40 | $new = $wporgClient->getThemesBy('browse', 'new'); 41 | $updated = $wporgClient->getThemesBy('browse', 'updated'); 42 | $search = $wporgClient->getThemesBy('search', 'twenty'); 43 | $tagged = $wporgClient->getThemesBy('tag', 'white'); 44 | $authors = $wporgClient->getThemesBy('author', 'wordpressdotorg'); 45 | 46 | $featureList = $wporgClient->getThemeFeatureList(); 47 | ``` 48 | 49 | ### Plugins 50 | 51 | ```php 52 | $plugin = $wporgClient->getPlugin('hello-dolly'); 53 | $stats = $wporgClient->getPluginStats('hello-dolly'); 54 | $downloads = $wporgClient->getPluginDownloads('hello-dolly', 7); 55 | $translations = $wporgClient->getPluginTranslations('akismet', '3.0'); 56 | 57 | $popular = $wporgClient->getPluginsBy('browse', 'popular'); 58 | $featured = $wporgClient->getPluginsBy('browse', 'featured'); 59 | $new = $wporgClient->getPluginsBy('browse', 'new'); 60 | $updated = $wporgClient->getPluginsBy('browse', 'updated'); 61 | $search = $wporgClient->getPluginsBy('search', 'dolly'); 62 | $tagged = $wporgClient->getPluginsBy('tag', 'widget'); 63 | $authors = $wporgClient->getPluginsBy('author', 'wordpressdotorg'); 64 | 65 | $importers = $wporgClient->getImporters(); 66 | $tags = $wporgClient->getHotTags(); 67 | ``` 68 | 69 | ### Events 70 | 71 | ```php 72 | $location = $wporgClient->getEvents(['location' => 'Seattle'])); 73 | $number = $wporgClient->getEvents(['location' => 'Australia', 'number' => 5])); 74 | $locale = $wporgClient->getEvents(['timezone' => 'Europe/Berlin', 'locale' => 'de_DE', 'location' => 'Dresden'])); 75 | $coordinates = $wporgClient->getEvents(['latitude' => '51.051', 'longitude' => '13.738'])); 76 | $ip = $wporgClient->getEvents(['ip' => '136.0.16.1'])); 77 | $country = $wporgClient->getEvents(['country' => 'IT'])); 78 | ``` 79 | 80 | ### Other 81 | 82 | #### Stats 83 | 84 | ```php 85 | $wordpress = $wporgClient->getStats('wordpress'); 86 | $php = $wporgClient->getStats('php'); 87 | $mysql = $wporgClient->getStats('mysql'); 88 | ``` 89 | 90 | #### Secret keys & salts 91 | 92 | ```php 93 | $secret = $wporgClient->getSalt(); 94 | ``` 95 | 96 | #### Browse happy 97 | 98 | ```php 99 | $browser = $wporgClient->getBrowser('Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.17'); 100 | ``` 101 | 102 | ## License 103 | 104 | MIT -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "rarst/wporg-client", 3 | "description": "Guzzle client for WordPress.org APIs", 4 | "license" : "MIT", 5 | "authors" : [ 6 | { 7 | "name" : "Andrey Savchenko", 8 | "homepage": "https://www.Rarst.net/" 9 | } 10 | ], 11 | "require" : { 12 | "php": "^7.2.5 || ^8", 13 | "guzzlehttp/guzzle-services": "^1.3.2" 14 | }, 15 | "autoload" : { 16 | "psr-4": { 17 | "Rarst\\Guzzle\\": "php/" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "92475d2dcaa7aba9193457d2ab65ebb0", 8 | "packages": [ 9 | { 10 | "name": "guzzlehttp/command", 11 | "version": "1.2.2", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/guzzle/command.git", 15 | "reference": "7883359e0ecab8a8f7c43aad2fc36360a35d21e8" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/guzzle/command/zipball/7883359e0ecab8a8f7c43aad2fc36360a35d21e8", 20 | "reference": "7883359e0ecab8a8f7c43aad2fc36360a35d21e8", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "guzzlehttp/guzzle": "^7.4.1", 25 | "guzzlehttp/promises": "^1.5.1", 26 | "guzzlehttp/psr7": "^1.8.3 || ^2.1", 27 | "php": "^7.2.5 || ^8.0" 28 | }, 29 | "require-dev": { 30 | "phpunit/phpunit": "^8.5.19" 31 | }, 32 | "type": "library", 33 | "extra": { 34 | "branch-alias": { 35 | "dev-master": "1.2-dev" 36 | } 37 | }, 38 | "autoload": { 39 | "psr-4": { 40 | "GuzzleHttp\\Command\\": "src/" 41 | } 42 | }, 43 | "notification-url": "https://packagist.org/downloads/", 44 | "license": [ 45 | "MIT" 46 | ], 47 | "authors": [ 48 | { 49 | "name": "Graham Campbell", 50 | "email": "hello@gjcampbell.co.uk", 51 | "homepage": "https://github.com/GrahamCampbell" 52 | }, 53 | { 54 | "name": "Michael Dowling", 55 | "email": "mtdowling@gmail.com", 56 | "homepage": "https://github.com/mtdowling" 57 | }, 58 | { 59 | "name": "Jeremy Lindblom", 60 | "email": "jeremeamia@gmail.com", 61 | "homepage": "https://github.com/jeremeamia" 62 | }, 63 | { 64 | "name": "Tobias Nyholm", 65 | "email": "tobias.nyholm@gmail.com", 66 | "homepage": "https://github.com/Nyholm" 67 | } 68 | ], 69 | "description": "Provides the foundation for building command-based web service clients", 70 | "support": { 71 | "issues": "https://github.com/guzzle/command/issues", 72 | "source": "https://github.com/guzzle/command/tree/1.2.2" 73 | }, 74 | "funding": [ 75 | { 76 | "url": "https://github.com/GrahamCampbell", 77 | "type": "github" 78 | }, 79 | { 80 | "url": "https://github.com/Nyholm", 81 | "type": "github" 82 | }, 83 | { 84 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/command", 85 | "type": "tidelift" 86 | } 87 | ], 88 | "time": "2022-02-08T10:21:14+00:00" 89 | }, 90 | { 91 | "name": "guzzlehttp/guzzle", 92 | "version": "7.4.5", 93 | "source": { 94 | "type": "git", 95 | "url": "https://github.com/guzzle/guzzle.git", 96 | "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82" 97 | }, 98 | "dist": { 99 | "type": "zip", 100 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", 101 | "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", 102 | "shasum": "" 103 | }, 104 | "require": { 105 | "ext-json": "*", 106 | "guzzlehttp/promises": "^1.5", 107 | "guzzlehttp/psr7": "^1.9 || ^2.4", 108 | "php": "^7.2.5 || ^8.0", 109 | "psr/http-client": "^1.0", 110 | "symfony/deprecation-contracts": "^2.2 || ^3.0" 111 | }, 112 | "provide": { 113 | "psr/http-client-implementation": "1.0" 114 | }, 115 | "require-dev": { 116 | "bamarni/composer-bin-plugin": "^1.4.1", 117 | "ext-curl": "*", 118 | "php-http/client-integration-tests": "^3.0", 119 | "phpunit/phpunit": "^8.5.5 || ^9.3.5", 120 | "psr/log": "^1.1 || ^2.0 || ^3.0" 121 | }, 122 | "suggest": { 123 | "ext-curl": "Required for CURL handler support", 124 | "ext-intl": "Required for Internationalized Domain Name (IDN) support", 125 | "psr/log": "Required for using the Log middleware" 126 | }, 127 | "type": "library", 128 | "extra": { 129 | "branch-alias": { 130 | "dev-master": "7.4-dev" 131 | } 132 | }, 133 | "autoload": { 134 | "files": [ 135 | "src/functions_include.php" 136 | ], 137 | "psr-4": { 138 | "GuzzleHttp\\": "src/" 139 | } 140 | }, 141 | "notification-url": "https://packagist.org/downloads/", 142 | "license": [ 143 | "MIT" 144 | ], 145 | "authors": [ 146 | { 147 | "name": "Graham Campbell", 148 | "email": "hello@gjcampbell.co.uk", 149 | "homepage": "https://github.com/GrahamCampbell" 150 | }, 151 | { 152 | "name": "Michael Dowling", 153 | "email": "mtdowling@gmail.com", 154 | "homepage": "https://github.com/mtdowling" 155 | }, 156 | { 157 | "name": "Jeremy Lindblom", 158 | "email": "jeremeamia@gmail.com", 159 | "homepage": "https://github.com/jeremeamia" 160 | }, 161 | { 162 | "name": "George Mponos", 163 | "email": "gmponos@gmail.com", 164 | "homepage": "https://github.com/gmponos" 165 | }, 166 | { 167 | "name": "Tobias Nyholm", 168 | "email": "tobias.nyholm@gmail.com", 169 | "homepage": "https://github.com/Nyholm" 170 | }, 171 | { 172 | "name": "Márk Sági-Kazár", 173 | "email": "mark.sagikazar@gmail.com", 174 | "homepage": "https://github.com/sagikazarmark" 175 | }, 176 | { 177 | "name": "Tobias Schultze", 178 | "email": "webmaster@tubo-world.de", 179 | "homepage": "https://github.com/Tobion" 180 | } 181 | ], 182 | "description": "Guzzle is a PHP HTTP client library", 183 | "keywords": [ 184 | "client", 185 | "curl", 186 | "framework", 187 | "http", 188 | "http client", 189 | "psr-18", 190 | "psr-7", 191 | "rest", 192 | "web service" 193 | ], 194 | "support": { 195 | "issues": "https://github.com/guzzle/guzzle/issues", 196 | "source": "https://github.com/guzzle/guzzle/tree/7.4.5" 197 | }, 198 | "funding": [ 199 | { 200 | "url": "https://github.com/GrahamCampbell", 201 | "type": "github" 202 | }, 203 | { 204 | "url": "https://github.com/Nyholm", 205 | "type": "github" 206 | }, 207 | { 208 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", 209 | "type": "tidelift" 210 | } 211 | ], 212 | "time": "2022-06-20T22:16:13+00:00" 213 | }, 214 | { 215 | "name": "guzzlehttp/guzzle-services", 216 | "version": "1.3.2", 217 | "source": { 218 | "type": "git", 219 | "url": "https://github.com/guzzle/guzzle-services.git", 220 | "reference": "4989d902dd4e0411b320e851c46f3c94d652d891" 221 | }, 222 | "dist": { 223 | "type": "zip", 224 | "url": "https://api.github.com/repos/guzzle/guzzle-services/zipball/4989d902dd4e0411b320e851c46f3c94d652d891", 225 | "reference": "4989d902dd4e0411b320e851c46f3c94d652d891", 226 | "shasum": "" 227 | }, 228 | "require": { 229 | "guzzlehttp/command": "^1.2.2", 230 | "guzzlehttp/guzzle": "^7.4.1", 231 | "guzzlehttp/psr7": "^1.8.3 || ^2.1", 232 | "guzzlehttp/uri-template": "^1.0.1", 233 | "php": "^7.2.5 || ^8.0" 234 | }, 235 | "require-dev": { 236 | "phpunit/phpunit": "^8.5.19 || ^9.5.8" 237 | }, 238 | "suggest": { 239 | "gimler/guzzle-description-loader": "^0.0.4" 240 | }, 241 | "type": "library", 242 | "extra": { 243 | "branch-alias": { 244 | "dev-master": "1.3-dev" 245 | } 246 | }, 247 | "autoload": { 248 | "psr-4": { 249 | "GuzzleHttp\\Command\\Guzzle\\": "src/" 250 | } 251 | }, 252 | "notification-url": "https://packagist.org/downloads/", 253 | "license": [ 254 | "MIT" 255 | ], 256 | "authors": [ 257 | { 258 | "name": "Graham Campbell", 259 | "email": "hello@gjcampbell.co.uk", 260 | "homepage": "https://github.com/GrahamCampbell" 261 | }, 262 | { 263 | "name": "Michael Dowling", 264 | "email": "mtdowling@gmail.com", 265 | "homepage": "https://github.com/mtdowling" 266 | }, 267 | { 268 | "name": "Stefano Kowalke", 269 | "email": "blueduck@mail.org", 270 | "homepage": "https://github.com/Konafets" 271 | }, 272 | { 273 | "name": "Tobias Nyholm", 274 | "email": "tobias.nyholm@gmail.com", 275 | "homepage": "https://github.com/Nyholm" 276 | } 277 | ], 278 | "description": "Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.", 279 | "support": { 280 | "issues": "https://github.com/guzzle/guzzle-services/issues", 281 | "source": "https://github.com/guzzle/guzzle-services/tree/1.3.2" 282 | }, 283 | "funding": [ 284 | { 285 | "url": "https://github.com/GrahamCampbell", 286 | "type": "github" 287 | }, 288 | { 289 | "url": "https://github.com/Nyholm", 290 | "type": "github" 291 | }, 292 | { 293 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle-services", 294 | "type": "tidelift" 295 | } 296 | ], 297 | "time": "2022-03-03T11:21:34+00:00" 298 | }, 299 | { 300 | "name": "guzzlehttp/promises", 301 | "version": "1.5.1", 302 | "source": { 303 | "type": "git", 304 | "url": "https://github.com/guzzle/promises.git", 305 | "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" 306 | }, 307 | "dist": { 308 | "type": "zip", 309 | "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", 310 | "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", 311 | "shasum": "" 312 | }, 313 | "require": { 314 | "php": ">=5.5" 315 | }, 316 | "require-dev": { 317 | "symfony/phpunit-bridge": "^4.4 || ^5.1" 318 | }, 319 | "type": "library", 320 | "extra": { 321 | "branch-alias": { 322 | "dev-master": "1.5-dev" 323 | } 324 | }, 325 | "autoload": { 326 | "files": [ 327 | "src/functions_include.php" 328 | ], 329 | "psr-4": { 330 | "GuzzleHttp\\Promise\\": "src/" 331 | } 332 | }, 333 | "notification-url": "https://packagist.org/downloads/", 334 | "license": [ 335 | "MIT" 336 | ], 337 | "authors": [ 338 | { 339 | "name": "Graham Campbell", 340 | "email": "hello@gjcampbell.co.uk", 341 | "homepage": "https://github.com/GrahamCampbell" 342 | }, 343 | { 344 | "name": "Michael Dowling", 345 | "email": "mtdowling@gmail.com", 346 | "homepage": "https://github.com/mtdowling" 347 | }, 348 | { 349 | "name": "Tobias Nyholm", 350 | "email": "tobias.nyholm@gmail.com", 351 | "homepage": "https://github.com/Nyholm" 352 | }, 353 | { 354 | "name": "Tobias Schultze", 355 | "email": "webmaster@tubo-world.de", 356 | "homepage": "https://github.com/Tobion" 357 | } 358 | ], 359 | "description": "Guzzle promises library", 360 | "keywords": [ 361 | "promise" 362 | ], 363 | "support": { 364 | "issues": "https://github.com/guzzle/promises/issues", 365 | "source": "https://github.com/guzzle/promises/tree/1.5.1" 366 | }, 367 | "funding": [ 368 | { 369 | "url": "https://github.com/GrahamCampbell", 370 | "type": "github" 371 | }, 372 | { 373 | "url": "https://github.com/Nyholm", 374 | "type": "github" 375 | }, 376 | { 377 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", 378 | "type": "tidelift" 379 | } 380 | ], 381 | "time": "2021-10-22T20:56:57+00:00" 382 | }, 383 | { 384 | "name": "guzzlehttp/psr7", 385 | "version": "2.4.0", 386 | "source": { 387 | "type": "git", 388 | "url": "https://github.com/guzzle/psr7.git", 389 | "reference": "13388f00956b1503577598873fffb5ae994b5737" 390 | }, 391 | "dist": { 392 | "type": "zip", 393 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737", 394 | "reference": "13388f00956b1503577598873fffb5ae994b5737", 395 | "shasum": "" 396 | }, 397 | "require": { 398 | "php": "^7.2.5 || ^8.0", 399 | "psr/http-factory": "^1.0", 400 | "psr/http-message": "^1.0", 401 | "ralouphie/getallheaders": "^3.0" 402 | }, 403 | "provide": { 404 | "psr/http-factory-implementation": "1.0", 405 | "psr/http-message-implementation": "1.0" 406 | }, 407 | "require-dev": { 408 | "bamarni/composer-bin-plugin": "^1.4.1", 409 | "http-interop/http-factory-tests": "^0.9", 410 | "phpunit/phpunit": "^8.5.8 || ^9.3.10" 411 | }, 412 | "suggest": { 413 | "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" 414 | }, 415 | "type": "library", 416 | "extra": { 417 | "branch-alias": { 418 | "dev-master": "2.4-dev" 419 | } 420 | }, 421 | "autoload": { 422 | "psr-4": { 423 | "GuzzleHttp\\Psr7\\": "src/" 424 | } 425 | }, 426 | "notification-url": "https://packagist.org/downloads/", 427 | "license": [ 428 | "MIT" 429 | ], 430 | "authors": [ 431 | { 432 | "name": "Graham Campbell", 433 | "email": "hello@gjcampbell.co.uk", 434 | "homepage": "https://github.com/GrahamCampbell" 435 | }, 436 | { 437 | "name": "Michael Dowling", 438 | "email": "mtdowling@gmail.com", 439 | "homepage": "https://github.com/mtdowling" 440 | }, 441 | { 442 | "name": "George Mponos", 443 | "email": "gmponos@gmail.com", 444 | "homepage": "https://github.com/gmponos" 445 | }, 446 | { 447 | "name": "Tobias Nyholm", 448 | "email": "tobias.nyholm@gmail.com", 449 | "homepage": "https://github.com/Nyholm" 450 | }, 451 | { 452 | "name": "Márk Sági-Kazár", 453 | "email": "mark.sagikazar@gmail.com", 454 | "homepage": "https://github.com/sagikazarmark" 455 | }, 456 | { 457 | "name": "Tobias Schultze", 458 | "email": "webmaster@tubo-world.de", 459 | "homepage": "https://github.com/Tobion" 460 | }, 461 | { 462 | "name": "Márk Sági-Kazár", 463 | "email": "mark.sagikazar@gmail.com", 464 | "homepage": "https://sagikazarmark.hu" 465 | } 466 | ], 467 | "description": "PSR-7 message implementation that also provides common utility methods", 468 | "keywords": [ 469 | "http", 470 | "message", 471 | "psr-7", 472 | "request", 473 | "response", 474 | "stream", 475 | "uri", 476 | "url" 477 | ], 478 | "support": { 479 | "issues": "https://github.com/guzzle/psr7/issues", 480 | "source": "https://github.com/guzzle/psr7/tree/2.4.0" 481 | }, 482 | "funding": [ 483 | { 484 | "url": "https://github.com/GrahamCampbell", 485 | "type": "github" 486 | }, 487 | { 488 | "url": "https://github.com/Nyholm", 489 | "type": "github" 490 | }, 491 | { 492 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", 493 | "type": "tidelift" 494 | } 495 | ], 496 | "time": "2022-06-20T21:43:11+00:00" 497 | }, 498 | { 499 | "name": "guzzlehttp/uri-template", 500 | "version": "v1.0.1", 501 | "source": { 502 | "type": "git", 503 | "url": "https://github.com/guzzle/uri-template.git", 504 | "reference": "b945d74a55a25a949158444f09ec0d3c120d69e2" 505 | }, 506 | "dist": { 507 | "type": "zip", 508 | "url": "https://api.github.com/repos/guzzle/uri-template/zipball/b945d74a55a25a949158444f09ec0d3c120d69e2", 509 | "reference": "b945d74a55a25a949158444f09ec0d3c120d69e2", 510 | "shasum": "" 511 | }, 512 | "require": { 513 | "php": "^7.2.5 || ^8.0", 514 | "symfony/polyfill-php80": "^1.17" 515 | }, 516 | "require-dev": { 517 | "phpunit/phpunit": "^8.5.19 || ^9.5.8", 518 | "uri-template/tests": "1.0.0" 519 | }, 520 | "type": "library", 521 | "extra": { 522 | "branch-alias": { 523 | "dev-master": "1.0-dev" 524 | } 525 | }, 526 | "autoload": { 527 | "psr-4": { 528 | "GuzzleHttp\\UriTemplate\\": "src" 529 | } 530 | }, 531 | "notification-url": "https://packagist.org/downloads/", 532 | "license": [ 533 | "MIT" 534 | ], 535 | "authors": [ 536 | { 537 | "name": "Graham Campbell", 538 | "email": "hello@gjcampbell.co.uk", 539 | "homepage": "https://github.com/GrahamCampbell" 540 | }, 541 | { 542 | "name": "Michael Dowling", 543 | "email": "mtdowling@gmail.com", 544 | "homepage": "https://github.com/mtdowling" 545 | }, 546 | { 547 | "name": "George Mponos", 548 | "email": "gmponos@gmail.com", 549 | "homepage": "https://github.com/gmponos" 550 | }, 551 | { 552 | "name": "Tobias Nyholm", 553 | "email": "tobias.nyholm@gmail.com", 554 | "homepage": "https://github.com/Nyholm" 555 | } 556 | ], 557 | "description": "A polyfill class for uri_template of PHP", 558 | "keywords": [ 559 | "guzzlehttp", 560 | "uri-template" 561 | ], 562 | "support": { 563 | "issues": "https://github.com/guzzle/uri-template/issues", 564 | "source": "https://github.com/guzzle/uri-template/tree/v1.0.1" 565 | }, 566 | "funding": [ 567 | { 568 | "url": "https://github.com/GrahamCampbell", 569 | "type": "github" 570 | }, 571 | { 572 | "url": "https://github.com/Nyholm", 573 | "type": "github" 574 | }, 575 | { 576 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/uri-template", 577 | "type": "tidelift" 578 | } 579 | ], 580 | "time": "2021-10-07T12:57:01+00:00" 581 | }, 582 | { 583 | "name": "psr/http-client", 584 | "version": "1.0.1", 585 | "source": { 586 | "type": "git", 587 | "url": "https://github.com/php-fig/http-client.git", 588 | "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" 589 | }, 590 | "dist": { 591 | "type": "zip", 592 | "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", 593 | "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", 594 | "shasum": "" 595 | }, 596 | "require": { 597 | "php": "^7.0 || ^8.0", 598 | "psr/http-message": "^1.0" 599 | }, 600 | "type": "library", 601 | "extra": { 602 | "branch-alias": { 603 | "dev-master": "1.0.x-dev" 604 | } 605 | }, 606 | "autoload": { 607 | "psr-4": { 608 | "Psr\\Http\\Client\\": "src/" 609 | } 610 | }, 611 | "notification-url": "https://packagist.org/downloads/", 612 | "license": [ 613 | "MIT" 614 | ], 615 | "authors": [ 616 | { 617 | "name": "PHP-FIG", 618 | "homepage": "http://www.php-fig.org/" 619 | } 620 | ], 621 | "description": "Common interface for HTTP clients", 622 | "homepage": "https://github.com/php-fig/http-client", 623 | "keywords": [ 624 | "http", 625 | "http-client", 626 | "psr", 627 | "psr-18" 628 | ], 629 | "support": { 630 | "source": "https://github.com/php-fig/http-client/tree/master" 631 | }, 632 | "time": "2020-06-29T06:28:15+00:00" 633 | }, 634 | { 635 | "name": "psr/http-factory", 636 | "version": "1.0.1", 637 | "source": { 638 | "type": "git", 639 | "url": "https://github.com/php-fig/http-factory.git", 640 | "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" 641 | }, 642 | "dist": { 643 | "type": "zip", 644 | "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", 645 | "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", 646 | "shasum": "" 647 | }, 648 | "require": { 649 | "php": ">=7.0.0", 650 | "psr/http-message": "^1.0" 651 | }, 652 | "type": "library", 653 | "extra": { 654 | "branch-alias": { 655 | "dev-master": "1.0.x-dev" 656 | } 657 | }, 658 | "autoload": { 659 | "psr-4": { 660 | "Psr\\Http\\Message\\": "src/" 661 | } 662 | }, 663 | "notification-url": "https://packagist.org/downloads/", 664 | "license": [ 665 | "MIT" 666 | ], 667 | "authors": [ 668 | { 669 | "name": "PHP-FIG", 670 | "homepage": "http://www.php-fig.org/" 671 | } 672 | ], 673 | "description": "Common interfaces for PSR-7 HTTP message factories", 674 | "keywords": [ 675 | "factory", 676 | "http", 677 | "message", 678 | "psr", 679 | "psr-17", 680 | "psr-7", 681 | "request", 682 | "response" 683 | ], 684 | "support": { 685 | "source": "https://github.com/php-fig/http-factory/tree/master" 686 | }, 687 | "time": "2019-04-30T12:38:16+00:00" 688 | }, 689 | { 690 | "name": "psr/http-message", 691 | "version": "1.0.1", 692 | "source": { 693 | "type": "git", 694 | "url": "https://github.com/php-fig/http-message.git", 695 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" 696 | }, 697 | "dist": { 698 | "type": "zip", 699 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", 700 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", 701 | "shasum": "" 702 | }, 703 | "require": { 704 | "php": ">=5.3.0" 705 | }, 706 | "type": "library", 707 | "extra": { 708 | "branch-alias": { 709 | "dev-master": "1.0.x-dev" 710 | } 711 | }, 712 | "autoload": { 713 | "psr-4": { 714 | "Psr\\Http\\Message\\": "src/" 715 | } 716 | }, 717 | "notification-url": "https://packagist.org/downloads/", 718 | "license": [ 719 | "MIT" 720 | ], 721 | "authors": [ 722 | { 723 | "name": "PHP-FIG", 724 | "homepage": "http://www.php-fig.org/" 725 | } 726 | ], 727 | "description": "Common interface for HTTP messages", 728 | "homepage": "https://github.com/php-fig/http-message", 729 | "keywords": [ 730 | "http", 731 | "http-message", 732 | "psr", 733 | "psr-7", 734 | "request", 735 | "response" 736 | ], 737 | "support": { 738 | "source": "https://github.com/php-fig/http-message/tree/master" 739 | }, 740 | "time": "2016-08-06T14:39:51+00:00" 741 | }, 742 | { 743 | "name": "ralouphie/getallheaders", 744 | "version": "3.0.3", 745 | "source": { 746 | "type": "git", 747 | "url": "https://github.com/ralouphie/getallheaders.git", 748 | "reference": "120b605dfeb996808c31b6477290a714d356e822" 749 | }, 750 | "dist": { 751 | "type": "zip", 752 | "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", 753 | "reference": "120b605dfeb996808c31b6477290a714d356e822", 754 | "shasum": "" 755 | }, 756 | "require": { 757 | "php": ">=5.6" 758 | }, 759 | "require-dev": { 760 | "php-coveralls/php-coveralls": "^2.1", 761 | "phpunit/phpunit": "^5 || ^6.5" 762 | }, 763 | "type": "library", 764 | "autoload": { 765 | "files": [ 766 | "src/getallheaders.php" 767 | ] 768 | }, 769 | "notification-url": "https://packagist.org/downloads/", 770 | "license": [ 771 | "MIT" 772 | ], 773 | "authors": [ 774 | { 775 | "name": "Ralph Khattar", 776 | "email": "ralph.khattar@gmail.com" 777 | } 778 | ], 779 | "description": "A polyfill for getallheaders.", 780 | "support": { 781 | "issues": "https://github.com/ralouphie/getallheaders/issues", 782 | "source": "https://github.com/ralouphie/getallheaders/tree/develop" 783 | }, 784 | "time": "2019-03-08T08:55:37+00:00" 785 | }, 786 | { 787 | "name": "symfony/deprecation-contracts", 788 | "version": "v3.1.0", 789 | "source": { 790 | "type": "git", 791 | "url": "https://github.com/symfony/deprecation-contracts.git", 792 | "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" 793 | }, 794 | "dist": { 795 | "type": "zip", 796 | "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", 797 | "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", 798 | "shasum": "" 799 | }, 800 | "require": { 801 | "php": ">=8.1" 802 | }, 803 | "type": "library", 804 | "extra": { 805 | "branch-alias": { 806 | "dev-main": "3.1-dev" 807 | }, 808 | "thanks": { 809 | "name": "symfony/contracts", 810 | "url": "https://github.com/symfony/contracts" 811 | } 812 | }, 813 | "autoload": { 814 | "files": [ 815 | "function.php" 816 | ] 817 | }, 818 | "notification-url": "https://packagist.org/downloads/", 819 | "license": [ 820 | "MIT" 821 | ], 822 | "authors": [ 823 | { 824 | "name": "Nicolas Grekas", 825 | "email": "p@tchwork.com" 826 | }, 827 | { 828 | "name": "Symfony Community", 829 | "homepage": "https://symfony.com/contributors" 830 | } 831 | ], 832 | "description": "A generic function and convention to trigger deprecation notices", 833 | "homepage": "https://symfony.com", 834 | "support": { 835 | "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.0" 836 | }, 837 | "funding": [ 838 | { 839 | "url": "https://symfony.com/sponsor", 840 | "type": "custom" 841 | }, 842 | { 843 | "url": "https://github.com/fabpot", 844 | "type": "github" 845 | }, 846 | { 847 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 848 | "type": "tidelift" 849 | } 850 | ], 851 | "time": "2022-02-25T11:15:52+00:00" 852 | }, 853 | { 854 | "name": "symfony/polyfill-php80", 855 | "version": "v1.26.0", 856 | "source": { 857 | "type": "git", 858 | "url": "https://github.com/symfony/polyfill-php80.git", 859 | "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" 860 | }, 861 | "dist": { 862 | "type": "zip", 863 | "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", 864 | "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", 865 | "shasum": "" 866 | }, 867 | "require": { 868 | "php": ">=7.1" 869 | }, 870 | "type": "library", 871 | "extra": { 872 | "branch-alias": { 873 | "dev-main": "1.26-dev" 874 | }, 875 | "thanks": { 876 | "name": "symfony/polyfill", 877 | "url": "https://github.com/symfony/polyfill" 878 | } 879 | }, 880 | "autoload": { 881 | "files": [ 882 | "bootstrap.php" 883 | ], 884 | "psr-4": { 885 | "Symfony\\Polyfill\\Php80\\": "" 886 | }, 887 | "classmap": [ 888 | "Resources/stubs" 889 | ] 890 | }, 891 | "notification-url": "https://packagist.org/downloads/", 892 | "license": [ 893 | "MIT" 894 | ], 895 | "authors": [ 896 | { 897 | "name": "Ion Bazan", 898 | "email": "ion.bazan@gmail.com" 899 | }, 900 | { 901 | "name": "Nicolas Grekas", 902 | "email": "p@tchwork.com" 903 | }, 904 | { 905 | "name": "Symfony Community", 906 | "homepage": "https://symfony.com/contributors" 907 | } 908 | ], 909 | "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", 910 | "homepage": "https://symfony.com", 911 | "keywords": [ 912 | "compatibility", 913 | "polyfill", 914 | "portable", 915 | "shim" 916 | ], 917 | "support": { 918 | "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" 919 | }, 920 | "funding": [ 921 | { 922 | "url": "https://symfony.com/sponsor", 923 | "type": "custom" 924 | }, 925 | { 926 | "url": "https://github.com/fabpot", 927 | "type": "github" 928 | }, 929 | { 930 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 931 | "type": "tidelift" 932 | } 933 | ], 934 | "time": "2022-05-10T07:21:04+00:00" 935 | } 936 | ], 937 | "packages-dev": [], 938 | "aliases": [], 939 | "minimum-stability": "stable", 940 | "stability-flags": [], 941 | "prefer-stable": false, 942 | "prefer-lowest": false, 943 | "platform": { 944 | "php": "^7.2.5 || ^8" 945 | }, 946 | "platform-dev": [], 947 | "plugin-api-version": "2.3.0" 948 | } 949 | -------------------------------------------------------------------------------- /php/WporgClient.php: -------------------------------------------------------------------------------- 1 | false, 24 | 'requires' => false, 25 | 'tested' => false, 26 | 'compatibility' => false, 27 | 'rating' => false, 28 | 'num_ratings' => false, 29 | 'ratings' => false, 30 | 'downloaded' => false, 31 | 'last_updated' => false, 32 | 'added' => false, 33 | 'homepage' => false, 34 | 'sections' => false, 35 | 'downloadlink' => false, 36 | 'tags' => false, 37 | 'donate_link' => false, 38 | 'active_installs' => false, 39 | ]; 40 | 41 | protected function getRequestFields($fields) 42 | { 43 | return is_array($fields) ? array_merge($this->disabledFields, array_fill_keys($fields, true)) : []; 44 | } 45 | 46 | public static function getClient(Client $client = null, Description $description = null, array $config = [ ]) 47 | { 48 | if (empty( $client )) { 49 | $client = new Client(); 50 | } 51 | 52 | if (empty( $description )) { 53 | $description = new Description(WporgService::getDescription()); 54 | } 55 | 56 | return new self($client, $description, null, null, null, $config); 57 | } 58 | 59 | public function getSalt() 60 | { 61 | $command = $this->getCommand('getSalt'); 62 | $response = $this->execute($command); 63 | /** @var Stream $body */ 64 | $body = $response['body']; 65 | 66 | return $body->getContents(); 67 | } 68 | 69 | public function getStats($type) 70 | { 71 | $command = $this->getCommand('getStats', [ 'type' => $type ]); 72 | 73 | return $this->execute($command); 74 | } 75 | 76 | public function getUpdates($version = null, $locale = null) 77 | { 78 | $args = [ ]; 79 | 80 | if (! empty( $version )) { 81 | $args['version'] = $version; 82 | } 83 | 84 | if (! empty( $locale )) { 85 | $args['locale'] = $locale; 86 | } 87 | 88 | return $this->getCoreVersionCheck($args); 89 | } 90 | 91 | public function getCredits($version = null) 92 | { 93 | // TODO compare version to be >=3.2 94 | return $this->getCoreCredits(empty( $version ) ? [ ] : [ 'version' => $version ]); 95 | } 96 | 97 | public function getTranslations($version = null) 98 | { 99 | // TODO compare version to be >=4.0 100 | $args = [ 'type' => 'core' ]; 101 | 102 | if (! empty( $version )) { 103 | $args['version'] = $version; 104 | } 105 | 106 | $command = $this->getCommand('getTranslations', $args); 107 | 108 | return $this->execute($command); 109 | } 110 | 111 | public function getTheme($slug, $fields = null) 112 | { 113 | $response = $this->getThemesInfo([ 114 | 'request' => [ 115 | 'slug' => $slug, 116 | 'fields' => $this->getRequestFields($fields) 117 | ] 118 | ]); 119 | 120 | return $response->toArray(); 121 | } 122 | 123 | public function getThemeTranslations($slug, $version = null) 124 | { 125 | $args = [ 'type' => 'themes', 'slug' => $slug ]; 126 | 127 | if (! empty( $version )) { 128 | $args['version'] = $version; 129 | } 130 | 131 | $command = $this->getCommand('getTranslations', $args); 132 | 133 | return $this->execute($command); 134 | } 135 | 136 | public function getThemeFeatureList() 137 | { 138 | return $this->getThemesInfo([ 'action' => 'feature_list' ])->toArray(); 139 | } 140 | 141 | public function getThemesBy($type, $value, $page = 1, $perPage = 10, $fields = null) 142 | { 143 | $response = $this->getThemesInfo([ 144 | 'action' => 'query_themes', 145 | 'request' => [ 146 | $type => $value, 147 | 'page' => $page, 148 | 'per_page' => $perPage, 149 | 'fields' => $this->getRequestFields($fields), 150 | ], 151 | ]); 152 | 153 | return $response->toArray(); 154 | } 155 | 156 | public function getPlugin($slug, $fields = null) 157 | { 158 | $response = $this->getPluginsInfo([ 159 | 'action' => 'plugin_information', 160 | 'request' => [ 161 | 'slug' => $slug, 162 | 'fields' => $this->getRequestFields($fields), 163 | ] 164 | ]); 165 | 166 | return $response->toArray(); 167 | } 168 | 169 | public function getPluginStats($slug) 170 | { 171 | $command = $this->getCommand('getStats', [ 'type' => 'plugin', 'slug' => $slug ]); 172 | 173 | return $this->execute($command); 174 | } 175 | 176 | /** 177 | * @param string $slug Plugin slug. 178 | * @param null|int $limit Number of days to retrieve, maximum 730. 179 | * 180 | * @return array 181 | */ 182 | public function getPluginDownloads($slug, $limit = null) 183 | { 184 | $args = [ 'slug' => $slug ]; 185 | 186 | if (! empty($limit)) { 187 | $limit = (int)$limit; 188 | $args['limit'] = $limit > 730 ? 730 : $limit; 189 | } 190 | 191 | return $this->getDownloads($args); 192 | } 193 | 194 | public function getPluginTranslations($slug, $version = null) 195 | { 196 | $args = [ 'type' => 'plugins', 'slug' => $slug ]; 197 | 198 | if (! empty( $version )) { 199 | $args['version'] = $version; 200 | } 201 | 202 | $command = $this->getCommand('getTranslations', $args); 203 | 204 | return $this->execute($command); 205 | } 206 | 207 | public function getPluginsBy($type, $value, $page = 1, $perPage = 10, $fields = null) 208 | { 209 | $response = $this->getPluginsInfo([ 210 | 'action' => 'query_plugins', 211 | 'request' => [ 212 | $type => $value, 213 | 'page' => $page, 214 | 'per_page' => $perPage, 215 | 'fields' => $this->getRequestFields($fields), 216 | ], 217 | ]); 218 | 219 | return $response->toArray(); 220 | } 221 | 222 | public function getHotTags($number = 100) 223 | { 224 | $response = $this->getPluginsInfo([ 225 | 'action' => 'hot_tags', 226 | 'request' => [ 'number' => $number ], // Number currently broken in API. 227 | ]); 228 | 229 | return $response->toArray(); 230 | } 231 | 232 | public function getChecksums($version, $locale = 'en_US') 233 | { 234 | return $this->getCoreChecksums([ 'version' => $version, 'locale' => $locale ]); 235 | } 236 | 237 | public function getBrowser($useragent) 238 | { 239 | return $this->getCoreBrowseHappy([ 'useragent' => $useragent ])->toArray(); 240 | } 241 | } 242 | -------------------------------------------------------------------------------- /php/WporgService.php: -------------------------------------------------------------------------------- 1 | 'WordPress.org API', 10 | 'baseUrl' => 'https://api.wordpress.org', 11 | 'description' => 'Guzzle client for WordPress.org APIs', 12 | 'operations' => [ 13 | 'getSalt' => [ 14 | 'summary' => 'Get security secret keys and salts.', 15 | 'responseModel' => 'body', 16 | 'httpMethod' => 'GET', 17 | 'uri' => 'secret-key/{version}/salt/', 18 | 'parameters' => [ 19 | 'version' => [ 20 | 'location' => 'uri', 21 | 'default' => '1.1', 22 | ] 23 | ], 24 | ], 25 | 'getStats' => [ 26 | 'summary' => 'Get usage stats information.', 27 | 'responseModel' => 'json', 28 | 'httpMethod' => 'GET', 29 | 'uri' => 'stats/{type}/{version}/{slug}', 30 | 'parameters' => [ 31 | 'type' => [ 32 | 'location' => 'uri', 33 | 'type' => 'string', 34 | 'required' => true, 35 | ], 36 | 'version' => [ 37 | 'location' => 'uri', 38 | 'default' => '1.0', 39 | ], 40 | 'slug' => [ 41 | 'location' => 'uri', 42 | 'type' => 'string', 43 | ], 44 | ], 45 | ], 46 | 'getDownloads' => [ 47 | 'extends' => 'getStats', 48 | 'uri' => 'stats/{type}/{version}/downloads.php', 49 | 'parameters' => [ 50 | 'type' => [ 51 | 'location' => 'uri', 52 | 'default' => 'plugin', 53 | 'required' => true, 54 | ], 55 | 'version' => [ 56 | 'location' => 'uri', 57 | 'default' => '1.0', 58 | ], 59 | 'slug' => [ 60 | 'location' => 'query', 61 | 'type' => 'string', 62 | ], 63 | 'limit' => [ 64 | 'location' => 'query', 65 | ], 66 | ], 67 | ], 68 | 'getCoreVersionCheck' => [ 69 | 'summary' => 'Get WordPress core update information.', 70 | 'responseModel' => 'json', 71 | 'httpMethod' => 'GET', 72 | 'uri' => 'core/version-check/{api_version}/', 73 | 'parameters' => [ 74 | 'api_version' => [ 75 | 'location' => 'uri', 76 | 'default' => '1.7', 77 | ], 78 | 'version' => [ 79 | 'location' => 'query', 80 | ], 81 | 'locale' => [ 82 | 'location' => 'query', 83 | ], 84 | ], 85 | ], 86 | 'getCoreCredits' => [ 87 | 'summary' => 'Get core release credits information.', 88 | 'responseModel' => 'json', 89 | 'httpMethod' => 'GET', 90 | 'uri' => 'core/credits/{api_version}/', 91 | 'parameters' => [ 92 | 'api_version' => [ 93 | 'location' => 'uri', 94 | 'default' => '1.1', 95 | ], 96 | 'version' => [ 97 | 'location' => 'query', 98 | ], 99 | ], 100 | ], 101 | 'getTranslations' => [ 102 | 'summary' => 'Get available translations information.', 103 | 'responseModel' => 'json', 104 | 'httpMethod' => 'GET', 105 | 'uri' => 'translations/{type}/{api_version}/', 106 | 'parameters' => [ 107 | 'type' => [ 108 | 'location' => 'uri', 109 | 'requires' => true, 110 | ], 111 | 'api_version' => [ 112 | 'location' => 'uri', 113 | 'default' => '1.0', 114 | ], 115 | 'version' => [ 116 | 'location' => 'query', 117 | ], 118 | 'slug' => [ 119 | 'location' => 'query', 120 | ], 121 | ], 122 | ], 123 | 'getThemesInfo' => [ 124 | 'summary' => 'Get repository theme information.', 125 | 'responseModel' => 'json', 126 | 'httpMethod' => 'GET', 127 | 'uri' => 'themes/info/{version}/', 128 | 'parameters' => [ 129 | 'version' => [ 130 | 'location' => 'uri', 131 | 'default' => '1.1', 132 | ], 133 | 'action' => [ 134 | 'location' => 'query', 135 | 'default' => 'theme_information', 136 | ], 137 | 'request' => [ 138 | 'location' => 'query', 139 | 'type' => 'array', 140 | ], 141 | ], 142 | ], 143 | 'getPluginsInfo' => [ 144 | 'summary' => 'Get repository plugin information.', 145 | 'responseModel' => 'json', 146 | 'httpMethod' => 'GET', 147 | 'uri' => 'plugins/info/{version}/', 148 | 'parameters' => [ 149 | 'version' => [ 150 | 'location' => 'uri', 151 | 'default' => '1.1', 152 | ], 153 | 'action' => [ 154 | 'location' => 'query', 155 | ], 156 | 'request' => [ 157 | 'location' => 'query', 158 | 'type' => 'array', 159 | ], 160 | ], 161 | ], 162 | 'getCoreImporters' => [ 163 | 'summary' => 'Get popular importers information.', 164 | 'responseModel' => 'json', 165 | 'httpMethod' => 'GET', 166 | 'uri' => 'core/importers/{api_version}/', 167 | 'parameters' => [ 168 | 'api_version' => [ 169 | 'location' => 'uri', 170 | 'default' => '1.1', 171 | ], 172 | ], 173 | ], 174 | 'getImporters' => [ 'extends' => 'getCoreImporters' ], // shorter alias 175 | 'getCoreChecksums' => [ 176 | 'summary' => 'Get core files checksums information.', 177 | 'responseModel' => 'json', 178 | 'httpMethod' => 'GET', 179 | 'uri' => '/core/checksums/{api_version}/', 180 | 'parameters' => [ 181 | 'api_version' => [ 182 | 'location' => 'uri', 183 | 'default' => '1.0', 184 | ], 185 | 'version' => [ 186 | 'location' => 'query', 187 | 'required' => 'true', 188 | ], 189 | 'locale' => [ 190 | 'location' => 'query', 191 | 'default' => 'en_US', 192 | ], 193 | ], 194 | ], 195 | 'getCoreBrowseHappy' => [ 196 | 'summary' => 'Get reference to documentation.', 197 | 'responseModel' => 'json', 198 | 'httpMethod' => 'POST', 199 | 'uri' => '/core/browse-happy/{api_version}/', 200 | 'parameters' => [ 201 | 'api_version' => [ 202 | 'location' => 'uri', 203 | 'default' => '1.1', 204 | ], 205 | 'useragent' => [ 206 | 'location' => 'formParam', 207 | 'required' => 'true', 208 | ], 209 | ], 210 | ], 211 | 'getEvents' => [ 212 | 'summary' => 'Get WordCamps and meetups.', 213 | 'responseModel' => 'json', 214 | 'httpMethod' => 'GET', 215 | 'uri' => '/events/{api_version}/', 216 | 'parameters' => [ 217 | 'api_version' => [ 218 | 'location' => 'uri', 219 | 'default' => '1.0', 220 | ], 221 | 'number' => [ 222 | 'location' => 'query', 223 | 'default' => 10, 224 | ], 225 | 'location' => [ 226 | 'location' => 'query', 227 | ], 228 | 'locale' => [ 229 | 'location' => 'query', 230 | ], 231 | 'timezone' => [ 232 | 'location' => 'query', 233 | ], 234 | 'latitude' => [ 235 | 'location' => 'query', 236 | ], 237 | 'longitude' => [ 238 | 'location' => 'query', 239 | ], 240 | 'ip' => [ 241 | 'location' => 'query', 242 | ], 243 | 'country' => [ 244 | 'location' => 'query', 245 | ], 246 | ] 247 | ] 248 | ], 249 | 'models' => [ 250 | 'body' => [ 251 | 'type' => 'object', 252 | 'properties' => [ 253 | 'body' => [ 254 | 'location' => 'body', 255 | 'type' => 'string', 256 | ], 257 | ] 258 | ], 259 | 'json' => [ 260 | 'type' => 'object', 261 | 'additionalProperties' => [ 'location' => 'json' ], 262 | ], 263 | ] 264 | ]; 265 | } 266 | } 267 | --------------------------------------------------------------------------------