73% mine-metamask

Code Review | Login and Pay with Metamask

WordPress plugin Login and Pay with Metamask scored73%from 54 tests.

About plugin

  • Plugin page: mine-metamask
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.0
  • WordPress version: 6.3.1
  • First release: Jul 8, 2022
  • Latest release: Jul 8, 2022
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: 0 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,121 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼1.01MB] [CPU: ▼44.44ms] Passed 4 tests

A check of server-side resources used by Login and Pay with Metamask
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.97 ▼0.5016.53 ▼28.73
Dashboard /wp-admin3.01 ▼0.3018.67 ▼38.20
Posts /wp-admin/edit.php3.01 ▼0.3521.95 ▼31.91
Add New Post /wp-admin/post-new.php3.01 ▼2.8821.27 ▼78.93
Media Library /wp-admin/upload.php3.01 ▼0.2217.16 ▼20.07

Server storage [IO: ▲1.78MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 67 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Login and Pay with Metamask
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3514.34 ▼0.021.89 ▼0.2244.53 ▲0.09
Dashboard /wp-admin2,195 ▲185.63 ▲0.0684.32 ▼12.1441.12 ▼0.78
Posts /wp-admin/edit.php2,097 ▼61.97 ▼0.0539.08 ▼2.3339.63 ▼0.42
Add New Post /wp-admin/post-new.php1,526 ▼023.39 ▲0.27625.45 ▼76.3048.08 ▼7.24
Media Library /wp-admin/upload.php1,397 ▼34.17 ▲0.0698.16 ▼12.5044.89 ▼1.24

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/mine-metamask/inc/Woocommerce/Payment.php+25
    Undefined index: request
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant MineMetamask_PATH - assumed 'MineMetamask_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/mine-metamask/inc/Login.php on line 3
    • > PHP Parse error
      syntax error, unexpected '|', expecting variable (T_VARIABLE) in wp-content/plugins/mine-metamask/vendor/symfony/polyfill-mbstring/bootstrap80.php on line 15
    • > PHP Warning
      require_once(MineMetamask_PATH/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/mine-metamask/inc/Login.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gmp_init() in wp-content/plugins/mine-metamask/vendor/wmh/php-ecrecover/ecrecover_helper.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/mine-metamask/inc/Woocommerce/WC_Token_Gateway.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'MineMetamask_PATH/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/mine-metamask/inc/Login.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/mine-metamask/vendor/kornrunner/keccak/test/KeccakTest.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: bsc, login, web3, metamask, woocommerce...

mine-metamask/metamask.php 77% from 13 tests

This is the main PHP file of "Login and Pay with Metamask" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")
  • Git Repository: There should be no Git repositories present in your plugin
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("mine-metamask.php" instead of "metamask.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin6,703 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
PHP357768386,194
JSON400284
Markdown3360115
YAML313061
XML14029
JavaScript515418
CSS2002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity23.53
▷ Minimum class complexity1.00
▷ Maximum class complexity166.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes210.53%
Methods167
▷ Static methods10462.28%
▷ Public methods14888.62%
▷ Protected methods00.00%
▷ Private methods1911.38%
Functions86
▷ Named functions8295.35%
▷ Anonymous functions44.65%
Constants16
▷ Global constants956.25%
▷ Class constants743.75%
▷ Public constants114.29%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/layer/theme/default/icon-ext.png5.77KB2.91KB▼ 49.62%
static/layer/theme/default/icon.png11.22KB4.36KB▼ 61.19%