73% e2pdf

Code Review | E2Pdf - Export To Pdf Tool for WordPress

WordPress plugin E2Pdf - Export To Pdf Tool for WordPress scored73%from 54 tests.

About plugin

  • Plugin page: e2pdf
  • Plugin version: 1.20.25
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Aug 20, 2018
  • Latest release: Oct 24, 2023
  • Number of updates: 202
  • Update frequency: every 9.4 days
  • Top authors: oleksandrz (100%)

Code review

54 tests

User reviews

46 reviews

Install metrics

10,000+ active /272,890 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.34MB] [CPU: ▼6.50ms] Passed 4 tests

An overview of server-side resources used by E2Pdf - Export To Pdf Tool for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2540.87 ▼0.57
Dashboard /wp-admin3.68 ▲0.3347.42 ▼11.85
Posts /wp-admin/edit.php3.71 ▲0.3664.76 ▲16.96
Add New Post /wp-admin/post-new.php6.35 ▲0.4774.89 ▼16.12
Media Library /wp-admin/upload.php3.63 ▲0.4035.84 ▲2.56
Templates /wp-admin/admin.php?page=e2pdf-templates4.12397.46
Settings /wp-admin/admin.php?page=e2pdf-settings4.08399.33
License /wp-admin/admin.php?page=e2pdf-license3.63378.79
Export /wp-admin/admin.php?page=e2pdf3.74388.18

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 463 new files
Database: 7 new tables, 11 new options
New tables
wp_e2pdf_pages
wp_e2pdf_bulks
wp_e2pdf_templates
wp_e2pdf_entries
wp_e2pdf_elements
wp_e2pdf_datasets
wp_e2pdf_revisions
New WordPress options
db_upgraded
can_compress_scripts
e2pdf_license
e2pdf_cache_fonts
e2pdf_version
e2pdf_nonce_key
widget_recent-posts
e2pdf_cache
widget_recent-comments
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for E2Pdf - Export To Pdf Tool for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,932 ▲17113.54 ▼0.838.75 ▲7.0941.94 ▼2.22
Dashboard /wp-admin2,261 ▲835.59 ▼0.2480.60 ▼35.6535.69 ▼5.87
Posts /wp-admin/edit.php2,169 ▲692.02 ▼0.0150.06 ▲14.0646.08 ▲14.29
Add New Post /wp-admin/post-new.php1,553 ▲2723.18 ▲0.02682.08 ▲2.0155.68 ▼1.19
Media Library /wp-admin/upload.php1,463 ▲664.26 ▲0.10103.97 ▼6.2644.61 ▼3.03
Templates /wp-admin/admin.php?page=e2pdf-templates1,2001.9130.3433.47
Settings /wp-admin/admin.php?page=e2pdf-settings1,2541.8229.8436.98
License /wp-admin/admin.php?page=e2pdf-license9652.2527.5129.81
Export /wp-admin/admin.php?page=e2pdf1,1461.7927.4426.14

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_e2pdf_bulks
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please take a closer look at the following
  • 77× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/e2pdf/classes/helper/e2pdf-shortcode.php
    • > /wp-content/plugins/e2pdf/classes/view/page-e2pdf-settings.php
    • > /wp-content/plugins/e2pdf/classes/helper/e2pdf-qrcode.php
    • > /wp-content/plugins/e2pdf/classes/model/e2pdf-filter.php
    • > /wp-content/plugins/e2pdf/classes/model/e2pdf-element.php
    • > /wp-content/plugins/e2pdf/classes/model/e2pdf-action.php
    • > /wp-content/plugins/e2pdf/classes/model/e2pdf-api.php
    • > /wp-content/plugins/e2pdf/classes/helper/e2pdf-image.php
    • > /wp-content/plugins/e2pdf/classes/helper/e2pdf-simplexmlelement.php
    • > /wp-content/plugins/e2pdf/classes/view/metaboxes/e2pdf_templates_save.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (29 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

e2pdf/e2pdf.php Passed 13 tests

The principal PHP file in "E2Pdf - Export To Pdf Tool for WordPress" v. 1.20.25 is loaded by WordPress automatically on each request
18 characters long description:
Export to PDF tool

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected118,265 lines of code in 176 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript613,04181972,200
PHP774,1963,06338,414
CSS71,334395,486
PO File17691,1311,407
HTML16616426
SVG84097332

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,253)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 373)
Cyclomatic complexity
Average complexity per logical line of code0.68
Average class complexity164.37
▷ Minimum class complexity1.00
▷ Maximum class complexity2,253.00
Average method complexity12.70
▷ Minimum method complexity1.00
▷ Maximum method complexity373.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes54
▷ Abstract classes00.00%
▷ Concrete classes54100.00%
▷ Final classes00.00%
Methods754
▷ Static methods60.80%
▷ Public methods65987.40%
▷ Protected methods20.27%
▷ Private methods9312.33%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/pdf.js/web/images/shadow.png0.26KB0.35KB0.00%