88% wpmk-pdf-generator

Code Review | WPMK PDF Generator

WordPress plugin WPMK PDF Generator scored88%from 54 tests.

About plugin

  • Plugin page: wpmk-pdf-generator
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8.1
  • WordPress version: 6.3.1
  • First release: Sep 24, 2018
  • Latest release: Oct 26, 2021
  • Number of updates: 8
  • Update frequency: every 141.4 days
  • Top authors: wpmkorg (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /3,167 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.20ms] Passed 4 tests

An overview of server-side resources used by WPMK PDF Generator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0642.30 ▲5.63
Dashboard /wp-admin3.37 ▲0.0250.00 ▼6.95
Posts /wp-admin/edit.php3.48 ▲0.1247.29 ▼0.26
Add New Post /wp-admin/post-new.php5.95 ▲0.0681.95 ▼8.80
Media Library /wp-admin/upload.php3.29 ▲0.0634.02 ▲3.20

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WPMK PDF Generator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,976 ▲20517.96 ▲3.5910.79 ▲8.9742.36 ▲2.75
Dashboard /wp-admin2,224 ▲635.98 ▲0.3697.23 ▼7.6890.06 ▲46.53
Posts /wp-admin/edit.php2,126 ▲263.29 ▲1.2839.81 ▼0.6432.44 ▼5.64
Add New Post /wp-admin/post-new.php1,554 ▲2624.31 ▲1.34654.79 ▼54.9234.77 ▼26.89
Media Library /wp-admin/upload.php1,417 ▲175.24 ▲1.05106.17 ▲1.7192.22 ▲50.06

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests Passed 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 Passed 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
Congratulations! This plugin passed the SRP test

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)
No browser errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% 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
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Admin Screen), #2 (Preview Screen), #3 (Downloaded PDF Preview)
  • Requires php: Invalid version format
  • Tags: Please reduce the number of tags, currently 18 tag instead of maximum 10
The official readme.txt is a good inspiration

wpmk-pdf-generator/wpmk-pdf.php 85% from 13 tests

The main file in "WPMK PDF Generator" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wpmk-pdf-generator.php" instead of "wpmk-pdf.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin289 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP262142216
CSS11045
JavaScript41927028

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity1.44
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods211.11%
▷ Public methods1372.22%
▷ Protected methods00.00%
▷ Private methods527.78%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 1.06MB with 0.57MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png287.85KB92.15KB▼ 67.99%
screenshot-2.png523.78KB158.01KB▼ 69.83%
assets/images/pdf-icon.png0.12KB0.11KB▼ 9.60%
screenshot-1.png277.41KB92.99KB▼ 66.48%