{"id":21813097,"url":"https://github.com/webdevstudios/wds-wp-rest-api-connect","last_synced_at":"2025-10-07T04:20:54.677Z","repository":{"id":18464396,"uuid":"21658986","full_name":"WebDevStudios/WDS-WP-REST-API-Connect","owner":"WebDevStudios","description":"A tool for connecting to the JSON-based REST API for WordPress via OAuth - https://github.com/WP-API/OAuth1, https://github.com/WP-API/OAuth1","archived":false,"fork":false,"pushed_at":"2017-03-08T17:34:56.000Z","size":107,"stargazers_count":85,"open_issues_count":3,"forks_count":18,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-27T13:45:09.933Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://webdevstudios.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebDevStudios.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-09T16:02:24.000Z","updated_at":"2024-09-10T18:46:35.000Z","dependencies_parsed_at":"2022-09-08T04:11:17.165Z","dependency_job_id":null,"html_url":"https://github.com/WebDevStudios/WDS-WP-REST-API-Connect","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FWDS-WP-REST-API-Connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FWDS-WP-REST-API-Connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FWDS-WP-REST-API-Connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FWDS-WP-REST-API-Connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebDevStudios","download_url":"https://codeload.github.com/WebDevStudios/WDS-WP-REST-API-Connect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248795422,"owners_count":21162771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-27T14:27:13.004Z","updated_at":"2025-10-07T04:20:49.645Z","avatar_url":"https://github.com/WebDevStudios.png","language":"PHP","readme":"WDS WP REST API Connect (0.2.6) [![Scrutinizer Code Quality](http://img.shields.io/scrutinizer/g/WebDevStudios/WDS-WP-JSON-API-Connect.svg?style=flat)](https://scrutinizer-ci.com/g/WebDevStudios/WDS-WP-JSON-API-Connect/)\n=========\n\nA tool for connecting to the [REST API for WordPress](https://github.com/WP-API/WP-API) via [OAuth 1.0a](https://github.com/WP-API/OAuth1).\n\nTo get started, you'll need to install both the [WP REST API plugin](https://github.com/WP-API/WP-API) and the [OAuth plugin](https://github.com/WP-API/OAuth1).\n\nTo use this library, you will need to run `composer install` from the root of the library, and then include the main library file, `wds-wp-rest-api-connect.php` and the composer autoloader, `vendor/autoload.php` from your plugin/theme.\n\nOnce installed and activated, you'll need to create a '[Client Application](http://v2.wp-api.org/guide/authentication/#oauth-authentication)'.\nWhen you have the Client key and secret, you'll create a new `WDS_WP_REST_API\\OAuth1\\Connect` object by passing those credentials along with the REST API URL and the registered callback URL:\n```php\n// Make sure you run `composer install`!\nrequire_once 'vendor/autoload.php';\n\n// include the library.\nrequire_once( 'wds-wp-rest-api-connect.php' );\n\n// Get the connect object\n$api_connect = new WDS_WP_REST_API\\OAuth1\\Connect();\n\n// Client credentials\n$client = array(\n\n\t// Library will 'discover' the API url\n\t'api_url' =\u003e 'WP SITE URL TO CONNECT TO',\n\n\t// App credentials set up on the server\n\t'client_key' =\u003e 'YOUR CLIENT KEY',\n\t'client_secret' =\u003e 'YOUR CLIENT SECRET',\n\n\t// Must match stored callback URL setup on server.\n\t'callback_uri' =\u003e admin_url() . '?api-connect',\n);\n\n/*\n * Initate the API connection.\n *\n * if the oauth connection is not yet authorized, (and autoredirect_authoriziation\n * is not explicitly set to false) you will be auto-redirected to the other site to\n * receive authorization.\n */\n$discovery = $api_connect-\u003einit( $client );\n\n```\n\nYou can then use this object to retrieve the authentication request URL, or if you have been authenticated, make requests. To see a full example, view [the included example.php file](https://github.com/WebDevStudios/WDS-WP-REST-API-Connect/blob/master/example.php).\n\n## Changelog\n\n### 0.2.6\n* Remove Ryan McCue's Requests library from composer since it now exists in WP core.\n\n### 0.2.5\n* Fix a typo from a variable which should be using an object property (for legacy mode).\n\n### 0.2.4\n* Fix broken logic in `Connect::auth_request()` where $response variable might not get properly set.\n\n### 0.2.3\n* Update example.php\n* Make requests more consistent, and pass parameters through appropriate filters.\n* Fixed a few missed exception handlers.\n\n### 0.2.2\n* Add set_headers method to be able to set headers for discovery.\n* Use our own API Discovery library to use the WP http API, and to correctly pass any headers if they exist.\n\n### 0.2.1\n* Bug fix: Fix the order of checks in the reset_connection method to ensure the delete_stored_error method is always called.\n\n### 0.2.0\n* Complete rewrite. Breaks backwards-compatibility, but previous version will not work with the newest version of the [WordPress OAuth](https://github.com/WP-API/OAuth1) plugin. Please review the [WP-API Authentication documentation](http://v2.wp-api.org/guide/authentication/#oauth-authentication).\n\n### 0.1.5\n* Remove autoload from composer.json (for now).\n\n### 0.1.4\n* Add utility methods for dealing with errors.\n* Convert post body to a query string before wp_remote_request does because http_build_query drops empty values and oauth signatures end up not matching.\n\n### 0.1.3\n* Fix some docs, and \"clever\" code, and fix an incorrect variable name.\n* Add class_exists check so we don't break sites w/ multiple instantiations.\n* Store response code as object property.\n* Account for `WP_Error` from responses before creating response code.\n* Accept a headers array, and pass those headers to all requests.\n* Option/transient key should be a hash of all the args, not just the url.\n* Do not cache api description if request is a failure (or being requested not to).\n* Make headers and key/option_key accessible as read-only properties.\n* Change from JSON to REST to match WordPress core plugin.\n* Move error option to its own method.\n\n### 0.1.2\n* Better checks for failed requests.\n* Set the http method for each call so that the OAuth signature matches.\n* Create a redirect URL based on current url or allow one to be passed in.\n* Keep response as an accessible class property, and add get/set request methods. Also properly handle GET request authorization header.\n* Some cleanup based on scrutinizer feedback.\n\n### 0.1.1\n* Rename file\n\n### 0.1.0\n* Release\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdevstudios%2Fwds-wp-rest-api-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebdevstudios%2Fwds-wp-rest-api-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdevstudios%2Fwds-wp-rest-api-connect/lists"}