83% translate-wp-with-google-languages-translator

Code Review | Translate WordPress with Google Languages Translator

WordPress plugin Translate WordPress with Google Languages Translator scored83%from 54 tests.

About plugin

  • Plugin page: translate-wp-with...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6
  • WordPress version: 6.3.1
  • First release: Sep 30, 2016
  • Latest release: Sep 30, 2016
  • Number of updates: 8
  • Update frequency: every 3.5 days
  • Top authors: leopolt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,008 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼7.63ms] Passed 4 tests

This is a short check of server-side resources used by Translate WordPress with Google Languages Translator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1439.66 ▲1.27
Dashboard /wp-admin3.47 ▲0.1242.60 ▼14.45
Posts /wp-admin/edit.php3.58 ▲0.2246.71 ▲1.37
Add New Post /wp-admin/post-new.php6.05 ▲0.1681.60 ▼18.71
Media Library /wp-admin/upload.php3.39 ▲0.1636.51 ▲4.06
Google Languages Translator /wp-admin/options-general.php?page=translate-wordpress-google-languages-translator3.3647.81

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 19 new options
New WordPress options
db_upgraded
glt-display-mode
glt-languages-list
theysaidso_admin_options
widget_google_languages_translator_widget
widget_recent-posts
glt-align
glt-multi-language
glt-toolbar
glt-inline-display-mode
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Translate WordPress with Google Languages Translator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲7613.25 ▼1.171.76 ▼0.0341.24 ▼0.11
Dashboard /wp-admin2,208 ▲205.88 ▲0.04101.37 ▼0.8640.77 ▲0.92
Posts /wp-admin/edit.php2,096 ▲42.02 ▲0.0238.40 ▼4.1835.28 ▼1.63
Add New Post /wp-admin/post-new.php1,536 ▼623.13 ▲4.88608.47 ▼3.2855.52 ▲7.02
Media Library /wp-admin/upload.php1,386 ▼54.25 ▲0.0598.94 ▼1.5942.70 ▼1.92
Google Languages Translator /wp-admin/options-general.php?page=translate-wordpress-google-languages-translator2,3752.2935.6336.00

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_google_languages_translator_widget
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/translate-wp-with-google-languages-translator/uninstall.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/translate-wp-with-google-languages-translator/translate-wp-google-languages-translator.php:748

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 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

translate-wp-with-google-languages-translator/translate-wp-google-languages-translator.php 85% from 13 tests

"Translate WordPress with Google Languages Translator" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 167 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("translate-wp-with-google-languages-translator.php" instead of "translate-wp-google-languages-translator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin1,480 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP23167729
CSS21640565
JavaScript1790186

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity19.80
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods48
▷ Static methods4491.67%
▷ Public methods2041.67%
▷ Protected methods2858.33%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/flags.png32.73KB12.09KB▼ 63.06%