10% pdf-creator-lite

Code Review | PDF Creator Lite

WordPress plugin PDF Creator Lite scored10%from 54 tests.

About plugin

  • Plugin page: pdf-creator-lite
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3
  • WordPress version: 6.3.1
  • First release: Jun 30, 2014
  • Latest release: Sep 18, 2015
  • Number of updates: 19
  • Update frequency: every 23.5 days
  • Top authors: alexfurr (68.42%)simon.ward (36.84%)

Code review

54 tests

User reviews

4 reviews

Install metrics

90+ active /8,728 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/pdf-creator-lite/tcpdf/tcpdf.php+16914
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▲5.57MB] [CPU: ▼38.91ms] 75% from 4 tests

This is a short check of server-side resources used by PDF Creator Lite
The following require your attention
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.57MB on /wp-admin/tools.php?page=exportAsPDF)
PageMemory (MB)CPU Time (ms)
Home /9.56 ▲6.1025.42 ▼16.10
Dashboard /wp-admin9.58 ▲6.2425.99 ▼34.07
Posts /wp-admin/edit.php9.58 ▲6.2327.12 ▼19.91
Add New Post /wp-admin/post-new.php9.58 ▲3.7023.41 ▼85.55
Media Library /wp-admin/upload.php9.58 ▲6.3629.48 ▼7.07
PDF Creator /wp-admin/tools.php?page=exportAsPDF9.5826.08

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 63 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for PDF Creator Lite
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲16713.58 ▼0.745.44 ▲3.4039.95 ▼2.08
Dashboard /wp-admin2,207 ▲194.83 ▼0.04117.97 ▲5.5842.72 ▲3.10
Posts /wp-admin/edit.php2,093 ▲42.05 ▼0.0136.05 ▼0.4333.72 ▼3.09
Add New Post /wp-admin/post-new.php1,522 ▲322.95 ▼0.01613.09 ▼67.6753.61 ▲0.90
Media Library /wp-admin/upload.php1,392 ▲44.19 ▼0.0399.47 ▼10.8242.16 ▼5.60
PDF Creator /wp-admin/tools.php?page=exportAsPDF1,3422.3341.2443.23

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/pdf-creator-lite/tcpdf/tcpdf.php+16914
    Array and string offset access syntax with curly braces is deprecated
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=exportAsPDF
    • > Deprecated in wp-content/plugins/pdf-creator-lite/tcpdf/include/tcpdf_images.php+310
    Array and string offset access syntax with curly braces is deprecated
    • > GET request to /wp-admin/tools.php?page=exportAsPDF
    • > Warning in wp-content/plugins/pdf-creator-lite/tcpdf/tcpdf.php+17770
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

SRP 0% 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
Please fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/pdf-creator-lite/tcpdf/tools/tcpdf_addfont.php
    • > /wp-content/plugins/pdf-creator-lite/download.php
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/pdf-creator-lite/pdf-creator-lite.php:16
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/pdf-creator-lite/tcpdf/tcpdf.php on line 17770
    • > PHP Fatal error
      Uncaught Error: Class 'TCPDF' not found in wp-content/plugins/pdf-creator-lite/scripts/extend-class-tcpdf.php:4
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/pdf-creator-lite/tcpdf/tcpdf.php on line 17770

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/tools.php?page=exportAsPDF
    • > Rendering (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1 The specified value "!" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #3 (The outputted file) image required
The official readme.txt might help

pdf-creator-lite/pdf-creator-lite.php Passed 13 tests

"PDF Creator Lite" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
82 characters long description:
Let visitors and admins create PDFs of your site content at the click of a button.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin49,208 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP401,83212,11147,039
JavaScript33081881,674
CSS14228455
JSON10040

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 4,296)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 496)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity443.60
▷ Minimum class complexity1.00
▷ Maximum class complexity4,296.00
Average method complexity10.48
▷ Minimum method complexity1.00
▷ Maximum method complexity496.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods700
▷ Static methods10615.14%
▷ Public methods42360.43%
▷ Protected methods27739.57%
▷ Private methods00.00%
Functions24
▷ Named functions2291.67%
▷ Anonymous functions28.33%
Constants106
▷ Global constants106100.00%
▷ Class constants00.00%
▷ Public constants00.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
12 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/pdf_icons/pdf_icon12.png0.46KB0.32KB▼ 29.36%
images/pdf_icons/pdf_icon07.png4.73KB2.65KB▼ 43.85%
images/pdf_icons/pdf_icon06.png4.17KB2.63KB▼ 36.90%
images/pdf_icons/pdf_icon02.png3.21KB2.04KB▼ 36.50%
images/pdf_icons/pdf_icon08.png5.32KB2.67KB▼ 49.77%