Skip to content

Commit

Permalink
1.0.0-beta.3
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasplevy committed Aug 19, 2019
1 parent 1f4e0c2 commit 85d80ce
Show file tree
Hide file tree
Showing 19 changed files with 106 additions and 81 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
LifterLMS REST API Changelog
============================

v1.0.0-beta.3 - 2019-08-19
--------------------------

##### Interface and Experience improvements during API Key creation

+ Better expose that API Keys are never shown again after the initial creation.
+ Allow downloading of API Credentials as a `.txt` file.
+ Add `required` properties to required fields.

##### Updates

+ Added the ability to CRUD webhooks via the REST API.
+ Conditionally throw `_doing_it_wrong` on server controller stubs.
+ Improve performance by returning early when errors are encountered for various methods.
+ Utilizes a new custom property `show_in_llms_rest` to determine if taxonomies should be displayed in the LifterLMS REST API.
+ On the webhooks table the "Delivery URL" is trimmed to 40 characters to improve table readability.

##### Bug fixes

+ Fixed a formatting error when creating webhooks with the default auto-generated webhook name.
+ On the webhooks table a translatable string is output for the status instead of the database value.
+ Fix an issue causing the "Last" page pagination link to display for lists with 0 possible results.
+ Don't output the "Last" page pagination link on the last page.


v1.0.0-beta.2 - 2019-08-15
--------------------------

Expand Down
2 changes: 1 addition & 1 deletion class-lifterlms-rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package LifterLMS_REST_API/Classes
*
* @since 1.0.0-beta.1
* @version [version]
* @version 1.0.0-beta.3
*/

defined( 'ABSPATH' ) || exit;
Expand Down
6 changes: 3 additions & 3 deletions includes/abstracts/class-llms-rest-controller-stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @package LifterLMS_REST/Abstracts
*
* @since 1.0.0-beta.1
* @version [version]
* @version 1.0.0-beta.3
*/

defined( 'ABSPATH' ) || exit;
Expand All @@ -16,7 +16,7 @@
* LLMS_REST_Controller_Stubs class.
*
* @since 1.0.0-beta.1
* @since [version] Conditionally throw `_doing_it_wrong()` on stub method.
* @since 1.0.0-beta.3 Conditionally throw `_doing_it_wrong()` on stub method.
*/
abstract class LLMS_REST_Controller_Stubs extends WP_REST_Controller {

Expand Down Expand Up @@ -175,7 +175,7 @@ protected function get_pagination_data_from_query( $query, $prepared, $request )
* Prepare an object for response.
*
* @since 1.0.0-beta.1
* @since [version] Conditionally throw `_doing_it_wrong()`.
* @since 1.0.0-beta.3 Conditionally throw `_doing_it_wrong()`.
*
* @param LLMS_Abstract_User_Data $object User object.
* @param WP_REST_Request $request Request object.
Expand Down
8 changes: 4 additions & 4 deletions includes/abstracts/class-llms-rest-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package LifterLMS_REST/Abstracts
*
* @since 1.0.0-beta.1
* @version [version]
* @version 1.0.0-beta.3
*/

defined( 'ABSPATH' ) || exit;
Expand All @@ -14,7 +14,7 @@
* LLMS_REST_Controller class..
*
* @since 1.0.0-beta.1
* @since [version] Fix an issue displaying a last page for lists with 0 possible results & handle error conditions early in responses.
* @since 1.0.0-beta.3 Fix an issue displaying a last page for lists with 0 possible results & handle error conditions early in responses.
*/
abstract class LLMS_REST_Controller extends LLMS_REST_Controller_Stubs {

Expand Down Expand Up @@ -181,7 +181,7 @@ public function get_item( $request ) {
* Retrieves all users.
*
* @since 1.0.0-beta.1
* @since [version] Fix an issue displaying a last page for lists with 0 possible results.
* @since 1.0.0-beta.3 Fix an issue displaying a last page for lists with 0 possible results.
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
Expand Down Expand Up @@ -338,7 +338,7 @@ protected function prepare_item_for_database( $request ) {
* Prepares a single object for response.
*
* @since 1.0.0-beta.1
* @since [version] Return early with a WP_Error if `$object` is a WP_Error
* @since 1.0.0-beta.3 Return early with a WP_Error if `$object` is a WP_Error
*
* @param obj $object Raw object from database.
* @param WP_REST_Request $request Request object.
Expand Down
8 changes: 4 additions & 4 deletions includes/abstracts/class-llms-rest-posts-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @since 1.0.0-beta.1
* @since 1.0.0-beta.2 Filter taxonomies by `public` property instead of `show_in_rest`.
* @since [version] Filter taxonomies by `show_in_llms_rest` property instead of `public`.
* @since 1.0.0-beta.3 Filter taxonomies by `show_in_llms_rest` property instead of `public`.
*/
abstract class LLMS_REST_Posts_Controller extends LLMS_REST_Controller {

Expand Down Expand Up @@ -1134,7 +1134,7 @@ abstract protected function create_llms_post( $object_args );
*
* @since 1.0.0-beta.1
* @since 1.0.0-beta.2 Filter taxonomies by `public` property instead of `show_in_rest`.
* @since [version] Filter taxonomies by `show_in_llms_rest` property instead of `public`.
* @since 1.0.0-beta.3 Filter taxonomies by `show_in_llms_rest` property instead of `public`.
*
* @param LLMS_Post_Model $object Object data.
* @return array Links for the given object.
Expand Down Expand Up @@ -1351,7 +1351,7 @@ protected function handle_featured_media( $featured_media, $object_id ) {
*
* @since 1.0.0-beta.1
* @since 1.0.0-beta.2 Filter taxonomies by `public` property instead of `show_in_rest`.
* @since [version] Filter taxonomies by `show_in_llms_rest` property instead of `public`.
* @since 1.0.0-beta.3 Filter taxonomies by `show_in_llms_rest` property instead of `public`.
*
* @param int $object_id The post ID to update the terms form.
* @param WP_REST_Request $request The request object with post and terms data.
Expand Down Expand Up @@ -1381,7 +1381,7 @@ protected function handle_terms( $object_id, $request ) {
* Heavily based on WP_REST_Posts_Controller::check_assign_terms_permission().
*
* @since 1.0.0-beta.1
* @since [version] Filter taxonomies by `show_in_llms_rest` property instead of `public`.
* @since 1.0.0-beta.3 Filter taxonomies by `show_in_llms_rest` property instead of `public`.
*
* @param WP_REST_Request $request The request object with post and terms data.
* @return bool Whether the current user can assign the provided terms.
Expand Down
10 changes: 5 additions & 5 deletions includes/admin/class-llms-rest-admin-form-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package LifterLMS_REST/Admin/Classes
*
* @since 1.0.0-beta.1
* @version [version]
* @version 1.0.0-beta.3
*/

defined( 'ABSPATH' ) || exit;
Expand All @@ -14,7 +14,7 @@
* LLMS_REST_Admin_Form_Controller class..
*
* @since 1.0.0-beta.1
* @since [version] Added API credential download methods.
* @since 1.0.0-beta.3 Added API credential download methods.
*/
class LLMS_REST_Admin_Form_Controller {

Expand All @@ -35,7 +35,7 @@ public function __construct() {
* Handles submission of admin forms & nonce links.
*
* @since 1.0.0-beta.1
* @since [version] Added logic for handling api key txt download via nonce link.
* @since 1.0.0-beta.3 Added logic for handling api key txt download via nonce link.
*
* @return false|void
*/
Expand Down Expand Up @@ -66,7 +66,7 @@ public function handle_events() {
/**
* Generate and download a api key credentials file.
*
* @since [version]
* @since 1.0.0-beta.3
*
* @return false|void
*/
Expand Down Expand Up @@ -149,7 +149,7 @@ protected function handle_webhook_upsert() {
/**
* Validates `GET` information from the credential download URL and prepares information for generating the file.
*
* @since [version]
* @since 1.0.0-beta.3
*
* @return false|array
*/
Expand Down
8 changes: 4 additions & 4 deletions includes/admin/class-llms-rest-admin-settings-api-keys.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package LifterLMS_REST/Admin/Classes
*
* @since 1.0.0-beta.1
* @version [version]
* @version 1.0.0-beta.3
*/

defined( 'ABSPATH' ) || exit;
Expand All @@ -14,7 +14,7 @@
* Admin Settings Page: REST API
*
* @since 1.0.0-beta.1
* @since [version] Improve UX of key generation and updates.
* @since 1.0.0-beta.3 Improve UX of key generation and updates.
*/
class LLMS_Rest_Admin_Settings_API_Keys {

Expand All @@ -31,7 +31,7 @@ class LLMS_Rest_Admin_Settings_API_Keys {
* Get settings fields for the Keys tab.
*
* @since 1.0.0-beta.1
* @since [version] Add "required" to the description field, add helper text, & add credential download option after generation.
* @since 1.0.0-beta.3 Add "required" to the description field, add helper text, & add credential download option after generation.
*
* @return array
*/
Expand Down Expand Up @@ -229,7 +229,7 @@ public static function get_fields() {
* Form handler to save Create / Update an API key.
*
* @since 1.0.0-beta.1
* @since [version] Remove key copy message in favor of message directly above the key fields.
* @since 1.0.0-beta.3 Remove key copy message in favor of message directly above the key fields.
*
* @return null|LLMS_REST_API_Key|WP_Error
*/
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/tables/class-llms-rest-table-webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* LLMS_REST_Table_Webhooks class..
*
* @since 1.0.0-beta.1
* @since [version] Output translated status instead of the database value; trim the delivery URL to 40 characters.
* @since 1.0.0-beta.3 Output translated status instead of the database value; trim the delivery URL to 40 characters.
*/
class LLMS_REST_Table_Webhooks extends LLMS_Admin_Table {

Expand Down Expand Up @@ -59,7 +59,7 @@ protected function get_name_cell( $webhook ) {
* Retrieve data for the columns
*
* @since 1.0.0-beta.1
* @since [version] Output translated status instead of the database value; trim the delivery URL to 40 characters.
* @since 1.0.0-beta.3 Output translated status instead of the database value; trim the delivery URL to 40 characters.
*
* @param string $key the column id / key.
* @param LLMS_REST_API_Key $webhook API key object.
Expand Down
6 changes: 3 additions & 3 deletions includes/class-llms-rest-webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package LifterLMS_REST/Classes
*
* @since 1.0.0-beta.1
* @version [version]
* @version 1.0.0-beta.3
*/

defined( 'ABSPATH' ) || exit;
Expand All @@ -14,7 +14,7 @@
* LLMS_REST_Webhooks class.
*
* @since 1.0.0-beta.1
* @since [version] Fix formatting error on the default webhook name string.
* @since 1.0.0-beta.3 Fix formatting error on the default webhook name string.
*/
class LLMS_REST_Webhooks extends LLMS_REST_Database_Resource {

Expand Down Expand Up @@ -106,7 +106,7 @@ public function get_admin_url() {
* Overrides parent to dynamically set the class variable since several defaults are generated through functions.
*
* @since 1.0.0-beta.1
* @since [version] Fix formatting error.
* @since 1.0.0-beta.3 Fix formatting error.
*
* @return array
*/
Expand Down
4 changes: 2 additions & 2 deletions includes/server/class-llms-rest-enrollments-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* LLMS_REST_Enrollments_Controller
*
* @since 1.0.0-beta.1
* @since [version] Don't output "Last" page link header on the last page.
* @since 1.0.0-beta.3 Don't output "Last" page link header on the last page.
*/
class LLMS_REST_Enrollments_Controller extends LLMS_REST_Controller {

Expand Down Expand Up @@ -136,7 +136,7 @@ public function get_items_permissions_check( $request ) {
* Get a collection of enrollments.
*
* @since 1.0.0-beta.1
* @since [version] Don't output "Last" page link header on the last page.
* @since 1.0.0-beta.3 Don't output "Last" page link header on the last page.
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_Error|WP_REST_Response
Expand Down
Loading

0 comments on commit 85d80ce

Please sign in to comment.