62% xili-language

Code Review | xili-language

WordPress plugin xili-language scored 62% from 54 tests.

About plugin

  • Plugin page: xili-language
  • Plugin version: 2.21.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.5-4.9
  • WordPress version: 6.3.1
  • First release: Jan 25, 2009
  • Latest release: Aug 5, 2020
  • Number of updates: 499
  • Update frequency: every 8.4 days
  • Top authors: michelwppi (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active / 273,414 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.93MB] [CPU: ▼30.38ms] Passed 4 tests

An overview of server-side resources used by xili-language
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.04 ▲1.5874.90 ▲29.07
Dashboard /wp-admin6.23 ▲2.9333.71 ▼41.32
Posts /wp-admin/edit.php6.23 ▲2.8830.43 ▼26.33
Add New Post /wp-admin/post-new.php6.23 ▲0.3529.97 ▼64.84
Media Library /wp-admin/upload.php6.23 ▲3.0145.64 ▲10.98
Languages ©xili /wp-admin/options-general.php?page=language_page6.2432.45
About xili-language /wp-admin/index.php?page=xl-about6.2428.18

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 46 new files
Database: no new tables, 10 new options
New WordPress options
widget_xili-recent-comments
widget_xili-recent-posts
xili_language_settings
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_xili_language_widgets
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for xili-language
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲11413.32 ▲0.072.14 ▲0.0640.43 ▼4.57
Dashboard /wp-admin2,288 ▲824.98 ▲0.12119.28 ▲3.4384.56 ▲42.67
Posts /wp-admin/edit.php2,290 ▲1992.34 ▲0.3543.76 ▲6.2835.34 ▲2.10
Add New Post /wp-admin/post-new.php1,847 ▲31320.12 ▼2.89806.39 ▲10.2356.67 ▼3.97
Media Library /wp-admin/upload.php1,493 ▲1084.39 ▲0.22109.48 ▲6.1546.58 ▲3.23
Languages ©xili /wp-admin/options-general.php?page=language_page2,3062.3249.88149.61
About xili-language /wp-admin/index.php?page=xl-about9331.8632.6538.01

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/xili-language/xili-includes/locales.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; GP_Locale has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • widget_xili_language_widgets
    • widget_recent-posts
    • theysaidso_admin_options
    • xili_language_settings
    • widget_theysaidso_widget
    • widget_xili-recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_xili-recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/index.php?page=xl-about
    • > Deprecated in wp-content/plugins/xili-language/xili-includes/locales.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; GP_Locale has a deprecated constructor
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/index.php?page=xl-about
    • > Deprecated in wp-content/plugins/xili-language/xili-includes/locales.php+56
    Methods with the same name as their class will not be constructors in a future version of PHP; GP_Locales has a deprecated constructor
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/index.php?page=xl-about
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.
    • > GET request to /wp-admin/options-general.php?page=language_page
    • > 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=language_page
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/xili-language/uninstall.php
    • > /wp-content/plugins/xili-language/xili-includes/pll_functions.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/xili-language/xili-includes/xili-language-widgets.php:68
    • > PHP Fatal error
      Uncaught Error: Class 'xili_language' not found in wp-content/plugins/xili-language/xili-includes/xl-class-admin.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/xili-language/xili-language.php:6014

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% 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
These attributes need your attention:
  • Screenshots: Screenshot #5 (The plugin settings UI - third tab: Settings for navigation menus and experts.) image required
You can look at the official readme.txt

xili-language/xili-language.php 92% from 13 tests

The main PHP script in "xili-language" version 2.21.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 481 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin16,056 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP102,9113,02013,385
PO File37919392,418
JavaScript66326226
CSS2161927

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,018)
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity148.00
▷ Minimum class complexity6.00
▷ Maximum class complexity1,018.00
Average method complexity6.49
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods402
▷ Static methods61.49%
▷ Public methods402100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions78
▷ Named functions78100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants14100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
19 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/xili-xl-bbp-addon-logo-32.png2.65KB1.64KB▼ 37.95%
xili-css/flags/fr_ca.png0.61KB0.68KB0.00%
xili-css/flags/fr_fr.png0.53KB0.63KB0.00%
xili-css/flags/km.png0.54KB0.72KB0.00%
xili-css/flags/ar_xx.png0.40KB0.32KB▼ 20.87%