Releases: marknotton/craft-plugin-agent
Releases · marknotton/craft-plugin-agent
Changes to how User Agents are handled, and updates to the Javascript Agent functions.
Changed
- User agent exceptiones are now handled earlier on in the Services init method, rather than each time the 'Check' method is called.
- User agent matches will no longer return
true
during the 'Check' method, but instead uses Jenssegers "setUserAgent" method to edit the user agent string to a fallback. The fallback defaults to a "Chrome 81 on Windows" string and be can modified in the agents config file. This will not amend your true browser User Agent, it only changes the user agent string referenced in this plugin. - Breaking Since version 1.1.7 - Adding custom user agent exceptions in the config file meant defining a 'checkExceptions' value. This is now renamed to 'userAgentExceptions'.
Updated
- The Javaacript class is now formatted to ES5 isntead of ES6. So the ES5 version has been removed.
- The Javaacript classes viewport related methods are removed as they were not-inkeeping with the nature of this plugin. Only data-attribute querying methods remain.
- The Javaacript class is now IIFE instead of a Class.
Fixes for the "Check" method including the option to add user agent exceptopms
Added
- Issue 7 - You can add bespoke user agents to a configs file which will allow the "Check" method to pass. This will help in circumstances where bots using uncommon agent strings were failing for one reason or the other.
Fixed
- Issue 6 - Empty user agents now return false.
- In some cases where the user agent version was 0 but the user agent name was corrent, the "check" method would return false. Also, when the version was 0 but the user agent name was incorrect the "check" method would returns true. This mixmatch of rules is now working as expected.
Updated
- Composer dependency versions
Fixed 'HTTP_USER_AGENT' error for non-human traffic
There were circumstances where non-human traffic would throw an error because the 'HTTP_USER_AGENT' didn't exist.
Fixes issues where the new Googlebot user agents aren't flagged correctly.
Fixed
The new version of Googlebot (smartphone) emulates Chrome 41, which shouldn't really be flagged as an unsupported browser given it's actually a bot. So there are now user agent exceptions (specifically tailored to Google for now) that will allow trusted bots to access the site regardless of version number or browser name. In a future update this will be manageable via the plugins settings.
Added ES5 Babelified agent.es5.js distribution file.
Added
- ES5 Babelified agent.es5.js distribution file.
Version Number Update
Changed
- Version number as-per the last commit because the last set of changes didn't seem to appear in the commit.
Redirect function breaking
Fixed
- Redirect function breaks in cases where user agents versions can't be read. To avoid new browsers from being redirected incorrectly, we have to allow browsers coming back with versions 0 regardless of any other criteria.
Agent.js now includes a rudimentary check for touch devices.
### Fixed - Read Me typo
Check function rewritten and fixed.
Changed
- Checks function has been completely rewritten. Instead of checking if criteria is not met, it now does the opposite. This is far more legible and should have been this way in the first place. It's also much quicker and removes redundant code.
Fixed
- Schema issues that occurred in the previous release.
Resolved a schema versioning error
Fixed a schema-versioning bug that's preventing the plugin from being able to install via the Plugin Store.