84% ip-language-switcher

Code Review | IP Language Switcher

WordPress plugin IP Language Switcher scored84%from 54 tests.

About plugin

  • Plugin page: ip-language-switcher
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.7
  • WordPress version: 6.3.1
  • First release: Apr 19, 2017
  • Latest release: May 22, 2017
  • Number of updates: 4
  • Update frequency: every 8.3 days
  • Top authors: henryme (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,051 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.94ms] 75% from 4 tests

Server-side resources used by IP Language Switcher
It is recommended to improve the following
  • CPU: You should keep total CPU usage under 500.00ms (currently 519.45ms on /wp-admin/options-general.php?page=ip-language-switcher)
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.94 ▲1.17
Dashboard /wp-admin3.37 ▲0.0749.88 ▲0.78
Posts /wp-admin/edit.php3.43 ▲0.0748.32 ▼3.97
Add New Post /wp-admin/post-new.php5.98 ▲0.0989.82 ▼10.84
Media Library /wp-admin/upload.php3.30 ▲0.0738.66 ▼1.73
IP Language /wp-admin/options-general.php?page=ip-language-switcher3.73519.45

Server storage [IO: ▲0.23MB] [DB: ▲0.05MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for IP Language Switcher
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.35 ▼0.031.61 ▼0.1340.62 ▼5.29
Dashboard /wp-admin2,200 ▲205.57 ▼0.0886.76 ▼8.6539.80 ▲1.29
Posts /wp-admin/edit.php2,111 ▲112.01 ▲0.0533.79 ▼6.5932.14 ▼6.71
Add New Post /wp-admin/post-new.php1,535 ▲923.09 ▲0.09680.09 ▼15.9552.59 ▲0.38
Media Library /wp-admin/upload.php1,408 ▲114.25 ▲0.15102.72 ▼1.2144.49 ▼3.56
IP Language /wp-admin/options-general.php?page=ip-language-switcher2,2582.0024.22111.49

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

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)
Good news, no errors were detected

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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ip-language-switcher/ip-language-switcher.php:195

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed: The official readme.txt is a good inspiration

ip-language-switcher/ip-language-switcher.php Passed 13 tests

The main PHP file in "IP Language Switcher" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
46 characters long description:
Language is no longer a barrier for developer.

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
Good job! No executable or dangerous file extensions detected338 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1322198
CSS10090
PO File191030
JavaScript10020

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity29.00
▷ Minimum class complexity29.00
▷ Maximum class complexity29.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods18.33%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
1 PNG file occupies 0.21MB with 0.15MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot.png215.60KB57.80KB▼ 73.19%