Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/php.lint.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
run: |
rm tests/_envs/.env
mv tests/_envs/.env.testing tests/_envs/.env
touch tests/_envs/.env.local

- name: Run PHP tests
run: composer test:wpunit
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@ AGENTS.md
.env.e2e
.env.e2e.example
bootstrap-project.js

# Local test environment overrides
tests/_envs/.env.local

# Codeception runtime artifacts
tests/_output/*
!tests/_output/.gitignore
tests/_support/_generated/
2 changes: 1 addition & 1 deletion assets/build/admin/package.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-i18n'), 'version' => '94ba9a9d32ea506460c6');
<?php return array('dependencies' => array('wp-i18n'), 'version' => 'cd879d1903e305e67f49');
2 changes: 1 addition & 1 deletion assets/build/admin/package.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/build/editor/form.builder.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins'), 'version' => '998222f5df4e19e7fc3d');
<?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins'), 'version' => 'f2898b123edbefeeaef4');
2 changes: 1 addition & 1 deletion assets/build/editor/form.builder.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/build/editor/package.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '0aefae306822008fa4a6');
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '84dd167a2e5aa9a15f3b');
2 changes: 1 addition & 1 deletion assets/build/editor/package.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/build/frontend/main.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-i18n'), 'version' => '153ab9d38663373cb700');
<?php return array('dependencies' => array('wp-i18n'), 'version' => 'b6ad40658d81b14a771d');
2 changes: 1 addition & 1 deletion assets/build/frontend/main.js

Large diffs are not rendered by default.

27 changes: 26 additions & 1 deletion assets/src/frontend/main/submit/AjaxSubmit.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ function AjaxSubmit( form ) {

this.lastResponse = response;
const $form = jQuery( rootNode );
const csrfToken = response?._jfb_csrf_token;

if ( csrfToken ) {
this.refreshCsrfToken( csrfToken );
}

switch ( response.status ) {
case 'success':
Expand Down Expand Up @@ -129,6 +134,26 @@ function AjaxSubmit( form ) {

rootNode.appendChild( node );
};
this.refreshCsrfToken = function ( csrfToken ) {
const formId = this.form.getFormId();
const forms = document.querySelectorAll(
'form.jet-form-builder[data-form-id]',
);

for ( const formNode of forms ) {
if ( +formNode.dataset.formId !== formId ) {
continue;
}

const csrfFields = formNode.querySelectorAll(
'input[name="_jfb_csrf_token"]',
);

for ( const field of csrfFields ) {
field.value = csrfToken;
}
}
};
}

AjaxSubmit.prototype = Object.create( BaseSubmit.prototype );
Expand Down Expand Up @@ -167,4 +192,4 @@ AjaxSubmit.prototype.watchFail = function ( callable ) {
} );
};

export default AjaxSubmit;
export default AjaxSubmit;
3 changes: 1 addition & 2 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ extensions:
- Codeception\Command\GenerateWPCanonical
- Codeception\Command\GenerateWPXMLRPC
params:
- tests/_envs/.env.local
- tests/_envs/.env
settings:
colors: true
Expand Down Expand Up @@ -80,5 +81,3 @@ modules:
mu-plugins: '/wp-content/mu-plugins'
themes: '/wp-content/themes'
uploads: '/wp-content/uploads'


2 changes: 1 addition & 1 deletion compatibility/bricks/assets/build/frontend.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => 'cf7d02a4042a42f5c32e');
<?php return array('dependencies' => array(), 'version' => '223249f02ffb577062b5');
2 changes: 1 addition & 1 deletion compatibility/bricks/assets/build/frontend.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '0c021d3fb5d78e7cd81c');
<?php return array('dependencies' => array(), 'version' => 'bad44884ebe52d8c8260');
2 changes: 1 addition & 1 deletion compatibility/jet-appointment/assets/build/frontend.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion compatibility/jet-booking/assets/build/frontend.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '575a25df8a77e253481c');
<?php return array('dependencies' => array(), 'version' => '812ce05eafd67481989c');
2 changes: 1 addition & 1 deletion compatibility/jet-booking/assets/build/frontend.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading