83% dk-pdf

Code Review | DK PDF

WordPress plugin DK PDF scored83%from 54 tests.

About plugin

  • Plugin page: dk-pdf
  • Plugin version: 1.9.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.9
  • WordPress version: 6.3.1
  • First release: Jul 10, 2015
  • Latest release: Mar 24, 2021
  • Number of updates: 38
  • Update frequency: every 54.8 days
  • Top authors: dinamiko (100%)

Code review

54 tests

User reviews

41 reviews

Install metrics

5,000+ active /76,911 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
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼9.06ms] Passed 4 tests

This is a short check of server-side resources used by DK PDF
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0434.92 ▼9.69
Dashboard /wp-admin3.38 ▲0.0744.77 ▼2.12
Posts /wp-admin/edit.php3.49 ▲0.1444.80 ▼3.13
Add New Post /wp-admin/post-new.php5.96 ▲0.0780.22 ▼21.28
Media Library /wp-admin/upload.php3.30 ▲0.0736.42 ▲0.20
DK PDF /wp-admin/admin.php?page=dkpdf_settings3.3036.38
Addons /wp-admin/admin.php?page=dkpdf-addons3.2627.15

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 784 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for DK PDF
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,939 ▲16813.56 ▼0.815.87 ▲3.8637.88 ▼7.58
Dashboard /wp-admin2,236 ▲484.88 ▼0.03101.05 ▼7.8438.76 ▼9.45
Posts /wp-admin/edit.php2,113 ▲242.04 ▲0.0135.29 ▼5.5331.89 ▼4.37
Add New Post /wp-admin/post-new.php1,536 ▲817.49 ▼5.81671.52 ▲72.5860.51 ▲8.44
Media Library /wp-admin/upload.php1,412 ▲214.30 ▲0.10105.92 ▲6.8848.02 ▲2.80
DK PDF /wp-admin/admin.php?page=dkpdf_settings1,1143.8660.5926.22
Addons /wp-admin/admin.php?page=dkpdf-addons7882.0524.4427.56

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 146× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Tag/Cite.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Tag/Em.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Tag/FieldSet.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/Code39.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Tag/TextCircle.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\MpdfException' not found in wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Tag/Div.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Tag/H4.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Tag/Nav.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Tag/Section.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Front-end PDF Button), #2 (PDF Button settings), #3 (PDF Setup settings), #4 (PDF Header & Footer settings), #5 (PDF Custom CSS), #6 (Disable PDF Button Metabox)
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

dk-pdf/dk-pdf.php 85% from 13 tests

"DK PDF" version 1.9.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.9.6" instead of "3.9")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin75,797 lines of code in 343 files:
LanguageFilesBlank linesComment linesLines of code
PHP3159,38810,45473,934
Markdown62160768
CSS47918454
JSON5290379
JavaScript7321496
PO File1252766
XML39066
YAML111031
Bourne Shell1203

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 7,591)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity79.82
▷ Minimum class complexity1.00
▷ Maximum class complexity7,591.00
Average method complexity16.47
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces22
Interfaces5
Traits2
Classes215
▷ Abstract classes73.26%
▷ Concrete classes20896.74%
▷ Final classes10.48%
Methods1,153
▷ Static methods827.11%
▷ Public methods1,00086.73%
▷ Protected methods332.86%
▷ Private methods12010.41%
Functions67
▷ Named functions6191.04%
▷ Anonymous functions68.96%
Constants392
▷ Global constants123.06%
▷ Class constants38096.94%
▷ Public constants380100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin