10% language-field

Code Review | Language Field

WordPress plugin Language Field scored10%from 54 tests.

About plugin

  • Plugin page: language-field
  • Plugin version: 0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.6.1
  • WordPress version: 6.3.1
  • First release: May 11, 2013
  • Latest release: Jan 28, 2021
  • Number of updates: 19
  • Update frequency: every 148.4 days
  • Top authors: theode (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

80+ active /8,243 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > User deprecated in wp-includes/functions.php+5747
    Function add_option was called with an argument that is deprecated since version 2.3.0 with no alternative available.

Server metrics [RAM: ▼0.98MB] [CPU: ▼33.86ms] Passed 4 tests

Analyzing server-side resources used by Language Field
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.78 ▼0.6815.25 ▼22.15
Dashboard /wp-admin3.07 ▼0.2427.24 ▼21.88
Posts /wp-admin/edit.php3.14 ▼0.2226.36 ▼20.68
Add New Post /wp-admin/post-new.php3.10 ▼2.7832.69 ▼70.71
Media Library /wp-admin/upload.php3.13 ▼0.1026.78 ▼6.52
Language Field /wp-admin/options-general.php?page=language-field3.0529.12

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
language_fields

Browser metrics Passed 4 tests

An overview of browser requirements for Language Field
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.72 ▲0.101.65 ▼0.0236.65 ▼1.96
Dashboard /wp-admin2,199 ▲195.57 ▼0.1085.67 ▼3.1037.90 ▼3.33
Posts /wp-admin/edit.php2,101 ▲11.97 ▼0.0639.28 ▲0.6436.74 ▲2.14
Add New Post /wp-admin/post-new.php6,219 ▲4,69126.16 ▲2.91859.66 ▲240.4759.21 ▼1.33
Media Library /wp-admin/upload.php1,404 ▲44.39 ▲0.1696.58 ▲1.8242.95 ▲1.01
Language Field /wp-admin/options-general.php?page=language-field8092.0025.8025.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • language_fields
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=language-field
    • > Notice in wp-content/plugins/language-field/lf_core_functions.php+77
    Trying to get property 'ID' of non-object
    • > GET request to /wp-admin/options-general.php?page=language-field
    • > 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-field
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/language-field/lf_core_functions.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/language-field/lf_admin_page.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/language-field/lf_core_functions.php:16

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: language, multilingual, languages, translation

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

"Language Field" version 0.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/lang/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin220 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP38363220

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected