84% wpdeepl

Code Review | DeepL API translation plugin

WordPress plugin DeepL API translation plugin scored84%from 54 tests.

About plugin

  • Plugin page: wpdeepl
  • Plugin version: 2.4.1.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 27, 2018
  • Latest release: Dec 1, 2023
  • Number of updates: 169
  • Update frequency: every 12.3 days
  • Top authors: Malaiac (100%)

Code review

54 tests

User reviews

26 reviews

Install metrics

4,000+ active /82,490 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
Install script ran successfully

Server metrics [RAM: ▲0.56MB] [CPU: ▼2.11ms] Passed 4 tests

Analyzing server-side resources used by DeepL API translation plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0136.69 ▼6.68
Dashboard /wp-admin4.06 ▲0.7553.71 ▲1.69
Posts /wp-admin/edit.php4.11 ▲0.7552.55 ▲2.83
Add New Post /wp-admin/post-new.php6.66 ▲0.7795.99 ▼6.29
Media Library /wp-admin/upload.php3.98 ▲0.7441.41 ▲7.81
DeepL translation /wp-admin/options-general.php?page=deepl_settings3.8935.79

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 14 new options
New WordPress options
wpdeepl_metabox_post_types
wpdeepl_tpost_title
wpdeepl_tpost_content
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
deepl_plugin_installed
widget_theysaidso_widget
db_upgraded
...

Browser metrics Passed 4 tests

Checking browser requirements for DeepL API translation plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3214.67 ▲0.311.67 ▲0.0438.91 ▼4.90
Dashboard /wp-admin2,199 ▲245.62 ▼0.0494.09 ▼16.8542.88 ▼2.54
Posts /wp-admin/edit.php2,101 ▼22.06 ▲0.0941.05 ▲0.9836.73 ▲0.97
Add New Post /wp-admin/post-new.php6,227 ▲4,70126.11 ▲2.84817.16 ▲152.0758.27 ▲1.43
Media Library /wp-admin/upload.php1,407 ▲104.18 ▼0.0399.07 ▼0.9543.01 ▼1.09
DeepL translation /wp-admin/options-general.php?page=deepl_settings8971.6925.6228.38

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 14 options in the database
    • wpdeepl_metabox_context
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • deepl_plugin_installed
    • db_upgraded
    • wpdeepl_metabox_post_types
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • wpdeepl_tpost_title
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'DeepLApi' not found in wp-content/plugins/wpdeepl/client/deeplapi-translate.class.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpdeepl/modules/deepl-translate-post.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpdeepl/admin/deepl-admin-hooks.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DeepLApi' not found in wp-content/plugins/wpdeepl/client/deeplapi-usage.class.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DeepLData' not found in wp-content/plugins/wpdeepl/client/deeplapi.class.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wpdeepl/wpdeepl.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'DeepLApi' not found in wp-content/plugins/wpdeepl/client/deeplapi-glossary.class.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: translation, post

wpdeepl/wpdeepl.php 92% from 13 tests

"DeepL API translation plugin" version 2.4.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Requires at least: Required version does not match the one declared in readme.txt ("5.1" instead of "4.0.0")

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 plugin3,847 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP177987373,273
PO File1103167285
CSS1154148
SVG100121
JavaScript15019
Markdown1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity41.80
▷ Minimum class complexity5.00
▷ Maximum class complexity83.00
Average method complexity3.59
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes10
▷ Abstract classes220.00%
▷ Concrete classes880.00%
▷ Final classes00.00%
Methods159
▷ Static methods3119.50%
▷ Public methods14389.94%
▷ Protected methods159.43%
▷ Private methods10.63%
Functions39
▷ Named functions3692.31%
▷ Anonymous functions37.69%
Constants11
▷ Global constants1090.91%
▷ Class constants19.09%
▷ Public constants1100.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.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png2.96KB2.02KB▼ 31.94%
assets/screenshot-1.png25.78KB25.10KB▼ 2.63%
assets/icon-256x256.png4.13KB1.51KB▼ 63.47%