73% wp-multilang

Code Review | WP Multilang

WordPress plugin WP Multilang scored73%from 54 tests.

About plugin

  • Plugin page: wp-multilang
  • Plugin version: 2.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.3
  • WordPress version: 6.3.1
  • First release: May 24, 2017
  • Latest release: Oct 28, 2019
  • Number of updates: 142
  • Update frequency: every 6.3 days
  • Top authors: VaLeXaR (100%)

Code review

54 tests

User reviews

88 reviews

Install metrics

10,000+ active /129,697 total downloads

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: ▲1.43MB] [CPU: ▲2.30ms] Passed 4 tests

An overview of server-side resources used by WP Multilang
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.57 ▲1.1049.47 ▲11.39
Dashboard /wp-admin4.88 ▲1.5454.31 ▼7.12
Posts /wp-admin/edit.php4.92 ▲1.5653.43 ▲7.32
Add New Post /wp-admin/post-new.php7.55 ▲1.6697.94 ▼2.40
Media Library /wp-admin/upload.php4.75 ▲1.5248.31 ▲15.99
WP Multilang /wp-admin/options-general.php?page=wpm-settings4.7841.48

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 452 new files
Database: no new tables, 17 new options
New WordPress options
widget_theysaidso_widget
widget_wpm_language_switcher
widget_recent-comments
wpm_site_language
widget_recent-posts
wpm_db_version
db_upgraded
wpm_uninstall_translations
can_compress_scripts
wpm_use_prefix
...

Browser metrics Passed 4 tests

An overview of browser requirements for WP Multilang
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲4113.27 ▼0.981.51 ▼0.8143.44 ▼4.40
Dashboard /wp-admin2,209 ▲174.85 ▼0.0898.82 ▼16.6739.15 ▼3.28
Posts /wp-admin/edit.php2,108 ▲222.12 ▲0.0735.77 ▼0.0432.12 ▲0.15
Add New Post /wp-admin/post-new.php6,240 ▲4,71818.87 ▼4.34921.12 ▲279.0955.78 ▼4.26
Media Library /wp-admin/upload.php1,394 ▲34.23 ▼0.0698.52 ▼3.4342.89 ▼1.80
WP Multilang /wp-admin/options-general.php?page=wpm-settings9752.0826.1431.17

Uninstaller [IO: ▲0.00MB] [DB: ▲0.05MB] 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
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_wpm_language_switcher
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-multilang/templates/admin-language-switcher.php
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wp-multilang/templates/language-switcher-list.php:2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-multilang/templates/admin-language-switcher.php on line 3
    • > PHP Notice
      Undefined variable: lang in wp-content/plugins/wp-multilang/templates/admin-language-switcher-customizer.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wp-multilang/templates/language-switcher-dropdown.php:2
    • > PHP Notice
      Undefined variable: languages in wp-content/plugins/wp-multilang/templates/admin-language-switcher.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wp-multilang/templates/language-switcher-select.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-multilang/templates/admin-language-switcher-customizer.php:7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-multilang/templates/admin-language-switcher-customizer.php on line 4
    • > PHP Notice
      Undefined variable: languages in wp-content/plugins/wp-multilang/templates/admin-language-switcher-customizer.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-multilang/templates/admin-language-switcher-customizer.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=wpm-settings
    • > Network (severe)
    https://www.paypalobjects.com/en_UA/i/scr/pixel.gif - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Requires php: Invalid plugin version format
You can look at the official readme.txt

wp-multilang/wp-multilang.php Passed 13 tests

The entry point to "WP Multilang" version 2.4.1 is a PHP file that has certain tags in its header comment area
33 characters long description:
Multilingual plugin for WordPress

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 detected9,837 lines of code in 145 files:
LanguageFilesBlank linesComment linesLines of code
PHP892,3064,1267,998
JSON2000767
Sass15782345
JavaScript146018269
PO File1103170243
CSS6293215

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity18.50
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity3.57
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes62
▷ Abstract classes58.06%
▷ Concrete classes5791.94%
▷ Final classes11.75%
Methods427
▷ Static methods8118.97%
▷ Public methods37688.06%
▷ Protected methods225.15%
▷ Private methods296.79%
Functions89
▷ Named functions8595.51%
▷ Anonymous functions44.49%
Constants9
▷ Global constants9100.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
298 compressed PNG files occupy 0.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
flags/ko.png0.25KB0.26KB0.00%
flags/bt.png0.29KB0.30KB0.00%
flags/pt-br.png0.33KB0.39KB0.00%
flags/ne.png0.18KB0.29KB0.00%
flags/dk.png0.17KB0.22KB0.00%