GithubHelp home page GithubHelp logo

adampatterson / wpoauth Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 59 KB

wpOAuth is a package meant to help with the integration of API services into plugins or themes.

PHP 99.44% CSS 0.56%
php wordpress

wpoauth's Introduction

WordPress oAuth PHP

PHP Composer

A simple oAuth client meant for personal projects

This script is still under development.

Install from Packagist

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);

composer require adampatterson/wpoauth

Tests

$ composer global require phpunit/phpunit
$ export PATH=~/.composer/vendor/bin:$PATH
$ which phpunit
~/.composer/vendor/bin/phpunit

composer run-script test

Local Dev

Run from the themes root.

ln -s ~/Sites/personal/_packages/WpOAuth ./vendor/adampatterson/wpoauth

https://wordpress.org/plugins/transients-manager/

wpoauth's People

Contributors

adampatterson avatar

Watchers

 avatar James Cloos avatar

wpoauth's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.