Skip to content

Commit

Permalink
fixes for bad api keys (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjaudiomv authored Dec 7, 2023
1 parent f16b8de commit ca55deb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM wordpress:6.3.1-php8.2-apache
FROM wordpress:6.4.2-php8.1-apache

RUN apt-get update && \
apt-get install -y --no-install-recommends ssl-cert && \
Expand All @@ -17,4 +17,4 @@ RUN pecl install xdebug-3.2.2 && docker-php-ext-enable xdebug \
&& echo "xdebug.idekey=IDE_DEBUG" >> ${PHP_INI_PATH}

EXPOSE 80
EXPOSE 443
EXPOSE 443
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ This section describes how to install the plugin and get it working.

# Changelog

= 1.8.1 =
* Better handling for bad API keys.

= 1.8.0 =
* Refactored codebase.

Expand Down
10 changes: 5 additions & 5 deletions bmlt-versions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Description: A simple content generator to display the versions and links of the various BMLT components. Add [bmlt_versions] to a page or a post to generate the list.
Author: bmlt-enabled
Author URI: https://bmlt.app
Version: 1.8.0
Version: 1.8.1
Install: Drop this directory into the "wp-content/plugins/" directory and activate it.
*/
/* Disallow direct access to the plugin file */
Expand Down Expand Up @@ -68,7 +68,7 @@ public function bmltVersionsAdminOptionsPage()
?>
<div>
<h2>BMLT Versions</h2>
<p>You must activate a GitHub personal access token to use this plugin. Instructions can be found here <a herf="https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token">https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token</a>.</p>
<p>You must activate a GitHub personal access token to use this plugin. Instructions can be found here <a href="https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token">https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token</a>.</p>
<p>Links for documentation are optional and only configured for [bmlt_versions_simple]. You can find all the documentations pages here <a href="https://bmlt.app">https://bmlt.app</a>. If inputs are left blank, "View Documentation" link will not display on the front end</p>
<form method="post" action="options.php">
<?php settings_fields('bmltVersionsOptionGroup'); ?>
Expand Down Expand Up @@ -311,12 +311,12 @@ public function githubLatestReleaseInfo($repo)

public function githubLatestReleaseVersion($result)
{
return $result['tag_name'];
return $result['tag_name'] ?? '';
}

public function githubLatestReleaseDate($result)
{
return $result['published_at'];
return $result['published_at'] ?? '';
}

public function githubReleaseDescription($repo)
Expand All @@ -343,7 +343,7 @@ public function get($url, $cookies = null)
'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:105.0) Gecko/20100101 Firefox/105.0 +bmltVersions',
'Authorization' => "token $gitHubApiKey"
],
'cookies' => isset($cookies) ? $cookies : null
'cookies' => $cookies ?? null
];

return wp_remote_get($url, $args);
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Contributors: pjaudiomv, GarrettWeinberg, tempsaint, dgershman
Tags: bmlt, meeting list
Tested up to: 6.3.2
Stable tag: 1.8.0
Tested up to: 6.4.2
Stable tag: 1.8.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -45,6 +45,9 @@ This section describes how to install the plugin and get it working.

== Changelog ==

= 1.8.1 =
* Better handling for bad API keys.

= 1.8.0 =
* Refactored codebase.

Expand Down

0 comments on commit ca55deb

Please sign in to comment.