84% translation-detector

Code Review | Translation Detector

WordPress plugin Translation Detector scored84%from 54 tests.

About plugin

  • Plugin page: translation-detector
  • Plugin version: 1.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.5
  • WordPress version: 6.3.1
  • First release: Jan 28, 2015
  • Latest release: Apr 11, 2016
  • Number of updates: 53
  • Update frequency: every 8.4 days
  • Top authors: guillaume.diard (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active /3,423 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.33ms] Passed 4 tests

Server-side resources used by Translation Detector
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.39 ▼0.74
Dashboard /wp-admin3.32 ▲0.0260.27 ▲7.32
Posts /wp-admin/edit.php3.38 ▲0.0252.19 ▼5.72
Add New Post /wp-admin/post-new.php5.92 ▲0.0486.65 ▼14.73
Media Library /wp-admin/upload.php3.25 ▲0.0242.71 ▲3.86
Translation detector /wp-admin/options-general.php?page=translation_detector3.2229.07

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Translation Detector: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5113.17 ▼1.183.74 ▲1.9640.20 ▼5.86
Dashboard /wp-admin2,221 ▲475.81 ▲0.2496.69 ▲6.8641.69 ▼5.07
Posts /wp-admin/edit.php2,125 ▲252.28 ▲0.3336.79 ▼2.4730.50 ▼4.97
Add New Post /wp-admin/post-new.php1,543 ▲1523.28 ▲0.03688.88 ▼0.2636.78 ▼14.98
Media Library /wp-admin/upload.php1,423 ▲234.49 ▲0.34109.08 ▲4.0447.22 ▲1.75
Translation detector /wp-admin/options-general.php?page=translation_detector1,2402.4159.0828.95

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/translation-detector/translation-detector-admin.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/translation-detector/translation-detector-functions.php:26

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 on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
10 plugin tags: developper, language, polylang, post, lang...

translation-detector/translation-detector.php 92% from 13 tests

This is the main PHP file of "Translation Detector" version 1.3.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin360 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP43652330
SVG10125
JavaScript1005

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin