10% wp-translations-badges

Code Review | WP-Translations Badges

WordPress plugin WP-Translations Badges scored10%from 54 tests.

About plugin

  • Plugin page: wp-translations-b...
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6.1
  • WordPress version: 6.3.1
  • First release: May 8, 2014
  • Latest release: Sep 8, 2016
  • Number of updates: 31
  • Update frequency: every 27.6 days
  • Top authors: boddhi (80.65%)wptranslationsteam (12.9%)fxbenard (12.9%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,967 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/wp-translations-badges/includes/widget-wp_translations_badge.php+310
    Function create_function() is deprecated

Server metrics [RAM: ▼1.72MB] [CPU: ▼53.65ms] Passed 4 tests

Analyzing server-side resources used by WP-Translations Badges
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.27 ▼1.207.41 ▼33.84
Dashboard /wp-admin2.29 ▼1.027.48 ▼44.39
Posts /wp-admin/edit.php2.29 ▼1.077.27 ▼47.53
Add New Post /wp-admin/post-new.php2.29 ▼3.607.61 ▼88.84
Media Library /wp-admin/upload.php2.29 ▼0.947.09 ▼30.52

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

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • Illegal file modification found: 1 file (0.00KB) outside of "wp-content/plugins/wp-translations-badges/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/wp-translations-badges/assets/icon-256\303\227256.png"
Filesystem: 36 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_wp_translations_badge-id
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by WP-Translations Badges
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.38 ▼0.221.79 ▼0.1645.85 ▼1.38
Dashboard /wp-admin2,195 ▲215.63 ▼0.0593.31 ▼8.2245.18 ▲1.03
Posts /wp-admin/edit.php2,103 ▲61.99 ▼0.0134.97 ▼4.3834.30 ▼0.04
Add New Post /wp-admin/post-new.php1,586 ▲6023.40 ▲0.19672.59 ▼6.7149.50 ▼1.13
Media Library /wp-admin/upload.php1,403 ▲34.29 ▲0.0399.32 ▼14.5444.88 ▼4.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/wp-translations-badges/includes/widget-wp_translations_badge.php+310
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_wp_translations_badge-id
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-translations-badges/includes/field-dropdown.php
    • > /wp-content/plugins/wp-translations-badges/includes/element-wp_translations_badge.php
  • 25× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: value in wp-content/plugins/wp-translations-badges/includes/field-dropdown.php on line 32
    • > PHP Notice
      Undefined variable: groupid in wp-content/plugins/wp-translations-badges/includes/field-username.php on line 14
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-translations-badges/includes/field-dropdown.php on line 21
    • > PHP Notice
      Undefined variable: value in wp-content/plugins/wp-translations-badges/includes/field-dropdown.php on line 21
    • > PHP Notice
      Undefined variable: name in wp-content/plugins/wp-translations-badges/includes/field-username.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-translations-badges/configs/wp_translations_badge-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-translations-badges/includes/field-onoff.php:3
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/wp-translations-badges/includes/element-wp_translations_badge.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-translations-badges/includes/field-dropdown.php on line 25
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/wp-translations-badges/includes/field-dropdown.php on line 21

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: i18n, badges, widget, wp-translations, wpt...

wp-translations-badges/plugincore.php 92% from 13 tests

Analyzing the main PHP file in "WP-Translations Badges" version 1.0.9
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-translations-badges.php" instead of "plugincore.php")

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
There were no executable files found in this plugin1,640 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP10198362918
CSS3218547
JavaScript32110175

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity73.00
▷ Minimum class complexity41.00
▷ Maximum class complexity105.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods36
▷ Static methods1130.56%
▷ Public methods3288.89%
▷ Protected methods00.00%
▷ Private methods411.11%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 compressed PNG files occupy 0.14MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/wp_t_badge_donator.png5.46KB5.62KB0.00%
assets/images/wp_t_badge_supporter.png5.45KB5.60KB0.00%
assets/images/icon.png1.54KB0.77KB▼ 50.41%
assets/images/wp_t_badge_translator.png5.61KB5.75KB0.00%
assets/images/wp_t_badge_developer.png5.53KB5.67KB0.00%