83% wc-cart-pdf

Code Review | WooCommerce Cart PDF

WordPress plugin WooCommerce Cart PDF scored83%from 54 tests.

About plugin

  • Plugin page: wc-cart-pdf
  • Plugin version: 2.7.0
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4.1
  • WordPress version: 6.3.1
  • First release: Feb 20, 2019
  • Latest release: Nov 22, 2023
  • Number of updates: 35
  • Update frequency: every 49.6 days
  • Top authors: dkjensen (97.14%)seattlewebco (5.71%)

Code review

54 tests

User reviews

20 reviews

Install metrics

1,000+ active /15,569 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.25MB] [CPU: ▼2.38ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Cart PDF
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2741.44 ▲3.65
Dashboard /wp-admin3.56 ▲0.2145.93 ▼13.38
Posts /wp-admin/edit.php3.67 ▲0.3251.32 ▲1.52
Add New Post /wp-admin/post-new.php6.15 ▲0.2791.28 ▼1.32
Media Library /wp-admin/upload.php3.48 ▲0.2535.90 ▲4.92

Server storage [IO: ▲92.23MB] [DB: ▲0.07MB] 67% from 3 tests

Input-output and database impact of this plugin
Just a few items left to fix
  • Try to limit filesystem usage to 25MB (currently using 92.23MB)
Filesystem: 664 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Cart PDF
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3114.20 ▼0.161.65 ▲0.1840.81 ▲1.85
Dashboard /wp-admin2,198 ▲185.60 ▼0.0692.37 ▼5.8537.99 ▼3.05
Posts /wp-admin/edit.php2,097 ▼31.94 ▼0.0038.12 ▼2.7534.95 ▲0.84
Add New Post /wp-admin/post-new.php1,649 ▲10922.26 ▼0.85632.12 ▼8.9257.61 ▼9.40
Media Library /wp-admin/upload.php1,403 ▲34.21 ▲0.0197.68 ▲1.9340.02 ▼0.64

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 232× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/Tag/Span.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\MpdfException' not found in wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/Exception/FontException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/Tag/Table.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/Tag/Font.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/Tag/BarCode.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/Tag/Sup.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\FormFeed' not found in wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/Tag/TocPageBreak.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/Tag/Meter.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-cart-pdf/wc-cart-pdf-compatibility.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/Tag/B.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
No plugin tags provided

wc-cart-pdf/wc-cart-pdf.php Passed 13 tests

The main PHP script in "WooCommerce Cart PDF" version 2.7.0 is automatically included on every request by WordPress
48 characters long description:
Allows customers to download their cart as a PDF

Code Analysis 95% 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 plugin79,043 lines of code in 443 files:
LanguageFilesBlank linesComment linesLines of code
PHP42111,65613,00377,776
JSON300571
CSS36518406
YAML7584196
XML27055
Markdown414034
Bourne Shell1203
JavaScript2022

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 7,024)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity55.71
▷ Minimum class complexity1.00
▷ Maximum class complexity7,024.00
Average method complexity13.34
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces49
Interfaces25
Traits6
Classes293
▷ Abstract classes93.07%
▷ Concrete classes28496.93%
▷ Final classes144.93%
Methods1,523
▷ Static methods1449.46%
▷ Public methods1,32687.07%
▷ Protected methods553.61%
▷ Private methods1429.32%
Functions59
▷ Named functions2644.07%
▷ Anonymous functions3355.93%
Constants432
▷ Global constants81.85%
▷ Class constants42498.15%
▷ Public constants424100.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
There were not PNG files found in your plugin