78% woodpecker-click-to-translate

Code Review | Click to Translate - bilingual dictionary plugin for WordPress

WordPress plugin Click to Translate - bilingual dictionary plugin for WordPress scored78%from 54 tests.

About plugin

  • Plugin page: woodpecker-click-...
  • Plugin version: 2.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.0.2
  • WordPress version: 6.3.1
  • First release: Nov 30, 2018
  • Latest release: Oct 4, 2022
  • Number of updates: 71
  • Update frequency: every 20.1 days
  • Top authors: wltravis (59.15%)gijsslijpen (42.25%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,953 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼1.64ms] Passed 4 tests

Server-side resources used by Click to Translate - bilingual dictionary plugin for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1443.93 ▼1.72
Dashboard /wp-admin3.51 ▲0.2052.80 ▲0.20
Posts /wp-admin/edit.php3.56 ▲0.2055.07 ▲0.20
Add New Post /wp-admin/post-new.php6.03 ▲0.14101.38 ▼3.55
Media Library /wp-admin/upload.php3.37 ▲0.1434.06 ▼1.50

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
wlClickToTranslateOptionKeyV1.0
widget_wlbutton_widget
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Click to Translate - bilingual dictionary plugin for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲4114.26 ▲0.781.92 ▼3.1444.00 ▲1.88
Dashboard /wp-admin2,218 ▲274.80 ▼1.10107.88 ▲4.0444.25 ▲0.89
Posts /wp-admin/edit.php2,101 ▲92.01 ▲0.0440.34 ▼3.7736.07 ▼0.13
Add New Post /wp-admin/post-new.php6,248 ▲4,73418.78 ▲1.09891.97 ▲266.7255.27 ▲3.63
Media Library /wp-admin/upload.php1,394 ▲94.22 ▲0.0295.35 ▼4.9341.72 ▼2.78

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-posts
    • theysaidso_admin_options
    • wlClickToTranslateOptionKeyV1.0
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_wlbutton_widget
    • widget_recent-comments
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/woodpecker-click-to-translate/view/meta-box-disable-in-single.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/woodpecker-click-to-translate/widget/widget.php:7
    • > PHP Notice
      Undefined variable: disabled in wp-content/plugins/woodpecker-click-to-translate/view/meta-box-disable-in-single.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/woodpecker-click-to-translate/view/index.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WLClickToTranslate\\plugin_basename() in wp-content/plugins/woodpecker-click-to-translate/wl_click_to_translate.php:18

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, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (The button that appears on a blog page.), #2 (The pop-up button with the translation.), #3 (The place to fill in your access key created on [the access tokens page](https://translate.woodpeckerlearning.com/dashboard/accessToken, "Access Tokens").)
The official readme.txt might help

woodpecker-click-to-translate/wl_click_to_translate.php 85% from 13 tests

The principal PHP file in "Click to Translate - bilingual dictionary plugin for WordPress" v. 2.1.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woodpecker-click-to-translate.php" instead of "wl_click_to_translate.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected750 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP1213251726
PO File14021
CSS1001
JavaScript1011
Markdown1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity6.70
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.68
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods84
▷ Static methods67.14%
▷ Public methods7690.48%
▷ Protected methods00.00%
▷ Private methods89.52%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
3 PNG files occupy 0.42MB with 0.29MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png259.57KB71.11KB▼ 72.60%
screenshot-3.png60.74KB18.25KB▼ 69.96%
screenshot-1.png106.84KB33.94KB▼ 68.24%