83% woo-product-design

Code Review | Woocommerce Product Design

WordPress plugin Woocommerce Product Design scored83%from 54 tests.

About plugin

  • Plugin page: woo-product-design
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 11, 2017
  • Latest release: Jun 11, 2017
  • Number of updates: 7
  • Update frequency: every 1.1 days
  • Top authors: ckhandla94 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /881 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.76ms] Passed 4 tests

An overview of server-side resources used by Woocommerce Product Design
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.0341.23 ▼6.22
Dashboard /wp-admin3.66 ▲0.1058.27 ▲0.47
Posts /wp-admin/edit.php3.71 ▲0.0350.60 ▼5.50
Add New Post /wp-admin/post-new.php6.18 ▲0.0391.93 ▼7.77
Media Library /wp-admin/upload.php3.52 ▲0.0339.35 ▲4.78

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 360 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Woocommerce Product Design
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲914.27 ▼0.251.84 ▼0.2346.71 ▲1.13
Dashboard /wp-admin2,201 ▲215.60 ▼0.0787.34 ▼1.9245.26 ▲2.89
Posts /wp-admin/edit.php2,106 ▲32.00 ▼0.0036.17 ▼5.7037.02 ▲0.56
Add New Post /wp-admin/post-new.php1,555 ▲2423.54 ▲0.19663.50 ▼8.6053.86 ▲1.70
Media Library /wp-admin/upload.php1,409 ▲184.20 ▼0.0297.34 ▲1.0943.16 ▼0.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 179× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/woo-product-design/domPDF/dompdf/dompdf/lib/fonts/dompdf_font_family_cache.php on line 78
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\AbstractTag' not found in wp-content/plugins/woo-product-design/domPDF/phenx/php-svg-lib/src/Svg/Tag/RadialGradient.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Header' not found in wp-content/plugins/woo-product-design/domPDF/phenx/php-font-lib/src/FontLib/EOT/Header.php:21
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/woo-product-design/domPDF/dompdf/dompdf/lib/fonts/dompdf_font_family_cache.php on line 52
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/woo-product-design/domPDF/dompdf/dompdf/src/FrameDecorator/ListBullet.php:19
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/woo-product-design/domPDF/dompdf/dompdf/lib/php-font-lib/src/FontLib/Autoloader.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-product-design/domPDF/dompdf/dompdf/autoload.inc.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/woo-product-design/domPDF/phenx/php-font-lib/src/FontLib/Table/DirectoryEntry.php:19
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/woo-product-design/domPDF/dompdf/dompdf/lib/fonts/dompdf_font_family_cache.php on line 84
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/woo-product-design/domPDF/dompdf/dompdf/src/FrameDecorator/TableRowGroup.php:20
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/woo-product-design/domPDF/dompdf/dompdf/lib/fonts/dompdf_font_family_cache.php on line 53

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

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === woo-product-design === )
The official readme.txt might help

woo-product-design/woocommerce-product-design.php 92% from 13 tests

"Woocommerce Product Design" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-product-design.php" instead of "woocommerce-product-design.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin108,767 lines of code in 226 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1710,46819,95456,075
PHP1758,49513,06734,507
JSON70014,116
CSS14120752,664
SVG300961
Markdown4810214
HTML2148165
XML21034
YAML28031

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 653)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity36.96
▷ Minimum class complexity1.00
▷ Maximum class complexity766.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity653.00
Code structure
Namespaces24
Interfaces2
Traits0
Classes159
▷ Abstract classes63.77%
▷ Concrete classes15396.23%
▷ Final classes10.65%
Methods1,700
▷ Static methods764.47%
▷ Public methods1,46386.06%
▷ Protected methods17610.35%
▷ Private methods613.59%
Functions35
▷ Named functions1542.86%
▷ Anonymous functions2057.14%
Constants149
▷ Global constants21.34%
▷ Class constants14798.66%
▷ Public constants147100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
24 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/customizer/images/select4.png0.19KB0.15KB▼ 20.10%
assets/customizer/images/grid.png2.69KB0.13KB▼ 95.17%
assets/customizer/images/overlay.png8.91KB8.24KB▼ 7.55%
assets/customizer/images/select_hue.png0.56KB1.43KB0.00%
assets/customizer/images/select3.png0.23KB0.17KB▼ 24.46%