Benchmarks
Plugin footprint 83% from 16 tests
Installer Passed 1 test
🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors
Server metrics [RAM: ▲0.23MB] [CPU: ▼8.35ms] Passed 4 tests
An overview of server-side resources used by Locale Auto Switch
This plugin has minimal impact on server resources
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 3.73 ▲0.26 | 34.91 ▼5.09 |
Dashboard /wp-admin | 3.54 ▲0.20 | 46.19 ▼14.76 |
Posts /wp-admin/edit.php | 3.59 ▲0.24 | 46.99 ▼1.50 |
Add New Post /wp-admin/post-new.php | 6.13 ▲0.24 | 79.59 ▼12.04 |
Media Library /wp-admin/upload.php | 3.46 ▲0.24 | 33.82 ▼0.18 |
Locale Auto Switch /wp-admin/options-general.php?page=LocaleAutoSwitch | 3.58 | 32.70 |
Server storage [IO: ▲0.04MB] [DB: ▲0.09MB] Passed 3 tests
A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 8 new options
New WordPress options |
---|
widget_recent-comments |
widget_localeautoswitchwidgetitem |
can_compress_scripts |
theysaidso_admin_options |
widget_theysaidso_widget |
db_upgraded |
locale_auto_switch |
widget_recent-posts |
Browser metrics Passed 4 tests
An overview of browser requirements for Locale Auto Switch
There were no issues detected in relation to browser resource usage
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 2,793 ▲47 | 14.35 ▼0.30 | 1.61 ▲0.03 | 37.75 ▲0.01 |
Dashboard /wp-admin | 2,196 ▲19 | 5.63 ▼0.04 | 81.23 ▼5.53 | 40.17 ▲1.73 |
Posts /wp-admin/edit.php | 2,104 ▲4 | 2.02 ▼0.01 | 38.92 ▲2.76 | 33.99 ▼0.77 |
Add New Post /wp-admin/post-new.php | 6,195 ▲4,666 | 19.05 ▼3.88 | 910.78 ▲286.06 | 76.86 ▲24.93 |
Media Library /wp-admin/upload.php | 1,407 ▲7 | 4.21 ▼0.09 | 94.57 ▼0.01 | 40.41 ▼1.44 |
Locale Auto Switch /wp-admin/options-general.php?page=LocaleAutoSwitch | 5,399 | 1.20 | 26.68 | 119.99 |
Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 75% from 4 tests
🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
- This plugin did not uninstall successfully, leaving 7 options in the database
- widget_recent-posts
- widget_recent-comments
- widget_theysaidso_widget
- db_upgraded
- widget_localeautoswitchwidgetitem
- theysaidso_admin_options
- can_compress_scripts
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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
- 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
- > PHP Fatal error
Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/locale-auto-switch/lib/class-localeautoswitchadmin.php:62
- > PHP Fatal error
Uncaught Error: Call to undefined function add_action() in wp-content/plugins/locale-auto-switch/lib/class-localeautoswitchregist.php:37
- > PHP Fatal error
Uncaught Error: Call to undefined function get_available_languages() in wp-content/plugins/locale-auto-switch/lib/class-localeautoswitch.php:53
- > PHP Fatal error
Uncaught Error: Call to undefined function add_action() in wp-content/plugins/locale-auto-switch/lib/class-localeautoswitchwidgetitem.php:23
- > PHP Fatal error
Uncaught Error: Call to undefined function add_action() in wp-content/plugins/locale-auto-switch/lib/class-localeautoswitchregist.php:37
- > PHP Fatal error
User-side errors Passed 1 test
🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test
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
3 plugin tags: locale, languages, browser
locale-auto-switch/localeautoswitch.php 92% from 13 tests
The primary PHP file in "Locale Auto Switch" version 1.16 is used by WordPress to initiate all plugin functionality
The following require your attention:
- Main file name: Please rename the main PHP file in this plugin to the plugin slug ("locale-auto-switch.php" instead of "localeautoswitch.php")
Code Analysis Passed 3 tests
File types Passed 1 test
🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin617 lines of code in 10 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 7 | 83 | 253 | 576 |
JavaScript | 2 | 4 | 0 | 21 |
JSON | 1 | 0 | 0 | 20 |
PHP code Passed 2 tests
Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.40 |
Average class complexity | 22.50 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 73.00 |
Average method complexity | 6.06 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 35.00 |
Code structure | ||
---|---|---|
Namespaces | 0 | |
Interfaces | 0 | |
Traits | 0 | |
Classes | 4 | |
▷ Abstract classes | 0 | 0.00% |
▷ Concrete classes | 4 | 100.00% |
▷ Final classes | 0 | 0.00% |
Methods | 17 | |
▷ Static methods | 0 | 0.00% |
▷ Public methods | 12 | 70.59% |
▷ Protected methods | 0 | 0.00% |
▷ Private methods | 5 | 29.41% |
Functions | 1 | |
▷ Named functions | 0 | 0.00% |
▷ Anonymous functions | 1 | 100.00% |
Constants | 0 | |
▷ Global constants | 0 | 0.00% |
▷ Class constants | 0 | 0.00% |
▷ Public constants | 0 | 0.00% |
Plugin size Passed 2 tests
Image compression Passed 2 tests
Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected