78% easytranslate

Code Review | EasyTranslate

WordPress plugin EasyTranslate scored78%from 54 tests.

About plugin

  • Plugin page: easytranslate
  • Plugin version: 1.10.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1
  • WordPress version: 6.3.1
  • First release: Jun 16, 2020
  • Latest release: Apr 25, 2023
  • Number of updates: 121
  • Update frequency: every 8.7 days
  • Top authors: frpet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,868 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼2.70ms] Passed 4 tests

Analyzing server-side resources used by EasyTranslate
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0635.55 ▼1.95
Dashboard /wp-admin3.44 ▲0.1444.95 ▼4.31
Posts /wp-admin/edit.php3.49 ▲0.1448.71 ▲3.69
Add New Post /wp-admin/post-new.php5.98 ▲0.1082.70 ▼8.23
Media Library /wp-admin/upload.php3.30 ▲0.0845.17 ▲12.61
Projects /wp-admin/admin.php?page=admin-easy-translate-projects3.2528.24
Integration /wp-admin/admin.php?page=admin-easy-translate-integration3.3031.97
String translations /wp-admin/admin.php?page=admin-easy-translate-partial-translations3.1821.22
Page translations /wp-admin/admin.php?page=admin-easy-translate3.1722.10

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 34 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
easy_translate_api_integration
recovery_mode_email_last_sent
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for EasyTranslate
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8114.38 ▼0.191.64 ▲0.0139.16 ▼1.35
Dashboard /wp-admin2,236 ▲565.67 ▲0.0779.89 ▼4.1980.85 ▲35.51
Posts /wp-admin/edit.php2,138 ▲382.01 ▼0.0140.31 ▲4.3337.47 ▲4.43
Add New Post /wp-admin/post-new.php1,712 ▲18622.24 ▼0.74775.84 ▲146.7156.48 ▲3.79
Media Library /wp-admin/upload.php1,438 ▲384.19 ▲0.0098.52 ▲5.2571.72 ▲28.70
Projects /wp-admin/admin.php?page=admin-easy-translate-projects7191.527.2617.57
Integration /wp-admin/admin.php?page=admin-easy-translate-integration8922.1624.6128.20
String translations /wp-admin/admin.php?page=admin-easy-translate-partial-translations9021.6523.7826.28
Page translations /wp-admin/admin.php?page=admin-easy-translate8981.6624.4026.06

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

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=admin-easy-translate-projects
    • > Error in wp-content/plugins/easytranslate/admin/class-easy-translate-api-integration.php+351
    Uncaught TypeError: Argument 1 passed to Easy_Translate_API_Integration::map_fields() must be of the type array, string given, called in wp-content/plugins/easytranslate/admin/class-easy-translate-projects.php on line 41 and defined in wp-content/plugins/easytranslate/admin/class-easy-translate-api-integration.php:351
    Stack trace:
    #0 wp-content/plugins/easytranslate/admin/class-easy-translate-projects.php(41): Easy_Translate_API_Integration::map_fields()
    #1 wp-content/plugins/easytranslate/admin/class-easy-translate-projects.php(85): Easy_Translate_Projects->handle_actions()
    #2 wp-content/plugins/easytranslate/admin/class-easy-translate-admin.php(238): Easy_Translate_Projects->render()
    #3 wp-includes/class-wp-hook.php(310): Easy_Translate_Admin->show_projects_page()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517):
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=admin-easy-translate
    • > Warning in wp-content/plugins/easytranslate/admin/class-easy-translate-admin.php+183
    Use of undefined constant ICL_TM_NOT_TRANSLATED - assumed 'ICL_TM_NOT_TRANSLATED' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=admin-easy-translate
    • > Warning in wp-content/plugins/easytranslate/admin/class-easy-translate-admin.php+183
    Use of undefined constant ICL_TM_WAITING_FOR_TRANSLATOR - assumed 'ICL_TM_WAITING_FOR_TRANSLATOR' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=admin-easy-translate
    • > Warning in wp-content/plugins/easytranslate/admin/class-easy-translate-admin.php+183
    Use of undefined constant ICL_STRING_TRANSLATION_PARTIAL - assumed 'ICL_STRING_TRANSLATION_PARTIAL' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=admin-easy-translate
    • > Warning in wp-content/plugins/easytranslate/admin/class-easy-translate-admin.php+183
    Use of undefined constant ICL_TM_NEEDS_UPDATE - assumed 'ICL_TM_NEEDS_UPDATE' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=admin-easy-translate
    • > Warning in wp-content/plugins/easytranslate/admin/class-easy-translate-admin.php+183
    Use of undefined constant ICL_TM_DUPLICATE - assumed 'ICL_TM_DUPLICATE' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=admin-easy-translate
    • > Warning in wp-content/plugins/easytranslate/admin/class-easy-translate-admin.php+183
    Use of undefined constant ICL_TM_COMPLETE - assumed 'ICL_TM_COMPLETE' (this will throw an Error in a future version of PHP)

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Easy_Translate_Translation_List' not found in wp-content/plugins/easytranslate/admin/class-easy-translate-post-translation-list.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/easytranslate/admin/partials/string-translation.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/easytranslate/admin/partials/translation-options.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/easytranslate/admin/partials/post-translation.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Easy_Translate_API_Service' not found in wp-content/plugins/easytranslate/admin/class-easy-translate-api-string-library.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/easytranslate/admin/class-easy-translate-translation-list.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Easy_Translate_API_Service' not found in wp-content/plugins/easytranslate/admin/class-easy-translate-api-laas.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Easy_Translate_Translation_List' not found in wp-content/plugins/easytranslate/admin/class-easy-translate-string-translation-list.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/easytranslate/admin/partials/projects.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/easytranslate/admin/partials/requirements.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid url: ""
The official readme.txt might help

easytranslate/easy-translate.php 85% from 13 tests

Analyzing the main PHP file in "EasyTranslate" version 1.10.3
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("easytranslate.php" instead of "easy-translate.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
Success! There were no dangerous files found in this plugin2,775 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP266131,2292,690
CSS111562
JavaScript1112723

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity16.94
▷ Minimum class complexity1.00
▷ Maximum class complexity75.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes212.50%
▷ Concrete classes1487.50%
▷ Final classes00.00%
Methods151
▷ Static methods2415.89%
▷ Public methods9965.56%
▷ Protected methods4328.48%
▷ Private methods95.96%
Functions14
▷ Named functions1071.43%
▷ Anonymous functions428.57%
Constants47
▷ Global constants48.51%
▷ Class constants4391.49%
▷ Public constants43100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/icon.png1.86KB1.91KB0.00%