|
@@ -178,6 +178,8 @@ var Redownload = function() {
|
|
|
offenders.unusedUnicodeRanges = listUnusedUnicodeRanges(results);
|
|
|
metrics.unusedUnicodeRanges = offenders.unusedUnicodeRanges.count;
|
|
|
|
|
|
+ // Detect WordPress
|
|
|
+ metrics.isWordPress = detectWordPress(results);
|
|
|
|
|
|
data.toolsResults.redownload = {
|
|
|
metrics: metrics,
|
|
@@ -741,6 +743,17 @@ var Redownload = function() {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
+ function detectWordPress(requests) {
|
|
|
+ // Check the first file only
|
|
|
+ if (requests[0].isHTML
|
|
|
+ && requests[0].weightCheck.bodyBuffer
|
|
|
+ && requests[0].weightCheck.bodyBuffer.indexOf('/wp-content/') > 0) {
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
function redownloadEntry(entry, httpAuth, proxy) {
|
|
|
var deferred = Q.defer();
|