84% gtranslate

Code Review | Translate Wordpress with GTranslate

WordPress plugin Translate Wordpress with GTranslate scored84%from 54 tests.

About plugin

  • Plugin page: gtranslate
  • Plugin version: 3.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.1-6.4
  • WordPress version: 6.3.1
  • First release: Mar 31, 2010
  • Latest release: Nov 20, 2023
  • Number of updates: 676
  • Update frequency: every 7.6 days
  • Top authors: edo888 (100%)

Code review

54 tests

User reviews

3672 reviews

Install metrics

500,000+ active /10,257,589 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.55MB] [CPU: ▼1.85ms] Passed 4 tests

A check of server-side resources used by Translate Wordpress with GTranslate
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.04 ▲0.5741.90 ▲0.72
Dashboard /wp-admin3.87 ▲0.5253.62 ▼9.28
Posts /wp-admin/edit.php3.99 ▲0.6254.98 ▲6.72
Add New Post /wp-admin/post-new.php6.45 ▲0.5694.53 ▼1.51
Media Library /wp-admin/upload.php3.80 ▲0.5637.73 ▲2.67
GTranslate /wp-admin/options-general.php?page=gtranslate_options3.7936.96

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 578 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
gtranslate_admin_notice
widget_theysaidso_widget
theysaidso_admin_options
GTranslate
widget_gtranslate

Browser metrics Passed 4 tests

A check of browser resources used by Translate Wordpress with GTranslate
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3214.72 ▲0.371.69 ▼0.0137.03 ▼6.96
Dashboard /wp-admin2,199 ▲225.64 ▲0.0694.37 ▲2.1743.01 ▼0.96
Posts /wp-admin/edit.php2,104 ▲41.94 ▼0.0939.51 ▲0.0336.04 ▼2.90
Add New Post /wp-admin/post-new.php1,538 ▲725.10 ▲2.39589.36 ▲5.2185.11 ▲34.33
Media Library /wp-admin/upload.php1,407 ▲74.14 ▼0.0195.40 ▼3.3641.57 ▼0.40
GTranslate /wp-admin/options-general.php?page=gtranslate_options5,7377.20308.5365.96

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_recent-posts
    • gtranslate_admin_notice
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_gtranslate
    • theysaidso_admin_options
    • GTranslate
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gtranslate/gtranslate.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

gtranslate/gtranslate.php 92% from 13 tests

"Translate Wordpress with GTranslate" version 3.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 154 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected4,517 lines of code in 112 files:
LanguageFilesBlank linesComment linesLines of code
PHP44712502,494
JavaScript12380101,837
SVG9500130
CSS10056

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.47
Average class complexity95.00
▷ Minimum class complexity4.00
▷ Maximum class complexity226.00
Average method complexity9.55
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods33
▷ Static methods1957.58%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions20100.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
444 compressed PNG files occupy 0.38MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
flags/16/pt.png0.58KB0.63KB0.00%
flags/48/gd.png2.38KB1.65KB▼ 30.73%
flags/16/en-ca.png0.56KB0.54KB▼ 3.86%
flags/48/nl.png0.62KB0.61KB▼ 2.36%
flags/32/es-co.png0.50KB0.59KB0.00%