93% e2pdf

Code Review | E2Pdf - Export To Pdf Tool for WordPress

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

About plugin

  • Plugin page: e2pdf
  • Plugin version: 1.16.44
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 5.8.1
  • First release: Aug 20, 2018
  • Latest release: Nov 3, 2021
  • Number of updates: 160
  • Update frequency: every 7.3 days
  • Top authors: oleksandrz (100%)

Code review

54 tests

User reviews

34 reviews

Install metrics

7,000+ active / 107,575 total downloads

Benchmarks

Plugin footprint Passed 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: ▲4.29MB] [CPU: ▼112.99ms] 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 /6.85 ▲4.1361.45 ▲40.43
Dashboard /wp-admin7.39 ▲4.3372.83 ▲33.91
Posts /wp-admin/edit.php7.42 ▲4.3174.31 ▲30.35
Add New Post /wp-admin/post-new.php9.97 ▲4.54115.09 ▼543.42
Media Library /wp-admin/upload.php7.39 ▲4.3866.93 ▲27.22
Templates /wp-admin/admin.php?page=e2pdf-templates7.74428.84
Export /wp-admin/admin.php?page=e2pdf7.63486.90
Settings /wp-admin/admin.php?page=e2pdf-settings7.57420.05
License /wp-admin/admin.php?page=e2pdf-license7.40434.09

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 455 new files
Database: 6 new tables, 4 new options
New tables
wp_e2pdf_revisions
wp_e2pdf_entries
wp_e2pdf_elements
wp_e2pdf_pages
wp_e2pdf_templates
wp_e2pdf_datasets
New WordPress options
e2pdf_cache
e2pdf_license
e2pdf_cache_fonts
e2pdf_version

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 /3,851 ▲25516.33 ▲0.3313.77 ▲4.3745.94 ▲1.53
Dashboard /wp-admin3,014 ▲805.88 ▼0.09140.17 ▼2.58111.61 ▲0.93
Posts /wp-admin/edit.php2,780 ▲412.72 ▼0.0063.01 ▲0.2188.77 ▼4.85
Add New Post /wp-admin/post-new.php1,631 ▼4118.46 ▼0.42353.60 ▼12.29108.38 ▼1.74
Media Library /wp-admin/upload.php1,851 ▲415.03 ▼0.02142.96 ▼4.63119.85 ▼1.79
Templates /wp-admin/admin.php?page=e2pdf-templates1,5672.4260.8688.51
Export /wp-admin/admin.php?page=e2pdf1,4692.3961.0278.30
Settings /wp-admin/admin.php?page=e2pdf-settings1,6632.4263.4072.61
License /wp-admin/admin.php?page=e2pdf-license1,2252.8656.0079.00

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

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
  • 71× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/e2pdf/classes/extension/e2pdf-caldera.php
    • > /wp-content/plugins/e2pdf/classes/helper/e2pdf-shortcode.php
    • > /wp-content/plugins/e2pdf/classes/model/e2pdf-template.php
    • > /wp-content/plugins/e2pdf/classes/model/e2pdf-api.php
    • > /wp-content/plugins/e2pdf/classes/view/field/checkbox.php
    • > /wp-content/plugins/e2pdf/classes/model/e2pdf-license.php
    • > /wp-content/plugins/e2pdf/e2pdf.php
    • > /wp-content/plugins/e2pdf/classes/controller/frontend/e2pdf-download.php
    • > /wp-content/plugins/e2pdf/classes/extension/e2pdf-forminator.php
    • > /wp-content/plugins/e2pdf/classes/controller/e2pdf.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.16.44 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 detected110,673 lines of code in 164 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript613,13150370,616
PHP714,5073,39332,815
CSS61,297395,272
PO File16629651,224
HTML16616426
SVG79096320

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 1,985)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 346)
Cyclomatic complexity
Average complexity per logical line of code0.66
Average class complexity158.04
▷ Minimum class complexity1.00
▷ Maximum class complexity1,985.00
Average method complexity12.28
▷ Minimum method complexity1.00
▷ Maximum method complexity346.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes49
▷ Abstract classes00.00%
▷ Concrete classes49100.00%
▷ Final classes00.00%
Methods682
▷ Static methods71.03%
▷ Public methods59086.51%
▷ Protected methods20.29%
▷ Private methods9013.20%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ 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
4 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/qrcode.png7.00KB2.98KB▼ 57.35%
img/barcode.png5.56KB2.12KB▼ 61.86%
img/upload.png2.23KB1.26KB▼ 43.68%
assets/pdf.js/web/images/shadow.png0.26KB0.35KB0.00%