Skip to content

Commit acd982a

Browse files
committed
Merge branch 'develop' into trunk
2 parents 1800ad4 + 04324a8 commit acd982a

95 files changed

Lines changed: 12386 additions & 7270 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module.exports = {
44
extends: '@10up/eslint-config/wordpress',
55
rules: {
66
...defaultEslintrc.rules,
7+
'@wordpress/no-unsafe-wp-apis': 'off',
78
'jsdoc/check-tag-names': [
89
'error',
910
{
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
name: E2E Test
1+
name: E2e Tests
2+
3+
permissions:
4+
contents: read
5+
pull-requests: write
26

37
env:
8+
CI: true
49
COMPOSER_VERSION: "2"
510
COMPOSER_CACHE: "${{ github.workspace }}/.composer-cache"
611
NODE_VERSION: "20"
712
NODE_CACHE: "${{ github.workspace }}/node_modules_cache"
8-
CYPRESS_GOOGLE_MAPS_API_KEY: ${{ secrets.CYPRESS_GOOGLE_MAPS_API_KEY }}
13+
GOOGLE_MAPS_API_KEY: ${{ secrets.CYPRESS_GOOGLE_MAPS_API_KEY }}
14+
VECTOR_EMBEDDINGS_API_KEY: ${{ secrets.VECTOR_EMBEDDINGS_API_KEY }}
15+
VECTOR_EMBEDDINGS_API_URL: ${{ secrets.VECTOR_EMBEDDINGS_API_URL }}
16+
VECTOR_EMBEDDINGS_MODEL: ${{ secrets.VECTOR_EMBEDDINGS_MODEL }}
17+
AI_SEARCH_SUMMARY_API_URL: ${{ secrets.AI_SEARCH_SUMMARY_API_URL }}
18+
AI_SEARCH_SUMMARY_MODEL: ${{ secrets.AI_SEARCH_SUMMARY_MODEL }}
919

1020
on:
11-
schedule:
12-
- cron: '0 0 * * *'
1321
push:
1422
branches:
1523
- develop
@@ -20,20 +28,29 @@ on:
2028
- '[0-9].[0-9x]*' # Version branches: 4.x.x, 4.1.x, 5.x
2129

2230
jobs:
23-
cypress_local:
31+
e2e_local:
2432
name: ES ${{ matrix.esVersion }} - ${{ matrix.core.name }}
2533
runs-on: ubuntu-latest
34+
defaults:
35+
run:
36+
working-directory: ./elasticpress-labs
2637
strategy:
2738
fail-fast: false
2839
matrix:
29-
esVersion: ['7.10.1', '8.12.2']
40+
esVersion: ['7.10.1', '8.12.2', '9.1.5', 'EP.io']
3041
core:
3142
- {name: 'WP latest', version: ''}
32-
- {name: 'WP minimum', version: '6.0'}
43+
- {name: 'WP minimum', version: '6.2'}
3344

3445
steps:
3546
- name: Checkout
3647
uses: actions/checkout@v4
48+
with:
49+
path: elasticpress-labs
50+
51+
- name: Set path variable
52+
run: |
53+
echo "WORKING_DIR=$(pwd)" >> $GITHUB_ENV
3754
3855
- name: Prepare npm cache
3956
uses: actions/cache@v4
@@ -69,120 +86,56 @@ jobs:
6986
- name: Install dependencies
7087
run: npm ci --include=dev
7188

89+
- name: Install Playwright Browsers
90+
run: npx playwright install --with-deps
91+
7292
- name: Set up WP environment with Elasticsearch
7393
run: ES_VERSION=${{ matrix.esVersion }} npm run env:start
94+
if: matrix.esVersion != 'EP.io'
7495

75-
- name: Check ES response
76-
run: curl --connect-timeout 5 --max-time 10 --retry 5 --retry-max-time 40 --retry-all-errors http://localhost:8890
77-
78-
- name: Build asset
79-
run: npm run build
80-
81-
- name: Set up database
82-
run: npm run cypress:setup -- --wp-version=${{ matrix.core.version }}
83-
84-
- name: Test
85-
run: npm run cypress:run
86-
87-
- name: Make artifacts available
88-
uses: actions/upload-artifact@v4
89-
if: failure()
90-
with:
91-
name: cypress-artifact-${{ matrix.esVersion }}-${{ matrix.core.name }}
92-
retention-days: 2
93-
path: |
94-
${{ github.workspace }}/tests/cypress/screenshots/
95-
${{ github.workspace }}/tests/cypress/videos/
96-
${{ github.workspace }}/tests/cypress/logs/
97-
98-
- name: Stop Elasticsearch
99-
if: always()
100-
run: npm run es:stop
101-
102-
cypress_epio:
103-
name: EP.io - ${{ matrix.core.name }}
104-
runs-on: ubuntu-latest
105-
strategy:
106-
fail-fast: false
107-
matrix:
108-
core:
109-
- {name: 'WP latest', version: ''}
110-
- {name: 'WP minimum', version: '6.0'}
111-
112-
steps:
113-
- name: Checkout
114-
uses: actions/checkout@v4
115-
116-
- name: Prepare npm cache
117-
uses: actions/cache@v4
118-
with:
119-
path: ${{ env.NODE_CACHE }}
120-
key: npm-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
121-
restore-keys: |
122-
npm-${{ env.NODE_VERSION }}-
123-
- name: Prepare composer cache
124-
uses: actions/cache@v4
125-
with:
126-
path: ${{ env.COMPOSER_CACHE }}
127-
key: composer-${{ env.COMPOSER_VERSION }}-${{ hashFiles('**/composer.lock') }}
128-
restore-keys: |
129-
composer-${{ env.COMPOSER_VERSION }}-
130-
131-
- name: Set PHP version
132-
uses: shivammathur/setup-php@v2
133-
with:
134-
php-version: '8.2'
135-
extensions: :php-psr
136-
tools: cs2pr
137-
coverage: none
138-
139-
- name: composer install
140-
run: composer install
141-
142-
- name: "Install node v${{ env.NODE_VERSION }}"
143-
uses: actions/setup-node@v4
144-
with:
145-
node-version: ${{ env.NODE_VERSION }}
146-
147-
- name: Install dependencies
148-
run: npm ci --include=dev
149-
150-
- name: Set up WP environment
96+
- name: Set up WP environment with Elasticsearch (EP.io)
15197
run: |
15298
npm run env start
15399
npm run env:install-tests-cli
100+
if: matrix.esVersion == 'EP.io'
101+
102+
- name: Check ES response
103+
run: curl --connect-timeout 5 --max-time 10 --retry 5 --retry-max-time 40 --retry-all-errors http://localhost:8890
104+
if: matrix.esVersion != 'EP.io'
154105

155106
- name: Build asset
156107
run: npm run build
157108

158109
- name: Set up database
110+
run: npm run e2e:setup -- --wp-version=${{ matrix.core.version }} --ep-branch=develop --cf-access-client-id="${{ secrets.CF_ACCESS_CLIENT_ID }}" --cf-access-client-secret="${{ secrets.CF_ACCESS_CLIENT_SECRET }}"
111+
if: matrix.esVersion != 'EP.io'
112+
113+
- name: Set up database (EP.io)
159114
env:
160115
EPIO_HOST: ${{ vars.EPIO_HOST }}
161116
EPIO_INDEX_PREFIX: ${{ vars.EPIO_INDEX_PREFIX }}
162-
run: npm run cypress:setup -- --ep-host="$EPIO_HOST" --es-shield='${{ secrets.EP_CREDENTIALS }}' --ep-index-prefix="$EPIO_INDEX_PREFIX" --wp-version=${{ matrix.core.version }}
117+
run: npm run e2e:setup -- --ep-host="$EPIO_HOST" --es-shield='${{ secrets.EP_CREDENTIALS }}' --ep-index-prefix="$EPIO_INDEX_PREFIX" --wp-version=${{ matrix.core.version }} --ep-branch=develop --cf-access-client-id="${{ secrets.CF_ACCESS_CLIENT_ID }}" --cf-access-client-secret="${{ secrets.CF_ACCESS_CLIENT_SECRET }}"
118+
if: matrix.esVersion == 'EP.io'
163119

164-
- name: Test
165-
run: npm run cypress:run
120+
- name: Run Playwright tests
121+
run: npm run playwright:test
166122

167123
- name: Make artifacts available
168124
uses: actions/upload-artifact@v4
169125
if: failure()
170126
with:
171-
name: cypress-artifact-epio-${{ matrix.core.name }}
127+
name: playwright-report-${{ matrix.esVersion }}-${{ matrix.core.name }}
172128
retention-days: 2
173-
path: |
174-
${{ github.workspace }}/tests/cypress/screenshots/
175-
${{ github.workspace }}/tests/cypress/videos/
176-
${{ github.workspace }}/tests/cypress/logs/
129+
path: ${{ env.WORKING_DIR }}/tests/e2e/playwright-report/
177130

178131
- name: Delete Elasticsearch search templates
179-
if: always()
132+
if: ${{ !cancelled() && matrix.esVersion == 'EP.io' }}
180133
run: |
181134
./bin/wp-env-cli tests-wordpress "wp --allow-root plugin activate elasticpress elasticpress-labs"
182135
./bin/wp-env-cli tests-wordpress "wp --allow-root elasticpress-tests delete-all-search-templates"
183136
184137
- name: Delete Elasticsearch indices
185-
if: always()
138+
if: ${{ !cancelled() && matrix.esVersion == 'EP.io' }}
186139
run: |
187140
./bin/wp-env-cli tests-wordpress "wp --allow-root plugin activate elasticpress elasticpress-labs"
188141
./bin/wp-env-cli tests-wordpress "wp --allow-root elasticpress-tests delete-all-indices"

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ vendor
66
.idea
77
*.log
88
.phpunit.result.cache
9+
.env
910

1011
# Editors
1112
*.esproj
@@ -26,3 +27,12 @@ Session.vim
2627
# Windows
2728
Thumbs.db
2829
Desktop.ini
30+
31+
# Playwright
32+
/playwright-report/
33+
/test-results/
34+
/tests/e2e/dist/
35+
/tests/e2e/test-results/
36+
/tests/e2e/playwright-report/
37+
/tests/e2e/blob-report/
38+
/tests/e2e/playwright/.cache/

.lintstagedrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"*.css": [
33
"10up-toolkit lint-style"
44
],
5-
"*.{js,jsx}": [
5+
"*.{js,jsx,ts,tsx}": [
66
"10up-toolkit lint-js"
77
],
88
"*.php": [

.wp-env.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,19 @@
1010
"https://downloads.wordpress.org/theme/twentytwentyone.zip"
1111
],
1212
"plugins": [
13-
"https://downloads.wordpress.org/plugin/elasticpress.zip"
13+
"https://downloads.wordpress.org/plugin/elasticpress.zip",
14+
"https://downloads.wordpress.org/plugin/debug-bar.zip",
15+
"https://downloads.wordpress.org/plugin/debug-bar-elasticpress.zip"
1416
],
1517
"mappings": {
1618
"wp-content/plugins/elasticpress-labs": ".",
17-
".htaccess": "./tests/cypress/wordpress-files/.htaccess",
18-
"wp-content/mu-plugins/delete-all-templates.php": "./tests/cypress/wordpress-files/test-mu-plugins/delete-all-templates.php",
19-
"wp-content/mu-plugins/unique-index-name.php": "./tests/cypress/wordpress-files/test-mu-plugins/unique-index-name.php",
20-
"wp-content/mu-plugins/disable-welcome-guide.php": "./tests/cypress/wordpress-files/test-mu-plugins/disable-welcome-guide.php",
21-
"wp-content/plugins/geo-location-js-action.php": "./tests/cypress/wordpress-files/test-plugins/geo-location-js-action.php",
22-
"wp-content/plugins/geo-location-pre-geo-points.php": "./tests/cypress/wordpress-files/test-plugins/geo-location-pre-geo-points.php"
19+
".htaccess": "./tests/e2e/wordpress-files/.htaccess",
20+
"wp-content/mu-plugins/delete-all-templates.php": "./tests/e2e/wordpress-files/test-mu-plugins/delete-all-templates.php",
21+
"wp-content/mu-plugins/disable-welcome-guide.php": "./tests/e2e/wordpress-files/test-mu-plugins/disable-welcome-guide.php",
22+
"wp-content/mu-plugins/set-ai-auth-headers.php": "./tests/e2e/wordpress-files/test-mu-plugins/set-ai-auth-headers.php",
23+
"wp-content/mu-plugins/unique-index-name.php": "./tests/e2e/wordpress-files/test-mu-plugins/unique-index-name.php",
24+
"wp-content/plugins/geo-location-js-action.php": "./tests/e2e/wordpress-files/test-plugins/geo-location-js-action.php",
25+
"wp-content/plugins/geo-location-pre-geo-points.php": "./tests/e2e/wordpress-files/test-plugins/geo-location-pre-geo-points.php"
2326
}
2427
}
2528
}

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,29 @@ All notable changes to this project will be documented in this file, per [the Ke
1414
### Developer
1515
-->
1616

17+
## [2.5.0] - 2025-11-05
18+
19+
### Added
20+
- New Vector Embeddings, Semantic Search, and AI Summary Search features. Props [@tott](https://github.com/tott), [@felipeelia](https://github.com/felipeelia), [@psorensen](https://github.com/psorensen), [@gsarig](https://github.com/gsarig), [@ZacharyRener](https://github.com/ZacharyRener), [@burhandodhy](https://github.com/burhandodhy), and [@oscarssanchezz](https://github.com/oscarssanchezz) via [#126](https://github.com/10up/ElasticPressLabs/pull/126), [#158](https://github.com/10up/ElasticPressLabs/pull/158), [#160](https://github.com/10up/ElasticPressLabs/pull/160), and [#161](https://github.com/10up/ElasticPressLabs/pull/161).
21+
- New `ep_user_pre_query_db_results` and `ep_user_query_db_sql` filters in Users `query_db` method. Props [@burhandodhy](https://github.com/burhandodhy), [@felipeelia](https://github.com/felipeelia), and [@yarovikov](https://github.com/yarovikov) via [#141](https://github.com/10up/ElasticPressLabs/pull/141).
22+
- Support for include, lower_limit_object_id, and upper_limit_object_id to User Indexable. Props [@burhandodhy](https://github.com/burhandodhy) via [#144](https://github.com/10up/ElasticPressLabs/pull/144).
23+
- Support for searching posts by Co-Author. Props [@burhandodhy](https://github.com/burhandodhy) via [#143](https://github.com/10up/ElasticPressLabs/pull/143).
24+
25+
### Fixed
26+
- Geolocation infinte loop due to cache. Props [@felipeelia](https://github.com/felipeelia) and [@burhandodhy](https://github.com/burhandodhy) via [#147](https://github.com/10up/ElasticPressLabs/pull/147).
27+
- Autoload fatal error when the plugin is installed via composer. Props [@felipeelia](https://github.com/felipeelia), [@burhandodhy](https://github.com/burhandodhy), and [@gsarig](https://github.com/gsarig) via [#145](https://github.com/10up/ElasticPressLabs/pull/145).
28+
- Ordering user queries by meta key/value. Props [@mphillips](https://github.com/mphillips) via [#148](https://github.com/10up/ElasticPressLabs/pull/148).
29+
30+
### Security
31+
- Overwrite package @babel/runtime coming from core packages due to a vulnerability. Props [@hugosolar](https://github.com/hugosolar) via [#152](https://github.com/10up/ElasticPressLabs/pull/152).
32+
- Bumped `tar-fs` from 2.1.1 to 3.1.1. Props [@dependabot](https://github.com/dependabot) via [#139](https://github.com/10up/ElasticPressLabs/pull/139), [#150](https://github.com/10up/ElasticPressLabs/pull/150), and [#155](https://github.com/10up/ElasticPressLabs/pull/155).
33+
- Bumped `http-proxy-middleware` from 2.0.7 to 2.0.9. Props [@dependabot](https://github.com/dependabot) via [#142](https://github.com/10up/ElasticPressLabs/pull/142).
34+
- Removed `tmp`. Props [@dependabot](https://github.com/dependabot) via [#154](https://github.com/10up/ElasticPressLabs/pull/154).
35+
36+
### Developer
37+
- Migrated e2e tests from Cypress to Playwright. Props [@felipeelia](https://github.com/felipeelia) and [@burhandodhy](https://github.com/burhandodhy) via [#153](https://github.com/10up/ElasticPressLabs/pull/153).
38+
- Run e2e tests on Elasticsearch 9. Props [@felipeelia](https://github.com/felipeelia) via [#161](https://github.com/10up/ElasticPressLabs/pull/161).
39+
1740
## [2.4.0] - 2025-03-26
1841

1942
- New minimum versions (see [#122](https://github.com/10up/ElasticPressLabs/pull/122)) are:
@@ -153,6 +176,7 @@ This version introduces the new *External Content* feature. Check [our blog post
153176
- Initial plugin release.
154177

155178
[Unreleased]: https://github.com/10up/ElasticPressLabs/compare/trunk...develop
179+
[2.5.0]: https://github.com/10up/ElasticPressLabs/compare/2.4.0...2.5.0
156180
[2.4.0]: https://github.com/10up/ElasticPressLabs/compare/2.3.1...2.4.0
157181
[2.3.1]: https://github.com/10up/ElasticPressLabs/compare/2.3.0...2.3.1
158182
[2.3.0]: https://github.com/10up/ElasticPressLabs/compare/2.2.0...2.3.0

CREDITS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@ Thank you to all the people who have already contributed to this repository via
1717
[Tung Du (@dinhtungdu)](https://github.com/dinhtungdu),
1818
[Ricardo Moraleida (@moraleida)](https://github.com/moraleida),
1919
[Marko Banusic (@mbanusic)](https://github.com/mbanusic),
20-
[Oscar Sanchez S. (@oscarssanchez)](https://github.com/oscarssanchez),
20+
[Oscar Sanchez S. (@oscarssanchezz)](https://github.com/oscarssanchezz),
2121
[Burhan Nasir (@burhandodhy)](https://github.com/burhandodhy),
2222
[Mohammed Razzaq (@MARQAS)](https://github.com/MARQAS),
2323
[Eric Caron (@ecaron)](https://github.com/ecaron),
2424
[Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh),
25+
[Alexandr (@yarovikov)](https://github.com/yarovikov),
26+
[Giorgos Sarigiannidis (@gsarig)](https://github.com/gsarig),
27+
[Hugo Solar (@hugosolar)](https://github.com/hugosolar),
28+
[Peter Sorensen (@psorensen)](https://github.com/psorensen),
29+
[Zach (@ZacharyRener)](https://github.com/ZacharyRener),
30+
[Michael Phillips (@mphillips)](https://github.com/mphillips),
2531
and
2632
[Felipe Elia (@felipeelia)](https://github.com/felipeelia).
2733

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"$schema": "https://schemas.wp.org/trunk/block.json",
3+
"apiVersion": 3,
4+
"name": "elasticpress-labs/ai-search-summary",
5+
"title": "AI Search Summary",
6+
"category": "elasticpress",
7+
"icon": "superhero-alt",
8+
"description": "AI Search Summary block description.",
9+
"textdomain": "elasticpress-labs",
10+
"attributes": {
11+
"title": {
12+
"default": "Title",
13+
"type": "string"
14+
},
15+
"note": {
16+
"default": "AI generated results",
17+
"type": "string"
18+
}
19+
},
20+
"supports": {
21+
"align": true,
22+
"color": {
23+
"background": true,
24+
"link": true,
25+
"text": true
26+
},
27+
"html": false,
28+
"position": {
29+
"sticky": true
30+
},
31+
"spacing": {
32+
"margin": true,
33+
"padding": true
34+
},
35+
"typography": {
36+
"fontSize": true,
37+
"lineHeight": true
38+
}
39+
},
40+
"editorScript": "ep-ai-search-summary-block-script",
41+
"script": "ep-ai-search-summary-block-frontend-script"
42+
}

0 commit comments

Comments
 (0)