89% acf-better-search

Code Review | ACF: Better Search

WordPress plugin ACF: Better Search scored 89% from 54 tests.

About plugin

  • Plugin page: acf-better-search
  • Plugin version: 4.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 5.9.2
  • First release: Dec 18, 2016
  • Latest release: Jan 17, 2022
  • Number of updates: 135
  • Update frequency: every 13.7 days
  • Top authors: mateuszgbiorczyk (100%)

Code review

54 tests

User reviews

130 reviews

Install metrics

30,000+ active / 335,905 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼298.72ms] Passed 4 tests

This is a short check of server-side resources used by ACF: Better Search
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.2854.36 ▲1.68
Dashboard /wp-admin3.63 ▲0.2236.30 ▲3.73
Posts /wp-admin/edit.php3.86 ▲0.2240.41 ▲1.90
Add New Post /wp-admin/post-new.php7.19 ▲0.1997.62 ▼1,201.15
Media Library /wp-admin/upload.php3.57 ▲0.2825.53 ▲2.68
ACF: Better Search /wp-admin/options-general.php?page=acfbs_admin_page3.5725.96

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 51 new files
Database: no new tables, 1 new option
New WordPress options
acfbs_notice_hidden

Browser metrics Passed 4 tests

A check of browser resources used by ACF: Better Search
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,802 ▲4816.08 ▲0.435.66 ▼0.322.05 ▼0.46
Dashboard /wp-admin2,931 ▲706.31 ▲0.14127.49 ▼8.07190.49 ▲30.78
Posts /wp-admin/edit.php2,727 ▲333.27 ▲0.0365.60 ▲3.45157.72 ▲15.64
Add New Post /wp-admin/post-new.php1,688 ▲2716.14 ▼0.76405.04 ▲6.01155.59 ▼4.44
Media Library /wp-admin/upload.php1,731 ▲335.61 ▲0.12137.74 ▼3.57197.25 ▲6.44
ACF: Better Search /wp-admin/options-general.php?page=acfbs_admin_page1,5182.5456.20123.94

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/acf-better-search/templates/components/settings/features.php
    • > /wp-content/plugins/acf-better-search/templates/components/settings/fields.php
  • 26× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: features in wp-content/plugins/acf-better-search/templates/components/settings/features.php on line 13
    • > PHP Fatal error
      Uncaught Error: Interface 'AcfBetterSearch\\HookableInterface' not found in wp-content/plugins/acf-better-search/src/Admin/Assets.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'AcfBetterSearch\\HookableInterface' not found in wp-content/plugins/acf-better-search/src/Search/Where.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'AcfBetterSearch\\HookableInterface' not found in wp-content/plugins/acf-better-search/src/Search/Init.php:10
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/acf-better-search/templates/components/settings/fields.php on line 14
    • > PHP Fatal error
      Uncaught Error: Interface 'AcfBetterSearch\\HookableInterface' not found in wp-content/plugins/acf-better-search/src/Settings/Page.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function AcfBetterSearch\\plugin_basename() in wp-content/plugins/acf-better-search/src/PluginInfo.php:42
    • > PHP Fatal error
      Uncaught Error: Interface 'AcfBetterSearch\\HookableInterface' not found in wp-content/plugins/acf-better-search/src/Admin/Install.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'AcfBetterSearch\\HookableInterface' not found in wp-content/plugins/acf-better-search/src/Admin/Notice.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/acf-better-search/templates/components/notices/thanks.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: extended search, better search, search, advanced custom fields, acf search

acf-better-search/acf-better-search.php Passed 13 tests

The main PHP file in "ACF: Better Search" ver. 4.0.1 adds more information about the plugin and also serves as the entry point for this plugin
127 characters long description:
Adds to default WordPress search engine the ability to search by content from selected fields of Advanced Custom Fields plugin.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected1,598 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP393537341,591
JSON1005
CSS1001
JavaScript1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity7.88
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.52
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces1
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes00.00%
Methods111
▷ Static methods1917.12%
▷ Public methods9484.68%
▷ Protected methods00.00%
▷ Private methods1715.32%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants12
▷ Global constants00.00%
▷ Class constants12100.00%
▷ Public constants12100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin