From 022f60a4a66d181babf8600835675c34a3964bff Mon Sep 17 00:00:00 2001 From: drill-lancer Date: Tue, 12 Mar 2024 11:38:15 +0900 Subject: [PATCH 1/7] fix: dynamic extension --- src/utils/is-excludes-blocks.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/is-excludes-blocks.js b/src/utils/is-excludes-blocks.js index 29d5846ee..3c962e36c 100644 --- a/src/utils/is-excludes-blocks.js +++ b/src/utils/is-excludes-blocks.js @@ -54,11 +54,11 @@ export const isExcludesBlocks = ({ blockName, addExclude }) => { 'core/block', 'core/rss', 'core/search', - 'core/social-link', + //'core/social-link', 'core/tag-cloud', - 'core/site-logo', - 'core/site-title', - 'core/site-tagline', + //'core/site-logo', + //'core/site-title', + //'core/site-tagline', 'core/template-part', 'core/post-title', 'core/post-excerpt', From 37f9cc2926207550c129969d18b023d0509b7c5b Mon Sep 17 00:00:00 2001 From: drill-lancer Date: Tue, 12 Mar 2024 14:10:40 +0900 Subject: [PATCH 2/7] fix: readme --- readme.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.txt b/readme.txt index a4a18468e..f6714253a 100644 --- a/readme.txt +++ b/readme.txt @@ -103,6 +103,8 @@ e.g. == Changelog == +[ Specification Change ] core/social-link, core/site-logo, core/site-title and core/site-tagline correspond to custom-css-extension, hidden-extension and margin-extension + = 1.69.1 = [ Bug Fix ][ Inline Font Size ] Applies only Font Size has a numeric value. [ Bug Fix ][ GridColCard (Pro) ] Fixed a bug where vertical alignment settings for card blocks did not apply in the editing screen. From f0b0da4fed5863266758adeff72e5c26fa4f20b0 Mon Sep 17 00:00:00 2001 From: drill-lancer Date: Tue, 12 Mar 2024 14:24:52 +0900 Subject: [PATCH 3/7] fix: readme --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index f6714253a..8533da75f 100644 --- a/readme.txt +++ b/readme.txt @@ -103,7 +103,7 @@ e.g. == Changelog == -[ Specification Change ] core/social-link, core/site-logo, core/site-title and core/site-tagline correspond to custom-css-extension, hidden-extension and margin-extension +[ Specification Change ] core/social-link, core/site-logo, core/site-title and core/site-tagline correspond to margin-extension = 1.69.1 = [ Bug Fix ][ Inline Font Size ] Applies only Font Size has a numeric value. From bbb51b55b0b4ae709bbd77a51dd8cff66c358944 Mon Sep 17 00:00:00 2001 From: kurudrive Date: Wed, 27 Mar 2024 20:46:48 +0900 Subject: [PATCH 4/7] build --- languages/vk-blocks-pro.pot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/languages/vk-blocks-pro.pot b/languages/vk-blocks-pro.pot index 4707b462a..42c334dad 100644 --- a/languages/vk-blocks-pro.pot +++ b/languages/vk-blocks-pro.pot @@ -2,14 +2,14 @@ # This file is distributed under the same license as the VK Blocks Pro plugin. msgid "" msgstr "" -"Project-Id-Version: VK Blocks Pro 1.69.1.2\n" +"Project-Id-Version: VK Blocks Pro 1.70.0.0\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/vk-blocks-pro\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-03-27T11:38:40+00:00\n" +"POT-Creation-Date: 2024-03-27T11:46:22+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.6.0\n" "X-Domain: vk-blocks-pro\n" From 3c3f2d24111c8a117097e6d29e655ac35e786104 Mon Sep 17 00:00:00 2001 From: kurudrive Date: Thu, 28 Mar 2024 12:08:46 +0900 Subject: [PATCH 5/7] lint --- test/phpunit/pro/test-blog-card.php | 46 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/test/phpunit/pro/test-blog-card.php b/test/phpunit/pro/test-blog-card.php index fe9ee9fdd..56fa1d1e8 100644 --- a/test/phpunit/pro/test-blog-card.php +++ b/test/phpunit/pro/test-blog-card.php @@ -51,7 +51,7 @@ public static function wpTearDownAfterClass() { wp_delete_post( self::$attachment_id, true ); } - public function test_vk_blocks_blog_card_render_callback(){ + public function test_vk_blocks_blog_card_render_callback() { print PHP_EOL; print '------------------------------------' . PHP_EOL; @@ -62,8 +62,8 @@ public function test_vk_blocks_blog_card_render_callback(){ $tests = array( // 内部リンク array( - 'content' => ' - + 'content' => ' +
@@ -74,17 +74,17 @@ public function test_vk_blocks_blog_card_render_callback(){ ', 'expected' => ' ', ), // 外部リンク 埋め込み不可 array( - 'content' => ' + 'content' => '
', @@ -100,35 +100,35 @@ public function test_vk_blocks_blog_card_render_callback(){ foreach ( $tests as $test ) { $get_block_wrapper_attributes = get_block_wrapper_attributes(); - $parse_blocks = parse_blocks(sprintf($test['content'], $get_block_wrapper_attributes)); - $render_block_content = render_block( $parse_blocks[1] ); + $parse_blocks = parse_blocks( sprintf( $test['content'], $get_block_wrapper_attributes ) ); + $render_block_content = render_block( $parse_blocks[1] ); if ( is_wp_version_compatible( '6.3' ) ) { $get_block_wrapper_attributes = 'class="wp-block-vk-blocks-blog-card is-layout-flow wp-block-blog-card-is-layout-flow"'; } else { $get_block_wrapper_attributes = 'class="wp-block-vk-blocks-blog-card"'; } - if ( is_array($test['expected']) ) { - $correct = array(); - $correct[1] = sprintf($test['expected']['can_embed'], $get_block_wrapper_attributes); - $correct[2] = sprintf($test['expected']['cannot_embed'], $get_block_wrapper_attributes); + if ( is_array( $test['expected'] ) ) { + $correct = array(); + $correct[1] = sprintf( $test['expected']['can_embed'], $get_block_wrapper_attributes ); + $correct[2] = sprintf( $test['expected']['cannot_embed'], $get_block_wrapper_attributes ); } else { - $correct = sprintf($test['expected'], $get_block_wrapper_attributes); + $correct = sprintf( $test['expected'], $get_block_wrapper_attributes ); } // print PHP_EOL; - print '$render_block_content :'; var_dump($render_block_content); + print '$render_block_content :'; + var_dump( $render_block_content ); // print PHP_EOL; // print PHP_EOL; - print 'correct :'; - var_dump($correct); + print 'correct :'; + var_dump( $correct ); // print PHP_EOL; - if ( is_array($correct) ) { - $this->assertContains($render_block_content, $correct); + if ( is_array( $correct ) ) { + $this->assertContains( $render_block_content, $correct ); } else { $this->assertSame( $correct, $render_block_content ); } - } } -}; +} From 0b5e6fe120e72f963164136709f5d9da3f980075 Mon Sep 17 00:00:00 2001 From: kurudrive Date: Thu, 28 Mar 2024 12:12:15 +0900 Subject: [PATCH 6/7] [ Blog Card ] Fix test --- test/phpunit/pro/test-blog-card.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/phpunit/pro/test-blog-card.php b/test/phpunit/pro/test-blog-card.php index 56fa1d1e8..6c53530b0 100644 --- a/test/phpunit/pro/test-blog-card.php +++ b/test/phpunit/pro/test-blog-card.php @@ -83,12 +83,13 @@ public function test_vk_blocks_blog_card_render_callback() { ', ), // 外部リンク 埋め込み不可 + // 2024.3.28 以前は GitHub のURLでテストしていたが、GitHub は埋め込みができるようになったため、URLを変更 array( 'content' => ' - -
- ', - 'expected' => '
https://github.com/vektor-inc/vk-blocks-pro/blob/master/vk-blocks.php
', + +
+', + 'expected' => '
https://vektor-inc.co.jp/data/photo_ishikawa.jpg
', ), ); From aa79850a1c77689216dbfc2c063772b1a703233f Mon Sep 17 00:00:00 2001 From: kurudrive Date: Thu, 28 Mar 2024 12:20:28 +0900 Subject: [PATCH 7/7] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=AE=E3=81=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/phpunit/pro/test-blog-card.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test/phpunit/pro/test-blog-card.php b/test/phpunit/pro/test-blog-card.php index 6c53530b0..fe1613a07 100644 --- a/test/phpunit/pro/test-blog-card.php +++ b/test/phpunit/pro/test-blog-card.php @@ -100,17 +100,27 @@ public function test_vk_blocks_blog_card_render_callback() { foreach ( $tests as $test ) { + // Get block wrapper attributes ( HTML attributes like as : class="wp-block-vk-blocks-blog-card" ). $get_block_wrapper_attributes = get_block_wrapper_attributes(); - $parse_blocks = parse_blocks( sprintf( $test['content'], $get_block_wrapper_attributes ) ); - $render_block_content = render_block( $parse_blocks[1] ); + // ラッパーア属性を結合したコンテンツ要素 + $block_content = sprintf( $test['content'], $get_block_wrapper_attributes ); + // ブロック情報を配列に変換 + $parse_blocks = parse_blocks( $block_content ); + // Render Blog card block. + $render_block_content = render_block( $parse_blocks[1] ); + if ( is_wp_version_compatible( '6.3' ) ) { $get_block_wrapper_attributes = 'class="wp-block-vk-blocks-blog-card is-layout-flow wp-block-blog-card-is-layout-flow"'; } else { $get_block_wrapper_attributes = 'class="wp-block-vk-blocks-blog-card"'; } + if ( is_array( $test['expected'] ) ) { - $correct = array(); + // Expected が配列の場合 + $correct = array(); + // 埋め込み成功 $correct[1] = sprintf( $test['expected']['can_embed'], $get_block_wrapper_attributes ); + // 埋め込み失敗 $correct[2] = sprintf( $test['expected']['cannot_embed'], $get_block_wrapper_attributes ); } else { $correct = sprintf( $test['expected'], $get_block_wrapper_attributes ); @@ -126,6 +136,7 @@ public function test_vk_blocks_blog_card_render_callback() { // print PHP_EOL; if ( is_array( $correct ) ) { + // 成功 / 失敗 がある場合 $this->assertContains( $render_block_content, $correct ); } else { $this->assertSame( $correct, $render_block_content );