diff --git a/plugins/wpgraphql-logging/activation.php b/plugins/wpgraphql-logging/activation.php index 102cd706..af01d313 100644 --- a/plugins/wpgraphql-logging/activation.php +++ b/plugins/wpgraphql-logging/activation.php @@ -11,6 +11,10 @@ use WPGraphQL\Logging\Plugin; +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + /** * Runs when the plugin is activated. */ diff --git a/plugins/wpgraphql-logging/composer.json b/plugins/wpgraphql-logging/composer.json index 4f717be2..90f03139 100644 --- a/plugins/wpgraphql-logging/composer.json +++ b/plugins/wpgraphql-logging/composer.json @@ -2,7 +2,7 @@ "name": "wpengine/wpgraphql-logging", "type": "wordpress-plugin", "description": "A plugin for logging WPGraphQL request lifecycle tp help with debugging and performance analysis for WPGraphQL queries.", - "license": "GPLv2 or later", + "license": "GPL-2.0-or-later", "version": "1.0.1", "authors": [ { diff --git a/plugins/wpgraphql-logging/deactivation.php b/plugins/wpgraphql-logging/deactivation.php index 5f135ded..0b7aafd2 100644 --- a/plugins/wpgraphql-logging/deactivation.php +++ b/plugins/wpgraphql-logging/deactivation.php @@ -11,6 +11,10 @@ use WPGraphQL\Logging\Plugin; +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + /** * Runs when the plugin is deactivated. */ diff --git a/plugins/wpgraphql-logging/readme.txt b/plugins/wpgraphql-logging/readme.txt index 36b9e2db..aebfd6b2 100644 --- a/plugins/wpgraphql-logging/readme.txt +++ b/plugins/wpgraphql-logging/readme.txt @@ -6,7 +6,7 @@ Tested up to: 6.9 Requires PHP: 8.1.2 Requires WPGraphQL: 2.3.0 Stable tag: 1.0.1 -License: GPL-2.0-or-later +License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html WPGraphQL Logging plugin provides observability and visibility into the GraphQL request and event lifecycle. This allows users to quickly identify and resolve performance issues and bottlenecks within their headless WordPress application. diff --git a/plugins/wpgraphql-logging/src/Admin/Settings/Templates/admin.php b/plugins/wpgraphql-logging/src/Admin/Settings/Templates/admin.php index c34f170b..6a149892 100644 --- a/plugins/wpgraphql-logging/src/Admin/Settings/Templates/admin.php +++ b/plugins/wpgraphql-logging/src/Admin/Settings/Templates/admin.php @@ -13,6 +13,10 @@ use WPGraphQL\Logging\Admin\Settings\Fields\Tab\BasicConfigurationTab; use WPGraphQL\Logging\Admin\Settings\Fields\Tab\DataManagementTab; +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + $wpgraphql_logging_configuration_helper = ConfigurationHelper::get_instance(); $wpgraphql_logging_tabs_config = (array) get_query_var( 'wpgraphql_logging_main_page_config' ); $wpgraphql_logging_current_tab = (string) ( $wpgraphql_logging_tabs_config['current_tab'] ?? '' ); diff --git a/plugins/wpgraphql-logging/src/Admin/View/Download/DownloadLogService.php b/plugins/wpgraphql-logging/src/Admin/View/Download/DownloadLogService.php index f067a795..0bcecbdb 100644 --- a/plugins/wpgraphql-logging/src/Admin/View/Download/DownloadLogService.php +++ b/plugins/wpgraphql-logging/src/Admin/View/Download/DownloadLogService.php @@ -62,7 +62,7 @@ public function generate_csv( int $log_id ): void { $content = $this->get_content( $log ); $writer->insertOne( $headers ); $writer->insertOne( $content ); - fclose( $output ); + fclose( $output ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose -- Closes the php://output stream, which WP_Filesystem can't handle. exit; } diff --git a/plugins/wpgraphql-logging/src/Admin/View/List/ListTable.php b/plugins/wpgraphql-logging/src/Admin/View/List/ListTable.php index 726557dc..cd7e9028 100644 --- a/plugins/wpgraphql-logging/src/Admin/View/List/ListTable.php +++ b/plugins/wpgraphql-logging/src/Admin/View/List/ListTable.php @@ -10,6 +10,10 @@ use WPGraphQL\Logging\Logger\Database\WordPressDatabaseEntity; use WP_List_Table; +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + // Include the WP_List_Table class if not already loaded. if ( ! class_exists( 'WP_List_Table' ) ) { require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; diff --git a/plugins/wpgraphql-logging/src/Admin/View/Templates/WPGraphQLLoggerNotice.php b/plugins/wpgraphql-logging/src/Admin/View/Templates/WPGraphQLLoggerNotice.php index 834b3957..94ec035b 100644 --- a/plugins/wpgraphql-logging/src/Admin/View/Templates/WPGraphQLLoggerNotice.php +++ b/plugins/wpgraphql-logging/src/Admin/View/Templates/WPGraphQLLoggerNotice.php @@ -11,6 +11,10 @@ use WPGraphQL\Logging\Admin\AdminNotice; +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + $wpgraphql_logging_key = AdminNotice::ADMIN_NOTICE_KEY; $wpgraphql_logging_ajax_nonce = wp_create_nonce( $wpgraphql_logging_key ); $wpgraphql_logging_notice = __( "Heads up! While very useful for debugging, the WPGraphQL Logging Plugin can impact your site's performance under heavy usage, so please use it judiciously.", 'wpgraphql-logging' ); diff --git a/plugins/wpgraphql-logging/src/Admin/View/Templates/WPGraphQLLoggerView.php b/plugins/wpgraphql-logging/src/Admin/View/Templates/WPGraphQLLoggerView.php index cfb3830e..833ab9e2 100644 --- a/plugins/wpgraphql-logging/src/Admin/View/Templates/WPGraphQLLoggerView.php +++ b/plugins/wpgraphql-logging/src/Admin/View/Templates/WPGraphQLLoggerView.php @@ -13,6 +13,10 @@ * * @since 0.0.1 */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; +} ?>