89% scan2pay-alertco-woo

Code Review | Scan2Pay for WooCommerce

WordPress plugin Scan2Pay for WooCommerce scored 89% from 54 tests.

About plugin

  • Plugin page: scan2pay-alertco-woo
  • Plugin version: 2.5.6
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 10, 2019
  • Latest release: Nov 14, 2019
  • Number of updates: 12
  • Update frequency: every 0.3 days
  • Top authors: alertco (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 478 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.05MB] [CPU: ▲1.91ms] Passed 4 tests

Analyzing server-side resources used by Scan2Pay for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0540.30 ▲2.81
Dashboard /wp-admin3.35 ▲0.0548.76 ▲3.15
Posts /wp-admin/edit.php3.40 ▲0.0550.20 ▲1.66
Add New Post /wp-admin/post-new.php5.93 ▲0.05100.69 ▲6.17
Media Library /wp-admin/upload.php3.28 ▲0.0537.13 ▼0.00

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Scan2Pay for WooCommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.62 ▼0.784.59 ▲2.8337.17 ▼0.22
Dashboard /wp-admin2,206 ▲145.89 ▲0.98115.30 ▲0.4648.18 ▲5.15
Posts /wp-admin/edit.php2,089 ▲111.99 ▼0.1838.99 ▲3.3934.65 ▲0.64
Add New Post /wp-admin/post-new.php1,542 ▲2018.10 ▼5.21599.39 ▼66.5956.39 ▲3.36
Media Library /wp-admin/upload.php1,388 ▼34.24 ▲0.0493.99 ▼4.1240.61 ▼2.60

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

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 83% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Contributors: Contributors not specified
  • Screenshots: These screenshots need descriptions #1, #2, #3, #4 in scan2pay-alertco-woo/assets to your readme.txt
You can look at the official readme.txt

scan2pay-alertco-woo/woocommerce-gateway-scan2pay.php 77% from 13 tests

Analyzing the main PHP file in "Scan2Pay for WooCommerce" version 2.5.6
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("scan2pay-alertco-woo.php" instead of "woocommerce-gateway-scan2pay.php")
  • Description: The description should be shorter than 140 characters (currently 250 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin265 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP111657238
Markdown113027

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
9 PNG files occupy 0.15MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/fav4.png1.23KB1.18KB▼ 4.12%
images/fav3.png1.72KB1.45KB▼ 15.69%
images/logo_dash.png3.12KB2.16KB▼ 30.75%
screenshots/scan2pay-woo2.png46.33KB12.04KB▼ 74.01%
images/meu_icon.png1.15KB1.30KB0.00%