Skip to content

Commit

Permalink
Released Spectra 2.15.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bsf-zanev committed Aug 29, 2024
2 parents f732bea + 23e9909 commit 4b190d3
Show file tree
Hide file tree
Showing 54 changed files with 561 additions and 218 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
**Requires at least:** 5.6
**Requires PHP:** 7.4
**Tested up to:** 6.6
**Stable tag:** 2.15.1
**Stable tag:** 2.15.2
**License:** GPLv2 or later
**License URI:** https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -215,6 +215,14 @@ Our external packages use [Rating Star Component](https://github.com/n49/react-s

## Changelog ##

### 2.15.2 - Thursday, 29th August 2024 ###
* Improvement: Container - Added a children-width option for flex columns.
* Fix: Container - Resolved an issue wherein the "Children Width" option would not work as intended.
* Fix: FAQ - Resolved an issue wherein the question icon color would not appear correctly in the editor as compared to the frontend.
* Fix: FAQ - Resolved an issue wherein HTML anchor would not work as intended.
* Fix: Quick Action Bar - Resolved an issue wherein the Quick Access Bar would become non-functional after editing a pattern.
* Fix: Global - Resolved a DOMException issue for iFrames in the block editor with the Stripe plugin.

### 2.15.1 - Tuesday, 6th August 2024 ###
* This update addressed a security bug. Props to Patchstack for privately reporting it to our team. Please make sure you are using the latest version on your website.

Expand All @@ -234,13 +242,6 @@ Our external packages use [Rating Star Component](https://github.com/n49/react-s
* Fix: Global - Resolved an issue wherein the last modified dates would be altered after running the `Ultimate Addons for Gutenberg` database update.
* Deprecated: Header Titlebar - Safely removed the Header Titlebar functionality to allow support for the WordPress 6.6 command palette.

### 2.14.0 - Monday, 8th July 2024 ###
* Fix: Global - Optimized the `Ultimate Addons for Gutenberg` database updation and resolved the editor refresh and RichText issues. Read more about migration [here](https://wpspectra.com/docs/spectra-database-update-instructions/).

### 2.13.9 - Thursday, 4th July 2024 ###
* Improvement: Global - Added an update notice for users that used to use `Ultimate Addons for Gutenberg` to update their database to ensure compatibility with the Heading and Info-box block defaults. Read more [here](https://wpspectra.com/docs/spectra-database-update-instructions/).
* Fix: Container - Resolved an issue wherein WordPress core blocks inside the container were aligning to the center in tablet/mobile view in the editor.

The full changelog is available [here](https://wpspectra.com/whats-new/).

## Upgrade Notice ##
Expand Down
42 changes: 38 additions & 4 deletions admin-core/ajax/common-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -627,16 +627,50 @@ public function enable_on_page_css_button() {
*/
public function blocks_activation_and_deactivation() {
$this->check_permission_nonce( 'uag_blocks_activation_and_deactivation' );
$value = $this->check_post_value();

$value = $this->check_post_value();
$status = $this->check_post_value( 'status' );
if ( '' !== $status ) {
$status_value = 'disabled' === $status ? 'disabled' : 'enabled';
}
// will sanitize $value in later stage.
$value = json_decode( stripslashes( $value ), true );

if ( 'disabled' === \UAGB_Helper::$file_generation ) {
\UAGB_Admin_Helper::create_specific_stylesheet(); // Get Specific Stylesheet.
}

$this->save_admin_settings( '_uagb_blocks', $this->sanitize_form_inputs( $value ) );
if ( '' !== $status ) {
// Update all extensions.
$update_all_extensions = array(
'uag_enable_animations_extension',
'uag_enable_dynamic_content',
'uag_enable_block_condition',
'uag_enable_block_responsive',
'uag_enable_masonry_gallery',
'uag_enable_gbs_extension',
'_uagb_blocks',
);
// Create an array with the new status for each extension.
$change_extension = array();
// Iterate over the array and set the new status for each item.
foreach ( $update_all_extensions as $item ) {
if ( '_uagb_blocks' === $item ) {
$change_extension[ $item ] = $value;
continue;
}
$change_extension[ $item ] = $status_value;
}
// Iterate over the array and call save_admin_settings for each item.
foreach ( $change_extension as $key => $val ) {
if ( '_uagb_blocks' === $key ) {
\UAGB_Admin_Helper::update_admin_settings_option( '_uagb_blocks', $val );
continue;
}
// Update all extensions.
\UAGB_Admin_Helper::update_admin_settings_option( $key, $val );
}
} else {
$this->save_admin_settings( '_uagb_blocks', $this->sanitize_form_inputs( $value ) );
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion admin-core/assets/build/dashboard-app-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin-core/assets/build/dashboard-app.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n'), 'version' => '26ae4ae030bd6952de6b');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n'), 'version' => '72b0cf60dada024b9ed5');
2 changes: 1 addition & 1 deletion admin-core/assets/build/dashboard-app.css

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions admin-core/assets/build/dashboard-app.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions admin-core/assets/src/common/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -465,4 +465,6 @@

.whats-new-rss-flyout-contents {
font-family: Inter, sans-serif;
top: 32px !important;
height: calc(100% - 32px) !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { __ } from '@wordpress/i18n';
import { useSelector, useDispatch } from 'react-redux';
import { Switch } from '@headlessui/react'
import UAGB_Block_Icons from '@Common/block-icons';
import { useEffect } from '@wordpress/element';
import { uagbClassNames } from '@Utils/Helpers';
import { useCallback } from '@wordpress/element';
import { uagbClassNames, debounce } from '@Helpers/Helpers';
import getApiData from '@Controls/getApiData';

const AnimationsExtension = () => {
Expand All @@ -17,12 +17,12 @@ const AnimationsExtension = () => {

const animationExtensionStatus = 'disabled' === enableAnimationsExtension ? false : true;

useEffect( () => {

const sendApiCall = setTimeout( () => {
// Debounce function to limit the rate of execution of a function.
const debouncedApiCall = useCallback(
debounce( ( status ) => {
const data = {
security: uag_react.enable_animations_extension_nonce,
value: enableAnimationsExtension,
value: status,
};

const getApiDataFetch = getApiData( {
Expand All @@ -32,21 +32,18 @@ const AnimationsExtension = () => {
} );

getApiDataFetch.then( () => {} );
}, 300 )

return ()=>{
clearTimeout( sendApiCall );
}

}, [enableAnimationsExtension] );
}, 300 ), // Adjust the delay as needed.
[ enableAnimationsExtension ]
);

const updateAnimationsExtensionStatus = () => {

const assetStatus = ( enableAnimationsExtension === 'disabled' ) ? 'enabled' : 'disabled' ;

dispatch( {type: 'UPDATE_ENABLE_ANIMATIONS_EXTENSION', payload: assetStatus } );
dispatch( {type: 'UPDATE_SETTINGS_SAVED_NOTIFICATION', payload: 'Successfully saved!' } );
};
debouncedApiCall( assetStatus ); // Call the debounced function.
};

return (
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const BlockCard = ( props ) => {
const data = {
security: uag_react.blocks_activation_and_deactivation_nonce,
value: JSON.stringify( optionsClone ),
status: '',
};

// Call the getApiData function with the specified parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { __ } from '@wordpress/i18n';
import { useSelector, useDispatch } from 'react-redux';
import { Switch } from '@headlessui/react'
import UAGB_Block_Icons from '@Common/block-icons';
import { useEffect } from 'react';

import { debounce } from '@Helpers/Helpers';
import { useCallback } from '@wordpress/element';
import getApiData from '@Controls/getApiData';

function classNames( ...classes ) {
Expand All @@ -17,12 +17,14 @@ const DisplayConditionsExtension = () => {

const displayConditionsStatus = 'disabled' === enableDisplayConditions ? false : true;

useEffect( () => {
// Debounce function to limit the rate of execution of a function.
const debouncedApiCall = useCallback(
debounce( ( status ) => {

// Create an object with the security and value properties
const data = {
security: uag_react.enable_block_condition_nonce,
value: enableDisplayConditions,
value: status,
};

// Call the getApiData function with the specified parameters
Expand All @@ -35,7 +37,9 @@ const DisplayConditionsExtension = () => {
// Wait for the API call to complete, but perform no actions after it finishes
getApiFetchData.then( () => {} );

}, [enableDisplayConditions] );
}, 300 ), // Adjust the delay as needed.
[ enableDisplayConditions ]
);

const updateDisplayConditionsStatus = () => {

Expand All @@ -48,7 +52,8 @@ const DisplayConditionsExtension = () => {

dispatch( {type: 'UPDATE_ENABLE_DISPLAY_CONDITIONS', payload: assetStatus } );
dispatch( {type: 'UPDATE_SETTINGS_SAVED_NOTIFICATION', payload: 'Successfully saved!' } );
};
debouncedApiCall( assetStatus ); // Call the debounced function.
};

return (
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { __ } from '@wordpress/i18n';
import { useSelector, useDispatch } from 'react-redux';
import { Switch } from '@headlessui/react'
import UAGB_Block_Icons from '@Common/block-icons';
import { useEffect } from 'react';
import { useCallback } from '@wordpress/element';
import { debounce } from '@Helpers/Helpers';

import getApiData from '@Controls/getApiData';

Expand All @@ -17,12 +18,14 @@ const DynamicContentExtension = () => {

const dynamicContentStatus = 'disabled' === enableDynamicContentExtension ? false : true;

useEffect( () => {
// Debounce function to limit the rate of execution of a function.
const debouncedApiCall = useCallback(
debounce( ( status ) => {

// Create an object with the security and enableDynamicContentExtension properties
const data = {
security: uag_react.enable_dynamic_content_nonce,
value: enableDynamicContentExtension,
value: status,
};

// Call the getApiData function with the specified parameters
Expand All @@ -35,7 +38,9 @@ const DynamicContentExtension = () => {
// Wait for the API call to complete, but perform no actions after it finishes
getApiFetchData.then( () => {} );

}, [enableDynamicContentExtension] );
}, 300 ), // Adjust the delay as needed.
[ enableDynamicContentExtension ]
);

const updatedynamicContentStatus = () => {

Expand All @@ -48,7 +53,7 @@ const DynamicContentExtension = () => {

dispatch( {type: 'UPDATE_ENABLE_DYNAMIC_CONTENT_EXTENSION', payload: assetStatus } );
dispatch( {type: 'UPDATE_SETTINGS_SAVED_NOTIFICATION', payload: 'Successfully saved!' } );

debouncedApiCall( assetStatus ); // Call the debounced function.
};

return (
Expand Down
27 changes: 6 additions & 21 deletions admin-core/assets/src/dashboard-app/pages/blocks/FilterTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,16 @@ const FilterTabs = () => {
// Update Blocks Statuses.
dispatch( {type:'UPDATE_BLOCK_STATUSES', payload: value} );

if ( 'extensions' === activeBlocksFilterTab || 'all' === activeBlocksFilterTab ) {
if ( 'extensions' === activeBlocksFilterTab || 'all' === activeBlocksFilterTab || 'pro' === activeBlocksFilterTab ) {
// Update Extensions Statuses.
dispatch( { type: 'UPDATE_ENABLE_MASONRY_EXTENSION', payload: 'enabled' } );
dispatch( { type: 'UPDATE_ENABLE_DISPLAY_CONDITIONS', payload: 'enabled' } );
dispatch( { type: 'UPDATE_ENABLE_RESPONSIVE_CONDITIONS', payload: 'enabled' } );
dispatch( { type: 'UPDATE_ENABLE_DYNAMIC_CONTENT_EXTENSION', payload: 'enabled' } );
dispatch( { type: 'UPDATE_ENABLE_ANIMATIONS_EXTENSION', payload: 'enabled' } );
}

if ( 'pro' === activeBlocksFilterTab ) {
// Update Extensions Statuses.
dispatch( { type: 'UPDATE_ENABLE_DYNAMIC_CONTENT_EXTENSION', payload: 'enabled' } );
dispatch( { type: 'UPDATE_ALL_EXTENSIONS', payload: 'enabled' } );
}

// Create an object with the security and value properties
const data = {
security: uag_react.blocks_activation_and_deactivation_nonce,
value: JSON.stringify( value ),
status: 'enabled',
};
// Call the getApiData function with the specified parameters
const getApiFetchData = getApiData( {
Expand Down Expand Up @@ -121,23 +113,16 @@ const FilterTabs = () => {
// Update Blocks Statuses.
dispatch( {type:'UPDATE_BLOCK_STATUSES', payload: value} );

if ( 'extensions' === activeBlocksFilterTab || 'all' === activeBlocksFilterTab ) {
// Update Extensions Statuses.
dispatch( { type: 'UPDATE_ENABLE_MASONRY_EXTENSION', payload: 'disabled' } );
dispatch( { type: 'UPDATE_ENABLE_DISPLAY_CONDITIONS', payload: 'disabled' } );
dispatch( { type: 'UPDATE_ENABLE_RESPONSIVE_CONDITIONS', payload: 'disabled' } );
dispatch( { type: 'UPDATE_ENABLE_DYNAMIC_CONTENT_EXTENSION', payload: 'disabled' } );
}

if ( 'pro' === activeBlocksFilterTab ) {
if ( 'extensions' === activeBlocksFilterTab || 'all' === activeBlocksFilterTab || 'pro' === activeBlocksFilterTab ) {
// Update Extensions Statuses.
dispatch( { type: 'UPDATE_ENABLE_DYNAMIC_CONTENT_EXTENSION', payload: 'disabled' } );
dispatch( { type: 'UPDATE_ALL_EXTENSIONS', payload: 'disabled' } );
}

// Create an object with the security and value properties
const data = {
security: uag_react.blocks_activation_and_deactivation_nonce,
value: JSON.stringify( value ),
status: 'disabled',
};
// Call the getApiData function with the specified parameters
const getApiFetchData = getApiData( {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { __ } from '@wordpress/i18n';
import { useSelector, useDispatch } from 'react-redux';
import { Switch } from '@headlessui/react'
import UAGB_Block_Icons from '@Common/block-icons';
import { useEffect } from 'react';
import { useCallback } from '@wordpress/element';
import { debounce } from '@Helpers/Helpers';

import getApiData from '@Controls/getApiData';

Expand All @@ -14,12 +15,14 @@ const GBSExtension = () => {

const GBSStatus = ! ( 'disabled' === enableGBSExtension );

useEffect( () => {
// Debounce function to limit the rate of execution of a function.
const debouncedApiCall = useCallback(
debounce( ( status ) => {

// Create an object with the security and enableGBSExtension properties
const data = {
security: uag_react.enable_gbs_extension_nonce,
value: enableGBSExtension,
value: status,
};

// Call the getApiData function with the specified parameters
Expand All @@ -28,14 +31,16 @@ const GBSExtension = () => {
action: 'uag_enable_gbs_extension',
data,
} );
}, [enableGBSExtension] );
}, 300 ), // Adjust the delay as needed.
[]
);

const updateGBSStatus = () => {
const assetStatus = ( 'disabled' === enableGBSExtension ) ? 'enabled' : 'disabled';

dispatch( { type: 'UPDATE_GBS_EXTENSION', payload: assetStatus } );
dispatch( { type: 'UPDATE_SETTINGS_SAVED_NOTIFICATION', payload: 'Successfully saved!' } );

debouncedApiCall( assetStatus ); // Call the debounced function.
};

return (
Expand Down
Loading

0 comments on commit 4b190d3

Please sign in to comment.