10% tcpdf

Code Review | TCPDF Library

WordPress plugin TCPDF Library scored10%from 54 tests.

About plugin

  • Plugin page: tcpdf
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 11, 2012
  • Latest release: Sep 7, 2015
  • Number of updates: 5
  • Update frequency: every 212.2 days
  • Top authors: rheinardkorf (60%)sushkov (60%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /5,633 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/tcpdf/lib/tcpdf/include/tcpdf_images.php+318
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▲0.21MB] [CPU: ▼3.82ms] Passed 4 tests

Server-side resources used by TCPDF Library
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2339.55 ▼8.35
Dashboard /wp-admin3.53 ▲0.2349.32 ▼7.56
Posts /wp-admin/edit.php3.59 ▲0.2347.24 ▲0.98
Add New Post /wp-admin/post-new.php6.05 ▲0.1787.67 ▲0.02
Media Library /wp-admin/upload.php3.46 ▲0.2337.82 ▲0.63

Server storage [IO: ▲26.63MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
It is recommended to fix the following issues
  • Try to limit filesystem usage to 25MB (currently using 26.63MB)
Filesystem: 205 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by TCPDF Library
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.011.73 ▼0.1143.34 ▼2.93
Dashboard /wp-admin2,198 ▲245.62 ▲0.0284.98 ▼11.1240.48 ▲0.73
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0435.66 ▼1.3835.33 ▼0.29
Add New Post /wp-admin/post-new.php1,526 ▼723.63 ▲0.44694.03 ▲24.2662.21 ▲9.77
Media Library /wp-admin/upload.php1,400 ▲34.19 ▼0.0294.38 ▼9.7440.91 ▼1.40

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/tcpdf/lib/tcpdf/tools/tcpdf_addfont.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tcpdf/tcpdf.php:52

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tested up to: Invalid plugin version format
  • Requires at least: Invalid plugin version format
The official readme.txt is a good inspiration

tcpdf/tcpdf.php 92% from 13 tests

The main PHP script in "TCPDF Library" version 1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 145 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin47,085 lines of code in 95 files:
LanguageFilesBlank linesComment linesLines of code
PHP941,38911,72947,045
JSON10040

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 4,349)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 499)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity427.53
▷ Minimum class complexity1.00
▷ Maximum class complexity4,349.00
Average method complexity10.13
▷ Minimum method complexity1.00
▷ Maximum method complexity499.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods701
▷ Static methods10915.55%
▷ Public methods42560.63%
▷ Protected methods27639.37%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants108
▷ Global constants108100.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