Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
core:
- {name: 'WP latest', version: 'latest'}
- {name: 'WP minimum', version: 'WordPress/WordPress#6.7'}
- {name: 'WP minimum', version: 'WordPress/WordPress#6.8'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}

steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/plugin-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ jobs:
working-directory: ${{ github.event.repository.name }}

- name: Run plugin check
uses: wordpress/plugin-check-action@70f38272b2beee386e973f319591baa2fc7dff16 # v1.1.2
uses: wordpress/plugin-check-action@ec9b3fe9beaa76bcc4510b7ba2cb5855a5f80f3f # v1.1.4
with:
build-dir: ${{ github.event.repository.name }}
exclude-checks: 'plugin_readme,plugin_updater' # Plugin isn't on .org so excluding these for now.
exclude-directories: 'assets,dist,vendor'
exclude-files: 'includes/Classifai/Providers/Watson/Helpers.php,includes/Classifai/Helpers.php' # These files are included via composer and cause errors with PHPCS if we fix the "prevent direct access" check.
ignore-codes: 'PluginCheck.CodeAnalysis.DiscouragedFunctions.load_plugin_textdomainFound' # Plugin isn't on .org so we load the textdomain manually.
ignore-warnings: true
4 changes: 4 additions & 0 deletions classifai.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
* Domain Path: /languages
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Get the minimum version of PHP required by this plugin.
*
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"require": {
"php": ">=7.4",
"yahnis-elsts/plugin-update-checker": "5.1",
"aws/aws-sdk-php": "^3.300",
"aws/aws-sdk-php": "3.337.3",
"woocommerce/action-scheduler": "3.8.1"
},
"autoload": {
Expand Down Expand Up @@ -46,6 +46,11 @@
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
},
"audit": {
"ignore": {
"PKSA-dxyf-6n16-t87m": "Latest version of aws/aws-sdk-php that we can use as newer versions drop support for PHP 7.4"
}
}
},
"archive": {
Expand Down
16 changes: 8 additions & 8 deletions composer.lock

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

4 changes: 4 additions & 0 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
* Global Constants.
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

$plugin_version = '3.7.0';

// Useful global constants
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Admin/BulkActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

use function Classifai\attachment_is_pdf;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Handle bulk actions.
*/
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Admin/DebugInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

namespace Classifai\Admin;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Adds information useful for debugging to the Site Health screen introduced to core in 5.2.
*
Expand Down
6 changes: 5 additions & 1 deletion includes/Classifai/Admin/Notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
use Classifai\Features\Classification;
use function Classifai\should_use_legacy_settings_panel;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

class Notifications {

/**
Expand Down Expand Up @@ -284,7 +288,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 */
// phpcs:disable Squiz.PHP.Heredoc.NotAllowed, PluginCheck.CodeAnalysis.Heredoc.NotAllowed
$script = <<<EOD
jQuery( function() {
const dismissNotices = document.querySelectorAll( '.classifai-dismissible-notice' );
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Admin/Onboarding.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
use Classifai\Plugin;
use Classifai\Services\ServicesManager;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

class Onboarding {

/**
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
use function Classifai\get_post_statuses_for_language_settings;
use function Classifai\is_elasticpress_installed;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

class Settings {

/**
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Admin/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

use YahnisElsts\PluginUpdateChecker\v5\PucFactory;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Plugin update class.
*/
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Admin/UserProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

use function Classifai\get_plugin;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* The UserProfile class provides opt-out settings for ClassifAI feature on user profile page.
*
Expand Down
4 changes: 4 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,10 @@
* @package ClassifAI
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

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

// phpcs:ignore WordPress.Security.NonceVerification.Recommended
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Admin/templates/onboarding-footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
* @package ClassifAI
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/** @var array $args Arguments coming from the included file. */
?>
<div class="classifai-setup-footer">
Expand Down
4 changes: 4 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,10 @@
* @package ClassifAI
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

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

/** @var array $args Arguments coming from the included file. */
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Admin/templates/onboarding-step-four.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
* @package ClassifAI
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

$onboarding_options = get_option( 'classifai_onboarding_options', array() );
$enabled_features = $onboarding_options['enabled_features'] ?? array();
$configured_features = $onboarding_options['configured_features'] ?? array();
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Admin/templates/onboarding-step-one.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
* @package ClassifAI
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

$onboarding = new Classifai\Admin\Onboarding();
$features = $onboarding->get_features();
$onboarding_options = $onboarding->get_onboarding_options();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
* @package ClassifAI
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

$base_url = admin_url( 'admin.php?page=classifai_setup&step=3' );
$onboarding = new Classifai\Admin\Onboarding();
$enabled_features = $onboarding->get_enabled_features();
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Admin/templates/onboarding-step-two.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
* @package ClassifAI
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

$onboarding = new Classifai\Admin\Onboarding();
$args = array(
'step' => 2,
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Blocks/key-takeaways/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
* @var WP_Block $block Block instance.
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

$block_title = $attributes['title'] ?? '';
$layout = $attributes['render'] ?? 'list';
$takeaways = $attributes['takeaways'] ?? [];
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Command/ClassifaiCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
use function Classifai\Providers\Watson\get_password;
use function Classifai\safe_file_get_contents;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* ClassifaiCommand is the command line interface of the ClassifAI plugin.
* It provides subcommands to test classification results and batch
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/EmbeddingsScheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
use ActionScheduler_DBLogger;
use ActionScheduler_Store;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

class EmbeddingsScheduler {

/**
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Features/AudioTranscriptsGeneration.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
use function Classifai\is_remote_url;
use function Classifai\is_local_path;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Class AudioTranscriptsGeneration
*/
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Features/Classification.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
use function Classifai\get_asset_info;
use function Classifai\get_classification_mode;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Class Classification
*/
Expand Down
9 changes: 5 additions & 4 deletions includes/Classifai/Features/ContentGeneration.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
namespace Classifai\Features;

use Classifai\Providers\Azure\OpenAI;
use Classifai\Providers\GoogleAI\GeminiAPI;
use Classifai\Providers\OpenAI\ChatGPT;
use Classifai\Providers\Browser\ChromeAI;
use Classifai\Providers\XAI\Grok;
use Classifai\Providers\Localhost\Ollama;
use Classifai\Services\LanguageProcessing;
use WP_REST_Server;
Expand All @@ -16,6 +13,10 @@
use function Classifai\sanitize_prompts;
use function Classifai\get_asset_info;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Class ContentGeneration
*/
Expand All @@ -34,7 +35,7 @@ class ContentGeneration extends Feature {
*/
public $prompt = 'Act as an experienced SEO copywriter tasked with writing an article based off of a given summary and an optionally provided title. Your goal is to craft a compelling, informative piece that adheres to SEO best practices, is well-researched, engaging to the target audience, and structured in a way that enhances readability. Incorporate relevant keywords naturally throughout the text, without compromising the flow or quality of the content. Ensure that the article provides value to the reader. Only return the contents of the article, not the title or other commentary.';

// phpcs:disable Squiz.PHP.Heredoc.NotAllowed
// phpcs:disable Squiz.PHP.Heredoc.NotAllowed, PluginCheck.CodeAnalysis.Heredoc.NotAllowed
/**
* The format of how we'd like content to be returned.
*
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Features/ContentResizing.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
use function Classifai\sanitize_prompts;
use function Classifai\get_asset_info;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Class ContentResizing
*/
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Features/DescriptiveTextGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

use function Classifai\clean_input;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Class DescriptiveTextGenerator
*/
Expand Down
4 changes: 4 additions & 0 deletions includes/Classifai/Features/ExcerptGeneration.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
use function Classifai\get_asset_info;
use function Classifai\sanitize_prompts;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Class ExcerptGeneration
*/
Expand Down
Loading