Skip to content

Commit

Permalink
Merge branch 'develop' into feature/826
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Dec 10, 2024
2 parents 1860aba + 295b3d4 commit 94e6dab
Show file tree
Hide file tree
Showing 9 changed files with 295 additions and 338 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Tap into leading cloud-based services like [OpenAI](https://openai.com/), [Micro
## Requirements

* PHP 7.4+
* [WordPress](http://wordpress.org) 6.1+
* [WordPress](http://wordpress.org) 6.5+
* To utilize the NLU Language Processing functionality, you will need an active [IBM Watson](https://cloud.ibm.com/registration) account.
* To utilize the ChatGPT, Embeddings, Text to Speech or Whisper Language Processing functionality or DALL·E Image Processing functionality, you will need an active [OpenAI](https://platform.openai.com/signup) account.
* To utilize the Azure AI Vision Image Processing functionality or Text to Speech Language Processing functionality, you will need an active [Microsoft Azure](https://signup.azure.com/signup) account.
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
"require-dev": {
"10up/phpcs-composer": "^3.0",
"yoast/phpunit-polyfills": "^1.0.0",
"szepeviktor/phpstan-wordpress": "dev-master",
"szepeviktor/phpstan-wordpress": "^2.0.1",
"phpstan/extension-installer": "1.4.x-dev",
"php-stubs/wp-cli-stubs": "dev-master",
"johnbillion/wp-compat": "dev-trunk",
"phpstan/phpstan-deprecation-rules": "1.2.x-dev"
"johnbillion/wp-compat": "^1.1.0",
"phpstan/phpstan-deprecation-rules": "^2.0.1"
},
"scripts": {
"lint": "phpcs -s . --runtime-set testVersion 7.4-",
Expand Down
610 changes: 279 additions & 331 deletions composer.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions includes/Classifai/Admin/Notifications.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
/* phpcs:disable PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage */

namespace Classifai\Admin;

Expand Down Expand Up @@ -280,6 +281,7 @@ public function add_dismiss_script() {
$nonce = wp_create_nonce( 'classifai_dismissible_notice' );
$admin_ajax_url = esc_url( admin_url( 'admin-ajax.php' ) );

/* phpcs:disable Squiz.PHP.Heredoc.NotAllowed */
$script = <<<EOD
jQuery( function() {
const dismissNotices = document.querySelectorAll( '.classifai-dismissible-notice' );
Expand Down Expand Up @@ -314,6 +316,7 @@ public function add_dismiss_script() {
});
});
EOD;
/* phpcs:enable Squiz.PHP.Heredoc.NotAllowed */

wp_add_inline_script( 'common', $script, 'after' );
}
Expand Down
2 changes: 2 additions & 0 deletions includes/Classifai/Admin/templates/classifai-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package ClassifAI
*/

/* phpcs:disable PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage */

// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$active_page = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'classifai_settings';
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
Expand Down
2 changes: 2 additions & 0 deletions includes/Classifai/Admin/templates/onboarding-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package ClassifAI
*/

/* phpcs:disable PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage */

/** @var array $args Arguments coming from the included file. */
?>
<h1 class="classifai-setup-heading">
Expand Down
2 changes: 1 addition & 1 deletion includes/Classifai/Features/ImageGeneration.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public function print_media_templates() {

<?php
// Template for a single generated image.
/* phpcs:disable WordPressVIPMinimum.Security.Mustache.OutputNotation */
/* phpcs:disable WordPressVIPMinimum.Security.Mustache.OutputNotation,PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage */
?>
<script type="text/html" id="tmpl-dalle-image">
<div class="generated-image">
Expand Down
4 changes: 3 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ parameters:
- '#Constant CLASSIFAI_.+ not found#'
- '#Constant WATSON_.+ not found#'
- '#Constant MERCURY_PARSER_API_KEY not found#'
# Flags these require statements even though they are fine.
- '#Path in require_once\(\) "\.\/wp-admin\/includes\/.+\.php" is not a file or it does not exist#'
WPCompat:
requiresAtLeast: '6.1'
requiresAtLeast: '6.5'
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe( 'Image processing Tests', () => {
cy.visitFeatureSettings(
'image_processing/feature_image_to_text_generator'
);
cy.wait( 1500 ); // Add delay to avoid flaky test in WP minimum (6.1) environment.
cy.wait( 1500 ); // Add delay to avoid flaky test in WP minimum environment.
cy.disableFeature();
cy.saveFeatureSettings();

Expand Down

0 comments on commit 94e6dab

Please sign in to comment.