Benchmarks
Plugin footprint 65% from 16 tests
Installer Passed 1 test
🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors
Server metrics [RAM: ▲0.79MB] [CPU: ▼9.90ms] Passed 4 tests
This is a short check of server-side resources used by Advanced PDF Generator
This plugin has minimal impact on server resources
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 4.24 ▲0.78 | 48.48 ▲1.76 |
Dashboard /wp-admin | 4.12 ▲0.81 | 46.36 ▼5.83 |
Posts /wp-admin/edit.php | 4.15 ▲0.79 | 45.86 ▼10.39 |
Add New Post /wp-admin/post-new.php | 6.76 ▲0.88 | 79.74 ▼21.42 |
Media Library /wp-admin/upload.php | 3.99 ▲0.76 | 36.59 ▼1.97 |
Server storage [IO: ▲9.04MB] [DB: ▲0.00MB] Passed 3 tests
Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 152 new files
Database: 1 new table, 6 new options
New tables |
---|
wp_apdfg_values |
New WordPress options |
---|
can_compress_scripts |
widget_theysaidso_widget |
theysaidso_admin_options |
widget_recent-comments |
widget_recent-posts |
db_upgraded |
Browser metrics Passed 4 tests
This is an overview of browser requirements for Advanced PDF Generator
There were no issues detected in relation to browser resource usage
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 2,937 ▲180 | 13.57 ▼0.82 | 10.38 ▲8.07 | 42.22 ▼3.45 |
Dashboard /wp-admin | 2,226 ▲38 | 5.83 ▲0.81 | 94.61 ▼19.62 | 39.49 ▼8.60 |
Posts /wp-admin/edit.php | 2,112 ▲23 | 2.00 ▼0.02 | 33.61 ▼2.13 | 29.85 ▼5.19 |
Add New Post /wp-admin/post-new.php | 1,531 ▲17 | 17.37 ▼0.38 | 652.35 ▼18.47 | 61.31 ▲3.86 |
Media Library /wp-admin/upload.php | 1,411 ▲20 | 4.20 ▲0.03 | 94.24 ▼8.44 | 41.19 ▼0.22 |
Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests
🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
- This plugin does not fully uninstall, leaving 1 table in the database
- wp_apdfg_values
- The uninstall procedure has failed, leaving 6 options in the database
- widget_recent-posts
- can_compress_scripts
- widget_theysaidso_widget
- theysaidso_admin_options
- widget_recent-comments
- db_upgraded
Smoke tests 50% from 4 tests
Server-side errors Passed 1 test
🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test
SRP 0% from 2 tests
🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
- 1× PHP files output non-empty strings when accessed directly via GET requests:
- > /wp-content/plugins/advanced-pdf-generator/public/partials/plugin-name-public-display.php
- 86× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
- > PHP Warning
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/advanced-pdf-generator/public/libs/dompdf/lib/Cpdf.php on line 481
- > PHP Notice
Trying to get property 'submit_label' of non-object in wp-content/plugins/advanced-pdf-generator/admin/partials/advanced-pdf-generator-admin-display.php on line 101
- > PHP Notice
Undefined variable: values in wp-content/plugins/advanced-pdf-generator/admin/partials/advanced-pdf-generator-admin-display.php on line 45
- > PHP Warning
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/advanced-pdf-generator/public/libs/dompdf/lib/Cpdf.php on line 467
- > PHP Notice
Undefined variable: values in wp-content/plugins/advanced-pdf-generator/admin/partials/advanced-pdf-generator-admin-display.php on line 87
- > PHP Fatal error
Uncaught Error: Class 'Dompdf\\FrameDecorator\\Block' not found in wp-content/plugins/advanced-pdf-generator/public/libs/dompdf/src/FrameDecorator/TableCell.php:19
- > PHP Fatal error
Uncaught Error: Class 'Dompdf\\Positioner\\AbstractPositioner' not found in wp-content/plugins/advanced-pdf-generator/public/libs/dompdf/src/Positioner/ListBullet.php:19
- > PHP Fatal error
Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/advanced-pdf-generator/public/libs/dompdf/src/FrameDecorator/Text.php:24
- > PHP Notice
Trying to get property 'success_message' of non-object in wp-content/plugins/advanced-pdf-generator/admin/partials/advanced-pdf-generator-admin-display.php on line 87
- > PHP Fatal error
Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/advanced-pdf-generator/public/libs/dompdf/src/FrameDecorator/Inline.php:22
- > PHP Warning
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 93% from 29 tests
readme.txt 94% from 16 tests
Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
- Screenshots: Add descriptions for screenshots #1, #2, #3 in advanced-pdf-generator/assets to your readme.txt
advanced-pdf-generator/advanced-pdf-generator.php 92% from 13 tests
The main PHP script in "Advanced PDF Generator" version 0.4.0 is automatically included on every request by WordPress
It is important to fix the following:
- Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
Code Analysis 97% from 3 tests
File types Passed 1 test
🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin23,012 lines of code in 102 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 91 | 5,642 | 13,163 | 22,157 |
CSS | 3 | 95 | 52 | 430 |
Markdown | 3 | 91 | 0 | 218 |
XML | 1 | 0 | 2 | 140 |
JSON | 1 | 0 | 0 | 44 |
HTML | 1 | 0 | 0 | 17 |
JavaScript | 2 | 4 | 54 | 6 |
PHP code 50% from 2 tests
This plugin's cyclomatic complexity and code structure detailed below
The following items need your attention
- Method cyclomatic complexity has to be reduced to less than 100 (currently 652)
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.47 |
Average class complexity | 54.37 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 765.00 |
Average method complexity | 5.07 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 652.00 |
Code structure | ||
---|---|---|
Namespaces | 10 | |
Interfaces | 1 | |
Traits | 0 | |
Classes | 83 | |
▷ Abstract classes | 4 | 4.82% |
▷ Concrete classes | 79 | 95.18% |
▷ Final classes | 0 | 0.00% |
Methods | 1,130 | |
▷ Static methods | 62 | 5.49% |
▷ Public methods | 955 | 84.51% |
▷ Protected methods | 122 | 10.80% |
▷ Private methods | 53 | 4.69% |
Functions | 11 | |
▷ Named functions | 3 | 27.27% |
▷ Anonymous functions | 8 | 72.73% |
Constants | 84 | |
▷ Global constants | 3 | 3.57% |
▷ Class constants | 81 | 96.43% |
▷ Public constants | 81 | 100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
public/libs/dompdf/lib/res/broken_image.png | 0.60KB | 0.47KB | ▼ 22.33% |