78% sitetran

Code Review | SiteTran - Translate Your WordPress Site

WordPress plugin SiteTran - Translate Your WordPress Site scored78%from 54 tests.

About plugin

  • Plugin page: sitetran
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 1, 2022
  • Latest release: Sep 27, 2023
  • Number of updates: 14
  • Update frequency: every 31.1 days
  • Top authors: sitetran (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /364 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼1.63ms] Passed 4 tests

Server-side resources used by SiteTran - Translate Your WordPress Site
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0642.12 ▲4.01
Dashboard /wp-admin3.35 ▲0.0546.43 ▼0.75
Posts /wp-admin/edit.php3.47 ▲0.1143.80 ▼3.84
Add New Post /wp-admin/post-new.php5.95 ▲0.0780.66 ▼5.73
Media Library /wp-admin/upload.php3.28 ▲0.0536.53 ▲3.82

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: 2 new tables, 9 new options
New tables
wp_sitetran_page_to_lang
wp_sitetran_pages
New WordPress options
widget_theysaidso_widget
sitetran_flush_rewrite_rules
theysaidso_admin_options
sitetran_had_conflict
widget_recent-comments
sitetran_db_version
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

SiteTran - Translate Your WordPress Site: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲9714.36 ▼0.021.99 ▲0.4841.38 ▲1.95
Dashboard /wp-admin2,236 ▲655.54 ▲0.0283.72 ▼3.2537.91 ▼0.88
Posts /wp-admin/edit.php2,148 ▲482.02 ▲0.0636.75 ▼0.5331.97 ▼4.18
Add New Post /wp-admin/post-new.php1,557 ▲2818.16 ▼4.91614.74 ▼47.4952.49 ▲1.60
Media Library /wp-admin/upload.php1,442 ▲394.25 ▲0.0795.93 ▼2.6541.40 ▼4.03

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • sitetran_had_conflict

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/sitetran/translate-your-website-sitetran.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: slug in wp-content/plugins/sitetran/includes/templates/translate.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_redirect() in wp-content/plugins/sitetran/includes/templates/translate.php:48

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Translation Interface), #2 (Free Usage), #3 (Adding new languages), #4 (Managing translators), #5 (Monitoring translator progress), #6 (Monitoring widget usage progress)
You can look at the official readme.txt

sitetran/translate-your-website-sitetran.php 92% from 13 tests

This is the main PHP file of "SiteTran - Translate Your WordPress Site" version 1.2.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sitetran.php" instead of "translate-your-website-sitetran.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
Good job! No executable or dangerous file extensions detected2,220 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP44464811,583
CSS221357
JavaScript44531253
SVG30027

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity47.25
▷ Minimum class complexity9.00
▷ Maximum class complexity113.00
Average method complexity4.70
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods50
▷ Static methods48.00%
▷ Public methods4896.00%
▷ Protected methods00.00%
▷ Private methods24.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/check-mark.png4.33KB2.52KB▼ 41.85%