10% languageswitcher

Code Review | Languageswitcher

WordPress plugin Languageswitcher scored10%from 54 tests.

About plugin

  • Plugin page: languageswitcher
  • Plugin version: 0.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.3
  • WordPress version: 6.3.1
  • First release: Jan 23, 2013
  • Latest release: Aug 18, 2015
  • Number of updates: 51
  • Update frequency: every 18.4 days
  • Top authors: svenhesse (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /6,081 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/languageswitcher/languageswitcher.php+31
    Use of undefined constant Languageswitcher - assumed 'Languageswitcher' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.84MB] [CPU: ▼51.61ms] Passed 4 tests

An overview of server-side resources used by Languageswitcher
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.15 ▼1.325.11 ▼34.63
Dashboard /wp-admin2.17 ▼1.146.60 ▼46.54
Posts /wp-admin/edit.php2.17 ▼1.195.76 ▼41.96
Add New Post /wp-admin/post-new.php2.17 ▼3.727.03 ▼83.30
Media Library /wp-admin/upload.php2.17 ▼1.065.70 ▼28.64
Languageswitcher /wp-admin/options-general.php?page=languageswitcher2.176.04

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Languageswitcher
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,907 ▲12113.40 ▼1.1410.18 ▲7.8039.23 ▼0.77
Dashboard /wp-admin2,205 ▲245.62 ▼0.0992.11 ▼17.2941.17 ▲2.38
Posts /wp-admin/edit.php2,110 ▲102.04 ▲0.0241.89 ▲3.5937.33 ▲1.12
Add New Post /wp-admin/post-new.php1,532 ▲623.26 ▼0.41668.83 ▼31.8753.19 ▼4.54
Media Library /wp-admin/upload.php1,407 ▲104.19 ▲0.0495.81 ▼32.5846.82 ▼4.91
Languageswitcher /wp-admin/options-general.php?page=languageswitcher8902.0125.5129.86

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/languageswitcher/languageswitcher.php+31
    Use of undefined constant Languageswitcher - assumed 'Languageswitcher' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=languageswitcher
    • > Warning in wp-content/plugins/languageswitcher/languageswitcher.php+31
    Use of undefined constant Languageswitcher - assumed 'Languageswitcher' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=languageswitcher
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=languageswitcher
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=languageswitcher
    • > Notice in wp-content/plugins/languageswitcher/languageswitcher.php+137
    Trying to access array offset on value of type bool

SRP 0% 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/languageswitcher/css/style.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant Languageswitcher - assumed 'Languageswitcher' (this will throw an Error in a future version of PHP) in wp-content/plugins/languageswitcher/languageswitcher.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/languageswitcher/languageswitcher.php:93

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid url: ""
The official readme.txt is a good inspiration

languageswitcher/languageswitcher.php 92% from 13 tests

The principal PHP file in "Languageswitcher" v. 0.2.5 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 193 characters long)

Code Analysis Passed 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
Everything looks great! No dangerous files found in this plugin386 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP257134259
JavaScript1201673
PO File1171754

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods16.67%
▷ Public methods1493.33%
▷ Protected methods00.00%
▷ Private methods16.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin