84% world-flag

Code Review | World Flag

WordPress plugin World Flag scored84%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: 6.3.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

100+ active /4,420 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼0.78ms] Passed 4 tests

Analyzing server-side resources used by World Flag
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.76 ▲0.81
Dashboard /wp-admin3.36 ▲0.0159.99 ▼1.46
Posts /wp-admin/edit.php3.41 ▲0.0544.54 ▲2.75
Add New Post /wp-admin/post-new.php6.23 ▲0.3486.31 ▼2.48
Media Library /wp-admin/upload.php3.28 ▲0.0536.31 ▲0.01

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for World Flag
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲4514.35 ▼0.021.87 ▲0.2241.71 ▼2.26
Dashboard /wp-admin2,195 ▲145.65 ▼0.0385.27 ▼13.3342.23 ▼0.67
Posts /wp-admin/edit.php2,100 ▲32.00 ▼0.0136.84 ▲2.3535.74 ▼2.57
Add New Post /wp-admin/post-new.php1,528 ▲223.41 ▼0.31684.80 ▲7.4854.83 ▲2.30
Media Library /wp-admin/upload.php1,397 ▼34.21 ▼0.03108.51 ▼2.8547.60 ▲0.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 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
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === world-flag === )
The official readme.txt is a good inspiration

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 considered dangerous and should not be included with any WordPress plugin
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

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
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

PNG files should be compressed to save space and minimize bandwidth usage
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%