84% ls-gtrans-widget

Code Review | Ls Gtrans Widget

WordPress plugin Ls Gtrans Widget scored84%from 54 tests.

About plugin

  • Plugin page: ls-gtrans-widget
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 13, 2015
  • Latest release: Feb 8, 2023
  • Number of updates: 11
  • Update frequency: every 251.8 days
  • Top authors: lenasterg (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,634 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.04ms] Passed 4 tests

This is a short check of server-side resources used by Ls Gtrans Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.39 ▼2.12
Dashboard /wp-admin3.32 ▼0.0243.59 ▼18.95
Posts /wp-admin/edit.php3.37 ▲0.0246.07 ▲3.97
Add New Post /wp-admin/post-new.php5.90 ▲0.02115.62 ▲35.04
Media Library /wp-admin/upload.php3.25 ▲0.0235.66 ▲0.95

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_ls_gtrans_widget
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ls Gtrans Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.31 ▼1.074.42 ▲2.3541.50 ▼0.65
Dashboard /wp-admin2,203 ▲115.90 ▲0.93106.77 ▼9.8041.55 ▲0.35
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0339.49 ▼3.1535.03 ▼2.41
Add New Post /wp-admin/post-new.php1,533 ▲1923.14 ▲5.34617.42 ▼38.7762.48 ▼7.39
Media Library /wp-admin/upload.php1,382 ▼64.21 ▼0.0295.02 ▼5.3541.39 ▼0.77

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
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_ls_gtrans_widget
    • theysaidso_admin_options

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ls-gtrans-widget/class-ls-gtrans-widget.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ls-gtrans-widget/class-ls-gtrans-widget.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

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
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Widget settings), #2 (Widget in frontend)
You can take inspiration from this readme.txt

ls-gtrans-widget/index.php 92% from 13 tests

The entry point to "Ls Gtrans Widget" version 2.0.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("ls-gtrans-widget.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin81 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2102681

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.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

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.10MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/google_logo.png0.79KB0.74KB▼ 6.28%
screenshot-2.png41.31KB20.40KB▼ 50.61%
screenshot-1.png57.52KB23.26KB▼ 59.57%