Skip to content

Commit 7a31e4d

Browse files
authored
Merge pull request #15 from PolyPlugins/version/1.2.1
1.2.1
2 parents 81e0a61 + 3064be4 commit 7a31e4d

7 files changed

Lines changed: 35 additions & 9 deletions

File tree

.wordpress-org/Thumbs.db

47.5 KB
Binary file not shown.

.wordpress-org/icon-128x128.png

9.54 KB
Loading

.wordpress-org/icon-256x256.png

36.7 KB
Loading

README.MD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ Yes, the plugin supports uploading images to the WordPress media library via the
6565

6666
## Changelog
6767

68+
### 1.2.1
69+
* Updated: Tested up to
70+
* Bugfix: Notice design not correct since WP 7
71+
6872
### 1.2.0
6973
* Added: Previous beta feature to send email or Discord message if time elapsed is past last access time
7074
* Updated: Date function to gmdate and replaced unlink calls with wp_delete_file

TODO

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1+
# Update Checklist
2+
[ ] Update Readme
3+
[ ] Update Screenshots
4+
[ ] Plugin Scan
5+
16
# General
2-
[ ] Optimizations
7+
[ ] Make notifications run on a cron
8+
[ ] Have status attribute only accept correct arguments
9+
[ ] Add settings class
10+
[ ] Include last accessed time in responses
11+
[ ] Add endpoint to fetch last accessed time
12+
[ ] Bulk updates
13+

content-api.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin Name: Content API
55
* Plugin URI: https://www.polyplugins.com/contact/
66
* Description: Adds various endpoints to create content
7-
* Version: 1.2.0
7+
* Version: 1.2.1
88
* Requires at least: 6.5
99
* Requires PHP: 7.4
1010
* Author: Poly Plugins
@@ -2595,8 +2595,8 @@ public function maybe_display_last_accessed_notice() {
25952595
<p>Content API Last Accessed: <strong><?php echo esc_html($formatted_time); ?></strong></p>
25962596
</div>
25972597
<?php else : ?>
2598-
<div class="notice <?php echo esc_attr($notice_class); ?>" style="background-color: #D63638; color: #fff;">
2599-
<p>Content API Last Accessed: <strong><?php echo esc_html($formatted_time); ?></strong></p>
2598+
<div class="notice <?php echo esc_attr($notice_class); ?>" style="background-color: #D63638!important; color: #fff!important; border-color: #D63638!important; border-radius: 5px!important;">
2599+
<p style="color: #fff!important;">Content API Last Accessed: <strong><?php echo esc_html($formatted_time); ?></strong></p>
26002600
</div>
26012601
<?php endif; ?>
26022602
<?php
@@ -2778,10 +2778,15 @@ public function maybe_send_last_accessed_email_notification() {
27782778
*/
27792779
public function has_permission(WP_REST_Request $request) {
27802780
$this->options = get_option('content_api_options_polyplugins');
2781-
$token = $this->options['token'];
2781+
$token = isset($this->options['token']) ? $this->options['token'] : '';
2782+
2783+
if (empty($token)) {
2784+
return new WP_Error('not_authorized', "Not Authorized", array('status' => 401));
2785+
}
2786+
27822787
$request_token = $this->get_request_token($request->get_header('authorization'));
2783-
2784-
if ($request_token !== $token) {
2788+
2789+
if (empty($request_token) || !hash_equals($token, $request_token)) {
27852790
return new WP_Error('not_authorized', "Not Authorized", array('status' => 401));
27862791
}
27872792

@@ -3001,6 +3006,8 @@ private function post_data_missing($parameters) {
30013006
* @return string $token The token
30023007
*/
30033008
private function get_request_token($authorization) {
3009+
$token = '';
3010+
30043011
if ($authorization) {
30053012
$parts = explode(' ', $authorization);
30063013

readme.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
=== Content API ===
22
Contributors: polyplugins
33
Tags: content api, rest api, content, creative, api
4-
Tested up to: 6.9
5-
Stable tag: 1.2.0
4+
Tested up to: 7.0
5+
Stable tag: 1.2.1
66
Requires PHP: 7.4
77
License: GPLv3
88
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -84,6 +84,10 @@ Yes, the plugin supports uploading images to the WordPress media library via the
8484

8585
== Changelog ==
8686

87+
= 1.2.1 =
88+
* Updated: Tested up to
89+
* Bugfix: Notice design not correct since WP 7
90+
8791
= 1.2.0 =
8892
* Added: Previous beta feature to send email or Discord message if time elapsed is past last access time
8993
* Updated: Date function to gmdate and replaced unlink calls with wp_delete_file

0 commit comments

Comments
 (0)