84% lokalise

Code Review | Lokalise Companion Plugin

WordPress plugin Lokalise Companion Plugin scored84%from 54 tests.

About plugin

  • Plugin page: lokalise
  • Plugin version: 1.6.8
  • PHP compatiblity: 5.4.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.0.0
  • WordPress version: 6.3.1
  • First release: Aug 4, 2020
  • Latest release: Nov 14, 2023
  • Number of updates: 25
  • Update frequency: every 48.0 days
  • Top authors: lokalise (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,559 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.34MB] [CPU: ▼3.16ms] Passed 4 tests

A check of server-side resources used by Lokalise Companion Plugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3541.39 ▼0.12
Dashboard /wp-admin3.65 ▲0.3050.31 ▼13.37
Posts /wp-admin/edit.php3.71 ▲0.3453.55 ▲4.82
Add New Post /wp-admin/post-new.php6.25 ▲0.3585.64 ▼3.70
Media Library /wp-admin/upload.php3.58 ▲0.3438.55 ▲4.54
Lokalise /wp-admin/options-general.php?page=lokalise3.5531.86

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 82 new files
Database: 1 new table, 8 new options
New tables
wp_lokalise_auth_tokens
New WordPress options
can_compress_scripts
lokalise_version
theysaidso_admin_options
widget_recent-posts
db_upgraded
lokalise_secret
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Lokalise Companion Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲6214.25 ▼0.141.63 ▼0.0541.06 ▼2.87
Dashboard /wp-admin2,214 ▲405.60 ▲0.0689.81 ▼13.7038.53 ▼4.74
Posts /wp-admin/edit.php2,120 ▲202.10 ▲0.1240.56 ▲3.6538.01 ▲2.57
Add New Post /wp-admin/post-new.php1,544 ▲1323.41 ▲0.51668.68 ▼8.8254.30 ▼4.33
Media Library /wp-admin/upload.php1,419 ▲224.15 ▼0.0798.92 ▼4.8742.73 ▼0.54
Lokalise /wp-admin/options-general.php?page=lokalise8042.0428.0128.59

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means 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 items
  • 29× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Lokalise_Locales' not found in wp-content/plugins/lokalise/include/Locales/class-lokalise-locales-site.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Lokalise_Registrable' not found in wp-content/plugins/lokalise/include/Model/class-lokalise-post-types-provider.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Lokalise_Registrable' not found in wp-content/plugins/lokalise/include/class-lokalise-i18n.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Lokalise_Registrable' not found in wp-content/plugins/lokalise/include/Provider/class-lokalise-provider-wpml.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Lokalise_Registrable' not found in wp-content/plugins/lokalise/include/class-lokalise-rest.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Lokalise_Registrable' not found in wp-content/plugins/lokalise/include/Provider/class-lokalise-provider-polylang.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Lokalise_Locales' not found in wp-content/plugins/lokalise/include/Locales/class-lokalise-locales-wpml.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lokalise/template/admin-notice-many-providers.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lokalise/template/admin-notice-secret.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Lokalise_Registrable' not found in wp-content/plugins/lokalise/include/class-lokalise-dashboard.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
Please take inspiration from this readme.txt

lokalise/plugin.php 92% from 13 tests

The main PHP script in "Lokalise Companion Plugin" version 1.6.8 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("lokalise.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin2,889 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
PHP565739772,539
PO File3720178
CSS211079
JSON20075
Markdown19018

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity7.15
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces5
Traits0
Classes36
▷ Abstract classes38.33%
▷ Concrete classes3391.67%
▷ Final classes00.00%
Methods223
▷ Static methods2611.66%
▷ Public methods19286.10%
▷ Protected methods41.79%
▷ Private methods2712.11%
Functions14
▷ Named functions428.57%
▷ Anonymous functions1071.43%
Constants25
▷ Global constants832.00%
▷ Class constants1768.00%
▷ Public constants17100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/lokalise-logo.png0.25KB0.29KB0.00%