From 22c57d23df0b73ec4404d9af29c5add94bdf80ad Mon Sep 17 00:00:00 2001 From: Kyle Leaders Date: Tue, 6 Jun 2023 11:46:26 -0700 Subject: [PATCH 1/2] Updating to 1.2.1, minor documentation changes. --- includes/exceptions.php | 8 ++++---- multisite-json-api.php | 9 ++++----- public/class-multisite-json-api.php | 6 +++--- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/includes/exceptions.php b/includes/exceptions.php index c6b17b4..e44caa6 100644 --- a/includes/exceptions.php +++ b/includes/exceptions.php @@ -5,7 +5,7 @@ class GenericException extends \Exception { public $url; public $id; - public function __construct($message = '', $id = '', $url = 'http://github.com/remkade/multisite-json-api', $code = 400, Exception $previous = null) { + public function __construct($message = '', $id = '', $url = 'https://github.com/remkade/multisite-json-api', $code = 400, Exception $previous = null) { parent::__construct($message, $code); $this->url = $url; $this->id = $id; @@ -13,18 +13,18 @@ public function __construct($message = '', $id = '', $url = 'http://github.com/r } class SiteNotFoundException extends GenericException { - public function __construct($message = 'Unable to Find Site', $id = 'site_not_found', $url = 'http://github.com/remkade/multisite-json-api') { + public function __construct($message = 'Unable to Find Site', $id = 'site_not_found', $url = 'https://github.com/remkade/multisite-json-api') { parent::__construct($message, $id, $url, 404); } } class SiteCreationException extends GenericException { - public function __construct($message = 'Error Creating Site', $id = 'site_creation_error', $url = 'http://github.com/remkade/multisite-json-api') { + public function __construct($message = 'Error Creating Site', $id = 'site_creation_error', $url = 'https://github.com/remkade/multisite-json-api') { parent::__construct($message, $id, $url, 400); } } class UserCreationException extends GenericException { - public function __construct($message = 'Error Creating User', $id = 'user_creation_error', $url = 'http://github.com/remkade/multisite-json-api') { + public function __construct($message = 'Error Creating User', $id = 'user_creation_error', $url = 'https://github.com/remkade/multisite-json-api') { parent::__construct($message, $id, $url, 400); } } diff --git a/multisite-json-api.php b/multisite-json-api.php index 5cdb1cd..fef9379 100644 --- a/multisite-json-api.php +++ b/multisite-json-api.php @@ -6,16 +6,16 @@ * also follow WordPress Coding Standards and PHP best practices. * * @package Multisite_JSON_API - * @author Kyle Leaders + * @author Kyle Leaders * @license GPL-2.0+ - * @link http://technicasites.com - * @copyright 2014 Technica Sites LLC + * @link https://technicasites.com/ + * @copyright 2023 Technica Sites LLC * * @wordpress-plugin * Plugin Name: Multisite JSON API * Plugin URI: http://github.com/remkade/multisite-json-api * Description: A JSON API for managing multisite sites - * Version: 1.2.0 + * Version: 1.2.1 * Author: Kyle Leaders * Author URI: http://github.com/remkade * Text Domain: en_US @@ -58,5 +58,4 @@ if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { require_once( plugin_dir_path( __FILE__ ) . 'admin/class-multisite-json-api-admin.php' ); add_action( 'plugins_loaded', array( 'Multisite_JSON_API_Admin', 'get_instance' ) ); - } diff --git a/public/class-multisite-json-api.php b/public/class-multisite-json-api.php index a019dd2..745ba25 100644 --- a/public/class-multisite-json-api.php +++ b/public/class-multisite-json-api.php @@ -5,8 +5,8 @@ * @package Multsite_JSON_API * @author Kyle Leaders * @license GPL-2.0+ - * @link http://github.com/remkade/multisite-json-api - * @copyright 2014 Kyle Leaders + * @link https://github.com/remkade/multisite-json-api + * @copyright 2023 Technica Sites LLC */ /** @@ -30,7 +30,7 @@ class Multisite_JSON_API { * * @var string */ - const VERSION = '1.2.0'; + const VERSION = '1.2.1'; /** * @TODO - Rename "plugin-name" to the name of your plugin From 1809c8e149f0019b6eb9bdd700add38d2516428c Mon Sep 17 00:00:00 2001 From: Kyle Leaders Date: Tue, 6 Jun 2023 14:46:02 -0700 Subject: [PATCH 2/2] http: -> https: --- README.txt | 2 +- admin/class-multisite-json-api-admin.php | 2 +- includes/class-endpoint.php | 4 ++-- multisite-json-api.php | 6 +++--- tests/EndpointTest.php | 10 +++++----- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.txt b/README.txt index d1be8d4..1fc7aa3 100644 --- a/README.txt +++ b/README.txt @@ -45,7 +45,7 @@ You can install this using all the usual methods. The only thing different is th = Where is the documentation for the API? = -Take a look at the [github page](http://github.com/remkade/multisite-json-api/) for the full documentation. +Take a look at the [github page](https://github.com/remkade/multisite-json-api/) for the full documentation. == Screenshots == diff --git a/admin/class-multisite-json-api-admin.php b/admin/class-multisite-json-api-admin.php index 2b4361e..f48b3ef 100644 --- a/admin/class-multisite-json-api-admin.php +++ b/admin/class-multisite-json-api-admin.php @@ -5,7 +5,7 @@ * @package Multisite_JSON_API_Admin * @author Kyle Leaders * @license GPL-2.0+ - * @link http://github.com/remkade/multisite-json-api/ + * @link https://github.com/remkade/multisite-json-api/ * @copyright 2014 Kyle Leaders */ diff --git a/includes/class-endpoint.php b/includes/class-endpoint.php index f9d2e96..b4cd178 100644 --- a/includes/class-endpoint.php +++ b/includes/class-endpoint.php @@ -25,7 +25,7 @@ public function respond_with_json($payload, $status=200) { * @since '0.0.1' * @return void */ - public function error($error, $error_id, $status=400, $url='http://github.com/remkade/multisite-json-api/wiki') { + public function error($error, $error_id, $status=400, $url='https://github.com/remkade/multisite-json-api/wiki') { $output = array('id'=> $error_id, 'message' => $error, 'url' => $url); $this->respond_with_json($output, $status); } @@ -232,7 +232,7 @@ public function get_site_by_id($id) { public function content_for_admin_site_creation_notification($site_id) { $site = $this->get_site_by_id($site_id); if($site) { - $url = 'http://'.$site->domain.$site->path; + $url = 'https://'.$site->domain.$site->path; return sprintf("New site created by Multisite JSON API\n\n\tUser: %s\n\n\n\tAddress: %s", wp_get_current_user()->login, $url); diff --git a/multisite-json-api.php b/multisite-json-api.php index fef9379..3551f13 100644 --- a/multisite-json-api.php +++ b/multisite-json-api.php @@ -13,14 +13,14 @@ * * @wordpress-plugin * Plugin Name: Multisite JSON API - * Plugin URI: http://github.com/remkade/multisite-json-api + * Plugin URI: https://github.com/remkade/multisite-json-api * Description: A JSON API for managing multisite sites * Version: 1.2.1 * Author: Kyle Leaders - * Author URI: http://github.com/remkade + * Author URI: https://github.com/remkade * Text Domain: en_US * License: GPL-2.0+ - * License URI: http://www.gnu.org/licenses/gpl-2.0.txt + * License URI: https://www.gnu.org/licenses/gpl-2.0.txt * Domain Path: /languages * GitHub Plugin URI: https://github.com/remkade/multisite-json-api * WordPress-Plugin-Boilerplate: v2.6.1 diff --git a/tests/EndpointTest.php b/tests/EndpointTest.php index 47c5d64..2aefc6e 100644 --- a/tests/EndpointTest.php +++ b/tests/EndpointTest.php @@ -18,12 +18,12 @@ protected function setUp() : void { } public function testErrorConformsToHerokuErrors(){ - $this->expectOutputString("{\n \"id\": \"error_id\",\n \"message\": \"Error!\",\n \"url\": \"http://github.com/remkade/multisite-json-api/wiki\"\n}"); + $this->expectOutputString("{\n \"id\": \"error_id\",\n \"message\": \"Error!\",\n \"url\": \"https://github.com/remkade/multisite-json-api/wiki\"\n}"); $this->api->error("Error!", "error_id", 400); } public function testJSONException(){ - $this->expectOutputString("{\n \"id\": \"site_creation_error\",\n \"message\": \"Error Creating Site\",\n \"url\": \"http://github.com/remkade/multisite-json-api\"\n}"); + $this->expectOutputString("{\n \"id\": \"site_creation_error\",\n \"message\": \"Error Creating Site\",\n \"url\": \"https://github.com/remkade/multisite-json-api\"\n}"); $this->api->json_exception(new SiteCreationException()); } @@ -264,7 +264,7 @@ public function testGetMissingSiteById() { public function testContentsForAdminSiteNotification() { $output = $this->api->content_for_admin_site_creation_notification(2); - $this->assertEquals("New site created by Multisite JSON API\n\n\tUser: user\n\n\n\tAddress: http://widgets.example.com/", $output); + $this->assertEquals("New site created by Multisite JSON API\n\n\tUser: user\n\n\n\tAddress: https://widgets.example.com/", $output); } public function testContentsForAdminSiteNotificationWithMissingSite() { @@ -275,14 +275,14 @@ public function testContentsForAdminSiteNotificationWithMissingSite() { public function testSanityCheckWhenNotMultisiteButActive() { self::$is_multisite = false; self::$plugin_is_active = true; - $this->expectOutputString("{\n \"id\": \"not_multisite\",\n \"message\": \"This is not a multisite install! Please enable multisite to use this plugin.\",\n \"url\": \"http://codex.wordpress.org/Create_A_Network\"\n}"); + $this->expectOutputString("{\n \"id\": \"not_multisite\",\n \"message\": \"This is not a multisite install! Please enable multisite to use this plugin.\",\n \"url\": \"https://codex.wordpress.org/Create_A_Network\"\n}"); $this->api->sanity_check(); } public function testSanityCheckWhenActivatedButNotMultiSite() { self::$is_multisite = true; self::$plugin_is_active = false; - $this->expectOutputString("{\n \"id\": \"plugin_not_active\",\n \"message\": \"This plugin is not active, please activate it network wide before using.\",\n \"url\": \"http://codex.wordpress.org/Create_A_Network\"\n}"); + $this->expectOutputString("{\n \"id\": \"plugin_not_active\",\n \"message\": \"This plugin is not active, please activate it network wide before using.\",\n \"url\": \"https://codex.wordpress.org/Create_A_Network\"\n}"); $this->api->sanity_check(); }