83% comment-translator

Code Review | Comment Translator

WordPress plugin Comment Translator scored83%from 54 tests.

About plugin

  • Plugin page: comment-translator
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1
  • WordPress version: 6.3.1
  • First release: Jan 1, 2015
  • Latest release: Jan 1, 2015
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: codycode (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,240 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.03MB] [CPU: ▼4.54ms] Passed 4 tests

Server-side resources used by Comment Translator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.59 ▼3.06
Dashboard /wp-admin3.33 ▲0.0348.11 ▲0.74
Posts /wp-admin/edit.php3.45 ▲0.0946.41 ▼2.25
Add New Post /wp-admin/post-new.php5.91 ▲0.0381.24 ▼13.59
Media Library /wp-admin/upload.php3.26 ▲0.0337.80 ▲5.92
Comment Translator /wp-admin/tools.php?page=pct_setting3.3234.35

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Comment Translator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.35 ▼1.031.70 ▼0.3047.61 ▲9.32
Dashboard /wp-admin2,212 ▲245.83 ▼0.0994.15 ▼15.7938.91 ▼2.70
Posts /wp-admin/edit.php2,095 ▲61.99 ▲0.0036.02 ▼4.5332.93 ▼4.93
Add New Post /wp-admin/post-new.php1,534 ▲2023.22 ▲5.66672.29 ▲2.7556.32 ▼3.42
Media Library /wp-admin/upload.php1,404 ▲164.31 ▲0.13101.05 ▼9.1645.00 ▼1.83
Comment Translator /wp-admin/tools.php?page=pct_setting9972.0632.9629.06

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 16× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'phpapp_Option_Model' not found in wp-content/plugins/comment-translator/app/components/yandex_translate/pct_Yandex_Translate_Model.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pct_instance() in wp-content/plugins/comment-translator/app/components/pct_Yandex_Translate.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pct_instance() in wp-content/plugins/comment-translator/app/components/pct_Google_Translate.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/comment-translator/comment_translator.php:242
    • > PHP Fatal error
      Uncaught Error: Class 'phpapp_Model' not found in wp-content/plugins/comment-translator/vendors/phpapp_Option_Model.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/comment-translator/app/views/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/comment-translator/app/controllers/pct_Setting_Controller.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pct_instance() in wp-content/plugins/comment-translator/app/views/picker/dropdown.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/comment-translator/app/controllers/pct_Translate_Controller.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pct_instance() in wp-content/plugins/comment-translator/app/views/picker/link.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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:
  • Contributors: Plugin contributors field is missing
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === comment-translator === )
You can take inspiration from this readme.txt

comment-translator/comment_translator.php 92% from 13 tests

"Comment Translator" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
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 ("comment-translator.php" instead of "comment_translator.php")

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
Success! There were no dangerous files found in this plugin1,849 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP202151701,781
CSS210368

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.32
Average class complexity10.25
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity2.51
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods98
▷ Static methods1111.22%
▷ Public methods9495.92%
▷ Protected methods11.02%
▷ Private methods33.06%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png52.42KB25.64KB▼ 51.09%
assets/screenshot-2.png9.89KB5.50KB▼ 44.39%