89% woo-wechat-crossborder

Code Review | Wechat Crossborder for WooCommerce

WordPress plugin Wechat Crossborder for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: woo-wechat-crossb...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Oct 12, 2018
  • Latest release: Oct 12, 2018
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: xunhuweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /659 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

An overview of server-side resources used by Wechat Crossborder for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0139.45 ▼4.26
Dashboard /wp-admin3.36 ▲0.0150.22 ▼5.15
Posts /wp-admin/edit.php3.41 ▲0.0150.84 ▲0.59
Add New Post /wp-admin/post-new.php5.94 ▲0.0199.55 ▼5.14
Media Library /wp-admin/upload.php3.28 ▲0.0140.68 ▲3.34

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Wechat Crossborder for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲2814.72 ▲0.192.00 ▲0.3344.50 ▲6.13
Dashboard /wp-admin2,198 ▲185.62 ▲0.0382.49 ▼6.7141.55 ▲1.51
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0033.57 ▼1.1133.05 ▼2.30
Add New Post /wp-admin/post-new.php1,526 ▼023.10 ▲0.06666.57 ▼22.1261.74 ▲8.65
Media Library /wp-admin/upload.php1,400 ▲34.16 ▼0.02100.09 ▼6.0945.27 ▼3.61

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
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
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #3 (Order pay screen, including QR code of wechat and payment amount.), #4 (Pay screen in weChat)
The official readme.txt is a good inspiration

woo-wechat-crossborder/init.php 77% from 13 tests

The entry point to "Wechat Crossborder for WooCommerce" version 1.0.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 239 characters long)
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woo-wechat-crossborder.php" instead of "init.php")

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
Good job! No executable or dangerous file extensions detected3,035 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP83701,6682,215
JavaScript281128750
PO File1191970

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity6.30
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity1.32
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods382
▷ Static methods174.45%
▷ Public methods37297.38%
▷ Protected methods10.26%
▷ Private methods92.36%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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
images/weixin.png3.57KB2.02KB▼ 43.49%
images/ep_new_sprites1.png2.89KB0.20KB▼ 92.93%
images/logo.png3.09KB2.47KB▼ 20.10%