68% geolocation-history

Code Review | Geolocation History

WordPress plugin Geolocation History scored 68% from 54 tests.

About plugin

  • Plugin page: geolocation-history
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5
  • WordPress version: 5.8.1
  • First release: Dec 19, 2012
  • Latest release: Dec 19, 2012
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: yoran (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 839 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 gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼134.38ms] Passed 4 tests

Server-side resources used by Geolocation History
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1639.79 ▲13.22
Dashboard /wp-admin3.10 ▲0.0556.84 ▲12.85
Posts /wp-admin/edit.php3.15 ▲0.0549.47 ▲1.71
Add New Post /wp-admin/post-new.php5.46 ▲0.03103.53 ▼544.96
Media Library /wp-admin/upload.php3.04 ▲0.0432.67 ▼7.13
Location History /wp-admin/options-general.php?page=location-history3.0030.50

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 28 new files
Database: 1 new table, 2 new options
New tables
wp_geolocation_history
New WordPress options
lochis_db
lochis_db_version

Browser metrics Passed 4 tests

An overview of browser requirements for Geolocation History
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲13616.03 ▲0.5610.16 ▲2.5348.97 ▼0.70
Dashboard /wp-admin2,978 ▲475.84 ▼0.09151.44 ▲8.61112.22 ▼13.48
Posts /wp-admin/edit.php2,744 ▲52.68 ▲0.0072.12 ▲6.9794.75 ▲5.75
Add New Post /wp-admin/post-new.php1,686 ▲318.72 ▼0.08388.08 ▼24.98113.42 ▼14.03
Media Library /wp-admin/upload.php1,812 ▲85.03 ▲0.02155.77 ▲0.71128.20 ▲5.80
Location History /wp-admin/options-general.php?page=location-history1,2412.7576.2566.04

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_geolocation_history
  • Zombie WordPress options were found after uninstall: 2 options
    • lochis_db_version
    • lochis_db

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=location-history
    • > Notice in wp-content/plugins/geolocation-history/lochis.php+113
    Undefined index: lochis-hidden
    • > GET request to /wp-admin/options-general.php?page=location-history
    • > Notice in wp-content/plugins/geolocation-history/lochis.php+67
    Undefined index: id
    • > GET request to /wp-admin/options-general.php?page=location-history
    • > Notice in wp-content/plugins/geolocation-history/lochis.php+71
    Undefined index: label
    • > GET request to /wp-admin/options-general.php?page=location-history
    • > Notice in wp-content/plugins/geolocation-history/lochis.php+77
    Undefined index: date
    • > GET request to /wp-admin/options-general.php?page=location-history
    • > Notice in wp-content/plugins/geolocation-history/lochis.php+84
    Undefined index: latitude
    • > GET request to /wp-admin/options-general.php?page=location-history
    • > Notice in wp-content/plugins/geolocation-history/lochis.php+87
    Undefined index: longitude

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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/geolocation-history/lochis.php:270

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (The administrator part of the plugin.), #2 (An example of how the plugin was used to keep track of the locations of the blog's author while he was traveling.)
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === geolocation-history === )
You can take inspiration from this readme.txt

geolocation-history/lochis.php 92% from 13 tests

The main PHP file in "Geolocation History" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("geolocation-history.php" instead of "lochis.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin2,548 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31732791,436
CSS540173864
PHP13260248

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.05
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
18 PNG files occupy 0.22MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bootstrap/img/glyphicons-halflings-white.png8.57KB9.20KB0.00%
screenshot-1.png53.90KB14.27KB▼ 73.53%
css/images/ui-icons_ef8c08_256x240.png4.27KB4.11KB▼ 3.78%
css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png0.13KB0.18KB0.00%
css/images/ui-icons_ffd27a_256x240.png4.27KB4.11KB▼ 3.78%