10% wp-post-distance-filter

Code Review | Wordpress Post Distance Filter

WordPress plugin Wordpress Post Distance Filter scored10%from 54 tests.

About plugin

  • Plugin page: wp-post-distance-...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 19, 2014
  • Latest release: Mar 5, 2015
  • Number of updates: 13
  • Update frequency: every 7.1 days
  • Top authors: niksudan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,091 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/wp-post-distance-filter/wp-post-distance-filter.php+265
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼1.89MB] [CPU: ▼54.39ms] Passed 4 tests

This is a short check of server-side resources used by Wordpress Post Distance Filter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.364.97 ▼39.93
Dashboard /wp-admin2.12 ▼1.195.96 ▼44.95
Posts /wp-admin/edit.php2.12 ▼1.245.72 ▼40.10
Add New Post /wp-admin/post-new.php2.12 ▼3.775.65 ▼92.57
Media Library /wp-admin/upload.php2.12 ▼1.116.31 ▼24.89
Distance Filter /wp-admin/options-general.php?page=wpdf-options2.127.23

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_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Wordpress Post Distance Filter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.71 ▼0.601.62 ▼0.3541.41 ▼1.31
Dashboard /wp-admin2,207 ▲195.83 ▼0.0494.52 ▼20.9142.61 ▼4.47
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0534.31 ▼5.8532.79 ▲0.30
Add New Post /wp-admin/post-new.php1,542 ▲923.16 ▲0.01650.79 ▼12.7760.18 ▲8.98
Media Library /wp-admin/upload.php1,395 ▲74.20 ▲0.0097.06 ▼1.9444.05 ▼0.60
Distance Filter /wp-admin/options-general.php?page=wpdf-options1,0362.1930.3547.99

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/wp-post-distance-filter/wp-post-distance-filter.php+265
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% 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 errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=wpdf-options
    • > Deprecated in wp-content/plugins/wp-post-distance-filter/wp-post-distance-filter.php+265
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

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
Please fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-post-distance-filter/wp-post-distance-filter.php:120
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/wp-post-distance-filter/options-page.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: distance, posts, filter, archive, location

wp-post-distance-filter/wp-post-distance-filter.php Passed 13 tests

Analyzing the main PHP file in "Wordpress Post Distance Filter" version 1.1.1
24 characters long description:
Filter posts by distance

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin313 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP244128283
Markdown123030

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.44
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods9100.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin