62% transifex-wp-translation

Code Review | Transifex WP Translation

WordPress plugin Transifex WP Translation scored62%from 54 tests.

About plugin

  • Plugin page: transifex-wp-tran...
  • Plugin version: 0.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.1.1
  • WordPress version: 6.3.1
  • First release: Mar 23, 2015
  • Latest release: Apr 5, 2015
  • Number of updates: 16
  • Update frequency: every 1.0 days
  • Top authors: brooksX (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,888 total downloads

Benchmarks

Plugin footprint 65% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.59MB] [CPU: ▼47.55ms] Passed 4 tests

Server-side resources used by Transifex WP Translation
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.41 ▼1.069.78 ▼30.84
Dashboard /wp-admin2.42 ▼0.8813.98 ▼38.75
Posts /wp-admin/edit.php2.43 ▼0.9413.17 ▼35.83
Add New Post /wp-admin/post-new.php2.42 ▼3.4713.80 ▼84.79
Media Library /wp-admin/upload.php2.42 ▼0.8113.03 ▼22.95
Switcher /wp-admin/admin.php?page=txwt-plugin_switcher2.4211.90
Transifex /wp-admin/admin.php?page=txwt-plugin2.4215.09

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 275 new files
Database: no new tables, 7 new options
New WordPress options
widget_txwt_multilingual_ls
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Transifex WP Translation
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,995 ▲23414.22 ▼0.3723.71 ▲22.2136.54 ▼3.58
Dashboard /wp-admin2,221 ▲415.55 ▼0.0786.24 ▼4.1760.46 ▲18.58
Posts /wp-admin/edit.php2,126 ▲231.97 ▲0.0135.36 ▼7.8035.27 ▼3.40
Add New Post /wp-admin/post-new.php1,701 ▲17221.97 ▼1.49676.31 ▲75.0659.40 ▲6.21
Media Library /wp-admin/upload.php1,423 ▲204.27 ▲0.07101.41 ▼6.5370.71 ▲22.40
Switcher /wp-admin/admin.php?page=txwt-plugin_switcher2,8754.74148.1245.58
Transifex /wp-admin/admin.php?page=txwt-plugin1,2893.2072.9832.70

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Switcher_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_txwt_multilingual_ls
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=txwt-plugin
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Switcher_Widget is deprecated since version 4.3.0! Use __construct() instead.

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/transifex-wp-translation/classes/class.txwt-lang-switcher.php
    • > /wp-content/plugins/transifex-wp-translation/classes/class.txwt-switcher-widgets.php
    • > /wp-content/plugins/transifex-wp-translation/views/txwt-settings/page-settings-section-headers.php
  • 19× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/transifex-wp-translation/transifex-wp-translation.php:37
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/transifex-wp-translation/views/stgs-page.php on line 1
    • > PHP Notice
      Undefined variable: section in wp-content/plugins/transifex-wp-translation/views/txwt-settings/page-settings-section-headers.php on line 17
    • > PHP Warning
      Use of undefined constant TXWT_REQUIRED_WP_VERSION - assumed 'TXWT_REQUIRED_WP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/transifex-wp-translation/views/requirements-error.php on line 11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/transifex-wp-translation/views/txwt-settings/page-settings-section-headers.php on line 9
    • > PHP Notice
      Undefined variable: section in wp-content/plugins/transifex-wp-translation/views/txwt-settings/page-settings-section-headers.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/transifex-wp-translation/views/requirements-error.php:12
    • > PHP Warning
      Use of undefined constant TXWT_NAME - assumed 'TXWT_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/transifex-wp-translation/views/requirements-error.php on line 2
    • > PHP Warning
      Use of undefined constant TXWT_REQUIRED_PHP_VERSION - assumed 'TXWT_REQUIRED_PHP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/transifex-wp-translation/views/requirements-error.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/transifex-wp-translation/views/txwt-settings/page-settings-section-headers.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: transifex live, translation, localization, transifex, internationalization

transifex-wp-translation/transifex-wp-translation.php 92% from 13 tests

The principal PHP file in "Transifex WP Translation" v. 0.3.2 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin2,261 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP103072411,576
CSS26712352
JavaScript35625224
PO File14954109

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity36.00
▷ Minimum class complexity5.00
▷ Maximum class complexity55.00
Average method complexity3.59
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods54
▷ Static methods712.96%
▷ Public methods5398.15%
▷ Protected methods11.85%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
255 compressed PNG files occupy 0.13MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/flags/mx.png0.56KB0.71KB0.00%
images/flags/mo.png0.57KB0.71KB0.00%
images/flags/ph.png0.53KB0.71KB0.00%
images/flags/ke.png0.56KB0.69KB0.00%
images/flags/eo.png0.22KB0.16KB▼ 25.66%