79% ip-loc8

Code Review | IP Loc8

WordPress plugin IP Loc8 scored79%from 54 tests.

About plugin

  • Plugin page: ip-loc8
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Oct 13, 2015
  • Latest release: Dec 15, 2016
  • Number of updates: 6
  • Update frequency: every 71.5 days
  • Top authors: studioreforma (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,880 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.58ms] Passed 4 tests

A check of server-side resources used by IP Loc8
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.53 ▲0.98
Dashboard /wp-admin3.33 ▲0.0263.59 ▲0.59
Posts /wp-admin/edit.php3.38 ▲0.0249.36 ▼2.83
Add New Post /wp-admin/post-new.php5.91 ▲0.0293.70 ▼9.05
Media Library /wp-admin/upload.php3.25 ▲0.0240.66 ▲3.88
IP Location /wp-admin/options-general.php?page=iploc8_settings3.2137.07

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for IP Loc8
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲8314.48 ▼0.202.01 ▲0.4543.28 ▲0.71
Dashboard /wp-admin2,225 ▲194.84 ▼1.04108.00 ▲0.4343.07 ▼2.72
Posts /wp-admin/edit.php2,107 ▲72.04 ▲0.0441.87 ▲1.6939.41 ▲6.89
Add New Post /wp-admin/post-new.php1,547 ▲223.24 ▲0.01685.47 ▲82.2853.15 ▼30.51
Media Library /wp-admin/upload.php1,404 ▲74.15 ▼0.00114.33 ▼7.0647.34 ▼6.21
IP Location /wp-admin/options-general.php?page=iploc8_settings8492.0828.4135.55

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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 take a closer look at the following
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ip-loc8/classes/class.geolocator.php
    • > /wp-content/plugins/ip-loc8/classes/class.init.php
    • > /wp-content/plugins/ip-loc8/classes/class.admin.php
    • > /wp-content/plugins/ip-loc8/classes/class.locator.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ip-loc8/ip-loc8.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 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
3 plugin tags: qtranslate, geolocation, ip geolocation

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

The main file in "IP Loc8" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
72 characters long description:
This plugins provides city and country info based on the user IP address

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
There were no executable files found in this plugin382 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP584132382

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods25
▷ Static methods14.00%
▷ Public methods2392.00%
▷ Protected methods00.00%
▷ Private methods28.00%
Functions5
▷ Named functions5100.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
No PNG images were found in this plugin