78% google-website-translator

Code Review | Prisna GWT - Google Website Translator

WordPress plugin Prisna GWT - Google Website Translator scored78%from 54 tests.

About plugin

  • Plugin page: google-website-tr...
  • Plugin version: 1.4.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.3
  • WordPress version: 6.3.1
  • First release: Sep 30, 2014
  • Latest release: Aug 13, 2023
  • Number of updates: 76
  • Update frequency: every 42.6 days
  • Top authors: Prisna (100%)

Code review

54 tests

User reviews

51 reviews

Install metrics

10,000+ active /255,649 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
Install script ran successfully

Server metrics [RAM: ▲0.63MB] [CPU: ▲0.73ms] Passed 4 tests

This is a short check of server-side resources used by Prisna GWT - Google Website Translator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.09 ▲0.6345.30 ▲6.30
Dashboard /wp-admin3.93 ▲0.6349.24 ▼0.33
Posts /wp-admin/edit.php4.05 ▲0.6949.81 ▲0.92
Add New Post /wp-admin/post-new.php6.51 ▲0.6390.18 ▼0.69
Media Library /wp-admin/upload.php3.86 ▲0.6338.56 ▲3.02
Prisna GWT /wp-admin/plugins.php?page=prisna-google-website-translator-settings6.2561.07

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 199 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_prisna-google-website-translator
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Prisna GWT - Google Website Translator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲7313.31 ▼0.881.92 ▲0.2445.89 ▲6.70
Dashboard /wp-admin2,211 ▲235.83 ▲0.9299.67 ▼18.2242.24 ▲0.84
Posts /wp-admin/edit.php2,093 ▲12.02 ▲0.0434.00 ▼5.6934.78 ▲0.19
Add New Post /wp-admin/post-new.php1,536 ▲2223.39 ▲5.67651.12 ▲5.9552.43 ▼3.87
Media Library /wp-admin/upload.php1,395 ▲74.21 ▲0.0198.19 ▼3.1341.80 ▼1.94
Prisna GWT /wp-admin/plugins.php?page=prisna-google-website-translator-settings14,1223.2179.68231.64

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_prisna-google-website-translator
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'PrisnaGWTItem' not found in wp-content/plugins/google-website-translator/classes/admin.class.php:157
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/google-website-translator/uninstall.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PrisnaGWTItem' not found in wp-content/plugins/google-website-translator/classes/main.class.php:100
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/google-website-translator/google-website-translator.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/google-website-translator/classes/common.class.php:886

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Assamese.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Bhojpuri.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Dogri.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Ilocano.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Konkani.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Maithili.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Meiteilon.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Mizo.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Odia.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Sanskrit.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Sepedi.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Sorani.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Tatar.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Tsonga.gif - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=prisna-google-website-translator-settings
    • > Network (severe)
    wp-content/plugins/google-website-translator/images/Uyghur.gif - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

google-website-translator/google-website-translator.php 85% from 13 tests

The main file in "Prisna GWT - Google Website Translator" v. 1.4.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 176 characters long)
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
There were no executable files found in this plugin7,347 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP71,295202,909
SVG2312,082
JavaScript2285141,082
CSS120411,025
PO File18787249

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity8.71
▷ Minimum class complexity1.00
▷ Maximum class complexity90.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes45
▷ Abstract classes24.44%
▷ Concrete classes4395.56%
▷ Final classes00.00%
Methods216
▷ Static methods9945.83%
▷ Public methods15471.30%
▷ Protected methods6228.70%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants16
▷ Global constants956.25%
▷ Class constants743.75%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
27 PNG files occupy 0.15MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/pad.png2.62KB7.54KB0.00%
images/style_horizontal.png6.31KB3.00KB▼ 52.46%
images/w9xWz.png3.44KB0.98KB▼ 71.43%
images/banner.png14.12KB4.89KB▼ 65.34%
images/logo.png4.84KB2.12KB▼ 56.22%