84% saledash

Code Review | SaleDash - WooCommerce微信商城小程序

WordPress plugin SaleDash - WooCommerce微信商城小程序 scored84%from 54 tests.

About plugin

  • Plugin page: saledash
  • Plugin version: 1.9.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.0
  • WordPress version: 6.3.1
  • First release: Aug 10, 2022
  • Latest release: Aug 10, 2022
  • Number of updates: 2
  • Update frequency: every 7.5 days
  • Top authors: ooqwqoo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /397 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.50ms] Passed 4 tests

An overview of server-side resources used by SaleDash - WooCommerce微信商城小程序
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.71 ▲1.62
Dashboard /wp-admin3.31 ▲0.0046.78 ▼5.97
Posts /wp-admin/edit.php3.36 ▲0.0047.28 ▼2.14
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.43 ▼21.27
Media Library /wp-admin/upload.php3.23 ▲0.0037.60 ▼0.60

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for SaleDash - WooCommerce微信商城小程序
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▲0.001.65 ▼0.0147.45 ▲6.03
Dashboard /wp-admin2,195 ▲215.51 ▼0.0895.38 ▼0.5444.35 ▲0.81
Posts /wp-admin/edit.php2,100 ▼02.15 ▲0.1937.74 ▼1.5336.69 ▼5.05
Add New Post /wp-admin/post-new.php1,364 ▼16417.11 ▼6.01593.62 ▼95.8848.15 ▼4.27
Media Library /wp-admin/upload.php1,397 ▼34.24 ▼0.10114.86 ▲13.5649.37 ▲2.82

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'WP_W2W_PATHincludes/wxpay/class.WxPay.Data.php' (include_path='.:/usr/share/php') in wp-content/plugins/saledash/includes/wxpay/class.WxPay.Api.php on line 10
    • > PHP Warning
      Use of undefined constant WP_W2W_PATH - assumed 'WP_W2W_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/saledash/includes/wxpay/class.WxPay.JsApiPay.php on line 14
    • > PHP Warning
      Use of undefined constant WP_W2W_PATH - assumed 'WP_W2W_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/saledash/includes/wxpay/class.WxPay.Api.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'W2W_WxPayNotifyReply' not found in wp-content/plugins/saledash/includes/wxpay/class.WxPay.Notify.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/saledash/saledash.php:16
    • > PHP Warning
      Use of undefined constant WP_W2W_PATH - assumed 'WP_W2W_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/saledash/includes/wxpay/class.WxPay.Data.php on line 14
    • > PHP Warning
      require_once(WP_W2W_PATHincludes/wxpay/class.WxPay.Api.php): failed to open stream: No such file or directory in wp-content/plugins/saledash/includes/wxpay/class.WxPay.JsApiPay.php on line 14
    • > PHP Warning
      require_once(WP_W2W_PATHincludes/wxpay/class.WxPay.Data.php): failed to open stream: No such file or directory in wp-content/plugins/saledash/includes/wxpay/class.WxPay.Api.php on line 10
    • > PHP Fatal error
      require_once(): Failed opening required 'WP_W2W_PATHincludes/wxpay/class.WxPay.Config.php' (include_path='.:/usr/share/php') in wp-content/plugins/saledash/includes/wxpay/class.WxPay.Data.php on line 14
    • > PHP Warning
      require_once(WP_W2W_PATHincludes/wxpay/class.WxPay.Config.php): failed to open stream: No such file or directory in wp-content/plugins/saledash/includes/wxpay/class.WxPay.Data.php on line 14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Screenshots: Please add descriptions for these screenshots #1, #10, #2, #3, #4, #5, #6, #7, #8, #9 in saledash/assets to your readme.txt
You can look at the official readme.txt

saledash/saledash.php 92% from 13 tests

The primary PHP file in "SaleDash - WooCommerce微信商城小程序" version 1.9.3 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.3" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected9,576 lines of code in 208 files:
LanguageFilesBlank linesComment linesLines of code
PHP281,7113,4329,354
JSON17600176
SVG30034
CSS11012

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity21.55
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes42
▷ Abstract classes24.76%
▷ Concrete classes4095.24%
▷ Final classes00.00%
Methods630
▷ Static methods457.14%
▷ Public methods52082.54%
▷ Protected methods7511.90%
▷ Private methods355.56%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants14
▷ Global constants1071.43%
▷ Class constants428.57%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin