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 Jan 11, 2024
2 parents b2f148a + 742bcbf commit 0f6b46e
Show file tree
Hide file tree
Showing 55 changed files with 494 additions and 248 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Get updated JS files
id: changed-files
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v41
with:
files: |
**/*.js
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:

- name: Get updated PHP files
id: changed-files
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v41
with:
files: |
**/*.php
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file, per [the Ke

## [Unreleased] - TBD

## [2.5.1] - 2024-01-11
### Changed
- 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)).
- Update `10up/phpcs-composer` to version 3.0.0 (props [@dkotter](https://github.com/dkotter), [@faisal-alvi](https://github.com/faisal-alvi) via [#641](https://github.com/10up/classifai/pull/641)).

### Fixed
- Ensure that the "Classify" row/bulk action is visible only to users who have access to it (props [@iamdharmesh](https://github.com/iamdharmesh), [@ankitguptaindia](https://github.com/ankitguptaindia), [@dkotter](https://github.com/dkotter) via [#647](https://github.com/10up/classifai/pull/647)).
- Check for the `default` array key before we access it (props [@dkotter](https://github.com/dkotter), [@Sidsector9](https://github.com/Sidsector9) via [#650](https://github.com/10up/classifai/pull/650)).
- Address all new PHPCS issues (props [@dkotter](https://github.com/dkotter), [@faisal-alvi](https://github.com/faisal-alvi) via [#641](https://github.com/10up/classifai/pull/641)).

### Security
- Bump `tj-actions/changed-files` from 37 to 41 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#649](https://github.com/10up/classifai/pull/649)).
- Bump `follow-redirects` from 1.15.3 to 1.15.4 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@dkotter](https://github.com/dkotter) via [#657](https://github.com/10up/classifai/pull/657)).

## [2.5.0] - 2023-12-13
**Note that this release bumps the WordPress minimum from 5.8 to 6.1.**

Expand Down Expand Up @@ -476,6 +490,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.5.1]: https://github.com/10up/classifai/compare/2.5.0...2.5.1
[2.5.0]: https://github.com/10up/classifai/compare/2.4.0...2.5.0
[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
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), [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), [Tim Schwartz (@timatron)](https://github.com/timatron).
[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), [Tim Schwartz (@timatron)](https://github.com/timatron), [Ankit Gupta (@ankitguptaindia)](https://github.com/ankitguptaindia).

## Libraries

Expand Down
12 changes: 6 additions & 6 deletions autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,23 @@ public function add_namespace( $prefix, $base_dir, $prepend = false ) {
/**
* Loads the class file for a given class name.
*
* @param string $class The fully-qualified class name.
* @param string $classname The fully-qualified class name.
* @return mixed The mapped file name on success, or boolean false on
* failure.
*/
public function load_class( $class ) {
public function load_class( $classname ) {
// the current namespace prefix
$prefix = $class;
$prefix = $classname;

// work backwards through the namespace names of the fully-qualified
// class name to find a mapped file name
while ( false !== $pos = strrpos( $prefix, '\\' ) ) { // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition
while ( false !== $pos = strrpos( $prefix, '\\' ) ) { // phpcs:ignore Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition, WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition

// retain the trailing namespace separator in the prefix
$prefix = substr( $class, 0, $pos + 1 );
$prefix = substr( $classname, 0, $pos + 1 );

// the rest is the relative class name
$relative_class = substr( $class, $pos + 1 );
$relative_class = substr( $classname, $pos + 1 );

// try to load a mapped file for the prefix and relative class
$mapped_file = $this->load_mapped_file( $prefix, $relative_class );
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.5.0
* Version: 2.5.1
* Requires at least: 6.1
* Requires PHP: 7.4
* Author: 10up
Expand Down Expand Up @@ -37,7 +37,7 @@ function classifai_site_meets_php_requirements() {
if ( ! classifai_site_meets_php_requirements() ) {
add_action(
'admin_notices',
function() {
function () {
?>
<div class="notice notice-error">
<p>
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
]
},
"require-dev": {
"10up/phpcs-composer": "dev-master",
"10up/phpcs-composer": "^3.0",
"yoast/phpunit-polyfills": "^1.0.0"
},
"scripts": {
"lint": "phpcs . --runtime-set testVersion 7.4-",
"lint": "phpcs -s . --runtime-set testVersion 7.4-",
"lint-fix": "phpcbf ."
},
"minimum-stability": "dev",
Expand Down
Loading

0 comments on commit 0f6b46e

Please sign in to comment.