72% xili-dictionary

Code Review | xili-dictionary

WordPress plugin xili-dictionary scored72%from 54 tests.

About plugin

  • Plugin page: xili-dictionary
  • Plugin version: 2.12.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.1-4.9
  • WordPress version: 6.3.1
  • First release: Apr 28, 2009
  • Latest release: Apr 9, 2021
  • Number of updates: 176
  • Update frequency: every 24.8 days
  • Top authors: michelwppi (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /37,629 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
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.75ms] Passed 4 tests

Analyzing server-side resources used by xili-dictionary
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1547.09 ▲7.67
Dashboard /wp-admin3.40 ▲0.0642.08 ▼19.41
Posts /wp-admin/edit.php3.46 ▲0.1046.25 ▲0.61
Add New Post /wp-admin/post-new.php5.66 ▼0.2374.55 ▼15.86
Media Library /wp-admin/upload.php3.41 ▲0.1842.23 ▲9.36
Origins /wp-admin/edit-tags.php?taxonomy=origin&post_type=xdmsg3.3941.15
Writers /wp-admin/edit-tags.php?taxonomy=writer&post_type=xdmsg3.3941.16
Tools, Files po mo /wp-admin/edit.php?post_type=xdmsg&page=dictionary_page3.3939.55
New Msgid /wp-admin/post-new.php?post_type=xdmsg3.4559.41
Msg list /wp-admin/edit.php?post_type=xdmsg3.4539.86

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 40 new files
Database: no new tables, 7 new options
New WordPress options
xili_dictionary_settings
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for xili-dictionary
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,885 ▲12413.20 ▼1.534.33 ▲2.7144.95 ▲5.71
Dashboard /wp-admin2,276 ▲965.70 ▲0.0688.62 ▲2.1068.45 ▲25.50
Posts /wp-admin/edit.php2,193 ▲932.31 ▲0.3044.02 ▲5.9136.33 ▼0.05
Add New Post /wp-admin/post-new.php1,729 ▲20122.26 ▼0.73698.11 ▲27.8460.28 ▲5.85
Media Library /wp-admin/upload.php1,487 ▲904.25 ▲0.05102.46 ▼1.9276.90 ▲28.64
Origins /wp-admin/edit-tags.php?taxonomy=origin&post_type=xdmsg1,4021.9441.6434.59
Writers /wp-admin/edit-tags.php?taxonomy=writer&post_type=xdmsg1,4301.9935.3132.21
Tools, Files po mo /wp-admin/edit.php?post_type=xdmsg&page=dictionary_page1,9232.9564.1139.02
New Msgid /wp-admin/post-new.php?post_type=xdmsg2,1533.2469.61105.72
Msg list /wp-admin/edit.php?post_type=xdmsg1,3322.2541.4533.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • xili_dictionary_settings
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=xdmsg
    • > 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/edit.php?post_type=xdmsg&page=dictionary_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/edit.php?post_type=xdmsg&page=dictionary_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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/xili-dictionary/xili-dictionary.php
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/xili-dictionary/includes/pomo/po.php' (include_path='.:/usr/share/php') in wp-content/plugins/xili-dictionary/includes/pot-ext-meta.php on line 11
    • > PHP Warning
      require_once(wp-content/plugins/xili-dictionary/includes/pomo/po.php): failed to open stream: No such file or directory in wp-content/plugins/xili-dictionary/includes/pot-ext-meta.php on line 11
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/xili-dictionary/includes/extract/extract-wp.php on line 2
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/xili-dictionary/includes/extract/extract-wp.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHWPINC/pomo/entry.php' (include_path='.:/usr/share/php') in wp-content/plugins/xili-dictionary/includes/extract/extract-wp.php on line 2
    • > PHP Warning
      require_once(ABSPATHWPINC/pomo/entry.php): failed to open stream: No such file or directory in wp-content/plugins/xili-dictionary/includes/extract/extract-wp.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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 to be fixed:
  • Tags: There are too many tags (24 tag instead of maximum 10)
You can take inspiration from this readme.txt

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

The principal PHP file in "xili-dictionary" v. 2.12.5 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 220 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin16,021 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP51,5191,1437,740
JavaScript21,9316,9166,264
PO File16457631,564
CSS31450453

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 1,454)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 153)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity382.50
▷ Minimum class complexity8.00
▷ Maximum class complexity1,454.00
Average method complexity8.06
▷ Minimum method complexity1.00
▷ Maximum method complexity153.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods216
▷ Static methods94.17%
▷ Public methods21097.22%
▷ Protected methods00.00%
▷ Private methods62.78%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
26 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
xili-css/flags/en_us.png0.59KB0.65KB0.00%
images/sort_desc_disabled.png0.14KB0.25KB0.00%
xili-css/flags/de_de.png0.53KB0.72KB0.00%
xili-css/flags/ja.png0.41KB0.46KB0.00%
images/back_enabled_hover.png0.44KB0.60KB0.00%