Skip to content

Commit

Permalink
Check for duplicate load_bsearch()
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaydsouza committed Sep 13, 2024
1 parent dff641e commit a572329
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 32 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
[![Required PHP](https://img.shields.io/wordpress/plugin/required-php/better-search?style=flat-square)](https://wordpress.org/plugins/better-search/)
[![Active installs](https://img.shields.io/wordpress/plugin/installs/better-search?style=flat-square)](https://wordpress.org/plugins/better-search/)

__Requires:__ 5.9
__Requires:__ 6.3

__Tested up to:__ 6.4
__Tested up to:__ 6.6

__License:__ [GPL-2.0+](https://www.gnu.org/licenses/gpl-2.0.html)

Expand All @@ -22,11 +22,11 @@ Better Search replaces the default WordPress search with a better search engine

Are you looking for a way to improve your WordPress site search and make it easier for your visitors to find what they need? If so, you need __[Better Search](https://webberzone.com/plugins/better-search/)__, the plugin that replaces the default WordPress search engine with a more powerful and relevant one.

**Better Search** is not just a simple search plugin. It is a complete solution that gives you full control over your site search results. You can customize the output, fine tune the relevance, search within different fields and post types, track the popular searches, and much more.
__Better Search__ is not just a simple search plugin. It is a complete solution that gives you full control over your site search results. You can customize the output, fine tune the relevance, search within different fields and post types, track the popular searches, and much more.

With __Better Search__, you can make your site search more user-friendly and engaging. You can display a "search heatmap" of the most popular searches on your site, either as a widget or a shortcode. You can also use your own template file and CSS styles to match your theme perfectly.

**Better Search** has its own caching system and is also compatible with caching plugins like WP Super Cache and W3 Total Cache, so you don't have to worry about performance issues. It also has a profanity filter that lets you block unwanted words from search queries. And it is translation ready, so you can use it in any language.
__Better Search__ has its own caching system and is also compatible with caching plugins like WP Super Cache and W3 Total Cache, so you don't have to worry about performance issues. It also has a profanity filter that lets you block unwanted words from search queries. And it is translation ready, so you can use it in any language.

Here are some of the main features of __Better Search__:

Expand Down Expand Up @@ -77,6 +77,10 @@ Alternatively, search for __Better Search__ from Plugins » Add New within

## Frequently Asked Questions

Check out the [FAQ on the plugin page](https://wordpress.org/plugins/better-search/faq/) for a detailed list of questions and answers
Check out the [FAQ on the plugin page](https://wordpress.org/plugins/better-search/faq/) for a detailed list of questions and answers.

If your question isn't listed there, please create a new post in the [WordPress.org support forum](https://wordpress.org/support/plugin/better-search). I monitor the forums regularly. If you're looking for more advanced *paid* support, please see [details here](https://webberzone.com/support/).

## How can I report security bugs?

You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team help validate, triage and handle any security vulnerabilities. [Report a security vulnerability.](https://patchstack.com/database/vdp/better-search)
36 changes: 13 additions & 23 deletions better-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Plugin Name: Better Search
* Plugin URI: https://webberzone.com/plugins/better-search/
* Description: Replace the default WordPress search with a contextual search. Search results are sorted by relevancy ensuring a better visitor search experience.
* Version: 3.3.1
* Version: 4.0.0-beta1
* Author: WebberZone
* Author URI: https://webberzone.com/
* Text Domain: better-search
Expand All @@ -34,7 +34,7 @@
*
* @since 2.9.3
*/
define( 'BETTER_SEARCH_VERSION', '3.3.0' );
define( 'BETTER_SEARCH_VERSION', '4.0.0' );

/**
* Holds the filesystem directory path (with trailing slash) for Better Search
Expand Down Expand Up @@ -67,35 +67,25 @@
// Load the autoloader.
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/autoloader.php';

/**
* The code that runs during plugin activation.
*
* @since 3.3.0
*
* @param bool $network_wide Whether the plugin is being activated network-wide.
*/
function activate_bsearch( $network_wide ) {
Admin\Activator::activation_hook( $network_wide );
}
register_activation_hook( __FILE__, __NAMESPACE__ . '\activate_bsearch' );

/**
* The main function responsible for returning the one true WebberZone Snippetz instance to functions everywhere.
*
* @since 3.3.0
*/
function load_bsearch() {
Main::get_instance();
if ( ! function_exists( __NAMESPACE__ . '\load_bsearch' ) ) {
/**
* The main function responsible for returning the one true WebberZone Snippetz instance to functions everywhere.
*
* @since 3.3.0
*/
function load_bsearch() {
Main::get_instance();
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\load_bsearch' );
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\load_bsearch' );

/*
*----------------------------------------------------------------------------
* Include files
*----------------------------------------------------------------------------
*/
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/options-api.php';
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/class-better-search.php';
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/class-better-search-core-query.php';
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/class-better-search-query.php';
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/functions.php';
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/general-template.php';
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"wp-coding-standards/wpcs": "^2.3",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"yoast/phpunit-polyfills": "^1.0",
"yoast/phpunit-polyfills": "^3.0",
"phpunit/phpunit": "^5.7.21 || ^6.5 || ^7.5"
},
"config": {
Expand All @@ -39,4 +39,4 @@
"scripts": {
"phpstan": "vendor/bin/phpstan analyse --memory-limit=2048M"
}
}
}
51 changes: 51 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@webberzone/better-search",
"version": "4.0.0",
"description": "Better Search replaces the default WordPress search with a better search engine that gives contextual results sorted by relevance",
"author": "WebberZone",
"license": "GPL-2.0-or-later",
"main": "index.js",
"scripts": {
"build": "wp-scripts build --webpack-src-dir=includes/frontend/blocks/src/ --output-path=includes/frontend/blocks/build/",
"build:query": "wp-scripts build --webpack-src-dir=includes/pro/blocks/src/query/ --output-path=includes/pro/blocks/build/query/",
"build:featured-image": "wp-scripts build --webpack-src-dir=includes/pro/blocks/src/featured-image/ --output-path=includes/pro/blocks/build/featured-image/",
"build:pro": "npm run build:query && npm run build:featured-image && npm run build:popular-posts-pro",
"build:all": "npm run build && npm run build:pro",
"format": "wp-scripts format ./includes/pro/blocks/src/ ./includes/frontend/blocks/src/",
"format:free": "wp-scripts format ./includes/frontend/blocks/src/",
"format:pro": "wp-scripts format ./includes/pro/blocks/src/",
"lint:css": "wp-scripts lint-style ./includes/pro/blocks/src/ ./includes/frontend/blocks/src/",
"lint:js": "wp-scripts lint-js ./includes/pro/blocks/src/ ./includes/frontend/blocks/src/",
"packages-update": "wp-scripts packages-update",
"start": "wp-scripts start --webpack-src-dir=includes/frontend/blocks/src/ --output-path=includes/frontend/blocks/build/",
"start:featured-image": "wp-scripts start --webpack-src-dir=includes/pro/blocks/src/featured-image/ --output-path=includes/pro/blocks/build/featured-image/",
"start:query": "wp-scripts start --webpack-src-dir=includes/pro/blocks/src/query/ --output-path=includes/pro/blocks/build/query/",
"start:pro": "npm run start:query & npm run start:featured-image & npm run start:popular-posts-pro",
"start:all": "npm run start & npm run start:pro",
"zip": "wp-scripts plugin-zip"
},
"files": [
"css",
"freemius",
"includes",
"languages",
"README.md",
"better-search.php",
"index.php",
"uninstaller.php",
"changelog.txt",
"readme.txt",
"default.png",
"default2.png",
"wpml-config.xml"
],
"devDependencies": {
"@wordpress/prettier-config": "^4.7.0",
"@wordpress/scripts": "^27"
},
"dependencies": {
"@wordpress/icons": "^10.7.0",
"clsx": "^2.1.1",
"uuid": "^10.0.0"
}
}
12 changes: 10 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: webberzone, Ajay
Tags: search, Better Search, related search, relevant search, search results, contextual search, heatmap, popular searches, top searches, relevance
Donate link: https://ajaydsouza.com/donate/
Stable tag: 3.3.1
Requires at least: 5.9
Tested up to: 6.4
Requires at least: 6.3
Tested up to: 6.6
Requires PHP: 7.4
License: GPLv2 or later

Expand Down Expand Up @@ -104,9 +104,17 @@ You can turn the filter off by emptying the list.

Know of a better profanity filter? Suggest one in the [forums](https://wordpress.org/support/plugin/better-search).

= How can I report security bugs? =

You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team help validate, triage and handle any security vulnerabilities. [Report a security vulnerability.](https://patchstack.com/database/vdp/better-search)


== Changelog ==

= 3.4.0 =



= 3.3.1 =

* Security fix: Potential Cross Site Scripting (XSS) vulnerability. Thanks to Abdi Pranata for reporting this via Patchstack [https://patchstack.com/](https://patchstack.com/)
Expand Down

0 comments on commit a572329

Please sign in to comment.