89% wptranslator

Code Review | WPTranslator

WordPress plugin WPTranslator scored89%from 54 tests.

About plugin

  • Plugin page: wptranslator
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.6
  • WordPress version: 6.3.1
  • First release: Sep 20, 2016
  • Latest release: Sep 30, 2016
  • Number of updates: 6
  • Update frequency: every 1.7 days
  • Top authors: mediacambridge (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,777 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.14MB] [CPU: ▼8.04ms] Passed 4 tests

An overview of server-side resources used by WPTranslator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1535.34 ▼2.71
Dashboard /wp-admin3.46 ▲0.1144.54 ▼12.01
Posts /wp-admin/edit.php3.57 ▲0.2247.39 ▲6.89
Add New Post /wp-admin/post-new.php6.04 ▲0.1581.00 ▼15.68
Media Library /wp-admin/upload.php3.38 ▲0.1532.78 ▼1.76
WPTranslator /wp-admin/options-general.php?page=WPTranslator_options3.3630.26

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 236 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
WPTranslator

Browser metrics Passed 4 tests

A check of browser resources used by WPTranslator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲16213.98 ▼0.707.53 ▲5.8838.35 ▼0.32
Dashboard /wp-admin2,207 ▲165.80 ▲0.92105.15 ▲1.9437.72 ▼3.88
Posts /wp-admin/edit.php2,093 ▲71.99 ▼0.0339.65 ▲4.5535.71 ▲5.61
Add New Post /wp-admin/post-new.php1,517 ▼1617.57 ▼5.73649.34 ▼24.2951.18 ▼4.35
Media Library /wp-admin/upload.php1,395 ▲44.26 ▲0.0696.30 ▼7.6641.47 ▼3.50
WPTranslator /wp-admin/options-general.php?page=WPTranslator_options3,1421.7630.1329.32

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • WPTranslator
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

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
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === wptranslator === )
The official readme.txt might help

wptranslator/WPTranslator.php 85% from 13 tests

The entry point to "WPTranslator" version 1.0.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wptranslator.php" instead of "WPTranslator.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin599 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP113554599

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity45.50
▷ Minimum class complexity44.00
▷ Maximum class complexity47.00
Average method complexity5.24
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods21
▷ Static methods942.86%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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
233 compressed PNG files occupy 0.25MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
flags/fr.png0.52KB0.62KB0.00%
flags/lk.png0.95KB1.18KB0.00%
flags/gm.png0.50KB0.48KB▼ 4.50%
flags/de.png0.47KB0.50KB0.00%
flags/sl.png0.42KB0.41KB▼ 3.23%