Skip to content

Commit

Permalink
Merge branch 'release/2.28.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
JiveDig committed May 5, 2023
2 parents 5f5b80d + 1399279 commit 434e042
Show file tree
Hide file tree
Showing 133 changed files with 15,177 additions and 13,828 deletions.
6 changes: 5 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Changelog

## 2.28.0 (5/5/23)
* Changed: Update ACF to 6.1.6.
* Fixed: More thorough handling of markup processing to make sure valid markup is returned.

## 2.27.2 (5/2/23)
* Fixed: Remove beta label from plugin version.

## 2.27.1 (5/2/23)
* Fixed: The sizes attribute is only added to preload links if a srcset value is present. This prevents invalid markup.
* Changed: Update ACF to 6.1.5.
* Fixed: The sizes attribute is only added to preload links if a srcset value is present. This prevents invalid markup.

## 2.27.0 (4/13/23)
* Added: PHP 8.1 compatibility.
Expand Down
2 changes: 1 addition & 1 deletion lib/blocks/button.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function mai_render_button_block( $block_content, $block ) {
}
}

$block_content = $dom->saveHTML( $dom->documentElement );
$block_content = $dom->saveHTML();
}

return $block_content;
Expand Down
2 changes: 1 addition & 1 deletion lib/blocks/cover.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function mai_render_cover_block( $block_content, $block ) {
$first_block->removeAttribute( 'style' );
}

$block_content = $dom->saveHTML( $dom->documentElement );
$block_content = $dom->saveHTML();
}

return $block_content;
Expand Down
2 changes: 1 addition & 1 deletion lib/blocks/group.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function mai_render_group_block( $block_content, $block ) {
$classes = mai_add_classes( sprintf( 'has-%s-background', $light_or_dark ), $classes );
$first_block->setAttribute( 'class', $classes );

$block_content = $dom->saveHTML( $dom->documentElement );
$block_content = $dom->saveHTML();
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/blocks/heading.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function mai_render_heading_block( $block_content, $block ) {
$classes = mai_add_classes( sprintf( 'has-no-margin-%s', $side ), $classes );
$first_block->setAttribute( 'class', $classes );

$block_content = $dom->saveHTML( $dom->documentElement );
$block_content = $dom->saveHTML();
}

return $block_content;
Expand Down
2 changes: 1 addition & 1 deletion lib/blocks/paragraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function mai_render_paragraph_block( $block_content, $block ) {
$classes = mai_add_classes( sprintf( 'has-no-margin-%s', $side ), $classes );
$first_block->setAttribute( 'class', $classes );

$block_content = $dom->saveHTML( $dom->documentElement );
$block_content = $dom->saveHTML();
}

return $block_content;
Expand Down
2 changes: 1 addition & 1 deletion lib/blocks/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function mai_render_search_block( $block_content, $block ) {
}
}

$block_content = $dom->saveHTML( $dom->documentElement );
$block_content = $dom->saveHTML();
}

return $block_content;
Expand Down
8 changes: 4 additions & 4 deletions lib/blocks/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function mai_do_cover_group_block_settings( $block_content, $block ) {

$first_block->setAttribute( 'class', $classes );

$block_content = $dom->saveHTML( $dom->documentElement );
$block_content = $dom->saveHTML();
}
}

Expand Down Expand Up @@ -184,7 +184,7 @@ function mai_do_block_max_width_settings( $block_content, $block ) {

$first_block->setAttribute( 'class', $classes );

$block_content = $dom->saveHTML( $dom->documentElement );
$block_content = $dom->saveHTML();
}
}

Expand Down Expand Up @@ -241,7 +241,7 @@ function mai_do_block_spacing_settings( $block_content, $block ) {

$first_block->setAttribute( 'class', $classes );

$block_content = $dom->saveHTML( $dom->documentElement );
$block_content = $dom->saveHTML();
}
}

Expand Down Expand Up @@ -323,7 +323,7 @@ function mai_do_block_margin_settings( $block_content, $block ) {

$first_block->setAttribute( 'class', $classes );

$block_content = $dom->saveHTML( $dom->documentElement );
$block_content = $dom->saveHTML();
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/functions/deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function mai_convert_svg_xmlns( $svg ) {
if ( $xmlns ) {
$xmlns = str_replace( 'http:', 'https:', $xmlns );
$first->setAttribute( 'xmlns', $xmlns );
$svg = $dom->saveHTML( $dom->documentElement );
$svg = $dom->saveHTML();
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/functions/enqueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function mai_add_tag_attributes( $tag, $attributes ) {
foreach ( $attributes as $name => $value ) {
$first->setAttribute( $name, $value );
}
return $dom->saveHTML( $dom->documentElement );
return $dom->saveHTML();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/functions/icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ function mai_get_svg( $name, $class = '' ) {
if ( $first_svg ) {
$classes = mai_add_classes( $class, $first_svg->getAttribute( 'class' ) );
$first_svg->setAttribute( 'class', $classes );
$svg = $dom->saveHTML( $dom->documentElement );
$svg = $dom->saveHTML();
}
}

Expand Down Expand Up @@ -299,7 +299,7 @@ function mai_get_svg_icon( $name, $style = 'light', $atts = [] ) {
}
}

$svg = $dom->saveHTML( $dom->documentElement );
$svg = $dom->saveHTML();
}

// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
Expand Down
4 changes: 2 additions & 2 deletions lib/functions/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ function mai_post_terms_shortcode_classes( $output, $terms, $atts ) {
$classes = $first->getAttribute( 'class' );
$classes = mai_add_classes( sprintf( 'entry-terms-%s', sanitize_html_class( $atts['taxonomy'] ) ), $classes );
$first->setAttribute( 'class', $classes );
$output = trim( $dom->saveHTML( $dom->documentElement ) );
$output = trim( $dom->saveHTML() );

return $output;
}
Expand Down Expand Up @@ -329,7 +329,7 @@ function mai_gallery_shortcode_tag( $output, $tag, $atts, $m ) {
$first->removeAttribute( 'style' );
}

$output = $dom->saveHTML( $dom->documentElement );
$output = $dom->saveHTML();

return $output;
}
2 changes: 1 addition & 1 deletion lib/functions/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ function mai_localize_blocks( $content ) {
}
}

$blocks[ $index ]['innerHTML'] = $dom->saveHTML( $dom->documentElement );
$blocks[ $index ]['innerHTML'] = $dom->saveHTML();

$blocks[ $index ] = filter_block_kses( $blocks[ $index ], 'post' );
}
Expand Down
36 changes: 24 additions & 12 deletions lib/functions/utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -1588,21 +1588,29 @@ function mai_get_search_icon_form( $title = '', $icon_size = '16' ) {
* @return DOMDocument
*/
function mai_get_dom_document( $html ) {

// Create the new document.
$dom = new DOMDocument();

// Modify state.
$libxml_previous_state = libxml_use_internal_errors( true );

// Encode.
$html = mb_convert_encoding( $html, 'HTML-ENTITIES', 'UTF-8' );

// Load the content in the document HTML.
$dom->loadHTML( mb_convert_encoding( $html, 'HTML-ENTITIES', 'UTF-8' ) );
$dom->loadHTML( "<div>$html</div>" );

// Remove <!DOCTYPE.
$dom->removeChild( $dom->doctype );
// Handle wraps.
$container = $dom->getElementsByTagName('div')->item(0);
$container = $container->parentNode->removeChild( $container );

// Remove <html><body></body></html>.
$dom->replaceChild( $dom->firstChild->firstChild->firstChild, $dom->firstChild ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
while ( $dom->firstChild ) {
$dom->removeChild( $dom->firstChild );
}

while ( $container->firstChild ) {
$dom->appendChild( $container->firstChild );
}

// Handle errors.
libxml_clear_errors();
Expand All @@ -1623,12 +1631,16 @@ function mai_get_dom_document( $html ) {
* @return DOMElement $first_block The group block container.
*/
function mai_get_dom_first_child( $dom ) {
/**
* The group block container.
*
* @var DOMElement $first_block The group block container.
*/
return $dom->childNodes && isset( $dom->childNodes[0] ) ? $dom->childNodes[0] : false; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
foreach ( $dom->childNodes as $node ) {
// Skip if not a DOMElement.
if ( 1 !== $node->nodeType ) {
continue;
}

return $node;
}

return false;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/structure/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function mai_comment_reply_button_class( $link ) {
$classes = $button->setAttribute( 'class', $classes );
}

return $dom->saveHTML( $dom->documentElement );
return $dom->saveHTML();
}

/**
Expand Down Expand Up @@ -84,5 +84,5 @@ function mai_comment_reply_link( $formatted_link, $link, $text ) {
$classes = mai_add_classes( 'cancel-comment-reply-link', $classes );
$classes = $link->setAttribute( 'class', $classes );

return $dom->saveHTML( $dom->documentElement );
return $dom->saveHTML();
}
2 changes: 1 addition & 1 deletion lib/structure/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ function mai_custom_scroll_logo( $html, $blog_id ) {
$fragment = $first->ownerDocument->createDocumentFragment();
$fragment->appendXML( $logo );
$first->appendChild( $fragment );
$html = $dom->saveHTML( $dom->documentElement );
$html = $dom->saveHTML();
}

return $html;
Expand Down
4 changes: 2 additions & 2 deletions lib/structure/pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function mai_posts_nav() {
}
}

$pagination = $dom->saveHTML( $dom->documentElement );
$pagination = $dom->saveHTML();
}

echo $pagination;
Expand Down Expand Up @@ -201,7 +201,7 @@ function mai_adjacent_entry( $content, $args ) {
$link->setAttribute( 'class', $classes );
}

$content = $dom->saveHTML( $dom->documentElement );
$content = $dom->saveHTML();

return $content;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/structure/single.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function mai_entry_pagination_button_class( $link, $i ) {
$new .= ' button-small';
$class = mai_add_classes( $new, $class );
$first->setAttribute( 'class', $class );
$link = $dom->saveHTML( $dom->documentElement );
$link = $dom->saveHTML();
}

return $link;
Expand Down
2 changes: 1 addition & 1 deletion lib/support/woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function mai_product_loop_start_columns( $html ) {

$first->setAttribute( 'style', $style );

return str_replace( '</ul>', '', $dom->saveHTML( $dom->documentElement ) );
return str_replace( '</ul>', '', $dom->saveHTML() );
}

add_filter( 'woocommerce_pagination_args', 'mai_woocommerce_pagination_previous_next_text' );
Expand Down
2 changes: 1 addition & 1 deletion mai-engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Plugin URI: https://bizbudding.com/mai-theme/
* GitHub Plugin URI: https://github.com/maithemewp/mai-engine/
* Description: The required plugin to power Mai child themes.
* Version: 2.27.2
* Version: 2.28.0
* Author: BizBudding
* Author URI: https://bizbudding.com/
* Text Domain: mai-engine
Expand Down
6 changes: 3 additions & 3 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,11 @@
},
{
"name": "wpengine/advanced-custom-fields-pro",
"version": "6.1.5",
"version_normalized": "6.1.5.0",
"version": "6.1.6",
"version_normalized": "6.1.6.0",
"dist": {
"type": "zip",
"url": "https://connect.advancedcustomfields.com/v2/plugins/composer_download?p=pro&t=6.1.5"
"url": "https://connect.advancedcustomfields.com/v2/plugins/composer_download?p=pro&t=6.1.6"
},
"require": {
"composer/installers": "~1.0 || ~2.0"
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => 'maithemewp/mai-engine',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => 'b7e19a73a4aa7f673274a367e9b2570cefe13bf1',
'reference' => '92cf6c82758b061aea32fa6574d1aa2395724e2d',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down Expand Up @@ -319,7 +319,7 @@
'maithemewp/mai-engine' => array(
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => 'b7e19a73a4aa7f673274a367e9b2570cefe13bf1',
'reference' => '92cf6c82758b061aea32fa6574d1aa2395724e2d',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -337,12 +337,12 @@
'wpackagist-plugin/advanced-custom-fields' => array(
'dev_requirement' => false,
'replaced' => array(
0 => '6.1.5',
0 => '6.1.6',
),
),
'wpengine/advanced-custom-fields-pro' => array(
'pretty_version' => '6.1.5',
'version' => '6.1.5.0',
'pretty_version' => '6.1.6',
'version' => '6.1.6.0',
'reference' => NULL,
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../wpengine/advanced-custom-fields-pro',
Expand Down
4 changes: 2 additions & 2 deletions vendor/wpengine/advanced-custom-fields-pro/acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Plugin Name: Advanced Custom Fields PRO
* Plugin URI: https://www.advancedcustomfields.com
* Description: Customize WordPress with powerful, professional and intuitive fields.
* Version: 6.1.5
* Version: 6.1.6
* Author: WP Engine
* Author URI: https://wpengine.com/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=plugin_directory&utm_content=advanced_custom_fields
* Update URI: https://www.advancedcustomfields.com/pro
Expand All @@ -34,7 +34,7 @@ class ACF {
*
* @var string
*/
public $version = '6.1.5';
public $version = '6.1.6';

/**
* The plugin settings array.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 434e042

Please sign in to comment.