| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php /** |
| 2 | 2 | * @version 1.0 |
| 3 | 3 | * @package Booking Calendar |
| 4 | 4 | * @category Support functions for Settings page |
| @@ -81,10 +81,13 @@ | ||
| 81 | 81 | if ( ( isset( $_GET['reset'] ) ) && ( 'custom_forms' == $_GET['reset'] ) ) { // FixIn: 8.1.3.21. |
| 82 | 82 | |
| 83 | 83 | wpbc_open_meta_box_section( 'wpbc_general_settings_system_info', 'System Info' ); |
| 84 | 84 | |
| 85 | - // Reset Custom Booking Forms to NONE | |
| 86 | - update_bk_option( 'booking_forms_extended', serialize( array() ) ); | |
| 85 | + global $wpdb; | |
| 86 | + if ( function_exists( 'wpbc_is_table_exists' ) && wpbc_is_table_exists( 'booking_form_structures' ) ) { | |
| 87 | + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared | |
| 88 | + $wpdb->query( "DELETE FROM {$wpdb->prefix}booking_form_structures WHERE form_slug <> 'standard'" ); | |
| 89 | + } | |
| 87 | 90 | |
| 88 | 91 | wpbc_show_message_in_settings( '<strong>Custom forms</strong> has been reseted!', 'info' ); |
| 89 | 92 | |
| 90 | 93 | wpbc_close_meta_box_section(); |
| @@ -213,14 +216,14 @@ | ||
| 213 | 216 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing |
| 214 | 217 | if ( ( isset( $_GET['restore_dismissed'] ) ) && ( $_GET['restore_dismissed'] == 'On' ) ) { // FixIn: 8.1.3.10. |
| 215 | 218 | |
| 216 | 219 | update_bk_option( 'booking_is_show_powered_by_notice', 'On' ); |
| 217 | - | |
| 218 | 220 | update_bk_option( 'booking_wpdev_copyright_adminpanel', 'On' ); |
| 221 | + update_bk_option( 'booking_menu_go_pro', 'show' ); | |
| 219 | 222 | |
| 220 | 223 | global $wpdb; |
| 221 | 224 | |
| 222 | - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared | |
| 225 | + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter | |
| 223 | 226 | if ( false === $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE '%booking_win_%'" ) ) { // Delete all users booking windows states. |
| 224 | 227 | debuge_error( 'Error during deleting user meta at DB', __FILE__, __LINE__ ); |
| 225 | 228 | die(); |
| 226 | 229 | } else { |
| @@ -249,9 +252,9 @@ | ||
| 249 | 252 | global $wpdb, $wp_version; |
| 250 | 253 | |
| 251 | 254 | $all_plugins = get_plugins(); |
| 252 | 255 | $active_plugins = get_option( 'active_plugins' ); |
| 253 | - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared | |
| 256 | + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter | |
| 254 | 257 | $mysql_info = $wpdb->get_results( "SHOW VARIABLES LIKE 'sql_mode'" ); |
| 255 | 258 | |
| 256 | 259 | if ( is_array( $mysql_info ) ) $sql_mode = $mysql_info[0]->Value; |
| 257 | 260 | if ( empty( $sql_mode ) ) $sql_mode = 'Not set'; |
| @@ -283,9 +286,9 @@ | ||
| 283 | 286 | |
| 284 | 287 | $ver_small_name = wpbc_get_plugin_version_type(); |
| 285 | 288 | if ( class_exists( 'wpdev_bk_multiuser' ) ) $ver_small_name = 'multiuser'; |
| 286 | 289 | |
| 287 | - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared | |
| 290 | + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter | |
| 288 | 291 | $mysql_version = $wpdb->get_var( 'SELECT VERSION() AS version' ); |
| 289 | 292 | |
| 290 | 293 | $system_info['system_info'] = array( |
| 291 | 294 | 'Plugin Update' => ( defined( 'WPDEV_BK_VERSION' ) ) ? WPDEV_BK_VERSION : 'N/A', |