PluginProbe
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards / 5.5.84
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards v5.5.84
5.5.84 5.5.83 5.5.82 5.5.81 5.5.80 5.5.79 5.5.77 5.5.76 5.5.75 5.5.73 5.5.72 5.5.22 5.5.23 5.5.29 5.5.3 5.5.31 5.5.32 5.5.34 5.5.35 5.5.36 5.5.37 5.5.4 5.5.40 5.5.41 5.5.42 All 160 releases
← All changes | WPDataAccess/API/WPDA_Settings.php +14 -3 5.5.725.5.84 View file →
@@ -172,13 +172,15 @@
172 172 return $this->WPDA_Rest_Response( __( 'Changes successfully saved', 'wp-data-access' ) );
173 173 } else {
174 174 if ( '' === $wpdb->last_error ) {
175 175 return new \WP_Error(
176 + /* translators: %s = last dbs error */
176 177 sprintf( __( 'Failed to save changes [%s]', 'wp-data-access' ), $wpdb->last_error ),
177 178 array( 'status' => 420 )
178 179 );
179 180 } else {
180 181 return new \WP_Error(
182 + /* translators: %s = last dbs error */
181 183 sprintf( __( 'Failed to save changes [%s]', 'wp-data-access' ), $wpdb->last_error ),
182 184 array( 'status' => 420 )
183 185 );
184 186 }
@@ -225,8 +227,9 @@
225 227 ) {
226 228 return $this->WPDA_Rest_Response( __( 'Changes successfully saved', 'wp-data-access' ) );
227 229 } else {
228 230 return new \WP_Error(
231 + /* translators: %s = last dbs error */
229 232 sprintf( __( 'Failed to save changes [%s]', 'wp-data-access' ), $wpdb->last_error ),
230 233 array( 'status' => 420 )
231 234 );
232 235 }
@@ -234,8 +237,9 @@
234 237 if ( WPDA_Table_Settings_Model::insert( $table_name, json_encode( $settings ), $schema_name ) ) {
235 238 return $this->WPDA_Rest_Response( __( 'Changes successfully saved', 'wp-data-access' ) );
236 239 } else {
237 240 return new \WP_Error(
241 + /* translators: %s = last dbs error */
238 242 sprintf( __( 'Failed to save changes [%s]', 'wp-data-access' ), $wpdb->last_error ),
239 243 array( 'status' => 420 )
240 244 );
241 245 }
@@ -296,12 +300,15 @@
296 300 $sql_dml = $settings_unused['sql_dml'];
297 301 }
298 302 unset( $settings['unused'] );
299 303 }
304 + WPDA::wpda_log_wp_error($settings);
305 + WPDA::wpda_log_wp_error($settings_unused);
300 306
301 307 if ( null === $sql_dml ) {
302 308 return new \WP_Error(
303 309 sprintf(
310 + /* translators: %s = contact message */
304 311 __( 'Failed to save changes [%s]', 'wp-data-access' ),
305 312 'please contact the plugin development team'
306 313 ),
307 314 array( 'status' => 420 )
@@ -340,8 +347,9 @@
340 347 global $wpdb;
341 348 $msg = '' !== $wpdb->last_error ? " [{$wpdb->last_error}]" : '';
342 349
343 350 return new \WP_Error(
351 + /* translators: %s = error message */
344 352 sprintf( __( 'Failed to save changes [%s]', 'wp-data-access' ), $msg ),
345 353 array( 'status' => 420 )
346 354 );
347 355 }
@@ -427,8 +435,9 @@
427 435 }
428 436
429 437 if ( $dml_succeeded >= 0 && $dml_failed === 0 ) {
430 438 return $this->WPDA_Rest_Response(
439 + /* translators: %s = table name */
431 440 sprintf( __( 'Saved dashboard menus for table `%s`', 'wp-data-access' ), $table_name ),
432 441 $new_menus
433 442 );
434 443 } else {
@@ -435,9 +444,10 @@
435 444 global $wpdb;
436 445 $msg = '' !== $wpdb->last_error ? " [{$wpdb->last_error}]" : '';
437 446
438 447 return new \WP_Error(
439 - sprintf( __( 'Cannot save dashboard menus for table `%s`%s', 'wp-data-access' ), $table_name, $msg ),
448 + /* translators: 1: table name; 2: error message */
449 + sprintf( __( 'Cannot save dashboard menus for table `%1$s`%2$s', 'wp-data-access' ), $table_name, $msg ),
440 450 array( 'status' => 420 )
441 451 );
442 452 }
443 453 }
@@ -488,14 +498,14 @@
488 498 if ( isset( $settings['select'] ) ) {
489 499 unset( $rest_api_settings[ $schema_name ][ $table_name ]['select'] );
490 500 if (
491 501 isset( $rest_api_settings[ $schema_name ][ $table_name ] ) &&
492 - 0 === count( $rest_api_settings[ $schema_name ][ $table_name ] )//phpcs:ignore - 8.1 proof
502 + 0 === count( $rest_api_settings[ $schema_name ][ $table_name ] ) // phpcs:ignore -- 8.1 proof
493 503 ) {
494 504 unset( $rest_api_settings[ $schema_name ][ $table_name ] );
495 505 if (
496 506 isset( $rest_api_settings[ $schema_name ] ) &&
497 - 0 === count( $rest_api_settings[ $schema_name ] )//phpcs:ignore - 8.1 proof
507 + 0 === count( $rest_api_settings[ $schema_name ] ) // phpcs:ignore -- 8.1 proof
498 508 ) {
499 509 unset( $rest_api_settings[ $schema_name ] );
500 510 }
501 511 }
@@ -508,8 +518,9 @@
508 518
509 519 update_option( WPDA_API::WPDA_REST_API_TABLE_ACCESS, $rest_api_settings );
510 520
511 521 return $this->WPDA_Rest_Response(
522 + /* translators: %s = table name */
512 523 sprintf( __( 'Saved REST API settings for table `%s`', 'wp-data-access' ), $table_name )
513 524 );
514 525 }
515 526