10% woo-xem-gateway

Code Review | Woocommerce Gateway XEM

WordPress plugin Woocommerce Gateway XEM scored10%from 54 tests.

About plugin

  • Plugin page: woo-xem-gateway
  • Plugin version: 2.1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.5
  • WordPress version: 6.3.1
  • First release: May 20, 2017
  • Latest release: May 24, 2017
  • Number of updates: 10
  • Update frequency: every 0.5 days
  • Top authors: inpali (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /926 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class '\WSB\Activator' not found

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.38ms] Passed 4 tests

Analyzing server-side resources used by Woocommerce Gateway XEM
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.70 ▲0.11
Dashboard /wp-admin3.34 ▲0.0451.68 ▼1.67
Posts /wp-admin/edit.php3.46 ▲0.1050.25 ▼0.86
Add New Post /wp-admin/post-new.php5.92 ▲0.0486.98 ▼11.08
Media Library /wp-admin/upload.php3.27 ▲0.0440.30 ▲7.18

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woocommerce Gateway XEM
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3114.29 ▲0.011.75 ▼0.1744.60 ▼4.47
Dashboard /wp-admin2,198 ▲185.62 ▲0.1095.20 ▲4.4242.40 ▲3.85
Posts /wp-admin/edit.php2,103 ▲62.01 ▲0.0335.09 ▼2.3634.87 ▲1.97
Add New Post /wp-admin/post-new.php1,529 ▼223.50 ▲0.41687.14 ▲57.9856.23 ▲4.29
Media Library /wp-admin/upload.php1,403 ▲34.19 ▲0.01106.29 ▼3.7447.48 ▲5.02

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woo-xem-gateway/includes/class-wc-gateway-xem.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-xem-gateway/includes/class-xem-ajax.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: nem, xem, payment gateway, bitcoin, xme coin...

woo-xem-gateway/woocommerce-gateway-xem.php 85% from 13 tests

The main PHP file in "Woocommerce Gateway XEM" ver. 2.1.9 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-xem-gateway.php" instead of "woocommerce-gateway-xem.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
There were no executable files found in this plugin2,438 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript102343161,190
PHP6181224707
PO File4168168450
Sass16054
CSS112437

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity20.80
▷ Minimum class complexity10.00
▷ Maximum class complexity29.00
Average method complexity3.06
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods48
▷ Static methods2041.67%
▷ Public methods3981.25%
▷ Protected methods12.08%
▷ Private methods816.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

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
assets/img/pay_with_xem.png18.76KB8.97KB▼ 52.19%
assets/img/copy.png0.42KB0.34KB▼ 19.59%