Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e13c8a3
Fixed some but not all code quality issues for the logging plugin.
colinmurphy Sep 1, 2025
81b68f6
Update output references in code quality workflow
colinmurphy Sep 1, 2025
3ea7815
Fix SSL issue for running tests on WordPress 6.8 for the logging plugin.
colinmurphy Sep 1, 2025
9aea4f6
Trying to fix SSL issue for 6.8 tests.
colinmurphy Sep 1, 2025
37d06dd
Fixing SSL flag.
colinmurphy Sep 1, 2025
0480990
Applied fix to other plugins for 6.8.
colinmurphy Sep 1, 2025
323c844
Fixed PHPStan errors for logging.
colinmurphy Sep 1, 2025
eb60091
Fixed PHPCS errors for the logging plugin.
colinmurphy Sep 1, 2025
e3e7ec0
Fixed Psalm errors for the logging plugin.
colinmurphy Sep 1, 2025
cbdfe65
Reverted changes so I can just test logging plugin.
colinmurphy Sep 1, 2025
bba0c2c
Fixed fatal error caused by code quality change.
colinmurphy Sep 1, 2025
963b9f7
Removed test file as it needs to be fixed a later iteration.
colinmurphy Sep 1, 2025
d7e1b1f
Fixing SSL issue in the docker-compose file.
colinmurphy Sep 1, 2025
9f9c350
Reverting changes.
colinmurphy Sep 1, 2025
0680088
Adding a fix fir SSL for tests.
colinmurphy Sep 1, 2025
eb22341
Updating docker compose file to fix the issue for 6.8 with SSL required.
colinmurphy Sep 1, 2025
466d4f9
Updating mysql commands to disable SSL mode.
colinmurphy Sep 1, 2025
0629d98
Updated mariaDB version to fix issue with --ssl-mode=DISABLED
colinmurphy Sep 1, 2025
23abea6
Fix for docker-compose.
colinmurphy Sep 1, 2025
d75c12c
Added healthcheck.
colinmurphy Sep 1, 2025
5525b94
Fixes.
colinmurphy Sep 1, 2025
c35849a
Reverting mariadb change.
colinmurphy Sep 1, 2025
0202479
Reverted. Added mu plugin to see if we can disable WP SSL verify.
colinmurphy Sep 1, 2025
b7b6f47
Adding --no-defaults to try and ignore SSL issue.
colinmurphy Sep 1, 2025
d65c247
Fixing SSL flag.
colinmurphy Sep 2, 2025
1c3ab56
Fix for DB dump.
colinmurphy Sep 2, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
runs-on: ubuntu-latest
name: Detect plugins has php code quality configuration
outputs:
plugins: ${{ steps.detect.outputs.plugins }}
has-plugins: ${{ steps.detect.outputs.has-plugins }}
plugins: ${{ steps.detect-plugin-slug.outputs.plugins }}
has-plugins: ${{ steps.detect-plugin-slug.outputs.has-plugins }}
php-version: ${{ steps.detect-php-version.outputs.php-version }}
steps:
- name: Checkout
Expand Down
18 changes: 4 additions & 14 deletions plugins/wpgraphql-logging/bin/install-test-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ install_db() {
# create database
echo -e "$(status_message "Creating the database (if it does not exist)...")"

RESULT=$(mysql -u $WORDPRESS_DB_USER --password="$WORDPRESS_DB_PASSWORD" --skip-column-names -e "SHOW DATABASES LIKE '$WORDPRESS_DB_NAME'"$EXTRA)
if [ "$RESULT" != $WORDPRESS_DB_NAME ]; then
mysqladmin create $WORDPRESS_DB_NAME --user="$WORDPRESS_DB_USER" --password="$WORDPRESS_DB_PASSWORD"$EXTRA
fi
RESULT=$(mysql --no-defaults --ssl=false -u $WORDPRESS_DB_USER --password="$WORDPRESS_DB_PASSWORD" --skip-column-names -e "SHOW DATABASES LIKE '$WORDPRESS_DB_NAME'"$EXTRA)
if [ "$RESULT" != $WORDPRESS_DB_NAME ]; then
mysqladmin --no-defaults --ssl=false create $WORDPRESS_DB_NAME --user="$WORDPRESS_DB_USER" --password="$WORDPRESS_DB_PASSWORD"$EXTRA
fi
}

download() {
Expand Down Expand Up @@ -117,7 +117,6 @@ configure_wordpress() {
SITE_TITLE=${WORDPRESS_SITE_TITLE:-"WPGraphQL Logging Tests"}

wp core install --title="$SITE_TITLE" --admin_user="$WORDPRESS_ADMIN_USER" --admin_password="$WORDPRESS_ADMIN_PASSWORD" --admin_email="$WORDPRESS_ADMIN_EMAIL" --skip-email --url="$WORDPRESS_URL" --allow-root

echo -e "$(status_message "Running WordPress version: $(wp core version --allow-root) at $(wp option get home --allow-root)")"
}

Expand Down Expand Up @@ -196,15 +195,6 @@ post_setup() {
wp config set WP_AUTO_UPDATE_CORE false --raw --type=constant --quiet --allow-root
wp config set AUTOMATIC_UPDATER_DISABLED true --raw --type=constant --quiet --allow-root

# Export the db for codeception to use
SQLDUMP="$WORDPRESS_ROOT_DIR/wp-content/plugins/$PLUGIN_SLUG/tests/_data/dump.sql"
mkdir -p "$(dirname "$SQLDUMP")"
if [ ! -f "$SQLDUMP" ]; then
echo -e "$(status_message "Exporting test database dump...")"

wp db export "$SQLDUMP" --allow-root
fi

echo -e "$(status_message "Installed plugins")"
wp plugin list --allow-root
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,21 @@ public function get_fields(): array {


$fields[ self::EVENT_LOG_SELECTION ] = new Select_Field(
self::EVENT_LOG_SELECTION,
$this->get_name(),
__( 'Log Points', 'wpgraphql-logging' ),
[
Events::PRE_REQUEST => __( 'Pre Request', 'wpgraphql-logging' ),
Events::BEFORE_GRAPHQL_EXECUTION => __( 'Before Query Execution', 'wpgraphql-logging' ),
Events::BEFORE_RESPONSE_RETURNED => __( 'Before Response Returned', 'wpgraphql-logging' ),
Events::REQUEST_DATA => __( 'Request Data', 'wpgraphql-logging' ),
Events::REQUEST_RESULTS => __( 'Request Results', 'wpgraphql-logging' ),
Events::RESPONSE_HEADERS_TO_SEND => __( 'Response Headers', 'wpgraphql-logging' ),
],
'',
__( 'Select which points in the request lifecycle to log. By default, all points are logged.', 'wpgraphql-logging' ),
true
);
self::EVENT_LOG_SELECTION,
$this->get_name(),
__( 'Log Points', 'wpgraphql-logging' ),
[
Events::PRE_REQUEST => __( 'Pre Request', 'wpgraphql-logging' ),
Events::BEFORE_GRAPHQL_EXECUTION => __( 'Before Query Execution', 'wpgraphql-logging' ),
Events::BEFORE_RESPONSE_RETURNED => __( 'Before Response Returned', 'wpgraphql-logging' ),
Events::REQUEST_DATA => __( 'Request Data', 'wpgraphql-logging' ),
Events::REQUEST_RESULTS => __( 'Request Results', 'wpgraphql-logging' ),
Events::RESPONSE_HEADERS_TO_SEND => __( 'Response Headers', 'wpgraphql-logging' ),
],
'',
__( 'Select which points in the request lifecycle to log. By default, all points are logged.', 'wpgraphql-logging' ),
true
);

return apply_filters( 'wpgraphql_logging_basic_configuration_fields', $fields );
}
Expand Down
130 changes: 65 additions & 65 deletions plugins/wpgraphql-logging/src/Events/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,75 +8,75 @@
* List of available events that users can subscribe to with the EventManager.
*/
final class Events {
/**
* WPGraphQL action: do_graphql_request.
*
* Before the request is processed.
*
* @var string
*/
public const PRE_REQUEST = 'do_graphql_request';
/**
* WPGraphQL action: do_graphql_request.
*
* Before the request is processed.
*
* @var string
*/
public const PRE_REQUEST = 'do_graphql_request';

/**
* WPGraphQL action: graphql_before_execute.
*
* @var string
*/
public const BEFORE_GRAPHQL_EXECUTION = 'graphql_before_execute';
/**
* WPGraphQL action: graphql_before_execute.
*
* @var string
*/
public const BEFORE_GRAPHQL_EXECUTION = 'graphql_before_execute';

/**
* WPGraphQL action: graphql_return_response
*
* Before the response is returned to the client.
*
* @var string
*/
public const BEFORE_RESPONSE_RETURNED = 'graphql_return_response';
/**
* WPGraphQL action: graphql_return_response
*
* Before the response is returned to the client.
*
* @var string
*/
public const BEFORE_RESPONSE_RETURNED = 'graphql_return_response';

/**
* WPGraphQL filter: graphql_request_data.
*
* Allows the request data to be filtered. Ideal for capturing the
* full payload before processing.
*
* @var string
*/
public const REQUEST_DATA = 'graphql_request_data';
/**
* WPGraphQL filter: graphql_request_data.
*
* Allows the request data to be filtered. Ideal for capturing the
* full payload before processing.
*
* @var string
*/
public const REQUEST_DATA = 'graphql_request_data';

/**
* WPGraphQL filter: graphql_response_headers_to_send.
*
* Filters the headers to send in the GraphQL response.
*
* @var string
*/
public const RESPONSE_HEADERS_TO_SEND = 'graphql_response_headers_to_send';
/**
* WPGraphQL filter: graphql_response_headers_to_send.
*
* Filters the headers to send in the GraphQL response.
*
* @var string
*/
public const RESPONSE_HEADERS_TO_SEND = 'graphql_response_headers_to_send';

/**
* WPGraphQL filter: graphql_request_results.
*
* Filters the final results of the GraphQL execution.
*
* @var string
*/
public const REQUEST_RESULTS = 'graphql_request_results';
/**
* WPGraphQL filter: graphql_request_results.
*
* Filters the final results of the GraphQL execution.
*
* @var string
*/
public const REQUEST_RESULTS = 'graphql_request_results';

/**
* WPGraphQL filter: graphql_debug_enabled.
*
* Determines if GraphQL Debug is enabled. Useful for toggling logging.
*
* @var string
*/
public const DEBUG_ENABLED = 'graphql_debug_enabled';
/**
* WPGraphQL filter: graphql_debug_enabled.
*
* Determines if GraphQL Debug is enabled. Useful for toggling logging.
*
* @var string
*/
public const DEBUG_ENABLED = 'graphql_debug_enabled';

/**
* WPGraphQL filter: graphql_app_context_config.
*
* Filters the config for the AppContext. Useful for storing temporary
* data for the duration of a request.
*
* @var string
*/
public const APP_CONTEXT_CONFIG = 'graphql_app_context_config';
}
/**
* WPGraphQL filter: graphql_app_context_config.
*
* Filters the config for the AppContext. Useful for storing temporary
* data for the duration of a request.
*
* @var string
*/
public const APP_CONTEXT_CONFIG = 'graphql_app_context_config';
}
Loading