diff --git a/icons/wordpress.png b/icons/wordpress.png new file mode 100644 index 0000000..88bd883 Binary files /dev/null and b/icons/wordpress.png differ diff --git a/library/libraries.js b/library/libraries.js index 257353e..edb921c 100644 --- a/library/libraries.js +++ b/library/libraries.js @@ -1361,6 +1361,21 @@ var d41d8cd98f00b204e9800998ecf8427e_LibraryDetectorTests = { return false; } }, + 'WordPress': { + icon: 'wordpress', + url: 'https://wordpress.org/', + npm: null, + test: function (win) { + const hasAPILinkElem = !!document.querySelector('link[rel="https://api.w.org/"]'); + const hasWPIncludes = !!document.querySelectorAll('link[href*="wp-includes"], script[src*="wp-includes"]').length; + + if (!hasAPILinkElem && !hasWPIncludes) return false; + + const generatorMeta = document.querySelector('meta[name=generator][content^="WordPress"]') + const version = generatorMeta ? generatorMeta.getAttribute("content").replace(/^\w+\s/,'') : UNKNOWN_VERSION; + return { version }; + } + }, 'Workbox': { icon: 'workbox', url: 'https://developers.google.com/web/tools/workbox/',