Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.5.2 #612

Merged
merged 6 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
git commit -m "Release $VERSION"
git tag "$VERSION"
git push --tags
gh release create "$VERSION" -t "$VERSION" --generate-notes
gh release create "$VERSION" -t "$VERSION" --generate-notes -d
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ github.token }}
18 changes: 9 additions & 9 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,22 @@ on:
jobs:
lint:
runs-on: ubuntu-latest
container:
image: quay.io/pantheon-public/build-tools-ci:8.x-php7.4
options: --user root
name: Lint

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/vendor
key: test-lint-dependencies-{{ checksum "composer.json" }}
restore-keys: test-lint-dependencies-{{ checksum "composer.json" }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Install dependencies
run: composer install -n --prefer-dist

- name: Run PHP Lint
run: composer phpcs
validate-readme-spacing:
Expand All @@ -38,7 +35,6 @@ jobs:
uses: actions/checkout@v3
- uses: pantheon-systems/validate-readme-spacing@v1
test-phpunit:
needs: lint
runs-on: ubuntu-latest
services:
mariadb:
Expand Down Expand Up @@ -80,7 +76,9 @@ jobs:
run: bash bin/phpunit-test.sh

test-behat:
needs: test-phpunit
needs:
- test-phpunit
- lint
runs-on: ubuntu-latest
container:
image: quay.io/pantheon-public/build-tools-ci:8.x-php7.4
Expand Down Expand Up @@ -131,6 +129,8 @@ jobs:
fi
terminus auth:login --machine-token=$TERMINUS_TOKEN

- name: Validate Fixture WordPress Version
run: ./bin/validate-fixture-version.sh
- name: Prepare for Behat tests
run: ./bin/behat-prepare.sh

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changelog ##

### 2.5.2 (September 12, 2023) ###
* Fix incompatibility with Object Cache Pro when running "wp solr index" [[#611](https://github.com/pantheon-systems/solr-power/pull/611)]

### 2.5.1 ###
* Fix Solr not indexing automatically [[#598](https://github.com/pantheon-systems/solr-power/pull/598)]
* Fixed issue with empty/zero value for posts_per_page [[#599](https://github.com/pantheon-systems/solr-power/pull/599)] (props @threeiem)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
**Tags:** search
**Requires at least:** 4.6
**Requires PHP:** 7.1
**Tested up to:** 6.2
**Stable tag:** 2.5.1
**Tested up to:** 6.3
**Stable tag:** 2.5.2
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -13,7 +13,7 @@ Improve your user experience with the Apache Solr search engine for your WordPre
## Description ##

[![Actively Maintained](https://img.shields.io/badge/Pantheon-Actively_Maintained-yellow?logo=pantheon&color=FFDC28)](https://pantheon.io/docs/oss-support-levels#actively-maintained-support)
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/pantheon-systems/solr-power/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/pantheon-systems/solr-power/tree/main)
[![Lint and Test](https://github.com/pantheon-systems/solr-power/actions/workflows/lint-test.yml/badge.svg)](https://github.com/pantheon-systems/solr-power/actions/workflows/lint-test.yml)

Search is critical for your site, but the default search for WordPress leaves a lot to be desired. Improve your user experience with the Apache Solr search engine for your WordPress website.

Expand Down
10 changes: 2 additions & 8 deletions bin/behat-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ rm -rf $PREPARE_DIR/wp-content/plugins/solr-power/node_modules/
rm -rf $PREPARE_DIR/wp-content/plugins/solr-power/tests/
cd $BASH_DIR/..

# Download the latest Classic Editor release from WordPress.org
wget -O $PREPARE_DIR/classic-editor.zip https://downloads.wordpress.org/plugin/classic-editor.zip
unzip $PREPARE_DIR/classic-editor.zip -d $PREPARE_DIR
mv $PREPARE_DIR/classic-editor $PREPARE_DIR/wp-content/plugins/
rm $PREPARE_DIR/classic-editor.zip

###
# Push files to the environment
###
Expand All @@ -92,6 +86,6 @@ terminus build:workflow:wait $TERMINUS_SITE.$TERMINUS_ENV
# Set up WordPress, theme, and plugins for the test run
###
terminus wp $SITE_ENV -- core install --title=$TERMINUS_ENV-$TERMINUS_SITE --url=$PANTHEON_SITE_URL --admin_user=$WORDPRESS_ADMIN_USERNAME --admin_email=$WORDPRESS_ADMIN_EMAIL --admin_password=$WORDPRESS_ADMIN_PASSWORD
terminus wp $SITE_ENV -- plugin activate solr-power classic-editor
terminus wp $SITE_ENV -- theme activate twentyseventeen
terminus wp $SITE_ENV -- plugin activate solr-power
terminus wp $SITE_ENV -- theme activate twentytwentythree
terminus wp $SITE_ENV -- rewrite structure '/%year%/%monthnum%/%day%/%postname%/'
42 changes: 42 additions & 0 deletions bin/validate-fixture-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'

main(){
export TERMINUS_HIDE_GIT_MODE_WARNING=1
local DIRNAME=$(dirname "$0")

if [ -z "${TERMINUS_SITE}" ]; then
echo "TERMINUS_SITE environment variable must be set"
exit 1
fi

if ! terminus whoami > /dev/null; then
if [ -z "${TERMINUS_TOKEN}" ]; then
echo "TERMINUS_TOKEN environment variable must be set or terminus already logged in."
exit 1
fi
terminus auth:login --machine-token="${TERMINUS_TOKEN}"
fi
# Use find to locate the file with a case-insensitive search
README_FILE_PATH=$(find ${DIRNAME}/.. -iname "readme.txt" -print -quit)
if [[ -z "$README_FILE_PATH" ]]; then
echo "readme.txt not found."
exit 1
fi

local TESTED_UP_TO
TESTED_UP_TO=$(grep -i "Tested up to:" "${README_FILE_PATH}" | tr -d '\r\n' | awk -F ': ' '{ print $2 }')
echo "Tested Up To: ${TESTED_UP_TO}"
local FIXTURE_VERSION
FIXTURE_VERSION=$(terminus wp "${TERMINUS_SITE}.dev" -- core version)
echo "Fixture Version: ${FIXTURE_VERSION}"

if ! php -r "exit(version_compare('${TESTED_UP_TO}', '${FIXTURE_VERSION}'));"; then
echo "${FIXTURE_VERSION} is less than ${TESTED_UP_TO}"
echo "Please update ${TERMINUS_SITE} to at least WordPress ${TESTED_UP_TO}"
exit 1
fi
}

main
46 changes: 20 additions & 26 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions includes/class-solrpower-batch-index.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,18 @@ private static function clear_object_cache() {
return;
}

$wp_object_cache->group_ops = array();
$wp_object_cache->stats = array();
$wp_object_cache->memcache_debug = array();
$wp_object_cache->cache = array();
$properties_to_reset = array( 'group_ops', 'stats', 'memcache_debug', 'cache' );
$reflection = new ReflectionClass( $wp_object_cache );

// Set the property to an empty array if it exists and is not private/protected.
foreach ( $properties_to_reset as $property_name ) {
if ( $reflection->hasProperty( $property_name ) ) {
$property = $reflection->getProperty( $property_name );
if ( ! $property->isPrivate() && ! $property->isProtected() ) {
$wp_object_cache->$property_name = array();
}
}
}
if ( is_callable( $wp_object_cache, '__remoteset' ) ) {
$wp_object_cache->__remoteset();
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "solr-power",
"version": "2.5.1",
"version": "2.5.2",
"repository": {
"type": "git",
"url": "https://github.com/pantheon-systems/solr-power.git"
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: getpantheon, Outlandish Josh, 10up, collinsinternet, andrew.taylor
Tags: search
Requires at least: 4.6
Requires PHP: 7.1
Tested up to: 6.2
Stable tag: 2.5.1
Tested up to: 6.3
Stable tag: 2.5.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -235,6 +235,9 @@ Please report security bugs found in the source code of the Solr Power plugin th

== Changelog ==

= 2.5.2 (September 12, 2023) =
* Fix incompatibility with Object Cache Pro when running "wp solr index" [[#611](https://github.com/pantheon-systems/solr-power/pull/611)]

= 2.5.1 =
* Fix Solr not indexing automatically [[#598](https://github.com/pantheon-systems/solr-power/pull/598)]
* Fixed issue with empty/zero value for posts_per_page [[#599](https://github.com/pantheon-systems/solr-power/pull/599)] (props @threeiem)
Expand Down
4 changes: 2 additions & 2 deletions solr-power.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
/**
* Plugin Name: Solr Power
* Description: Allows WordPress sites to index and search content with ApacheSolr.
* Version: 2.5.1
* Version: 2.5.2
* Author: Pantheon
* Author URI: http://pantheon.io
* Text Domain: solr-for-wordpress-on-pantheon
*
* @package Solr_Power
**/

define( 'SOLR_POWER_VERSION', '2.5.1' );
define( 'SOLR_POWER_VERSION', '2.5.2' );

/**
* Copyright (c) 2011-2022 Pantheon, Matt Weber, Solr Power contributors
Expand Down