Skip to content

Commit e5dc093

Browse files
authored
Merge pull request #2893 from Strategy11/new_sniff_to_enforce_bool_for_wp_update_option_autoload_function
New sniff to avoid deprecated "no"/"yes" autoload parameters when cal…
2 parents 0b6dcbd + 15598ce commit e5dc093

19 files changed

+206
-29
lines changed

classes/controllers/FrmAddonsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@ public static function connect_link() {
12931293

12941294
if ( ! $auth ) {
12951295
$auth = hash( 'sha512', wp_rand() );
1296-
update_option( 'frm_connect_token', $auth, 'no' );
1296+
update_option( 'frm_connect_token', $auth, false );
12971297
}
12981298

12991299
$page = FrmAppHelper::simple_get( 'page', 'sanitize_title', 'formidable-settings' );

classes/controllers/FrmAppController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ public static function api_install() {
11991199
$running = get_option( 'frm_install_running' );
12001200

12011201
if ( false === $running || $running < strtotime( '-5 minutes' ) ) {
1202-
update_option( 'frm_install_running', time(), 'no' );
1202+
update_option( 'frm_install_running', time(), false );
12031203
self::install();
12041204
delete_option( 'frm_install_running' );
12051205
}

classes/controllers/FrmDashboardController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ private static function get_dashboard_options( $option_name = null ) {
541541
private static function update_dashboard_options( $data, $option_name ) {
542542
$options = self::get_dashboard_options();
543543
$options[ $option_name ] = $data;
544-
update_option( self::OPTION_META_NAME, $options, 'no' );
544+
update_option( self::OPTION_META_NAME, $options, false );
545545
}
546546

547547
/**

classes/controllers/FrmOnboardingWizardController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ public static function has_onboarding_been_skipped() {
455455
* @return void
456456
*/
457457
public static function mark_onboarding_as_skipped() {
458-
update_option( self::ONBOARDING_SKIPPED_OPTION, true, 'no' );
458+
update_option( self::ONBOARDING_SKIPPED_OPTION, true, false );
459459
}
460460

461461
/**
@@ -507,7 +507,7 @@ private static function has_already_redirected() {
507507
return true;
508508
}
509509

510-
update_option( self::REDIRECT_STATUS_OPTION, FrmAppHelper::plugin_version(), 'no' );
510+
update_option( self::REDIRECT_STATUS_OPTION, FrmAppHelper::plugin_version(), false );
511511
return false;
512512
}
513513

classes/controllers/FrmOverlayController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private function get_options_data() {
131131
* @return void
132132
*/
133133
private function update_options_data() {
134-
update_option( $this->option_meta_name, $this->options_data, 'no' );
134+
update_option( $this->option_meta_name, $this->options_data, false );
135135
}
136136

137137
/**

classes/controllers/FrmSettingsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ public static function settings_cta_dismiss() {
471471
check_ajax_referer( 'frm_ajax', 'nonce' );
472472
FrmAppHelper::permission_check( 'frm_change_settings' );
473473

474-
update_option( 'frm_lite_settings_upgrade', time(), 'no' );
474+
update_option( 'frm_lite_settings_upgrade', time(), false );
475475

476476
wp_send_json_success();
477477
}

classes/helpers/FrmAppHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4882,7 +4882,7 @@ public static function dismiss_warning_message( $option = '' ) {
48824882
check_ajax_referer( 'frm_ajax', 'nonce' );
48834883

48844884
if ( $option ) {
4885-
update_option( $option, true, 'no' );
4885+
update_option( $option, true, false );
48864886
}
48874887

48884888
wp_send_json_success();

classes/helpers/FrmFormMigratorsHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public static function dismiss_migrator() {
190190
}
191191

192192
$dismissed[] = FrmAppHelper::get_param( 'plugin', '', 'post', 'sanitize_text_field' );
193-
update_option( 'frm_dismissed', array_filter( $dismissed ), 'no' );
193+
update_option( 'frm_dismissed', array_filter( $dismissed ), false );
194194
wp_die();
195195
}
196196
}

classes/models/FrmFormState.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ private static function get_encryption_secret() {
260260

261261
// We don't have a secret, so let's generate one.
262262
$secret_key = is_callable( 'sodium_crypto_secretbox_keygen' ) ? sodium_crypto_secretbox_keygen() : wp_generate_password( 32, true, true );
263-
update_option( 'frm_form_state_key', base64_encode( $secret_key ), 'no' ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
263+
update_option( 'frm_form_state_key', base64_encode( $secret_key ), false ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
264264

265265
return $secret_key;
266266
}

classes/models/FrmFormTemplateApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function skip_categories() {
7979
* @return void
8080
*/
8181
public static function set_free_license_code( $code ) {
82-
update_option( self::$code_option_name, $code, 'no' );
82+
update_option( self::$code_option_name, $code, false );
8383
}
8484

8585
/**

0 commit comments

Comments
 (0)