Skip to content
Merged

Release #3130

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a9cf2db
Sync branch [skip ci]
pirate-bot Oct 19, 2026
a9ef585
Sync branch [skip ci]
pirate-bot Oct 19, 2026
9af5741
fix: keep Accordion letter spacing after the post is reopened (#3126)
selul Oct 23, 2026
ac7d64b
Prevented Countdown block breakage when editing as HTML (#3131)
girishpanchal30 Oct 23, 2026
5e4dc5a
build(deps): bump enshrined/svg-sanitize from 1.0.0 to 1.1.0 (#3138)
dependabot[bot] Oct 27, 2026
c8a1fba
Supported comma-separated recipients addresses (#3139)
girishpanchal30 Oct 27, 2026
5e8fa2c
build(deps): bump codeinwp/themeisle-sdk in /plugins/blocks-css (#3143)
dependabot[bot] Oct 28, 2026
87dc8b2
build(deps): bump codeinwp/themeisle-sdk in /plugins/blocks-animation…
dependabot[bot] Oct 28, 2026
d81f28b
build(deps): bump enshrined/svg-sanitize from 1.1.0 to 1.1.1 (#3141)
dependabot[bot] Oct 28, 2026
4b93f66
build(deps): bump codeinwp/themeisle-sdk from 3.3.67 to 3.3.68 (#3140)
dependabot[bot] Oct 28, 2026
46d3514
fix: persist welcome guide dismissal per user (#3136)
girishpanchal30 Oct 29, 2026
aa729aa
Prevented mobile layout shifts with head CSS (#3145)
girishpanchal30 Oct 30, 2026
2f7d322
build(deps): bump codeinwp/themeisle-sdk in /plugins/blocks-animation…
dependabot[bot] Nov 3, 2026
bca933c
build(deps): bump codeinwp/themeisle-sdk in /plugins/blocks-css (#3148)
dependabot[bot] Nov 3, 2026
cc2d5ed
build(deps): bump codeinwp/themeisle-sdk from 3.3.68 to 3.3.69 (#3147)
dependabot[bot] Nov 3, 2026
474084c
fix(black-friday): treat active_expired licenses as expired (#3135)
Soare-Robert-Daniel Nov 3, 2026
04f69dd
build(deps): bump codeinwp/themeisle-sdk in /plugins/blocks-css (#3155)
dependabot[bot] Nov 4, 2026
2d15f11
build(deps): bump codeinwp/themeisle-sdk in /plugins/blocks-animation…
dependabot[bot] Nov 4, 2026
45c68ef
build(deps): bump codeinwp/themeisle-sdk from 3.3.69 to 3.3.70 (#3151)
dependabot[bot] Nov 4, 2026
8bf7f6e
build(deps): bump codeinwp/themeisle-sdk in /plugins/blocks-animation…
dependabot[bot] Nov 5, 2026
5e2bbde
build(deps): bump codeinwp/themeisle-sdk in /plugins/blocks-css (#3160)
dependabot[bot] Nov 5, 2026
49eafd8
build(deps-dev): bump php-stubs/woocommerce-stubs from 11.2.0 to 11.2…
dependabot[bot] Nov 5, 2026
b02d90a
build(deps): bump codeinwp/themeisle-sdk from 3.3.70 to 3.3.71 (#3157)
dependabot[bot] Nov 5, 2026
670c2fd
fix: replace retired OpenAI models (#3134)
girishpanchal30 Nov 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion inc/class-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ public function add_black_friday_data( $configs ) {
$status = apply_filters( 'product_otter_license_status', false );

$is_pro = 'valid' === $status;
$is_expired = 'expired' === $status || 'active-expired' === $status;
$is_expired = in_array( $status, array( 'expired', 'active_expired', 'active-expired' ), true );
$pro_product_slug = defined( 'OTTER_PRO_BASEFILE' ) ? basename( dirname( OTTER_PRO_BASEFILE ) ) : '';

if ( $is_pro ) {
Expand Down
11 changes: 8 additions & 3 deletions inc/class-registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -1211,21 +1211,26 @@ public function load_condition_hide_on_styles( $block_content, $block ) {
return $block_content;
}

add_action( 'wp_footer', array( $this, 'condition_hide_on_style' ) );
self::condition_hide_on_style();
self::$scripts_loaded['condition_hide_on'] = true;

return $block_content;
}

/**
* Get the styles for Hide on condition.
* Enqueue the styles for Hide on condition.
*
* Enqueued, not echoed, so core can print them in <head> even when enqueued late.
*
* @static
* @since 2.4
* @access public
* @return void
*/
public static function condition_hide_on_style() {
echo '<style id="o-condition-hide-inline-css">@layer theme, base, components, utilities;@media (max-width:768px){@layer utilities{.o-hide-on-mobile:is(.o-hide-on-mobile,#_){display:none!important}}}@media (min-width:769px) and (max-width:1024px){@layer utilities{.o-hide-on-tablet:is(.o-hide-on-tablet,#_){display:none!important}}}@media (min-width:1025px){@layer utilities{.o-hide-on-desktop:is(.o-hide-on-desktop,#_){display:none!important}}}</style>';
wp_register_style( 'o-condition-hide', false, array(), OTTER_BLOCKS_VERSION );
wp_add_inline_style( 'o-condition-hide', '@layer theme, base, components, utilities;@media (max-width:768px){@layer utilities{.o-hide-on-mobile:is(.o-hide-on-mobile,#_){display:none!important}}}@media (min-width:769px) and (max-width:1024px){@layer utilities{.o-hide-on-tablet:is(.o-hide-on-tablet,#_){display:none!important}}}@media (min-width:1025px){@layer utilities{.o-hide-on-desktop:is(.o-hide-on-desktop,#_){display:none!important}}}' );
wp_enqueue_style( 'o-condition-hide' );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions inc/plugins/class-abilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function register_abilities() {
'properties' => array(
'email_to' => array(
'type' => 'string',
'description' => __( 'Recipient email address. The site admin email is used when empty.', 'otter-blocks' ),
'description' => __( 'Recipient email addresses, separated by commas. The site admin email is used when empty.', 'otter-blocks' ),
),
'subject' => array( 'type' => 'string' ),
'from_name' => array( 'type' => 'string' ),
Expand Down Expand Up @@ -919,7 +919,7 @@ private function apply_delivery( $entry, $delivery ) {
}

if ( '' !== $value && in_array( $key, array( 'email_to', 'cc', 'bcc', 'from_email', 'reply_to' ), true ) ) {
$emails = in_array( $key, array( 'email_to', 'from_email', 'reply_to' ), true ) ? array( $value ) : array_map( 'trim', explode( ',', $value ) );
$emails = in_array( $key, array( 'from_email', 'reply_to' ), true ) ? array( $value ) : array_map( 'trim', explode( ',', $value ) );

foreach ( $emails as $email ) {
if ( ! is_email( $email ) ) {
Expand Down
25 changes: 19 additions & 6 deletions inc/server/class-form-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ public function send_default_email( $form_data ) {

foreach ( $form_emails as $form ) {
if ( isset( $form['form'] ) && $form['form'] === $option_name && isset( $form['email'] ) && '' !== $form['email'] ) {
$to = sanitize_email( $form['email'] );
$to = implode( ', ', self::sanitize_recipients( $form['email'] ) );
}
}

Expand Down Expand Up @@ -817,14 +817,15 @@ public static function send_test_email( $form_data ) {
try {
$email_subject = ( __( 'Test email for Otter Form from ', 'otter-blocks' ) . get_bloginfo( 'name', 'display' ) );
$email_body = Form_Email::instance()->build_test_email( $form_data );

$recipients = $form_data->payload_has( 'to' ) ? self::sanitize_recipients( $form_data->get_data_from_payload( 'to' ) ) : array();
// Sent the form date to the admin site as a default behaviour.
$to = sanitize_email( get_option( 'admin_email' ) );
if ( $form_data->payload_has( 'to' ) && '' !== $form_data->get_data_from_payload( 'to' ) ) {
$to = sanitize_email( $form_data->get_data_from_payload( 'to' ) );
if ( empty( $recipients ) ) {
$recipients = array( sanitize_email( get_option( 'admin_email' ) ) );
}
$headers = array( 'Content-Type: text/html; charset=UTF-8', 'From: ' . get_bloginfo( 'name', 'display' ) . '<' . $to . '>' );
$headers = array( 'Content-Type: text/html; charset=UTF-8', 'From: ' . get_bloginfo( 'name', 'display' ) . '<' . $recipients[0] . '>' );
// phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_mail_wp_mail
$res->set_success( wp_mail( $to, $email_subject, $email_body, $headers ) );
$res->set_success( wp_mail( implode( ', ', $recipients ), $email_subject, $email_body, $headers ) );
} catch ( Exception $e ) {
$res->set_code( Form_Data_Response::ERROR_RUNTIME_ERROR );
$res->add_reason( $e->getMessage() );
Expand Down Expand Up @@ -1170,6 +1171,18 @@ public function build_email_error_content( $content ) {
return $content;
}

/**
* Sanitize a comma-separated list of email addresses, dropping the invalid ones.
*
* @param string $recipients Comma-separated email addresses.
* @return list<string>
*/
private static function sanitize_recipients( $recipients ) {
$emails = array_map( 'sanitize_email', explode( ',', $recipients ) );

return array_values( array_filter( $emails, 'is_email' ) );
}

/**
* Get the first email from the input's form.
*
Expand Down
2 changes: 1 addition & 1 deletion inc/server/class-otter-openai-backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function generate( array $payload ) {
* @param string $model Default model ID.
* @param array<string, mixed> $payload The filtered OpenAI-format payload.
*/
$model = (string) apply_filters( 'otter_ai_block_generation_model', 'gpt-5-mini', $payload );
$model = (string) apply_filters( 'otter_ai_block_generation_model', 'gpt-5.6-terra', $payload );
}

if ( is_string( $model ) && '' !== $model ) {
Expand Down
2 changes: 1 addition & 1 deletion inc/server/class-prompt-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function save_api_key( $request ) {
),
'body' => wp_json_encode(
array(
'model' => 'gpt-3.5-turbo',
'model' => 'gpt-6-luna',
'messages' => array(
array(
'role' => 'system',
Expand Down
6 changes: 0 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,6 @@ parameters:
count: 1
path: inc/class-registration.php

-
rawMessage: 'Method ThemeIsle\GutenbergBlocks\Registration::condition_hide_on_style() has no return type specified.'
identifier: missingType.return
count: 1
path: inc/class-registration.php

-
rawMessage: 'Method ThemeIsle\GutenbergBlocks\Registration::enqueue_assets() has no return type specified.'
identifier: missingType.return
Expand Down
12 changes: 6 additions & 6 deletions plugins/blocks-animation/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions plugins/blocks-css/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/blocks/blocks/accordion/group/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"type": "number"
},
"letterSpacing": {
"type": "string"
"type": ["number", "string"]
},
"padding": {
"type": "object"
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/blocks/form/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const FormOptions = ({ formOptions, setFormOption, attributes, setAttributes })
<TextControl
label={ __( 'Email To', 'otter-blocks' ) }
placeholder={ __( 'Default is to admin site', 'otter-blocks' ) }
type="email"
type="text"
value={ formOptions.emailTo }
onChange={ emailTo => setFormOption({ emailTo }) }
help={ __( 'Default is site administrator.', 'otter-blocks' ) }
Expand Down
7 changes: 5 additions & 2 deletions src/blocks/plugins/data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ import hash from 'object-hash';
*/
import apiFetch from '@wordpress/api-fetch';

import { registerStore } from '@wordpress/data';
import {
registerStore,
select
} from '@wordpress/data';

/**
* Internal dependencies
*/
import { getQueryStringFromObject } from '../../helpers/helper-functions.js';

const DEFAULT_STATE = {
showOnboarding: Boolean( window.themeisleGutenberg.showOnboarding ) && 'false' !== window.localStorage?.getItem( 'o-show-onboarding' ),
showOnboarding: Boolean( window.themeisleGutenberg.showOnboarding ) && 'false' !== window.localStorage?.getItem( 'o-show-onboarding' ) && false !== select( 'core/preferences' )?.get( 'themeisle/otter-blocks', 'show-welcome-guide' ),
viewType: 'Desktop',
visiblePopover: 'themeisle-blocks/dynamic-value',
dynamicData: {},
Expand Down
41 changes: 41 additions & 0 deletions src/blocks/plugins/html-edit/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ export const HTML_FIELDS = {
}
};

/**
* Markup that `save` generates from no attribute, by block name. An HTML edit
* inside it cannot be kept, so it is restored from `save`.
*
* @type {Object<string, string>}
*/
export const GENERATED_MARKUP = {
'themeisle-blocks/countdown': ':scope > .otter-countdown__container'
};

/**
* Parse markup into an inert fragment.
*
Expand Down Expand Up @@ -263,3 +273,34 @@ export const syncDuplicateValues = ( attributes, blockType, html ) => {

return synced ? template.innerHTML : null;
};

/**
* Replace the generated markup in an edited block with the markup `save`
* regenerates, so an HTML edit inside it matches `save` again.
*
* @param {string} name The block name.
* @param {string} html The edited block markup.
* @param {string} savedHTML The markup `save` generates for the block attributes.
* @return {string|null} The restored markup, or null when the generated markup was not edited.
*/
export const restoreGeneratedMarkup = ( name, html, savedHTML ) => {
const selector = GENERATED_MARKUP[ name ];

if ( ! selector || 'string' !== typeof html ) {
return null;
}

const template = document.createElement( 'template' );
template.innerHTML = html;

const edited = template.content.firstElementChild?.querySelector( selector );
const generated = toFragment( savedHTML ).firstElementChild?.querySelector( selector );

if ( ! edited || ! generated || edited.isEqualNode( generated ) ) {
return null;
}

edited.replaceWith( generated );

return template.innerHTML;
};
Loading
Loading