83% pdf-generator-addon-for-elementor-page-builder

Code Review | PDF Generator Addon for Elementor Page Builder

WordPress plugin PDF Generator Addon for Elementor Page Builder scored83%from 54 tests.

About plugin

  • Plugin page: pdf-generator-add...
  • Plugin version: 1.7.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Jan 26, 2019
  • Latest release: Jul 26, 2023
  • Number of updates: 50
  • Update frequency: every 32.9 days
  • Top authors: redefiningtheweb (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

1,000+ active /39,634 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.51MB] [CPU: ▼12.30ms] Passed 4 tests

Analyzing server-side resources used by PDF Generator Addon for Elementor Page Builder
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1938.16 ▼0.84
Dashboard /wp-admin3.48 ▲0.1748.46 ▲0.87
Posts /wp-admin/edit.php3.59 ▲0.2450.88 ▲6.04
Add New Post /wp-admin/post-new.php3.32 ▼2.5637.91 ▼52.65
Media Library /wp-admin/upload.php3.40 ▲0.1738.59 ▲3.41

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 628 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for PDF Generator Addon for Elementor Page Builder
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,937 ▲17613.93 ▼0.085.33 ▲3.7838.38 ▼8.25
Dashboard /wp-admin2,235 ▲555.84 ▲0.24100.98 ▲12.0440.96 ▼4.48
Posts /wp-admin/edit.php2,132 ▲322.40 ▲0.4644.04 ▲6.9235.46 ▼0.86
Add New Post /wp-admin/post-new.php1,576 ▲4518.48 ▼4.46616.88 ▲14.3445.05 ▼6.89
Media Library /wp-admin/upload.php1,447 ▲474.48 ▲0.28101.53 ▲1.0843.26 ▼19.96

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 fix the following
  • 237× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/pdf-generator-addon-for-elementor-page-builder/includes/mpdf/mpdf/mpdf/src/Barcode/S25.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/pdf-generator-addon-for-elementor-page-builder/includes/mpdf/mpdf/mpdf/src/Tag/Figure.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/pdf-generator-addon-for-elementor-page-builder/includes/mpdf/setasign/fpdi/src/PdfParser/Type/PdfNull.php:16
    • > PHP Fatal error
      Trait 'Mpdf\\Strict' not found in wp-content/plugins/pdf-generator-addon-for-elementor-page-builder/includes/mpdf/mpdf/mpdf/src/Otl.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/pdf-generator-addon-for-elementor-page-builder/includes/mpdf/mpdf/mpdf/src/Barcode/Code93.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/pdf-generator-addon-for-elementor-page-builder/includes/mpdf/mpdf/mpdf/src/Tag/Annotation.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\SubstituteTag' not found in wp-content/plugins/pdf-generator-addon-for-elementor-page-builder/includes/mpdf/mpdf/mpdf/src/Tag/Tts.php:5
    • > PHP Notice
      Undefined index: filename in wp-content/plugins/pdf-generator-addon-for-elementor-page-builder/includes/mpdf/mpdf/mpdf/data/out.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/pdf-generator-addon-for-elementor-page-builder/includes/mpdf/mpdf/mpdf/src/Tag/Main.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/pdf-generator-addon-for-elementor-page-builder/includes/mpdf/setasign/fpdi/src/PdfParser/Type/PdfBoolean.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

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:
  • Tags: There are too many tags (11 tag instead of maximum 10)
Please take inspiration from this readme.txt

pdf-generator-addon-for-elementor-page-builder/pdf-generator-addon-for-elementor-page-builder.php Passed 13 tests

The primary PHP file in "PDF Generator Addon for Elementor Page Builder" version 1.7.2 is used by WordPress to initiate all plugin functionality
124 characters long description:
PDF Generator Addon for WordPress Elementor Page Builder allows to create a static look and generate PDF of pages and posts.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin83,028 lines of code in 465 files:
LanguageFilesBlank linesComment linesLines of code
PHP42412,19313,45079,564
Markdown1348101,472
CSS57033773
JSON800705
YAML9634236
JavaScript21960200
XML310075
Bourne Shell1203

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 7,021)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity56.44
▷ Minimum class complexity1.00
▷ Maximum class complexity7,021.00
Average method complexity12.82
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces49
Interfaces20
Traits8
Classes302
▷ Abstract classes82.65%
▷ Concrete classes29497.35%
▷ Final classes144.76%
Methods1,624
▷ Static methods1479.05%
▷ Public methods1,40586.51%
▷ Protected methods724.43%
▷ Private methods1479.05%
Functions40
▷ Named functions1537.50%
▷ Anonymous functions2562.50%
Constants461
▷ Global constants378.03%
▷ Class constants42491.97%
▷ Public constants424100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.53MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/rtw_tech_support.png2.60KB1.94KB▼ 25.52%
admin/assets/rtw_docs.png1.34KB1.30KB▼ 2.99%
admin/assets/rtw_github.png3.58KB2.26KB▼ 36.68%
public/images/pdf_down_icon.png2.66KB2.27KB▼ 14.56%
public/images/pdf_icon.png2.02KB1.88KB▼ 7.15%