Skip to content
This repository has been archived by the owner on May 9, 2019. It is now read-only.

Commit

Permalink
Merge pull request #577 from algolia/develop
Browse files Browse the repository at this point in the history
release 2.2.0
  • Loading branch information
rayrutjes authored May 11, 2017
2 parents 79582f0 + cc9d131 commit 43aa048
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 17 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2.2.0

- Ensure frontend dependencies are loaded (especially 'wp-util': wp.template())
- Escape ET Divi builder shortcodes
- Force autocomplete dropdown to be displayed above everything else

# 2.1.0

- Introduce a new filter to allow to customize synced indices
Expand All @@ -15,7 +21,7 @@ To upgrade from 1.7.0, follow the [Upgrade instructions](https://community.algol
- Allow to re-order results by drag and drop from the autocomplete settings page
- Allow to customize the header label of each result type of the autocomplete dropdown menu
- Allow to disable powered by logo from the admin
- Allow to re-index every index separatly
- Allow to re-index every index separately
- Keep existing index settings when re-indexing
- Keep existing synonyms when re-indexing
- Add a filter hook to specify the thumbnail formats to send to Algolia
Expand Down
6 changes: 6 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ Automatic updates should work like a charm; as always though, ensure you backup

== Changelog ==

= 2.2.0 =

- Ensure frontend dependencies are loaded (especially 'wp-util': wp.template())
- Escape ET Divi builder shortcodes
- Force autocomplete dropdown to be displayed above everything else

= 2.1.0 =

- Introduce a new filter to allow to customize synced indices
Expand Down
4 changes: 2 additions & 2 deletions algolia.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Plugin Name: Search by Algolia – Instant & Relevant results
* Plugin URI: https://community.algolia.com/wordpress
* Description: Search by Algolia is the smartest way to improve search on your site. Autocomplete is included, along with full control over look, feel and relevance.
* Version: 2.1.0
* Version: 2.2.0
* Author: Algolia
* Author URI: https://www.algolia.com/
* License: MIT License, GNU General Public License v2.0
Expand All @@ -30,7 +30,7 @@
}

// The Algolia Search plugin version.
define( 'ALGOLIA_VERSION', '2.1.0' );
define( 'ALGOLIA_VERSION', '2.2.0' );
define( 'ALGOLIA_PLUGIN_BASENAME', plugin_basename(__FILE__) );

if ( ! defined( 'ALGOLIA_PATH' ) ) {
Expand Down
4 changes: 3 additions & 1 deletion assets/css/algolia-autocomplete.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.algolia-autocomplete {
z-index: 999999 !important;
}
.aa-dropdown-menu {
/* we set the width in JS */
font-family: sans-serif;
z-index: 999999;
background-color: #fff;
border-top: none;
border-bottom-left-radius: 4px;
Expand Down
2 changes: 1 addition & 1 deletion docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var siteBuild = Metalsmith(__dirname)
.metadata({
title: 'Algolia Search Plugin for WordPress',
url: 'https://github.com/algolia/algoliasearch-wordpress',
version: '2.1.0',
version: '2.2.0',
time: new Date().getTime(),
tweets:['666409672006606848','675635141713248256','684325213329305600','669552193419259904','672084577805012992','714625225359425536','669555344725696512','688027404741308417','783838738791227392','782584336323227648','787040561215582208','698839453469544448','687060441881796608','705467858961223680','665028633048821760','654785137272459265','661567388983279617','708574926962294784','707863195025858560'],
header: algoliaComponents.communityHeader(communityHeaderData)
Expand Down
6 changes: 3 additions & 3 deletions includes/class-algolia-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ public function register_assets()

// JS.
wp_register_script( 'algolia-search', plugin_dir_url( __FILE__ ) . '../assets/js/algoliasearch/algoliasearch.jquery'.$suffix.'.js', array( 'jquery', 'underscore', 'wp-util' ), ALGOLIA_VERSION );
wp_register_script( 'algolia-autocomplete', plugin_dir_url( __FILE__ ) . '../assets/js/autocomplete.js/autocomplete'.$suffix.'.js', array(), ALGOLIA_VERSION );
wp_register_script( 'algolia-autocomplete-noconflict', plugin_dir_url( __FILE__ ) . '../assets/js/autocomplete-noconflict.js', array(), ALGOLIA_VERSION );
wp_register_script( 'algolia-autocomplete', plugin_dir_url( __FILE__ ) . '../assets/js/autocomplete.js/autocomplete'.$suffix.'.js', array( 'jquery', 'underscore', 'wp-util' ), ALGOLIA_VERSION );
wp_register_script( 'algolia-autocomplete-noconflict', plugin_dir_url( __FILE__ ) . '../assets/js/autocomplete-noconflict.js', array( 'algolia-autocomplete' ), ALGOLIA_VERSION );

wp_register_script( 'algolia-instantsearch', plugin_dir_url( __FILE__ ) . '../assets/js/instantsearch.js/instantsearch-preact'.$suffix.'.js', array(), ALGOLIA_VERSION );
wp_register_script( 'algolia-instantsearch', plugin_dir_url( __FILE__ ) . '../assets/js/instantsearch.js/instantsearch-preact'.$suffix.'.js', array( 'jquery', 'underscore', 'wp-util' ), ALGOLIA_VERSION );
}

/**
Expand Down
3 changes: 1 addition & 2 deletions includes/class-algolia-template-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ public function load_instantsearch_template() {
// Enqueue the instantsearch.js default styles.
wp_enqueue_style( 'algolia-instantsearch' );

// Ensure jQuery is loaded.
wp_enqueue_script( 'jquery' );


// Enqueue the instantsearch.js library.
wp_enqueue_script( 'algolia-instantsearch' );
Expand Down
17 changes: 11 additions & 6 deletions includes/class-algolia-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,27 +172,32 @@ public static function prepare_content( $content ) {

public static function remove_content_noise( $content ) {
$noise_patterns = array(
// strip out comments
// strip out comments.
"'<!--(.*?)-->'is",
// strip out cdata
// strip out cdata.
"'<!\[CDATA\[(.*?)\]\]>'is",
// Per sourceforge http://sourceforge.net/tracker/?func=detail&aid=2949097&group_id=218559&atid=1044037
// Script tags removal now preceeds style tag removal.
// strip out <script> tags
"'<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>'is",
"'<\s*script\s*>(.*?)<\s*/\s*script\s*>'is",
// strip out <style> tags
// strip out <style> tags.
"'<\s*style[^>]*[^/]>(.*?)<\s*/\s*style\s*>'is",
"'<\s*style\s*>(.*?)<\s*/\s*style\s*>'is",
// strip out preformatted tags
// strip out preformatted tags.
"'<\s*(?:code)[^>]*>(.*?)<\s*/\s*(?:code)\s*>'is",
// strip out <pre> tags
// strip out <pre> tags.
"'<\s*pre[^>]*[^/]>(.*?)<\s*/\s*pre\s*>'is",
"'<\s*pre\s*>(.*?)<\s*/\s*pre\s*>'is",
);

// If there is ET builder (Divi), remove shortcodes.
if ( function_exists( 'et_pb_is_pagebuilder_used' ) ) {
$noise_patterns[] = '/\[\/?et_pb.*?\]/';
}

foreach ( $noise_patterns as $pattern ) {
$content = preg_replace($pattern, '', $content);
$content = preg_replace( $pattern, '', $content );
}

return $content;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "algoliasearch-wordpress",
"version": "2.1.0",
"version": "2.2.0",
"description": "Algolia Search plugin for WordPress is a drop in replacement for WordPress search. It also provides an optional \"as you type\" auto-complete experience.",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit 43aa048

Please sign in to comment.