10% teral-translate

Code Review | Teral Website Translation

WordPress plugin Teral Website Translation scored10%from 54 tests.

About plugin

  • Plugin page: teral-translate
  • Plugin version: 0.2.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.3.2
  • WordPress version: 6.3.1
  • First release: Feb 5, 2020
  • Latest release: Feb 19, 2020
  • Number of updates: 7
  • Update frequency: every 46.0 days
  • Top authors: djibomar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /525 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/teral-translate/includes/functions.php+28
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼1.92MB] [CPU: ▼58.28ms] Passed 4 tests

A check of server-side resources used by Teral Website Translation
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.394.53 ▼31.04
Dashboard /wp-admin2.09 ▼1.255.75 ▼53.07
Posts /wp-admin/edit.php2.10 ▼1.265.28 ▼43.33
Add New Post /wp-admin/post-new.php2.09 ▼3.798.12 ▼105.66
Media Library /wp-admin/upload.php2.10 ▼1.134.90 ▼29.79
Teral Translate /wp-admin/options-general.php?page=teral-translate2.106.18

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 164 new files
Database: no new tables, 9 new options
New WordPress options
teral_translate_config
teral_translate_version
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
widget_tl-switcher-widget
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Teral Website Translation
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲8613.28 ▼1.155.44 ▲3.8142.98 ▼0.03
Dashboard /wp-admin2,210 ▲255.83 ▼0.0497.60 ▼2.9538.14 ▼5.39
Posts /wp-admin/edit.php2,093 ▲42.02 ▲0.0234.58 ▼2.8836.05 ▲0.54
Add New Post /wp-admin/post-new.php1,524 ▲1023.32 ▲5.69668.07 ▲73.7947.12 ▲3.70
Media Library /wp-admin/upload.php1,392 ▲44.22 ▼0.0196.32 ▲2.0341.53 ▼0.71
Teral Translate /wp-admin/options-general.php?page=teral-translate1,1987.48162.13141.95

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/teral-translate/includes/src/Requirements.php+34
    Accessing static property Teral\Translate\src\Requirements::$permalinkEnabled as non static
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_tl-switcher-widget
    • teral_translate_version
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=teral-translate
    • > Notice in wp-content/plugins/teral-translate/includes/src/Requirements.php+52
    Accessing static property Teral\Translate\src\Requirements::$permalinkEnabled as non static
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=teral-translate
    • > Notice in wp-content/plugins/teral-translate/includes/src/Requirements.php+61
    Accessing static property Teral\Translate\src\Requirements::$configEnabled as non static

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 take a closer look at the following
  • 61× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UriInterface' not found in wp-content/plugins/teral-translate/vendor/guzzlehttp/psr7/src/Uri.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/teral-translate/vendor/guzzlehttp/promises/src/Promise.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/teral-translate/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Teral\\Translate\\Lib\\Dom\\Selector\\AbstractSelector' not found in wp-content/plugins/teral-translate/includes/Lib/Dom/Selector/Text.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/teral-translate/vendor/guzzlehttp/promises/src/FulfilledPromise.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Teral\\Translate\\Lib\\Dom\\Selector\\AbstractSelector' not found in wp-content/plugins/teral-translate/includes/Lib/Dom/Selector/Button.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Handler\\CurlFactoryInterface' not found in wp-content/plugins/teral-translate/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\TaskQueueInterface' not found in wp-content/plugins/teral-translate/vendor/guzzlehttp/promises/src/TaskQueue.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/teral-translate/includes/Widget.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Teral\\Translate\\Lib\\Dom\\Selector\\AbstractSelector' not found in wp-content/plugins/teral-translate/includes/Lib/Dom/Selector/Title.php:10

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)
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 21 tag instead of maximum 10
  • Contributors: Plugin contributors field is missing
You can look at the official readme.txt

teral-translate/teral-translate.php 85% from 13 tests

Analyzing the main PHP file in "Teral Website Translation" version 0.2.0
Please take the time to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: 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 plugin14,586 lines of code in 152 files:
LanguageFilesBlank linesComment linesLines of code
PHP1302,3595,98010,824
Markdown101,01803,233
JSON600485
JavaScript309217
Dockerfile18010
make1409
CSS1108

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity13.36
▷ Minimum class complexity1.00
▷ Maximum class complexity201.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces16
Interfaces15
Traits2
Classes99
▷ Abstract classes44.04%
▷ Concrete classes9595.96%
▷ Final classes99.47%
Methods834
▷ Static methods8410.07%
▷ Public methods67881.29%
▷ Protected methods283.36%
▷ Private methods12815.35%
Functions168
▷ Named functions7242.86%
▷ Anonymous functions9657.14%
Constants149
▷ Global constants2416.11%
▷ Class constants12583.89%
▷ Public constants125100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected