83% electroneum-instant-payments-for-woocommerce

Code Review | Electroneum Instant Payments for WooCommerce

WordPress plugin Electroneum Instant Payments for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: electroneum-insta...
  • Plugin version: 1.1.6
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.1.1
  • WordPress version: 6.3.1
  • First release: Sep 22, 2018
  • Latest release: Mar 20, 2019
  • Number of updates: 8
  • Update frequency: every 22.4 days
  • Top authors: electroneum101 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,844 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▲1.09ms] Passed 4 tests

This is a short check of server-side resources used by Electroneum Instant Payments for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0947.76 ▲5.50
Dashboard /wp-admin3.38 ▲0.0855.29 ▲3.26
Posts /wp-admin/edit.php3.48 ▲0.1257.52 ▲7.24
Add New Post /wp-admin/post-new.php5.96 ▲0.0892.13 ▼11.65
Media Library /wp-admin/upload.php3.31 ▲0.0844.53 ▲10.73

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
payment_post_id
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Electroneum Instant Payments for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲3914.35 ▲0.171.72 ▲0.0146.30 ▲5.90
Dashboard /wp-admin2,194 ▲175.55 ▼0.1089.86 ▼0.7274.06 ▲31.75
Posts /wp-admin/edit.php2,114 ▲141.99 ▲0.0236.73 ▲0.6532.15 ▼10.18
Add New Post /wp-admin/post-new.php1,550 ▲2423.04 ▼0.58660.71 ▲20.71162.84 ▲114.54
Media Library /wp-admin/upload.php1,411 ▲144.12 ▼0.12116.74 ▲20.4881.48 ▲38.89

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • payment_post_id
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/electroneum-instant-payments-for-woocommerce/include/electroneum_ips_library.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/electroneum-instant-payments-for-woocommerce/include/electroneum_ips_library.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

electroneum-instant-payments-for-woocommerce/electroneum_ips_gateway.php 85% from 13 tests

The main PHP script in "Electroneum Instant Payments for WooCommerce" version 1.1.6 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("electroneum-instant-payments-for-woocommerce.php" instead of "electroneum_ips_gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin628 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP5172385602
JavaScript251126

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity23.67
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity3.34
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/checked.png1.52KB1.44KB▼ 5.01%
assets/electroneum-24.png3.80KB1.75KB▼ 54.00%
assets/electroneum.png0.68KB0.69KB0.00%