84% language-icons-flags-switcher

Code Review | Flag Icons

WordPress plugin Flag Icons scored84%from 54 tests.

About plugin

  • Plugin page: language-icons-fl...
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.8.9
  • WordPress version: 6.3.1
  • First release: Jul 8, 2013
  • Latest release: Apr 10, 2022
  • Number of updates: 81
  • Update frequency: every 39.5 days
  • Top authors: havengr (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

5,000+ active /58,919 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Flag Icons
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3666.39 ▲19.68
Dashboard /wp-admin3.66 ▲0.3548.98 ▲0.53
Posts /wp-admin/edit.php3.71 ▲0.3553.31 ▼0.51
Add New Post /wp-admin/post-new.php6.24 ▲0.3588.06 ▼10.24
Media Library /wp-admin/upload.php3.58 ▲0.3537.71 ▲7.28
Flag Icons /wp-admin/options-general.php?page=my_plugin_menu_flags3.6189.68

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Flag Icons
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲4114.28 ▼0.282.01 ▲0.1936.30 ▼7.76
Dashboard /wp-admin2,201 ▲245.65 ▲0.0286.02 ▼2.1636.30 ▼6.04
Posts /wp-admin/edit.php2,103 ▼02.02 ▲0.0436.93 ▼4.2530.97 ▼5.01
Add New Post /wp-admin/post-new.php1,545 ▲1123.06 ▲0.34665.30 ▲48.4553.72 ▼5.68
Media Library /wp-admin/upload.php1,406 ▲34.21 ▲0.02101.70 ▲3.8944.53 ▲1.01
Flag Icons /wp-admin/options-general.php?page=my_plugin_menu_flags2,3862.0327.06166.32

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please fix the following items
  • 93× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: opt90 in wp-content/plugins/language-icons-flags-switcher/result.php on line 107
    • > PHP Notice
      Undefined variable: opt59 in wp-content/plugins/language-icons-flags-switcher/result.php on line 107
    • > PHP Notice
      Undefined variable: opt72 in wp-content/plugins/language-icons-flags-switcher/result.php on line 107
    • > PHP Notice
      Undefined variable: opt83 in wp-content/plugins/language-icons-flags-switcher/result.php on line 107
    • > PHP Notice
      Undefined variable: opt88 in wp-content/plugins/language-icons-flags-switcher/result.php on line 107
    • > PHP Notice
      Undefined variable: opt12 in wp-content/plugins/language-icons-flags-switcher/result.php on line 107
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/language-icons-flags-switcher/settingsmenu.php:7
    • > PHP Notice
      Undefined variable: opt29 in wp-content/plugins/language-icons-flags-switcher/result.php on line 107
    • > PHP Notice
      Undefined variable: opt5 in wp-content/plugins/language-icons-flags-switcher/result.php on line 107
    • > PHP Notice
      Undefined variable: opt62 in wp-content/plugins/language-icons-flags-switcher/result.php on line 107

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Donate link: Please fix this invalid URI: ""
You can take inspiration from this readme.txt

language-icons-flags-switcher/functionsfile.php 92% from 13 tests

This is the main PHP file of "Flag Icons" version 2.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("language-icons-flags-switcher.php" instead of "functionsfile.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin340 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP327429327
CSS114013

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
92 compressed PNG files occupy 0.07MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/Cambodia.png0.39KB0.40KB0.00%
img/Mexico.png0.26KB0.26KB0.00%
img/hungary.png0.73KB1.16KB0.00%
img/Luxembourg.png0.11KB0.12KB0.00%
img/czech.png0.83KB1.40KB0.00%