83% wc-cu-copper-payment-gateway

Code Review | Payment Gateway for peg63.546u Copper on WooCommerce

WordPress plugin Payment Gateway for peg63.546u Copper on WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: wc-cu-copper-paym...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.1-5.8.3
  • WordPress version: 6.3.1
  • First release: Mar 1, 2022
  • Latest release: Mar 1, 2022
  • Number of updates: 7
  • Update frequency: every 5.0 days
  • Top authors: firstratit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /277 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.46ms] Passed 4 tests

Server-side resources used by Payment Gateway for peg63.546u Copper on WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0138.30 ▲1.88
Dashboard /wp-admin3.31 ▲0.0152.36 ▲2.16
Posts /wp-admin/edit.php3.36 ▲0.0048.38 ▼7.79
Add New Post /wp-admin/post-new.php5.89 ▲0.0099.52 ▼9.12
Media Library /wp-admin/upload.php3.23 ▲0.0033.69 ▼6.80

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

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

Browser metrics Passed 4 tests

Payment Gateway for peg63.546u Copper on WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲7613.26 ▼1.162.14 ▲0.3339.37 ▼8.36
Dashboard /wp-admin2,217 ▲294.87 ▼0.98111.19 ▲3.5045.81 ▲1.25
Posts /wp-admin/edit.php2,099 ▲72.00 ▼0.0639.44 ▼8.4036.89 ▼2.91
Add New Post /wp-admin/post-new.php1,525 ▲117.72 ▼5.56717.60 ▲10.9465.09 ▲10.89
Media Library /wp-admin/upload.php1,399 ▲114.19 ▼0.02108.54 ▼1.7548.98 ▲0.40

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 22× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Exception: Cannot use BigInteger. Neither gmp nor bcmath module is loaded in wp-content/plugins/wc-cu-copper-payment-gateway/lib/Elliptic/BigInteger.php:14
    • > PHP Fatal error
      Uncaught Exception: Cannot use BigInteger. Neither gmp nor bcmath module is loaded in wp-content/plugins/wc-cu-copper-payment-gateway/lib/Elliptic/BigInteger.php:14
    • > PHP Fatal error
      Uncaught Exception: Cannot use BigInteger. Neither gmp nor bcmath module is loaded in wp-content/plugins/wc-cu-copper-payment-gateway/lib/Elliptic/BigInteger.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Elliptic\\Curve\\BaseCurve\\Point' not found in wp-content/plugins/wc-cu-copper-payment-gateway/lib/Elliptic/Curve/EdwardsCurve/Point.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Elliptic\\Curve\\BaseCurve\\Point' not found in wp-content/plugins/wc-cu-copper-payment-gateway/lib/Elliptic/Curve/MontCurve/Point.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Elliptic\\Curve\\BaseCurve\\Point' not found in wp-content/plugins/wc-cu-copper-payment-gateway/lib/Elliptic/Curve/EdwardsCurve/Point.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'React\\EventLoop\\LoopInterface' not found in wp-content/plugins/wc-cu-copper-payment-gateway/vendor/react/event-loop/src/ExtEventLoop.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Elliptic\\Curve\\BaseCurve\\Point' not found in wp-content/plugins/wc-cu-copper-payment-gateway/lib/Elliptic/Curve/ShortCurve/Point.php:8
    • > PHP Fatal error
      Uncaught Exception: Cannot use BigInteger. Neither gmp nor bcmath module is loaded in wp-content/plugins/wc-cu-copper-payment-gateway/lib/Elliptic/BigInteger.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'React\\EventLoop\\LoopInterface' not found in wp-content/plugins/wc-cu-copper-payment-gateway/vendor/react/event-loop/src/ExtLibeventLoop.php:38

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: gateway, token, woocommerce, payment, ethereum...

wc-cu-copper-payment-gateway/cu-copper-payment-gateway.php 77% from 13 tests

"Payment Gateway for peg63.546u Copper on WooCommerce" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wc-cu-copper-payment-gateway.php" instead of "cu-copper-payment-gateway.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.5" instead of "5.5.1")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin13,534 lines of code in 77 files:
LanguageFilesBlank linesComment linesLines of code
PHP601,8521,63511,701
Markdown436401,026
JSON500350
JavaScript24112229
Sass116182
YAML313061
CSS11456
XML14029

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity26.55
▷ Minimum class complexity1.00
▷ Maximum class complexity162.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces16
Interfaces2
Traits0
Classes42
▷ Abstract classes24.76%
▷ Concrete classes4095.24%
▷ Final classes1435.00%
Methods631
▷ Static methods12319.49%
▷ Public methods58392.39%
▷ Protected methods30.48%
▷ Private methods457.13%
Functions117
▷ Named functions8774.36%
▷ Anonymous functions3025.64%
Constants23
▷ Global constants1043.48%
▷ Class constants1356.52%
▷ Public constants430.77%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin