Skip to content

Commit

Permalink
adds wordpress detection
Browse files Browse the repository at this point in the history
  • Loading branch information
housseindjirdeh committed Mar 5, 2019
1 parent 9ece296 commit 2ab612a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Binary file added icons/wordpress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions library/libraries.js
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,21 @@ var d41d8cd98f00b204e9800998ecf8427e_LibraryDetectorTests = {
return false;
}
},
'WordPress': {
icon: 'wordpress',
url: 'https://wordpress.org/',
npm: null,
test: function (win) {
if (!!document.querySelector('meta[name=generator][content^="WordPress"]')) {
var versionName = document.querySelector("meta[name='generator']").getAttribute("content");
return { version: versionName.replace(/[^0-9\.]+/g,"") };
}
else if (!!document.querySelectorAll('link[href*="wp-includes"], script[src*="wp-includes"]').length) {
return { version: UNKNOWN_VERSION };
}
return false;
}
},
'Workbox': {
icon: 'workbox',
url: 'https://developers.google.com/web/tools/workbox/',
Expand Down

0 comments on commit 2ab612a

Please sign in to comment.