83% wp-pdf-generator

Code Review | WP PDF Generator

WordPress plugin WP PDF Generator scored83%from 54 tests.

About plugin

  • Plugin page: wp-pdf-generator
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: WP 3.0.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Jan 23, 2015
  • Latest release: Jun 5, 2023
  • Number of updates: 40
  • Update frequency: every 76.4 days
  • Top authors: wooexpert (67.5%)wpexpertsio (35%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /36,291 total downloads

Benchmarks

Plugin footprint 83% 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.07MB] [CPU: ▼4.10ms] Passed 4 tests

Analyzing server-side resources used by WP PDF Generator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.95 ▲2.49
Dashboard /wp-admin3.38 ▲0.0752.54 ▼3.72
Posts /wp-admin/edit.php3.49 ▲0.1348.56 ▼4.89
Add New Post /wp-admin/post-new.php5.96 ▲0.0798.26 ▼6.45
Media Library /wp-admin/upload.php3.30 ▲0.0735.75 ▼1.33

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 30 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
wpexperts_pdf_option
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WP PDF Generator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲16414.94 ▲0.5836.72 ▲35.2143.70 ▲1.17
Dashboard /wp-admin2,211 ▲375.56 ▼0.0894.02 ▲1.1188.11 ▲45.10
Posts /wp-admin/edit.php2,116 ▲161.99 ▼0.0236.75 ▼1.9232.80 ▼4.77
Add New Post /wp-admin/post-new.php1,539 ▲1123.13 ▲0.05677.00 ▲18.7563.72 ▲2.26
Media Library /wp-admin/upload.php1,407 ▲74.10 ▲0.04104.21 ▼8.3974.60 ▲29.33

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-pdf-generator/wp_objects_save_data.php:17

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 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: There are too many tags (18 tag instead of maximum 10)
The official readme.txt is a good inspiration

wp-pdf-generator/wp_objects_pdf.php 77% from 13 tests

"WP PDF Generator" version 1.2.3'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:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-pdf-generator.php" instead of "wp_objects_pdf.php")
  • Requires at least: Periods and digits should be used for the required version number (ex. "7.0" instead of "WP 3.0.1")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected381 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP47175269
JavaScript62727061
CSS21051

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity10.50
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods21
▷ Static methods29.52%
▷ Public methods1571.43%
▷ Protected methods00.00%
▷ Private methods628.57%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/pdf11.png0.47KB0.47KB0.00%
images/images.png0.56KB0.56KB0.35%
images/download.png0.64KB0.64KB0.15%