Benchmarks
Plugin footprint 65% 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.19MB] [CPU: ▼2.48ms] Passed 4 tests
A check of server-side resources used by Discount rules by NAPPS
No issues were detected with server-side resource usage
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 3.62 ▲0.16 | 40.27 ▲0.30 |
Dashboard /wp-admin | 3.53 ▲0.22 | 45.67 ▼4.67 |
Posts /wp-admin/edit.php | 3.58 ▲0.22 | 48.52 ▲1.48 |
Add New Post /wp-admin/post-new.php | 6.30 ▲0.41 | 83.65 ▼7.03 |
Media Library /wp-admin/upload.php | 3.39 ▲0.16 | 37.84 ▲2.64 |
Server storage [IO: ▲1.00MB] [DB: ▲0.00MB] Passed 3 tests
How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 46 new files
Database: 3 new tables, 8 new options
New tables |
---|
wp_napps_discount_rules_collections |
wp_napps_discount_rules |
wp_napps_discount_rules_products |
New WordPress options |
---|
db_upgraded |
widget_recent-comments |
widget_recent-posts |
can_compress_scripts |
widget_theysaidso_widget |
napps_discountrules_version |
napps_discountrules_installed |
theysaidso_admin_options |
Browser metrics Passed 4 tests
Checking browser requirements for Discount rules by NAPPS
This plugin has a minimal impact on browser resources
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 2,790 ▲28 | 14.25 ▲0.04 | 1.80 ▲0.12 | 42.52 ▼0.83 |
Dashboard /wp-admin | 2,198 ▲27 | 5.55 ▲0.01 | 85.05 ▼21.49 | 41.27 ▼0.50 |
Posts /wp-admin/edit.php | 2,100 ▼3 | 1.95 ▼0.01 | 39.00 ▲1.99 | 35.80 ▼0.58 |
Add New Post /wp-admin/post-new.php | 1,526 ▼0 | 23.54 ▲0.71 | 686.86 ▼51.37 | 54.80 ▼1.30 |
Media Library /wp-admin/upload.php | 1,394 ▼3 | 4.13 ▼0.10 | 98.63 ▼6.92 | 45.03 ▲0.77 |
Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests
🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
- This plugin does not fully uninstall, leaving 3 tables in the database
- wp_napps_discount_rules_collections
- wp_napps_discount_rules
- wp_napps_discount_rules_products
- This plugin did not uninstall successfully, leaving 8 options in the database
- widget_recent-posts
- widget_theysaidso_widget
- widget_recent-comments
- napps_discountrules_installed
- theysaidso_admin_options
- can_compress_scripts
- napps_discountrules_version
- db_upgraded
Smoke tests 75% 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 50% 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
The following issues need your attention
- 6× PHP files trigger server errors when accessed directly:
- > PHP Fatal error
Uncaught Error: Class 'App\\Repository\\WoocommerceRepository' not found in wp-content/plugins/discount-rules-by-napps/app/Repository/ProductRepository.php:9
- > PHP Fatal error
Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/discount-rules-by-napps/app/Api/CategoryController.php:14
- > PHP Fatal error
Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/discount-rules-by-napps/app/Api/ProductController.php:13
- > PHP Fatal error
Uncaught Error: Class 'App\\Repository\\WoocommerceRepository' not found in wp-content/plugins/discount-rules-by-napps/app/Repository/CategoryRepository.php:7
- > PHP Fatal error
Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/discount-rules-by-napps/app/Api.php:15
- > PHP Fatal error
Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/discount-rules-by-napps/app/Api/DiscountRulesController.php:19
- > PHP Fatal error
User-side errors Passed 1 test
🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side
Optimizations
Plugin configuration 93% from 29 tests
readme.txt 94% from 16 tests
The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
- Screenshots: These screenshots lack descriptions #1, #2, #3 in discount-rules-by-napps/assets to your readme.txt
discount-rules-by-napps/plugin.php 92% from 13 tests
The main PHP file in "Discount rules by NAPPS" ver. 1.0.7 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
- Main file name: Name the main plugin file the same as the plugin slug ("discount-rules-by-napps.php" instead of "plugin.php")
Code Analysis Passed 3 tests
File types Passed 1 test
🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin2,344 lines of code in 37 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 31 | 598 | 1,159 | 2,333 |
JSON | 1 | 0 | 0 | 5 |
CSS | 2 | 2 | 2 | 3 |
JavaScript | 3 | 0 | 1 | 3 |
PHP code Passed 2 tests
Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.37 |
Average class complexity | 11.58 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 48.00 |
Average method complexity | 2.66 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 22.00 |
Code structure | ||
---|---|---|
Namespaces | 9 | |
Interfaces | 0 | |
Traits | 0 | |
Classes | 24 | |
▷ Abstract classes | 1 | 4.17% |
▷ Concrete classes | 23 | 95.83% |
▷ Final classes | 1 | 4.35% |
Methods | 156 | |
▷ Static methods | 22 | 14.10% |
▷ Public methods | 139 | 89.10% |
▷ Protected methods | 6 | 3.85% |
▷ Private methods | 11 | 7.05% |
Functions | 4 | |
▷ Named functions | 0 | 0.00% |
▷ Anonymous functions | 4 | 100.00% |
Constants | 16 | |
▷ Global constants | 8 | 50.00% |
▷ Class constants | 8 | 50.00% |
▷ Public constants | 8 | 100.00% |
Plugin size 50% from 2 tests
Image compression 50% from 2 tests
It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
(invalid) assets/js/b219f8481319273ae941.png | 13.52KB | 0.00KB | ▼ 100.00% |
(invalid) assets/js/a4bf06611a4724123de0.png | 0.42KB | 0.00KB | ▼ 100.00% |