10% country-flags-info-widget

Code Review | Country Flags Info Widget

WordPress plugin Country Flags Info Widget scored10%from 54 tests.

About plugin

  • Plugin page: country-flags-inf...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2.2
  • WordPress version: 6.3.1
  • First release: Jun 13, 2015
  • Latest release: Jun 13, 2015
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: sierramike (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,964 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/country-flags-info-widget/country-flags-info-widget.php+453
    Function create_function() is deprecated

Server metrics [RAM: ▼1.58MB] [CPU: ▼52.21ms] Passed 4 tests

Server-side resources used by Country Flags Info Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.41 ▼1.055.73 ▼31.19
Dashboard /wp-admin2.43 ▼0.915.79 ▼53.50
Posts /wp-admin/edit.php2.43 ▼0.927.85 ▼37.00
Add New Post /wp-admin/post-new.php2.43 ▼3.456.39 ▼87.14
Media Library /wp-admin/upload.php2.43 ▼0.807.17 ▼28.32

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 248 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_countryflags
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Country Flags Info Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.23 ▼0.321.77 ▲0.2546.18 ▲7.15
Dashboard /wp-admin2,197 ▲205.56 ▼0.0585.99 ▼0.3838.38 ▼6.90
Posts /wp-admin/edit.php2,102 ▼12.01 ▲0.0234.20 ▲0.3033.47 ▼3.12
Add New Post /wp-admin/post-new.php1,528 ▲223.26 ▲0.17665.99 ▲21.9253.57 ▲0.06
Media Library /wp-admin/upload.php1,405 ▲114.20 ▲0.0199.05 ▼1.5145.76 ▲0.73

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
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/country-flags-info-widget/country-flags-info-widget.php+453
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_countryflags
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/country-flags-info-widget/country-flags-info-widget.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: flags, countries, widget, country

country-flags-info-widget/country-flags-info-widget.php Passed 13 tests

The principal PHP file in "Country Flags Info Widget" v. 1.0.0 is loaded by WordPress automatically on each request
99 characters long description:
Enables a widget in which you can display a list of country with flags, names and misc information.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin602 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP12812414
CSS25197
JavaScript117191

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 252)
Cyclomatic complexity
Average complexity per logical line of code0.74
Average class complexity278.00
▷ Minimum class complexity278.00
▷ Maximum class complexity278.00
Average method complexity56.40
▷ Minimum method complexity1.00
▷ Maximum method complexity252.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
243 PNG files occupy 0.20MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
flags/VU.png1.24KB1.24KB0.16%
flags/NR.png0.41KB0.30KB▼ 25.54%
flags/GG.png0.24KB0.19KB▼ 23.20%
flags/CR.png0.18KB0.13KB▼ 26.09%
flags/JM.png0.60KB0.50KB▼ 16.50%