84% preferred-languages

Code Review | Preferred Languages

WordPress plugin Preferred Languages scored84%from 54 tests.

About plugin

  • Plugin page: preferred-languages
  • Plugin version: 2.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.4
  • WordPress version: 6.3.1
  • First release: Oct 2, 2017
  • Latest release: Dec 1, 2023
  • Number of updates: 40
  • Update frequency: every 56.3 days
  • Top authors: swissspidy (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

2,000+ active /74,160 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼0.25ms] Passed 4 tests

A check of server-side resources used by Preferred Languages
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1543.75 ▼0.98
Dashboard /wp-admin3.44 ▲0.1050.24 ▼11.59
Posts /wp-admin/edit.php3.56 ▲0.2054.49 ▲6.67
Add New Post /wp-admin/post-new.php6.03 ▲0.14100.40 ▲13.70
Media Library /wp-admin/upload.php3.36 ▲0.1440.24 ▲4.90

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Preferred Languages: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲1814.73 ▼0.011.77 ▼0.3444.17 ▲1.39
Dashboard /wp-admin2,198 ▲175.63 ▼0.0897.96 ▼9.7342.23 ▼1.22
Posts /wp-admin/edit.php2,100 ▼31.97 ▲0.0340.73 ▼3.8335.40 ▼0.03
Add New Post /wp-admin/post-new.php1,526 ▼023.31 ▲0.26674.84 ▼6.3852.03 ▼6.83
Media Library /wp-admin/upload.php1,391 ▼34.19 ▼0.0198.78 ▲1.0340.85 ▲0.62

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/preferred-languages/inc/functions.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: internationalization, translation, locale, i18n, language...

preferred-languages/preferred-languages.php Passed 13 tests

The main PHP file in "Preferred Languages" ver. 2.1.1 adds more information about the plugin and also serves as the entry point for this plugin
69 characters long description:
Choose languages for displaying WordPress in, in order of preference.

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
No dangerous file extensions were detected627 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP4175393612
JavaScript10013
CSS2002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
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%
Functions33
▷ Named functions33100.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
There are no PNG files in this plugin