84% admin-bar-languages

Code Review | Admin bar languages

WordPress plugin Admin bar languages scored84%from 54 tests.

About plugin

  • Plugin page: admin-bar-languages
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.8.3
  • WordPress version: 6.3.1
  • First release: Sep 12, 2014
  • Latest release: Nov 10, 2017
  • Number of updates: 8
  • Update frequency: every 144.4 days
  • Top authors: simison (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /3,288 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▼2.36ms] Passed 4 tests

An overview of server-side resources used by Admin bar languages
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3344.11 ▼1.67
Dashboard /wp-admin3.58 ▲0.2854.34 ▲1.14
Posts /wp-admin/edit.php3.65 ▲0.2949.14 ▼6.07
Add New Post /wp-admin/post-new.php5.98 ▲0.1088.47 ▼2.82
Media Library /wp-admin/upload.php3.59 ▲0.3641.89 ▲4.85

Server storage [IO: ▲0.12MB] [DB: ▲0.05MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 247 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Admin bar languages
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲3114.82 ▲0.381.88 ▼0.2846.43 ▲1.42
Dashboard /wp-admin2,208 ▲204.87 ▼1.03111.67 ▼3.1044.09 ▲0.92
Posts /wp-admin/edit.php2,091 ▲21.99 ▲0.0237.17 ▼1.5039.28 ▲5.87
Add New Post /wp-admin/post-new.php1,516 ▲217.83 ▲0.29656.04 ▼27.3356.28 ▲1.51
Media Library /wp-admin/upload.php1,393 ▲84.13 ▼0.11102.43 ▲3.4945.62 ▼2.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • 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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/admin-bar-languages/admin-bar-languages.php

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 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (17 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

admin-bar-languages/admin-bar-languages.php Passed 13 tests

"Admin bar languages" version 1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
67 characters long description:
Show flags for languages at "My sites" list in WordPress admin bar.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected94 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2304451
Markdown115024
CSS14219

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.70
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
242 compressed PNG files occupy 0.11MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
flags/VE.png0.55KB0.54KB▼ 3.00%
flags/PH.png0.61KB0.67KB0.00%
flags/AW.png0.33KB0.32KB▼ 2.64%
flags/TD.png0.13KB0.12KB▼ 7.81%
flags/SB.png0.37KB0.35KB▼ 5.74%