Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b5ff907
Form Builder: Set Email Field type = `email`
n7studios Jan 5, 2026
123e71d
Tests: Merge Uncode Theme Tests
n7studios Jan 5, 2026
91409d4
Merge remote-tracking branch 'origin/fix-uncode-tests' into form-buil…
n7studios Jan 6, 2026
91b2190
Update readme.txt
n7studios Jan 6, 2026
4528d35
Fix formatting; reinstate signup link
n7studios Jan 6, 2026
ab1c7cb
Blocks: Use Spinner for WordPress < 6.3
n7studios Jan 7, 2026
62dbbbf
Add GitHub Actions for WordPress 6.2.8 tests
n7studios Jan 7, 2026
6b1888a
Tests: Add WordPress 6.2.8 SQL dump
n7studios Jan 7, 2026
a76e715
Block refresh: Add standardised `convertkit-block-refreshing` class
n7studios Jan 7, 2026
aa4fe11
Tests: Use aria-label for greater compat. across WordPress versions 6…
n7studios Jan 7, 2026
0177562
Tests: Check if block is refreshing using standardised `convertkit-bl…
n7studios Jan 7, 2026
b708e77
GitHub Action: Include WORDPRESS_DB_SQL_DUMP_FILE
n7studios Jan 7, 2026
3102717
Tests: Improve detection of Add Block button
n7studios Jan 7, 2026
fa42992
JS Coding Standards
n7studios Jan 7, 2026
d7b567f
Tests: Backward Compat: Install all required Plugins
n7studios Jan 7, 2026
86715e7
Tests: Use `seeElementHasClasses` helper method
n7studios Jan 7, 2026
07c452e
Backward compat. tests: Only install required Plugins
n7studios Jan 7, 2026
d2caa9c
Tests: Check against correct element when using seeElementHasClasses …
n7studios Jan 7, 2026
929f7b7
Install older Plugin versions for WordPress 6.2.8 tests
n7studios Jan 7, 2026
48cd91e
Remove Jetpack Boost from backward compat.
n7studios Jan 7, 2026
a0f85ff
Tests: Backward compat: Install paid third party Plugins
n7studios Jan 7, 2026
3f9114a
Fix tests
n7studios Jan 7, 2026
daf5262
Backward compat. tests: Reinstate all test groups
n7studios Jan 7, 2026
480effe
Tests: Helpers: Support newer and older style block name changes e.g.…
n7studios Jan 7, 2026
81a4025
Merge pull request #989 from Kit/fix-progressbar-component
n7studios Jan 8, 2026
1a2648a
Merge pull request #986 from Kit/form-builder-email-field-type
n7studios Jan 8, 2026
4c61bf2
Merge pull request #988 from Kit/update-readme
n7studios Jan 8, 2026
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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ WORDPRESS_ROOT_DIR="/Users/tim/Local Sites/convertkit-github/app/public"
# Local site URL
WORDPRESS_URL=http://kit.local

# Local site DB SQL dump file
WORDPRESS_DB_SQL_DUMP_FILE="tests/Support/Data/dump.sql"

# Kit credentials
CONVERTKIT_OAUTH_ACCESS_TOKEN=
CONVERTKIT_OAUTH_REFRESH_TOKEN=
Expand Down
329 changes: 329 additions & 0 deletions .github/workflows/tests-backward-compat.yml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
DB_USER: root
DB_PASS: root
DB_HOST: localhost
WORDPRESS_DB_SQL_DUMP_FILE: tests/Support/Data/dump.sql # Used to populate the test site database for WordPress 6.2.8
INSTALL_PLUGINS: "admin-menu-editor autoptimize beaver-builder-lite-version block-visibility contact-form-7 classic-editor custom-post-type-ui debloat elementor forminator jetpack-boost mailchimp-for-wp rocket-lazy-load woocommerce wordpress-seo wpforms-lite litespeed-cache wp-crontrol wp-super-cache w3-total-cache wp-fastest-cache wp-optimize sg-cachepress" # Don't include this repository's Plugin here.
INSTALL_PLUGINS_URLS: "https://downloads.wordpress.org/plugin/convertkit-for-woocommerce.1.6.4.zip http://cktestplugins.wpengine.com/wp-content/uploads/2024/01/convertkit-action-filter-tests.zip http://cktestplugins.wpengine.com/wp-content/uploads/2024/11/disable-doing-it-wrong-notices.zip http://cktestplugins.wpengine.com/wp-content/uploads/2025/03/uncode-js_composer.7.8.zip http://cktestplugins.wpengine.com/wp-content/uploads/2025/03/uncode-core.zip" # URLs to specific third party Plugins
INSTALL_THEMES_URLS: "http://cktestplugins.wpengine.com/wp-content/uploads/2025/03/uncode.zip http://cktestplugins.wpengine.com/wp-content/uploads/2025/04/Divi.zip"
Expand Down Expand Up @@ -265,6 +266,7 @@ jobs:
with:
path: ${{ env.PLUGIN_DIR }}/.env.testing
contents: |
WORDPRESS_DB_SQL_DUMP_FILE=${{ env.WORDPRESS_DB_SQL_DUMP_FILE }}
CONVERTKIT_API_KEY=${{ env.CONVERTKIT_API_KEY }}
CONVERTKIT_API_SECRET=${{ env.CONVERTKIT_API_SECRET }}
CONVERTKIT_API_KEY_NO_DATA=${{ env.CONVERTKIT_API_KEY_NO_DATA }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ class ConvertKit_Block_Form_Builder_Field_Email extends ConvertKit_Block_Form_Bu
*/
public $field_id = 'email';

/**
* The type of field to render.
*
* @since 3.1.4
*
* @var string
*/
public $field_type = 'email';

/**
* Whether the field is required.
*
Expand Down
212 changes: 188 additions & 24 deletions readme.txt

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion resources/backend/css/gutenberg.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@
top: 20px;
right: 20px;
line-height: 22px;
width: auto;
}

.wp-block .convertkit-no-content .convertkit-progress-bar {
.wp-block .convertkit-no-content .convertkit-progress-bar,
.wp-block .convertkit-no-content .spinner {
float: none;
margin: 0 auto;
}

Expand Down
11 changes: 10 additions & 1 deletion resources/backend/js/gutenberg.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,18 @@ function convertKitGutenbergRegisterBlock(block) {
* @return {Object} Progress Bar.
*/
const loadingIndicator = function (props) {
// If the ProgressBar component is not available i.e. WordPress < 6.3, return a spinner.
if (typeof ProgressBar === 'undefined') {
return el('span', {
key: props.clientId + '-spinner',
className: 'spinner is-active convertkit-block-refreshing',
});
}

return el(ProgressBar, {
key: props.clientId + '-progress-bar',
className: 'convertkit-progress-bar',
className:
'convertkit-progress-bar convertkit-block-refreshing',
});
};

Expand Down
2 changes: 1 addition & 1 deletion tests/EndToEnd.suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ modules:
download.default_directory: '%WORDPRESS_ROOT_DIR%'
lucatume\WPBrowser\Module\WPDb:
dbUrl: '%WORDPRESS_DB_URL%'
dump: 'tests/Support/Data/dump.sql'
dump: '%WORDPRESS_DB_SQL_DUMP_FILE%'
#import the dump before the tests; this means the test site database will be repopulated before the tests.
populate: true
# re-import the dump between tests; this means the test site database will be repopulated between the tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,18 @@ public function testBroadcastsBlockWithThemeColorParameters(EndToEndTester $I)
$I->seeInSource('<link rel="stylesheet" id="convertkit-broadcasts-css" href="' . $_ENV['WORDPRESS_URL'] . '/wp-content/plugins/convertkit/resources/frontend/css/broadcasts.css');

// Confirm that the chosen colors are applied as CSS styles.
$I->seeInSource('<div class="convertkit-broadcasts wp-block-convertkit-broadcasts has-text-color has-' . $textColor . '-color has-background has-' . $backgroundColor . '-background-color"');
$I->seeElementHasClasses(
$I,
'.convertkit-broadcasts',
[
'convertkit-broadcasts',
'wp-block-convertkit-broadcasts',
'has-text-color',
'has-' . $textColor . '-color',
'has-background',
'has-' . $backgroundColor . '-background-color',
]
);
}

/**
Expand Down Expand Up @@ -835,7 +846,16 @@ public function testBroadcastsBlockWithHexColorParameters(EndToEndTester $I)
$I->seeInSource('<link rel="stylesheet" id="convertkit-broadcasts-css" href="' . $_ENV['WORDPRESS_URL'] . '/wp-content/plugins/convertkit/resources/frontend/css/broadcasts.css');

// Confirm that the chosen colors are applied as CSS styles.
$I->seeInSource('<div class="convertkit-broadcasts wp-block-convertkit-broadcasts has-text-color has-background"');
$I->seeElementHasClasses(
$I,
'.convertkit-broadcasts',
[
'convertkit-broadcasts',
'wp-block-convertkit-broadcasts',
'has-text-color',
'has-background',
]
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1283,10 +1283,10 @@ private function seeFormBuilderField(EndToEndTester $I, $fieldType, $fieldName,
// Check field exists with correct attributes.
switch ( $fieldType ) {
case 'textarea':
$I->seeElementInDOM($container . ' textarea[name="convertkit[' . $fieldName . ']"][id="' . $fieldID . '"]' . $required ? '[required]' : '');
$I->seeElementInDOM($container . ' textarea[name="convertkit[' . $fieldName . ']"][id="' . $fieldID . '"]' . ( $required ? '[required]' : '' ) );
break;
default:
$I->seeElementInDOM($container . ' input[name="convertkit[' . $fieldName . ']"][type="' . $fieldType . '"][id="' . $fieldID . '"]' . $required ? '[required]' : '');
$I->seeElementInDOM($container . ' input[name="convertkit[' . $fieldName . ']"][type="' . $fieldType . '"][id="' . $fieldID . '"]' . ( $required ? '[required]' : '' ) );
}

// Check label exists with correct text.
Expand Down
42 changes: 38 additions & 4 deletions tests/EndToEnd/forms/blocks-shortcodes/PageBlockFormCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,16 @@ public function testFormBlockWithThemeColorParameters(EndToEndTester $I)
$I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID']);

// Confirm that the chosen colors are applied as CSS styles.
$I->seeInSource('<div class="convertkit-form wp-block-convertkit-form has-background" style="background-color:' . $backgroundColor . '"');
$I->seeInSource('style="background-color:' . $backgroundColor . '"');
$I->seeElementHasClasses(
$I,
'.convertkit-form',
[
'convertkit-form',
'wp-block-convertkit-form',
'has-background',
]
);
}

/**
Expand Down Expand Up @@ -1265,7 +1274,16 @@ public function testFormBlockWithHexColorParameters(EndToEndTester $I)
$I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID']);

// Confirm that the chosen colors are applied as CSS styles.
$I->seeInSource('<div class="convertkit-form wp-block-convertkit-form has-background" style="background-color:' . $backgroundColor . '"');
$I->seeInSource('style="background-color:' . $backgroundColor . '"');
$I->seeElementHasClasses(
$I,
'.convertkit-form',
[
'convertkit-form',
'wp-block-convertkit-form',
'has-background',
]
);
}

/**
Expand Down Expand Up @@ -1315,7 +1333,15 @@ public function testFormBlockWithMarginAndPaddingParameters(EndToEndTester $I)
$I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID']);

// Confirm that the chosen margin and padding are applied as CSS styles.
$I->seeInSource('<div class="convertkit-form wp-block-convertkit-form" style="padding-top:var(--wp--preset--spacing--30);margin-top:var(--wp--preset--spacing--30)"');
$I->seeInSource('style="padding-top:var(--wp--preset--spacing--30);margin-top:var(--wp--preset--spacing--30)"');
$I->seeElementHasClasses(
$I,
'.convertkit-form',
[
'convertkit-form',
'wp-block-convertkit-form',
]
);
}

/**
Expand Down Expand Up @@ -1365,7 +1391,15 @@ public function testFormBlockWithAlignmentParameter(EndToEndTester $I)
$I->seeFormOutput($I, $_ENV['CONVERTKIT_API_FORM_ID']);

// Confirm that the chosen alignment is applied as a CSS class.
$I->seeInSource('<div class="convertkit-form alignright wp-block-convertkit-form"');
$I->seeElementHasClasses(
$I,
'.convertkit-form',
[
'convertkit-form',
'wp-block-convertkit-form',
'alignright',
]
);
}

/**
Expand Down
34 changes: 24 additions & 10 deletions tests/EndToEnd/forms/blocks-shortcodes/PageBlockFormTriggerCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,20 @@ public function testFormTriggerBlockWithThemeColorParameters(EndToEndTester $I)
);

// Confirm that the chosen colors are applied as CSS styles.
$I->seeInSource('class="convertkit-formtrigger wp-block-button__link wp-element-button wp-block-convertkit-formtrigger has-text-color has-' . $textColor . '-color has-background has-' . $backgroundColor . '-background-color');
$I->seeElementHasClasses(
$I,
'a.convertkit-formtrigger',
[
'convertkit-formtrigger',
'wp-block-button__link',
'wp-element-button',
'wp-block-convertkit-formtrigger',
'has-text-color',
'has-' . $textColor . '-color',
'has-background',
'has-' . $backgroundColor . '-background-color',
]
);
}

/**
Expand Down Expand Up @@ -352,16 +365,17 @@ public function testFormTriggerBlockWithHexColorParameters(EndToEndTester $I)
$I->checkNoWarningsAndNoticesOnScreen($I);

// Confirm that the chosen colors are applied as CSS styles.
$I->seeInSource('class="convertkit-formtrigger wp-block-button__link wp-element-button wp-block-convertkit-formtrigger has-text-color has-background"');

// Confirm that the block displays.
$I->seeFormTriggerOutput(
$I->seeElementHasClasses(
$I,
formURL: $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_URL'],
text: 'Subscribe',
textColor: $textColor,
backgroundColor: $backgroundColor,
isBlock: true
'a.convertkit-formtrigger',
[
'convertkit-formtrigger',
'wp-block-button__link',
'wp-element-button',
'wp-block-convertkit-formtrigger',
'has-text-color',
'has-background',
]
);
}

Expand Down
15 changes: 14 additions & 1 deletion tests/EndToEnd/products/PageBlockProductCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,20 @@ public function testProductBlockWithThemeColorParameters(EndToEndTester $I)
);

// Confirm that the chosen colors are applied as CSS styles.
$I->seeInSource('class="convertkit-product wp-block-button__link wp-element-button wp-block-convertkit-product has-text-color has-' . $textColor . '-color has-background has-' . $backgroundColor . '-background-color');
$I->seeElementHasClasses(
$I,
'a.convertkit-product',
[
'convertkit-product',
'wp-block-button__link',
'wp-element-button',
'wp-block-convertkit-product',
'has-text-color',
'has-' . $textColor . '-color',
'has-background',
'has-' . $backgroundColor . '-background-color',
]
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ public function _before(EndToEndTester $I)

/**
* Test that restricting content by a Product specified in the Page Settings works when
* creating and viewing a new WordPress Page using the Uncode theme with
* the Visual Composer Page Builder.
* creating and viewing a new WordPress Page using the Uncode theme both using
* the Visual Composer Page Builder and not using it.
*
* @since 2.7.7
*
* @param EndToEndTester $I Tester.
*/
public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(EndToEndTester $I)
public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I)
{
// Activate theme and third party Plugins.
$I->useTheme('uncode');
Expand Down Expand Up @@ -81,28 +81,7 @@ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(End
checkNoWarningsAndNotices: false
);

// Deactivate theme and third party Plugins.
$I->deactivateThirdPartyPlugin($I, 'uncode-wpbakery-page-builder');
$I->deactivateThirdPartyPlugin($I, 'uncode-core');
$I->useTheme('twentytwentyfive');
}

/**
* Test that restricting content by a Product specified in the Page Settings works when
* creating and viewing a new WordPress Page using the Uncode theme without
* the Visual Composer Page Builder.
*
* @since 2.7.7
*
* @param EndToEndTester $I Tester.
*/
public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I)
{
// Activate theme and third party Plugins.
$I->useTheme('uncode');
$I->activateThirdPartyPlugin($I, 'uncode-core');

// Programmatically create a Page using the Visual Composer Page Builder.
// Programmatically create a Page without using the Visual Composer Page Builder.
$pageID = $I->havePostInDatabase(
[
'post_type' => 'page',
Expand Down Expand Up @@ -134,10 +113,6 @@ public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I)
// Don't check for warnings and notices, as Uncode uses deprecated functions which WordPress 6.9 warn about.
checkNoWarningsAndNotices: false
);

// Deactivate theme and third party Plugins.
$I->deactivateThirdPartyPlugin($I, 'uncode-core');
$I->useTheme('twentytwentyfive');
}

/**
Expand Down
Loading