84% wpsso-user-locale

Code Review | WPSSO User Locale Selector

WordPress plugin WPSSO User Locale Selector scored84%from 54 tests.

About plugin

  • Plugin page: wpsso-user-locale
  • Plugin version: 4.0.0
  • PHP compatiblity: 7.2.34+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 6, 2017
  • Latest release: Nov 9, 2023
  • Number of updates: 1,656
  • Update frequency: every 1.5 days
  • Top authors: jsmoriss (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /16,885 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼7.83ms] Passed 4 tests

Server-side resources used by WPSSO User Locale Selector
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1043.29 ▲3.67
Dashboard /wp-admin3.41 ▲0.0647.13 ▼16.58
Posts /wp-admin/edit.php3.52 ▲0.1646.68 ▼2.72
Add New Post /wp-admin/post-new.php5.99 ▲0.1080.46 ▼13.52
Media Library /wp-admin/upload.php3.33 ▲0.1034.75 ▲1.52

Server storage [IO: ▲0.20MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

WPSSO User Locale Selector: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲4914.07 ▼0.341.83 ▲0.2042.53 ▼5.35
Dashboard /wp-admin2,195 ▲235.49 ▼0.1992.84 ▼8.1335.79 ▼6.65
Posts /wp-admin/edit.php2,106 ▲62.01 ▼0.0037.74 ▲1.0838.50 ▲3.56
Add New Post /wp-admin/post-new.php1,532 ▼423.04 ▼0.11651.90 ▲15.5953.45 ▲1.76
Media Library /wp-admin/upload.php1,406 ▲64.22 ▲0.0199.81 ▲0.9242.83 ▲2.83

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

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 fix the following
  • 12× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/wpsso-user-locale/lib/filters.php
    • > /wp-content/plugins/wpsso-user-locale/lib/register.php
    • > /wp-content/plugins/wpsso-user-locale/lib/locale.php
    • > /wp-content/plugins/wpsso-user-locale/lib/abstract/com/add-on.php
    • > /wp-content/plugins/wpsso-user-locale/gettext/gettext-lib-config.php
    • > /wp-content/plugins/wpsso-user-locale/lib/abstract/add-on.php
    • > /wp-content/plugins/wpsso-user-locale/gettext/gettext-lib-abstract-com.php
    • > /wp-content/plugins/wpsso-user-locale/wpsso-user-locale.php
    • > /wp-content/plugins/wpsso-user-locale/lib/config.php
    • > /wp-content/plugins/wpsso-user-locale/lib/filters-messages.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
10 plugin tags: region, toolbar, language, menu, user locale...

wpsso-user-locale/wpsso-user-locale.php Passed 13 tests

The principal PHP file in "WPSSO User Locale Selector" v. 4.0.0 is loaded by WordPress automatically on each request
83 characters long description:
Quick and easy locale / language / region selector for the WordPress admin toolbar.

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
Good job! No executable or dangerous file extensions detected788 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12352171644
PO File1191962
Markdown126052
HTML232030

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity10.50
▷ Minimum class complexity3.00
▷ Maximum class complexity33.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes220.00%
▷ Concrete classes880.00%
▷ Final classes00.00%
Methods40
▷ Static methods820.00%
▷ Public methods3177.50%
▷ Protected methods512.50%
▷ Private methods410.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon-256x256.png76.45KB23.75KB▼ 68.93%
images/icon-128x128.png28.14KB9.36KB▼ 66.76%