72% bang-faceted-search

Code Review | Bang Faceted Search

WordPress plugin Bang Faceted Search scored72%from 54 tests.

About plugin

  • Plugin page: bang-faceted-search
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.5.0
  • WordPress version: 6.3.1
  • First release: Jun 5, 2013
  • Latest release: Nov 17, 2020
  • Number of updates: 5
  • Update frequency: every 544.4 days
  • Top authors: marcus.downing (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,207 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼4.74ms] Passed 4 tests

Analyzing server-side resources used by Bang Faceted Search
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0939.67 ▼2.62
Dashboard /wp-admin3.38 ▲0.0746.24 ▼3.79
Posts /wp-admin/edit.php3.49 ▲0.1350.92 ▼2.29
Add New Post /wp-admin/post-new.php5.96 ▲0.0791.73 ▼10.24
Media Library /wp-admin/upload.php3.30 ▲0.0737.33 ▲2.52
Faceted Search /wp-admin/options-general.php?page=bang_fs3.1728.62

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 13 new options
New WordPress options
widget_bang-field-widget
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
widget_author-facet-widget
recovery_mode_email_last_sent
theysaidso_admin_options
widget_search-facet-widget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Bang Faceted Search
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.34 ▼0.292.35 ▲0.6645.98 ▲5.05
Dashboard /wp-admin2,206 ▲355.57 ▼0.0083.15 ▼4.1843.38 ▲1.14
Posts /wp-admin/edit.php2,111 ▲112.03 ▲0.0642.91 ▲5.6038.68 ▲2.51
Add New Post /wp-admin/post-new.php1,533 ▲223.26 ▲0.06579.64 ▼70.4660.65 ▲6.04
Media Library /wp-admin/upload.php1,405 ▲54.13 ▼0.12101.81 ▼3.6444.83 ▼0.36
Faceted Search /wp-admin/options-general.php?page=bang_fs6891.127.7315.77

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 13 options in the database
    • widget_bang-post-type-widget
    • widget_search-facet-widget
    • recovery_mode_email_last_sent
    • widget_author-facet-widget
    • db_upgraded
    • widget_theysaidso_widget
    • widget_bang-field-widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_date-facet-widget
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=bang_fs
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'bang_fs_add_help_tabs' not found or invalid function name
    • > GET request to /wp-admin/options-general.php?page=bang_fs
    • > Warning in wp-content/plugins/bang-faceted-search/main.php+37
    require_once(faceted-search-settings.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/options-general.php?page=bang_fs
    • > Compile error in wp-content/plugins/bang-faceted-search/main.php+37
    require_once(): Failed opening required 'faceted-search-settings.php' (include_path='.:/usr/share/php')

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
  • 15× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/bang-faceted-search/widgets/PostTypeFacetWidget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/bang-faceted-search/functions/class-faceted-search.php:383
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bang-faceted-search/functions/relevanssi.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/bang-faceted-search/widgets/YearFacetWidget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/bang-faceted-search/widgets/SearchFacetWidget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/bang-faceted-search/widgets/AuthorFacetWidget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bang-faceted-search/functions/widgets.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bang-faceted-search/main.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/bang-faceted-search/functions/search.php:173
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/bang-faceted-search/widgets/TaxonomyFacetWidget.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=bang_fs
    • > Network (severe)
    wp-content/plugins/bang-faceted-search/admin.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=bang_fs
    • > Network (severe)
    wp-content/plugins/bang-faceted-search/scripts/admin/fs-admin.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not 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
1 plugin tags: search

bang-faceted-search/main.php 92% from 13 tests

The main file in "Bang Faceted Search" v. 2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("bang-faceted-search.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected4,948 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP211,0207614,889
JavaScript16153
CSS1106

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity18.08
▷ Minimum class complexity1.00
▷ Maximum class complexity98.00
Average method complexity3.77
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods74
▷ Static methods00.00%
▷ Public methods74100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions200
▷ Named functions18894.00%
▷ Anonymous functions126.00%
Constants15
▷ Global constants15100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/bang.png3.76KB1.22KB▼ 67.67%