78% user-location-and-ip

Code Review | User Location and IP

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

About plugin

  • Plugin page: user-location-and-ip
  • Plugin version: 1.7
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.4
  • WordPress version: 6.3.1
  • First release: May 13, 2020
  • Latest release: Oct 25, 2023
  • Number of updates: 19
  • Update frequency: every 66.3 days
  • Top authors: sunnybundel (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

600+ active /5,413 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
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by User Location and IP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0636.11 ▼1.13
Dashboard /wp-admin3.37 ▲0.0247.67 ▼10.61
Posts /wp-admin/edit.php3.49 ▲0.1250.24 ▲2.80
Add New Post /wp-admin/post-new.php5.95 ▲0.0684.08 ▲0.68
Media Library /wp-admin/upload.php3.29 ▲0.0634.71 ▼0.59
User Location and IP /wp-admin/options-general.php?page=user-location-and-ip3.2629.80

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 266 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for User Location and IP
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6414.28 ▼0.011.53 ▼0.1138.44 ▼2.83
Dashboard /wp-admin2,202 ▲215.63 ▼0.0687.58 ▼10.2838.53 ▼6.64
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0339.50 ▲4.4339.33 ▲5.23
Add New Post /wp-admin/post-new.php1,538 ▲1018.65 ▼4.48627.41 ▼110.5965.14 ▲0.14
Media Library /wp-admin/upload.php1,401 ▲104.23 ▼0.0293.30 ▼2.4942.91 ▼3.22
User Location and IP /wp-admin/options-general.php?page=user-location-and-ip8951.9921.2127.17

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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 were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/user-location-and-ip/user-location-and-ip.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-location-and-ip/admin/user-ip-menu.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: ip address, user ip address, user location, user country, locator...

user-location-and-ip/user-location-and-ip.php 92% from 13 tests

Analyzing the main PHP file in "User Location and IP" version 1.7
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 203 characters long)

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
No dangerous file extensions were detected559 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP85935559

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity18.00
▷ Minimum class complexity6.00
▷ Maximum class complexity30.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods32
▷ Static methods00.00%
▷ Public methods1650.00%
▷ Protected methods00.00%
▷ Private methods1650.00%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
256 PNG files occupy 0.82MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
flags/pn.png9.60KB5.00KB▼ 47.88%
flags/mq.png6.41KB3.92KB▼ 38.88%
flags/uz.png0.61KB0.67KB0.00%
flags/ar.png4.19KB2.49KB▼ 40.49%
flags/bw.png0.25KB0.26KB0.00%