Skip to content

Commit 4b6162b

Browse files
author
Orzo Cogorzo
authored
Merge pull request #3 from codeccoop/fix/http-setting-register
Fix http setting register adn skip heartbeat migrations
2 parents 419fd90 + be628a0 commit 4b6162b

File tree

7 files changed

+64
-3
lines changed

7 files changed

+64
-3
lines changed

forms-bridge/deps/http

Submodule http updated from bdd6e14 to 7146612

forms-bridge/includes/class-forms-bridge.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,11 @@ private static function notify_error(
587587
* Apply db migrations on plugin upgrades.
588588
*/
589589
private static function do_migrations() {
590+
$action = sanitize_text_field( wp_unslash( $_POST['action'] ?? '' ) );
591+
if ( 'heartbeat' === $action && wp_doing_ajax() ) {
592+
return;
593+
}
594+
590595
$from = get_option( self::DB_VERSION, self::version() );
591596

592597
if ( ! preg_match( '/^\d+\.\d+\.\d+$/', $from ) ) {

forms-bridge/migrations/3.0.0.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
<?php
2+
/**
3+
* Database migration to version 3.0.0
4+
*
5+
* @package formsbridge
6+
*/
7+
8+
// phpcs:disable WordPress.Files.FileName
29

310
if ( ! defined( 'ABSPATH' ) ) {
411
exit();
512
}
613

14+
/**
15+
* Migration 3.0.0
16+
*/
717
function forms_bridge_migration_300() {
818
$setting_names = array( 'rest-api', 'odoo', 'financoop', 'google-sheets' );
919

forms-bridge/migrations/3.0.4.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
<?php
2+
/**
3+
* Database migration to version 3.0.4
4+
*
5+
* @package formsbridge
6+
*/
7+
8+
// phpcs:disable WordPress.Files.FileName
29

310
if ( ! defined( 'ABSPATH' ) ) {
411
exit();
512
}
613

14+
/**
15+
* Migration 3.0.4
16+
*/
717
function forms_bridge_migration_304() {
818
$setting_names = array( 'rest-api', 'odoo', 'financoop', 'google-sheets' );
919

forms-bridge/migrations/3.1.0.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
<?php
2+
/**
3+
* Database migration to version 3.1.0
4+
*
5+
* @package formsbridge
6+
*/
7+
8+
// phpcs:disable WordPress.Files.FileName
29

310
if ( ! defined( 'ABSPATH' ) ) {
411
exit();
512
}
613

14+
/**
15+
* Migration 3.1.0
16+
*/
717
function forms_bridge_migration_310() {
818
$setting_names = array(
919
'rest-api',

forms-bridge/migrations/4.0.0.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
<?php
2+
/**
3+
* Database migration to version 4.0.0
4+
*
5+
* @package formsbridge
6+
*/
7+
8+
// phpcs:disable WordPress.Files.FileName
29

310
use FORMS_BRIDGE\Addon;
411

512
if ( ! defined( 'ABSPATH' ) ) {
613
exit();
714
}
815

16+
/**
17+
* Migration 4.0.0
18+
*/
919
function forms_bridge_migration_400() {
1020
$setting_names = array(
1121
'bigin',
@@ -245,7 +255,7 @@ function forms_bridge_migration_400() {
245255
}
246256

247257
$registry = get_option( 'forms_bridge_addons' );
248-
if ( $registry && is_array( $registry ) ) {
258+
if ( isset( $registry['rest-api'] ) ) {
249259
$registry['rest'] = $registry['rest-api'];
250260
unset( $registry['rest-api'] );
251261
update_option( 'forms_bridge_addons', $registry );

forms-bridge/migrations/4.0.7.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
11
<?php
2+
/**
3+
* Database migration to version 4.0.7
4+
*
5+
* @package formsbridge
6+
*/
7+
8+
// phpcs:disable WordPress.Files.FileName
29

310
if ( ! defined( 'ABSPATH' ) ) {
411
exit();
512
}
613

14+
/**
15+
* Migration 4.0.7
16+
*/
717
function forms_bridge_migration_407() {
818
$http = get_option( 'http-bridge_general', array() ) ?: array(
919
'backends' => array(),
1020
'credentials' => array(),
1121
);
1222

13-
update_option( 'forms-bridge_http', $http );
23+
$result = update_option( 'forms-bridge_http', $http );
24+
25+
if ( $result ) {
26+
delete_option( 'http-bridge_general' );
27+
}
1428
}
29+
30+
forms_bridge_migration_407();

0 commit comments

Comments
 (0)