10% wp-post-to-pdf-enhanced

Code Review | WP Post to PDF Enhanced

WordPress plugin WP Post to PDF Enhanced scored 10% from 54 tests.

About plugin

  • Plugin page: wp-post-to-pdf-en...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-4.2
  • WordPress version: 6.3.1
  • First release: Nov 12, 2013
  • Latest release: Apr 27, 2015
  • Number of updates: 79
  • Update frequency: every 43.9 days
  • Top authors: LewisR (98.73%)e3betht (2.53%)

Code review

54 tests

User reviews

47 reviews

Install metrics

1,000+ active / 60,976 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php+41
    Methods with the same name as their class will not be constructors in a future version of PHP; wpptopdfenh has a deprecated constructor

Server metrics [RAM: ▼1.67MB] [CPU: ▼50.93ms] Passed 4 tests

This is a short check of server-side resources used by WP Post to PDF Enhanced
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.32 ▼1.154.46 ▼43.95
Dashboard /wp-admin2.34 ▼0.975.98 ▼41.20
Posts /wp-admin/edit.php2.34 ▼1.029.70 ▼35.86
Add New Post /wp-admin/post-new.php2.34 ▼3.556.17 ▼82.69
Media Library /wp-admin/upload.php2.34 ▼0.907.26 ▼27.52
WP Post to PDF Enhanced /wp-admin/options-general.php?page=wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php2.346.14

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

Input-output and database impact of this plugin
These are issues you should consider
  • Total filesystem usage must be limited to 25MB (currently using 26.78MB)
Filesystem: 211 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
wpptopdfenh
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Post to PDF Enhanced
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.39 ▼1.011.64 ▼0.3038.54 ▼10.90
Dashboard /wp-admin2,210 ▲224.87 ▼1.17107.27 ▼8.7342.81 ▲0.59
Posts /wp-admin/edit.php2,096 ▲71.99 ▼0.0343.02 ▲6.9636.73 ▲2.55
Add New Post /wp-admin/post-new.php1,545 ▲3118.16 ▲0.56604.12 ▼36.2551.49 ▼0.89
Media Library /wp-admin/upload.php1,395 ▲44.22 ▲0.03104.31 ▲2.0942.47 ▼0.38
WP Post to PDF Enhanced /wp-admin/options-general.php?page=wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php3,9871.7726.6846.00

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php+41
    Methods with the same name as their class will not be constructors in a future version of PHP; wpptopdfenh has a deprecated constructor
  • The uninstall procedure has failed, leaving 7 options in the database
    • wpptopdfenh
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php
    • > Deprecated in wp-content/plugins/wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php+41
    Methods with the same name as their class will not be constructors in a future version of PHP; wpptopdfenh has a deprecated constructor
  • 29 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php
    • > Deprecated in wp-content/plugins/wp-post-to-pdf-enhanced/tcpdf/include/tcpdf_images.php+310
    Array and string offset access syntax with curly braces is deprecated
    • > GET request to /wp-admin/options-general.php?page=wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php
    • > Warning in wp-content/plugins/wp-post-to-pdf-enhanced/tcpdf/tcpdf.php+17637
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
    • > GET request to /wp-admin/options-general.php?page=wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php
    • > Notice in wp-content/plugins/wp-post-to-pdf-enhanced/wpptopdfenh_options.php+73
    Undefined index: excludeThis
    • > GET request to /wp-admin/options-general.php?page=wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php
    • > Notice in wp-content/plugins/wp-post-to-pdf-enhanced/wpptopdfenh_options.php+89
    Undefined index: excludeThisCache
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php
    • > Notice in wp-content/plugins/wp-post-to-pdf-enhanced/wpptopdfenh_options.php+174
    Undefined index: authorDetail
    • > GET request to /wp-admin/options-general.php?page=wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php
    • > Notice in wp-content/plugins/wp-post-to-pdf-enhanced/wpptopdfenh_options.php+316
    Undefined index: customCss
    • > GET request to /wp-admin/options-general.php?page=wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php
    • > Notice in wp-content/plugins/wp-post-to-pdf-enhanced/wpptopdfenh_options.php+375
    Undefined index: liSymbolFile
    • > GET request to /wp-admin/options-general.php?page=wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php
    • > Notice in wp-content/plugins/wp-post-to-pdf-enhanced/wpptopdfenh_options.php+421
    Undefined index: customFooterText
    • > GET request to /wp-admin/options-general.php?page=wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php
    • > Notice in wp-content/plugins/wp-post-to-pdf-enhanced/wpptopdfenh_options.php+461
    Undefined index: footerCellBorder
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php
    • > Notice in wp-content/plugins/wp-post-to-pdf-enhanced/wpptopdfenh_options.php+489
    Undefined index: footerAlign

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 21× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WPPTOPDFENH_PATH - assumed 'WPPTOPDFENH_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-post-to-pdf-enhanced/tcpdf/config/tcpdf_config.php on line 60
    • > PHP Warning
      Use of undefined constant WPPTOPDFENH_URL - assumed 'WPPTOPDFENH_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-post-to-pdf-enhanced/tcpdf/config/tcpdf_config.php on line 79
    • > PHP Warning
      require_once(WPPTOPDFENH_PATH/tcpdf/tcpdf.php): failed to open stream: No such file or directory in wp-content/plugins/wp-post-to-pdf-enhanced/wpptopdfenh_shortcodes.php on line 10
    • > PHP Fatal error
      require_once(): Failed opening required 'WPPTOPDFENH_PATH/tcpdf/tcpdf.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-post-to-pdf-enhanced/wpptopdfenh_shortcodes.php on line 10
    • > PHP Warning
      Use of undefined constant WPPTOPDFENH_URL - assumed 'WPPTOPDFENH_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-post-to-pdf-enhanced/tcpdf/config/tcpdf_config.php on line 79
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/wp-post-to-pdf-enhanced/tcpdf/tcpdf.php on line 17637
    • > PHP Warning
      Use of undefined constant WPPTOPDFENH_PATH - assumed 'WPPTOPDFENH_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-post-to-pdf-enhanced/tcpdf/config/tcpdf_config.php on line 60
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-post-to-pdf-enhanced/tcpdf/config/tcpdf_config.php on line 146
    • > PHP Warning
      Use of undefined constant WPPTOPDFENH_PATH - assumed 'WPPTOPDFENH_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-post-to-pdf-enhanced/wpptopdfenh_shortcodes.php on line 10
    • > PHP Warning
      Use of undefined constant WPPTOPDFENH_PATH - assumed 'WPPTOPDFENH_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-post-to-pdf-enhanced/tcpdf/config/tcpdf_config.php on line 60

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can take inspiration from this readme.txt

wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php Passed 13 tests

The main PHP file in "WP Post to PDF Enhanced" ver. 1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
136 characters long description:
WP Post to PDF Enhanced, based on the original WP Post to PDF, renders posts & pages as downloadable PDFs for archiving and/or printing.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin49,304 lines of code in 100 files:
LanguageFilesBlank linesComment linesLines of code
PHP971,52211,97449,182
CSS16078
JSON10040
diff10144

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 4,240)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 487)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity371.94
▷ Minimum class complexity1.00
▷ Maximum class complexity4,240.00
Average method complexity9.40
▷ Minimum method complexity1.00
▷ Maximum method complexity487.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods795
▷ Static methods10613.33%
▷ Public methods50363.27%
▷ Protected methods29236.73%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants152
▷ Global constants152100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
asset/images/logo.png11.80KB6.44KB▼ 45.40%
asset/images/pdf.png1.29KB1.25KB▼ 3.63%