84% wcm-user-language-switcher

Code Review | WCM User Language Switcher

WordPress plugin WCM User Language Switcher scored84%from 54 tests.

About plugin

  • Plugin page: wcm-user-language...
  • Plugin version: 1.8.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.1-4.1
  • WordPress version: 6.3.1
  • First release: Jan 18, 2013
  • Latest release: Jul 12, 2020
  • Number of updates: 9
  • Update frequency: every 304.1 days
  • Top authors: stephenh1988 (66.67%)stephenharris (33.33%)jenkinspress (22.22%)

Code review

54 tests

User reviews

8 reviews

Install metrics

100+ active /12,462 total downloads

Benchmarks

Plugin footprint 83% 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 gracefully, with no errors

Server metrics [RAM: ▲0.42MB] [CPU: ▼5.05ms] Passed 4 tests

An overview of server-side resources used by WCM User Language Switcher
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4339.00 ▼3.49
Dashboard /wp-admin3.79 ▲0.4147.05 ▼17.73
Posts /wp-admin/edit.php3.82 ▲0.4346.94 ▼0.17
Add New Post /wp-admin/post-new.php6.35 ▲0.43113.79 ▲1.21
Media Library /wp-admin/upload.php3.69 ▲0.4337.78 ▲5.87

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: no files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

WCM User Language Switcher: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲5913.31 ▼0.991.61 ▼0.5140.53 ▼4.82
Dashboard /wp-admin2,224 ▲365.88 ▲0.07108.10 ▼3.7341.77 ▼1.00
Posts /wp-admin/edit.php2,107 ▲182.06 ▲0.0439.23 ▼2.2234.93 ▼2.92
Add New Post /wp-admin/post-new.php1,541 ▲1323.00 ▲4.86641.73 ▼15.5950.81 ▼8.74
Media Library /wp-admin/upload.php1,403 ▲124.18 ▲0.0092.29 ▼8.7640.42 ▼5.10

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wcm-user-language-switcher/wcm_lang_switch.class.php:36

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: switcher, localisation, language

wcm-user-language-switcher/wcm_lang_switch.class.php 92% from 13 tests

The main file in "WCM User Language Switcher" v. 1.8.1 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: Please rename the main PHP file in this plugin to the plugin slug ("wcm-user-language-switcher.php" instead of "wcm_lang_switch.class.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected4,633 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JSON4004,218
PHP244142284
Markdown1700114
YAML10017

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity23.00
▷ Minimum class complexity11.00
▷ Maximum class complexity35.00
Average method complexity4.38
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods17.69%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png51.29KB17.25KB▼ 66.36%
assets/logo.png2.81KB3.05KB0.00%
assets/banner-1544x500.png31.07KB35.02KB0.00%
screenshot-1.png7.82KB8.12KB0.00%
assets/banner-772x250.png13.92KB15.23KB0.00%