Skip to content
This repository was archived by the owner on Apr 27, 2021. It is now read-only.

Commit 4082858

Browse files
committed
do not log traffic while the plugin is not configured
1 parent c2246b3 commit 4082858

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin Name: redirection.io
55
* Plugin URI: https://redirection.io
66
* Description: Proxy client for redirection.io | Put an end to 404 errors - Track HTTP errors and setup useful HTTP redirections
7-
* Version: 0.2.0
7+
* Version: 0.2.1
88
* Author: redirection-io
99
* Author Website: https://redirection.io
1010
* Text Domain: redirectionio

src/RedirectionIO.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class RedirectionIO
1717
{
1818
private $client;
1919

20+
private $missConfigured = false;
21+
2022
private $lastRuleId = null;
2123

2224
public function __construct()
@@ -45,6 +47,7 @@ public function findRedirect()
4547
$connections = [];
4648

4749
if (false === $options || empty($options['projectKey']) || !isset($options['connections'])) {
50+
$this->missConfigured = true;
4851
return false;
4952
}
5053

@@ -95,6 +98,10 @@ public function findRedirect()
9598

9699
public function log()
97100
{
101+
if ($this->missConfigured) {
102+
return;
103+
}
104+
98105
$scheme = 'http';
99106

100107
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {

0 commit comments

Comments
 (0)