Benchmarks
Plugin footprint 82% from 16 tests
Installer Passed 1 test
🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully
Server metrics [RAM: ▲0.58MB] [CPU: ▼4.34ms] 75% from 4 tests
An overview of server-side resources used by AffiniPay WordPress
It is recommended to improve the following
- CPU: Try to keep total CPU usage under 500.00ms (currently 652.17ms on /wp-admin/options-general.php?page=affinipay-payment-gateway/lib/class-affinipay-settings.php)
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 4.07 ▲0.61 | 39.94 ▼2.62 |
Dashboard /wp-admin | 3.92 ▲0.61 | 49.18 ▼13.39 |
Posts /wp-admin/edit.php | 3.97 ▲0.61 | 54.64 ▲7.31 |
Add New Post /wp-admin/post-new.php | 6.44 ▲0.55 | 85.58 ▼7.47 |
Media Library /wp-admin/upload.php | 3.78 ▲0.55 | 41.02 ▲6.12 |
Affinipay Payments /wp-admin/options-general.php?page=affinipay-payment-gateway/lib/class-affinipay-settings.php | 3.78 | 652.17 |
Server storage [IO: ▲9.30MB] [DB: ▲0.00MB] Passed 3 tests
Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 1,766 new files
Database: no new tables, 6 new options
New WordPress options |
---|
widget_recent-comments |
widget_recent-posts |
theysaidso_admin_options |
widget_theysaidso_widget |
can_compress_scripts |
db_upgraded |
Browser metrics Passed 4 tests
A check of browser resources used by AffiniPay WordPress
There were no issues detected in relation to browser resource usage
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 2,812 ▲77 | 13.70 ▼0.65 | 1.53 ▼0.45 | 38.38 ▼6.01 |
Dashboard /wp-admin | 2,210 ▲22 | 5.80 ▲0.89 | 102.12 ▼6.04 | 39.73 ▲2.09 |
Posts /wp-admin/edit.php | 2,102 ▲13 | 2.04 ▲0.04 | 39.87 ▲5.32 | 35.35 ▲1.04 |
Add New Post /wp-admin/post-new.php | 1,525 ▼11 | 23.25 ▲0.14 | 673.63 ▲72.98 | 45.40 ▼5.40 |
Media Library /wp-admin/upload.php | 1,393 ▲2 | 4.24 ▲0.12 | 93.25 ▼5.71 | 42.41 ▼3.90 |
Affinipay Payments /wp-admin/options-general.php?page=affinipay-payment-gateway/lib/class-affinipay-settings.php | 833 | 2.19 | 23.96 | 28.25 |
Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests
🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
- Zombie WordPress options detected upon uninstall: 6 options
- widget_recent-comments
- db_upgraded
- widget_recent-posts
- can_compress_scripts
- theysaidso_admin_options
- widget_theysaidso_widget
Smoke tests 50% 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 0% 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
- 8× PHP files output text when accessed directly:
- > /wp-content/plugins/affinipay-payment-gateway/public/loader.php
- > /wp-content/plugins/affinipay-payment-gateway/views/admin-accounts-response.php
- > /wp-content/plugins/affinipay-payment-gateway/affinipay-wordpress.php
- > /wp-content/plugins/affinipay-payment-gateway/vendor/phpunit/phpunit/tests/TextUI/_files/phpt_external.php
- > /wp-content/plugins/affinipay-payment-gateway/views/admin-settings-default.php
- > /wp-content/plugins/affinipay-payment-gateway/build/loader.php
- > /wp-content/plugins/affinipay-payment-gateway/views/admin-settings-saved.php
- > /wp-content/plugins/affinipay-payment-gateway/affinipay-wp.php
- 819× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
- > PHP Fatal error
Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/affinipay-payment-gateway/vendor/phpunit/phpunit/src/Framework/WarningTestCase.php:15
- > PHP Fatal error
Uncaught Error: Class 'PHPUnit\\Framework\\Constraint\\Constraint' not found in wp-content/plugins/affinipay-payment-gateway/vendor/phpunit/phpunit/src/Framework/Constraint/LessThan.php:18
- > PHP Fatal error
Uncaught Error: Interface 'Prophecy\\Prediction\\PredictionInterface' not found in wp-content/plugins/affinipay-payment-gateway/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php:25
- > PHP Fatal error
Uncaught Error: Class 'SebastianBergmann\\CodeCoverage\\TestCase' not found in wp-content/plugins/affinipay-payment-gateway/vendor/phpunit/php-code-coverage/tests/tests/CodeCoverageTest.php:19
- > PHP Fatal error
Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/affinipay-payment-gateway/vendor/phpunit/phpunit/tests/Util/TestTest.php:19
- > PHP Fatal error
Uncaught Error: Class 'ChargeIO_Transaction' not found in wp-content/plugins/affinipay-payment-gateway/vendor/affinipay/chargeio-php/lib/ChargeIO/Charge.php:3
- > PHP Fatal error
Uncaught Error: Class 'Prophecy\\Exception\\Doubler\\DoubleException' not found in wp-content/plugins/affinipay-payment-gateway/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassNotFoundException.php:14
- > PHP Fatal error
Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/affinipay-payment-gateway/vendor/phpdocumentor/reflection-common/tests/unit/FqsenTest.php:18
- > PHP Fatal error
Uncaught Error: Class 'PhpSpec\\ObjectBehavior' not found in wp-content/plugins/affinipay-payment-gateway/vendor/phpspec/prophecy/spec/Prophecy/Argument/ArgumentsWildcardSpec.php:8
- > PHP Fatal error
Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/affinipay-payment-gateway/vendor/phar-io/manifest/tests/values/LibraryTest.php:19
- > PHP Fatal error
User-side errors Passed 1 test
🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected
Optimizations
Plugin configuration 96% from 29 tests
readme.txt Passed 16 tests
Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
2 plugin tags: affinipay, payments
affinipay-payment-gateway/affinipay-wordpress.php 92% from 13 tests
The main file in "AffiniPay WordPress" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
- Main file name: Name the main plugin file the same as the plugin slug ("affinipay-payment-gateway.php" instead of "affinipay-wordpress.php")
Code Analysis 97% from 3 tests
File types Passed 1 test
🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected130,208 lines of code in 1,587 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 1,298 | 23,084 | 63,615 | 100,313 |
JSON | 41 | 15 | 0 | 14,966 |
CSS | 11 | 778 | 251 | 3,660 |
Markdown | 72 | 1,676 | 0 | 3,171 |
XML | 77 | 94 | 17 | 2,440 |
HTML | 11 | 116 | 36 | 1,815 |
JavaScript | 27 | 209 | 534 | 1,473 |
Ant | 17 | 125 | 0 | 734 |
YAML | 25 | 141 | 1 | 636 |
SVG | 1 | 0 | 0 | 288 |
XSD | 1 | 0 | 0 | 267 |
Groovy | 1 | 22 | 24 | 163 |
TypeScript | 2 | 10 | 3 | 145 |
Bourne Shell | 2 | 21 | 11 | 134 |
INI | 1 | 0 | 0 | 3 |
PHP code 50% from 2 tests
This plugin's cyclomatic complexity and code structure detailed below
Please fix the following
- Method cyclomatic complexity has to be reduced to less than 100 (currently 127)
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.25 |
Average class complexity | 4.56 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 216.00 |
Average method complexity | 1.85 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 127.00 |
Code structure | ||
---|---|---|
Namespaces | 112 | |
Interfaces | 86 | |
Traits | 4 | |
Classes | 1,246 | |
▷ Abstract classes | 35 | 2.81% |
▷ Concrete classes | 1,211 | 97.19% |
▷ Final classes | 51 | 4.21% |
Methods | 5,559 | |
▷ Static methods | 504 | 9.07% |
▷ Public methods | 4,885 | 87.88% |
▷ Protected methods | 378 | 6.80% |
▷ Private methods | 296 | 5.32% |
Functions | 238 | |
▷ Named functions | 152 | 63.87% |
▷ Anonymous functions | 86 | 36.13% |
Constants | 117 | |
▷ Global constants | 19 | 16.24% |
▷ Class constants | 98 | 83.76% |
▷ Public constants | 98 | 100.00% |
Plugin size Passed 2 tests
Image compression Passed 2 tests
Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
vendor/myclabs/deep-copy/doc/clone.png | 12.09KB | 5.48KB | ▼ 54.70% |
vendor/myclabs/deep-copy/doc/deep-copy.png | 10.64KB | 5.23KB | ▼ 50.84% |
vendor/myclabs/deep-copy/doc/graph.png | 6.29KB | 3.03KB | ▼ 51.86% |
vendor/myclabs/deep-copy/doc/deep-clone.png | 13.68KB | 6.54KB | ▼ 52.22% |