94% world-flag

Code Review | World Flag

WordPress plugin World Flag scored 94% from 54 tests.

About plugin

  • Plugin page: world-flag
  • Plugin version: 2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9.2-3.9
  • WordPress version: 5.8.1
  • First release: Mar 19, 2013
  • Latest release: Jun 27, 2014
  • Number of updates: 17
  • Update frequency: every 27.4 days
  • Top authors: ssovit (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active / 4,178 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼180.75ms] Passed 4 tests

Server-side resources used by World Flag
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.0525.00 ▲1.77
Dashboard /wp-admin3.11 ▲0.0531.42 ▼9.90
Posts /wp-admin/edit.php3.16 ▲0.0529.59 ▼3.42
Add New Post /wp-admin/post-new.php5.52 ▲0.0871.83 ▼710.03
Media Library /wp-admin/upload.php3.05 ▲0.0523.63 ▲0.36

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by World Flag
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,668 ▲6715.95 ▼0.085.36 ▼0.2580.16 ▲2.15
Dashboard /wp-admin2,930 ▲346.12 ▼0.07114.33 ▼14.05169.05 ▲3.90
Posts /wp-admin/edit.php2,737 ▼33.25 ▲0.0165.39 ▼3.30135.44 ▼10.38
Add New Post /wp-admin/post-new.php3,708 ▼2219.35 ▲4.05424.52 ▼4.88157.97 ▼18.04
Media Library /wp-admin/upload.php1,752 ▼35.56 ▲0.01139.75 ▼9.79187.47 ▲1.18

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

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
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/world-flag/world-flag.php:37
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/world-flag/assets/tinymce/dialog.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === world-flag === )
Please take inspiration from this readme.txt

world-flag/world-flag.php Passed 13 tests

The main PHP script in "World Flag" version 2.5 is automatically included on every request by WordPress
44 characters long description:
Add any World's Country flag to post or page

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
There were no executable files found in this plugin752 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP3925427
CSS110253
JavaScript26772

PHP code Passed 2 tests

An short overview of 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.12
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.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

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/tinymce/icon.png1.34KB1.37KB0.00%
assets/flags.png76.98KB25.70KB▼ 66.61%