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
This plugin's installer ran successfully
Server metrics [RAM: ▲0.00MB] [CPU: ▼5.09ms] Passed 4 tests
Analyzing server-side resources used by WooCommerce Gift Coupon
Normal server usage
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 3.46 ▲0.00 | 42.30 ▼4.95 |
Dashboard /wp-admin | 3.31 ▲0.00 | 50.37 ▼3.42 |
Posts /wp-admin/edit.php | 3.36 ▲0.00 | 50.13 ▼1.66 |
Add New Post /wp-admin/post-new.php | 5.89 ▲0.00 | 92.43 ▼10.31 |
Media Library /wp-admin/upload.php | 3.23 ▲0.00 | 36.17 ▼0.72 |
Server storage [IO: ▲9.93MB] [DB: ▲0.00MB] Passed 3 tests
Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 253 new files
Database: no new tables, 6 new options
New WordPress options |
---|
widget_recent-posts |
widget_theysaidso_widget |
theysaidso_admin_options |
can_compress_scripts |
widget_recent-comments |
db_upgraded |
Browser metrics Passed 4 tests
This is an overview of browser requirements for WooCommerce Gift Coupon
This plugin renders optimally with no browser resource issues detected
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 2,789 ▲28 | 14.21 ▼0.08 | 1.75 ▼0.01 | 43.09 ▲0.06 |
Dashboard /wp-admin | 2,195 ▲18 | 5.51 ▼0.09 | 86.32 ▼4.27 | 39.19 ▼5.76 |
Posts /wp-admin/edit.php | 2,103 ▼0 | 2.02 ▲0.02 | 38.15 ▼2.57 | 37.78 ▼0.05 |
Add New Post /wp-admin/post-new.php | 1,526 ▼0 | 23.14 ▼0.44 | 680.37 ▼21.39 | 60.78 ▲4.57 |
Media Library /wp-admin/upload.php | 1,400 ▲3 | 4.18 ▼0.01 | 95.88 ▼22.55 | 44.50 ▼5.66 |
Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests
🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
- Zombie WordPress options detected upon uninstall: 6 options
- widget_recent-comments
- widget_theysaidso_widget
- can_compress_scripts
- theysaidso_admin_options
- db_upgraded
- widget_recent-posts
Smoke tests 75% from 4 tests
Server-side errors Passed 1 test
🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test
SRP 50% from 2 tests
🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
- 103× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
- > PHP Fatal error
Uncaught Error: Class 'Svg\\Tag\\AbstractTag' not found in wp-content/plugins/woocommerce-gift-coupon/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/StyleTag.php:13
- > PHP Fatal error
Uncaught Error: Call to undefined function wp_max_upload_size() in wp-content/plugins/woocommerce-gift-coupon/admin/includes/gs-middle-options-page.php:11
- > PHP Fatal error
Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/woocommerce-gift-coupon/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/hhea.php:17
- > PHP Fatal error
Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/woocommerce-gift-coupon/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/cmap.php:17
- > PHP Fatal error
Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/woocommerce-gift-coupon/lib/dompdf/src/FrameDecorator/Block.php:20
- > PHP Fatal error
Uncaught Error: Class 'FontLib\\Header' not found in wp-content/plugins/woocommerce-gift-coupon/lib/dompdf/lib/php-font-lib/src/FontLib/EOT/Header.php:21
- > PHP Fatal error
Uncaught Error: Interface 'Dompdf\\Canvas' not found in wp-content/plugins/woocommerce-gift-coupon/lib/dompdf/src/Adapter/GD.php:24
- > PHP Fatal error
Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/woocommerce-gift-coupon/lib/dompdf/src/FrameDecorator/Inline.php:22
- > PHP Fatal error
Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/woocommerce-gift-coupon/lib/dompdf/src/FrameReflower/Block.php:23
- > PHP Fatal error
Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woocommerce-gift-coupon/lib/dompdf/lib/php-font-lib/tests/FontLib/FontTest.php:8
- > 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 Passed 29 tests
readme.txt Passed 16 tests
The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: discount coupon, cards, coupons, gift, pdf coupon...
woocommerce-gift-coupon/woocommerce-gift-coupon.php Passed 13 tests
"WooCommerce Gift Coupon" version 3.3.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
130 characters long description:
Buy coupons as a product to give a friend. Generate coupon code PDF and send it by email or download manually on the user profile.
Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected45,332 lines of code in 176 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 158 | 7,857 | 15,063 | 44,152 |
CSS | 2 | 116 | 46 | 552 |
Markdown | 4 | 86 | 0 | 233 |
XML | 3 | 3 | 2 | 175 |
JSON | 4 | 0 | 0 | 124 |
YAML | 2 | 11 | 2 | 40 |
JavaScript | 1 | 0 | 4 | 31 |
HTML | 1 | 0 | 0 | 17 |
SVG | 1 | 0 | 0 | 8 |
PHP code 50% from 2 tests
A short review of cyclomatic complexity and code structure
These items need your attention
- Please reduce cyclomatic complexity of methods to less than 100 (currently 652)
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.43 |
Average class complexity | 41.43 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 765.00 |
Average method complexity | 4.78 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 652.00 |
Code structure | ||
---|---|---|
Namespaces | 25 | |
Interfaces | 2 | |
Traits | 0 | |
Classes | 143 | |
▷ Abstract classes | 6 | 4.20% |
▷ Concrete classes | 137 | 95.80% |
▷ Final classes | 0 | 0.00% |
Methods | 1,609 | |
▷ Static methods | 80 | 4.97% |
▷ Public methods | 1,360 | 84.52% |
▷ Protected methods | 188 | 11.68% |
▷ Private methods | 61 | 3.79% |
Functions | 49 | |
▷ Named functions | 38 | 77.55% |
▷ Anonymous functions | 11 | 22.45% |
Constants | 155 | |
▷ Global constants | 7 | 4.52% |
▷ Class constants | 148 | 95.48% |
▷ Public constants | 148 | 100.00% |
Plugin size Passed 2 tests
Image compression Passed 2 tests
Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
admin/images/woocommerce_gift_coupon-icon.png | 0.37KB | 0.48KB | 0.00% |
lib/dompdf/lib/res/broken_image.png | 0.60KB | 0.47KB | ▼ 22.33% |