84% document-engine

Code Review | Document Engine - Download Posts as PDF, PDF Embedder

WordPress plugin Document Engine - Download Posts as PDF, PDF Embedder scored84%from 54 tests.

About plugin

  • Plugin page: document-engine
  • Plugin version: 1.0.12
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.2
  • WordPress version: 6.3.1
  • First release: Apr 12, 2022
  • Latest release: Jun 5, 2023
  • Number of updates: 13
  • Update frequency: every 32.2 days
  • Top authors: matrixaddons (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,751 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼3.78ms] Passed 4 tests

A check of server-side resources used by Document Engine - Download Posts as PDF, PDF Embedder
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2841.47 ▼5.59
Dashboard /wp-admin3.61 ▲0.3051.12 ▼2.11
Posts /wp-admin/edit.php3.66 ▲0.3049.27 ▲2.37
Add New Post /wp-admin/post-new.php6.13 ▲0.2489.80 ▼4.58
Media Library /wp-admin/upload.php3.47 ▲0.2336.08 ▼2.85
Documents /wp-admin/admin.php?page=document-engine-settings3.7343.07

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 631 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Document Engine - Download Posts as PDF, PDF Embedder
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲12414.31 ▼0.331.63 ▼0.4741.96 ▼5.23
Dashboard /wp-admin2,284 ▲1045.69 ▼0.0286.62 ▼7.7778.70 ▲38.98
Posts /wp-admin/edit.php2,201 ▲1011.99 ▼0.0434.68 ▼5.8033.78 ▼5.63
Add New Post /wp-admin/post-new.php6,463 ▲4,93227.84 ▲4.63924.04 ▲288.2240.36 ▼12.78
Media Library /wp-admin/upload.php1,504 ▲1014.24 ▲0.0198.74 ▼2.4274.76 ▲29.33
Documents /wp-admin/admin.php?page=document-engine-settings1,2693.8261.1960.52

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

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 | 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
Almost there! Just fix the following items
  • 217× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/document-engine/vendor/mpdf/mpdf/src/Tag/Figure.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/document-engine/vendor/mpdf/mpdf/src/Tag/Li.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerAwareInterface' not found in wp-content/plugins/document-engine/vendor/mpdf/mpdf/src/Writer/MetadataWriter.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/document-engine/vendor/mpdf/mpdf/src/Tag/BarCode.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/document-engine/vendor/mpdf/mpdf/src/Barcode/I25.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Meter' not found in wp-content/plugins/document-engine/vendor/mpdf/mpdf/src/Tag/Progress.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function document_engine_pdf_header_logo() in wp-content/plugins/document-engine/templates/pdf-header.php:5
    • > PHP Fatal error
      Trait 'Mpdf\\Strict' not found in wp-content/plugins/document-engine/vendor/mpdf/mpdf/src/Writer/FontWriter.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/document-engine/vendor/mpdf/mpdf/src/Tag/H2.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/document-engine/vendor/mpdf/mpdf/src/Barcode/EanExt.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: create pdf, generate pdf, wordpress to pdf, pdf maker, pdf viewer

document-engine/document-engine.php Passed 13 tests

The principal PHP file in "Document Engine - Download Posts as PDF, PDF Embedder" v. 1.0.12 is loaded by WordPress automatically on each request
56 characters long description:
Convert any post type to PDF document & PDF viewer block

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected92,585 lines of code in 452 files:
LanguageFilesBlank linesComment linesLines of code
PHP40911,63411,80177,200
SVG4019,620
CSS71,595303,677
Markdown938501,179
JSON600548
YAML7584196
JavaScript625587
XML310075
Bourne Shell1203

PHP code 0% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Class cyclomatic complexity has to be reduced 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 complexity58.32
▷ Minimum class complexity1.00
▷ Maximum class complexity7,024.00
Average method complexity13.59
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces49
Interfaces10
Traits6
Classes295
▷ Abstract classes103.39%
▷ Concrete classes28596.61%
▷ Final classes155.26%
Methods1,422
▷ Static methods17312.17%
▷ Public methods1,23286.64%
▷ Protected methods574.01%
▷ Private methods1339.35%
Functions64
▷ Named functions4164.06%
▷ Anonymous functions2335.94%
Constants436
▷ Global constants143.21%
▷ Class constants42296.79%
▷ Public constants422100.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
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
assets/images/upload-image.png2.57KB1.94KB▼ 24.52%