83% ip2map

Code Review | IP2Map

WordPress plugin IP2Map scored83%from 54 tests.

About plugin

  • Plugin page: ip2map
  • Plugin version: 1.0.14
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.0-6.4
  • WordPress version: 6.3.1
  • First release: Dec 14, 2011
  • Latest release: Nov 10, 2023
  • Number of updates: 39
  • Update frequency: every 111.5 days
  • Top authors: ip2location (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /5,983 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.78ms] Passed 4 tests

Server-side resources used by IP2Map
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0236.66 ▲1.65
Dashboard /wp-admin3.33 ▼0.0245.48 ▼11.64
Posts /wp-admin/edit.php3.38 ▲0.0245.92 ▼0.65
Add New Post /wp-admin/post-new.php5.91 ▲0.0285.73 ▼10.54
Media Library /wp-admin/upload.php3.25 ▲0.0232.65 ▼0.27

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

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

Browser metrics Passed 4 tests

A check of browser resources used by IP2Map
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.18 ▼0.091.64 ▲0.0737.23 ▼4.84
Dashboard /wp-admin2,195 ▲175.60 ▼0.1092.51 ▼18.3341.51 ▲2.73
Posts /wp-admin/edit.php2,097 ▼02.02 ▲0.0135.79 ▼4.1335.30 ▼1.46
Add New Post /wp-admin/post-new.php1,526 ▼022.97 ▼0.03665.24 ▲9.1558.96 ▲11.45
Media Library /wp-admin/upload.php1,394 ▼34.17 ▼0.0498.14 ▼7.6941.86 ▼3.24

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however 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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ip2map/IP2Map.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (Visitor list), #2 (Button design)
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === ip2map === )
The official readme.txt is a good inspiration

ip2map/IP2Map.php 92% from 13 tests

The principal PHP file in "IP2Map" v. 1.0.14 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ip2map.php" instead of "IP2Map.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin190 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1239130
JavaScript19060

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.37
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin