Skip to content

Commit

Permalink
Merge branch 'develop' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Nov 9, 2023
2 parents 1742dc0 + 6e90c18 commit bfb3822
Show file tree
Hide file tree
Showing 44 changed files with 2,745 additions and 474 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ tests export-ignore
.nvmrc export-ignore
.wordpress-version-checker.json export-ignore
.wp-env.json export-ignore
.wp-env.override.json export-ignore
CHANGELOG.md export-ignore
classifai.zip export-ignore
CODE_OF_CONDUCT.md export-ignore
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ jobs:
- name: Test
run: npm run cypress:run

- name: Update summary
run: |
npx mochawesome-merge ./tests/cypress/reports/*.json -o tests/cypress/reports/mochawesome.json
rm -rf ./tests/cypress/reports/mochawesome-*.json
npx mochawesome-json-to-md -p ./tests/cypress/reports/mochawesome.json -o ./tests/cypress/reports/mochawesome.md
npx mochawesome-report-generator tests/cypress/reports/mochawesome.json -o tests/cypress/reports/
cat ./tests/cypress/reports/mochawesome.md >> $GITHUB_STEP_SUMMARY
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: failure()
Expand All @@ -52,3 +60,4 @@ jobs:
${{ github.workspace }}/tests/cypress/screenshots/
${{ github.workspace }}/tests/cypress/videos/
${{ github.workspace }}/tests/cypress/logs/
${{ github.workspace }}/tests/cypress/reports/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ config.local.php
tests/cypress/downloads
tests/cypress/screenshots
tests/cypress/videos
tests/cypress/reports
.wp-env.override.json
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file, per [the Ke

## [Unreleased] - TBD

## [2.4.0] - 2023-11-09
### Added
- Support for modifying prompts from the admin settings page (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@ravinderk](https://github.com/ravinderk), [@dkotter](https://github.com/dkotter) via [#594](https://github.com/10up/classifai/pull/594)).
- Support for setting multiple prompts for each feature that supports prompts (props [@ravinderk](https://github.com/ravinderk), [@iamdharmesh](https://github.com/iamdharmesh), [@berkod](https://github.com/berkod), [@dkotter](https://github.com/dkotter) via [#602](https://github.com/10up/classifai/pull/602)).
- New filters added to allow developer control over all requests made to OpenAI (props [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@berkod](https://github.com/berkod), [@dkotter](https://github.com/dkotter) via [#604](https://github.com/10up/classifai/pull/604)).
- Documentation updates in regards to data retention (props [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter) via [#582](https://github.com/10up/classifai/pull/582)).
- Example snippet to make taxonomies private to the developer docs (props [@theskinnyghost](https://github.com/theskinnyghost), [@dkotter](https://github.com/dkotter) via [#583](https://github.com/10up/classifai/pull/583)).
- GitHub Action summary for Cypress E2E checks (props [@faisal-alvi](https://github.com/faisal-alvi), [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter) via [#578](https://github.com/10up/classifai/pull/578)).

### Changed
- Ensure the default prompts in ClassifAI show as the first prompt in our settings and cannot be removed or edited (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul), [@ravinderk](https://github.com/ravinderk) via [#610](https://github.com/10up/classifai/pull/610)).
- Fix multiple typos across the codebase (props [@parikshit-adhikari](https://github.com/parikshit-adhikari), [@shresthasurav](https://github.com/shresthasurav), [@jeffpaul](https://github.com/jeffpaul) via [#603](https://github.com/10up/classifai/pull/603), [#605](https://github.com/10up/classifai/pull/605)).
- Use `get_asset_info` across the enqueuing of all our dependencies (props [@ravinderk](https://github.com/ravinderk), [@jeffpaul](https://github.com/jeffpaul), [@berkod](https://github.com/berkod), [@dkotter](https://github.com/dkotter) via [#608](https://github.com/10up/classifai/pull/608)).
- Bump WordPress "tested up to" version to 6.4 (props [@dkotter](https://github.com/dkotter) via [#613](https://github.com/10up/classifai/pull/613)).

### Fixed
- Ensure all hooks show in our documentation (props [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@berkod](https://github.com/berkod), [@dkotter](https://github.com/dkotter) via [#604](https://github.com/10up/classifai/pull/604)).

### Security
- Bump `@cypress/request` from 2.88.12 to 3.0.0 and `cypress` from 12.14.0 to 13.1.0 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@dkotter](https://github.com/dkotter) via [#576](https://github.com/10up/classifai/pull/576)).
- Bump `postcss` from 8.4.24 to 8.4.31 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@dkotter](https://github.com/dkotter) via [#584](https://github.com/10up/classifai/pull/584)).
- Bump `@babel/traverse` from 7.22.4 to 7.23.2 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@dkotter](https://github.com/dkotter) via [#601](https://github.com/10up/classifai/pull/601)).

## [2.3.0] - 2023-09-05
**Note that this release bumps the WordPress minimum from 5.7 to 5.8.**

Expand Down Expand Up @@ -428,6 +451,7 @@ All notable changes to this project will be documented in this file, per [the Ke
- Initial closed source release

[Unreleased]: https://github.com/10up/classifai/compare/trunk...develop
[2.4.0]: https://github.com/10up/classifai/compare/2.3.0...2.4.0
[2.3.0]: https://github.com/10up/classifai/compare/2.2.3...2.3.0
[2.2.3]: https://github.com/10up/classifai/compare/2.2.2...2.2.3
[2.2.2]: https://github.com/10up/classifai/compare/2.2.1...2.2.2
Expand Down
2 changes: 1 addition & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The following individuals are responsible for curating the list of issues, respo

Thank you to all the people who have already contributed to this repository via bug reports, code, design, ideas, project management, translation, testing, etc.

[Darshan Sawardekar (@dsawardekar)](https://github.com/dsawardekar), [Ryan Welcher (@ryanwelcher)](https://github.com/ryanwelcher), [Adam Silverstein (@adamsilverstein)](https://github.com/adamsilverstein), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Helen Hou-Sandí (@helen)](https://github.com/helen), [Christian Chung (@christianc1)](https://github.com/christianc1), [Dependabot (@dependabot)](https://github.com/dependabot), [Dillon McCallum (@McCallumDillon)](https://github.com/McCallumDillon), [Dustin Rue (@dustinrue)](https://github.com/dustinrue), [Jay Wood (@JayWood)](https://github.com/JayWood), [John Watkins (@johnwatkins0)](https://github.com/johnwatkins0), [Matthew McAchran (@mmcachran)](https://github.com/mmcachran), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [Darío Hereñú (@kant)](https://github.com/kant), [Aaron Jorbin (@aaronjorbin)](https://github.com/aaronjorbin), [Eduard Florea (@eflorea)](https://github.com/eflorea), [Jackie Kjome (@JackieKjome)](https://github.com/JackieKjome), [Ricky Lee Whittemore (@rickalee)](https://github.com/rickalee), [Ritesh Patel (@Ritesh-patel)](https://github.com/Ritesh-patel), [Dana Ross (@dana-ross)](https://github.com/dana-ross), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Pete Nelson (@petenelson)](https://github.com/petenelson), [Connor Smyth (@ActuallyConnor)](https://github.com/ActuallyConnor), [Oscar Sanchez S. (@oscarssanchez)](https://github.com/oscarssanchez), [Shah Qureshi (@ShahAaron)](https://github.com/ShahAaron), [Barry Ceelen (@barryceelen)](https://github.com/barryceelen), [Jeffrey Carandang (@phpbits)](https://github.com/phpbits), [Thrijith Thankachan (@thrijith)](https://github.com/thrijith), [Junaid Bhura (@junaidbhura)](https://github.com/junaidbhura), [Blanca Hong [@blancahong]](https://profiles.wordpress.org/blancahong/), [Barney Jeffries (@barneyjeffries)](https://github.com/barneyjeffries), [Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [@myBCN](https://github.com/myBCN), [James Morrison (@jamesmorrison)](https://github.com/jamesmorrison), [Rahul Prajapati (@rahulsprajapati)](https://github.com/rahulsprajapati), [Sérgio Santos (@s3rgiosan)](https://github.com/s3rgiosan), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Delfina Hoxha](https://www.linkedin.com/in/delfina-hoxha/), [Ajay Maurya (@ajmaurya99)](https://github.com/ajmaurya99), [Faisal Alvi (@faisal-alvi)](https://github.com/faisal-alvi), [Mustafa Uysal (@mustafauysal)](https://github.com/mustafauysal), [Max Lyuchin (@cadic)](https://github.com/cadic), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Quamruz Zaman (@zamanq)](https://github.com/zamanq), [Ravinder Kumar (@ravinderk)](https://github.com/ravinderk), [Joe McGill (@joemcgill)](https://github.com/joemcgill), [Tyler Bailey (@TylerB24890)](https://github.com/TylerB24890), [Viktor Szépe (@szepeviktor)](https://github.com/szepeviktor), [Ivan Ivanić (@Spoygg)](https://github.com/Spoygg), [Jayedul Kabir (@jayedul)](https://github.com/jayedul), [Garth Gutenberg (@ggutenberg)](https://github.com/ggutenberg), [Mehidi Hassan (@mehidi258)](https://github.com/mehidi258), [Julian Weiland (@derweili)](https://github.com/derweili), [Anton Vanyukov (@av3nger)](https://github.com/av3nger), [Ben Keith (@benlk)](https://github.com/benlk), [David Hechler (@pixeldevsio)](https://github.com/pixeldevsio), [Joshua Abenazer (@joshuaabenazer)](https://github.com/joshuaabenazer), [Dominik Schilling (@ocean90)](https://github.com/ocean90), [Björn Holine (@bjorn2404)](https://github.com/bjorn2404), [Konstantinos Galanakis (@kmgalanakis)](https://github.com/kmgalanakis).
[Darshan Sawardekar (@dsawardekar)](https://github.com/dsawardekar), [Ryan Welcher (@ryanwelcher)](https://github.com/ryanwelcher), [Adam Silverstein (@adamsilverstein)](https://github.com/adamsilverstein), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Helen Hou-Sandí (@helen)](https://github.com/helen), [Christian Chung (@christianc1)](https://github.com/christianc1), [Dependabot (@dependabot)](https://github.com/dependabot), [Dillon McCallum (@McCallumDillon)](https://github.com/McCallumDillon), [Dustin Rue (@dustinrue)](https://github.com/dustinrue), [Jay Wood (@JayWood)](https://github.com/JayWood), [John Watkins (@johnwatkins0)](https://github.com/johnwatkins0), [Matthew McAchran (@mmcachran)](https://github.com/mmcachran), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [Darío Hereñú (@kant)](https://github.com/kant), [Aaron Jorbin (@aaronjorbin)](https://github.com/aaronjorbin), [Eduard Florea (@eflorea)](https://github.com/eflorea), [Jackie Kjome (@JackieKjome)](https://github.com/JackieKjome), [Ricky Lee Whittemore (@rickalee)](https://github.com/rickalee), [Ritesh Patel (@Ritesh-patel)](https://github.com/Ritesh-patel), [Dana Ross (@dana-ross)](https://github.com/dana-ross), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Pete Nelson (@petenelson)](https://github.com/petenelson), [Connor Smyth (@ActuallyConnor)](https://github.com/ActuallyConnor), [Oscar Sanchez S. (@oscarssanchez)](https://github.com/oscarssanchez), [Shah Qureshi (@ShahAaron)](https://github.com/ShahAaron), [Barry Ceelen (@barryceelen)](https://github.com/barryceelen), [Jeffrey Carandang (@phpbits)](https://github.com/phpbits), [Thrijith Thankachan (@thrijith)](https://github.com/thrijith), [Junaid Bhura (@junaidbhura)](https://github.com/junaidbhura), [Blanca Hong [@blancahong]](https://profiles.wordpress.org/blancahong/), [Barney Jeffries (@barneyjeffries)](https://github.com/barneyjeffries), [Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [@myBCN](https://github.com/myBCN), [James Morrison (@jamesmorrison)](https://github.com/jamesmorrison), [Rahul Prajapati (@rahulsprajapati)](https://github.com/rahulsprajapati), [Sérgio Santos (@s3rgiosan)](https://github.com/s3rgiosan), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Delfina Hoxha](https://www.linkedin.com/in/delfina-hoxha/), [Ajay Maurya (@ajmaurya99)](https://github.com/ajmaurya99), [Faisal Alvi (@faisal-alvi)](https://github.com/faisal-alvi), [Mustafa Uysal (@mustafauysal)](https://github.com/mustafauysal), [Max Lyuchin (@cadic)](https://github.com/cadic), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Quamruz Zaman (@zamanq)](https://github.com/zamanq), [Ravinder Kumar (@ravinderk)](https://github.com/ravinderk), [Joe McGill (@joemcgill)](https://github.com/joemcgill), [Tyler Bailey (@TylerB24890)](https://github.com/TylerB24890), [Viktor Szépe (@szepeviktor)](https://github.com/szepeviktor), [Ivan Ivanić (@Spoygg)](https://github.com/Spoygg), [Jayedul Kabir (@jayedul)](https://github.com/jayedul), [Garth Gutenberg (@ggutenberg)](https://github.com/ggutenberg), [Mehidi Hassan (@mehidi258)](https://github.com/mehidi258), [Julian Weiland (@derweili)](https://github.com/derweili), [Anton Vanyukov (@av3nger)](https://github.com/av3nger), [Ben Keith (@benlk)](https://github.com/benlk), [David Hechler (@pixeldevsio)](https://github.com/pixeldevsio), [Joshua Abenazer (@joshuaabenazer)](https://github.com/joshuaabenazer), [Dominik Schilling (@ocean90)](https://github.com/ocean90), [Björn Holine (@bjorn2404)](https://github.com/bjorn2404), [Konstantinos Galanakis (@kmgalanakis)](https://github.com/kmgalanakis), [Dan Berko (@berkod)](https://github.com/berkod), [Luca Ricci (@theskinnyghost)](https://github.com/theskinnyghost), [Parikshit Adhikari (@parikshit-adhikari)](https://github.com/parikshit-adhikari), [Surav Shrestha (@shresthasurav)](https://github.com/shresthasurav).

## Libraries

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> Supercharge WordPress Content Workflows and Engagement with Artificial Intelligence.
[![Support Level](https://img.shields.io/badge/support-active-green.svg)](#support-level) [![Release Version](https://img.shields.io/github/release/10up/classifai.svg)](https://github.com/10up/classifai/releases/latest) ![WordPress tested up to version](https://img.shields.io/badge/WordPress-v6.3%20tested-success.svg) [![GPLv2 License](https://img.shields.io/github/license/10up/classifai.svg)](https://github.com/10up/classifai/blob/develop/LICENSE.md)
[![Support Level](https://img.shields.io/badge/support-active-green.svg)](#support-level) [![Release Version](https://img.shields.io/github/release/10up/classifai.svg)](https://github.com/10up/classifai/releases/latest) ![WordPress tested up to version](https://img.shields.io/badge/WordPress-v6.4%20tested-success.svg) [![GPLv2 License](https://img.shields.io/github/license/10up/classifai.svg)](https://github.com/10up/classifai/blob/develop/LICENSE.md)

[![E2E Testing](https://github.com/10up/classifai/actions/workflows/cypress.yml/badge.svg)](https://github.com/10up/classifai/actions/workflows/cypress.yml) [![PHPUnit Testing](https://github.com/10up/classifai/actions/workflows/test.yml/badge.svg)](https://github.com/10up/classifai/actions/workflows/test.yml) [![Linting](https://github.com/10up/classifai/actions/workflows/lint.yml/badge.svg)](https://github.com/10up/classifai/actions/workflows/lint.yml) [![CodeQL](https://github.com/10up/classifai/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/10up/classifai/actions/workflows/codeql-analysis.yml) [![Dependency Review](https://github.com/10up/classifai/actions/workflows/dependency-review.yml/badge.svg)](https://github.com/10up/classifai/actions/workflows/dependency-review.yml)

Expand Down Expand Up @@ -418,6 +418,10 @@ We recommend that you are transparent with your users that AI tools are being us

> This site makes use of Artificial Intelligence tools to help with tasks like language processing, image processing, and content recommendations.
### When a post is sent to OpenAI (e.g. to generate a title or excerpt), is the post content fed into OpenAI and used for other customers?

According to OpenAI, they do not train their models on any data that is sent via API requests (see https://openai.com/enterprise-privacy). OpenAI may keep the data for up to 30 days to identify abuse, though you can request zero data retention (ZDR) with a qualifying use-case.

## Support Level

**Active:** 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.
Expand Down
4 changes: 2 additions & 2 deletions classifai.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://github.com/10up/classifai
* Update URI: https://classifaiplugin.com
* Description: Enhance your WordPress content with Artificial Intelligence and Machine Learning services.
* Version: 2.3.0
* Version: 2.4.0
* Requires at least: 5.8
* Requires PHP: 7.4
* Author: 10up
Expand Down Expand Up @@ -87,7 +87,7 @@ classifai_define( 'CLASSIFAI_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
/**
* Loads the CLASSIFAI PHP autoloader if possible.
*
* @return bool True or false if autoloading was successfull.
* @return bool True or false if autoloading was successful.
*/
function classifai_autoload() {
if ( classifai_can_autoload() ) {
Expand Down
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* declared here instead of a Class.
*/

$plugin_version = '2.3.0';
$plugin_version = '2.4.0';

if ( file_exists( __DIR__ . '/.commit' ) ) {
$plugin_version .= '-' . file_get_contents( __DIR__ . '/.commit' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
Expand Down
3 changes: 3 additions & 0 deletions hookdocs/meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"useful-snippets": {
"title": "Useful snippets"
},
"wp-cli": {
"title": "WP-CLI Commands"
}
Expand Down
18 changes: 18 additions & 0 deletions hookdocs/useful-snippets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Make ClassifAI taxonomies private

Some users might want to set some of the taxonomies provided by the plugin private, so that their archive pages won't be generated (and thus indexed by search engines).

In order to do that, we can use a filter provided by WordPress Core, namely `register_{$taxonomy}_taxonomy_args` ([see here for the documentation](https://developer.wordpress.org/reference/hooks/register_taxonomy_taxonomy_args/)).

For example, let's say we want to make the `classifai-image-tags` taxonomy private, we would need to add this snippet to either our theme `functions.php` or our custom plugin.

```php
namespace MyPluginOrTheme;

add_filter( 'register_classifai-image-tags_taxonomy_args', __NAMESPACE__ . '\override_taxonomy_args' );

function override_taxonomy_args( $args ) {
$args['public'] = false;
return $args;
}
```
2 changes: 1 addition & 1 deletion includes/Classifai/Admin/SavePostHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function is_configured() {
*
* Skips classification if running under the Gutenberg Metabox
* compatibility request. The classification is performed during the REST
* lifecyle when using Gutenberg.
* lifecycle when using Gutenberg.
*
* @param int $post_id The post that was saved
*/
Expand Down
2 changes: 1 addition & 1 deletion includes/Classifai/Blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function blocks_styles() {
'recommended-content-block-style',
CLASSIFAI_PLUGIN_URL . 'dist/recommended-content-block-frontend.css',
[],
CLASSIFAI_PLUGIN_VERSION
get_asset_info( 'recommended-content-block-frontend', 'version' )
);

wp_enqueue_script(
Expand Down
4 changes: 2 additions & 2 deletions includes/Classifai/Command/ClassifaiCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ private function should_transcribe_attachment( $attachment, int $attachment_id,
* ## Options
*
* [<attachment_ids>]
* : Comma delimeted Attachment IDs to classify
* : Comma delimited Attachment IDs to classify
*
* [--limit=<limit>]
* : Limit classification to N attachments. Default 100.
Expand Down Expand Up @@ -1219,7 +1219,7 @@ private function get_attachment_to_classify( $opts = [] ) {
/**
* Prints the output from the NLU API.
*
* @param mixed $output The variable to oputput.
* @param mixed $output The variable to output.
* @param int $post_id The post id.
*/
private function print( $output, $post_id ) {
Expand Down
Loading

0 comments on commit bfb3822

Please sign in to comment.