72% tmy-globalization

Code Review | Translatio

WordPress plugin Translatio scored72%from 54 tests.

About plugin

  • Plugin page: tmy-globalization
  • Plugin version: 1.9.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Sep 13, 2022
  • Latest release: Dec 1, 2023
  • Number of updates: 84
  • Update frequency: every 5.3 days
  • Top authors: yushao (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /955 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.79MB] [CPU: ▼17.92ms] Passed 4 tests

A check of server-side resources used by Translatio
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.357.09 ▼35.19
Dashboard /wp-admin3.53 ▲0.1850.99 ▼10.69
Posts /wp-admin/edit.php3.66 ▲0.3152.22 ▲1.43
Add New Post /wp-admin/post-new.php3.66 ▼2.2368.99 ▼27.22
Media Library /wp-admin/upload.php3.46 ▲0.2341.77 ▲8.82
Diagnosis /wp-admin/admin.php?page=tmy-support-manager3.4036.78
Taxonomies /wp-admin/admin.php?page=tmy-g11n-taxonomy-menu3.5938.73
Setup /wp-admin/admin.php?page=tmy-g11n-setup-menu3.4942.63
Text /wp-admin/admin.php?page=tmy-g11n-text-menu3.4437.37
Dashboard /wp-admin/admin.php?page=tmy-g11n-dashboard-menu3.4232.66
Translations /wp-admin/edit.php?post_type=g11n_translation3.5240.41

Server storage [IO: ▲2.30MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Just a few items left to fix
  • You have illegally modified 1 file (0.78KB) outside of "wp-content/plugins/tmy-globalization/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 1,162 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_g11n_lang_wg
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Translatio
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,320 ▲54826.48 ▲12.0946.91 ▲45.0635.81 ▼8.41
Dashboard /wp-admin2,373 ▲19311.50 ▲5.88118.74 ▲29.0441.74 ▲4.38
Posts /wp-admin/edit.php2,318 ▲21810.25 ▲8.2380.65 ▲40.9035.20 ▼6.60
Add New Post /wp-admin/post-new.php3,015 ▲1,48911.71 ▼11.30217.16 ▼373.0467.91 ▲14.61
Media Library /wp-admin/upload.php1,602 ▲19913.00 ▲8.73148.21 ▲48.9645.33 ▼0.20
Diagnosis /wp-admin/admin.php?page=tmy-support-manager1,0589.9171.2539.82
Taxonomies /wp-admin/admin.php?page=tmy-g11n-taxonomy-menu1,2219.9665.2925.40
Setup /wp-admin/admin.php?page=tmy-g11n-setup-menu2,5999.9366.2531.31
Text /wp-admin/admin.php?page=tmy-g11n-text-menu1,2609.9267.6528.68
Dashboard /wp-admin/admin.php?page=tmy-g11n-dashboard-menu1,0239.8969.6526.45
Translations /wp-admin/edit.php?post_type=g11n_translation1,43210.2075.4233.23

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_g11n_lang_wg
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=tmy-support-manager
    • > User deprecated in wp-includes/functions.php+5737
    Function get_bloginfo was called with an argument that is deprecated since version 2.2.0! The text_direction option is deprecated for the family of bloginfo() functions. Use the is_rtl() function instead.
    • > GET request to /wp-admin/admin.php?page=tmy-support-manager
    • > Notice in wp-content/plugins/tmy-globalization/includes/class-tmy-g11n-translator.php+118
    Undefined variable: payload

SRP 0% 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
Almost there! Just fix the following items
  • 6× PHP files output text when accessed directly:
    • > /wp-content/plugins/tmy-globalization/admin/partials/tmy-g11n-admin-display.php
    • > /wp-content/plugins/tmy-globalization/public/partials/tmy-g11n-public-display.php
    • > /wp-content/plugins/tmy-globalization/trunk/admin/include/g11n-lang-list.php
    • > /wp-content/plugins/tmy-globalization/trunk/public/partials/tmy-g11n-public-display.php
    • > /wp-content/plugins/tmy-globalization/trunk/admin/partials/tmy-g11n-admin-display.php
    • > /wp-content/plugins/tmy-globalization/admin/include/g11n-lang-list.php
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/tmy-globalization/includes/class-tmy-g11n-widget.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/tmy-globalization/trunk/admin/include/class-tmy-g11n-table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/tmy-globalization/trunk/includes/class-tmy-g11n-widget.php:3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/tmy-globalization/admin/include/class-tmy-g11n-table.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/tmy-globalization/trunk/admin/include/class-tmy-g11n-table.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/tmy-globalization/admin/include/class-tmy-g11n-table.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/tmy-globalization/admin/include/class-tmy-g11n-table.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/tmy-globalization/trunk/admin/include/class-tmy-g11n-table.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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
5 plugin tags: localization, language, multilingual, woocommerce, translation

tmy-globalization/tmy-globalization.php 92% from 13 tests

Analyzing the main PHP file in "Translatio" version 1.9.4
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin7,289 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP191,6611,4256,890
SVG632196
PO File16583152
JavaScript375629
CSS23820
Markdown1002

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity48.86
▷ Minimum class complexity1.00
▷ Maximum class complexity226.00
Average method complexity4.51
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods296
▷ Static methods41.35%
▷ Public methods27291.89%
▷ Protected methods82.70%
▷ Private methods165.41%
Functions30
▷ Named functions2273.33%
▷ Anonymous functions826.67%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1056 compressed PNG files occupy 0.46MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/flags/32/NL.png0.12KB0.13KB0.00%
includes/flags/24/KA_GE.png0.13KB0.14KB0.00%
includes/flags/32/MG.png0.12KB0.12KB▼ 1.61%
trunk/includes/flags/24/MT.png0.23KB0.25KB0.00%
includes/flags/32/DK.png0.13KB0.12KB▼ 3.13%