73% geo-location

Code Review | Geo Location

WordPress plugin Geo Location scored73%from 54 tests.

About plugin

  • Plugin page: geo-location
  • Plugin version: 2.5.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 31, 2018
  • Latest release: Nov 10, 2020
  • Number of updates: 87
  • Update frequency: every 10.3 days
  • Top authors: ujw0l (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,676 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.16ms] Passed 4 tests

This is a short check of server-side resources used by Geo Location
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0349.35 ▲2.79
Dashboard /wp-admin3.33 ▲0.0350.25 ▲1.05
Posts /wp-admin/edit.php3.38 ▲0.0350.63 ▼0.84
Add New Post /wp-admin/post-new.php5.93 ▲0.0597.35 ▼11.63
Media Library /wp-admin/upload.php3.25 ▲0.0341.62 ▲6.90

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 12 new files
Database: 1 new table, 6 new options
New tables
wp_visitorInfo
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Geo Location: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲16216.62 ▲2.241.75 ▼0.1538.32 ▼2.43
Dashboard /wp-admin2,352 ▲16712.43 ▲7.33172.84 ▲60.3241.03 ▼2.20
Posts /wp-admin/edit.php2,238 ▲1468.99 ▲6.9676.78 ▲36.5260.67 ▲26.20
Add New Post /wp-admin/post-new.php1,770 ▲22826.62 ▲8.55658.67 ▲60.1234.97 ▼27.08
Media Library /wp-admin/upload.php1,537 ▲14610.75 ▲6.52138.98 ▲36.9946.34 ▲5.21

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method geoLocation::geolocation_geoLocationRemove() should not be called statically
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/geo-location/geolocation.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Requires at least: Version not formatted correctly
  • Screenshots: These screenshots require images: #1 (Screenshot of the backend visitors display page tab), #2 (Screen shot of backend with API key form), #3 (Screen shot of backend map preview.), #4 (Screenshot of all unique visitors mapped in bing map), #5 (Screenshot of page blocked visitors will see.), #6 (Screenshot of single visitor in bing map on overlay in admin area.)
The official readme.txt might help

geo-location/geolocation.php 92% from 13 tests

"Geo Location" version 2.5.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("geo-location.php" instead of "geolocation.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,386 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript327397642
PHP111431414
CSS18814330

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity38.00
▷ Minimum class complexity38.00
▷ Maximum class complexity38.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods2291.67%
▷ Protected methods00.00%
▷ Private methods28.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 3.00MB with 1.61MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png836.71KB252.27KB▼ 69.85%
screenshot-2.png66.76KB32.77KB▼ 50.91%
screenshot-1.png58.14KB31.34KB▼ 46.11%
screenshot-3.png1,393.51KB395.19KB▼ 71.64%
screenshot-5.png4.79KB3.36KB▼ 29.88%