Skip to content

Commit

Permalink
Release: (1742dc0) Merge branch 'develop' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Sep 5, 2023
1 parent 71e6cc5 commit cd59199
Show file tree
Hide file tree
Showing 120 changed files with 3,439 additions and 3,473 deletions.
Binary file added assets/img/screenshot-12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ protected function load_mapped_file( $prefix, $relative_class ) {
// replace the namespace prefix with the base directory,
// replace namespace separators with directory separators
// in the relative class name, append with .php
$file = $base_dir
. str_replace( '\\', '/', $relative_class )
. '.php';
$file = $base_dir . str_replace( '\\', '/', $relative_class ) . '.php';

// if the mapped file exists, require it
if ( $this->require_file( $file ) ) {
Expand Down
61 changes: 39 additions & 22 deletions classifai.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* 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.2.3
* Requires at least: 5.7
* Version: 2.3.0
* Requires at least: 5.8
* Requires PHP: 7.4
* Author: 10up
* Author URI: https://10up.com
Expand All @@ -16,30 +16,47 @@
*/

/**
* Require PHP version 7.4+ - throw an error if the plugin is activated on an older version.
* Get the minimum version of PHP required by this plugin.
*
* Note that this itself is only PHP5.3+ compatible because of the anonymous callback.
* @return string Minimum version required.
*/
register_activation_hook(
__FILE__,
function() {
if ( version_compare( PHP_VERSION, '7.4.0', '<' ) ) {
wp_die(
sprintf(
wp_kses(
/* translators: PHP Update guide URL */
__( 'ClassifAI requires PHP version 7.4. <a href="%s">Click here</a> to learn how to update your PHP version.', 'classifai' ),
array(
'a' => array( 'href' => array() ),
function classifai_minimum_php_requirement() {
return '7.4';
}

/**
* Whether PHP installation meets the minimum requirements
*
* @return bool True if meets minimum requirements, false otherwise.
*/
function classifai_site_meets_php_requirements() {
return version_compare( phpversion(), classifai_minimum_php_requirement(), '>=' );
}

// Ensuring our PHP version requirement is met first before loading plugin.
if ( ! classifai_site_meets_php_requirements() ) {
add_action(
'admin_notices',
function() {
?>
<div class="notice notice-error">
<p>
<?php
echo wp_kses_post(
sprintf(
/* translators: %s: Minimum required PHP version */
__( 'ClassifAI requires PHP version %s or later. Please upgrade PHP or disable the plugin.', 'classifai' ),
esc_html( classifai_minimum_php_requirement() )
)
),
esc_url( 'https://wordpress.org/support/update-php/' )
),
esc_html__( 'Error Activating', 'classifai' )
);
);
?>
</p>
</div>
<?php
}
}
);
);
return;
}

/**
* Small wrapper around PHP's define function. The defined constant is
Expand Down
9 changes: 5 additions & 4 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
* declared here instead of a Class.
*/

$plugin_version = '2.2.3';
$plugin_version = '2.3.0';

if ( file_exists( __DIR__ . '/.commit' ) ) {
$plugin_version .= '-' . file_get_contents( __DIR__ . '/.commit' );
$plugin_version .= '-' . file_get_contents( __DIR__ . '/.commit' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
}

// Useful global constants
Expand All @@ -16,8 +16,9 @@ classifai_define( 'CLASSIFAI_PLUGIN_VERSION', $plugin_version );
classifai_define( 'CLASSIFAI_PLUGIN_DIR', __DIR__ );
classifai_define( 'CLASSIFAI_PLUGIN_URL', plugin_dir_url( __FILE__ ) );

// API
classifai_define( 'WATSON_NLU_VERSION', '2018-03-19' );
// API - https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-release-notes#active-version-dates
classifai_define( 'WATSON_NLU_VERSION', '2022-08-10' );

// Taxonomies
classifai_define( 'WATSON_CATEGORY_TAXONOMY', 'watson-category' );
classifai_define( 'WATSON_KEYWORD_TAXONOMY', 'watson-keyword' );
Expand Down
2 changes: 1 addition & 1 deletion dist/admin.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => 'bebd517578e28722f510');
<?php return array('dependencies' => array(), 'version' => 'b88da674f852dcc57e0e');
2 changes: 1 addition & 1 deletion dist/admin.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/commands.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('wp-commands', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives'), 'version' => '29252950274641f22357');
1 change: 1 addition & 0 deletions dist/commands.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/content-resizing-plugin.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-wordcount'), 'version' => 'bc2e64ef6385d5eae7f7');
1 change: 1 addition & 0 deletions dist/content-resizing-plugin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/content-resizing-plugin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/generate-excerpt-classic.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('wp-api-fetch'), 'version' => '284bc067245a0a71d7c5');
1 change: 1 addition & 0 deletions dist/generate-excerpt-classic.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/generate-excerpt-classic.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/generate-image-media-upload.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('wp-i18n'), 'version' => '5cb5eef05c879e06dcd5');
Loading

0 comments on commit cd59199

Please sign in to comment.