Skip to content

Commit 4c2ccb9

Browse files
committed
Ready to release 3.8.0 on wp.org
1 parent ac64759 commit 4c2ccb9

File tree

9 files changed

+178
-151
lines changed

9 files changed

+178
-151
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ All notable changes to **Device Detector** are documented in this *changelog*.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and **Device Detector** adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## [3.8.0] - 2024-05-07
7+
8+
### Changed
9+
- The plugin now adapts its requirements to the PSR-3 loaded version.
10+
611
## [3.7.2] - 2024-05-04
712

813
### Fixed

device-detector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Plugin Name: Device Detector
1111
* Plugin URI: https://perfops.one/device-detector
1212
* Description: Full featured analytics reporting and management tool that detects all devices accessing your WordPress site.
13-
* Version: 3.7.2
13+
* Version: 3.8.0
1414
* Requires at least: 6.2
1515
* Requires PHP: 8.1
1616
* Author: Pierre Lannoy / PerfOps One

includes/libraries/class-libraries.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public static function init() {
136136
'name' => 'DecaLog SDK',
137137
'prefix' => 'DecaLog',
138138
'base' => PODD_VENDOR_DIR . 'decalog-sdk/',
139-
'version' => '4.1.0',
139+
'version' => '4.2.0',
140140
'author' => 'Pierre Lannoy',
141141
'url' => 'https://github.com/Pierre-Lannoy/wp-decalog-sdk',
142142
'license' => 'mit',

includes/libraries/decalog-sdk/Engine.php

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Engine {
2626
* @since 1.0.0
2727
* @var string $version Maintains the engine version.
2828
*/
29-
private static $version = '4.1.0';
29+
private static $version = '4.2.0';
3030

3131
/**
3232
* The logger instances and parameters.
@@ -39,7 +39,7 @@ class Engine {
3939
/**
4040
* Registers a new logger.
4141
*
42-
* @param string $class The class identifier, must be a value in ['plugin', 'theme'].
42+
* @param string $class The class identifier, must be a value in ['plugin', 'theme', 'library'].
4343
* @param string $slug The slug identifier.
4444
* @param string $name The name of the component that will trigger events.
4545
* @param string $version The version of the component that will trigger events.
@@ -82,6 +82,28 @@ public static function getSdkVersion() {
8282
return self::$version;
8383
}
8484

85+
/**
86+
* Get the loaded version of PSR-3.
87+
*
88+
* @return int The PSR-3 main version.
89+
* @since 4.2.0
90+
*/
91+
public static function getPsrVersion() {
92+
if ( class_exists( '\Psr\Log\NullLogger') ) {
93+
$reflection = new \ReflectionMethod(\Psr\Log\NullLogger::class, 'log');
94+
foreach ( $reflection->getParameters() as $param ) {
95+
if ( 'message' === $param->getName() ) {
96+
if ( str_contains($param->getType() ?? '', '|') ) {
97+
return 3;
98+
}
99+
}
100+
}
101+
} else {
102+
return 0;
103+
}
104+
return 1;
105+
}
106+
85107
/**
86108
* Get the version of DecaLog.
87109
*
@@ -106,7 +128,7 @@ public static function getVersionString() {
106128
if ( ! defined( 'DECALOG_PRODUCT_NAME' ) ) {
107129
define( 'DECALOG_PRODUCT_NAME', 'DecaLog' );
108130
}
109-
return DECALOG_PRODUCT_NAME . ' ' . self::getDecalogVersion() . ' (SDK ' . self::getSdkVersion() . ')';
131+
return DECALOG_PRODUCT_NAME . ' ' . self::getDecalogVersion() . ' (SDK ' . self::getSdkVersion() . ' / PSR-3^' . self::getPsrVersion() . ')';
110132
}
111133
return '';
112134
}

includes/libraries/decalog-sdk/EventsLogger.php

Lines changed: 142 additions & 142 deletions
Large diffs are not rendered by default.

includes/libraries/decalog-sdk/MetricsLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class MetricsLogger {
3232
/**
3333
* Initialize the class and set its properties.
3434
*
35-
* @param string $class The class identifier, must be a value in ['plugin', 'theme'].
35+
* @param string $class The class identifier, must be a value in ['plugin', 'theme', 'library'].
3636
* @param string $name Optional. The name of the component that will trigger events.
3737
* @param string $version Optional. The version of the component that will trigger events.
3838
* @since 1.0.0

includes/libraries/decalog-sdk/TracesLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TracesLogger {
3232
/**
3333
* Initialize the class and set its properties.
3434
*
35-
* @param string $class The class identifier, must be a value in ['plugin', 'theme'].
35+
* @param string $class The class identifier, must be a value in ['plugin', 'theme', 'library'].
3636
* @param string $name Optional. The name of the component that will trigger events.
3737
* @param string $version Optional. The version of the component that will trigger events.
3838
* @since 1.0.0

init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
define( 'PODD_PRODUCT_SHORTNAME', 'Device Detector' );
1313
define( 'PODD_PRODUCT_ABBREVIATION', 'podd' );
1414
define( 'PODD_SLUG', 'device-detector' );
15-
define( 'PODD_VERSION', '3.7.2' );
15+
define( 'PODD_VERSION', '3.8.0' );
1616
define( 'PODD_API_VERSION', '3' );
1717
define( 'PODD_CODENAME', '"-"' );
1818

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: bot, detection, detector, device, mobile
44
Requires at least: 6.2
55
Requires PHP: 8.1
66
Tested up to: 6.5
7-
Stable tag: 3.7.2
7+
Stable tag: 3.8.0
88
License: GPLv3
99
License URI: https://www.gnu.org/licenses/gpl-3.0.html
1010

0 commit comments

Comments
 (0)