93% woocommerce-admin

Code Review | WooCommerce Admin

WordPress plugin WooCommerce Admin scored 93% from 54 tests.

About plugin

  • Plugin page: woocommerce-admin
  • Plugin version: 3.3.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.9.1
  • WordPress version: 5.9.2
  • First release: Mar 27, 2019
  • Latest release: Mar 31, 2022
  • Number of updates: 184
  • Update frequency: every 6.0 days
  • Top authors: psealock (25%)jeffstieler (12.5%)timmydcrawford (11.96%)adrianduffell (9.24%)moon0326 (8.7%)

Code review

54 tests

User reviews

250 reviews

Install metrics

300,000+ active / 18,150,604 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.02MB] [CPU: ▼319.38ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce Admin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0165.06 ▲3.71
Dashboard /wp-admin3.41 ▲0.0035.98 ▼3.79
Posts /wp-admin/edit.php3.64 ▲0.0044.82 ▲3.64
Add New Post /wp-admin/post-new.php6.88 ▼0.09103.40 ▼1,277.31
Media Library /wp-admin/upload.php3.29 ▲0.0032.49 ▼0.05

Server storage [IO: ▲12.76MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 828 new files
Database: 8 new tables, no new options
New tables
wp_wc_order_stats
wp_wc_admin_note_actions
wp_wc_category_lookup
wp_wc_order_product_lookup
wp_wc_customer_lookup
wp_wc_admin_notes
wp_wc_order_tax_lookup
wp_wc_order_coupon_lookup

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Admin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,789 ▲4116.04 ▲0.206.73 ▼0.502.89 ▼0.45
Dashboard /wp-admin2,918 ▲316.55 ▲0.01153.84 ▼29.87176.40 ▼21.05
Posts /wp-admin/edit.php2,691 ▼13.42 ▼0.0270.39 ▼4.81161.05 ▼9.54
Add New Post /wp-admin/post-new.php1,635 ▼021.61 ▲5.43544.99 ▼25.62177.39 ▼1.13
Media Library /wp-admin/upload.php1,692 ▼85.73 ▲0.07174.25 ▲4.33224.09 ▼7.13

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 136× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php:4
    • > PHP Fatal error
      Trait 'Automattic\\WooCommerce\\Internal\\Admin\\CouponsMovedTrait' not found in wp-content/plugins/woocommerce-admin/src-internal/Admin/Marketing.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woocommerce-admin/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woocommerce-admin/vendor/composer/installers/src/Composer/Installers/KnownInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woocommerce-admin/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installer\\LibraryInstaller' not found in wp-content/plugins/woocommerce-admin/vendor/composer/installers/src/Composer/Installers/Installer.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Admin\\DataSourcePoller' not found in wp-content/plugins/woocommerce-admin/src/Features/PaymentGatewaySuggestions/PaymentGatewaySuggestionsDataSourcePoller.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woocommerce-admin/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
Please take inspiration from this readme.txt

woocommerce-admin/woocommerce-admin.php 85% from 13 tests

The main PHP script in "WooCommerce Admin" version 3.3.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 175 characters long)
  • Requires at least: Required version must match the one declared in readme.txt ("5.4.0" instead of "5.6")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin157,022 lines of code in 757 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript13227,92222,923110,694
PHP5198,76421,63143,797
CSS7877851,017
Markdown52620785
JSON300385
SVG1701221
YAML3313123

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity9.14
▷ Minimum class complexity1.00
▷ Maximum class complexity162.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces54
Interfaces8
Traits9
Classes485
▷ Abstract classes61.24%
▷ Concrete classes47998.76%
▷ Final classes20.42%
Methods2,343
▷ Static methods79834.06%
▷ Public methods1,81477.42%
▷ Protected methods38816.56%
▷ Private methods1416.02%
Functions107
▷ Named functions4340.19%
▷ Anonymous functions6459.81%
Constants232
▷ Global constants177.33%
▷ Class constants21592.67%
▷ Public constants215100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
15 compressed PNG files occupy 0.08MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/onboarding/creativemail.png1.84KB1.95KB0.00%
images/onboarding/mailpoet.png1.52KB1.48KB▼ 2.50%
images/onboarding/eway.png8.77KB4.31KB▼ 50.82%
images/admin_notes/dashboard-widget-setup.png3.53KB3.77KB0.00%
images/onboarding/google-listings-and-ads.png1.74KB1.57KB▼ 9.44%