Benchmarks
Plugin footprint 65% from 16 tests
Installer Passed 1 test
🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices
Server metrics [RAM: ▲0.65MB] [CPU: ▲3.75ms] Passed 4 tests
This is a short check of server-side resources used by WooCommerce Disable Payment Methods based on cart conditions
No issues were detected with server-side resource usage
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 4.11 ▲0.65 | 43.96 ▼1.18 |
Dashboard /wp-admin | 3.98 ▲0.67 | 55.20 ▲5.72 |
Posts /wp-admin/edit.php | 4.03 ▲0.67 | 54.67 ▲8.21 |
Add New Post /wp-admin/post-new.php | 6.50 ▲0.61 | 100.87 ▲7.28 |
Media Library /wp-admin/upload.php | 3.90 ▲0.67 | 39.60 ▲3.18 |
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius | 4.27 | 39.79 |
Conditional Payment Methods /wp-admin/admin.php?page=wccpg_welcome_page | 3.91 | 37.78 |
Conditional Payment Methods /wp-admin/admin.php?page=wccpg_whats_new | 3.84 | 35.28 |
Server storage [IO: ▲3.73MB] [DB: ▲0.07MB] Passed 3 tests
Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 270 new files
Database: no new tables, 10 new options
New WordPress options |
---|
fs_debug_mode |
db_upgraded |
wccpg_welcome_redirect |
fs_active_plugins |
widget_theysaidso_widget |
widget_recent-posts |
widget_recent-comments |
theysaidso_admin_options |
fs_accounts |
can_compress_scripts |
Browser metrics Passed 4 tests
Checking browser requirements for WooCommerce Disable Payment Methods based on cart conditions
There were no issues detected in relation to browser resource usage
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 2,831 ▲45 | 14.24 ▼0.09 | 2.11 ▲0.09 | 32.63 ▼9.62 |
Dashboard /wp-admin | 2,215 ▲38 | 5.62 ▼0.02 | 93.89 ▼1.13 | 44.01 ▲2.00 |
Posts /wp-admin/edit.php | 2,121 ▲18 | 2.01 ▲0.02 | 41.77 ▲2.48 | 40.14 ▲5.81 |
Add New Post /wp-admin/post-new.php | 1,531 ▲5 | 23.30 ▲0.23 | 682.17 ▲13.49 | 59.80 ▲3.21 |
Media Library /wp-admin/upload.php | 1,420 ▲20 | 4.18 ▲0.06 | 98.93 ▲1.74 | 47.61 ▲7.62 |
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius | 1,082 | 1.65 | 26.47 | 28.54 |
Conditional Payment Methods /wp-admin/admin.php?page=wccpg_welcome_page | 797 | 2.03 | 24.12 | 28.48 |
Conditional Payment Methods /wp-admin/admin.php?page=wccpg_whats_new | 797 | 2.03 | 23.84 | 26.58 |
Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 50% from 4 tests
🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
- Uninstall procedure had uncaught errors
- > Notice in wp-content/plugins/woo-conditional-payment-gateways/vendor/freemius/includes/class-freemius.php+8486
Undefined property: stdClass::$plugins
- The uninstall procedure has failed, leaving 10 options in the database
- widget_recent-posts
- widget_recent-comments
- wccpg_welcome_redirect
- theysaidso_admin_options
- widget_theysaidso_widget
- fs_active_plugins
- fs_accounts
- can_compress_scripts
- db_upgraded
- fs_debug_mode
Smoke tests 50% from 4 tests
Server-side errors 0% from 1 test
🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
- > GET request to /wp-admin/admin.php?page=wccpg_welcome_page
- > Notice in wp-content/plugins/woo-conditional-payment-gateways/vendor/vg-plugin-sdk/views/page-template.php+18
Undefined variable: content
- > GET request to /wp-admin/admin.php?page=wccpg_whats_new
- > Warning in wp-content/plugins/woo-conditional-payment-gateways/vendor/vg-plugin-sdk/index.php+169
include(/1.16.0.php): failed to open stream: No such file or directory
- > GET request to /wp-admin/admin.php?page=wccpg_whats_new
- > Warning in wp-content/plugins/woo-conditional-payment-gateways/vendor/vg-plugin-sdk/index.php+169
include(): Failed opening '/1.16.0.php' for inclusion (include_path='.:/usr/share/php')
- > GET request to /wp-admin/admin.php?page=wccpg_whats_new
- > Notice in wp-content/plugins/woo-conditional-payment-gateways/vendor/vg-plugin-sdk/index.php+171
Undefined variable: items
- > GET request to /wp-admin/admin.php?page=wccpg_whats_new
- > Warning in wp-content/plugins/woo-conditional-payment-gateways/vendor/vg-plugin-sdk/index.php+187
include(): Filename cannot be empty
- > GET request to /wp-admin/admin.php?page=wccpg_whats_new
- > Warning in wp-content/plugins/woo-conditional-payment-gateways/vendor/vg-plugin-sdk/index.php+187
include(): Failed opening '' for inclusion (include_path='.:/usr/share/php')
SRP 50% from 2 tests
🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
- 15× PHP files trigger server errors when accessed directly (only 10 are shown):
- > PHP Fatal error
Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-conditional-payment-gateways/modules/core/frontend/reload-checkout.php:7
- > PHP Warning
Use of undefined constant WCCPG_DIST_DIR - assumed 'WCCPG_DIST_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-conditional-payment-gateways/inc/freemius-init.php on line 10
- > PHP Fatal error
Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-conditional-payment-gateways/backend/premium-teasers.php:155
- > PHP Warning
require_once(WCCPG_DIST_DIR/vendor/freemius/start.php): failed to open stream: No such file or directory in wp-content/plugins/woo-conditional-payment-gateways/inc/freemius-init.php on line 10
- > PHP Fatal error
Uncaught Error: Call to undefined function __() in wp-content/plugins/woo-conditional-payment-gateways/vendor/vg-plugin-sdk/samples/email-optin-form.php:3
- > PHP Fatal error
require_once(): Failed opening required 'WCCPG_DIST_DIR/vendor/freemius/start.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-conditional-payment-gateways/inc/freemius-init.php on line 10
- > PHP Fatal error
Uncaught Error: Class 'WPCPG_Condition' not found in wp-content/plugins/woo-conditional-payment-gateways/modules/core/backend/conditions/cart/subtotal.php:5
- > PHP Fatal error
Uncaught Error: Call to undefined function WCCPG() in wp-content/plugins/woo-conditional-payment-gateways/modules/core/index.php:22
- > PHP Warning
Use of undefined constant WCCPG_TEXTDOMAIN - assumed 'WCCPG_TEXTDOMAIN' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-conditional-payment-gateways/modules/core/index.php on line 19
- > PHP Fatal error
Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/woo-conditional-payment-gateways/vendor/vg-plugin-sdk/views/page-template.php:5
- > 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 Passed 16 tests
The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: payment gateways, woocommerce
woo-conditional-payment-gateways/conditional-payment-gateways.php 85% from 13 tests
The main file in "WooCommerce Disable Payment Methods based on cart conditions" v. 1.16.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
- Main file name: It is recommended to name the main PHP file as the plugin slug ("woo-conditional-payment-gateways.php" instead of "conditional-payment-gateways.php")
- Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "3.0")
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
Everything looks great! No dangerous files found in this plugin45,294 lines of code in 222 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 141 | 8,595 | 17,384 | 35,111 |
JavaScript | 63 | 2,572 | 733 | 9,674 |
CSS | 17 | 66 | 0 | 499 |
XML | 1 | 0 | 0 | 10 |
PHP code 50% from 2 tests
An overview of cyclomatic complexity and code structure
Please fix the following
- Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,073)
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.62 |
Average class complexity | 72.45 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 3,073.00 |
Average method complexity | 4.37 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 94.00 |
Code structure | ||
---|---|---|
Namespaces | 0 | |
Interfaces | 0 | |
Traits | 2 | |
Classes | 63 | |
▷ Abstract classes | 3 | 4.76% |
▷ Concrete classes | 60 | 95.24% |
▷ Final classes | 0 | 0.00% |
Methods | 1,409 | |
▷ Static methods | 211 | 14.98% |
▷ Public methods | 1,014 | 71.97% |
▷ Protected methods | 20 | 1.42% |
▷ Private methods | 375 | 26.61% |
Functions | 107 | |
▷ Named functions | 107 | 100.00% |
▷ Anonymous functions | 0 | 0.00% |
Constants | 154 | |
▷ Global constants | 107 | 69.48% |
▷ Class constants | 47 | 30.52% |
▷ Public constants | 47 | 100.00% |
Plugin size Passed 2 tests
Image compression Passed 2 tests
All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
vendor/freemius/assets/img/plugin-icon.png | 9.16KB | 5.26KB | ▼ 42.58% |
modules/core/assets/imgs/gateway-key.png | 49.85KB | 20.64KB | ▼ 58.59% |
vendor/freemius/assets/img/theme-icon.png | 10.97KB | 5.78KB | ▼ 47.37% |