68% wc-china-checkout

Code Review | WC China Checkout 物流通知插件

WordPress plugin WC China Checkout 物流通知插件 scored68%from 54 tests.

About plugin

  • Plugin page: wc-china-checkout
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.5
  • WordPress version: 6.3.1
  • First release: Jun 21, 2018
  • Latest release: Jun 21, 2018
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: xunhuweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,317 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.91MB] [CPU: ▲8.96ms] Passed 4 tests

A check of server-side resources used by WC China Checkout 物流通知插件
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.22 ▲1.7550.07 ▲10.56
Dashboard /wp-admin4.26 ▲0.9559.19 ▲12.67
Posts /wp-admin/edit.php4.31 ▲0.9559.79 ▲15.35
Add New Post /wp-admin/post-new.php6.77 ▲0.8899.94 ▲1.93
Media Library /wp-admin/upload.php4.10 ▲0.8645.04 ▲10.66
WC China Checkout /wp-admin/admin.php?page=wc-sinic3.9630.44
Settings /wp-admin/admin.php?page=woo_ch_page_default4.0939.62

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 92 new files
Database: 1 new table, 8 new options
New tables
wp_xh_sessions
New WordPress options
widget_recent-posts
woocommerce_allowed_countries
can_compress_scripts
widget_recent-comments
woocommerce_specific_allowed_countries
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

WC China Checkout 物流通知插件: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,340 ▲59416.12 ▲1.705.56 ▲4.0044.53 ▲8.95
Dashboard /wp-admin2,645 ▲4597.45 ▲2.52148.92 ▲34.0949.26 ▲7.67
Posts /wp-admin/edit.php2,561 ▲4724.05 ▲2.0766.81 ▲31.8940.85 ▲10.86
Add New Post /wp-admin/post-new.php1,406 ▼12717.48 ▼5.38519.35 ▼133.8429.71 ▼21.52
Media Library /wp-admin/upload.php1,697 ▲3095.23 ▲1.0294.74 ▼1.9052.20 ▲11.20
WC China Checkout /wp-admin/admin.php?page=wc-sinic280.440.073.42
Settings /wp-admin/admin.php?page=woo_ch_page_default1,3083.5956.7533.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie tables detected upon uninstall: 1 table
    • wp_xh_sessions
  • This plugin does not fully uninstall, leaving 8 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • woocommerce_allowed_countries
    • widget_recent-comments
    • woocommerce_specific_allowed_countries
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Interface 'Gregwar\\Captcha\\CaptchaBuilderInterface' not found in wp-content/plugins/wc-china-checkout/includes/captcha/CaptchaBuilder.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Gregwar\\Captcha\\PhraseBuilderInterface' not found in wp-content/plugins/wc-china-checkout/includes/captcha/PhraseBuilder.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=wc-sinic
    • > Network (severe)
    wp-admin/admin.php?page=wc-sinic - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
2 plugin tags: chinese checkout, woocommerce

wc-china-checkout/init.php 85% from 13 tests

The principal PHP file in "WC China Checkout 物流通知插件" v. 1.0.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wc-china-checkout.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin28,146 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript213,9152,48715,042
PHP371,0872,1799,712
CSS11335422,830
PO File17761,511516
HTML14046

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity18.38
▷ Minimum class complexity1.00
▷ Maximum class complexity161.00
Average method complexity3.24
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces1
Interfaces3
Traits0
Classes42
▷ Abstract classes1433.33%
▷ Concrete classes2866.67%
▷ Final classes13.57%
Methods361
▷ Static methods7420.50%
▷ Public methods32188.92%
▷ Protected methods195.26%
▷ Private methods215.82%
Functions5
▷ Named functions00.00%
▷ Anonymous functions5100.00%
Constants11
▷ Global constants763.64%
▷ Class constants436.36%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.05MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/empty.png0.96KB0.10KB▼ 89.95%
assets/My97DatePicker/skin/twoer/img.png48.15KB0.79KB▼ 98.37%