72% live-search-custom-fields-lite

Code Review | Live Search and Custom Fields LITE - Advanced Filter

WordPress plugin Live Search and Custom Fields LITE - Advanced Filter scored 72% from 54 tests.

About plugin

  • Plugin page: live-search-custo...
  • Plugin version: 2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.3.3
  • WordPress version: 6.3.1
  • First release: Jun 29, 2017
  • Latest release: Nov 6, 2020
  • Number of updates: 9
  • Update frequency: every 136.2 days
  • Top authors: ionvv (55.56%)pixolette (55.56%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 13,073 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▲2.10ms] Passed 4 tests

This is a short check of server-side resources used by Live Search and Custom Fields LITE - Advanced Filter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0438.25 ▼9.70
Dashboard /wp-admin3.38 ▲0.0751.17 ▲6.89
Posts /wp-admin/edit.php3.49 ▲0.1354.95 ▲9.24
Add New Post /wp-admin/post-new.php5.95 ▲0.0793.24 ▲5.47
Media Library /wp-admin/upload.php3.27 ▲0.0538.90 ▲5.74
LSCF Lite /wp-admin/admin.php?page=pxLF_plugin3.3537.90
Export/Import /wp-admin/admin.php?page=lscf_export3.3238.85

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 295 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Live Search and Custom Fields LITE - Advanced Filter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,994 ▲24815.19 ▲0.641.86 ▼0.0238.08 ▼2.46
Dashboard /wp-admin2,384 ▲2026.83 ▲0.98144.40 ▲33.41109.50 ▲66.48
Posts /wp-admin/edit.php2,308 ▲2163.69 ▲1.6659.39 ▲18.4987.34 ▲51.36
Add New Post /wp-admin/post-new.php1,720 ▲17823.18 ▲4.89580.18 ▼63.6633.75 ▼15.33
Media Library /wp-admin/upload.php1,447 ▲594.42 ▲0.2587.37 ▼16.4780.21 ▲35.36
LSCF Lite /wp-admin/admin.php?page=pxLF_plugin1,1133.4145.3894.65
Export/Import /wp-admin/admin.php?page=lscf_export1,1473.2549.6380.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
Please take a closer look at the following
  • 13× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/live-search-custom-fields-lite/shortcode.php
    • > /wp-content/plugins/live-search-custom-fields-lite/_views/frontend/custom-fields-single-page.php
    • > /wp-content/plugins/live-search-custom-fields-lite/_helpers/query_helper.php
    • > /wp-content/plugins/live-search-custom-fields-lite/_models/main_model.php
    • > /wp-content/plugins/live-search-custom-fields-lite/_views/backend/post-customFields.php
    • > /wp-content/plugins/live-search-custom-fields-lite/_controllers/main_controller.php
    • > /wp-content/plugins/live-search-custom-fields-lite/settings/settings.php
    • > /wp-content/plugins/live-search-custom-fields-lite/_controllers/import_export_controller.php
    • > /wp-content/plugins/live-search-custom-fields-lite/base.php
    • > /wp-content/plugins/live-search-custom-fields-lite/_controllers/http_requests_controller.php
  • 15× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/live-search-custom-fields-lite/_views/backend/edit-filter-shortcode.php:15
    • > PHP Warning
      include_once(): Failed opening 'LSCF_PLUGIN_PATH_controllers/custom-fieldsController.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/live-search-custom-fields-lite/admin/admin_page.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'LscfLitePluginMainController' not found in wp-content/plugins/live-search-custom-fields-lite/_views/backend/landing.php:4
    • > PHP Warning
      Use of undefined constant LSCF_PLUGIN_PATH - assumed 'LSCF_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/live-search-custom-fields-lite/admin/admin_page.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'LscfLitePluginMainController' not found in wp-content/plugins/live-search-custom-fields-lite/_views/backend/filter-style.php:26
    • > PHP Warning
      include_once(LSCF_PLUGIN_PATH_controllers/custom-fieldsController.php): failed to open stream: No such file or directory in wp-content/plugins/live-search-custom-fields-lite/admin/admin_page.php on line 2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/live-search-custom-fields-lite/_views/backend/post-customFields.php on line 8
    • > PHP Notice
      Undefined variable: fields_data in wp-content/plugins/live-search-custom-fields-lite/_views/backend/post-customFields.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/live-search-custom-fields-lite/_views/frontend/filter.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'LscfLitePluginMainController' not found in wp-content/plugins/live-search-custom-fields-lite/_views/backend/settings-tab.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=lscf_export
    • > Javascript (severe) in unknown
    /wp-content/plugins/live-search-custom-fields-lite/assets/vendor.js?ver=1 0:215 Uncaught Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=lscf_export
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $j(...).colorPicker is not a function" "TypeError: $j(...).colorPicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/live-search-custom-fields-lite/assets/source.js?ver=1.1:2:16511)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=lscf_export
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: a(...).colorPicker is not a function" "TypeError: a(...).colorPicker is not a function\n at init (/wp-content/plugins/live-search-custom-fields-lite/assets/source.js?ver=1.1:1:30155)\n at filterThemeSettings (/wp-content/plugins/live-search-custom-fields-lite/assets/source.js?ver=1.1:1:30974)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/live-search-custom-fields-lite/assets/source.js?ver=1.1:2:16631)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=lscf_export
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $j(...).colorPicker is not a function
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=lscf_export
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: a(...).colorPicker is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can look at the official readme.txt

live-search-custom-fields-lite/base.php 92% from 13 tests

The main PHP file in "Live Search and Custom Fields LITE - Advanced Filter" ver. 2.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("live-search-custom-fields-lite.php" instead of "base.php")

Code Analysis 97% from 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 plugin51,390 lines of code in 128 files:
LanguageFilesBlank linesComment linesLines of code
SVG110018,595
JavaScript445,1502,27113,247
Sass968577,281
CSS18324484,732
PHP222,0846593,980
HTML201,50523,202
Markdown2340300
JSON21053

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 115)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity58.38
▷ Minimum class complexity1.00
▷ Maximum class complexity185.00
Average method complexity11.20
▷ Minimum method complexity1.00
▷ Maximum method complexity115.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods45
▷ Static methods36.67%
▷ Public methods4497.78%
▷ Protected methods12.22%
▷ Private methods00.00%
Functions16
▷ Named functions16100.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
76 PNG files occupy 0.98MB with 0.71MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/icons/px-checkbox-checked.png1.12KB0.38KB▼ 66.17%
assets/css/images/icons/px-checkbox_1.png1.04KB0.20KB▼ 80.84%
assets/css/images/icons/px-radiobox-inactive.png1.32KB0.58KB▼ 55.98%
assets/css/images/long-d-arrow.png0.96KB0.15KB▼ 84.78%
assets/images/right-arrow-slick.png1.34KB0.38KB▼ 71.90%