84% ip-geolocation

Code Review | IP Geolocation

WordPress plugin IP Geolocation scored84%from 54 tests.

About plugin

  • Plugin page: ip-geolocation
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Apr 30, 2020
  • Latest release: Jul 19, 2023
  • Number of updates: 20
  • Update frequency: every 59.2 days
  • Top authors: vadatiertebat (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

80+ active /1,934 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼2.06ms] Passed 4 tests

This is a short check of server-side resources used by IP Geolocation
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1942.71 ▲1.90
Dashboard /wp-admin3.51 ▲0.2059.23 ▲10.12
Posts /wp-admin/edit.php3.62 ▲0.2648.06 ▼3.35
Add New Post /wp-admin/post-new.php6.09 ▲0.1991.18 ▼6.64
Media Library /wp-admin/upload.php3.43 ▲0.2037.39 ▼0.16
IP Geo Location Settings /wp-admin/options-general.php?page=ipgeo-settings3.4035.85

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

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

Browser metrics Passed 4 tests

IP Geolocation: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.26 ▼0.101.94 ▲0.3745.09 ▲4.82
Dashboard /wp-admin2,202 ▲225.59 ▼0.0796.37 ▲3.4842.68 ▲3.48
Posts /wp-admin/edit.php2,104 ▲12.00 ▼0.0338.79 ▼3.8536.24 ▼2.38
Add New Post /wp-admin/post-new.php6,367 ▲4,83927.62 ▲4.44898.91 ▲234.9861.26 ▲4.89
Media Library /wp-admin/upload.php1,404 ▲74.18 ▼0.05100.52 ▼19.8542.27 ▼10.80
IP Geo Location Settings /wp-admin/options-general.php?page=ipgeo-settings8232.0526.0132.47

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

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 everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_shortcode() in wp-content/plugins/ip-geolocation/includes/shortcode-generator/gutenberg/build/template.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'ET_Builder_Module' not found in wp-content/plugins/ip-geolocation/includes/shortcode-generator/divi/includes/modules/IPGeoDiviModule/IPGeoDiviModule.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'DiviExtension' not found in wp-content/plugins/ip-geolocation/includes/shortcode-generator/divi/includes/IPGeoDivi.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ip-geolocation/includes/shortcode-generator/divi/ipgeo-divi.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ip-geolocation/ip-geolocation.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: location of ip, ip geo location, ipinfo, geo location, ipinformation...

ip-geolocation/ip-geolocation.php 92% from 13 tests

This is the main PHP file of "IP Geolocation" version 2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected1,549 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP162584531,387
CSS515190
SVG21129
JSON10017
JSX16215
JavaScript64311

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity30.75
▷ Minimum class complexity1.00
▷ Maximum class complexity171.00
Average method complexity6.80
▷ Minimum method complexity1.00
▷ Maximum method complexity90.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods41
▷ Static methods512.20%
▷ Public methods3380.49%
▷ Protected methods717.07%
▷ Private methods12.44%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin