79% ip-locator

Code Review | IP Locator

WordPress plugin IP Locator scored79%from 54 tests.

About plugin

  • Plugin page: ip-locator
  • Plugin version: 3.9.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Apr 2, 2020
  • Latest release: Oct 25, 2023
  • Number of updates: 24
  • Update frequency: every 54.2 days
  • Top authors: PierreLannoy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /8,699 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
This plugin's installer ran successfully

Server metrics [RAM: ▲1.88MB] [CPU: ▲22.20ms] Passed 4 tests

Analyzing server-side resources used by IP Locator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.23 ▲1.7654.93 ▲19.12
Dashboard /wp-admin5.23 ▲1.9279.46 ▲30.54
Posts /wp-admin/edit.php5.28 ▲1.9271.86 ▲28.15
Add New Post /wp-admin/post-new.php7.79 ▲1.90100.04 ▲14.61
Media Library /wp-admin/upload.php5.15 ▲1.9260.94 ▲26.90
Scheduled Actions /wp-admin/tools.php?page=action-scheduler5.3260.70
IP Locator /wp-admin/admin.php?page=iplocator-settings5.5252.74
Analytics /wp-admin/admin.php?page=perfopsone-analytics5.1352.17
Control Center /wp-admin/admin.php?page=perfopsone-dashboard5.1952.28
Locations /wp-admin/admin.php?page=iplocator-tools5.1650.40
Tools /wp-admin/admin.php?page=perfopsone-tools5.1347.60
Locations /wp-admin/admin.php?page=iplocator-viewer5.6258.06

Server storage [IO: ▲7.43MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 1,088 new files
Database: 3 new tables, 7 new options
New tables
wp_iplocator_v4
wp_iplocator_statistics
wp_iplocator_v6
New WordPress options
widget_theysaidso_widget
action_scheduler_lock_async-request-runner
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for IP Locator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲7614.26 ▼0.111.78 ▲0.1846.99 ▲5.95
Dashboard /wp-admin2,243 ▲755.62 ▲0.0899.36 ▲4.6342.75 ▼3.94
Posts /wp-admin/edit.php2,148 ▲452.04 ▲0.0734.52 ▼0.7933.53 ▼4.29
Add New Post /wp-admin/post-new.php1,553 ▲2523.39 ▲0.18698.48 ▲9.0454.24 ▲2.37
Media Library /wp-admin/upload.php1,448 ▲484.19 ▼0.0699.03 ▲4.5743.28 ▼1.23
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,3071.7126.3329.88
IP Locator /wp-admin/admin.php?page=iplocator-settings2,0561.8126.5038.63
Analytics /wp-admin/admin.php?page=perfopsone-analytics8992.0023.5725.06
Control Center /wp-admin/admin.php?page=perfopsone-dashboard1,0742.0125.1233.77
Locations /wp-admin/admin.php?page=iplocator-tools8922.0728.3028.56
Tools /wp-admin/admin.php?page=perfopsone-tools8812.1623.3123.52
Locations /wp-admin/admin.php?page=iplocator-viewer1,6664.27102.9578.25

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • action_scheduler_lock_async-request-runner
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% 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 0% 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
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/ip-locator/public/partials/ip-locator-public-display.php
  • 76× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/ip-locator/includes/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ip-locator/includes/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Upgrader_Skin' not found in wp-content/plugins/ip-locator/perfopsone/class-upgraderskin.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_Schema' not found in wp-content/plugins/ip-locator/includes/libraries/action-scheduler/classes/schema/ActionScheduler_StoreSchema.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/ip-locator/includes/libraries/psr/http-message/RequestInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Logger' not found in wp-content/plugins/ip-locator/includes/libraries/action-scheduler/classes/data-stores/ActionScheduler_DBLogger.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_RecurringSchedule' not found in wp-content/plugins/ip-locator/includes/libraries/action-scheduler/classes/schedules/ActionScheduler_IntervalSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/ip-locator/includes/libraries/action-scheduler/lib/cron-expression/CronExpression_MinutesField.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'cebe\\markdownparser\\MarkdownParser' not found in wp-content/plugins/ip-locator/includes/libraries/markdown/GithubMarkdown.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Action_Scheduler\\Migration\\ActionMigrator' not found in wp-content/plugins/ip-locator/includes/libraries/action-scheduler/classes/migration/DryRun_ActionMigrator.php:15

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

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
4 plugin tags: geolocation, country, flag, language

ip-locator/ip-locator.php Passed 13 tests

The entry point to "IP Locator" version 3.9.0 is a PHP file that has certain tags in its header comment area
40 characters long description:
Country and language IP-based detection.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin79,357 lines of code in 1,048 files:
LanguageFilesBlank linesComment linesLines of code
SVG8030139,305
JavaScript161,9292,30721,381
PHP2022,89112,64515,914
CSS1533422,187
Markdown101980517
JSON20053

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity12.91
▷ Minimum class complexity1.00
▷ Maximum class complexity191.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity58.00
Code structure
Namespaces19
Interfaces16
Traits15
Classes151
▷ Abstract classes1711.26%
▷ Concrete classes13488.74%
▷ Final classes00.00%
Methods1,265
▷ Static methods30323.95%
▷ Public methods93573.91%
▷ Protected methods23618.66%
▷ Private methods947.43%
Functions58
▷ Named functions3458.62%
▷ Anonymous functions2441.38%
Constants91
▷ Global constants4751.65%
▷ Class constants4448.35%
▷ Public constants44100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin