PHPackages                             adampatterson/wpoauth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. adampatterson/wpoauth

ActiveLibrary[HTTP &amp; Networking](/categories/http)

adampatterson/wpoauth
=====================

0.0.1(5y ago)06[3 issues](https://github.com/adampatterson/WpOAuth/issues)MITPHPCI passing

Since May 1Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/adampatterson/WpOAuth)[ Packagist](https://packagist.org/packages/adampatterson/wpoauth)[ RSS](/packages/adampatterson-wpoauth/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

WordPress oAuth PHP
===================

[](#wordpress-oauth-php)

[![PHP Composer](https://github.com/adampatterson/wpoauth/workflows/PHP%20Composer/badge.svg?branch=main)](https://github.com/adampatterson/wpoauth/workflows/PHP%20Composer/badge.svg?branch=main)

A simple oAuth client meant for personal projects

Note

This script is still under development.

Install from [Packagist](https://packagist.org/packages/adampatterson/wpoauth)
------------------------------------------------------------------------------

[](#install-from-packagist)

```
composer require adampatterson/wpoauth
```

Basic Usage
-----------

[](#basic-usage)

```
$wpOAuthParams = [
    "authUrl"            => "https://auth.com/connect/authorize",
    "tokenUrl"           => "https://auth.com/connect/token",
    "clientRedirect"     => "https://site.com/?callback=wpoauth",
    "clientId"           => CLIENT_ID,
    "clientSecret"       => CLIENT_SECRET,
    "scope"              => "read offline_access",
    "response_type"      => "code",
    "expires_in"         => HOUR_IN_SECONDS - 1,
    "refresh_expires_in" => (WEEK_IN_SECONDS * 2) - 1,
    "transient_prefix"   => 'change_me'
    "should_log"         => true,
    "log_path"           => __DIR__.'/_log.php',
];

$this->wpOAuth = new WpOAuth($wpOAuthParams);
```

Tests
-----

[](#tests)

```
composer install
composer test
```

Local Dev
---------

[](#local-dev)

Run from the theme root.

```
ln -s ~/Sites/packages/WpOAuth ./vendor/adampatterson/wpoauth
```

I'd reccomend using the [WordPress Transients Manager](https://wordpress.org/plugins/transients-manager/) plugin so you can monitor, and invalidate the token storage.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance58

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1889d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/042770de9c0c4d404547538b5a64dfe6f6e4400e212e6db042b541e3bef250c4?d=identicon)[adampatterson](/maintainers/adampatterson)

---

Top Contributors

[![adampatterson](https://avatars.githubusercontent.com/u/31537?v=4)](https://github.com/adampatterson "adampatterson (41 commits)")

---

Tags

phpwordpresshttprequestwordpressGuzzleauthoauth

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/adampatterson-wpoauth/health.svg)

```
[![Health](https://phpackages.com/badges/adampatterson-wpoauth/health.svg)](https://phpackages.com/packages/adampatterson-wpoauth)
```

###  Alternatives

[eljam/guzzle-jwt-middleware

A jwt authentication middleware for guzzle 6

28761.5k3](/packages/eljam-guzzle-jwt-middleware)[openapi/openapi-sdk

Minimal and agnostic PHP SDK for Openapi® (https://openapi.com)

171.4k1](/packages/openapi-openapi-sdk)[art4/requests-psr18-adapter

Use WordPress/Requests as a PSR-18 HTTP client

157.1k](/packages/art4-requests-psr18-adapter)[behamin/service-proxy

for proxy or sending requests to other services with useful utilities

102.2k](/packages/behamin-service-proxy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
