68% weglot

Code Review | Weglot Translate - Translate your WordPress website and go multilingual

WordPress plugin Weglot Translate - Translate your WordPress website and go multilingual scored68%from 54 tests.

About plugin

  • Plugin page: weglot
  • Plugin version: 4.2.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.4
  • WordPress version: 6.3.1
  • First release: Sep 27, 2015
  • Latest release: Nov 21, 2023
  • Number of updates: 279
  • Update frequency: every 10.7 days
  • Top authors: remyb92 (100%)

Code review

54 tests

User reviews

1592 reviews

Install metrics

50,000+ active /2,138,474 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
Installer ran successfully

Server metrics [RAM: ▲1.91MB] [CPU: ▲21.61ms] Passed 4 tests

An overview of server-side resources used by Weglot Translate - Translate your WordPress website and go multilingual
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.31 ▲1.8459.31 ▲23.49
Dashboard /wp-admin5.14 ▲1.8364.03 ▲16.52
Posts /wp-admin/edit.php5.71 ▲2.35191.34 ▲141.22
Add New Post /wp-admin/post-new.php8.10 ▲2.21111.90 ▲25.45
Media Library /wp-admin/upload.php5.00 ▲1.7754.65 ▲20.97

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 407 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
weglot_version
widget_weglot-translate
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Weglot Translate - Translate your WordPress website and go multilingual
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,907 ▲14514.32 ▼0.031.79 ▲0.1039.96 ▲1.81
Dashboard /wp-admin2,283 ▲1055.61 ▼0.10102.08 ▼13.2343.80 ▼0.34
Posts /wp-admin/edit.php2,250 ▲1504.01 ▲2.0278.59 ▲39.8133.88 ▼0.59
Add New Post /wp-admin/post-new.php6,504 ▲4,96927.23 ▲4.12932.96 ▲289.5240.46 ▼14.46
Media Library /wp-admin/upload.php1,494 ▲944.20 ▼0.0496.28 ▼6.2143.86 ▲1.99

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
  • This plugin does not fully uninstall, leaving 8 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • weglot_version
    • widget_recent-posts
    • can_compress_scripts
    • widget_weglot-translate
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/weglot/vendor/weglot/weglot-php/update_certs.php
  • 50× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Weglot\\Client\\Api\\Exception\\AbstractException' not found in wp-content/plugins/weglot/vendor/weglot/weglot-php/src/Client/Api/Exception/MissingRequiredParamException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Weglot\\Client\\Endpoint\\Endpoint' not found in wp-content/plugins/weglot/vendor/weglot/weglot-php/src/Client/Endpoint/Status.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Weglot\\Parser\\Check\\Dom\\AbstractDomChecker' not found in wp-content/plugins/weglot/vendor/weglot/weglot-php/src/Parser/Check/Dom/TdDataTitle.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Weglot\\Parser\\Check\\Dom\\AbstractDomChecker' not found in wp-content/plugins/weglot/vendor/weglot/weglot-php/src/Parser/Check/Dom/LinkDataTooltip.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Weglot\\Parser\\ConfigProvider\\AbstractConfigProvider' not found in wp-content/plugins/weglot/vendor/weglot/weglot-php/src/Parser/ConfigProvider/ManualConfigProvider.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Weglot\\Parser\\Check\\Dom\\AbstractDomChecker' not found in wp-content/plugins/weglot/vendor/weglot/weglot-php/src/Parser/Check/Dom/Text.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Weglot\\Parser\\Formatter\\AbstractFormatter' not found in wp-content/plugins/weglot/vendor/weglot/weglot-php/src/Parser/Formatter/DomFormatter.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'Weglot\\Parser\\Check\\Dom\\AbstractDomChecker' not found in wp-content/plugins/weglot/vendor/weglot/weglot-php/src/Parser/Check/Dom/LinkHref.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Weglot\\Client\\Api\\Shared\\AbstractCollectionInterface' not found in wp-content/plugins/weglot/vendor/weglot/weglot-php/src/Client/Api/Shared/AbstractCollection.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Weglot\\Client\\Api\\Shared\\AbstractCollection' not found in wp-content/plugins/weglot/vendor/weglot/weglot-php/src/Client/Api/LanguageCollection.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 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
These attributes need your attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
  • Screenshots: Please describe screenshot #9 in weglot/assets to your readme.txt
The official readme.txt might help

weglot/weglot.php Passed 13 tests

The main PHP script in "Weglot Translate - Translate your WordPress website and go multilingual" version 4.2.2 is automatically included on every request by WordPress
105 characters long description:
Translate your website into multiple languages in minutes without doing any coding. Fully SEO compatible.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
It is important to fix the following items
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/weglot/vendor/weglot/weglot-php/data/ca-certificates.crt
28,837 lines of code in 354 files:
LanguageFilesBlank linesComment linesLines of code
PHP2583,4406,40016,068
JSON22104,306
PO File81,5591,7683,934
Markdown1241401,390
Sass813601,384
JavaScript352161721,088
CSS7333620
YAML22028
SVG10112
XML1007

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity8.09
▷ Minimum class complexity1.00
▷ Maximum class complexity208.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces61
Interfaces10
Traits5
Classes207
▷ Abstract classes2311.11%
▷ Concrete classes18488.89%
▷ Final classes10.54%
Methods847
▷ Static methods8610.15%
▷ Public methods77691.62%
▷ Protected methods586.85%
▷ Private methods131.53%
Functions77
▷ Named functions5064.94%
▷ Anonymous functions2735.06%
Constants259
▷ Global constants4316.60%
▷ Class constants21683.40%
▷ Public constants216100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
24 compressed PNG files occupy 0.90MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
blocks/weglot-widget/build/images/circular_flag.2a0fa173.png82.09KB83.03KB0.00%
dist/images/rect_bright.png33.80KB34.53KB0.00%
blocks/weglot-widget/build/images/rect_bright.93dd8032.png33.80KB34.53KB0.00%
app/images/rect_mate.png51.46KB52.63KB0.00%
dist/images/wgarrowdown.png0.16KB0.28KB0.00%