From 4e61a41b1ce22fb6e3ca3b22314b682c189ba0a7 Mon Sep 17 00:00:00 2001 From: Josh Cunningham Date: Tue, 12 Jan 2021 08:27:22 -0800 Subject: [PATCH] Adjust file structure to allow for easier installation (#5) * Adjust file structure to allow for easier installation * Update README --- README.md | 9 +++------ composer.json | 4 ++-- .../wp-rest-api-auth0.php | 0 wp-rest-api-auth0-loader.php | 15 +++++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) rename wp-rest-api-auth0.php => src/wp-rest-api-auth0.php (100%) diff --git a/README.md b/README.md index 817666e..fb52e8a 100644 --- a/README.md +++ b/README.md @@ -27,14 +27,11 @@ Install this package: composer require joshcanhelp/wp-rest-api-auth0 ``` -### Install manually +Require the autoloader at some point when `add_action` is available, like in `wp-content/mu-plugins`. -To get this running on an existing WordPress site not managed with Composer: +### Install manually -1. Download or clone this repo outside of your WordPress installation -1. Make a directory called `wp-rest-api-auth0` in the root of the repo and move `wp-rest-api-auth0.php` and `composer.json` into that directory -1. [Download Composer locally](https://getcomposer.org/download/) into that direcory and run `php composer.phar install` there -1. Move `wp-rest-api-auth0-loader.php` and the `wp-rest-api-auth0` directory into the `wp-content/mu-plugins` directory of the WordPress install (make one if it does not exist) +To install this manually without Compsoer, just download the [latest release ZIP](https://github.com/joshcanhelp/wp-rest-api-auth0/releases) and upload through the admin interface. Please note that this plugin will not update automatically; updates will need to be made by deleting and re-adding (make sure your site is in maintenance mode) or directly via an FTP client (not recommended). ## Testing with Docker diff --git a/composer.json b/composer.json index 475d529..7901cf2 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ ], "autoload": { "files": [ - "wp-rest-api-auth0.php" + "src/wp-rest-api-auth0.php" ] } -} +} \ No newline at end of file diff --git a/wp-rest-api-auth0.php b/src/wp-rest-api-auth0.php similarity index 100% rename from wp-rest-api-auth0.php rename to src/wp-rest-api-auth0.php diff --git a/wp-rest-api-auth0-loader.php b/wp-rest-api-auth0-loader.php index 01682ea..40c20a5 100644 --- a/wp-rest-api-auth0-loader.php +++ b/wp-rest-api-auth0-loader.php @@ -1,8 +1,11 @@ + * Author URI: https://www.joshcanhelp.com * * @package WpRestApiAuth0 */ @@ -11,9 +14,9 @@ if ( ! class_exists( 'Auth0\\SDK\\Helpers\\Tokens\\SymmetricVerifier' ) - && is_file( __DIR__ . '/wp-rest-api-auth0/vendor/autoload.php' ) + && is_file( __DIR__ . '/vendor/autoload.php' ) ) { - require_once __DIR__ . '/wp-rest-api-auth0/vendor/autoload.php'; + require_once __DIR__ . '/vendor/autoload.php'; } -require_once __DIR__ . '/wp-rest-api-auth0/wp-rest-api-auth0.php'; +require_once __DIR__ . '/src/wp-rest-api-auth0.php';