Skip to content
Merged

Release #3175

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b5c39b6
Sync branch [skip ci]
pirate-bot Nov 9, 2026
04d4605
Sync branch [skip ci]
pirate-bot Nov 9, 2026
5e10d30
fix: validate template cloud requests
selul Nov 11, 2026
3bb3436
fix: align template cloud request arguments
selul Nov 11, 2026
4e9b945
Merge pull request #3171 from Codeinwp/codex/validate-template-cloud-…
selul Nov 11, 2026
012b316
Validate custom animation timing values
selul Nov 11, 2026
d85c22e
Cover editor animation timing styles
selul Nov 11, 2026
6e01224
Preserve supported animation timing classes
selul Nov 11, 2026
647f216
Merge pull request #3172 from Codeinwp/codex/validate-animation-timin…
selul Nov 11, 2026
67256cb
build(deps-dev): bump php-stubs/woocommerce-stubs from 11.2.1 to 11.2…
dependabot[bot] Nov 12, 2026
9ded225
fix: stop repeated synced pattern expansion
selul Nov 12, 2026
9e9feac
fix: stop synced pattern cycles when loading pattern fonts and styles
vytisbulkevicius Nov 12, 2026
01ed9cd
fix: keep a separate pattern chain per loader, release it on errors, …
vytisbulkevicius Nov 12, 2026
a8e7855
fix: skip synced pattern references that are not positive IDs
vytisbulkevicius Nov 12, 2026
1cc4ebe
Merge pull request #3176 from Codeinwp/codex/guard-reusable-css-cycles
vytisbulkevicius Nov 12, 2026
02c5599
feat: opt into the Themeisle SDK Support Hub
vytisbulkevicius Nov 12, 2026
bb4cc90
fix: read the stored Pro license for the Support Hub Pro flag
vytisbulkevicius Nov 12, 2026
2fc146f
test: run the Support Hub license test in the main process
vytisbulkevicius Nov 12, 2026
5739406
test: switch off the stubbed Pro license for the free sidebar case
vytisbulkevicius Nov 12, 2026
a60d51a
test: make the Support Hub visibility checks fail without the change
vytisbulkevicius Nov 13, 2026
48e34d1
Merge pull request #3177 from Codeinwp/feat/support-hub
vytisbulkevicius Nov 13, 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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
},
"minimum-stability": "dev",
"require": {
"codeinwp/themeisle-sdk": "^3.3.65",
"codeinwp/themeisle-sdk": "^3.3.70",
"tubalmartin/cssmin": "^4.1",
"wptt/webfont-loader": "^1.1",
"sabberworm/php-css-parser": "^8.4",
Expand Down
16 changes: 8 additions & 8 deletions composer.lock

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

29 changes: 25 additions & 4 deletions inc/class-blocks-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,19 @@ protected function is_standalone() {
* @access public
*/
public function cycle_through_blocks( $inner_blocks, $id ) {
return $this->collect_css_from_blocks( $inner_blocks, $id, array() );
}

/**
* Collect custom CSS while tracking the current synced-pattern chain.
*
* @param array<int, array<string, mixed>> $inner_blocks Blocks to inspect.
* @param int $id Post ID.
* @param array<int, bool> $seen_refs Synced-pattern IDs in the current chain.
*
* @return string
*/
private function collect_css_from_blocks( $inner_blocks, $id, $seen_refs ) {
$style = '';

foreach ( $inner_blocks as $block ) {
Expand All @@ -232,7 +245,13 @@ public function cycle_through_blocks( $inner_blocks, $id ) {
}

if ( 'core/block' === $block['blockName'] && ! empty( $block['attrs']['ref'] ) ) {
$reusable_block = get_post( $block['attrs']['ref'] );
$reference_id = (int) $block['attrs']['ref'];

if ( $reference_id <= 0 || isset( $seen_refs[ $reference_id ] ) ) {
continue;
}

$reusable_block = get_post( $reference_id );

if ( ! $reusable_block || 'wp_block' !== $reusable_block->post_type ) {
return '';
Expand All @@ -242,13 +261,15 @@ public function cycle_through_blocks( $inner_blocks, $id ) {
return '';
}

$blocks = parse_blocks( $reusable_block->post_content );
$blocks = parse_blocks( $reusable_block->post_content );
$next_seen_refs = $seen_refs;
$next_seen_refs[ $reference_id ] = true;

$style .= $this->cycle_through_blocks( $blocks, $reusable_block->ID );
$style .= $this->collect_css_from_blocks( $blocks, $reusable_block->ID, $next_seen_refs );
}

if ( ! empty( $block['innerBlocks'] ) && is_array( $block['innerBlocks'] ) ) {
$style .= $this->cycle_through_blocks( $block['innerBlocks'], $id );
$style .= $this->collect_css_from_blocks( $block['innerBlocks'], $id, $seen_refs );
}
}

Expand Down
47 changes: 36 additions & 11 deletions inc/css/class-block-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ class Block_Frontend extends Base_CSS {
*/
private $total_inline_size = 0;

/**
* Synced-pattern IDs being expanded in the current chain, per loader method.
*
* @var array<string, array<int, bool>>
*/
private $expanding_refs = array();

/**
* Initialize the class
*/
Expand Down Expand Up @@ -207,13 +214,39 @@ public function get_fonts( $fonts_list = array() ) {
* @access public
*/
public function enqueue_reusable_fonts( $blocks ) {
$this->expand_reusable_blocks( $blocks, 'enqueue_google_fonts' );
}

/**
* Run a loader method for each synced pattern referenced in the blocks,
* skipping patterns that method is already expanding in the current chain.
*
* @param array<int, array<string, mixed>> $blocks Blocks to inspect.
* @param 'enqueue_google_fonts'|'enqueue_styles' $loader Method that receives the pattern ID.
*
* @return void
*/
private function expand_reusable_blocks( $blocks, $loader ) {
foreach ( $blocks as $block ) {
if ( 'core/block' === $block['blockName'] && ! empty( $block['attrs']['ref'] ) ) {
$this->enqueue_google_fonts( $block['attrs']['ref'] );
$reference_id = (int) $block['attrs']['ref'];

// A non-positive ID is malformed; WordPress meta lookups would read it as its absolute value.
if ( $reference_id <= 0 || isset( $this->expanding_refs[ $loader ][ $reference_id ] ) ) {
continue;
}

$this->expanding_refs[ $loader ][ $reference_id ] = true;

try {
$this->$loader( $reference_id );
} finally {
unset( $this->expanding_refs[ $loader ][ $reference_id ] );
}
}

if ( isset( $block['innerBlocks'] ) && ! empty( $block['innerBlocks'] ) && is_array( $block['innerBlocks'] ) ) {
$this->enqueue_reusable_fonts( $block['innerBlocks'] );
$this->expand_reusable_blocks( $block['innerBlocks'], $loader );
}
}
}
Expand Down Expand Up @@ -353,15 +386,7 @@ function () use ( $file_name, $file_url ) {
* @access public
*/
public function enqueue_reusable_styles( $blocks ) {
foreach ( $blocks as $block ) {
if ( 'core/block' === $block['blockName'] && ! empty( $block['attrs']['ref'] ) ) {
$this->enqueue_styles( $block['attrs']['ref'] );
}

if ( isset( $block['innerBlocks'] ) && ! empty( $block['innerBlocks'] ) && is_array( $block['innerBlocks'] ) ) {
$this->enqueue_reusable_styles( $block['innerBlocks'] );
}
}
$this->expand_reusable_blocks( $blocks, 'enqueue_styles' );
}

/**
Expand Down
6 changes: 3 additions & 3 deletions inc/plugins/class-template-cloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,16 @@ public static function sync_sources() {
foreach ( $sources as $source ) {
$url = trailingslashit( $source['url'] ) . self::API_ENDPOINT_SUFFIX;
$args = array(
'sslverify' => false,
'headers' => array(
'reject_unsafe_urls' => true,
'headers' => array(
'X-API-KEY' => $source['key'],
),
);

if ( function_exists( 'vip_safe_wp_remote_get' ) ) {
$response = vip_safe_wp_remote_get( $url, '', 3, 1, 20, $args );
} else {
$response = wp_remote_get( $url, $args ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get
$response = wp_safe_remote_get( $url, $args );
}

if ( is_wp_error( $response ) ) {
Expand Down
5 changes: 3 additions & 2 deletions inc/server/class-template-cloud-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,16 @@ public function register_routes() {
private function validate_source_and_get_name( $url, $key ) {
$url = trailingslashit( $url ) . self::API_ENDPOINT_SUFFIX;
$args = [
'headers' => [
'reject_unsafe_urls' => true,
'headers' => [
'X-API-KEY' => $key,
],
];

if ( function_exists( 'vip_safe_wp_remote_get' ) ) {
$response = vip_safe_wp_remote_get( $url, '', 3, 1, 20, $args );
} else {
$response = wp_remote_get( $url, $args ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get
$response = wp_safe_remote_get( $url, $args );
}

if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
Expand Down
41 changes: 41 additions & 0 deletions otter-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,47 @@ function () {
}
);

/*
* Opts into the SDK Support Hub: one Help button on Otter's screens and the
* deactivation window. The dashboard and Form Submissions screens already fire
* `themeisle_internal_page`, so no `pages` list is needed.
*/
add_filter(
'otter_blocks_support_hub_metadata',
function () {
return array(
// The SDK reads this while loading Otter, before Otter Pro's Licenser adds the
// product_otter_license_status filter, so read the stored license directly.
'is_pro' => defined( 'OTTER_PRO_BASEFILE' ) && class_exists( '\ThemeisleSDK\Modules\Licenser' ) && \ThemeisleSDK\Modules\Licenser::is_valid( OTTER_PRO_BASEFILE ),
'links' => array(
array(
'icon' => 'book-alt',
'text' => __( 'Documentation', 'otter-blocks' ),
'url' => \ThemeIsle\GutenbergBlocks\Pro::get_docs_url(),
),
array(
'icon' => 'groups',
'text' => __( 'Community Forum', 'otter-blocks' ),
'url' => 'https://wordpress.org/support/plugin/otter-blocks/',
),
),
);
}
);

/*
* Otter also fires `themeisle_internal_page` in the block editor, which would put
* the Help button on every post, site and widget editor. Keep it to Otter's screens.
*/
add_filter(
'otter_blocks_hide_support_hub',
function ( $hide ) {
global $pagenow;

return $hide || in_array( $pagenow, array( 'post.php', 'post-new.php', 'site-editor.php', 'widgets.php' ), true );
}
);

add_filter(
'themeisle_sdk_compatibilities/' . basename( OTTER_BLOCKS_PATH ),
function ( $compatibilities ) {
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ Sure, Otter is compatible with any WordPress theme.

### Where can I get help? ###

If you encounter any difficulties or if you have questions about Otter, you can create a ticket on our [support forum](https://wordpress.org/support/plugin/otter-blocks/). Also, feel free to check our [documentation](https://docs.themeisle.com/article/1478-otter-blocks-documentation) to find out more about the features within the plugin and how to use it to its full potential.
If you encounter any difficulties or if you have questions about Otter, you can ask our support team from the **Help** button on the Otter dashboard, or create a ticket on our [support forum](https://wordpress.org/support/plugin/otter-blocks/). Also, feel free to check our [documentation](https://docs.themeisle.com/article/1478-otter-blocks-documentation) to find out more about the features within the plugin and how to use it to its full potential.

### What are the Patterns and how can I use them? ###

Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ Sure, Otter is compatible with any WordPress theme.

= Where can I get help? =

If you encounter any difficulties or if you have questions about Otter, you can create a ticket on our [support forum](https://wordpress.org/support/plugin/otter-blocks/). Also, feel free to check our [documentation](https://docs.themeisle.com/article/1478-otter-blocks-documentation) to find out more about the features within the plugin and how to use it to its full potential.
If you encounter any difficulties or if you have questions about Otter, you can ask our support team from the **Help** button on the Otter dashboard, or create a ticket on our [support forum](https://wordpress.org/support/plugin/otter-blocks/). Also, feel free to check our [documentation](https://docs.themeisle.com/article/1478-otter-blocks-documentation) to find out more about the features within the plugin and how to use it to its full potential.

= What are the Patterns and how can I use them? =

Expand Down
14 changes: 10 additions & 4 deletions src/animation/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import {

import AnimationPopover from './components/animation-popover.js';

import { getAnimationTimingValue } from './timing.js';

import ControlPanelControl from './../blocks/components/control-panel-control/index.js';

import countPlaceholder from './../../assets/images/count-animation.png';
Expand Down Expand Up @@ -217,10 +219,14 @@ function AnimationControls({
attributes.className
?.split( ' ' )
.map( ( i ) => {
if ( i.includes( 'o-anim-value-delay-' ) ) {
return `.${ i } { animation-delay: ${ i.replace( 'o-anim-value-delay-', '' ) }; --webkit-animation-delay: ${ i.replace( 'o-anim-value-delay-', '' ) }; }`;
} else if ( i.includes( 'o-anim-value-speed-' ) ) {
return `.${ i } { animation-duration: ${ i.replace( 'o-anim-value-speed-', '' ) }; --webkit-animation-duration: ${ i.replace( 'o-anim-value-speed-', '' ) }; }`;
const delayValue = getAnimationTimingValue( i, 'o-anim-value-delay-' );
if ( null !== delayValue ) {
return `.${ i } { animation-delay: ${ delayValue }; --webkit-animation-delay: ${ delayValue }; }`;
}

const speedValue = getAnimationTimingValue( i, 'o-anim-value-speed-' );
if ( null !== speedValue ) {
return `.${ i } { animation-duration: ${ speedValue }; --webkit-animation-duration: ${ speedValue }; }`;
}
return '';
})
Expand Down
18 changes: 13 additions & 5 deletions src/animation/frontend.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { getAnimationTimingValue } from './timing.js';

const animations = [
'none',
'bounce',
Expand Down Expand Up @@ -344,7 +346,7 @@ const createCustomAnimationNode = ( elements ) => {
if ( classes.contains( 'o-anim-custom-delay' ) ) {
let delay;
for ( const className of classes ) {
if ( className.includes( 'o-anim-value-delay-' ) ) {
if ( null !== getAnimationTimingValue( className, 'o-anim-value-delay-' ) ) {
delay = className;
break;
}
Expand All @@ -357,7 +359,7 @@ const createCustomAnimationNode = ( elements ) => {
if ( classes.contains( 'o-anim-custom-speed' ) ) {
let speed;
for ( const className of classes ) {
if ( className.includes( 'o-anim-value-speed-' ) ) {
if ( null !== getAnimationTimingValue( className, 'o-anim-value-speed-' ) ) {
speed = className;
break;
}
Expand All @@ -379,9 +381,12 @@ const createCustomAnimationNode = ( elements ) => {
// Helper to escape CSS class names (e.g., 2.3 -> 2\.3)
const escapeCssClass = className => className.replace(/([!"#$%&'()*+,.\/:;<=>?@[\\\]^`{|}~])/g, '\\$1');

customValuesNode.innerHTML = customDelays.reduce(
customValuesNode.textContent = customDelays.reduce(
( accumulator, cssClass ) => {
const delayValue = cssClass.replace( 'o-anim-value-delay-', '' );
const delayValue = getAnimationTimingValue( cssClass, 'o-anim-value-delay-' );
if ( null === delayValue ) {
return accumulator;
}
const escapedClass = escapeCssClass( cssClass );

return (
Expand All @@ -392,7 +397,10 @@ const createCustomAnimationNode = ( elements ) => {
''
) + '\n' + customSpeeds.reduce(
( accumulator, cssClass ) => {
const speedValue = cssClass.replace( 'o-anim-value-speed-', '' );
const speedValue = getAnimationTimingValue( cssClass, 'o-anim-value-speed-' );
if ( null === speedValue ) {
return accumulator;
}
const escapedClass = escapeCssClass( cssClass );

return (
Expand Down
18 changes: 18 additions & 0 deletions src/animation/timing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const TIMING_VALUE_PATTERN = /^[0-9]*\.?[0-9]+(?:ms|s)$/;

/**
* Read a supported animation timing value from a class name.
*
* @param {string} className The class name to inspect.
* @param {string} prefix The timing class prefix.
* @return {string|null} The timing value, or null when it is unsupported.
*/
export const getAnimationTimingValue = ( className, prefix ) => {
if ( ! className.startsWith( prefix ) ) {
return null;
}

const value = className.slice( prefix.length );

return TIMING_VALUE_PATTERN.test( value ) ? value : null;
};
Loading
Loading