78% conveythis-translate

Code Review | Language Translate Widget for WordPress - ConveyThis

WordPress plugin Language Translate Widget for WordPress - ConveyThis scored78%from 54 tests.

About plugin

  • Plugin page: conveythis-translate
  • Plugin version: 199...
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 21, 2018
  • Latest release: Nov 29, 2023
  • Number of updates: 323
  • Update frequency: every 6.5 days
  • Top authors: conveythis (100%)

Code review

54 tests

User reviews

125 reviews

Install metrics

10,000+ active /169,778 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.89MB] [CPU: ▲5.08ms] Passed 4 tests

A check of server-side resources used by Language Translate Widget for WordPress - ConveyThis
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.39 ▲0.9242.12 ▲3.06
Dashboard /wp-admin4.24 ▲0.9354.19 ▲4.97
Posts /wp-admin/edit.php4.29 ▲0.9354.79 ▲8.20
Add New Post /wp-admin/post-new.php6.75 ▲0.86102.21 ▲4.42
Media Library /wp-admin/upload.php4.09 ▲0.8642.16 ▲7.87

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 84 new files
Database: no new tables, 46 new options
New WordPress options
auto_translate
style_selector_id
conveythis_new_user
no_translate_element_id
style_change_flag
widget_recent-posts
target_languages_translations
conveythis_system_links
style_corner_type
style_indenting_vertical
...

Browser metrics Passed 4 tests

Language Translate Widget for WordPress - ConveyThis: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲13514.14 ▼0.571.54 ▼0.3537.94 ▼6.34
Dashboard /wp-admin2,299 ▲1255.62 ▼0.0597.90 ▼0.0143.00 ▼1.73
Posts /wp-admin/edit.php2,203 ▲1032.04 ▲0.0840.30 ▲4.4837.61 ▲5.23
Add New Post /wp-admin/post-new.php1,539 ▲12123.14 ▲5.32632.88 ▼0.9451.15 ▼2.14
Media Library /wp-admin/upload.php1,507 ▲1074.23 ▼0.14108.47 ▲10.8944.04 ▲0.01

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_conveythis
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 7× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/conveythis-translate/app/views/auth/login.php
    • > /wp-content/plugins/conveythis-translate/app/views/signup-modal.php
    • > /wp-content/plugins/conveythis-translate/app/views/auth/signup-modal.php
    • > /wp-content/plugins/conveythis-translate/endpoint.php
    • > /wp-content/plugins/conveythis-translate/app/views/layout/loader.php
    • > /wp-content/plugins/conveythis-translate/app/views/cache.php
    • > /wp-content/plugins/conveythis-translate/app/views/login.php
  • 51× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant CONVEY_PLUGIN_PATH - assumed 'CONVEY_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/conveythis-translate/app/views/auth/congratulations.php on line 43
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/conveythis-translate/app/views/page/general-settings.php:10
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/conveythis-translate/app/views/general-settings.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/conveythis-translate/app/class/ConveyThisWidget.php:4
    • > PHP Warning
      Use of undefined constant CONVEY_PLUGIN_PATH - assumed 'CONVEY_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/conveythis-translate/app/views/auth/congratulations.php on line 35
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/conveythis-translate/app/templates/posttype-conveythis-languages.php on line 5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/conveythis-translate/app/views/layout/widget.php:5
    • > PHP Warning
      Use of undefined constant CONVEYTHIS_PLUGIN_VERSION - assumed 'CONVEYTHIS_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/conveythis-translate/app/views/layout/loader.php on line 41
    • > PHP Warning
      Use of undefined constant CONVEY_PLUGIN_PATH - assumed 'CONVEY_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/conveythis-translate/app/views/layout/loader.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/conveythis-translate/app/views/auth/languages.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: translators, language, translate, translator, languages

conveythis-translate/index.php 77% from 13 tests

The primary PHP file in "Language Translate Widget for WordPress - ConveyThis" version 199... is used by WordPress to initiate all plugin functionality
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 ("conveythis-translate.php" instead of "index.php")
  • Description: The description should be shorter than 140 characters (currently 227 characters long)
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "199...")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin13,328 lines of code in 62 files:
LanguageFilesBlank linesComment linesLines of code
PHP381,3491386,294
JavaScript124331275,882
CSS10172591,137
SVG20015

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity108.83
▷ Minimum class complexity3.00
▷ Maximum class complexity505.00
Average method complexity5.78
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods110
▷ Static methods2018.18%
▷ Public methods9990.00%
▷ Protected methods00.00%
▷ Private methods1110.00%
Functions32
▷ Named functions13.12%
▷ Anonymous functions3196.88%
Constants17
▷ Global constants17100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.30MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
app/widget/images/logo-3-md.png226.62KB74.35KB▼ 67.19%
app/widget/images/logo-convey.png4.15KB1.70KB▼ 59.05%
app/widget/images/logo-conveythis_small.png5.41KB5.58KB0.00%
app/widget/images/close_grey.png0.52KB0.34KB▼ 34.78%
app/widget/images/conveythis-logo-vertical-blue.png3.23KB1.42KB▼ 56.18%