PluginProbe
WDesignKit – AI Templates, Widget Builder & MCP Workflow / 2.7.0
WDesignKit – AI Templates, Widget Builder & MCP Workflow v2.7.0
2.7.0 2.6.6 2.6.5 2.6.4 2.6.3 2.6.2 2.6.1 2.6.0 2.5.5 2.5.4 2.5.3 2.5.2 2.5.1 2.5.0 2.4.0 2.3.3 2.3.2 2.3.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 All 129 releases
← All changes | includes/admin/api/class-wdkit-code-snippet.php +10 -3 2.3.2 → 2.7.0 View file →
@@ -667,8 +667,15 @@
667 667 }
668 668
669 669 $snippet = $json['snippets'][0];
670 670
671 + // Decode HTML entities in the snippet name so imported titles show
672 + // "&" instead of the raw entity "&". The cloud content stores the
673 + // name HTML-encoded, and Nexter's file-based import uses it as-is.
674 + if ( isset( $snippet['name'] ) ) {
675 + $snippet['name'] = html_entity_decode( (string) $snippet['name'], ENT_QUOTES, 'UTF-8' );
676 + }
677 +
671 678 if ( empty( $snippet['post_type'] ) || 'nxt-code-snippet' !== $snippet['post_type'] ) {
672 679 $data = array(
673 680 'success' => false,
674 681 'data' => array(
@@ -719,9 +726,9 @@
719 726 } else {
720 727 // Fallback to old post-based method if file-based failed.
721 728 $post_id = wp_insert_post(
722 729 array(
723 - 'post_title' => sanitize_text_field( html_entity_decode( wp_unslash( $snippet['name'] ) ) ),
730 + 'post_title' => sanitize_text_field( $snippet['name'] ),
724 731 'post_type' => 'nxt-code-snippet',
725 732 'post_status' => 'publish',
726 733 )
727 734 );
@@ -838,9 +845,9 @@
838 845 if ( is_wp_error( $response ) ) {
839 846 $error_message = $response->get_error_message();
840 847
841 848 /* Translators: %s is a placeholder for the error message */
842 - $error_message = printf( esc_html__( 'API request error: %s', 'wdesignkit' ), esc_html( $error_message ) );
849 + $error_message = sprintf( esc_html__( 'API request error: %s', 'wdesignkit' ), esc_html( $error_message ) );
843 850
844 851 return array(
845 852 'massage' => $error_message,
846 853 'success' => false,
@@ -851,9 +858,9 @@
851 858 if ( 200 === $status_code ) {
852 859 return json_decode( wp_remote_retrieve_body( $response ), true );
853 860 }
854 861
855 - $error_message = printf( 'Server error: %d', esc_html( $status_code ) );
862 + $error_message = sprintf( 'Server error: %d', esc_html( $status_code ) );
856 863
857 864 if ( isset( $error_data->message ) ) {
858 865 $error_message .= ' (' . $error_data->message . ')';
859 866 }