79% geolocation

Code Review | Geolocation

WordPress plugin Geolocation scored79%from 54 tests.

About plugin

  • Plugin page: geolocation
  • Plugin version: 1.9.3
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3
  • WordPress version: 6.3.1
  • First release: May 3, 2010
  • Latest release: Aug 24, 2023
  • Number of updates: 135
  • Update frequency: every 36.0 days
  • Top authors: ymichel (82.22%)frsh (16.3%)mdawaffe (2.96%)

Code review

54 tests

User reviews

10 reviews

Install metrics

500+ active /34,185 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.47MB] [CPU: ▼14.83ms] Passed 4 tests

A check of server-side resources used by Geolocation
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2037.12 ▼7.66
Dashboard /wp-admin3.53 ▲0.2246.71 ▼3.33
Posts /wp-admin/edit.php3.64 ▲0.2849.60 ▲2.78
Add New Post /wp-admin/post-new.php3.38 ▼2.5136.84 ▼51.12
Media Library /wp-admin/upload.php3.45 ▲0.2237.02 ▲3.58

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 17 new options
New WordPress options
geolocation_map_width_page
geolocation_map_height
geolocation_osm_tiles_url
geolocation_map_display
widget_recent-posts
geolocation_map_position
geolocation_map_width
geolocation_provider
geolocation_default_zoom
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Checking browser requirements for Geolocation
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.23 ▼1.151.75 ▼0.2840.55 ▼5.56
Dashboard /wp-admin2,210 ▲195.85 ▲0.99105.15 ▼17.8039.76 ▼10.08
Posts /wp-admin/edit.php2,093 ▲72.12 ▲0.1133.37 ▼4.8836.26 ▲1.77
Add New Post /wp-admin/post-new.php6,359 ▲4,81721.54 ▲3.28988.33 ▲325.7656.18 ▼6.69
Media Library /wp-admin/upload.php1,386 ▼54.24 ▼0.01100.41 ▲3.6344.72 ▲0.38
Geolocation /wp-admin/geolocation.php260.440.0613.98

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/geolocation/geolocation.map-provider-osm.php on line 472
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/geolocation/geolocation.map-provider-osm.php on line 472
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/geolocation/geolocation.php:31
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/geolocation/geolocation.map-provider-osm.php on line 472

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/geolocation.php
    • > Network (severe)
    wp-admin/geolocation.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: location, journey, gps, travel, openstreet map...

geolocation/geolocation.php Passed 13 tests

"Geolocation" version 1.9.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
52 characters long description:
Displays post geotag information on an embedded map.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin2,446 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP51513841,756
CSS25830595
PO File1474894
JavaScript1051

PHP code Passed 2 tests

This is a very shot review of 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 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%
Functions48
▷ Named functions48100.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
9 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/wp_pin.png1.42KB1.42KB0.00%
js/images/layers-2x.png1.23KB1.67KB0.00%
img/globe.png0.91KB1.06KB0.00%
js/images/marker-shadow.png0.60KB1.16KB0.00%
img/icon.png0.86KB1.08KB0.00%