10% post2pdf-converter

Code Review | POST2PDF Converter

WordPress plugin POST2PDF Converter scored10%from 54 tests.

About plugin

  • Plugin page: post2pdf-converter
  • Plugin version: 0.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.3.1
  • WordPress version: 6.3.1
  • First release: Dec 26, 2011
  • Latest release: Mar 5, 2012
  • Number of updates: 117
  • Update frequency: every 0.8 days
  • Top authors: redcocker (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /21,472 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/post2pdf-converter/post2pdf-converter.php+60
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.14MB] [CPU: ▼5.29ms] Passed 4 tests

Analyzing server-side resources used by POST2PDF Converter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1537.04 ▼2.68
Dashboard /wp-admin3.46 ▲0.1144.23 ▼11.13
Posts /wp-admin/edit.php3.57 ▲0.2145.71 ▲1.53
Add New Post /wp-admin/post-new.php6.04 ▲0.1582.69 ▼8.89
Media Library /wp-admin/upload.php3.38 ▲0.1540.20 ▲8.07
POST2PDF Converter /wp-admin/options-general.php?page=post2pdf-converter-options3.7729.76

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 273 new files
Database: no new tables, 12 new options
New WordPress options
can_compress_scripts
post2pdf_conv_sig
post2pdf_conv_checkver_stamp
widget_recent-comments
post2pdf_conv_setting_opt
post2pdf_conv_exc
db_upgraded
post2pdf_conv_updated
widget_recent-posts
recovery_mode_email_last_sent
...

Browser metrics Passed 4 tests

A check of browser resources used by POST2PDF Converter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲5714.18 ▼0.371.75 ▲0.0137.63 ▼7.45
Dashboard /wp-admin2,212 ▲325.59 ▼0.0783.67 ▼8.1938.79 ▼1.91
Posts /wp-admin/edit.php2,096 ▼42.08 ▲0.0834.81 ▼2.5830.54 ▼7.27
Add New Post /wp-admin/post-new.php1,539 ▲423.19 ▼1.75601.24 ▼9.5259.76 ▼22.34
Media Library /wp-admin/upload.php1,414 ▲174.24 ▲0.0295.54 ▼14.0345.42 ▲0.14
POST2PDF Converter /wp-admin/options-general.php?page=post2pdf-converter-options2,2251.126.4232.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=post2pdf-converter-options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=post2pdf-converter-options
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=post2pdf-converter-options
    • > Notice in wp-content/plugins/post2pdf-converter/post2pdf-converter-admin.php+583
    Undefined property: POST2PDF_Converter::$post2pdf_conv_allowed_str
    • > GET request to /wp-admin/options-general.php?page=post2pdf-converter-options
    • > Error in wp-content/plugins/post2pdf-converter/post2pdf-converter-admin.php+769
    Uncaught Error: Call to undefined function mysql_get_server_info() in wp-content/plugins/post2pdf-converter/post2pdf-converter-admin.php:769
    Stack trace:
    #0 wp-content/plugins/post2pdf-converter/post2pdf-converter.php(838): include_once()
    #1 wp-includes/class-wp-hook.php(310): POST2PDF_Converter->post2pdf_conv_options_panel()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/post2pdf-converter/tcpdf/tcpdf.php on line 22155
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/post2pdf-converter/tcpdf/config/tcpdf_config.php:41
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/post2pdf-converter/tcpdf/config/tcpdf_config.php:95
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/post2pdf-converter/post2pdf-converter.php:49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/post2pdf-converter/post2pdf-converter-admin.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (This is the download link.), #2 (This is setting panel.)
You can look at the official readme.txt

post2pdf-converter/post2pdf-converter.php 92% from 13 tests

"POST2PDF Converter" version 0.4.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
These items require your attention
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/post2pdf-converter/tcpdf/tcpdf.crt
49,311 lines of code in 148 files:
LanguageFilesBlank linesComment linesLines of code
PHP1451,82813,05248,557
PO File2351374733
JavaScript14121

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 5,191)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 479)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity467.07
▷ Minimum class complexity1.00
▷ Maximum class complexity5,191.00
Average method complexity10.61
▷ Minimum method complexity1.00
▷ Maximum method complexity479.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods679
▷ Static methods00.00%
▷ Public methods35351.99%
▷ Protected methods32648.01%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants114
▷ Global constants114100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
tcpdf/images/tcpdf_signature.png66.34KB25.47KB▼ 61.61%
img/pdf128.png7.18KB3.77KB▼ 47.48%
img/pdf32.png1.51KB1.46KB▼ 3.29%
img/pdf48.png2.47KB1.86KB▼ 24.61%
img/pdf16.png0.65KB0.74KB0.00%