78% simple-location

Code Review | Simple Location

WordPress plugin Simple Location scored78%from 54 tests.

About plugin

  • Plugin page: simple-location
  • Plugin version: 5.0.18
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.4
  • WordPress version: 6.3.1
  • First release: Apr 7, 2015
  • Latest release: Nov 12, 2023
  • Number of updates: 150
  • Update frequency: every 20.9 days
  • Top authors: dshanske (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

500+ active /43,100 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲3.49MB] [CPU: ▲24.16ms] Passed 4 tests

An overview of server-side resources used by Simple Location
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /7.00 ▲3.5369.03 ▲27.94
Dashboard /wp-admin6.86 ▲3.5272.39 ▲9.24
Posts /wp-admin/edit.php6.92 ▲3.5683.75 ▲36.88
Add New Post /wp-admin/post-new.php9.23 ▲3.34117.87 ▲22.57
Media Library /wp-admin/upload.php6.79 ▲3.5668.13 ▲37.90
Simple Location /wp-admin/options-general.php?page=simloc6.7469.40
Locations /wp-admin/edit-tags.php?taxonomy=location&post_type=page6.7861.16
All Venues /wp-admin/edit.php?post_type=venue6.8564.79
Locations /wp-admin/edit-tags.php?taxonomy=location6.7860.51
Types /wp-admin/edit-tags.php?taxonomy=venue_type&post_type=venue6.7860.76
Locations /wp-admin/edit-tags.php?taxonomy=location&post_type=attachment6.7858.07
Add New /wp-admin/post-new.php?post_type=venue9.22102.33
Locations /wp-admin/edit-tags.php?taxonomy=location&post_type=venue6.7869.07

Server storage [IO: ▲33.78MB] [DB: ▲0.07MB] 67% from 3 tests

Filesystem and database footprint
Please fix the following
  • Total filesystem usage must be limited to 25MB (currently using 33.78MB)
Filesystem: 616 new files
Database: no new tables, 10 new options
New WordPress options
db_upgraded
widget_sloc_airport_widget
widget_sloc_station_widget
widget_sloc_lastseen_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_sloc_weather_widget
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Location
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,871 ▲10914.29 ▼0.051.83 ▲0.0240.63 ▼3.31
Dashboard /wp-admin2,249 ▲715.63 ▲0.0190.20 ▼16.8741.92 ▲3.95
Posts /wp-admin/edit.php2,233 ▲1331.98 ▲0.0438.69 ▼1.7334.59 ▲0.08
Add New Post /wp-admin/post-new.php9,193 ▲7,66226.25 ▲3.32872.05 ▲251.6258.56 ▲5.93
Media Library /wp-admin/upload.php1,454 ▲604.22 ▼0.0498.94 ▼1.9643.08 ▲0.36
Simple Location /wp-admin/options-general.php?page=simloc2,0782.0023.5646.97
Locations /wp-admin/edit-tags.php?taxonomy=location&post_type=page1,3442.2529.6331.41
All Venues /wp-admin/edit.php?post_type=venue1,1421.9029.4129.52
Locations /wp-admin/edit-tags.php?taxonomy=location1,3472.2528.2430.51
Types /wp-admin/edit-tags.php?taxonomy=venue_type&post_type=venue1,3002.1225.9130.27
Locations /wp-admin/edit-tags.php?taxonomy=location&post_type=attachment1,3442.2529.3031.62
Add New /wp-admin/post-new.php?post_type=venue9,13519.43861.6731.51
Locations /wp-admin/edit-tags.php?taxonomy=location&post_type=venue1,3442.2529.2530.24

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 10 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_sloc_airport_widget
    • widget_recent-posts
    • widget_sloc_weather_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_sloc_lastseen_widget
    • widget_sloc_station_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=venue
    • > Notice in wp-content/plugins/simple-location/templates/loc-metabox.php+142
    Undefined offset: 1
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=simloc
    • > Notice in wp-includes/general-template.php+5153
    Array to string conversion

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 74× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Loc_Config' not found in wp-content/plugins/simple-location/templates/elevation-form.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Loc_Config' not found in wp-content/plugins/simple-location/templates/weather-form.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_screen() in wp-content/plugins/simple-location/templates/timezone-metabox.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/simple-location/includes/widgets/class-sloc-lastseen-widget.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Geo_Provider' not found in wp-content/plugins/simple-location/includes/geo/class-geo-provider-geonames.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Map_Provider' not found in wp-content/plugins/simple-location/includes/map/class-map-provider-google.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-location/includes/class-geo-base.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Geo_Provider' not found in wp-content/plugins/simple-location/includes/geo/class-geo-provider-mapquest.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/simple-location/includes/class-location-plugins.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Map_Provider' not found in wp-content/plugins/simple-location/includes/map/class-map-provider-mapbox.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: location, timezones, weather, geo, indieweb...

simple-location/simple-location.php 92% from 13 tests

The main PHP script in "Simple Location" version 5.0.18 is automatically included on every request by WordPress
It is important to fix the following:
  • Requires PHP: Required version does not match the one declared in readme.txt ("5.6" instead of "7.0")

Code Analysis 97% from 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 plugin914,297 lines of code in 600 files:
LanguageFilesBlank linesComment linesLines of code
JSON20200894,417
PHP941,8675,47115,051
SVG29702194,321
JavaScript3458425
CSS413683

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 150)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity26.98
▷ Minimum class complexity1.00
▷ Maximum class complexity160.00
Average method complexity4.29
▷ Minimum method complexity1.00
▷ Maximum method complexity150.00
Code structure
Namespaces0
Interfaces0
Traits12
Classes70
▷ Abstract classes710.00%
▷ Concrete classes6390.00%
▷ Final classes11.59%
Methods647
▷ Static methods35154.25%
▷ Public methods61094.28%
▷ Protected methods81.24%
▷ Private methods294.48%
Functions82
▷ Named functions6680.49%
▷ Anonymous functions1619.51%
Constants4
▷ Global constants4100.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