Skip to content

Commit

Permalink
Updates UDD from version 6.3.1 to version 6.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Lannoy committed May 28, 2024
1 parent 09f7035 commit f7d77f2
Show file tree
Hide file tree
Showing 16 changed files with 1,661 additions and 451 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ All notable changes to **Device Detector** are documented in this *changelog*.

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).

## [4.0.0] - 2024-05-xx

### Added
- [BC] To enable installation on more heterogeneous platforms, the plugin now adapts its internal logging mode to already loaded libraries.

### Changed
- Updated DecaLog SDK from version 4.1.0 to version 5.0.0.
- Upgraded UDD from version 6.3.1 to version 6.3.2: dozens of added and improved detections.

### Fixed
- PHP error with some plugins like Woocommerce Paypal Payments.

## [3.8.0] - 2024-05-07

### Changed
Expand Down
30 changes: 19 additions & 11 deletions includes/libraries/decalog-sdk/Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Engine {
* @since 1.0.0
* @var string $version Maintains the engine version.
*/
private static $version = '4.2.0';
private static $version = '5.0.0';

/**
* The logger instances and parameters.
Expand Down Expand Up @@ -89,19 +89,27 @@ public static function getSdkVersion() {
* @since 4.2.0
*/
public static function getPsrVersion() {
if ( class_exists( '\Psr\Log\NullLogger') ) {
$reflection = new \ReflectionMethod(\Psr\Log\NullLogger::class, 'log');
foreach ( $reflection->getParameters() as $param ) {
if ( 'message' === $param->getName() ) {
if ( str_contains($param->getType() ?? '', '|') ) {
return 3;
$required = 1;
if ( ! defined( 'DECALOG_PSR_LOG_VERSION') ) {
define( 'DECALOG_PSR_LOG_VERSION', 'V1' );
}
switch ( strtolower( DECALOG_PSR_LOG_VERSION ) ) {
case 'v3':
$required = 3;
break;
case 'auto':
if ( class_exists( '\Psr\Log\NullLogger') ) {
$reflection = new \ReflectionMethod(\Psr\Log\NullLogger::class, 'log');
foreach ( $reflection->getParameters() as $param ) {
if ( 'message' === $param->getName() ) {
if ( str_contains($param->getType() ?? '', '|') ) {
$required = 3;
}
}
}
}
}
} else {
return 0;
}
return 1;
return $required;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion includes/libraries/decalog-sdk/EventsLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public function log( $level, string|\Stringable $message, array $context = [] ):
}
}

} else { // if version in not detected or equal to 1
} else {

/**
* DecaLog PSR-3 logger class. Failsafe for old PSR-3 versions.
Expand Down
4 changes: 2 additions & 2 deletions includes/libraries/udd/DeviceDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class DeviceDetector
/**
* Current version number of DeviceDetector
*/
public const VERSION = '6.3.1';
public const VERSION = '6.3.2';

/**
* Constant used as value for unknown browser / os
Expand Down Expand Up @@ -776,7 +776,7 @@ protected function getOsAttribute(string $attr): string
*/
protected function hasAndroidTableFragment(): bool
{
$regex = 'Android( [\.0-9]+)?; Tablet;|.*\-tablet$';
$regex = 'Android( [\.0-9]+)?; Tablet;|Tablet(?! PC)|.*\-tablet$';

return !!$this->matchUserAgent($regex);
}
Expand Down
6 changes: 4 additions & 2 deletions includes/libraries/udd/Parser/Client/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ class Browser extends AbstractClientParser
'MY' => 'Mypal',
'MR' => 'Monument Browser',
'MW' => 'MAUI WAP Browser',
'N7' => 'Naenara Browser',
'NW' => 'Navigateur Web',
'NK' => 'Naked Browser',
'NA' => 'Naked Browser Pro',
Expand All @@ -414,6 +415,7 @@ class Browser extends AbstractClientParser
'N2' => 'Norton Private Browser',
'NX' => 'Nox Browser',
'N1' => 'NOMone VR Browser',
'N6' => 'NOOK Browser',
'NE' => 'NetSurf',
'NF' => 'NetFront',
'NL' => 'NetFront Life',
Expand Down Expand Up @@ -723,7 +725,7 @@ class Browser extends AbstractClientParser
'IW', 'LH', 'LY', 'MB', 'MN', 'MO', 'MY', 'OA', 'OS',
'PI', 'PX', 'QA', 'S5', 'SX', 'TF', 'TO', 'WF', 'ZV',
'FP', 'AD', 'WL', '2I', 'P9', 'KJ', 'WY', 'VK', 'W5',
'7C',
'7C', 'N7',
],
'Internet Explorer' => ['IE', 'CZ', 'BZ', 'IM', 'PS', '3A', '4A', 'RN'],
'Konqueror' => ['KO'],
Expand Down Expand Up @@ -761,7 +763,7 @@ class Browser extends AbstractClientParser
'H5', 'V3', 'G2', 'BG', 'OL', 'II', 'TL', 'M6', 'Y3',
'M7', 'GN', 'D3', 'IG', 'HW', '4O', 'OU', '5P', 'KE',
'5A', 'TT', '6P', 'G3', '7P', 'VU', 'F8', 'L4', 'DK',
'DP', 'KL', 'K4',
'DP', 'KL', 'K4', 'N6',
];

/**
Expand Down
Loading

0 comments on commit f7d77f2

Please sign in to comment.