84% ip2location-widget

Code Review | IP2Location Widget

WordPress plugin IP2Location Widget scored84%from 54 tests.

About plugin

  • Plugin page: ip2location-widget
  • Plugin version: 1.2.10
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0-5.9
  • WordPress version: 6.3.1
  • First release: May 2, 2017
  • Latest release: Mar 18, 2022
  • Number of updates: 36
  • Update frequency: every 49.6 days
  • Top authors: ip2location (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,645 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
Installer ran successfully

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

Server-side resources used by IP2Location Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0736.65 ▼1.20
Dashboard /wp-admin3.36 ▲0.0248.54 ▼9.27
Posts /wp-admin/edit.php3.42 ▲0.0646.02 ▲0.26
Add New Post /wp-admin/post-new.php5.95 ▲0.0682.90 ▼8.27
Media Library /wp-admin/upload.php3.29 ▲0.0634.43 ▲1.66
IP2Location Widget /wp-admin/options-general.php?page=ip2location-widget3.2529.37

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 10 new options
New WordPress options
ip2location_widget_type
can_compress_scripts
ip2location_widget_language
widget_recent-comments
theysaidso_admin_options
widget_ip2locationwidget
widget_theysaidso_widget
db_upgraded
widget_recent-posts
ip2location_widget_debug_log_enabled

Browser metrics Passed 4 tests

This is an overview of browser requirements for IP2Location Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.33 ▼0.241.76 ▲0.2145.28 ▲6.10
Dashboard /wp-admin2,202 ▲285.70 ▲0.1784.40 ▼1.8036.91 ▼5.12
Posts /wp-admin/edit.php2,101 ▲12.03 ▲0.0333.52 ▼4.1635.02 ▲0.48
Add New Post /wp-admin/post-new.php1,540 ▲1418.20 ▼4.56628.11 ▼3.4766.34 ▲6.24
Media Library /wp-admin/upload.php1,401 ▲14.24 ▲0.0898.06 ▼9.0141.57 ▼8.35
IP2Location Widget /wp-admin/options-general.php?page=ip2location-widget1,0022.0625.0956.45

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 detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_ip2locationwidget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ip2location-widget/ip2location-widget.php:14

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: widget, geolocation

ip2location-widget/ip2location-widget.php Passed 13 tests

"IP2Location Widget" version 1.2.10's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
81 characters long description:
Displays the geolocation information of the visitor who is visiting your website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin376 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP26310316
JavaScript19060

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity31.00
▷ Minimum class complexity31.00
▷ Maximum class complexity31.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
PNG images were not found in this plugin