Skip to content

Commit

Permalink
Merge pull request #163 from WebDevStudios/chore/prep-release-2.0.0
Browse files Browse the repository at this point in the history
Chore/prep release 2.0.0
  • Loading branch information
richaber authored Jul 24, 2021
2 parents 2998778 + 9cdbc72 commit 2e2de12
Show file tree
Hide file tree
Showing 135 changed files with 1,310 additions and 1,007 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/erbium
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
12 changes: 10 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: WebDevStudios, williamsba1, gregrickaby, tw2113, richaber, mrasharirfan
Tags: Search, Algolia, Autocomplete, instant-search, relevant search, search highlight, faceted search, find-as-you-type search, suggest, search by category, ajax search, better search, custom search
Requires at least: 5.0
Tested up to: 5.7
Tested up to: 5.8
Requires PHP: 7.2
Stable tag: 1.8.0
Stable tag: 2.0.0
License: GNU General Public License v2.0, MIT License

Improve search on your site. Autocomplete is included, along with full control over look, feel and relevance.
Expand Down Expand Up @@ -106,6 +106,14 @@ WebDevStudios provides end-to-end WordPress opportunities from strategy and plan

Follow along with the changelog on [Github](https://github.com/WebDevStudios/wp-search-with-algolia/releases).

= 2.0.0 =
* Breaking changes for users with customized autocomplete.php / instantsearch.php template in their theme.
* Update autocomplete.php and instantsearch.php templates for compatibility with new JS libs.
* Update Algolia JavaScript API Client to 4.10.3
* Update Algolia InstantSearch.js to 4.25.2
* Update Algolia Autocomplete.js to 0.38.0
* Update Algolia PHP API Client to 3.0.2

= 1.8.0 =
* Focus on template versioning and update messaging
* Add Algolia_Template_Utils class
Expand Down
4 changes: 2 additions & 2 deletions algolia.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WP Search with Algolia
* Plugin URI: https://github.com/WebDevStudios/wp-search-with-algolia
* Description: Integrate the powerful Algolia search service with WordPress
* Version: 1.8.0
* Version: 2.0.0
* Requires at least: 5.0
* Requires PHP: 7.2
* Author: WebDevStudios
Expand All @@ -26,7 +26,7 @@
}

// The Algolia Search plugin version.
define( 'ALGOLIA_VERSION', '1.8.0' );
define( 'ALGOLIA_VERSION', '2.0.0' );

// The minmum required PHP version.
define( 'ALGOLIA_MIN_PHP_VERSION', '7.2' );
Expand Down
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webdevstudios/wp-search-with-algolia",
"version": "1.6.0",
"version": "2.0.0",
"description": "Integrate the powerful Algolia search service with WordPress.",
"authors": [
{
Expand All @@ -21,17 +21,17 @@
"composer/installers": "~1.0"
},
"require-dev": {
"algolia/algoliasearch-client-php": "^3.0.0",
"psr/http-message": "~1.0.0",
"psr/log": "~1.0.0",
"psr/simple-cache": "~1.0.0",
"webdevstudios/php-coding-standards": "^1.0.0",
"phpcompatibility/phpcompatibility-wp": "^2.0.0",
"slowprog/composer-copy-file": "^0.3.2"
"algolia/algoliasearch-client-php": "^3.0.2",
"psr/http-message": "~1.0.1",
"psr/log": "~1.0.2",
"psr/simple-cache": "~1.0.1",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"phpcompatibility/phpcompatibility-wp": "^2.1.2",
"wp-coding-standards/wpcs": "^2.3.0",
"slowprog/composer-copy-file": "^0.3.3"
},
"extra": {
"installer-name": "wp-search-with-algolia",
"phpcodesniffer-search-depth": 5,
"copy-file": {
"vendor/algolia": "includes/libraries"
},
Expand All @@ -42,7 +42,7 @@
},
"scripts": {
"lint": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --standard=phpcs.xml --extensions=php .",
"lint:fix": "vendor/bin/phpcbf",
"lint:fix": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --standard=phpcs.xml --extensions=php .",
"post-install-cmd": [
"SlowProg\\CopyFile\\ScriptHandler::copy"
],
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/class-algolia-admin-page-autocomplete.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ public function autocomplete_enabled_callback() {
$indices = $this->autocomplete_config->get_form_data();
$checked = 'yes' === $value ? 'checked ' : '';
$disabled = empty( $indices ) ? 'disabled ' : '';
?>
?>
<input type='checkbox' name='algolia_autocomplete_enabled' value='yes' <?php echo esc_html( $checked . ' ' . $disabled ); ?>/>
<?php
<?php
}

/**
Expand Down
19 changes: 10 additions & 9 deletions includes/admin/class-algolia-admin-page-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public function __construct( Algolia_Plugin $plugin ) {
*/
public function add_action_links( array $links ) {
return array_merge(
$links, array(
$links,
array(
'<a href="' . esc_url( admin_url( 'admin.php?page=' . $this->slug ) ) . '">' . esc_html__( 'Settings', 'wp-search-with-algolia' ) . '</a>',
)
);
Expand Down Expand Up @@ -206,10 +207,10 @@ public function application_id_callback() {
$settings = $this->plugin->get_settings();
$setting = $settings->get_application_id();
$disabled_html = $settings->is_application_id_in_config() ? ' disabled' : '';
?>
?>
<input type="text" name="algolia_application_id" class="regular-text" value="<?php echo esc_attr( $setting ); ?>" <?php echo esc_html( $disabled_html ); ?>/>
<p class="description" id="home-description"><?php esc_html_e( 'Your Algolia Application ID.', 'wp-search-with-algolia' ); ?></p>
<?php
<?php
}

/**
Expand All @@ -223,10 +224,10 @@ public function search_api_key_callback() {
$setting = $settings->get_search_api_key();
$disabled_html = $settings->is_search_api_key_in_config() ? ' disabled' : '';

?>
?>
<input type="text" name="algolia_search_api_key" class="regular-text" value="<?php echo esc_attr( $setting ); ?>" <?php echo esc_html( $disabled_html ); ?>/>
<p class="description" id="home-description"><?php esc_html_e( 'Your Algolia Search-only API key (public).', 'wp-search-with-algolia' ); ?></p>
<?php
<?php
}

/**
Expand All @@ -239,10 +240,10 @@ public function api_key_callback() {
$settings = $this->plugin->get_settings();
$setting = $settings->get_api_key();
$disabled_html = $settings->is_api_key_in_config() ? ' disabled' : '';
?>
?>
<input type="password" name="algolia_api_key" class="regular-text" value="<?php echo esc_attr( $setting ); ?>" <?php echo esc_html( $disabled_html ); ?>/>
<p class="description" id="home-description"><?php esc_html_e( 'Your Algolia ADMIN API key (kept private).', 'wp-search-with-algolia' ); ?></p>
<?php
<?php
}

/**
Expand All @@ -255,10 +256,10 @@ public function index_name_prefix_callback() {
$settings = $this->plugin->get_settings();
$index_name_prefix = $settings->get_index_name_prefix();
$disabled_html = $settings->is_index_name_prefix_in_config() ? ' disabled' : '';
?>
?>
<input type="text" name="algolia_index_name_prefix" value="<?php echo esc_attr( $index_name_prefix ); ?>" <?php echo esc_html( $disabled_html ); ?>/>
<p class="description" id="home-description"><?php esc_html_e( 'This prefix will be prepended to your index names.', 'wp-search-with-algolia' ); ?></p>
<?php
<?php
}

/**
Expand Down
9 changes: 6 additions & 3 deletions includes/class-algolia-autocomplete-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public function get_form_data() {
}

usort(
$config, function( $a, $b ):int {
$config,
function( $a, $b ):int {
return $a['position'] <=> $b['position'];
}
);
Expand Down Expand Up @@ -175,14 +176,16 @@ public function get_config() {

// Remove manually disabled indices.
$config = array_filter(
$config, function( $item ) {
$config,
function( $item ) {
return (bool) $item['enabled'];
}
);

// Sort the indices.
usort(
$config, function( $a, $b ):int {
$config,
function( $a, $b ):int {
return $a['position'] <=> $b['position'];
}
);
Expand Down
9 changes: 6 additions & 3 deletions includes/class-algolia-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ public function load_indices() {
$searchable_post_types = get_post_types(
array(
'exclude_from_search' => false,
), 'names'
),
'names'
);
$searchable_post_types = (array) apply_filters( 'algolia_searchable_post_types', $searchable_post_types );
$this->indices[] = new Algolia_Searchable_Posts_Index( $searchable_post_types );
Expand Down Expand Up @@ -353,7 +354,8 @@ public function get_indices( array $args = array() ) {

if ( isset( $args['enabled'] ) && true === $args['enabled'] ) {
$indices = array_filter(
$indices, function( $index ) {
$indices,
function( $index ) {
return $index->is_enabled();
}
);
Expand All @@ -362,7 +364,8 @@ public function get_indices( array $args = array() ) {
if ( isset( $args['contains'] ) ) {
$contains = (string) $args['contains'];
$indices = array_filter(
$indices, function( $index ) use ( $contains ) {
$indices,
function( $index ) use ( $contains ) {
return $index->contains_only( $contains );
}
);
Expand Down
3 changes: 2 additions & 1 deletion includes/class-algolia-template-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ public function template_loader( $template ) {
*/
public function load_instantsearch_template() {
add_action(
'wp_enqueue_scripts', function () {
'wp_enqueue_scripts',
function () {
// Enqueue the instantsearch.js default styles.
wp_enqueue_style( 'algolia-instantsearch' );

Expand Down
3 changes: 2 additions & 1 deletion includes/indices/class-algolia-users-index.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ protected function get_records( $item ) {
$avatar_size = 32;
if ( function_exists( 'get_avatar_url' ) ) {
$record['avatar_url'] = get_avatar_url(
$item->ID, array(
$item->ID,
array(
'size' => $avatar_size,
)
);
Expand Down
3 changes: 2 additions & 1 deletion includes/watchers/class-algolia-user-changes-watcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ public function on_delete_post( $post_id ) {
// Todo: this is not optimal given it would be triggered for every future triggered hook.
// Todo: needs to be changed.
add_action(
'after_delete_post', function() use ( $watcher, $author_id ) {
'after_delete_post',
function() use ( $watcher, $author_id ) {
$watcher->sync_item( $author_id );
}
);
Expand Down
2 changes: 1 addition & 1 deletion js/algoliasearch/dist/algoliasearch-lite.esm.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function encode(format, ...args) {
return format.replace(/%s/g, () => encodeURIComponent(args[i++]));
}

const version = '4.10.2';
const version = '4.10.3';

const AuthMode = {
/**
Expand Down
Loading

0 comments on commit 2e2de12

Please sign in to comment.