73% chinads-dropshipping-taobao-woocommerce

Code Review | ChinaDS – Tmall-Taobao Dropshipping for WooCommerce

WordPress plugin ChinaDS – Tmall-Taobao Dropshipping for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: chinads-dropshipp...
  • Plugin version: 2.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 6, 2022
  • Latest release: Sep 27, 2023
  • Number of updates: 23
  • Update frequency: every 21.9 days
  • Top authors: thanhtd (60.87%)mytrinh (39.13%)villatheme (8.7%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,323 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by ChinaDS – Tmall-Taobao Dropshipping for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.70 ▼0.11
Dashboard /wp-admin3.32 ▲0.0148.08 ▲2.29
Posts /wp-admin/edit.php3.43 ▲0.0745.23 ▼6.17
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.76 ▼17.40
Media Library /wp-admin/upload.php3.24 ▲0.0134.22 ▼0.13

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

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

Browser metrics Passed 4 tests

ChinaDS – Tmall-Taobao Dropshipping for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲3813.50 ▼0.881.71 ▼0.3243.11 ▼1.07
Dashboard /wp-admin2,215 ▲274.85 ▼0.09112.82 ▲11.8244.17 ▲0.39
Posts /wp-admin/edit.php2,095 ▲32.00 ▼0.0134.25 ▼10.5232.69 ▼5.09
Add New Post /wp-admin/post-new.php1,528 ▼522.94 ▼0.32656.28 ▲26.7452.11 ▼1.56
Media Library /wp-admin/upload.php1,397 ▲94.21 ▲0.0394.94 ▼2.0641.14 ▲0.73

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_tbds_error_product_images
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/chinads-dropshipping-taobao-woocommerce/admin/views/html-import-list-override-options.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: taobao dropshiping, wordpress, woocommerce, dropship, chinads...

chinads-dropshipping-taobao-woocommerce/chinads-taobao-dropshipping-for-woocommerce.php 85% from 13 tests

The principal PHP file in "ChinaDS – Tmall-Taobao Dropshipping for WooCommerce" v. 2.0.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("chinads-dropshipping-taobao-woocommerce.php" instead of "chinads-taobao-dropshipping-for-woocommerce.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected22,902 lines of code in 106 files:
LanguageFilesBlank linesComment linesLines of code
PHP341,4081,10611,097
SVG40123,820
JavaScript242271462,728
CSS373592391,957
PO File26908621,725
Sass531621,575

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 204)
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity67.59
▷ Minimum class complexity3.00
▷ Maximum class complexity521.00
Average method complexity6.78
▷ Minimum method complexity1.00
▷ Maximum method complexity204.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes27
▷ Abstract classes27.41%
▷ Concrete classes2592.59%
▷ Final classes14.00%
Methods313
▷ Static methods9229.39%
▷ Public methods27487.54%
▷ Protected methods3210.22%
▷ Private methods72.24%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/icon-256x256.png5.42KB2.73KB▼ 49.67%
assets/img/icon.png0.41KB0.33KB▼ 19.58%