10% advanced-google-translate

Code Review | Advanced Google Translate

WordPress plugin Advanced Google Translate scored 10% from 54 tests.

About plugin

  • Plugin page: advanced-google-t...
  • Plugin version: 2.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8.1
  • WordPress version: 5.8.1
  • First release: Aug 3, 2021
  • Latest release: Nov 11, 2021
  • Number of updates: 48
  • Update frequency: every 2.1 days
  • Top authors: ycxmz100 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

3,000+ active / 6,376 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/advanced-google-translate/agt-ui.php+84
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼0.27MB] [CPU: ▼195.67ms] Passed 4 tests

Server-side resources used by Advanced Google Translate
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.36 ▲0.529.07 ▼27.24
Dashboard /wp-admin3.38 ▲0.3212.31 ▼46.50
Posts /wp-admin/edit.php3.38 ▲0.279.80 ▼41.01
Add New Post /wp-admin/post-new.php3.38 ▼2.068.85 ▼666.02
Media Library /wp-admin/upload.php3.38 ▲0.388.87 ▼29.14

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 143 new files
Database: no new tables, 2 new options
New WordPress options
agt_settings
ssb_showoncpt

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Google Translate
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /5,421 ▲1,82518.66 ▲2.5561.79 ▲44.8977.62 ▲24.01
Dashboard /wp-admin3,015 ▲847.14 ▲1.01158.60 ▼10.87127.51 ▲13.38
Posts /wp-admin/edit.php2,817 ▲782.85 ▲0.1584.13 ▲14.49107.93 ▲16.49
Add New Post /wp-admin/post-new.php1,661 ▲4622.38 ▲1.00347.93 ▲51.30123.30 ▲14.51
Media Library /wp-admin/upload.php1,805 ▼25.65 ▲0.65158.95 ▼16.91119.43 ▼7.47

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/advanced-google-translate/agt-ui.php+84
    Trying to access array offset on value of type bool
  • Zombie WordPress options were found after uninstall: 2 options
    • ssb_showoncpt
    • agt_settings

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/advanced-google-translate/advanced-google-translate.php:52

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #2 (Advanced Google Translate in action: OUT), #3 (Advanced Google Translate backend button creator), #4 (An example site using Advanced Google Translate), #5 (An example site using Advanced Google Translate), #6 (An example site using Advanced Google Translate)
  • Donate link: Please fix this invalid url: ""
Please take inspiration from this readme.txt

advanced-google-translate/advanced-google-translate.php 77% from 13 tests

The principal PHP file in "Advanced Google Translate" v. 2.1.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 190 characters long)
  • Domain Path: The domain path should be prefixed with a forward slash character ("/")
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin17,250 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
SVG4006,940
JavaScript386225,428
CSS41,350293,218
PHP31531771,664

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 484)
Cyclomatic complexity
Average complexity per logical line of code1.88
Average class complexity476.50
▷ Minimum class complexity17.00
▷ Maximum class complexity936.00
Average method complexity74.15
▷ Minimum method complexity1.00
▷ Maximum method complexity484.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
111 PNG files occupy 0.08MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
flags/24/yi.png0.57KB0.51KB▼ 11.58%
flags/24/mt.png0.51KB0.57KB0.00%
flags/24/lb.png0.42KB0.40KB▼ 2.82%
flags/24/st.png1.51KB0.54KB▼ 64.42%
flags/24/km.png0.72KB0.76KB0.00%