84% transcy

Code Review | Translate WordPress Multilingual Sites - Transcy WordPress Translation Plugin

WordPress plugin Translate WordPress Multilingual Sites - Transcy WordPress Translation Plugin scored84%from 54 tests.

About plugin

  • Plugin page: transcy
  • Plugin version: 2.12.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3.1
  • WordPress version: 6.3.1
  • First release: Sep 13, 2022
  • Latest release: Nov 7, 2023
  • Number of updates: 94
  • Update frequency: every 4.5 days
  • Top authors: onecommerce (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /6,016 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲1.42MB] [CPU: ▲397.34ms] 75% from 4 tests

Analyzing server-side resources used by Translate WordPress Multilingual Sites - Transcy WordPress Translation Plugin
Please take the time to fix the following items
  • Extra CPU: Extra CPU usage should be kept under 200.00ms (currently 397.34ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /4.89 ▲1.42436.89 ▲395.92
Dashboard /wp-admin4.74 ▲1.43450.45 ▲398.79
Posts /wp-admin/edit.php4.77 ▲1.41450.74 ▲404.93
Add New Post /wp-admin/post-new.php7.66 ▲1.77489.51 ▲389.72
Media Library /wp-admin/upload.php4.66 ▲1.43645.97 ▲612.66

Server storage [IO: ▲3.36MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 222 new files
Database: 1 new table, 11 new options
New tables
wp_transcy_translations
New WordPress options
widget_recent-posts
widget_recent-comments
_transcy_registered_site
can_compress_scripts
transcy_apikey
transcy_client_data
db_upgraded
_transcy_upgrader_tracking
widget_theysaidso_widget
theysaidso_admin_options
...

Browser metrics Passed 4 tests

A check of browser resources used by Translate WordPress Multilingual Sites - Transcy WordPress Translation Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,969 ▲2,20718.30 ▲3.9511.35 ▲9.3942.53 ▼5.86
Dashboard /wp-admin4,253 ▲2,07310.69 ▲5.02224.58 ▲129.8676.83 ▲34.35
Posts /wp-admin/edit.php3,811 ▲1,7117.60 ▲5.59148.00 ▲110.9136.01 ▼1.37
Add New Post /wp-admin/post-new.php3,377 ▲1,85124.61 ▲1.48822.11 ▲178.3936.58 ▼11.97
Media Library /wp-admin/upload.php2,653 ▲1,2508.55 ▲4.37227.91 ▲131.5274.20 ▲33.53

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please fix the following items
  • 202× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Constant SODIUM_CRYPTO_AEAD_AES256GCM_KEYBYTES already defined in wp-content/plugins/transcy/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 11
    • > PHP Notice
      Constant SODIUM_CRYPTO_AUTH_KEYBYTES already defined in wp-content/plugins/transcy/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 28
    • > PHP Notice
      Constant SODIUM_CRYPTO_AEAD_AES256GCM_NPUBBYTES already defined in wp-content/plugins/transcy/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core32_ChaCha20' not found in wp-content/plugins/transcy/vendor/paragonie/sodium_compat/src/Core32/HChaCha20.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core_Poly1305' not found in wp-content/plugins/transcy/vendor/paragonie/sodium_compat/namespaced/Core/Poly1305.php:4
    • > PHP Notice
      Constant SODIUM_CRYPTO_BOX_MACBYTES already defined in wp-content/plugins/transcy/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 33
    • > PHP Fatal error
      Uncaught Error: Class 'TranscyApp\\Repositories\\BaseRepository' not found in wp-content/plugins/transcy/modules/app/Repositories/MenuRepository.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core32_Util' not found in wp-content/plugins/transcy/vendor/paragonie/sodium_compat/src/Core32/ChaCha20.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Compat' not found in wp-content/plugins/transcy/vendor/paragonie/sodium_compat/namespaced/Compat.php:4
    • > PHP Notice
      Constant SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING already defined in wp-content/plugins/transcy/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

transcy/transcy.php Passed 13 tests

This is the main PHP file of "Translate WordPress Multilingual Sites - Transcy WordPress Translation Plugin" version 2.12.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
122 characters long description:
Make your website multilingual easily with no coding. Instantly translate between languages with the Google Translate API.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin28,083 lines of code in 206 files:
LanguageFilesBlank linesComment linesLines of code
PHP1843,77313,02026,999
Markdown31360538
JSON600454
JavaScript55443130
HTML13025
XML10019
SVG20012
Bourne Shell1203
CSS3003

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity13.75
▷ Minimum class complexity1.00
▷ Maximum class complexity386.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces37
Interfaces2
Traits3
Classes155
▷ Abstract classes2113.55%
▷ Concrete classes13486.45%
▷ Final classes00.00%
Methods1,049
▷ Static methods63060.06%
▷ Public methods97793.14%
▷ Protected methods454.29%
▷ Private methods272.57%
Functions190
▷ Named functions18094.74%
▷ Anonymous functions105.26%
Constants361
▷ Global constants174.71%
▷ Class constants34495.29%
▷ Public constants344100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.32MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/dist/assets/currencyOnboarding-7f203515.png37.21KB12.57KB▼ 66.22%
assets/dist/assets/trialHasExpiredModal-66016c88.png7.10KB3.46KB▼ 51.27%
assets/dist/assets/somethingWrong-29b921d2.png13.93KB6.37KB▼ 54.24%
assets/dist/assets/dashboardLanguageImage-28bf5ebe.png66.25KB23.26KB▼ 64.88%
assets/dist/assets/rating-0e14e36c.png11.13KB5.13KB▼ 53.95%