Benchmarks
Plugin footprint 65% from 16 tests
Installer Passed 1 test
🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices
Server metrics [RAM: ▼1.97MB] [CPU: ▲858.38ms] 75% from 4 tests
This is a short check of server-side resources used by Carbon Balance: Carbon calculation and offsetting for WooCommerce
Please have a look at the following items
- Extra CPU: The extra CPU usage must be under 200.00ms (currently 858.38ms on /wp-admin/upload.php)
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 2.03 ▼1.43 | 972.13 ▲931.21 |
Dashboard /wp-admin | 2.05 ▼1.30 | 943.22 ▲886.27 |
Posts /wp-admin/edit.php | 2.05 ▼1.31 | 936.51 ▲886.97 |
Add New Post /wp-admin/post-new.php | 2.05 ▼3.84 | 903.51 ▲791.74 |
Media Library /wp-admin/upload.php | 2.05 ▼1.18 | 905.34 ▲868.54 |
Server storage [IO: ▲0.85MB] [DB: ▲0.00MB] Passed 3 tests
Filesystem and database footprint
No storage issues were detected
Filesystem: 67 new files
Database: no new tables, 8 new options
New WordPress options |
---|
widget_recent-posts |
carbonbalance_checkout_placement |
widget_recent-comments |
widget_theysaidso_widget |
db_upgraded |
carbonbalance_widgetmark_footer |
can_compress_scripts |
theysaidso_admin_options |
Browser metrics Passed 4 tests
Carbon Balance: Carbon calculation and offsetting for WooCommerce: an overview of browser usage
Normal browser usage
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 2,819 ▲73 | 14.79 ▲0.40 | 1.91 ▲0.25 | 36.68 ▼3.25 |
Dashboard /wp-admin | 2,210 ▲19 | 5.81 ▼0.04 | 94.43 ▼9.67 | 39.74 ▼2.47 |
Posts /wp-admin/edit.php | 2,092 ▲3 | 1.96 ▼0.03 | 32.79 ▼6.32 | 35.54 ▲0.48 |
Add New Post /wp-admin/post-new.php | 1,545 ▲31 | 20.72 ▲3.10 | 587.00 ▼50.38 | 52.35 ▲1.16 |
Media Library /wp-admin/upload.php | 1,392 ▲4 | 4.18 ▼0.00 | 89.53 ▼8.06 | 42.78 ▲0.49 |
Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests
🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
- The plugin did not uninstall gracefully
- > Notice in wp-content/plugins/carbonbalance-for-woocommerce/carbonbalance-plugin.php+477
Trying to get property 'message' of non-object
- This plugin does not fully uninstall, leaving 8 options in the database
- widget_recent-posts
- widget_recent-comments
- carbonbalance_checkout_placement
- db_upgraded
- can_compress_scripts
- carbonbalance_widgetmark_footer
- widget_theysaidso_widget
- theysaidso_admin_options
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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
- 10× PHP files trigger errors when accessed directly with GET requests:
- > PHP Fatal error
Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/carbonbalance-for-woocommerce/carbonbalance-autoloader.php:12
- > PHP Fatal error
Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/carbonbalance-for-woocommerce/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php:12
- > PHP Fatal error
Uncaught Error: Call to undefined function sanitize_url() in wp-content/plugins/carbonbalance-for-woocommerce/views/carbonbalance_widget_template_default.php:8
- > PHP Fatal error
Uncaught Error: Call to undefined function carbonbalance_plugin_woocommerce\\Components\\Admin\\add_action() in wp-content/plugins/carbonbalance-for-woocommerce/Components/Admin/Carbonbalance-AdminOverview.php:16
- > PHP Fatal error
Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/carbonbalance-for-woocommerce/vendor/cbschuld/logentries/tests/LogEntriesTest.php:8
- > PHP Fatal error
Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/carbonbalance-for-woocommerce/vendor/psr/log/Psr/Log/NullLogger.php:13
- > PHP Fatal error
Uncaught Error: Call to undefined function add_action() in wp-content/plugins/carbonbalance-for-woocommerce/Components/Admin/views/default.php:9
- > PHP Fatal error
Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/carbonbalance-for-woocommerce/vendor/psr/log/Psr/Log/AbstractLogger.php:12
- > PHP Fatal error
Uncaught Error: Class 'cbschuld\\LogEntriesWriter' not found in wp-content/plugins/carbonbalance-for-woocommerce/vendor/cbschuld/logentries/tests/WriterTest.php:7
- > PHP Fatal error
Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/carbonbalance-for-woocommerce/vendor/cbschuld/logentries/src/LogEntries.php:8
- > PHP Fatal error
User-side errors Passed 1 test
🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected
Optimizations
Plugin configuration 90% from 29 tests
readme.txt 88% from 16 tests
The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
- Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
- Screenshots: Please describe screenshot #1 in carbonbalance-for-woocommerce/assets to your readme.txt
carbonbalance-for-woocommerce/carbonbalance-plugin.php 92% from 13 tests
The principal PHP file in "Carbon Balance: Carbon calculation and offsetting for WooCommerce" v. 1.0.0.5 is loaded by WordPress automatically on each request
The following require your attention:
- Main file name: It is recommended to name the main PHP file as the plugin slug ("carbonbalance-for-woocommerce.php" instead of "carbonbalance-plugin.php")
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
Success! There were no dangerous files found in this plugin15,284 lines of code in 53 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
JavaScript | 3 | 265 | 34 | 6,986 |
JSON | 6 | 0 | 0 | 4,125 |
PHP | 29 | 641 | 940 | 2,355 |
CSS | 2 | 70 | 23 | 888 |
Sass | 2 | 59 | 3 | 541 |
Markdown | 2 | 61 | 0 | 146 |
Bourne Shell | 1 | 21 | 7 | 99 |
SVG | 2 | 1 | 0 | 82 |
XML | 3 | 3 | 0 | 43 |
INI | 2 | 0 | 0 | 10 |
YAML | 1 | 3 | 0 | 9 |
PHP code Passed 2 tests
A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.30 |
Average class complexity | 11.70 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 112.00 |
Average method complexity | 2.47 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 18.00 |
Code structure | ||
---|---|---|
Namespaces | 8 | |
Interfaces | 2 | |
Traits | 2 | |
Classes | 19 | |
▷ Abstract classes | 3 | 15.79% |
▷ Concrete classes | 16 | 84.21% |
▷ Final classes | 0 | 0.00% |
Methods | 160 | |
▷ Static methods | 13 | 8.12% |
▷ Public methods | 148 | 92.50% |
▷ Protected methods | 0 | 0.00% |
▷ Private methods | 12 | 7.50% |
Functions | 6 | |
▷ Named functions | 2 | 33.33% |
▷ Anonymous functions | 4 | 66.67% |
Constants | 14 | |
▷ Global constants | 0 | 0.00% |
▷ Class constants | 14 | 100.00% |
▷ Public constants | 14 | 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
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
images/carbonbalance_logo.png | 43.51KB | 16.37KB | ▼ 62.38% |
images/check_carbonbalance.png | 0.75KB | 0.39KB | ▼ 47.26% |