| @@ -153,9 +153,9 @@ | ||
| 153 | 153 | if ( function_exists( 'dbDelta' ) ) { |
| 154 | 154 | dbDelta( $q . $charset_collate . ';' ); |
| 155 | 155 | } else { |
| 156 | 156 | global $wpdb; |
| 157 | - $wpdb->query( $q . $charset_collate ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 157 | + $wpdb->query( $q . $charset_collate ); // WPCS: unprepared SQL ok. | |
| 158 | 158 | } |
| 159 | 159 | unset( $q ); |
| 160 | 160 | } |
| 161 | 161 | } |
| @@ -172,21 +172,21 @@ | ||
| 172 | 172 | * |
| 173 | 173 | * @since 3.06 |
| 174 | 174 | */ |
| 175 | 175 | private function add_default_template() { |
| 176 | - if ( FrmXMLHelper::check_if_libxml_disable_entity_loader_exists() ) { | |
| 176 | + if ( ! function_exists( 'libxml_disable_entity_loader' ) ) { | |
| 177 | 177 | // XML import is not enabled on your server. |
| 178 | 178 | return; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | $set_err = libxml_use_internal_errors( true ); |
| 182 | - $loader = FrmXMLHelper::maybe_libxml_disable_entity_loader( true ); | |
| 182 | + $loader = libxml_disable_entity_loader( true ); | |
| 183 | 183 | |
| 184 | 184 | $file = FrmAppHelper::plugin_path() . '/classes/views/xml/default-templates.xml'; |
| 185 | 185 | FrmXMLHelper::import_xml( $file ); |
| 186 | 186 | |
| 187 | 187 | libxml_use_internal_errors( $set_err ); |
| 188 | - FrmXMLHelper::maybe_libxml_disable_entity_loader( $loader ); | |
| 188 | + libxml_disable_entity_loader( $loader ); | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
| 192 | 192 | * @param int|string $old_db_version |
| @@ -204,9 +204,9 @@ | ||
| 204 | 204 | // bail if we don't know the previous version |
| 205 | 205 | return; |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - $migrations = array( 16, 11, 16, 17, 23, 25, 86, 90, 97, 98 ); | |
| 208 | + $migrations = array( 16, 11, 16, 17, 23, 25, 86, 90, 97 ); | |
| 209 | 209 | foreach ( $migrations as $migration ) { |
| 210 | 210 | if ( FrmAppHelper::$db_version >= $migration && $old_db_version < $migration ) { |
| 211 | 211 | $function_name = 'migrate_to_' . $migration; |
| 212 | 212 | $this->$function_name(); |
| @@ -221,12 +221,12 @@ | ||
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | global $wpdb, $wp_roles; |
| 224 | 224 | |
| 225 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $this->fields ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 226 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $this->forms ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 227 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $this->entries ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 228 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $this->entry_metas ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 225 | + $wpdb->query( 'DROP TABLE IF EXISTS ' . $this->fields ); // WPCS: unprepared SQL ok. | |
| 226 | + $wpdb->query( 'DROP TABLE IF EXISTS ' . $this->forms ); // WPCS: unprepared SQL ok. | |
| 227 | + $wpdb->query( 'DROP TABLE IF EXISTS ' . $this->entries ); // WPCS: unprepared SQL ok. | |
| 228 | + $wpdb->query( 'DROP TABLE IF EXISTS ' . $this->entry_metas ); // WPCS: unprepared SQL ok. | |
| 229 | 229 | |
| 230 | 230 | delete_option( 'frm_options' ); |
| 231 | 231 | delete_option( 'frm_db_version' ); |
| 232 | 232 | delete_option( 'frm_install_running' ); |
| @@ -233,9 +233,8 @@ | ||
| 233 | 233 | delete_option( 'frm_lite_settings_upgrade' ); |
| 234 | 234 | delete_option( 'frm-usage-uuid' ); |
| 235 | 235 | delete_option( 'frm_inbox' ); |
| 236 | 236 | delete_option( 'frmpro_css' ); |
| 237 | - delete_option( 'frm_welcome_redirect' ); | |
| 238 | 237 | |
| 239 | 238 | // Delete roles. |
| 240 | 239 | $frm_roles = FrmAppHelper::frm_capabilities(); |
| 241 | 240 | $roles = get_editable_roles(); |
| @@ -264,9 +263,8 @@ | ||
| 264 | 263 | // delete transients |
| 265 | 264 | delete_transient( 'frmpro_css' ); |
| 266 | 265 | delete_transient( 'frm_options' ); |
| 267 | 266 | delete_transient( 'frmpro_options' ); |
| 268 | - delete_transient( 'frm_activation_redirect' ); | |
| 269 | 267 | |
| 270 | 268 | $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE %s OR option_name LIKE %s', '_transient_timeout_frm_form_fields_%', '_transient_frm_form_fields_%' ) ); |
| 271 | 269 | |
| 272 | 270 | do_action( 'frm_after_uninstall' ); |
| @@ -274,17 +272,8 @@ | ||
| 274 | 272 | return true; |
| 275 | 273 | } |
| 276 | 274 | |
| 277 | 275 | /** |
| 278 | - * Clear frmpro_css transient. | |
| 279 | - * | |
| 280 | - * @since 4.10.02 | |
| 281 | - */ | |
| 282 | - private function migrate_to_98() { | |
| 283 | - delete_transient( 'frmpro_css' ); | |
| 284 | - } | |
| 285 | - | |
| 286 | - /** | |
| 287 | 276 | * Move default_blank and clear_on_focus to placeholder. |
| 288 | 277 | * |
| 289 | 278 | * @since 4.0 |
| 290 | 279 | */ |
| @@ -461,11 +450,11 @@ | ||
| 461 | 450 | * @since 2.0.2 |
| 462 | 451 | */ |
| 463 | 452 | private function migrate_to_23() { |
| 464 | 453 | global $wpdb; |
| 465 | - $exists = $wpdb->get_row( 'SHOW COLUMNS FROM ' . $this->forms . ' LIKE "parent_form_id"' ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 454 | + $exists = $wpdb->get_row( 'SHOW COLUMNS FROM ' . $this->forms . ' LIKE "parent_form_id"' ); // WPCS: unprepared SQL ok. | |
| 466 | 455 | if ( empty( $exists ) ) { |
| 467 | - $wpdb->query( 'ALTER TABLE ' . $this->forms . ' ADD parent_form_id int(11) default 0' ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 456 | + $wpdb->query( 'ALTER TABLE ' . $this->forms . ' ADD parent_form_id int(11) default 0' ); // WPCS: unprepared SQL ok. | |
| 468 | 457 | } |
| 469 | 458 | } |
| 470 | 459 | |
| 471 | 460 | /** |