From 8a8baa932acea98c8a4129fde6f331a05be524b3 Mon Sep 17 00:00:00 2001 From: pjaudiomv Date: Tue, 21 Jan 2020 21:30:15 -0500 Subject: [PATCH] added settings page for github api token --- README.md | 11 +++---- bmlt-versions/bmlt-versions.php | 51 ++++++++++++++++++++++++++++----- bmlt-versions/readme.txt | 9 ++++-- 3 files changed, 57 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index eabc17c..a475453 100644 --- a/README.md +++ b/README.md @@ -13,21 +13,22 @@ Ex. [bmlt_versions drupal="0"] would not display drupal link. -# MORE INFORMATION - -[https://github.com/bmlt-enabled/bmlt-versions](https://github.com/bmlt-enabled/bmlt-versions) - # Installation This section describes how to install the plugin and get it working. 1. Upload the entire BMLT Versions Plugin folder to the /wp-content/plugins/ directory 2. Activate the plugin through the Plugins menu in WordPress -3. Add [bmlt_versions] shortcode to your Wordpress page/post. +3. Add the GitHub API Token to the BMLT Versions settings page WordPress Dashboard->Settings->BMLT Versions +4. Add [bmlt_versions] shortcode to your Wordpress page/post. # Changelog += 1.3.0 = + +* Added settings page for GitHub API Token. + = 1.2.2 = * Cleanup. diff --git a/bmlt-versions/bmlt-versions.php b/bmlt-versions/bmlt-versions.php index 6db343d..cf7f2c2 100644 --- a/bmlt-versions/bmlt-versions.php +++ b/bmlt-versions/bmlt-versions.php @@ -1,11 +1,11 @@ +
+

BMLT Versions

+
+ + + + + + +
+ +
+
+ Contacts Plugin - ' . $contacts_date . ''; $content .= ''; } + if ($yap) { $content .= '
  • '; $yap_version = $this->githubLatestReleaseVersion('yap'); @@ -179,11 +214,13 @@ public function githubLatestReleaseDate($repo) public function get($url, $cookies = null) { + $gitHubApiKey = get_option('bmltVersionsGithubApiKey'); + $args = array( 'timeout' => '120', 'headers' => array( 'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) +bmltVersions', - 'Authorization' => 'token API_KEY_HERE' + 'Authorization' => "token $gitHubApiKey" ), 'cookies' => isset($cookies) ? $cookies : null ); diff --git a/bmlt-versions/readme.txt b/bmlt-versions/readme.txt index cbcb339..fda73cf 100644 --- a/bmlt-versions/readme.txt +++ b/bmlt-versions/readme.txt @@ -3,7 +3,7 @@ Contributors: pjaudiomv, radius314 Tags: bmlt, meeting list Tested up to: 5.3.2 -Stable tag: 1.2.2 +Stable tag: 1.3.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -29,11 +29,16 @@ This section describes how to install the plugin and get it working. 1. Upload the entire BMLT Versions Plugin folder to the /wp-content/plugins/ directory 2. Activate the plugin through the Plugins menu in WordPress -3. Add [bmlt_versions] shortcode to your Wordpress page/post. +3. Add the GitHub API Token to the BMLT Versions settings page WordPress Dashboard->Settings->BMLT Versions +4. Add [bmlt_versions] shortcode to your Wordpress page/post. == Changelog == += 1.3.0 = + +* Added settings page for GitHub API Token. + = 1.2.2 = * Cleanup.