68% automatic-translation

Code Review | Automatic Translation

WordPress plugin Automatic Translation scored68%from 54 tests.

About plugin

  • Plugin page: automatic-transla...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Jul 22, 2022
  • Latest release: Nov 3, 2022
  • Number of updates: 8
  • Update frequency: every 13.0 days
  • Top authors: masterhomepage (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /719 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.65MB] [CPU: ▼12.31ms] Passed 4 tests

This is a short check of server-side resources used by Automatic Translation
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.04365.84 ▲324.75
Dashboard /wp-admin3.36 ▲0.0647.82 ▼6.33
Posts /wp-admin/edit.php3.41 ▲0.0649.08 ▲1.05
Add New Post /wp-admin/post-new.php3.15 ▼2.7437.52 ▼63.45
Media Library /wp-admin/upload.php3.28 ▲0.0557.06 ▲19.48

Server storage [IO: ▲5.66MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Just a few items left to fix
  • Illegal file modification found: 1 file (1.27KB) outside of "wp-content/plugins/automatic-translation/" and "wp-content/uploads/"
    • (new file) sitemap.xml
Filesystem: 197 new files
Database: 1 new table, 8 new options
New tables
wp_translator_urls
New WordPress options
translator_install_time
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
translator_version

Browser metrics Passed 4 tests

Automatic Translation: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,633 ▼11314.13 ▼0.491.27 ▼0.4936.08 ▼7.11
Dashboard /wp-admin2,226 ▲355.83 ▲0.91103.06 ▼2.2371.50 ▲23.90
Posts /wp-admin/edit.php2,109 ▲232.00 ▼0.0336.05 ▼1.2134.08 ▲0.45
Add New Post /wp-admin/post-new.php1,682 ▲16320.40 ▼2.71649.03 ▼17.3363.22 ▲2.69
Media Library /wp-admin/upload.php1,399 ▲114.23 ▲0.01102.05 ▼14.1275.05 ▲26.14

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_translator_urls
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • translator_version
    • widget_recent-posts
    • widget_theysaidso_widget
    • translator_install_time
    • can_compress_scripts

Smoke tests 50% from 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 everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/automatic-translation/src/admin/menu.php
    • > /wp-content/plugins/automatic-translation/vendor/translator/script-php/errors.php
    • > /wp-content/plugins/automatic-translation/src/admin/scripts.php
  • 13× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/automatic-translation/script.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'TypistTech\\Imposter\\ConfigCollectionInterface' not found in wp-content/plugins/automatic-translation/vendor/typisttech/imposter/src/ConfigCollection.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'TypistTech\\Imposter\\Config' not found in wp-content/plugins/automatic-translation/vendor/typisttech/imposter/src/ProjectConfig.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'TypistTech\\Imposter\\ImposterInterface' not found in wp-content/plugins/automatic-translation/vendor/typisttech/imposter/src/Imposter.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'TypistTech\\Imposter\\ConfigInterface' not found in wp-content/plugins/automatic-translation/vendor/typisttech/imposter/src/ProjectConfigInterface.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'TypistTech\\Imposter\\ConfigInterface' not found in wp-content/plugins/automatic-translation/vendor/typisttech/imposter/src/Config.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'TypistTech\\Imposter\\FilesystemInterface' not found in wp-content/plugins/automatic-translation/vendor/typisttech/imposter/src/Filesystem.php:12
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/automatic-translation/src/woocommerce.php on line 13
    • > PHP Fatal error
      Uncaught Error: Interface 'Composer\\Plugin\\PluginInterface' not found in wp-content/plugins/automatic-translation/vendor/typisttech/imposter-plugin/src/ImposterPlugin.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/automatic-translation/src/woocommerce.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: wp translator, translator, wp automatic translator, automatic translation, translation...

automatic-translation/translator.php 85% from 13 tests

The main PHP file in "Automatic Translation" ver. 1.0.4 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("automatic-translation.php" instead of "translator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin26,976 lines of code in 156 files:
LanguageFilesBlank linesComment linesLines of code
PHP972,0741,91915,459
SVG32009,581
JSON900899
Markdown52080417
JavaScript5918290
CSS61616197
XML14280126
HTML1007

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity15.48
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces11
Interfaces6
Traits0
Classes46
▷ Abstract classes00.00%
▷ Concrete classes46100.00%
▷ Final classes36.52%
Methods344
▷ Static methods11834.30%
▷ Public methods30087.21%
▷ Protected methods123.49%
▷ Private methods329.30%
Functions105
▷ Named functions7268.57%
▷ Anonymous functions3331.43%
Constants59
▷ Global constants5593.22%
▷ Class constants46.78%
▷ Public constants375.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/translator-logo.png0.57KB0.73KB0.00%