67% svg-flags-lite

Code Review | SVG Flags - Beautiful Scalable Flags For All Countries!

WordPress plugin SVG Flags - Beautiful Scalable Flags For All Countries! scored67%from 54 tests.

About plugin

  • Plugin page: svg-flags-lite
  • Plugin version: 0.9.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.2
  • WordPress version: 6.3.1
  • First release: Oct 22, 2017
  • Latest release: Mar 22, 2022
  • Number of updates: 47
  • Update frequency: every 34.3 days
  • Top authors: dgwyer (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

3,000+ active /24,641 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼5.87MB] [CPU: ▼2,126,340.18ms] Passed 4 tests

This is a short check of server-side resources used by SVG Flags - Beautiful Scalable Flags For All Countries!
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /8.47 ▼36.3171.20 ▼8,505,401.70
Dashboard /wp-admin44.79 ▲41.448,516,520.11 ▲8,516,467.22
Posts /wp-admin/edit.php8.49 ▲5.0976.30 ▲26.09
Add New Post /wp-admin/post-new.php8.49 ▲2.5579.73 ▼20.80
Media Library /wp-admin/upload.php8.49 ▲5.2173.13 ▲35.70
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.4959.67
SVG Flags /wp-admin/options-general.php?page=svg-flags-wpgoplugins8.4970.94
About /wp-admin/admin.php?page=svg-flags-wpgoplugins-welcome8.4959.71
New Features /wp-admin/admin.php?page=svg-flags-wpgoplugins-new-features8.4968.21

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 781 new files
Database: no new tables, 12 new options
New WordPress options
svg-flags-lite_options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
fs_gdpr
fs_active_plugins
svg-flags-lite-new-features-numbered-icon
...

Browser metrics Passed 4 tests

A check of browser resources used by SVG Flags - Beautiful Scalable Flags For All Countries!
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7314.72 ▲0.141.80 ▲0.1230.14 ▼13.80
Dashboard /wp-admin2,213 ▲365.64 ▲0.0588.08 ▼4.3744.37 ▲4.45
Posts /wp-admin/edit.php2,125 ▲281.99 ▲0.0336.99 ▲1.5735.91 ▼0.85
Add New Post /wp-admin/post-new.php6,201 ▲4,66426.28 ▲8.14902.80 ▲257.2862.94 ▼11.11
Media Library /wp-admin/upload.php1,421 ▲214.19 ▲0.05100.56 ▼2.0445.15 ▲1.37
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0611.6623.8728.48
SVG Flags /wp-admin/options-general.php?page=svg-flags-wpgoplugins1,2332.0829.0346.93
About /wp-admin/admin.php?page=svg-flags-wpgoplugins-welcome1,1361.8826.6463.56
New Features /wp-admin/admin.php?page=svg-flags-wpgoplugins-new-features1,4131.8928.6364.92

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/svg-flags-lite/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 12 options in the database
    • svg-flags-lite_options
    • fs_accounts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • fs_active_plugins
    • widget_recent-comments
    • svg-flags-lite-new-features-numbered-icon
    • fs_debug_mode
    • fs_gdpr
    • ...

Smoke tests 50% 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
  • 46 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=svg-flags-wpgoplugins-new-features
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 46 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=svg-flags-wpgoplugins-new-features
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 27 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=svg-flags-wpgoplugins-new-features
    • > Notice in wp-content/plugins/svg-flags-lite/api/templates/settings/new-features.php+79
    Undefined property: stdClass::$license

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=svg-flags-wpgoplugins-new-features
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: svg_flags_admin_menu_data is not defined" "ReferenceError: svg_flags_admin_menu_data is not defined\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/svg-flags-lite/assets/js/admin-settings.js?ver=1599470936:6:67)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=svg-flags-wpgoplugins-new-features
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught ReferenceError: svg_flags_admin_menu_data is not defined

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: flag, world, scalable, svg, country

svg-flags-lite/svg-flags.php 85% from 13 tests

The main PHP file in "SVG Flags - Beautiful Scalable Flags For All Countries!" ver. 0.9.6 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("svg-flags-lite.php" instead of "svg-flags.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin71,411 lines of code in 694 files:
LanguageFilesBlank linesComment linesLines of code
SVG5140035,062
PHP1307,61916,64732,247
CSS19431,731
JavaScript9351497791
HTML140500
LESS6180443
Sass431295
JSON600186
Markdown131073
CoffeeScript18036
Bourne Shell110025
YAML22022

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity63.84
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes67
▷ Abstract classes22.99%
▷ Concrete classes6597.01%
▷ Final classes00.00%
Methods1,205
▷ Static methods18315.19%
▷ Public methods86271.54%
▷ Protected methods181.49%
▷ Private methods32526.97%
Functions94
▷ Named functions94100.00%
▷ Anonymous functions00.00%
Constants124
▷ Global constants9979.84%
▷ Class constants2520.16%
▷ Public constants25100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
41 PNG files occupy 0.99MB with 0.59MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/svg-flag-image-shortcode-test.png18.98KB7.61KB▼ 59.92%
assets/images/flexible-faq-thumb.png39.81KB14.48KB▼ 63.62%
assets/images/new-features/new-features-pro-6.png35.82KB13.40KB▼ 62.58%
api/assets/images/seo-media-manager-thumb.png10.15KB4.63KB▼ 54.41%
assets/images/svg-flag-shortcode-test.png18.48KB7.63KB▼ 58.72%