89% scanpay-for-woocommerce

Code Review | Scanpay for WooCommerce

WordPress plugin Scanpay for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: scanpay-for-wooco...
  • Plugin version: 1.3.16
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 11, 2016
  • Latest release: Dec 14, 2022
  • Number of updates: 65
  • Update frequency: every 34.9 days
  • Top authors: scanpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /6,637 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

An overview of server-side resources used by Scanpay for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.83 ▼2.45
Dashboard /wp-admin3.32 ▼0.0350.63 ▼20.45
Posts /wp-admin/edit.php3.37 ▲0.0155.85 ▲5.70
Add New Post /wp-admin/post-new.php5.90 ▲0.0198.34 ▼7.55
Media Library /wp-admin/upload.php3.25 ▲0.0136.69 ▲0.95

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Scanpay for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.011.72 ▲0.0244.66 ▼1.03
Dashboard /wp-admin2,198 ▲245.63 ▼0.1491.11 ▼10.6745.16 ▼0.96
Posts /wp-admin/edit.php2,100 ▼31.98 ▼0.0239.12 ▼0.5835.87 ▲0.64
Add New Post /wp-admin/post-new.php1,528 ▲223.23 ▲0.17654.28 ▼6.4055.07 ▲2.45
Media Library /wp-admin/upload.php1,397 ▼34.22 ▲0.04101.00 ▼8.6244.72 ▼3.02

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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

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)
Everything seems fine, but this is not an exhaustive test

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
4 plugin tags: payments, subscriptions, ecommerce, woocommerce

scanpay-for-woocommerce/woocommerce-scanpay.php 77% from 13 tests

The principal PHP file in "Scanpay for WooCommerce" v. 1.3.16 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("scanpay-for-woocommerce.php" instead of "woocommerce-scanpay.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin1,757 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP11128981,565
PO File1323796
SVG93054
make110530
diff131112

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity31.62
▷ Minimum class complexity1.00
▷ Maximum class complexity119.00
Average method complexity6.21
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes112.50%
▷ Concrete classes787.50%
▷ Final classes00.00%
Methods47
▷ Static methods12.13%
▷ Public methods3880.85%
▷ Protected methods48.51%
▷ Private methods510.64%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants17
▷ Global constants317.65%
▷ Class constants1482.35%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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