84% bp-distance-search

Code Review | BP Distance Search

WordPress plugin BP Distance Search scored84%from 54 tests.

About plugin

  • Plugin page: bp-distance-search
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Mar 7, 2019
  • Latest release: Nov 25, 2023
  • Number of updates: 25
  • Update frequency: every 69.0 days
  • Top authors: dontdream (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

200+ active /6,543 total downloads

Benchmarks

Plugin footprint 83% 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: ▼0.01MB] [CPU: ▼7.13ms] Passed 4 tests

A check of server-side resources used by BP Distance Search
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0132.40 ▼10.16
Dashboard /wp-admin3.31 ▼0.0446.68 ▼14.98
Posts /wp-admin/edit.php3.36 ▲0.0043.98 ▼1.41
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.89 ▲8.49
Media Library /wp-admin/upload.php3.23 ▲0.0031.37 ▼1.98

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by BP Distance Search
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6814.68 ▲0.401.70 ▼0.0137.95 ▼7.43
Dashboard /wp-admin2,203 ▲255.52 ▼0.1693.93 ▼18.5243.81 ▼2.61
Posts /wp-admin/edit.php2,115 ▲152.16 ▲0.1640.37 ▲3.6136.10 ▼1.74
Add New Post /wp-admin/post-new.php1,535 ▲423.42 ▲0.65638.59 ▼50.1949.60 ▼9.03
Media Library /wp-admin/upload.php1,408 ▲84.27 ▲0.0899.16 ▼7.8041.15 ▼6.43

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-distance-search/bds-main.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-distance-search/bds-location.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: buddypress, members, location, search, filter...

bp-distance-search/bds-main.php 92% from 13 tests

The main PHP script in "BP Distance Search" version 1.4.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("bp-distance-search.php" instead of "bds-main.php")

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
Good job! No executable or dangerous file extensions detected360 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP27227321
JavaScript13039

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
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
There were not PNG files found in your plugin