66% locateandfilter

Code Review | LocateAndFilter

WordPress plugin LocateAndFilter scored66%from 54 tests.

About plugin

  • Plugin page: locateandfilter
  • Plugin version: 1.6.14
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 14, 2019
  • Latest release: Sep 12, 2023
  • Number of updates: 67
  • Update frequency: every 24.5 days
  • Top authors: dgamoni (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

200+ active /5,827 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
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.72ms] Passed 4 tests

An overview of server-side resources used by LocateAndFilter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1540.52 ▼5.62
Dashboard /wp-admin3.43 ▲0.1351.65 ▲2.06
Posts /wp-admin/edit.php3.59 ▲0.2357.85 ▲7.02
Add New Post /wp-admin/post-new.php5.73 ▼0.1681.58 ▼18.42
Media Library /wp-admin/upload.php3.36 ▲0.1338.18 ▼0.91
All Marker /wp-admin/edit.php?post_type=locateanythingmarker3.4453.16
Tags /wp-admin/edit-tags.php?taxonomy=locateanythingmarkertag&post_type=locateanythingmarker3.4443.96
Add New /wp-admin/post-new.php?post_type=locateanythingmarker3.4951.70
Options /wp-admin/edit.php?post_type=locateandfiltermap&page=locate-anything-settings3.6343.90
Add New /wp-admin/post-new.php?post_type=locateandfiltermap3.8753.95
All Map /wp-admin/edit.php?post_type=locateandfiltermap3.4442.99
Categories /wp-admin/edit-tags.php?taxonomy=locateanythingmarkercategory&post_type=locateanythingmarker3.4043.56

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 409 new files
Database: no new tables, 8 new options
New WordPress options
locate-anything-option-sources
locate-anything-option-map-language
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for LocateAndFilter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,872 ▲10113.25 ▼0.994.41 ▲2.3645.28 ▼0.67
Dashboard /wp-admin2,272 ▲845.84 ▲0.9399.73 ▼7.4939.34 ▼2.05
Posts /wp-admin/edit.php2,379 ▲2865.75 ▲3.74101.00 ▲59.4836.64 ▲0.24
Add New Post /wp-admin/post-new.php9,188 ▲7,65527.69 ▲4.54926.29 ▲294.3463.03 ▲6.17
Media Library /wp-admin/upload.php1,457 ▲694.20 ▲0.0585.77 ▼14.8945.38 ▼3.77
All Marker /wp-admin/edit.php?post_type=locateanythingmarker1,3506.1363.1129.78
Tags /wp-admin/edit-tags.php?taxonomy=locateanythingmarkertag&post_type=locateanythingmarker1,5155.7658.8631.64
Add New /wp-admin/post-new.php?post_type=locateanythingmarker5,44910.65239.8985.33
Options /wp-admin/edit.php?post_type=locateandfiltermap&page=locate-anything-settings2,9394.6556.9034.02
Add New /wp-admin/post-new.php?post_type=locateandfiltermap7,7217.43221.9153.59
All Map /wp-admin/edit.php?post_type=locateandfiltermap1,3315.8961.0729.58
Categories /wp-admin/edit-tags.php?taxonomy=locateanythingmarkercategory&post_type=locateanythingmarker1,5495.7759.2730.64

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • theysaidso_admin_options
    • locate-anything-option-map-language
    • locate-anything-option-sources
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 0% 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)
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=locateanythingmarker
    • > Notice in wp-content/plugins/locateandfilter/admin/partials/locate-and-filter-metabox-post.php+113
    Undefined index: locate-anything-tooltip-preset
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=locateandfiltermap
    • > Notice in wp-content/plugins/locateandfilter/admin/class-locate-and-filter-admin.php+648
    Undefined variable: additional_field_list
    • > GET request to /wp-admin/post-new.php?post_type=locateanythingmarker
    • > Notice in wp-content/plugins/locateandfilter/admin/partials/locate-and-filter-metabox-post.php+203
    Undefined index: locate-anything-marker-symbol
    • > GET request to /wp-admin/edit.php?post_type=locateandfiltermap&page=locate-anything-settings
    • > Notice in wp-content/plugins/locateandfilter/addons/class-locate-and-filter-addons.php+101
    Undefined index: load
    • > GET request to /wp-admin/post-new.php?post_type=locateandfiltermap
    • > POST request to /wp-content/plugins/locateandfilter/admin/partials/locate-and-filter-preview.php
    • > Notice in wp-content/plugins/locateandfilter/public/class-locate-and-filter-public.php+1018
    Undefined index: locate-anything-marker-html-template
    • > GET request to /wp-admin/post-new.php?post_type=locateandfiltermap
    • > POST request to /wp-content/plugins/locateandfilter/admin/partials/locate-and-filter-preview.php
    • > Notice in wp-content/plugins/locateandfilter/public/class-locate-and-filter-public.php+1182
    Undefined index: locate-anything-lat
    • > GET request to /wp-admin/post-new.php?post_type=locateandfiltermap
    • > POST request to /wp-content/plugins/locateandfilter/admin/partials/locate-and-filter-preview.php
    • > Notice in wp-content/plugins/locateandfilter/public/class-locate-and-filter-public.php+1183
    Undefined index: locate-anything-lon

SRP 0% 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
Almost there! Just fix the following items
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/locateandfilter/assets/mapTemplates/template-top.php
    • > /wp-content/plugins/locateandfilter/admin/partials/locate-and-filter-preview.php
    • > /wp-content/plugins/locateandfilter/assets/mapTemplates/template-right.php
    • > /wp-content/plugins/locateandfilter/assets/mapTemplates/template-left.php
    • > /wp-content/plugins/locateandfilter/assets/mapTemplates/template-project.php
    • > /wp-content/plugins/locateandfilter/admin/js/edit_area/edit_area_compressor.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/locateandfilter/admin/js/edit_area/edit_area_compressor.php on line 71

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=locateanythingmarkercategory&post_type=locateanythingmarker
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?key=AIzaSyC0lZ7MbGfowxNTZva7fAyeTJ18dAWMUp0&v=3.exp&libraries=places&language=enen&ver=1.4.128 235:51 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"
    • > GET request to /wp-admin/post-new.php?post_type=locateanythingmarker
    • > Rendering (warning) in unknown
    /wp-admin/post-new.php?post_type=locateanythingmarker 1396 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/post-new.php?post_type=locateandfiltermap
    • > Rendering (warning) in unknown
    /wp-admin/post-new.php?post_type=locateandfiltermap 433 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/post-new.php?post_type=locateandfiltermap
    • > Rendering (warning) in unknown
    /wp-admin/post-new.php?post_type=locateandfiltermap 1417 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/post-new.php?post_type=locateandfiltermap
    • > Rendering (warning) in unknown
    /wp-admin/post-new.php?post_type=locateandfiltermap 1482 The specified value "#000" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
Please take inspiration from this readme.txt

locateandfilter/locateandfilter.php 85% from 13 tests

The primary PHP file in "LocateAndFilter" version 1.6.14 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 189 characters long)

Code Analysis Passed 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 plugin106,217 lines of code in 294 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript21024,05424,75889,503
PHP341,0461,6005,908
CSS346772995,844
HTML57603,304
JSON7001,492
Markdown4580166

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity38.85
▷ Minimum class complexity1.00
▷ Maximum class complexity177.00
Average method complexity4.28
▷ Minimum method complexity1.00
▷ Maximum method complexity55.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods157
▷ Static methods8856.05%
▷ Public methods15095.54%
▷ Protected methods00.00%
▷ Private methods74.46%
Functions28
▷ Named functions1346.43%
▷ Anonymous functions1553.57%
Constants0
▷ Global constants00.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
64 PNG files occupy 0.25MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/js/leaflet-1.8.0/images/marker-icon.png1.43KB1.55KB0.00%
assets/markers/48x48-marker-10.png1.91KB1.69KB▼ 11.26%
public/js/jquery-theme/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
assets/markers/48x48-marker-8.png1.43KB1.21KB▼ 15.57%
public/js/leaflet.awesome-markers-2.0/images/markers-soft.png40.26KB7.77KB▼ 80.70%