Benchmarks
Plugin footprint 83% from 16 tests
Installer Passed 1 test
🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors
Server metrics [RAM: ▲1.79MB] [CPU: ▼0.30ms] Passed 4 tests
Analyzing server-side resources used by 51Degrees - Optimize by Device & Location
Server-side resource usage in normal parameters
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 5.28 ▲1.82 | 58.29 ▲16.52 |
Dashboard /wp-admin | 5.12 ▲1.82 | 62.48 ▲0.14 |
Posts /wp-admin/edit.php | 5.17 ▲1.82 | 58.36 ▼2.00 |
Add New Post /wp-admin/post-new.php | 7.67 ▲1.78 | 93.28 ▼11.99 |
Media Library /wp-admin/upload.php | 4.98 ▲1.76 | 48.56 ▲12.65 |
51Degrees /wp-admin/options-general.php?page=51Degrees | 4.96 | 43.57 |
Server storage [IO: ▲14.84MB] [DB: ▲0.00MB] Passed 3 tests
Filesystem and database footprint
The plugin installed successfully
Filesystem: 3,269 new files
Database: no new tables, 8 new options
New WordPress options |
---|
widget_recent-posts |
db_upgraded |
fiftyonedegrees_resource_key_pipeline |
theysaidso_admin_options |
can_compress_scripts |
widget_recent-comments |
fiftyonedegrees_resource_key |
widget_theysaidso_widget |
Browser metrics Passed 4 tests
Checking browser requirements for 51Degrees - Optimize by Device & Location
There were no issues detected in relation to browser resource usage
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 2,814 ▲43 | 13.33 ▼1.02 | 1.69 ▼0.33 | 42.39 ▼2.80 |
Dashboard /wp-admin | 2,218 ▲39 | 4.86 ▼0.95 | 107.26 ▼18.99 | 46.94 ▼1.52 |
Posts /wp-admin/edit.php | 2,098 ▲6 | 2.05 ▲0.04 | 35.41 ▼9.49 | 34.58 ▼1.41 |
Add New Post /wp-admin/post-new.php | 6,363 ▲4,835 | 27.75 ▲9.39 | 873.38 ▲249.23 | 38.00 ▼16.87 |
Media Library /wp-admin/upload.php | 1,400 ▲15 | 4.21 ▲0.01 | 96.59 ▼3.80 | 42.78 ▼0.04 |
51Degrees /wp-admin/options-general.php?page=51Degrees | 840 | 2.09 | 24.84 | 25.43 |
Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests
🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
- This plugin does not fully uninstall, leaving 6 options in the database
- theysaidso_admin_options
- can_compress_scripts
- db_upgraded
- widget_theysaidso_widget
- widget_recent-comments
- widget_recent-posts
Smoke tests 50% 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)
Even though no errors were found, this is by no means an exhaustive test
SRP 0% 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
- 3× GET requests to PHP files return non-empty strings:
- > /wp-content/plugins/51degrees-optimize-by-device-location/lib/vendor/nikic/php-parser/grammar/rebuildParsers.php
- > /wp-content/plugins/51degrees-optimize-by-device-location/lib/vendor/antecedent/patchwork/src/Console.php
- > /wp-content/plugins/51degrees-optimize-by-device-location/lib/vendor/mustache/mustache/bin/build_bootstrap.php
- 1741× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
- > PHP Fatal error
Uncaught Error: Class 'PHPUnit\\Framework\\Constraint\\Constraint' not found in wp-content/plugins/51degrees-optimize-by-device-location/lib/vendor/phpunit/phpunit/src/Framework/Constraint/Boolean/IsFalse.php:15
- > PHP Fatal error
Uncaught Error: Class 'Hamcrest\\BaseMatcher' not found in wp-content/plugins/51degrees-optimize-by-device-location/lib/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/ShortcutCombination.php:12
- > PHP Fatal error
Uncaught Error: Interface 'Google\\Auth\\FetchAuthTokenInterface' not found in wp-content/plugins/51degrees-optimize-by-device-location/lib/vendor/google/auth/src/SignBlobInterface.php:23
- > PHP Fatal error
Uncaught Error: Interface 'PhpParser\\Builder' not found in wp-content/plugins/51degrees-optimize-by-device-location/lib/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php:9
- > PHP Fatal error
Uncaught Error: Class 'PhpParser\ode\\Expr\\Cast' not found in wp-content/plugins/51degrees-optimize-by-device-location/lib/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php:7
- > PHP Fatal error
Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/51degrees-optimize-by-device-location/lib/vendor/google/apiclient-services/src/GoogleAnalyticsAdmin/GoogleAnalyticsAdminV1alphaAcknowledgeUserDataCollectionRequest.php:20
- > PHP Fatal error
Uncaught Error: Class 'PhpParser\ode\\Expr\\Cast' not found in wp-content/plugins/51degrees-optimize-by-device-location/lib/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php:7
- > PHP Fatal error
Uncaught Error: Class 'PhpParser\ode\\Expr' not found in wp-content/plugins/51degrees-optimize-by-device-location/lib/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php:7
- > PHP Fatal error
Uncaught Error: Class 'PHPUnit\\Framework\\MockObject\\Rule\\InvocationOrder' not found in wp-content/plugins/51degrees-optimize-by-device-location/lib/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php:19
- > PHP Fatal error
Uncaught Error: Class 'Monolog\\Handler\\Handler' not found in wp-content/plugins/51degrees-optimize-by-device-location/lib/vendor/monolog/monolog/src/Monolog/Handler/NoopHandler.php:23
- > PHP Fatal error
User-side errors Passed 1 test
🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test
Optimizations
Plugin configuration 90% from 29 tests
readme.txt 94% from 16 tests
Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
- Tags: There are too many tags (25 tag instead of maximum 10)
51degrees-optimize-by-device-location/fiftyonedegrees.php 85% from 13 tests
Analyzing the main PHP file in "51Degrees - Optimize by Device & Location" version 4.4.1
You should first fix the following items:
- Main file name: Please rename the main PHP file in this plugin to the plugin slug ("51degrees-optimize-by-device-location.php" instead of "fiftyonedegrees.php")
- Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
Code Analysis 97% from 3 tests
File types Passed 1 test
🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin267,974 lines of code in 3,079 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 2,577 | 35,276 | 107,363 | 177,541 |
JavaScript | 161 | 4,040 | 4,215 | 38,299 |
JSON | 89 | 17 | 0 | 29,212 |
Markdown | 132 | 6,311 | 0 | 15,771 |
yacc | 3 | 326 | 12 | 2,013 |
YAML | 37 | 260 | 87 | 1,326 |
reStructuredText | 38 | 1,046 | 1,324 | 1,245 |
XSD | 3 | 0 | 0 | 962 |
HTML | 1 | 2 | 0 | 454 |
XML | 24 | 12 | 2 | 395 |
Mustache | 1 | 50 | 0 | 392 |
CSS | 6 | 36 | 7 | 153 |
Python | 2 | 92 | 180 | 114 |
TypeScript | 1 | 14 | 1 | 83 |
make | 1 | 4 | 0 | 9 |
Bourne Shell | 1 | 2 | 0 | 3 |
SVG | 2 | 0 | 0 | 2 |
PHP code 50% from 2 tests
This is a very shot review of cyclomatic complexity and code structure
Please fix the following
- Cyclomatic complexity of methods has to be reduced to less than 100 (currently 145)
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.34 |
Average class complexity | 7.69 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 662.00 |
Average method complexity | 2.26 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 145.00 |
Code structure | ||
---|---|---|
Namespaces | 269 | |
Interfaces | 168 | |
Traits | 57 | |
Classes | 2,415 | |
▷ Abstract classes | 297 | 12.30% |
▷ Concrete classes | 2,118 | 87.70% |
▷ Final classes | 598 | 28.23% |
Methods | 13,859 | |
▷ Static methods | 1,825 | 13.17% |
▷ Public methods | 11,499 | 82.97% |
▷ Protected methods | 1,119 | 8.07% |
▷ Private methods | 1,241 | 8.95% |
Functions | 2,069 | |
▷ Named functions | 594 | 28.71% |
▷ Anonymous functions | 1,475 | 71.29% |
Constants | 1,352 | |
▷ Global constants | 30 | 2.22% |
▷ Class constants | 1,322 | 97.78% |
▷ Public constants | 1,225 | 92.66% |
Plugin size Passed 2 tests
Image compression Passed 2 tests
Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.38MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
assets/images/screenshot-1.png | 65.88KB | 20.30KB | ▼ 69.18% |
assets/images/screenshot-5.png | 53.62KB | 16.68KB | ▼ 68.90% |
assets/images/icon-256x256.png | 33.75KB | 12.55KB | ▼ 62.80% |
assets/images/screenshot-2.png | 85.84KB | 29.74KB | ▼ 65.36% |
assets/images/logo.png | 8.80KB | 4.02KB | ▼ 54.29% |