77% wc-order-pdf-download

Code Review | WC Order PDF Download

WordPress plugin WC Order PDF Download scored77%from 54 tests.

About plugin

  • Plugin page: wc-order-pdf-down...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 27, 2020
  • Latest release: Jun 20, 2023
  • Number of updates: 23
  • Update frequency: every 51.4 days
  • Top authors: yagniksangani (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /3,029 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼5.12ms] Passed 4 tests

Analyzing server-side resources used by WC Order PDF Download
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1040.70 ▲3.46
Dashboard /wp-admin3.40 ▲0.1043.69 ▼2.87
Posts /wp-admin/edit.php3.52 ▲0.1642.08 ▼3.18
Add New Post /wp-admin/post-new.php5.99 ▲0.0982.57 ▼16.04
Media Library /wp-admin/upload.php3.33 ▲0.0935.47 ▲1.60

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 396 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WC Order PDF Download
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.37 ▼0.201.75 ▼0.1543.08 ▲4.60
Dashboard /wp-admin2,196 ▲185.55 ▼0.0982.35 ▼21.2238.22 ▼2.99
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0633.95 ▼3.5036.91 ▲2.52
Add New Post /wp-admin/post-new.php1,532 ▲622.94 ▼0.72667.32 ▲16.8652.14 ▲2.57
Media Library /wp-admin/upload.php1,407 ▲74.22 ▲0.0794.66 ▼12.3842.62 ▼5.56

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wc-order-pdf-download/vendor/sabberworm/php-css-parser/tests/quickdump.php
  • 162× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\Block' not found in wp-content/plugins/wc-order-pdf-download/vendor/dompdf/dompdf/src/FrameReflower/TableCell.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Frame' not found in wp-content/plugins/wc-order-pdf-download/vendor/dompdf/dompdf/src/FrameDecorator/AbstractFrameDecorator.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'Dompdf\\Canvas' not found in wp-content/plugins/wc-order-pdf-download/vendor/dompdf/dompdf/src/Adapter/CPDF.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Parsing\\UnexpectedTokenException' not found in wp-content/plugins/wc-order-pdf-download/vendor/sabberworm/php-css-parser/src/Parsing/UnexpectedEOFException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\ValueList' not found in wp-content/plugins/wc-order-pdf-download/vendor/sabberworm/php-css-parser/src/Value/RuleValueList.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Renderer\\AbstractRenderer' not found in wp-content/plugins/wc-order-pdf-download/vendor/dompdf/dompdf/src/Renderer/ListBullet.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Header' not found in wp-content/plugins/wc-order-pdf-download/vendor/phenx/php-font-lib/src/FontLib/EOT/Header.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\ValueList' not found in wp-content/plugins/wc-order-pdf-download/vendor/sabberworm/php-css-parser/src/Value/LineName.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/wc-order-pdf-download/vendor/phenx/php-font-lib/src/FontLib/Header.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/wc-order-pdf-download/vendor/sabberworm/php-css-parser/src/CSSList/CSSList.php:32

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% 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:
  • Donate link: Invalid url: "paypal.me/yagniksangani"
The official readme.txt might help

wc-order-pdf-download/woocommerce-order-pdf-download.php 85% from 13 tests

The main file in "WC Order PDF Download" v. 1.0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("wc-order-pdf-download.php" instead of "woocommerce-order-pdf-download.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin44,870 lines of code in 312 files:
LanguageFilesBlank linesComment linesLines of code
PHP2449,47618,65542,433
Markdown62570960
CSS4313854699
JSON700444
XML532186
YAML5297123
HTML10017
SVG1008

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 651)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity33.22
▷ Minimum class complexity1.00
▷ Maximum class complexity809.00
Average method complexity4.09
▷ Minimum method complexity1.00
▷ Maximum method complexity651.00
Code structure
Namespaces35
Interfaces8
Traits0
Classes222
▷ Abstract classes188.11%
▷ Concrete classes20491.89%
▷ Final classes00.00%
Methods2,474
▷ Static methods1576.35%
▷ Public methods2,13286.18%
▷ Protected methods24810.02%
▷ Private methods943.80%
Functions23
▷ Named functions14.35%
▷ Anonymous functions2295.65%
Constants217
▷ Global constants31.38%
▷ Class constants21498.62%
▷ Public constants214100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/dompdf/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%