89% user-ip-and-location

Code Review | User IP and Location

WordPress plugin User IP and Location scored89%from 54 tests.

About plugin

  • Plugin page: user-ip-and-location
  • Plugin version: 3.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 7.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 24, 2020
  • Latest release: Jul 28, 2023
  • Number of updates: 20
  • Update frequency: every 67.7 days
  • Top authors: theguidex (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

2,000+ active /19,727 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
Installer ran successfully

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

This is a short check of server-side resources used by User IP and Location
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.45 ▼1.07
Dashboard /wp-admin3.36 ▲0.0245.69 ▼22.06
Posts /wp-admin/edit.php3.47 ▲0.1244.88 ▼0.28
Add New Post /wp-admin/post-new.php5.94 ▲0.0679.81 ▼12.55
Media Library /wp-admin/upload.php3.28 ▲0.0535.69 ▲2.01
User IP and Location /wp-admin/options-general.php?page=user-ip-and-location3.2529.89

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 266 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for User IP and Location
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲10014.36 ▼0.201.98 ▲0.2739.86 ▼3.43
Dashboard /wp-admin2,199 ▲195.51 ▼0.1180.60 ▼8.0538.23 ▲0.35
Posts /wp-admin/edit.php2,107 ▲72.01 ▼0.0239.10 ▲2.5735.11 ▼0.35
Add New Post /wp-admin/post-new.php1,529 ▲323.27 ▼0.40656.20 ▼44.6752.21 ▼6.64
Media Library /wp-admin/upload.php1,404 ▲44.19 ▲0.0195.32 ▼6.8242.34 ▼1.41
User IP and Location /wp-admin/options-general.php?page=user-ip-and-location8952.0223.5225.93

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
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
These attributes need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt might help

user-ip-and-location/user-ip-and-location.php Passed 13 tests

The primary PHP file in "User IP and Location" version 3.1 is used by WordPress to initiate all plugin functionality
113 characters long description:
Allows you to insert user's IP address, Location, ISP, City in your WordPress blog post and page using shortcode.

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
Everything looks great! No dangerous files found in this plugin414 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP85847414

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity12.00
▷ Minimum class complexity6.00
▷ Maximum class complexity18.00
Average method complexity1.81
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods27
▷ Static methods00.00%
▷ Public methods1970.37%
▷ Protected methods00.00%
▷ Private methods829.63%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
256 PNG files occupy 0.82MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
flags/ax.png0.40KB0.40KB0.00%
flags/sk.png3.51KB2.54KB▼ 27.79%
flags/cu.png2.10KB1.40KB▼ 33.18%
flags/eu.png3.92KB2.59KB▼ 33.99%
flags/de.png0.13KB0.13KB0.00%