From 9d274c01d11f1fa9556e9afad7eddc54569e2a46 Mon Sep 17 00:00:00 2001 From: tfrommen Date: Wed, 28 Jun 2017 19:45:02 +0200 Subject: [PATCH] House cleaning. --- README.md | 2 +- bin/readme.txt | 10 +++--- bin/release.sh | 4 +-- book.json | 4 +-- composer.json | 21 ++++++------ inc/admin/class-admin.php | 16 ++++++--- inc/admin/class-listtable.php | 11 +++++++ inc/authentication/namespace.php | 34 +++++++++++++++++-- inc/class-client.php | 11 +++---- inc/endpoints/class-authorization.php | 16 ++++----- inc/endpoints/class-token.php | 14 ++++++++ inc/tokens/class-access-token.php | 24 ++++++++++++-- inc/tokens/class-authorization-code.php | 31 +++++++++++++++-- inc/tokens/class-token.php | 44 ++++++++++++++++++------- inc/tokens/namespace.php | 6 ++++ inc/types/class-authorization-code.php | 11 ++++++- inc/types/class-base.php | 3 +- inc/types/class-implicit.php | 9 +++++ plugin.php | 2 +- theme/oauth2-authorize.php | 3 ++ 20 files changed, 214 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index ef83ebf..92000b9 100755 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This is in extremely early beta, and does not work yet. Please help us out and c This plugin is licensed under the GNU General Public License v2 or later: -> Copyright 2016 by the contributors. +> Copyright 2017 by the contributors. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by diff --git a/bin/readme.txt b/bin/readme.txt index 0f532a9..17b0d27 100644 --- a/bin/readme.txt +++ b/bin/readme.txt @@ -1,8 +1,8 @@ -=== WordPress REST API - OAuth 1.0a Server === +=== WordPress REST API - OAuth 2 Server === Contributors: rmccue, rachelbaker, danielbachhuber, joehoyle Tags: json, rest, api, rest-api -Requires at least: 4.4 -Tested up to: 4.7-alpha +Requires at least: 4.8 +Tested up to: 4.8 Stable tag: {{TAG}} License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -10,6 +10,6 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html == Description == Connect applications to your WordPress site without ever giving away your password. -This plugin uses the OAuth 1.0a protocol to allow delegated authorization; that is, to allow applications to access a site using a set of secondary credentials. This allows server administrators to control which applications can access the site, as well as allowing users to control which applications have access to their data. +This plugin uses the OAuth 2 protocol to allow delegated authorization; that is, to allow applications to access a site using a set of secondary credentials. This allows server administrators to control which applications can access the site, as well as allowing users to control which applications have access to their data. -This plugin only supports WordPress >= 4.4. +This plugin only supports WordPress >= 4.8. diff --git a/bin/release.sh b/bin/release.sh index d055cee..a00e806 100644 --- a/bin/release.sh +++ b/bin/release.sh @@ -4,8 +4,8 @@ TAG=$1 -PLUGIN="rest-api-oauth1" -TMPDIR=/tmp/rest-api-oauth1-release-svn +PLUGIN="rest-api-oauth2" +TMPDIR=/tmp/rest-api-oauth2-release-svn PLUGINDIR="$PWD" PLUGINSVN="https://plugins.svn.wordpress.org/$PLUGIN" diff --git a/book.json b/book.json index aae65b9..53aa259 100644 --- a/book.json +++ b/book.json @@ -6,11 +6,11 @@ "plugins": ["edit-link", "github"], "pluginsConfig": { "edit-link": { - "base": "https://github.com/WP-API/OAuth1/tree/master", + "base": "https://github.com/WP-API/OAuth2/tree/master", "label": "Edit This Page" }, "github": { - "url": "https://github.com/WP-API/OAuth1/" + "url": "https://github.com/WP-API/OAuth2/" } } } diff --git a/composer.json b/composer.json index 39cce50..4267408 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,12 @@ { - "name": "wp-api/oauth1", - "description": "OAuth 1.0a Server for WordPress", - "type": "wordpress-plugin", - "license": "GPL2+", - "authors": [ - { - "name": "WP-API Team", - "homepage": "http://wp-api.org/" - } - ], - "require": {} + "name": "wp-api/oauth2", + "description": "OAuth 2 Server for WordPress", + "type": "wordpress-plugin", + "license": "GPL2+", + "authors": [ + { + "name": "WP-API Team", + "homepage": "http://wp-api.org/" + } + ] } diff --git a/inc/admin/class-admin.php b/inc/admin/class-admin.php index 0d7571a..051d98d 100644 --- a/inc/admin/class-admin.php +++ b/inc/admin/class-admin.php @@ -3,7 +3,6 @@ namespace WP\OAuth2\Admin; use WP\OAuth2\Client; -use WP\OAuth2\Types; use WP_Error; class Admin { @@ -136,6 +135,12 @@ class="add-new-h2">