Skip to content

Commit d4cafe9

Browse files
committed
Merge branch 'develop' into trunk
2 parents 0f6b46e + 258db39 commit d4cafe9

File tree

150 files changed

+19177
-13698
lines changed

Some content is hidden

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

150 files changed

+19177
-13698
lines changed

.github/hookdoc-tmpl/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ For more information about using ClassifAI with WordPress, please see the [Class
66

77
To report an issue with ClassifAI or contribute back to the project, please visit the [GitHub repository](https://github.com/10up/classifai/).
88

9+
## Migrating to version 3.0.0
10+
11+
Version 3.0.0 of ClassifAI contains breaking changes. Please review the [migration guide](./tutorial-migration-guide-v2-to-v3.html) for an overview of these changes and any action that may be required.
12+
913
<a href="http://10up.com/contact/" class="banner"><img src="https://10updotcom-wpengine.s3.amazonaws.com/uploads/2016/10/10up-Github-Banner.png" width="850"></a>

.github/hookdoc-tmpl/static/styles-10up.css

+11
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ nav ul:nth-of-type(3) {
5050

5151
nav ul {
5252
font-size: 1.2rem;
53+
overflow: scroll;
5354
}
5455

5556
nav li a {
@@ -132,3 +133,13 @@ footer {
132133
padding: 2px 10px;
133134
line-height: 16px;
134135
}
136+
137+
table {
138+
width: 100%;
139+
table-layout: fixed;
140+
overflow: scroll;
141+
}
142+
143+
table td {
144+
overflow: scroll;
145+
}

.github/workflows/build-release-zip.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout code
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313
- name: Set Node.js 16.x
14-
uses: actions/setup-node@v3
14+
uses: actions/setup-node@v4
1515
with:
1616
node-version-file: .nvmrc
1717
- name: npm install and build
@@ -22,7 +22,7 @@ jobs:
2222
composer install --no-dev
2323
npm run archive
2424
- name: Upload the ZIP file as an artifact
25-
uses: actions/upload-artifact@v3
25+
uses: actions/upload-artifact@v4
2626
with:
2727
name: ${{ github.event.repository.name }}
2828
path: release

.github/workflows/codeql-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v2
41+
uses: actions/checkout@v4
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL

.github/workflows/cypress.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
pull_request:
99
branches:
1010
- develop
11+
1112
jobs:
1213
cypress:
1314
name: ${{ matrix.core.name }}
@@ -17,10 +18,10 @@ jobs:
1718
core:
1819
- {name: 'WP latest', version: 'latest'}
1920
- {name: 'WP minimum', version: 'WordPress/WordPress#6.1'}
20-
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}
21+
# - {name: 'WP trunk', version: 'WordPress/WordPress#master'}
2122
steps:
2223
- name: Checkout
23-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2425

2526
- name: Install dependencies
2627
run: npm install
@@ -51,7 +52,7 @@ jobs:
5152
cat ./tests/cypress/reports/mochawesome.md >> $GITHUB_STEP_SUMMARY
5253
5354
- name: Upload artifacts
54-
uses: actions/upload-artifact@v3
55+
uses: actions/upload-artifact@v4
5556
if: failure()
5657
with:
5758
name: cypress-artifact-classifai

.github/workflows/dependency-review.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: 'Checkout Repository'
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919
- name: Dependency Review
20-
uses: actions/dependency-review-action@v3
20+
uses: actions/dependency-review-action@v4
2121
with:
2222
license-check: true
2323
vulnerability-check: false

.github/workflows/lint.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
runs-on: ubuntu-latest
2020

2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323

2424
- name: Setup node v16 and npm cache
25-
uses: actions/setup-node@v3
25+
uses: actions/setup-node@v4
2626
with:
2727
node-version-file: .nvmrc
2828
cache: npm
@@ -32,7 +32,7 @@ jobs:
3232

3333
- name: Get updated JS files
3434
id: changed-files
35-
uses: tj-actions/changed-files@v41
35+
uses: tj-actions/changed-files@v42
3636
with:
3737
files: |
3838
**/*.js
@@ -52,14 +52,14 @@ jobs:
5252

5353
steps:
5454
- name: Checkout
55-
uses: actions/checkout@v3
55+
uses: actions/checkout@v4
5656

5757
- name: Set standard 10up cache directories
5858
run: |
5959
composer config -g cache-dir "${{ env.COMPOSER_CACHE }}"
6060
6161
- name: Prepare composer cache
62-
uses: actions/cache@v3
62+
uses: actions/cache@v4
6363
with:
6464
path: ${{ env.COMPOSER_CACHE }}
6565
key: composer-${{ env.COMPOSER_VERSION }}-${{ hashFiles('**/composer.lock') }}
@@ -78,7 +78,7 @@ jobs:
7878

7979
- name: Get updated PHP files
8080
id: changed-files
81-
uses: tj-actions/changed-files@v41
81+
uses: tj-actions/changed-files@v42
8282
with:
8383
files: |
8484
**/*.php
@@ -97,7 +97,7 @@ jobs:
9797

9898
steps:
9999
- name: Checkout
100-
uses: actions/checkout@v3
100+
uses: actions/checkout@v4
101101

102102
- name: VIPCS check
103103
uses: 10up/wpcs-action@stable

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414

1515
- name: Set Node.js 16.x
16-
uses: actions/setup-node@v3
16+
uses: actions/setup-node@v4
1717
with:
1818
node-version-file: .nvmrc
1919

.github/workflows/repo-automator.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Repo Automator'
2+
on:
3+
issues:
4+
types:
5+
- opened
6+
push:
7+
branches:
8+
- develop
9+
pull_request:
10+
types:
11+
- opened
12+
- edited
13+
- synchronize
14+
- converted_to_draft
15+
- ready_for_review
16+
branches:
17+
- develop
18+
19+
jobs:
20+
Validate:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: 10up/action-repo-automator@trunk
24+
with:
25+
fail-label: needs:feedback
26+
pass-label: needs:code-review
27+
conflict-label: needs:refresh
28+
reviewers: |
29+
dkotter
30+
team:open-source-practice
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stable.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313
- name: Set Node.js 16.x
14-
uses: actions/setup-node@v3
14+
uses: actions/setup-node@v4
1515
with:
16-
node-version: 16.x
16+
node-version-file: .nvmrc
1717
- name: npm install and build
1818
run: |
1919
npm install

.github/workflows/test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ jobs:
2727

2828
steps:
2929
- name: Checkout
30-
uses: actions/checkout@v2.4.0
30+
uses: actions/checkout@v4
3131

3232
- name: Set standard 10up cache directories
3333
run: |
3434
composer config -g cache-dir "${{ env.COMPOSER_CACHE }}"
3535
3636
- name: Prepare composer cache
37-
uses: actions/cache@v2
37+
uses: actions/cache@v4
3838
with:
3939
path: ${{ env.COMPOSER_CACHE }}
4040
key: composer-${{ env.COMPOSER_VERSION }}-${{ hashFiles('**/composer.lock') }}
@@ -44,7 +44,7 @@ jobs:
4444
- uses: getong/[email protected]
4545

4646
- name: Set PHP version
47-
uses: shivammathur/setup-php@2.17.0
47+
uses: shivammathur/setup-php@v2
4848
with:
4949
php-version: ${{ matrix.php }}
5050
coverage: none

.husky/pre-commit

-4
This file was deleted.

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v16
1+
v20.11.1

.wp-env.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"core": "WordPress/WordPress#6.1",
32
"plugins": [".", "./tests/test-plugin", "https://downloads.wordpress.org/plugin/classic-editor.zip"],
43
"env": {
54
"tests": {

CHANGELOG.md

+55
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,60 @@ All notable changes to this project will be documented in this file, per [the Ke
44

55
## [Unreleased] - TBD
66

7+
## [3.0.0] - 2024-02-29
8+
**Note that this is a major release of ClassifAI that restructures most of the codebase and will have some breaking changes. If you're extending ClassifAI in any way, please ensure you fully test those integrations prior to running this update on production. For more details on what is changing, see the [migration guide](https://10up.github.io/classifai/tutorial-migration-guide-v2-to-v3.html).**
9+
10+
### Added
11+
- New Moderation Feature that utilizes the OpenAI Moderation API to moderate comments (props [@kirtangajjar](https://github.com/kirtangajjar), [@dkotter](https://github.com/dkotter), [@Sidsector9](https://github.com/Sidsector9) via [#531](https://github.com/10up/classifai/pull/531)).
12+
- Added the option to use Google's Gemini API as a Provider for the Title Generation, Excerpt Generation and Content Resizing Features (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter) via [#700](https://github.com/10up/classifai/pull/700)).
13+
- Added the option to use Azure OpenAI as a Provider for the Title Generation, Excerpt Generation and Content Resizing Features (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul), [@iamdharmesh](https://github.com/iamdharmesh) via [#716](https://github.com/10up/classifai/pull/716)).
14+
- Role and user-based access control for all Features (props [@iamdharmesh](https://github.com/iamdharmesh), [@Sidsector9](https://github.com/Sidsector9) via [#635](https://github.com/10up/classifai/pull/635)).
15+
- Ability to preview which terms will be added before they get added when using the Embeddings provider (props [@dkotter](https://github.com/dkotter), [@iamdharmesh](https://github.com/iamdharmesh) via [#709](https://github.com/10up/classifai/pull/709)).
16+
- Show error message if generating excerpts or titles fails in the Classic Editor (props [@dkotter](https://github.com/dkotter), [@faisal-alvi](https://github.com/faisal-alvi) via [#688](https://github.com/10up/classifai/pull/688)).
17+
- Tool to automatically migrate settings from the old settings structure to the new feature-first settings structure (props [@Sidsector9](https://github.com/Sidsector9), [@iamdharmesh](https://github.com/iamdharmesh), [@qasumitbagthariya](https://github.com/qasumitbagthariya), [@dkotter](https://github.com/dkotter) via [#711](https://github.com/10up/classifai/pull/711)).
18+
- Migration guide for the feature-first refactoring (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter) via [#726](https://github.com/10up/classifai/pull/726)).
19+
- Repo Automator GitHub Action to automate repo operations (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter) via [#681](https://github.com/10up/classifai/pull/681)).
20+
21+
### Changed
22+
- Major refactoring of the plugin to a feature-first architecture (props [@Sidsector9](https://github.com/Sidsector9), [@dkotter](https://github.com/dkotter) via [#611](https://github.com/10up/classifai/pull/611)).
23+
- Update the Azure AI Vision Image Analyze API from v3.0 to v3.2 and the Azure AI Vision Smart Cropping API from v3.1 to v3.2. Note that we recommend lowering the threshold values for the Descriptive Text Generator Feature to 55% for best results (props [@kmgalanakis](https://github.com/kmgalanakis), [@dkotter](https://github.com/dkotter), [@sksaju](https://github.com/sksaju), [@iamdharmesh](https://github.com/iamdharmesh) via [#559](https://github.com/10up/classifai/pull/559)).
24+
- Update from using DALL·E 2 to using DALL·E 3 in our Image Generation Feature (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul), [@iamdharmesh](https://github.com/iamdharmesh) via [#717](https://github.com/10up/classifai/pull/717)).
25+
- Refactor ClassifAI onboarding to work with the new feature-first refactoring (props [@iamdharmesh](https://github.com/iamdharmesh), [@Sidsector9](https://github.com/Sidsector9) via [#642](https://github.com/10up/classifai/pull/642)).
26+
- Ensure the Classification functionality works the same for all Providers (props [@dkotter](https://github.com/dkotter), [@iamdharmesh](https://github.com/iamdharmesh) via [#709](https://github.com/10up/classifai/pull/709)).
27+
- Introduce a filter to add new arguments to the Image Generation REST route, instead of registering that route twice (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter) via [#727](https://github.com/10up/classifai/pull/727)).
28+
- If on a multisite install, when handling user access based on role, if a Super Admin does not have a specific role on a site, treat that user as an administrator (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul), [@gsarig](https://github.com/gsarig), [@iamdharmesh](https://github.com/iamdharmesh) via [#689](https://github.com/10up/classifai/pull/689)).
29+
- Remove the "Enable role-based access" and "Enable user-based access" settings options and instead set those to be enabled by default (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#692](https://github.com/10up/classifai/pull/692)).
30+
- Update minimum node version to 20 (props [@Sidsector9](https://github.com/Sidsector9), [@dkotter](https://github.com/dkotter) via [#722](https://github.com/10up/classifai/pull/722)).
31+
- Updated E2E tests to work with the new feature-first refactoring (props [@Sidsector9](https://github.com/Sidsector9), [@dkotter](https://github.com/dkotter) via [#653](https://github.com/10up/classifai/pull/653)).
32+
33+
### Fixed
34+
- Ensure the classification popup works after feature-first refactoring (props [@faisal-alvi](https://github.com/faisal-alvi), [@dkotter](https://github.com/dkotter), [@Sidsector9](https://github.com/Sidsector9) via [#634](https://github.com/10up/classifai/pull/634)).
35+
- Ensure we only run image updates once (props [@dkotter](https://github.com/dkotter), [@Sidsector9](https://github.com/Sidsector9), [@sksaju](https://github.com/sksaju) via [#677](https://github.com/10up/classifai/pull/677)).
36+
- Ensure the Classification preview works as expected after feature-first refactoring (props [@dkotter](https://github.com/dkotter), [@QAharshalkadu](https://github.com/QAharshalkadu), [@Sidsector9](https://github.com/Sidsector9) via [#679](https://github.com/10up/classifai/pull/679)).
37+
- Ensure all `WP_CLI` commands work after the feature-first refactoring (props [@Sidsector9](https://github.com/Sidsector9), [@dkotter](https://github.com/dkotter) via [#682](https://github.com/10up/classifai/pull/682)).
38+
- Ensure the jQuery UI Dialog CSS is loaded properly (props [@dkotter](https://github.com/dkotter), [@faisal-alvi](https://github.com/faisal-alvi) via [#687](https://github.com/10up/classifai/pull/687)).
39+
- Ensure the classification button has proper bottom spacing (props [@dkotter](https://github.com/dkotter), [@QAharshalkadu](https://github.com/QAharshalkadu), [@faisal-alvi](https://github.com/faisal-alvi) via [#694](https://github.com/10up/classifai/pull/694)).
40+
- Load the dashicon font when the Text to Speech block is used to ensure icons display (props [@dkotter](https://github.com/dkotter), [@QAharshalkadu](https://github.com/QAharshalkadu), [@iamdharmesh](https://github.com/iamdharmesh) via [#695](https://github.com/10up/classifai/pull/695)).
41+
- Ensure the Text to Speech block is rendered for non-logged in users (props [@dkotter](https://github.com/dkotter), [@QAharshalkadu](https://github.com/QAharshalkadu), [@iamdharmesh](https://github.com/iamdharmesh) via [#695](https://github.com/10up/classifai/pull/695)).
42+
- Ensure the IBM Watson NLU credentials toggle link works properly in the ClassifAI onboarding (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter) via [#697](https://github.com/10up/classifai/pull/697)).
43+
- Ensure the connection status shows properly in the ClassifAI onboarding (props [@Sidsector9](https://github.com/Sidsector9), [@QAharshalkadu](https://github.com/QAharshalkadu), [@dkotter](https://github.com/dkotter) via [#702](https://github.com/10up/classifai/pull/702)).
44+
- Ensure the "Extract text from PDF" row action works properly in the media list table view (props [@iamdharmesh](https://github.com/iamdharmesh), [@qasumitbagthariya](https://github.com/qasumitbagthariya), [@dkotter](https://github.com/dkotter) via [#706](https://github.com/10up/classifai/pull/706)).
45+
- Fix fatal error if both the Classification Feature and Moderation Features are active (props [@dkotter](https://github.com/dkotter), [@QAharshalkadu](https://github.com/QAharshalkadu), [@iamdharmesh](https://github.com/iamdharmesh) via [#709](https://github.com/10up/classifai/pull/709)).
46+
- Ensure the stand-alone Generate Image page works if the Media Library is loaded in list mode (props [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya), [@Sidsector9](https://github.com/Sidsector9) via [#712](https://github.com/10up/classifai/pull/712)).
47+
48+
### Removed
49+
- Subscriber from the list of allowed roles (props [@dkotter](https://github.com/dkotter), [@ankitguptaindia](https://github.com/ankitguptaindia), [@Sidsector9](https://github.com/Sidsector9) via [#690](https://github.com/10up/classifai/pull/690)).
50+
- `AccessControl` class as it is no longer in use after the feature-first refactoring (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter) via [#680](https://github.com/10up/classifai/pull/680)).
51+
- Type declaration from the `attachment_is_pdf` parameter (props [@iamdharmesh](https://github.com/iamdharmesh), [@peterwilsoncc](https://github.com/peterwilsoncc), [@dkotter](https://github.com/dkotter) via [#719](https://github.com/10up/classifai/pull/719)).
52+
- Eliminate all dead code that is no longer needed after the feature-first refactoring (props [@Sidsector9](https://github.com/Sidsector9), [@dkotter](https://github.com/dkotter) via [#678](https://github.com/10up/classifai/pull/678)).
53+
54+
### Deprecated
55+
- Show deprecation notice for the Azure AI Personalizer provider, as this will be removed in a coming release (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul), [@iamdharmesh](https://github.com/iamdharmesh) via [#698](https://github.com/10up/classifai/pull/698)).
56+
57+
### Security
58+
- Protect against potential prompt injection when using OpenAI's ChatGPT (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter) via [#683](https://github.com/10up/classifai/pull/683)).
59+
- Bump `ip` from 1.1.8 to 1.1.9 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#721](https://github.com/10up/classifai/pull/721)).
60+
761
## [2.5.1] - 2024-01-11
862
### Changed
963
- Switch from using the Completions API to the Models API to verify credentials (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul), [@iamdharmesh](https://github.com/iamdharmesh) via [#654](https://github.com/10up/classifai/pull/654)).
@@ -490,6 +544,7 @@ All notable changes to this project will be documented in this file, per [the Ke
490544
- Initial closed source release
491545

492546
[Unreleased]: https://github.com/10up/classifai/compare/trunk...develop
547+
[3.0.0]: https://github.com/10up/classifai/compare/2.5.1...3.0.0
493548
[2.5.1]: https://github.com/10up/classifai/compare/2.5.0...2.5.1
494549
[2.5.0]: https://github.com/10up/classifai/compare/2.4.0...2.5.0
495550
[2.4.0]: https://github.com/10up/classifai/compare/2.3.0...2.4.0

0 commit comments

Comments
 (0)