Skip to content

Commit f5f3b1d

Browse files
Fixes bug where scans dont run because of undefined buffer in webpack (#336)
* fixes bug where scans dont run because of undefined buffer from webpack changes * remove node externals, not needed. * bump version for release
1 parent 8af42d1 commit f5f3b1d

File tree

5 files changed

+96
-12
lines changed

5 files changed

+96
-12
lines changed

package-lock.json

Lines changed: 79 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"@wordpress/scripts": "^26.2.0",
3535
"babel-jest": "^26.0",
3636
"babel-loader": "^8.1",
37+
"buffer": "^6.0.3",
3738
"compare-versions": "^4.1",
3839
"ignore-emit-webpack-plugin": "^2.0",
3940
"jest": "^26.0",

plugin/wpengine-phpcompat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: PHP Compatibility Checker
44
* Plugin URI: https://wpengine.com
55
* Description: The WP Engine PHP Compatibility Checker can be used by any WordPress website on any web host to check PHP version compatibility.
6-
* Version: 1.6.2
6+
* Version: 1.6.3
77
* Requires at least: 5.6
88
* Requires PHP: 5.6
99
* Author: WP Engine

readme.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Contributors: wpengine, octalmage, stevenkword, Taylor4484, pross, jcross, rfmeier, cadic, dkotter, ankit-k-gupta, jeffpaul
33
Tags: php 7, php 8, php, version, compat, compatibility, checker, wp engine, wpe, wpengine
44
Requires at least: 5.6
5-
Tested up to: 6.2
6-
Stable tag: 1.6.2
5+
Tested up to: 6.4
6+
Stable tag: 1.6.3
77
License: GPLv2 or later
88
License URI: http://www.gnu.org/licenses/gpl-2.0.html
99

@@ -87,6 +87,9 @@ You will find the plugin options in the WP Admin `Tools => PHP Compatibility` me
8787
2. Compatibility results screen
8888

8989
== Changelog ==
90+
= 1.6.3 =
91+
Fix issue where Buffer was not available to the scans.
92+
9093
= 1.6.2 =
9194
- Update packages.
9295

webpack.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const { merge } = require("webpack-merge");
22
const defaultConfig = require("@wordpress/scripts/config/webpack.config");
33
const DependencyExtractionWebpackPlugin = require("@wordpress/dependency-extraction-webpack-plugin");
44
const path = require("path");
5+
const webpack = require('webpack');
56

67
module.exports = merge(defaultConfig, {
78
output: {
@@ -16,5 +17,13 @@ module.exports = merge(defaultConfig, {
1617
plugin.constructor.name !== "DependencyExtractionWebpackPlugin"
1718
),
1819
new DependencyExtractionWebpackPlugin(),
19-
]
20+
new webpack.ProvidePlugin({
21+
Buffer: ['buffer', 'Buffer'],
22+
}),
23+
],
24+
resolve: {
25+
fallback: {
26+
buffer: require.resolve("buffer/"),
27+
}
28+
}
2029
});

0 commit comments

Comments
 (0)