From 4aa2df7998b7806e50cd961eb128f4e142af1c6b Mon Sep 17 00:00:00 2001 From: Chris Kindred Date: Tue, 10 Oct 2023 15:15:16 -0400 Subject: [PATCH 1/6] Remove alignment plugin from composer --- composer.json | 1 - composer.lock | 34 ++-------------------------------- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/composer.json b/composer.json index 5040aff2..f1bbebb5 100644 --- a/composer.json +++ b/composer.json @@ -111,7 +111,6 @@ }, "require": { "php": "^8.0|^8.1", - "block-editor-custom-alignments/block-editor-custom-alignments": "*", "composer/installers": "^2.2", "gravityforms/gravityforms": "*", "humanmade/s3-uploads": "^3.0", diff --git a/composer.lock b/composer.lock index c9869412..d40caee4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "da2ed3eaf3f1f3cde32644ff23675671", + "content-hash": "c3a80f6fc3836ee7b290191f73432a39", "packages": [ { "name": "aws/aws-crt-php", @@ -155,18 +155,6 @@ }, "time": "2023-08-30T18:19:33+00:00" }, - { - "name": "block-editor-custom-alignments/block-editor-custom-alignments", - "version": "1.0.6", - "dist": { - "type": "zip", - "url": "https://github.com/moderntribe/block-editor-custom-alignments/releases/download/v1.0.6/block-editor-custom-alignments.1.0.6.zip" - }, - "require": { - "ffraenz/private-composer-installer": "^5.0" - }, - "type": "wordpress-plugin" - }, { "name": "composer/ca-bundle", "version": "1.3.7", @@ -6439,24 +6427,6 @@ "type": "wordpress-plugin", "homepage": "https://wordpress.org/plugins/limit-login-attempts-reloaded/" }, - { - "name": "wpackagist-plugin/redirection", - "version": "5.3.10", - "source": { - "type": "svn", - "url": "https://plugins.svn.wordpress.org/redirection/", - "reference": "tags/5.3.10" - }, - "dist": { - "type": "zip", - "url": "https://downloads.wordpress.org/plugin/redirection.5.3.10.zip" - }, - "require": { - "composer/installers": "^1.0 || ^2.0" - }, - "type": "wordpress-plugin", - "homepage": "https://wordpress.org/plugins/redirection/" - }, { "name": "wpackagist-plugin/safe-svg", "version": "2.2.0", @@ -11859,5 +11829,5 @@ "platform-overrides": { "php": "8.1" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } From 72b13ce52177bfda4c2d1995f001c41fc002bdb1 Mon Sep 17 00:00:00 2001 From: Chris Kindred Date: Tue, 10 Oct 2023 15:17:07 -0400 Subject: [PATCH 2/6] Adds escaping to get_block_wrapper_attributes --- wp-content/themes/core/blocks/tribe/post-permalink/render.php | 2 +- wp-content/themes/core/blocks/tribe/post-type-name/render.php | 2 +- .../themes/core/blocks/tribe/query-results-count/render.php | 2 +- wp-content/themes/core/blocks/tribe/terms/render.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-content/themes/core/blocks/tribe/post-permalink/render.php b/wp-content/themes/core/blocks/tribe/post-permalink/render.php index 01849e1f..54c662c1 100644 --- a/wp-content/themes/core/blocks/tribe/post-permalink/render.php +++ b/wp-content/themes/core/blocks/tribe/post-permalink/render.php @@ -3,6 +3,6 @@ $post_permalink = get_the_permalink(); ?> -
> +
>
diff --git a/wp-content/themes/core/blocks/tribe/post-type-name/render.php b/wp-content/themes/core/blocks/tribe/post-type-name/render.php index e5d932ca..f9c5fe77 100644 --- a/wp-content/themes/core/blocks/tribe/post-type-name/render.php +++ b/wp-content/themes/core/blocks/tribe/post-type-name/render.php @@ -14,6 +14,6 @@ } ?> -
> +
> labels->singular_name, 'tribe' ); ?>
diff --git a/wp-content/themes/core/blocks/tribe/query-results-count/render.php b/wp-content/themes/core/blocks/tribe/query-results-count/render.php index a69985f7..7c5aa99f 100644 --- a/wp-content/themes/core/blocks/tribe/query-results-count/render.php +++ b/wp-content/themes/core/blocks/tribe/query-results-count/render.php @@ -19,6 +19,6 @@ } ?> -
> +
>

diff --git a/wp-content/themes/core/blocks/tribe/terms/render.php b/wp-content/themes/core/blocks/tribe/terms/render.php index 32cd395e..a9ec9f6f 100644 --- a/wp-content/themes/core/blocks/tribe/terms/render.php +++ b/wp-content/themes/core/blocks/tribe/terms/render.php @@ -13,7 +13,7 @@ $terms_block = new Terms_Block( $attributes ); $terms = $terms_block->get_the_terms(); -echo '
'; +echo '
'; if ( 0 === count( $terms ) ) { echo ''; From 7dc738fcfb1264d19efffa08187b0beda50798a8 Mon Sep 17 00:00:00 2001 From: Chris Kindred Date: Tue, 10 Oct 2023 15:30:00 -0400 Subject: [PATCH 3/6] upgrade phpcs for php8 --- .deploy/config/local-config-dokku.php | 4 +--- phpcs.xml.dist | 2 +- wp-content/plugins/core/src/Core.php | 10 ++-------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.deploy/config/local-config-dokku.php b/.deploy/config/local-config-dokku.php index fa4af2de..64f544fa 100644 --- a/.deploy/config/local-config-dokku.php +++ b/.deploy/config/local-config-dokku.php @@ -9,10 +9,8 @@ * * @param string $key * @param string $default - * - * @return string|bool */ -function fromenv( string $key, mixed $default = null ) { +function fromenv( string $key, mixed $default = null ): string|array|bool { $value = getenv( $key ); if ( $value === false ) { $value = $default; diff --git a/phpcs.xml.dist b/phpcs.xml.dist index bed6efb2..b8473898 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -10,7 +10,7 @@ - + diff --git a/wp-content/plugins/core/src/Core.php b/wp-content/plugins/core/src/Core.php index 026dfe33..833ca084 100644 --- a/wp-content/plugins/core/src/Core.php +++ b/wp-content/plugins/core/src/Core.php @@ -8,10 +8,7 @@ class Core { public const PLUGIN_FILE = 'plugin.file'; - /** - * @var \Psr\Container\ContainerInterface|\Invoker\InvokerInterface|\DI\FactoryInterface - */ - private $container; + private \Psr\Container\ContainerInterface|\Invoker\InvokerInterface|\DI\FactoryInterface $container; /** * @var string[] Names of classes implementing Definer_Interface. @@ -56,10 +53,7 @@ public function init( string $plugin_path ): void { $this->init_container( $plugin_path ); } - /** - * @return \Psr\Container\ContainerInterface|\Invoker\InvokerInterface|\DI\FactoryInterface - */ - public function container() { + public function container(): \Psr\Container\ContainerInterface|\Invoker\InvokerInterface|\DI\FactoryInterface { return $this->container; } From a7f089e553e76de7b9ad768d39db03a3fc2c9207 Mon Sep 17 00:00:00 2001 From: Chris Kindred Date: Tue, 10 Oct 2023 15:35:13 -0400 Subject: [PATCH 4/6] Avoid using WP Global variable name --- .../themes/core/blocks/tribe/terms/render.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/wp-content/themes/core/blocks/tribe/terms/render.php b/wp-content/themes/core/blocks/tribe/terms/render.php index a9ec9f6f..8851dad0 100644 --- a/wp-content/themes/core/blocks/tribe/terms/render.php +++ b/wp-content/themes/core/blocks/tribe/terms/render.php @@ -10,24 +10,24 @@ * @var \WP_Block $block The instance of the WP_Block class that represents the block being rendered. */ -$terms_block = new Terms_Block( $attributes ); -$terms = $terms_block->get_the_terms(); +$terms_block = new Terms_Block( $attributes ); +$terms_block_terms = $terms_block->get_the_terms(); echo '
'; -if ( 0 === count( $terms ) ) { +if ( 0 === count( $terms_block_terms ) ) { echo ''; echo '
'; return; } -if ( count( $terms ) > 1 ) { +if ( count( $terms_block_terms ) > 1 ) { echo '
    '; } -foreach ( $terms as $term ) { - if ( count( $terms ) > 1 ) { +foreach ( $terms_block_terms as $term ) { + if ( count( $terms_block_terms ) > 1 ) { echo '
  • '; } @@ -36,7 +36,7 @@ if ( $terms_block->display_as_links() ) { echo sprintf( '%s', - esc_url( get_term_link( $term ) ), + esc_url( get_term_link( $term ) ?? '' ), esc_html( $term->name ) ); } else { @@ -48,12 +48,12 @@ echo ''; - if ( count( $terms ) > 1 ) { // phpcs:ignore SlevomatCodingStandard.ControlStructures.EarlyExit.EarlyExitNotUsed + if ( count( $terms_block_terms ) > 1 ) { // phpcs:ignore SlevomatCodingStandard.ControlStructures.EarlyExit.EarlyExitNotUsed echo '
  • '; } } -if ( count( $terms ) > 1 ) { +if ( count( $terms_block_terms ) > 1 ) { echo '
'; } From ef47b327daa2944257558b0f5fd261e06a19a916 Mon Sep 17 00:00:00 2001 From: Chris Kindred Date: Tue, 10 Oct 2023 16:24:55 -0400 Subject: [PATCH 5/6] escape the login_logo url --- wp-content/plugins/core/src/Assets/Admin_Assets_Enqueuer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-content/plugins/core/src/Assets/Admin_Assets_Enqueuer.php b/wp-content/plugins/core/src/Assets/Admin_Assets_Enqueuer.php index 15ef37cd..a5846dbe 100644 --- a/wp-content/plugins/core/src/Assets/Admin_Assets_Enqueuer.php +++ b/wp-content/plugins/core/src/Assets/Admin_Assets_Enqueuer.php @@ -77,7 +77,7 @@ public function update_login_header(): void { padding-top: 86px; } ', - $login_logo + esc_url( $login_logo ) ); } From 0e7268f5b3d9bc7067cb781b6d2d5b6e370a1174 Mon Sep 17 00:00:00 2001 From: Chris Kindred Date: Tue, 10 Oct 2023 16:29:27 -0400 Subject: [PATCH 6/6] Replace the variable post_type with block_post_type to not override WP vars. --- .../themes/core/blocks/tribe/post-type-name/render.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-content/themes/core/blocks/tribe/post-type-name/render.php b/wp-content/themes/core/blocks/tribe/post-type-name/render.php index f9c5fe77..b264af85 100644 --- a/wp-content/themes/core/blocks/tribe/post-type-name/render.php +++ b/wp-content/themes/core/blocks/tribe/post-type-name/render.php @@ -1,13 +1,13 @@