Benchmarks
Plugin footprint 83% from 16 tests
Installer Passed 1 test
🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices
Server metrics [RAM: ▲0.01MB] [CPU: ▼5.76ms] Passed 4 tests
A check of server-side resources used by Discounts Manager for Products
No issues were detected with server-side resource usage
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 3.60 ▲0.14 | 36.11 ▼5.98 |
Dashboard /wp-admin | 3.31 ▲0.01 | 44.01 ▼7.82 |
Posts /wp-admin/edit.php | 3.36 ▲0.01 | 47.41 ▲0.44 |
Add New Post /wp-admin/post-new.php | 5.89 ▲0.01 | 90.46 ▼7.67 |
Media Library /wp-admin/upload.php | 3.24 ▲0.01 | 32.23 ▼1.57 |
Server storage [IO: ▲1.05MB] [DB: ▲0.00MB] Passed 3 tests
A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 42 new files
Database: no new tables, 6 new options
New WordPress options |
---|
db_upgraded |
widget_recent-comments |
widget_recent-posts |
widget_theysaidso_widget |
can_compress_scripts |
theysaidso_admin_options |
Browser metrics Passed 4 tests
Checking browser requirements for Discounts Manager for Products
Normal browser usage
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 2,800 ▲54 | 13.20 ▼1.22 | 1.60 ▼0.29 | 37.49 ▼4.75 |
Dashboard /wp-admin | 2,203 ▲18 | 5.91 ▲1.05 | 105.07 ▲1.65 | 36.48 ▼5.18 |
Posts /wp-admin/edit.php | 2,092 ▲3 | 2.04 ▼0.02 | 39.78 ▲3.42 | 35.40 ▲3.12 |
Add New Post /wp-admin/post-new.php | 1,514 ▼21 | 17.62 ▼5.63 | 581.90 ▼93.60 | 52.96 ▼3.94 |
Media Library /wp-admin/upload.php | 1,388 ▲3 | 4.22 ▲0.02 | 92.99 ▼5.06 | 39.88 ▼4.98 |
Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests
🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
- This plugin does not fully uninstall, leaving 6 options in the database
- widget_theysaidso_widget
- widget_recent-comments
- widget_recent-posts
- theysaidso_admin_options
- db_upgraded
- can_compress_scripts
Smoke tests 75% from 4 tests
Server-side errors Passed 1 test
🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected
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
Please fix the following items
- 9× PHP files trigger server errors when accessed directly:
- > PHP Fatal error
Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/woocommerce-discounts-plus/inc/templates/wcdp_error_message.php:5
- > PHP Fatal error
Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/woocommerce-discounts-plus/inc/templates/wcdp_category.php:6
- > PHP Fatal error
Uncaught Error: Call to a member function init_form_fields() on null in wp-content/plugins/woocommerce-discounts-plus/inc/templates/wcdp_general_settings.php:5
- > PHP Fatal error
Uncaught Error: Class 'wdp_core_factory' not found in wp-content/plugins/woocommerce-discounts-plus/inc/classes/Woo_Discounts_Plus_Plugin.php:7
- > PHP Fatal error
Uncaught Error: Call to undefined function _e() in wp-content/plugins/woocommerce-discounts-plus/inc/templates/wcdp_product_criteria.php:9
- > PHP Fatal error
Uncaught Error: Call to undefined function _e() in wp-content/plugins/woocommerce-discounts-plus/inc/templates/wdp_woo_tab.php:30
- > PHP Fatal error
Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/woocommerce-discounts-plus/inc/settings.php:14
- > PHP Fatal error
Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/woocommerce-discounts-plus/inc/templates/wcdp_global_criteria.php:6
- > PHP Fatal error
Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/woocommerce-discounts-plus/inc/templates/wcdp_cart_criteria.php:6
- > PHP Fatal error
User-side errors Passed 1 test
🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side
Optimizations
Plugin configuration 93% from 29 tests
readme.txt Passed 16 tests
The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: cart discount, woocommerce discount, discounts, criteria, order discount...
woocommerce-discounts-plus/index.php 85% from 13 tests
"Discounts Manager for Products" version 3.5.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
- Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
- Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woocommerce-discounts-plus.php" instead of "index.php")
Code Analysis Passed 3 tests
File types Passed 1 test
🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected5,184 lines of code in 23 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 13 | 1,604 | 755 | 3,242 |
PO File | 3 | 510 | 688 | 1,310 |
CSS | 4 | 71 | 9 | 423 |
JavaScript | 3 | 90 | 12 | 209 |
PHP code Passed 2 tests
This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.51 |
Average class complexity | 194.50 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 388.00 |
Average method complexity | 8.90 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 45.00 |
Code structure | ||
---|---|---|
Namespaces | 0 | |
Interfaces | 0 | |
Traits | 0 | |
Classes | 2 | |
▷ Abstract classes | 1 | 50.00% |
▷ Concrete classes | 1 | 50.00% |
▷ Final classes | 0 | 0.00% |
Methods | 50 | |
▷ Static methods | 0 | 0.00% |
▷ Public methods | 42 | 84.00% |
▷ Protected methods | 8 | 16.00% |
▷ Private methods | 0 | 0.00% |
Functions | 42 | |
▷ Named functions | 42 | 100.00% |
▷ Anonymous functions | 0 | 0.00% |
Constants | 0 | |
▷ Global constants | 0 | 0.00% |
▷ Class constants | 0 | 0.00% |
▷ Public constants | 0 | 0.00% |
Plugin size Passed 2 tests
Image compression Passed 2 tests
Using a strong compression for your PNG files is a great way to speed-up your plugin
9 PNG files occupy 0.17MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
images/flat-percent.png | 2.68KB | 1.25KB | ▼ 53.21% |
images/character-with-case.png | 22.93KB | 6.70KB | ▼ 70.79% |
images/email+invoice.png | 3.87KB | 2.70KB | ▼ 30.23% |
images/still-anim-sprite.png | 27.16KB | 8.07KB | ▼ 70.29% |
images/still-sprite.png | 31.38KB | 10.49KB | ▼ 66.57% |