-
+
+
+
@@ -165,7 +185,7 @@ class="installer_status"
diff --git a/base/base.php b/base/base.php
index 1f9ab9ffe..e88cfe12c 100644
--- a/base/base.php
+++ b/base/base.php
@@ -350,6 +350,36 @@ function siteorigin_widgets_url( $path = '' ) {
return plugins_url( 'so-widgets-bundle/' . $path );
}
+/**
+ * Check if the Page Builder can render.
+ *
+ * This method checks if the necessary conditions are met for Page Builder to
+ * render. It first verifies that Page Builder is active. It then checks
+ * if either:
+ * - The request is in the admin area, OR
+ * - If this is a REST request and the block editor is active.
+ *
+ * If none of these conditions are met, Page Builder can't render.
+ *
+ * @return bool True if Page Builder builder can render, false otherwise.
+ */
+function siteorigin_widgets_can_render_builder_field() {
+ if ( ! defined( 'SITEORIGIN_PANELS_VERSION' ) ) {
+ return false;
+ }
+
+ if ( is_admin() ) {
+ return true;
+ }
+
+ // Is this field being rendered inside one of our blocks?
+ if ( defined( 'REST_REQUEST' ) && function_exists( 'register_block_type' ) ) {
+ return true;
+ }
+
+ return false;
+}
+
function siteorigin_loading_optimization_attributes( $attr, $widget, $instance, $class ) {
// Allow other plugins to override whether this widget is lazy loaded or not.
if (
@@ -452,12 +482,20 @@ function siteorigin_widget_onclick( $onclick = null, $recursive = true ) {
if ( apply_filters( 'siteorigin_widgets_onclick_disallowlist', true ) ) {
// It's possible for allowed functions to contain disallowed functions, so we need to loop through and remove.
- $disallowed_functions = array( 'alert', 'eval', 'execScript', 'setTimeout', 'setInterval', 'function', 'document', 'Object', 'window', 'innerHTML', 'outerHTML', 'onload', 'onerror', 'onclick', 'storage', 'fetch', 'XMLHttpRequest', 'jQuery', '$.', 'prototype', '__proto__', 'constructor', 'decode', 'encode', 'atob', 'btoa', 'Promise', 'setImmediate', 'unescape', 'escape', 'captureEvents', 'proxy', 'Reflect', 'Array', 'String', 'Math', 'Date', 'property', 'Properties', 'Error', 'Map', 'Set', 'Generator', 'Web', 'dataview', 'Blob', 'javascript', 'Text', 'Intl', 'JSON', 'RegExp', 'console', 'history', 'location', 'navigator', 'screen', 'worker', 'FinalizationRegistry', 'weak', 'top', 'self', 'open', 'parent', 'frame', 'import', 'fragment', 'globalThis', 'frames', 'import', 'this', 'escape', 'watch', 'element', 'file', 'db', 'worker', 'EventSource', 'join', 'upper' );
+ $disallowed_functions = array( 'alert', 'eval', 'execScript', 'setTimeout', 'setInterval', 'function', 'document', 'Object', 'window', 'innerHTML', 'outerHTML', 'onload', 'onerror', 'onclick', 'storage', 'fetch', 'XMLHttpRequest', 'jQuery', '$.', 'prototype', '__proto__', 'constructor', 'decode', 'encode', 'atob', 'btoa', 'Promise', 'setImmediate', 'unescape', 'escape', 'captureEvents', 'proxy', 'Reflect', 'Array', 'String', 'Math', 'Date', 'property', 'Properties', 'Error', 'Map', 'Set', 'Generator', 'Web', 'dataview', 'Blob', 'javascript', 'Text', 'Intl', 'JSON', 'RegExp', 'console', 'history', 'location', 'navigator', 'screen', 'worker', 'FinalizationRegistry', 'weak', 'top', 'self', 'parent', 'frame', 'import', 'fragment', 'globalThis', 'frames', 'import', 'this', 'escape', 'watch', 'element', 'file', 'db', 'worker', 'EventSource', 'join', 'upper' );
if ( preg_match( '/\b(' . implode( '|', array_map( 'preg_quote', $disallowed_functions ) ) . ')\b/i', $onclick ) ) {
return;
}
+ // If string contains 'open' or 'close', check if there's a
+ // preceding dot. If not, disallow.
+ if ( preg_match( '/\b(open|close)\b/i', $onclick ) ) {
+ if ( ! preg_match( '/\.\s*(open|close)\s*\(/i', $onclick ) ) {
+ return;
+ }
+ }
+
// Case sensitive disallow.
$case_sensitive_disallow = array(
'URL',
@@ -469,6 +507,11 @@ function siteorigin_widget_onclick( $onclick = null, $recursive = true ) {
}
if ( apply_filters( 'siteorigin_widgets_onclick_allowlist', true ) ) {
+ // Ensure $onclick ends with a semicolon to prevent syntax errors.
+ if ( substr( $onclick, -1 ) !== ';' ) {
+ $onclick .= ';';
+ }
+
$onclick_parts = explode( ');', $onclick );
$adjusted_onclick = '';
@@ -514,6 +557,7 @@ function siteorigin_widget_onclick( $onclick = null, $recursive = true ) {
'ym',
'ml_account', // MailerLite.
'calendly.initpopupwidget', // Calendly.
+ 'pum.open', // Popup Maker.
)
) );
diff --git a/base/css/admin.less b/base/css/admin.less
index d2d7e3a83..b2c8e649d 100644
--- a/base/css/admin.less
+++ b/base/css/admin.less
@@ -5,19 +5,48 @@
}
.siteorigin-widget-teaser {
- padding: 10px 12px;
- border: 1px solid #5fc133;
+ align-items: center;
background: #edfbe7;
+ border: 1px solid #5fc133;
color: #394a3a;
+ display: flex;
+ justify-content: space-between;
margin-bottom: 20px;
+ padding: 10px 12px;
- .dashicons {
- float: right;
- margin: 1px 2px 6px 10px;
+ &-message {
+ margin: 0;
+
+ a {
+
+ &:hover,
+ &:focus {
+ text-decoration: none;
+ }
+ }
+ }
+
+ &-dismiss {
+ appearance: none;
+ background: none;
+ border: none;
+ color: #394a3a;
cursor: pointer;
font-size: 18px;
- width: 18px;
- height: 18px;
+
+ &:hover,
+ &:focus {
+ color: #666;
+ }
+
+ .dashicons {
+ cursor: pointer;
+ float: right;
+ font-size: 18px;
+ height: 18px;
+ margin: 1px 2px 6px 10px;
+ width: 18px;
+ }
}
}
@@ -27,6 +56,12 @@
background-color: #cde2ec;
margin-bottom: 20px;
+ &.sow-error {
+ background: #fce4e5;
+ border: 1px solid #ec666a;
+ color: #ec666a;
+ }
+
> span {
line-height: 22px;
}
@@ -162,6 +197,7 @@ div.siteorigin-widget-form {
}
&[multiple] {
+ background: #fff;
max-height: 83px;
}
@@ -1009,6 +1045,10 @@ div.siteorigin-widget-form {
font-size: 14px;
padding: 0 24px 0 8px;
+ &[multiple] {
+ padding: 0 8px;
+ }
+
/* 5.7.2 .wp-core-ui select styling */
-webkit-appearance: none;
background: #fff url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E') no-repeat right 5px top 55%;
@@ -1023,9 +1063,12 @@ div.siteorigin-widget-form {
font-size: 14px;
line-height: 2;
min-height: 30px;
- padding: 0 24px 0 8px;
vertical-align: middle;
width: auto;
+
+ &[multiple] {
+ background: #fff;
+ }
}
@media (max-width: 399px) {
diff --git a/base/inc/actions.php b/base/inc/actions.php
index 19bf22e49..16a9e1858 100644
--- a/base/inc/actions.php
+++ b/base/inc/actions.php
@@ -50,7 +50,9 @@ function siteorigin_widget_preview_widget_action() {
?>
-
+
+
+
$_wp_additional_image_sizes[ $_size ]['width'],
- 'height' => $_wp_additional_image_sizes[ $_size ]['height'],
- 'crop' => $_wp_additional_image_sizes[ $_size ]['crop'],
+ 'width' => (int) get_option( $_size . '_size_w' ),
+ 'height' => (int) get_option( $_size . '_size_h' ),
+ 'crop' => (bool) get_option( $_size . '_crop' ),
);
+
+ continue;
+ }
+
+ if ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
+ $sizes[ $_size] = $_wp_additional_image_sizes[ $_size ];
}
}
+ $siteorigin_image_sizes = $sizes;
+
return $sizes;
}
/**
- * @return mixed
+ * Get the image size configuration.
+ *
+ * This function retrieves the configuration for the specified image size.
+ * It returns null if the size is not defined, or if the sizes array is empty.
+ * If the size identifier is 'thumb', we override it to 'thumbnail' to match the
+ * current WordPress core image size.
+ *
+ * @param string $size - The image size identifier.
+ *
+ * @return array|null - The configuration array for the image size, or null if not found.
*/
function siteorigin_widgets_get_image_size( $size ) {
$sizes = siteorigin_widgets_get_image_sizes();
- if ( ! empty( $sizes[ $size ] ) ) {
- return $sizes[ $size ];
+ // Previously, we stored the thumbnail size as 'thumb'. It's now 'thumbnail'.
+ if ( $size === 'thumb' ) {
+ $size = 'thumbnail';
+ }
+
+ if (
+ empty( $sizes ) ||
+ ! is_string( $size ) ||
+ ! isset( $sizes[ $size ] )
+ ) {
+ return null;
}
- return null;
+ return $sizes[ $size ];
}
diff --git a/base/inc/fields/builder.class.php b/base/inc/fields/builder.class.php
index 81ace3ca2..70ef5ad75 100644
--- a/base/inc/fields/builder.class.php
+++ b/base/inc/fields/builder.class.php
@@ -6,45 +6,47 @@
* Class SiteOrigin_Widget_Field_Builder
*/
class SiteOrigin_Widget_Field_Builder extends SiteOrigin_Widget_Field_Base {
- protected function render_field( $value, $instance ) {
- if ( defined( 'SITEORIGIN_PANELS_VERSION' ) ) {
- // Normal rendering code
- // In some contexts this is already encoded, e.g. accordion widget using a layout field for content,
- // inside a PB block in the block editor.
- $valid_string = is_string( $value ); // Required for PHP <5.4
- if ( empty( $valid_string ) ) {
- $value = json_encode( $value );
- }
- ?>
-
-
-
-
+ ',
+ ''
+ );
+ ?>
+
+ .select2-results__options {
+ max-height: 200px;
+ overflow-y: auto;
+ }
+
+ .select2-results__option {
+
+ .select2-results__option {
+ padding-left: 1em;
+
+ .select2-results__group {
+ padding-left: 0;
+ }
+
+ .select2-results__option {
+ margin-left: -1em;
+ padding-left: 2em;
+
+ .select2-results__option {
+ margin-left: -2em;
+ padding-left: 3em;
+
+ .select2-results__option {
+ margin-left: -3em;
+ padding-left: 4em;
+
+ .select2-results__option {
+ margin-left: -4em;
+ padding-left: 5em;
+
+ .select2-results__option {
+ margin-left: -5em;
+ padding-left: 6em;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ .select2-results__option--group {
+ padding: 0;
+ }
+
+ .select2-results__option--disabled {
+ color: #999;
+ }
+
+ .select2-results__option--selected {
+ background-color: #ddd;
+ }
+
+ .select2-results__option--highlighted.select2-results__option--selectable {
+ background-color: #5897fb;
+ color: white;
+ }
+
+ .select2-results__group {
+ cursor: default;
+ display: block;
+ padding: 6px;
+ }
+}
diff --git a/base/inc/fields/date-range.class.php b/base/inc/fields/date-range.class.php
index b34fc5231..b43339158 100644
--- a/base/inc/fields/date-range.class.php
+++ b/base/inc/fields/date-range.class.php
@@ -31,10 +31,9 @@ private function render_specific_date_selector() {
?>
-
-
+
@@ -42,7 +41,7 @@ private function render_specific_date_selector() {
@@ -87,7 +86,7 @@ private function render_relative_date_selector_part( $name, $label, $value ) {
-
+