68% wpgt-google-translate

Code Review | WordPress Google Translate

WordPress plugin WordPress Google Translate scored 68% from 54 tests.

About plugin

  • Plugin page: wpgt-google-trans...
  • Plugin version: 1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9
  • WordPress version: 5.8.1
  • First release: Oct 6, 2018
  • Latest release: Jan 28, 2022
  • Number of updates: 14
  • Update frequency: every 96.7 days
  • Top authors: kartikparmar (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active / 4,775 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲4.83MB] [CPU: ▼164.56ms] 75% from 4 tests

Server-side resources used by WordPress Google Translate
Please have a look at the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,630.55ms on /wp-admin/admin.php?page=wpgt-google-translate)
PageMemory (MB)CPU Time (ms)
Home /8.35 ▲5.5145.25 ▲22.70
Dashboard /wp-admin8.36 ▲5.3050.06 ▲13.57
Posts /wp-admin/edit.php8.37 ▲5.2550.48 ▲17.14
Add New Post /wp-admin/post-new.php8.87 ▲3.4287.85 ▼708.16
Media Library /wp-admin/upload.php8.36 ▲5.3643.09 ▲19.23
WordPress Google Translate /wp-admin/admin.php?page=wpgt-google-translate8.361,630.55
Freemius Debug [v.2.3.2] /wp-admin/admin.php?page=freemius8.3640.08

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 181 new files
Database: no new tables, 5 new options
New WordPress options
widget_wpgt_google_translate
fs_gdpr
fs_accounts
fs_active_plugins
fs_debug_mode

Browser metrics Passed 4 tests

An overview of browser requirements for WordPress Google Translate
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,760 ▲15915.70 ▲0.135.74 ▲0.7373.39 ▼0.97
Dashboard /wp-admin2,974 ▲826.10 ▼0.04115.66 ▼22.71183.34 ▲6.34
Posts /wp-admin/edit.php2,785 ▲453.24 ▲0.0262.99 ▼1.55152.31 ▲10.90
Add New Post /wp-admin/post-new.php3,706 ▼21717.94 ▼1.51460.14 ▲11.12154.58 ▼4.47
Media Library /wp-admin/upload.php1,795 ▲435.54 ▲0.04150.95 ▲4.76198.14 ▲16.13
WordPress Google Translate /wp-admin/admin.php?page=wpgt-google-translate1,3602.4454.86179.62
Freemius Debug [v.2.3.2] /wp-admin/admin.php?page=freemius1,4662.4453.41111.05

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wpgt-google-translate/freemius/includes/class-freemius.php+8218
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 5 options in the database
    • fs_active_plugins
    • widget_wpgt_google_translate
    • fs_gdpr
    • fs_accounts
    • fs_debug_mode

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wpgt-google-translate/freemius/templates/ajax-loader.php
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wpgt-google-translate/includes/class-wpgt-widget.php:15
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/wpgt-google-translate/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wpgt-google-translate/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wpgt-google-translate/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/wpgt-google-translate/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wpgt-google-translate/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wpgt-google-translate/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wpgt-google-translate/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wpgt-google-translate/freemius/templates/account/partials/addon.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: switch, google-translate, website, translator, language

wpgt-google-translate/wpgt-google-translate.php Passed 13 tests

The primary PHP file in "WordPress Google Translate" version 1.3 is used by WordPress to initiate all plugin functionality
77 characters long description:
A light weight plugin to translate your WordPress website to other languages.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin45,396 lines of code in 140 files:
LanguageFilesBlank linesComment linesLines of code
PHP1097,09815,94329,697
PO File136,9658,46215,263
JavaScript43559202
Markdown1610192
JSON10027
CSS110014
SVG1001

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,772)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity85.30
▷ Minimum class complexity1.00
▷ Maximum class complexity2,772.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes46
▷ Abstract classes24.35%
▷ Concrete classes4495.65%
▷ Final classes00.00%
Methods1,125
▷ Static methods17315.38%
▷ Public methods78569.78%
▷ Protected methods151.33%
▷ Private methods32528.89%
Functions97
▷ Named functions97100.00%
▷ Anonymous functions00.00%
Constants123
▷ Global constants9879.67%
▷ Class constants2520.33%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%