diff --git a/.gitignore b/.gitignore index d71b28a..f54bc92 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,7 @@ dist out target vendor +gutenberg-native-ai.zip ### Environment ### .env diff --git a/bootstrap.php b/bootstrap.php index 6a3f9d7..71e525c 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -3,7 +3,7 @@ * The bootstrap file for the plugin. * * @link https://www.kotisivu.dev - * @since 1.0.0 + * @since 0.1.0 * @package Gutenberg_Native_Ai */ diff --git a/gutenberg-native-ai.php b/gutenberg-native-ai.php index 687590c..ed4d9bd 100644 --- a/gutenberg-native-ai.php +++ b/gutenberg-native-ai.php @@ -3,20 +3,22 @@ * The plugin bootstrap file * * @link https://www.kotisivu.dev - * @since 1.0.0 + * @since 0.1.0 * @package Gutenberg_Native_Ai * * @wordpress-plugin * Plugin Name: Gutenberg Native AI (Beta) * Plugin URI: https://www.kotisivu.dev * Description: A plugin that extends the Gutenberg editor with AI features designed to work natively with WordPress. - * Version: 1.0.0 + * Version: 0.1.0 * Author: Heikki Vihersalo * Author URI: https://www.kotisivu.dev/ * License: GPL-2.0+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt * Text Domain: gutenberg-native-ai * Domain Path: /languages + * Requires at least: 6.5.2 + * Requires PHP: 8.2 */ namespace Kotisivu\Gutenberg_Native_AI; @@ -29,7 +31,7 @@ /** * Current plugin and API versions. */ -define( 'GUTENBERG_NATIVE_AI_VERSION', '1.0.0' ); +define( 'GUTENBERG_NATIVE_AI_VERSION', '0.1.0' ); define( 'GUTENBERG_NATIVE_AI_API_VERSION', '1' ); /** diff --git a/includes/api/class-api-callback.php b/includes/api/class-api-callback.php index bc1eb7e..d57dead 100644 --- a/includes/api/class-api-callback.php +++ b/includes/api/class-api-callback.php @@ -3,7 +3,7 @@ * The API callback class file * * @link https://www.kotisivu.dev - * @since 1.0.0 + * @since 0.1.0 * * @package Gutenberg_Native_Ai */ @@ -13,7 +13,7 @@ /** * This class handles the API callbacks for the plugin. - * @since 1.0.0 + * @since 0.1.0 * @package Gutenberg_Native_Ai * @author Heikki Vihersalo */ diff --git a/includes/api/class-api-utils.php b/includes/api/class-api-utils.php index 33c329b..9f72fc2 100644 --- a/includes/api/class-api-utils.php +++ b/includes/api/class-api-utils.php @@ -3,7 +3,7 @@ * The API utility functions file * * @link https://www.kotisivu.dev - * @since 1.0.0 + * @since 0.1.0 * * @package Gutenberg_Native_Ai */ @@ -13,7 +13,7 @@ /** * This class handles the API utility functions for the plugin. * - * @since 1.0.0 + * @since 0.1.0 * @package Gutenberg_Native_Ai * @author Heikki Vihersalo */ @@ -27,7 +27,7 @@ private function __construct() { /** * Get ChatGPT settings from the database * - * @since 1.0.0 + * @since 0.1.0 * @access public * @return array */ @@ -52,7 +52,7 @@ public static function get_chatgpt_settings(): array { /** * Update ChatGPT settings in the database * - * @since 1.0.0 + * @since 0.1.0 * @access public * @param \WP_REST_Request $request Request object. * @return array @@ -92,7 +92,7 @@ public static function update_chatgpt_settings( \WP_REST_Request $request ): arr /** * Get content from Open AI * - * @since 1.0.0 + * @since 0.1.0 * @access public * @param \WP_REST_Request $request Request object. * @return Object @@ -141,7 +141,7 @@ public static function get_open_ai_text_content( \WP_REST_Request $request ): ar /** * Get content from Open AI * - * @since 1.0.0 + * @since 0.1.0 * @access public * @param \WP_REST_Request $request Request object. * @return Object @@ -187,7 +187,7 @@ public static function get_open_ai_image_content( \WP_REST_Request $request ): a * * @see https://gist.github.com/cyberwani/ad5452b040001878d692c3165836ebff * - * @since 1.0.0 + * @since 0.1.0 * @access public * @param \WP_REST_Request $request Request object. * @return Object diff --git a/includes/api/class-api.php b/includes/api/class-api.php index 6ab9b1a..7d40ae5 100644 --- a/includes/api/class-api.php +++ b/includes/api/class-api.php @@ -3,7 +3,7 @@ * The main API class file * * @link https://www.kotisivu.dev - * @since 1.0.0 + * @since 0.1.0 * * @package Gutenberg_Native_Ai */ @@ -13,7 +13,7 @@ /** * This class handles the core API functionality for the plugin. * - * @since 1.0.0 + * @since 0.1.0 * @package Gutenberg_Native_Ai * @author Heikki Vihersalo */ @@ -21,7 +21,7 @@ class API { /** * The base endpoint for this API. * - * @since 1.0.0 + * @since 0.1.0 * @access protected * @var string $base The base endpoint for this API. */ @@ -30,7 +30,7 @@ class API { /** * The unique identifier for this API endpoint (plugin name). * - * @since 1.0.0 + * @since 0.1.0 * @access protected * @var string $plugin_name The string used to uniquely identify this plugin. */ @@ -39,7 +39,7 @@ class API { /** * The current version of the API endpoint. * - * @since 1.0.0 + * @since 0.1.0 * @access protected * @var string $version The current version of the API endpoint. */ @@ -62,7 +62,7 @@ public function __construct( string $name, string $version ) { /** * Load dependencies * - * @since 1.0.0 + * @since 0.1.0 * @access private * @return void */ @@ -76,7 +76,7 @@ private function load_dependencies() { /** * Register plugin API routes * - * @since 1.0.0 + * @since 0.1.0 * @access public * @return void */ diff --git a/includes/api/class-data-encryption.php b/includes/api/class-data-encryption.php index 9e94c6a..3bb8b12 100644 --- a/includes/api/class-data-encryption.php +++ b/includes/api/class-data-encryption.php @@ -13,7 +13,7 @@ /** * Class responsible for encrypting and decrypting data. * - * @since 1.0.0 + * @since 0.1.0 * @access private * @ignore */ @@ -22,7 +22,7 @@ final class Data_Encryption { /** * Key to use for encryption. * - * @since 1.0.0 + * @since 0.1.0 * @var string */ private $key; @@ -30,7 +30,7 @@ final class Data_Encryption { /** * Salt to use for encryption. * - * @since 1.0.0 + * @since 0.1.0 * @var string */ private $salt; @@ -38,7 +38,7 @@ final class Data_Encryption { /** * Constructor. * - * @since 1.0.0 + * @since 0.1.0 */ public function __construct() { $this->key = $this->get_default_key(); @@ -50,7 +50,7 @@ public function __construct() { * * If a user-based key is set, that key is used. Otherwise the default key is used. * - * @since 1.0.0 + * @since 0.1.0 * * @param string $value Value to encrypt. * @return string|bool Encrypted value, or false on failure. @@ -77,7 +77,7 @@ public function encrypt( $value ) { * * If a user-based key is set, that key is used. Otherwise the default key is used. * - * @since 1.0.0 + * @since 0.1.0 * * @param string $raw_value Value to decrypt. * @return string|bool Decrypted value, or false on failure. @@ -106,7 +106,7 @@ public function decrypt( $raw_value ) { /** * Gets the default encryption key to use. * - * @since 1.0.0 + * @since 0.1.0 * * @return string Default (not user-based) encryption key. */ @@ -126,7 +126,7 @@ private function get_default_key() { /** * Gets the default encryption salt to use. * - * @since 1.0.0 + * @since 0.1.0 * * @return string Encryption salt. */ diff --git a/includes/api/enum-api-permission.php b/includes/api/enum-api-permission.php index 4078fe8..d93b789 100644 --- a/includes/api/enum-api-permission.php +++ b/includes/api/enum-api-permission.php @@ -3,7 +3,7 @@ * The API permissions enum file * * @link https://www.kotisivu.dev - * @since 1.0.0 + * @since 0.1.0 * * @package Gutenberg_Native_Ai */ @@ -13,7 +13,7 @@ /** * Enum Permission * - * @since 1.0.0 + * @since 0.1.0 * @package Gutenberg_Native_Ai * @author Heikki Vihersalo */ @@ -21,14 +21,14 @@ enum API_Permission { /** * Admin permission * - * @since 1.0.0 + * @since 0.1.0 */ case ADMIN; /** * Get the callback for the permission * - * @since 1.0.0 + * @since 0.1.0 * @access public * @return \Closure|bool */ diff --git a/includes/class-activator.php b/includes/class-activator.php index 014383e..1326811 100644 --- a/includes/class-activator.php +++ b/includes/class-activator.php @@ -3,7 +3,7 @@ * Fired during plugin activation * * @link https://www.kotisivu.dev - * @since 1.0.0 + * @since 0.1.0 * * @package Gutenberg_Native_Ai */ @@ -15,7 +15,7 @@ * * This class defines all code necessary to run during the plugin's activation. * - * @since 1.0.0 + * @since 0.1.0 * @package Gutenberg_Native_Ai * @author Heikki Vihersalo */ @@ -25,7 +25,7 @@ class Activator { * * Long Description. * - * @since 1.0.0 + * @since 0.1.0 */ public static function activate() { } diff --git a/includes/class-admin.php b/includes/class-admin.php index 79a46fc..5dd5edc 100644 --- a/includes/class-admin.php +++ b/includes/class-admin.php @@ -3,7 +3,7 @@ * The admin-specific functionality of the plugin. * * @link https://www.kotisivu.dev - * @since 1.0.0 + * @since 0.1.0 * * @package Gutenberg_Native_Ai */ @@ -13,7 +13,7 @@ /** * This class defines all code necessary handle the admin area. * - * @since 1.0.0 + * @since 0.1.0 * @package Gutenberg_Native_Ai * @author Heikki Vihersalo */ @@ -21,7 +21,7 @@ class Admin { /** * The unique identifier of this plugin. * - * @since 1.0.0 + * @since 0.1.0 * @access protected * @var string $plugin_name The string used to uniquely identify this plugin. */ @@ -30,7 +30,7 @@ class Admin { /** * The current version of the plugin. * - * @since 1.0.0 + * @since 0.1.0 * @access protected * @var string $version The current version of the plugin. */ @@ -39,7 +39,7 @@ class Admin { /** * Constructor * - * @since 1.0.0 + * @since 0.1.0 * @param string $plugin_name The string used to uniquely identify this plugin. * @param string $version The current version of the plugin. */ diff --git a/includes/class-deactivator.php b/includes/class-deactivator.php index 06d4f42..2ab7b4a 100644 --- a/includes/class-deactivator.php +++ b/includes/class-deactivator.php @@ -3,7 +3,7 @@ * Fired during plugin deactivation * * @link https://www.kotisivu.dev - * @since 1.0.0 + * @since 0.1.0 * * @package Gutenberg_Native_Ai */ @@ -15,7 +15,7 @@ * * This class defines all code necessary to run during the plugin's deactivation. * - * @since 1.0.0 + * @since 0.1.0 * @package Gutenberg_Native_Ai * @author Heikki Vihersalo */ @@ -25,7 +25,7 @@ class Deactivator { * * Long Description. * - * @since 1.0.0 + * @since 0.1.0 */ public static function deactivate() { } diff --git a/includes/class-i18n.php b/includes/class-i18n.php index da8de2f..4eb2907 100644 --- a/includes/class-i18n.php +++ b/includes/class-i18n.php @@ -6,7 +6,7 @@ * so that it is ready for translation. * * @link https://www.kotisivu.dev - * @since 1.0.0 + * @since 0.1.0 * * @package Gutenberg_Native_Ai */ @@ -19,7 +19,7 @@ * Loads and defines the internationalization files for this plugin * so that it is ready for translation. * - * @since 1.0.0 + * @since 0.1.0 * @package Gutenberg_Native_Ai * @author Heikki Vihersalo */ @@ -27,7 +27,7 @@ class i18n { /** * Load the plugin text domain for translation. * - * @since 1.0.0 + * @since 0.1.0 */ public function load_plugin_textdomain() { load_plugin_textdomain( diff --git a/includes/class-loader.php b/includes/class-loader.php index fa14ace..ab4450a 100644 --- a/includes/class-loader.php +++ b/includes/class-loader.php @@ -3,7 +3,7 @@ * Register all actions and filters for the plugin * * @link https://www.kotisivu.dev - * @since 1.0.0 + * @since 0.1.0 * * @package Gutenberg_Native_Ai */ @@ -24,7 +24,7 @@ class Loader { /** * The array of actions registered with WordPress. * - * @since 1.0.0 + * @since 0.1.0 * @access protected * @var array $actions The actions registered with WordPress to fire when the plugin loads. */ @@ -33,7 +33,7 @@ class Loader { /** * The array of filters registered with WordPress. * - * @since 1.0.0 + * @since 0.1.0 * @access protected * @var array $filters The filters registered with WordPress to fire when the plugin loads. */ @@ -42,7 +42,7 @@ class Loader { /** * Initialize the collections used to maintain the actions and filters. * - * @since 1.0.0 + * @since 0.1.0 */ public function __construct() { $this->actions = array(); @@ -52,7 +52,7 @@ public function __construct() { /** * Add a new action to the collection to be registered with WordPress. * - * @since 1.0.0 + * @since 0.1.0 * @param string $hook The name of the WordPress action that is being registered. * @param object $component A reference to the instance of the object on which the action is defined. * @param string $callback The name of the function definition on the $component. @@ -66,7 +66,7 @@ public function add_action( $hook, $component, $callback, $priority = 10, $accep /** * Add a new filter to the collection to be registered with WordPress. * - * @since 1.0.0 + * @since 0.1.0 * @param string $hook The name of the WordPress filter that is being registered. * @param object $component A reference to the instance of the object on which the filter is defined. * @param string $callback The name of the function definition on the $component. @@ -81,7 +81,7 @@ public function add_filter( $hook, $component, $callback, $priority = 10, $accep * A utility function that is used to register the actions and hooks into a single * collection. * - * @since 1.0.0 + * @since 0.1.0 * @access private * @param array $hooks The collection of hooks that is being registered (that is, actions or filters). * @param string $hook The name of the WordPress filter that is being registered. @@ -106,7 +106,7 @@ private function add( $hooks, $hook, $component, $callback, $priority, $accepted /** * Register the filters and actions with WordPress. * - * @since 1.0.0 + * @since 0.1.0 */ public function run() { foreach ( $this->filters as $hook ) { diff --git a/includes/class-plugin.php b/includes/class-plugin.php index 97b9f6f..9b848fa 100644 --- a/includes/class-plugin.php +++ b/includes/class-plugin.php @@ -3,7 +3,7 @@ * The core plugin class. * * @link https://www.kotisivu.dev - * @since 1.0.0 + * @since 0.1.0 * * @package Gutenberg_Native_Ai */ @@ -19,7 +19,7 @@ * Also maintains the unique identifier of this plugin as well as the current * version of the plugin. * - * @since 1.0.0 + * @since 0.1.0 * @package Gutenberg_Native_Ai * @author Heikki Vihersalo */ @@ -28,7 +28,7 @@ class Plugin { * The loader that's responsible for maintaining and registering all hooks that power * the plugin. * - * @since 1.0.0 + * @since 0.1.0 * @access protected * @var Loader $loader Maintains and registers all hooks for the plugin. */ @@ -37,7 +37,7 @@ class Plugin { /** * The unique identifier of this plugin. * - * @since 1.0.0 + * @since 0.1.0 * @access protected * @var string $plugin_name The string used to uniquely identify this plugin. */ @@ -46,7 +46,7 @@ class Plugin { /** * The current version of the plugin. * - * @since 1.0.0 + * @since 0.1.0 * @access protected * @var string $version The current version of the plugin. */ @@ -55,7 +55,7 @@ class Plugin { /** * The current version of the API. * - * @since 1.0.0 + * @since 0.1.0 * @access protected * @var string $api_version The current version of the API. */ @@ -68,10 +68,10 @@ class Plugin { * Load the dependencies, define the locale, and set the hooks for the admin area and * the public-facing side of the site. * - * @since 1.0.0 + * @since 0.1.0 */ public function __construct() { - $this->version = defined( 'GUTENBERG_NATIVE_AI_VERSION' ) ? GUTENBERG_NATIVE_AI_VERSION : '1.0.0'; + $this->version = defined( 'GUTENBERG_NATIVE_AI_VERSION' ) ? GUTENBERG_NATIVE_AI_VERSION : '0.1.0'; $this->api_version = defined( 'GUTENBERG_NATIVE_AI_API_VERSION' ) ? GUTENBERG_NATIVE_AI_API_VERSION : '1'; $this->plugin_name = 'gutenberg-native-ai'; @@ -84,7 +84,7 @@ public function __construct() { /** * Load the required dependencies for this plugin. * - * @since 1.0.0 + * @since 0.1.0 * @access private */ private function load_dependencies() { @@ -127,7 +127,7 @@ private function load_dependencies() { * Uses the Gutenberg_Native_Ai_i18n class in order to set the domain and to register the hook * with WordPress. * - * @since 1.0.0 + * @since 0.1.0 * @access private */ private function set_locale() { @@ -139,7 +139,7 @@ private function set_locale() { /** * Define API routes and callbacks. * - * @since 1.0.0 + * @since 0.1.0 * @access private */ private function add_api_routes() { @@ -152,7 +152,7 @@ private function add_api_routes() { * Register all of the hooks related to the admin area functionality * of the plugin. * - * @since 1.0.0 + * @since 0.1.0 * @access private */ private function define_admin_hooks() { @@ -169,7 +169,7 @@ private function define_admin_hooks() { /** * Run the loader to execute all of the hooks with WordPress. * - * @since 1.0.0 + * @since 0.1.0 */ public function run() { $this->loader->run(); @@ -179,7 +179,7 @@ public function run() { * The name of the plugin used to uniquely identify it within the context of * WordPress and to define internationalization functionality. * - * @since 1.0.0 + * @since 0.1.0 * @return string The name of the plugin. */ public function get_plugin_name() { @@ -189,7 +189,7 @@ public function get_plugin_name() { /** * The reference to the class that orchestrates the hooks with the plugin. * - * @since 1.0.0 + * @since 0.1.0 * @return Loader Orchestrates the hooks of the plugin. */ public function get_loader() { @@ -199,7 +199,7 @@ public function get_loader() { /** * Retrieve the version number of the plugin. * - * @since 1.0.0 + * @since 0.1.0 * @return string The version number of the plugin. */ public function get_version() { @@ -209,7 +209,7 @@ public function get_version() { /** * Retrieve the version number of the API. * - * @since 1.0.0 + * @since 0.1.0 * @return string The version number of the API. */ public function get_api_version() { diff --git a/includes/class-scripts.php b/includes/class-scripts.php index 40c0fa0..66a612a 100644 --- a/includes/class-scripts.php +++ b/includes/class-scripts.php @@ -3,7 +3,7 @@ * The enqueue scripts class. * * @link https://www.kotisivu.dev - * @since 1.0.0 + * @since 0.1.0 * * @package Gutenberg_Native_Ai */ @@ -20,7 +20,7 @@ class Scripts { /** * The ID of this plugin. * - * @since 1.0.0 + * @since 0.1.0 * @access private * @var string $plugin_name The ID of this plugin. */ @@ -29,7 +29,7 @@ class Scripts { /** * The version of this plugin. * - * @since 1.0.0 + * @since 0.1.0 * @access private * @var string $version The current version of this plugin. */ @@ -38,7 +38,7 @@ class Scripts { /** * Initialize the class and set its properties. * - * @since 1.0.0 + * @since 0.1.0 * @param string $plugin_name The name of this plugin. * @param string $version The version of this plugin. */ @@ -50,7 +50,7 @@ public function __construct( $plugin_name, $version ) { /** * Register the stylesheets for the admin area. * - * @since 1.0.0 + * @since 0.1.0 * @access public */ public function enqueue_styles() { @@ -61,7 +61,7 @@ public function enqueue_styles() { /** * Register the JavaScript for the admin area. * - * @since 1.0.0 + * @since 0.1.0 * @access public */ public function enqueue_scripts() { diff --git a/includes/index.php b/includes/index.php index 6129961..238489d 100644 --- a/includes/index.php +++ b/includes/index.php @@ -2,6 +2,6 @@ /** * Silence is golden * - * @since 1.0.0 + * @since 0.1.0 * @package Gutenberg_Native_Ai */ diff --git a/index.php b/index.php index 6129961..238489d 100644 --- a/index.php +++ b/index.php @@ -2,6 +2,6 @@ /** * Silence is golden * - * @since 1.0.0 + * @since 0.1.0 * @package Gutenberg_Native_Ai */ diff --git a/package.json b/package.json index f82bbe3..10c57d1 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,14 @@ { - "name": "kotisivu-block-theme", + "name": "gutenberg-native-ai", "version": "1.0.0", - "description": "Lightweight block theme", + "description": "A plugin that extends the Gutenberg editor with AI features designed to work natively with WordPress.", "author": "Hekki Vihersalo", "license": "GPL-2.0-or-later", "main": "build/index.js", "scripts": { "build": "wp-scripts build", "start": "wp-scripts start", + "zip": "wp-scripts plugin-zip", "format": "wp-scripts format", "lint": "yarn lint:css && yarn lint:js && yarn lint:php", "lint:css": "wp-scripts lint-style 'src/**/*.css'", @@ -16,9 +17,7 @@ "lint:php:fix": "./vendor/bin/phpcbf", "test:php": "./vendor/bin/phpunit" }, - "dependencies": { - "@wordpress/keyboard-shortcuts": "^5.9.0" - }, + "dependencies": {}, "devDependencies": { "@eslint/js": "^9.11.0", "@types/eslint__js": "^8.42.3", @@ -47,5 +46,34 @@ "resolutions": { "@typescript-eslint/typescript-estree": "^7.16.0" }, - "files": [] + "files": [ + ".github/workflows", + ".vscode", + "build/admin", + "build/ai", + "includes", + "languages", + "src", + "types", + ".editorconfig", + ".eslintignore", + ".eslintrc.json", + ".gitignore", + ".prettierignore", + ".prettierrc.js", + ".stylelintrc.json", + "bootstrap.php", + "composer.json", + "composer.lock", + "gutenberg-native-ai.php", + "index.php", + "LICENSE.txt", + "package.json", + "phpcs.xml", + "README.md", + "tsconfig.json", + "uninstall.php", + "webpack.config.js", + "yarn.lock" + ] } diff --git a/uninstall.php b/uninstall.php index d51437c..356e921 100644 --- a/uninstall.php +++ b/uninstall.php @@ -19,7 +19,7 @@ * https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913 * * @link https://www.kotisivu.dev - * @since 1.0.0 + * @since 0.1.0 * * @package Gutenberg_Native_Ai */ diff --git a/yarn.lock b/yarn.lock index 58b06a4..0da0635 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3615,16 +3615,6 @@ "@wordpress/element" "^5.35.0" "@wordpress/keycodes" "^3.58.0" -"@wordpress/keyboard-shortcuts@^5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@wordpress/keyboard-shortcuts/-/keyboard-shortcuts-5.9.0.tgz#889f4ca1bda0b0d54a6bdb696d296b6c6df509a0" - integrity sha512-4gwsrzBtBYEcfKTfJfDbul8bDDb8WiWaf4Ua0w3TDkAIO5l3hMUL/N6plw1a7Do/NcGFOmbm/RTjQkckSuRZ8A== - dependencies: - "@babel/runtime" "^7.16.0" - "@wordpress/data" "^10.9.0" - "@wordpress/element" "^6.9.0" - "@wordpress/keycodes" "^4.9.0" - "@wordpress/keycodes@^3.48.0", "@wordpress/keycodes@^3.54.0", "@wordpress/keycodes@^3.58.0": version "3.58.0" resolved "https://registry.yarnpkg.com/@wordpress/keycodes/-/keycodes-3.58.0.tgz#cc4d2a7c2eb47c2b4718dd6ec0e47c1a77d1f8ba"