80% jk-html-to-pdf

Code Review | JK Html To Pdf

WordPress plugin JK Html To Pdf scored80%from 54 tests.

About plugin

  • Plugin page: jk-html-to-pdf
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.5.2
  • WordPress version: 6.3.1
  • First release: May 30, 2016
  • Latest release: Jun 14, 2016
  • Number of updates: 10
  • Update frequency: every 2.1 days
  • Top authors: jaykrishnang (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,150 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.08ms] Passed 4 tests

Server-side resources used by JK Html To Pdf
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0549.28 ▲4.51
Dashboard /wp-admin3.35 ▲0.0544.60 ▼3.18
Posts /wp-admin/edit.php3.46 ▲0.1149.51 ▲0.66
Add New Post /wp-admin/post-new.php5.93 ▲0.0481.14 ▼8.32
Media Library /wp-admin/upload.php3.27 ▲0.0436.04 ▼1.49

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for JK Html To Pdf
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲8413.31 ▼0.992.04 ▼0.1237.76 ▼8.37
Dashboard /wp-admin2,222 ▲345.84 ▲0.97111.51 ▼2.7842.37 ▼6.48
Posts /wp-admin/edit.php2,108 ▲192.04 ▲0.0239.75 ▲1.7535.93 ▲0.42
Add New Post /wp-admin/post-new.php1,551 ▲1823.38 ▲0.22665.35 ▼0.0263.29 ▲8.20
Media Library /wp-admin/upload.php1,404 ▲164.21 ▲0.0495.60 ▼23.6341.49 ▼12.00

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/jk-html-to-pdf/jkhtmltopdf.php+70
    rmdir(wp-content/uploads/jkhtmltopdf//html): Directory not empty
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
No output text or server-side errors detected on direct access of PHP files

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 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: html, pdf, wkhtmltopdf, plugin, html to pdf

jk-html-to-pdf/jkhtmltopdf.php 92% from 13 tests

The main file in "JK Html To Pdf" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("jk-html-to-pdf.php" instead of "jkhtmltopdf.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected261 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP272162261

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods1071.43%
▷ Protected methods428.57%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
PNG images were not found in this plugin