78% text-domain-inspector

Code Review | Text Domain Inspector

WordPress plugin Text Domain Inspector scored78%from 54 tests.

About plugin

  • Plugin page: text-domain-inspe...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 12, 2018
  • Latest release: Jul 2, 2023
  • Number of updates: 6
  • Update frequency: every 302.7 days
  • Top authors: laugei (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active /1,948 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.65MB] [CPU: ▼0.73ms] Passed 4 tests

A check of server-side resources used by Text Domain Inspector
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.13 ▲0.6741.74 ▲2.51
Dashboard /wp-admin4.00 ▲0.6955.29 ▲2.17
Posts /wp-admin/edit.php4.05 ▲0.6956.82 ▲8.23
Add New Post /wp-admin/post-new.php6.52 ▲0.6390.29 ▼12.08
Media Library /wp-admin/upload.php3.86 ▲0.6342.26 ▲4.48

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

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

Browser metrics Passed 4 tests

Text Domain Inspector: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6913.28 ▼1.031.59 ▼0.3538.29 ▼9.45
Dashboard /wp-admin2,218 ▲304.91 ▼0.99106.56 ▲3.1539.44 ▼4.83
Posts /wp-admin/edit.php2,095 ▲62.04 ▼0.0137.00 ▼1.3434.38 ▼0.97
Add New Post /wp-admin/post-new.php1,541 ▲2722.98 ▲5.46655.33 ▼22.3851.59 ▼5.72
Media Library /wp-admin/upload.php1,397 ▲64.41 ▲0.24110.33 ▼31.1546.69 ▼5.80

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/text-domain-inspector/html5lib-php/maintenance/scrape-ncr.php
    • > /wp-content/plugins/text-domain-inspector/tests/bootstrap.php
  • 27× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      require_once(simpletest/autorun.php): failed to open stream: No such file or directory in wp-content/plugins/text-domain-inspector/html5lib-php/tests/autorun.php on line 89
    • > PHP Fatal error
      require_once(): Failed opening required 'simpletest/autorun.php' (include_path='.:/usr/share/php:wp-content/plugins/text-domain-inspector/html5lib-php/tests:/var/www/wordpress/wp-content/plugins/text-domain-inspector/html5lib-php/tests/../library') in /var/www/wordpress/wp-content/plugins/text-domain-inspector/html5lib-php/tests/autorun.php on line 89
    • > PHP Warning
      require_once(simpletest/autorun.php): failed to open stream: No such file or directory in wp-content/plugins/text-domain-inspector/html5lib-php/tests/autorun.php on line 89
    • > PHP Fatal error
      Uncaught Error: Class 'SimpleTest' not found in wp-content/plugins/text-domain-inspector/html5lib-php/tests/HTML5/TestDataHarness.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'HTML5_Tokenizer' not found in wp-content/plugins/text-domain-inspector/html5lib-php/tests/HTML5/TestableTokenizer.php:3
    • > PHP Warning
      require_once(simpletest/autorun.php): failed to open stream: No such file or directory in wp-content/plugins/text-domain-inspector/html5lib-php/tests/autorun.php on line 89
    • > PHP Fatal error
      require_once(): Failed opening required 'simpletest/autorun.php' (include_path='.:/usr/share/php:wp-content/plugins/text-domain-inspector/html5lib-php/tests:/var/www/wordpress/wp-content/plugins/text-domain-inspector/html5lib-php/tests/../library') in /var/www/wordpress/wp-content/plugins/text-domain-inspector/html5lib-php/tests/autorun.php on line 89
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/text-domain-inspector/text-domain-inspector.php on line 12
    • > PHP Fatal error
      require_once(): Failed opening required 'simpletest/autorun.php' (include_path='.:/usr/share/php:wp-content/plugins/text-domain-inspector/html5lib-php/tests:/var/www/wordpress/wp-content/plugins/text-domain-inspector/html5lib-php/tests/../library') in /var/www/wordpress/wp-content/plugins/text-domain-inspector/html5lib-php/tests/autorun.php on line 89
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/pluggable.php' (include_path='.:/usr/share/php') in wp-content/plugins/text-domain-inspector/text-domain-inspector.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: inspector, domain, text, translation, text-domain

text-domain-inspector/text-domain-inspector.php Passed 13 tests

"Text Domain Inspector" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
66 characters long description:
This plugin allows to inspect text domains of translatable strings

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin5,062 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP271,0312,2604,833
Bourne Shell12111120
HTML60069
XML24226
JSON30014

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 639)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity51.17
▷ Minimum class complexity1.00
▷ Maximum class complexity748.00
Average method complexity9.16
▷ Minimum method complexity1.00
▷ Maximum method complexity639.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes24
▷ Abstract classes416.67%
▷ Concrete classes2083.33%
▷ Final classes00.00%
Methods154
▷ Static methods127.79%
▷ Public methods11373.38%
▷ Protected methods1711.04%
▷ Private methods2415.58%
Functions14
▷ Named functions964.29%
▷ Anonymous functions535.71%
Constants61
▷ Global constants00.00%
▷ Class constants61100.00%
▷ Public constants61100.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
No PNG images were found in this plugin