62% geo-locater

Code Review | Geo Locater

WordPress plugin Geo Locater scored 62% from 54 tests.

About plugin

  • Plugin page: geo-locater
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.5.3
  • WordPress version: 5.8.1
  • First release: Jun 30, 2015
  • Latest release: Aug 15, 2016
  • Number of updates: 14
  • Update frequency: every 29.8 days
  • Top authors: nkmaurya (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,197 total downloads

Benchmarks

Plugin footprint 65% 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.06MB] [CPU: ▼184.48ms] Passed 4 tests

A check of server-side resources used by Geo Locater
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.95 ▲0.1142.97 ▲5.34
Dashboard /wp-admin3.07 ▲0.0138.08 ▼14.92
Posts /wp-admin/edit.php3.12 ▲0.0135.82 ▼18.35
Add New Post /wp-admin/post-new.php5.08 ▼0.3580.57 ▼700.89
Media Library /wp-admin/upload.php3.07 ▲0.0732.32 ▼3.74
Add New Location /wp-admin/post-new.php?post_type=location3.1345.21
Locater Shortcode /wp-admin/edit.php?post_type=location&page=locater_shortcode3.0529.42
Geo Locater /wp-admin/edit.php?post_type=location3.1031.54
Settings /wp-admin/edit.php?post_type=location&page=locater_settings3.0527.02

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: 1 new table, 1 new option
New tables
wp_locater_entries
New WordPress options
locater_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for Geo Locater
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,738 ▲14215.97 ▼0.0110.33 ▼1.0544.64 ▼8.67
Dashboard /wp-admin3,012 ▲785.95 ▼0.15151.17 ▼1.00129.37 ▲19.95
Posts /wp-admin/edit.php2,790 ▲512.61 ▼0.1070.32 ▼9.1793.23 ▼0.72
Add New Post /wp-admin/post-new.php1,716 ▲3318.76 ▼0.09406.08 ▼11.76108.71 ▼5.29
Media Library /wp-admin/upload.php1,872 ▲655.04 ▲0.01152.63 ▼29.74149.68 ▲34.06
Add New Location /wp-admin/post-new.php?post_type=location2,3744.55108.51109.31
Locater Shortcode /wp-admin/edit.php?post_type=location&page=locater_shortcode1,0852.0956.7675.13
Geo Locater /wp-admin/edit.php?post_type=location1,4612.6568.0378.67
Settings /wp-admin/edit.php?post_type=location&page=locater_settings1,2082.1558.0078.61

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_locater_entries
  • Zombie WordPress options detected upon uninstall: 1 option
    • locater_version

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=location&page=locater_settings
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method Locater::locater_scripts() should not be called statically
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=location
    • > Warning in wp-content/plugins/geo-locater/classes/class.locater.api.php+112
    count(): Parameter must be an array or an object that implements Countable
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=location
    • > Notice in wp-content/plugins/geo-locater/classes/class.locater.php+160
    Trying to access array offset on value of type bool

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/geo-locater/classes/class.locater.php
    • > /wp-content/plugins/geo-locater/classes/class.locater.api.php
    • > /wp-content/plugins/geo-locater/classes/class.locater.front.php
    • > /wp-content/plugins/geo-locater/locater.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/geo-locater/tpl/shortcode-template.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/geo-locater/tpl/settings-template.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 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
6 plugin tags: store finder, google map, geo coding, geo location, nearby location...

geo-locater/locater.php 92% from 13 tests

The primary PHP file in "Geo Locater" version 1.2 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("geo-locater.php" instead of "locater.php")

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
There were no executable files found in this plugin721 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP6136213480
JavaScript2487198
CSS16043

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity10.67
▷ Minimum class complexity6.00
▷ Maximum class complexity19.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods22
▷ Static methods2195.45%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/red-dot.png1.31KB1.07KB▼ 18.25%
img/loc.png0.48KB0.38KB▼ 21.47%