77% pdf-catalog-woocommerce

Code Review | PDF Catalog Woocommerce

WordPress plugin PDF Catalog Woocommerce scored77%from 54 tests.

About plugin

  • Plugin page: pdf-catalog-wooco...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 29, 2019
  • Latest release: Oct 14, 2023
  • Number of updates: 23
  • Update frequency: every 64.2 days
  • Top authors: gravitymaster97 (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

900+ active /11,235 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼8.22ms] Passed 4 tests

Server-side resources used by PDF Catalog Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1334.60 ▼5.51
Dashboard /wp-admin3.42 ▲0.0746.27 ▼13.05
Posts /wp-admin/edit.php3.53 ▲0.1848.07 ▼0.43
Add New Post /wp-admin/post-new.php6.02 ▲0.1378.90 ▼12.99
Media Library /wp-admin/upload.php3.34 ▲0.1134.10 ▼1.33

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 315 new files
Database: no new tables, 28 new options
New WordPress options
gmpcp_hf_item_background_color
gmpcp_trasnlation_single
gmpcp_background_color
widget_recent-comments
widget_recent-posts
can_compress_scripts
gmpcp_hf_background_color
gmpcp_trasnlation_tags
theysaidso_admin_options
gmwcp_single_display_location
...

Browser metrics Passed 4 tests

A check of browser resources used by PDF Catalog Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲6513.22 ▼1.141.65 ▼0.0139.14 ▼1.16
Dashboard /wp-admin2,232 ▲555.89 ▲0.1988.84 ▲1.5338.68 ▼4.03
Posts /wp-admin/edit.php2,139 ▲392.26 ▲0.2637.33 ▼1.3031.86 ▼4.98
Add New Post /wp-admin/post-new.php1,555 ▲2923.45 ▲0.44664.53 ▼6.0537.22 ▼22.92
Media Library /wp-admin/upload.php1,440 ▲464.54 ▲0.3396.29 ▼4.6542.60 ▼2.44

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
The following items require your attention
  • The uninstall procedure has failed, leaving 28 options in the database
    • gmpcp_trasnlation_read_more
    • gmwcp_enable_single_product
    • gmpcp_trasnlation_stock
    • gmpcp_item_background_color
    • db_upgraded
    • gmpcp_pagebreak
    • gmpcp_trasnlation_sku
    • gmpcp_footer_text
    • widget_recent-comments
    • gmpcp_trasnlation_categories
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/pdf-catalog-woocommerce/dompdf-master/vendor/masterminds/html5/bin/entities.php
  • 136× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/pdf-catalog-woocommerce/includes/GMWCP_layout.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\CSSList\\CSSBlockList' not found in wp-content/plugins/pdf-catalog-woocommerce/dompdf-master/vendor/sabberworm/php-css-parser/src/CSSList/AtRuleBlockList.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/pdf-catalog-woocommerce/dompdf-master/vendor/sabberworm/php-css-parser/src/Rule/Rule.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Renderer\\AbstractRenderer' not found in wp-content/plugins/pdf-catalog-woocommerce/dompdf-master/vendor/dompdf/dompdf/src/Renderer/ListBullet.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Shape' not found in wp-content/plugins/pdf-catalog-woocommerce/dompdf-master/vendor/phenx/php-svg-lib/src/Svg/Tag/Path.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\ListBullet' not found in wp-content/plugins/pdf-catalog-woocommerce/dompdf-master/vendor/dompdf/dompdf/src/FrameDecorator/ListBulletImage.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/pdf-catalog-woocommerce/dompdf-master/vendor/phenx/php-font-lib/src/FontLib/Table/DirectoryEntry.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\Header' not found in wp-content/plugins/pdf-catalog-woocommerce/dompdf-master/vendor/phenx/php-font-lib/src/FontLib/WOFF/Header.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Property\\AtRule' not found in wp-content/plugins/pdf-catalog-woocommerce/dompdf-master/vendor/sabberworm/php-css-parser/src/Property/Import.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Positioner\\Absolute' not found in wp-content/plugins/pdf-catalog-woocommerce/dompdf-master/vendor/dompdf/dompdf/src/Positioner/Fixed.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Contributors: Contributors not specified
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5, #6, #7, #8 in pdf-catalog-woocommerce/assets to your readme.txt
You can look at the official readme.txt

pdf-catalog-woocommerce/woocommerce-catalog-pdf.php 85% from 13 tests

The main PHP script in "PDF Catalog Woocommerce" version 2.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("pdf-catalog-woocommerce.php" instead of "woocommerce-catalog-pdf.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected44,066 lines of code in 242 files:
LanguageFilesBlank linesComment linesLines of code
PHP2148,59016,68240,448
JSON10001,773
Markdown1038101,279
CSS29738484
YAML213150
HTML10017
SVG1008
JavaScript2107

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity32.25
▷ Minimum class complexity1.00
▷ Maximum class complexity809.00
Average method complexity3.95
▷ Minimum method complexity1.00
▷ Maximum method complexity97.00
Code structure
Namespaces37
Interfaces9
Traits0
Classes190
▷ Abstract classes126.32%
▷ Concrete classes17893.68%
▷ Final classes00.00%
Methods2,189
▷ Static methods1396.35%
▷ Public methods1,73079.03%
▷ Protected methods40018.27%
▷ Private methods592.70%
Functions29
▷ Named functions26.90%
▷ Anonymous functions2793.10%
Constants220
▷ Global constants62.73%
▷ Class constants21497.27%
▷ Public constants20997.66%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/woocommerce-placeholder-600x600.png39.31KB21.09KB▼ 46.36%
dompdf-master/vendor/dompdf/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%