10% nearby-places-search

Code Review | Nearby Places Search

WordPress plugin Nearby Places Search scored10%from 54 tests.

About plugin

  • Plugin page: nearby-places-search
  • Plugin version: 1...
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 15, 2017
  • Latest release: Jun 15, 2017
  • Number of updates: 18
  • Update frequency: every 0.1 days
  • Top authors: dipankardipu123 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,130 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure had errors
    • > Warning in wp-content/plugins/nearby-places-search/config/nearby_places_search_config.php+99
    Use of undefined constant DEFAULT_LAT - assumed 'DEFAULT_LAT' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.96MB] [CPU: ▼58.93ms] Passed 4 tests

An overview of server-side resources used by Nearby Places Search
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.65 ▼35.81
Dashboard /wp-admin2.05 ▼1.265.56 ▼47.94
Posts /wp-admin/edit.php2.05 ▼1.315.15 ▼47.57
Add New Post /wp-admin/post-new.php2.05 ▼3.845.24 ▼104.38
Media Library /wp-admin/upload.php2.05 ▼1.185.44 ▼27.30
Search Settings /wp-admin/options-general.php?page=searchsettings2.054.98

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 102 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Nearby Places Search
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.26 ▼0.061.71 ▼0.2840.18 ▼1.35
Dashboard /wp-admin2,202 ▲245.65 ▼0.1182.26 ▼22.3840.15 ▼2.38
Posts /wp-admin/edit.php2,104 ▲42.07 ▲0.0838.13 ▼2.8333.35 ▼2.56
Add New Post /wp-admin/post-new.php1,529 ▼217.45 ▼5.73669.43 ▼2.2356.27 ▼0.72
Media Library /wp-admin/upload.php1,398 ▼24.22 ▲0.0697.15 ▼5.8744.54 ▼3.04
Search Settings /wp-admin/options-general.php?page=searchsettings1,2202.0622.9729.56

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
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/nearby-places-search/config/nearby_places_search_config.php+99
    Use of undefined constant DEFAULT_LAT - assumed 'DEFAULT_LAT' (this will throw an Error in a future version of PHP)
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% 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=searchsettings
    • > Warning in wp-content/plugins/nearby-places-search/config/nearby_places_search_config.php+99
    Use of undefined constant DEFAULT_LAT - assumed 'DEFAULT_LAT' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=searchsettings
    • > Warning in wp-content/plugins/nearby-places-search/config/nearby_places_search_config.php+100
    Use of undefined constant DEFAULT_LONG - assumed 'DEFAULT_LONG' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=searchsettings
    • > Warning in wp-content/plugins/nearby-places-search/config/nearby_places_search_config.php+101
    Use of undefined constant DEFAULT_NMAE - assumed 'DEFAULT_NMAE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=searchsettings
    • > Warning in wp-content/plugins/nearby-places-search/config/nearby_places_search_config.php+102
    Use of undefined constant DEFAULT_RADIUS - assumed 'DEFAULT_RADIUS' (this will throw an Error in a future version of PHP)
  • 91 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=searchsettings
    • > Notice in wp-content/plugins/nearby-places-search/plugin.php+134
    Undefined index: location_type
    • > GET request to /wp-admin/options-general.php?page=searchsettings
    • > Notice in wp-content/plugins/nearby-places-search/plugin.php+147
    Undefined index: api_key
    • > GET request to /wp-admin/options-general.php?page=searchsettings
    • > Notice in wp-content/plugins/nearby-places-search/plugin.php+156
    Undefined index: location_latitude
    • > GET request to /wp-admin/options-general.php?page=searchsettings
    • > Notice in wp-content/plugins/nearby-places-search/plugin.php+164
    Undefined index: location_longitude
    • > GET request to /wp-admin/options-general.php?page=searchsettings
    • > Notice in wp-content/plugins/nearby-places-search/plugin.php+172
    Undefined index: location_name
    • > GET request to /wp-admin/options-general.php?page=searchsettings
    • > Notice in wp-content/plugins/nearby-places-search/plugin.php+180
    Undefined index: radius

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
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/nearby-places-search/config/nearby_places_search_config.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/nearby-places-search/plugin.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/nearby-places-search/view/loadPlace.php:2

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/options-general.php?page=searchsettings
    • > Network (severe)
    wp-content/plugins/nearby_place_search/css/nearby_places_search_admin.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: google map shortcode, admin, location, radius, google map place search

nearby-places-search/plugin.php 85% from 13 tests

"Nearby Places Search" version 1...'s main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("nearby-places-search.php" instead of "plugin.php")
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "1...")

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
Success! There were no dangerous files found in this plugin536 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP3458296
JavaScript1205159
CSS211681

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
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%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
95 PNG files occupy 0.62MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
nearby_places_search_markers/storage.png0.59KB0.41KB▼ 29.45%
nearby_places_search_markers/doctor.png0.63KB0.44KB▼ 29.38%
nearby_places_search_markers/police.png0.64KB0.58KB▼ 9.73%
nearby_places_search_markers/bakery.png1.12KB0.77KB▼ 31.10%
nearby_places_search_markers/undefined.png0.09KB0.09KB0.00%