Skip to content

Commit d0bbabb

Browse files
Merge pull request #7 from jamesmorrison/fix/set-constants-before-calling
Set CF_ACCESS_GITHUB_URL constant before referencing.
2 parents 9e92d26 + d5e0be5 commit d0bbabb

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
All notable changes to this project will be documented in this file, per [the Keep a Changelog standard](http://keepachangelog.com/), and will adhere to [Semantic Versioning](http://semver.org/).
44

5+
## [1.0.4] - 2024-02-24
6+
- Set constant before calling `CF_ACCESS_GITHUB_URL`.
7+
58
## [1.0.3] - 2024-01-26
69
- Added constant `(bool)` `CF_ACCESS_CREATE_ACCOUNT`: whether an account should be created when authenticated through Cloudflare
710
- Added constant `(string)` `CF_ACCESS_NEW_USER_ROLE`: the new user role; defaults to subscriber

cloudflare-access-sso.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* Plugin Name: Cloudflare Access SSO
1212
* Description: Facilitates automatic login to WordPress when domain is protected with Cloudflare Access
13-
* Version: 1.0.3
13+
* Version: 1.0.4
1414
* Plugin URI: https://github.com/jamesmorrison/cloudflare-access-sso
1515
* Author: James Morrison
1616
* Author URI: https://jamesmorrison.uk/
@@ -33,6 +33,13 @@
3333
// Security check
3434
defined( 'ABSPATH' ) || exit;
3535

36+
// Useful global constants
37+
define( 'CF_ACCESS_SSO_PLUGIN_VERSION', '1.0.4' );
38+
define( 'CF_ACCESS_SSO_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
39+
define( 'CF_ACCESS_SSO_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
40+
define( 'CF_ACCESS_SSO_PLUGIN_INC', CF_ACCESS_SSO_PLUGIN_PATH . 'includes/' );
41+
define( 'CF_ACCESS_GITHUB_URL', 'https://github.com/jamesmorrison/cloudflare-access-sso' );
42+
3643
// The Cloudflare Team Name is required
3744
if ( ! defined( 'CF_ACCESS_TEAM_NAME' ) ) {
3845
error_log( 'Cloudflare Access SSO Error: Required constant: CF_ACCESS_TEAM_NAME is not defined.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
@@ -67,13 +74,6 @@
6774
define( 'CF_ACCESS_NEW_USER_ROLE', 'subscriber' );
6875
}
6976

70-
// Useful global constants
71-
define( 'CF_ACCESS_SSO_PLUGIN_VERSION', '1.0.3' );
72-
define( 'CF_ACCESS_SSO_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
73-
define( 'CF_ACCESS_SSO_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
74-
define( 'CF_ACCESS_SSO_PLUGIN_INC', CF_ACCESS_SSO_PLUGIN_PATH . 'includes/' );
75-
define( 'CF_ACCESS_GITHUB_URL', 'https://github.com/jamesmorrison/cloudflare-access-sso' );
76-
7777
// Load plugin classes
7878
if ( ! file_exists( CF_ACCESS_SSO_PLUGIN_PATH . 'vendor/autoload.php' ) ) {
7979
error_log( 'Cloudflare Access SSO Error: Composer dependencies are missing. Please run `composer install` in the plugin directory.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jamesmorrison/cloudflare-access-sso",
33
"description": "Facilitates SSO login to WordPress via Cloudflare Access.",
4-
"version": "1.0.3",
4+
"version": "1.0.4",
55
"type": "wordpress-plugin",
66
"homepage": "https://james.morrison.uk/plugins/cloudflare-access-sso/",
77
"readme": "./readme.md",
@@ -26,5 +26,10 @@
2626
"psr-4": {
2727
"CloudflareAccessSSO\\": "includes/classes/"
2828
}
29+
},
30+
"config": {
31+
"allow-plugins": {
32+
"dealerdirect/phpcodesniffer-composer-installer": true
33+
}
2934
}
3035
}

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)