10% banggood-dropshipping

Code Review | Dropshipping with Banggood for WooCommerce (Lite version)

WordPress plugin Dropshipping with Banggood for WooCommerce (Lite version) scored10%from 54 tests.

About plugin

  • Plugin page: banggood-dropship...
  • Plugin version: 1.2.11
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 6.3.1
  • First release: Sep 24, 2021
  • Latest release: Jul 7, 2022
  • Number of updates: 16
  • Update frequency: every 17.9 days
  • Top authors: ali2woo (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

90+ active /2,517 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • The plugin cannot be installed
    • > User deprecated in wp-includes/class-requests.php+24
    The PSR-0 `Requests_...` class names in the Requests library are deprecated. Switch to the PSR-4 `WpOrg\Requests\...` class names at your earliest convenience.

Server metrics [RAM: ▼1.86MB] [CPU: ▼49.81ms] Passed 4 tests

Analyzing server-side resources used by Dropshipping with Banggood for WooCommerce (Lite version)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.13 ▼1.347.42 ▼32.44
Dashboard /wp-admin2.15 ▼1.1610.68 ▼44.31
Posts /wp-admin/edit.php2.15 ▼1.218.73 ▼41.65
Add New Post /wp-admin/post-new.php2.15 ▼3.7410.08 ▼80.82
Media Library /wp-admin/upload.php2.15 ▼1.086.90 ▼30.49
Import List /wp-admin/admin.php?page=b2wl_import2.159.69
Search Products /wp-admin/admin.php?page=b2wl_dashboard2.1510.87
Settings /wp-admin/admin.php?page=b2wl_setting2.158.34

Server storage [IO: ▲5.45MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 270 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Dropshipping with Banggood for WooCommerce (Lite version)
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲4014.36 ▲0.081.74 ▼0.1944.34 ▲1.43
Dashboard /wp-admin2,235 ▲555.82 ▲0.1888.22 ▼1.7468.06 ▲29.79
Posts /wp-admin/edit.php2,143 ▲432.31 ▲0.3635.40 ▼4.2131.35 ▼7.57
Add New Post /wp-admin/post-new.php1,567 ▲3918.55 ▼4.67697.84 ▲12.4860.42 ▲7.84
Media Library /wp-admin/upload.php1,437 ▲344.44 ▲0.25111.60 ▲0.5169.70 ▲22.17
Import List /wp-admin/admin.php?page=b2wl_import1,8812.9358.7173.64
Search Products /wp-admin/admin.php?page=b2wl_dashboard21,2412.6265.4659.70
Settings /wp-admin/admin.php?page=b2wl_setting4,2913.0453.2849.34

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/class-requests.php+24
    The PSR-0 `Requests_...` class names in the Requests library are deprecated. Switch to the PSR-4 `WpOrg\Requests\...` class names at your earliest convenience.
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=b2wl_setting
    • > User deprecated in wp-includes/class-requests.php+24
    The PSR-0 `Requests_...` class names in the Requests library are deprecated. Switch to the PSR-4 `WpOrg\Requests\...` class names at your earliest convenience.

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/banggood-dropshipping/view/settings/settings_footer.php
  • 75× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/banggood-dropshipping/view/product_data_tab.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _ex() in wp-content/plugins/banggood-dropshipping/view/settings/phrase_filter.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _ex() in wp-content/plugins/banggood-dropshipping/view/settings/settings_head.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/banggood-dropshipping/includes/libs/Requests/Requests/Exception/HTTP/418.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/banggood-dropshipping/includes/libs/Requests/Requests/Exception/HTTP/500.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/banggood-dropshipping/view/includes/category_modal.php:4
    • > PHP Notice
      Undefined variable: account in wp-content/plugins/banggood-dropshipping/view/settings/account.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/banggood-dropshipping/view/includes/confirm_modal.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/banggood-dropshipping/includes/libs/Requests/Requests/Exception/HTTP/412.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function b2wl_get_setting() in wp-content/plugins/banggood-dropshipping/view/settings/price_formula.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: affiliate, dropship, woocommerce, woo, dropshipper...

banggood-dropshipping/bng2woo-lite.php 77% from 13 tests

The entry point to "Dropshipping with Banggood for WooCommerce (Lite version)" version 1.2.11 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("banggood-dropshipping.php" instead of "bng2woo-lite.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Requires at least: Required version does not match the one declared in readme.txt ("4.7" instead of "5.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin59,324 lines of code in 211 files:
LanguageFilesBlank linesComment linesLines of code
JSON30020,290
PHP1293,3975,21915,473
JavaScript603,45190913,130
CSS9484369,702
SVG96212698
XML10031

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 225)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity27.16
▷ Minimum class complexity1.00
▷ Maximum class complexity590.00
Average method complexity5.35
▷ Minimum method complexity1.00
▷ Maximum method complexity225.00
Code structure
Namespaces0
Interfaces4
Traits0
Classes107
▷ Abstract classes54.67%
▷ Concrete classes10295.33%
▷ Final classes00.00%
Methods636
▷ Static methods11017.30%
▷ Public methods53183.49%
▷ Protected methods7011.01%
▷ Private methods355.50%
Functions40
▷ Named functions2357.50%
▷ Anonymous functions1742.50%
Constants37
▷ Global constants1129.73%
▷ Class constants2670.27%
▷ Public constants26100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
34 PNG files occupy 1.02MB with 0.69MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/stickers/stick-004.png71.08KB20.12KB▼ 71.70%
assets/img/stickers/stick-021.png62.45KB17.95KB▼ 71.26%
assets/img/stickers/stick-011.png43.36KB13.87KB▼ 68.01%
assets/img/stickers/stick-003.png68.36KB21.68KB▼ 68.29%
assets/img/stickers/stick-012.png11.41KB4.44KB▼ 61.04%