89% canada-ali-payment

Code Review | WooCommerce Canada Ali Payment

WordPress plugin WooCommerce Canada Ali Payment scored89%from 54 tests.

About plugin

  • Plugin page: canada-ali-payment
  • Plugin version: 2.1.10
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Mar 12, 2018
  • Latest release: Mar 26, 2018
  • Number of updates: 14
  • Update frequency: every 1.1 days
  • Top authors: paybuzzca (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /5,448 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.12ms] Passed 4 tests

A check of server-side resources used by WooCommerce Canada Ali Payment
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.17 ▼4.04
Dashboard /wp-admin3.32 ▲0.0143.38 ▼7.53
Posts /wp-admin/edit.php3.37 ▲0.0148.40 ▲3.26
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.00 ▼3.43
Media Library /wp-admin/upload.php3.24 ▲0.0134.28 ▼1.48

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Canada Ali Payment
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.531.71 ▼0.0939.40 ▼7.95
Dashboard /wp-admin2,206 ▲184.86 ▲0.03107.04 ▼7.9439.49 ▼6.58
Posts /wp-admin/edit.php2,086 ▼01.98 ▼0.0239.27 ▲4.3234.82 ▼0.68
Add New Post /wp-admin/post-new.php1,519 ▼1423.51 ▲0.24585.02 ▼92.7249.10 ▼2.59
Media Library /wp-admin/upload.php1,388 ▼04.26 ▲0.0593.30 ▼6.1940.38 ▼2.95

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

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
No output text or server-side errors detected 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)
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 to be fixed:
  • Screenshots: These screenshots need descriptions #1, #2, #3, #4 in canada-ali-payment/assets to your readme.txt
  • Donate link: Invalid URI ("#")
The official readme.txt is a good inspiration

canada-ali-payment/init.php 77% from 13 tests

The main PHP script in "WooCommerce Canada Ali Payment" version 2.1.10 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: The principal plugin file should be the same as the plugin slug ("canada-ali-payment.php" instead of "init.php")
  • Description: The description should be shorter than 140 characters (currently 474 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected1,114 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript281128750
PHP25445294
PO File1191970

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity31.00
▷ Minimum class complexity31.00
▷ Maximum class complexity31.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods16.67%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/paybuzz_plugin_icon_canada.png58.33KB23.54KB▼ 59.64%
images/alipay.png3.54KB1.84KB▼ 48.11%