10% auto-translator-for-wpml-wpmlat

Code Review | Auto Translator for WPML

WordPress plugin Auto Translator for WPML scored10%from 54 tests.

About plugin

  • Plugin page: auto-translator-f...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9+
  • WordPress version: 6.3.1
  • First release: Jun 10, 2018
  • Latest release: Jun 10, 2018
  • Number of updates: 2
  • Update frequency: every 8.5 days
  • Top authors: RikuAnsem (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,213 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/auto-translator-for-wpml-wpmlat/class.auto-translator-for-wpml.php+58
    Undefined variable: message

Server metrics [RAM: ▼0.93MB] [CPU: ▼32.98ms] Passed 4 tests

This is a short check of server-side resources used by Auto Translator for WPML
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.12 ▼0.79
Dashboard /wp-admin3.01 ▼0.2922.46 ▼25.11
Posts /wp-admin/edit.php3.01 ▼0.3423.45 ▼25.16
Add New Post /wp-admin/post-new.php3.01 ▼2.8724.28 ▼68.68
Media Library /wp-admin/upload.php3.01 ▼0.2225.38 ▼12.97
Do auto translation /wp-admin/admin.php?page=wpmlat_execution3.0129.61
WMPL Auto Translator /wp-admin/options-general.php?page=wpmlat_config3.0122.98

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Auto Translator for WPML
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲10714.80 ▲0.421.72 ▲0.0739.48 ▼4.34
Dashboard /wp-admin2,245 ▲535.80 ▲0.9095.09 ▼17.7339.19 ▼0.97
Posts /wp-admin/edit.php2,131 ▲452.14 ▲0.1241.84 ▲6.6137.48 ▲3.15
Add New Post /wp-admin/post-new.php1,574 ▲4123.22 ▲0.20672.18 ▼15.6956.26 ▲6.64
Media Library /wp-admin/upload.php1,433 ▲484.32 ▲0.1594.18 ▼25.1941.49 ▼6.37
Do auto translation /wp-admin/admin.php?page=wpmlat_execution8092.0327.7629.44
WMPL Auto Translator /wp-admin/options-general.php?page=wpmlat_config9812.1622.6927.90

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
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/auto-translator-for-wpml-wpmlat/class.auto-translator-for-wpml-admin.php+123
    Use of undefined constant WPML_PLUGIN_FOLDER - assumed 'WPML_PLUGIN_FOLDER' (this will throw an Error in a future version of PHP)
  • Zombie WordPress options were found after uninstall: 7 options
    • wpmlat_use_translation_management
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpmlat_config
    • > Warning in wp-content/plugins/auto-translator-for-wpml-wpmlat/class.auto-translator-for-wpml-admin.php+123
    Use of undefined constant WPML_PLUGIN_FOLDER - assumed 'WPML_PLUGIN_FOLDER' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpmlat_config
    • > Notice in wp-content/plugins/auto-translator-for-wpml-wpmlat/pages/admin/Execution.php+193
    Undefined index: datapage
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpmlat_config
    • > Warning in wp-content/plugins/auto-translator-for-wpml-wpmlat/class.auto-translator-for-wpml.php+160
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=wpmlat_execution
    • > Notice in wp-content/plugins/auto-translator-for-wpml-wpmlat/pages/admin/Execution.php+64
    Undefined index: finish
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpmlat_config
    • > Warning in wp-content/plugins/auto-translator-for-wpml-wpmlat/pages/page-base.php+216
    in_array() expects parameter 2 to be array, bool given

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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/auto-translator-for-wpml-wpmlat/auto-translator-for-wpml.php
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WPMLAutoTranslatorAdminPageBase' not found in wp-content/plugins/auto-translator-for-wpml-wpmlat/pages/admin/Execution.php:6
    • > PHP Warning
      Use of undefined constant WPMLAT__PLUGIN_DIR - assumed 'WPMLAT__PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/auto-translator-for-wpml-wpmlat/pages/page-base.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/auto-translator-for-wpml-wpmlat/views/admin/config.php:17
    • > PHP Warning
      require_once(WPMLAT__PLUGIN_DIRpages/pageI.php): failed to open stream: No such file or directory in wp-content/plugins/auto-translator-for-wpml-wpmlat/pages/page-base.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'WPMLAT__PLUGIN_DIRpages/pageI.php' (include_path='.:/usr/share/php') in wp-content/plugins/auto-translator-for-wpml-wpmlat/pages/page-base.php on line 2
    • > PHP Fatal error
      Uncaught Error: Interface 'racs\\wpmlat\\TranslationService\\TranslationService' not found in wp-content/plugins/auto-translator-for-wpml-wpmlat/TranslationService/GoogleTranslateFree/GoogleTranslateFree.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WPMLAutoTranslatorAdminPageBase' not found in wp-content/plugins/auto-translator-for-wpml-wpmlat/pages/admin/Config.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/auto-translator-for-wpml-wpmlat/views/admin/execution.php:2

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 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: google, elementor, automatic, translation, wpml

auto-translator-for-wpml-wpmlat/auto-translator-for-wpml.php 85% from 13 tests

The principal PHP file in "Auto Translator for WPML" v. 1.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("auto-translator-for-wpml-wpmlat.php" instead of "auto-translator-for-wpml.php")
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin764 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP13204447695
JavaScript1141556
Markdown18013

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity9.56
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces2
Interfaces2
Traits0
Classes7
▷ Abstract classes114.29%
▷ Concrete classes685.71%
▷ Final classes00.00%
Methods61
▷ Static methods3557.38%
▷ Public methods5386.89%
▷ Protected methods23.28%
▷ Private methods69.84%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants457.14%
▷ Class constants342.86%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin