Benchmarks
Plugin footprint 83% from 16 tests
Installer Passed 1 test
🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully
Server metrics [RAM: ▲0.21MB] [CPU: ▼142.76ms] Passed 4 tests
Analyzing server-side resources used by Custom Post Type Attachment
No issues were detected with server-side resource usage
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 3.02 ▲0.30 | 37.60 ▲17.71 |
Dashboard /wp-admin | 3.30 ▲0.24 | 47.70 ▼1.78 |
Posts /wp-admin/edit.php | 3.35 ▲0.24 | 44.31 ▲1.93 |
Add New Post /wp-admin/post-new.php | 5.59 ▲0.16 | 84.89 ▼573.86 |
Media Library /wp-admin/upload.php | 3.18 ▲0.18 | 34.04 ▲2.66 |
Custom Post Type Attachment /wp-admin/options-general.php?page=custom_pdf_attachment | 3.16 | 33.24 |
Server storage [IO: ▲0.06MB] [DB: ▲0.00MB] Passed 3 tests
How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 39 new files
Database: no new tables, 1 new option
New WordPress options |
---|
widget_pdf_attachment_wid |
Browser metrics Passed 4 tests
An overview of browser requirements for Custom Post Type Attachment
There were no issues detected in relation to browser resource usage
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 3,718 ▲122 | 15.94 ▲0.46 | 8.74 ▼0.63 | 58.06 ▲13.89 |
Dashboard /wp-admin | 2,983 ▲46 | 6.15 ▲0.22 | 136.04 ▼4.50 | 114.04 ▲4.20 |
Posts /wp-admin/edit.php | 2,765 ▲26 | 2.71 ▲0.01 | 68.32 ▲5.95 | 97.57 ▲6.53 |
Add New Post /wp-admin/post-new.php | 1,683 ▼189 | 18.92 ▼0.15 | 380.21 ▲12.39 | 126.61 ▲13.60 |
Media Library /wp-admin/upload.php | 1,820 ▲10 | 5.05 ▲0.04 | 135.46 ▼18.46 | 114.90 ▼8.10 |
Custom Post Type Attachment /wp-admin/options-general.php?page=custom_pdf_attachment | 1,564 | 2.46 | 61.42 | 84.01 |
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
These items require your attention
- This plugin does not fully uninstall, leaving 1 option in the database
- widget_pdf_attachment_wid
Smoke tests 50% from 4 tests
Server-side errors Passed 1 test
🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test
SRP 0% 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
Almost there! Just fix the following items
- 4× PHP files output text when accessed directly:
- > /wp-content/plugins/custom-post-type-pdf-attachment/view/admin/info.php
- > /wp-content/plugins/custom-post-type-pdf-attachment/view/admin/pro-add.php
- > /wp-content/plugins/custom-post-type-pdf-attachment/view/admin/help-info.php
- > /wp-content/plugins/custom-post-type-pdf-attachment/view/admin/attachment-not-defined.php
- 10× PHP files trigger server-side errors or warnings when accessed directly:
- > PHP Fatal error
Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/custom-post-type-pdf-attachment/view/admin/help.php:3
- > PHP Warning
include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/custom-post-type-pdf-attachment/custom-pdf-attachment.php on line 23
- > PHP Fatal error
Uncaught Error: Call to undefined function _e() in wp-content/plugins/custom-post-type-pdf-attachment/view/admin/settings.php:3
- > PHP Fatal error
Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/custom-post-type-pdf-attachment/view/admin/donate.php:3
- > PHP Fatal error
Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/custom-post-type-pdf-attachment/custom-pdf-attachment.php:24
- > PHP Warning
include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/custom-post-type-pdf-attachment/custom-pdf-attachment.php on line 23
- > PHP Warning
Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-post-type-pdf-attachment/custom-pdf-attachment.php on line 23
- > PHP Notice
Undefined variable: saved_no_of_pdf_attachment in wp-content/plugins/custom-post-type-pdf-attachment/view/admin/help-info.php on line 15
- > PHP Fatal error
Uncaught Error: Call to undefined function _e() in wp-content/plugins/custom-post-type-pdf-attachment/view/admin/attachment-form.php:2
- > PHP Fatal error
Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-post-type-pdf-attachment/pdf-attachment-widget.php:3
- > PHP Fatal error
User-side errors Passed 1 test
🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side
Optimizations
Plugin configuration 90% from 29 tests
readme.txt 94% from 16 tests
The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
- Tags: There are too many tags (15 tag instead of maximum 10)
custom-post-type-pdf-attachment/custom-pdf-attachment.php 85% from 13 tests
The primary PHP file in "Custom Post Type Attachment" version 3.4.5 is used by WordPress to initiate all plugin functionality
The following require your attention:
- Description: Please don't use more than 140 characters for the plugin description (currently 163 characters long)
- Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-post-type-pdf-attachment.php" instead of "custom-pdf-attachment.php")
Code Analysis Passed 3 tests
File types Passed 1 test
🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin1,064 lines of code in 28 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 22 | 174 | 115 | 913 |
JavaScript | 3 | 2 | 1 | 75 |
CSS | 2 | 4 | 4 | 62 |
PO File | 1 | 6 | 0 | 14 |
PHP code Passed 2 tests
This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.41 |
Average class complexity | 14.44 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 53.00 |
Average method complexity | 3.47 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 18.00 |
Code structure | ||
---|---|---|
Namespaces | 0 | |
Interfaces | 0 | |
Traits | 0 | |
Classes | 9 | |
▷ Abstract classes | 0 | 0.00% |
▷ Concrete classes | 9 | 100.00% |
▷ Final classes | 0 | 0.00% |
Methods | 49 | |
▷ Static methods | 7 | 14.29% |
▷ Public methods | 48 | 97.96% |
▷ Protected methods | 0 | 0.00% |
▷ Private methods | 1 | 2.04% |
Functions | 11 | |
▷ Named functions | 10 | 90.91% |
▷ Anonymous functions | 1 | 9.09% |
Constants | 2 | |
▷ Global constants | 2 | 100.00% |
▷ Class constants | 0 | 0.00% |
▷ Public constants | 0 | 0.00% |
Plugin size Passed 2 tests
Image compression Passed 2 tests
PNG files should be compressed to save space and minimize bandwidth usage
8 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
images/image.png | 0.63KB | 1.08KB | 0.00% |
images/xls.png | 0.54KB | 0.53KB | ▼ 3.06% |
images/pdf.png | 0.45KB | 0.50KB | 0.00% |
images/zip.png | 0.18KB | 0.14KB | ▼ 22.28% |
images/ppt.png | 0.58KB | 0.70KB | 0.00% |