Skip to content

Commit

Permalink
Merge branch 'development' into feat/product-review-inline
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Jul 7, 2023
2 parents 558ff44 + e1c1ba2 commit a600c56
Show file tree
Hide file tree
Showing 20 changed files with 108 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/sync-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
from_branch: master
target_branch: development
github_token: ${{ secrets.BOT_TOKEN }}
- name: Merge development -> v2.3
- name: Merge development -> next
if: ${{ steps.retrieve-branch-name.outputs.branch_name == 'development' }}
uses: Codeinwp/merge-branch@master
with:
type: now
from_branch: development
target_branch: v2.3
target_branch: next
github_token: ${{ secrets.BOT_TOKEN }}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##### [Version 2.3.1](https://github.com/Codeinwp/otter-blocks/compare/v2.3.0...v2.3.1) (2023-06-20)

- Added Option to Allow Block Tools to Be Enabled by Default
- Improvements for Social Sharing Block
- Improvements to Posts Block’s Handling of WooCommerce Products
- Fix Dynamic Tags Not Working with Neve Pro Custom Layouts
- Fix Wrong Defaults in Form
- Fix Form Submissions Not Saving to Database If SMTP Fails
- Fix the Option to save Google Fonts Locally Not Working
- Fix Form Option Not Saving
- Fix Illegal String Offset on Minimal Version Check
- Fix the Issue with Otter Menu Pointing to the Old URL
- Fix Form Submission Email Being Used as Post Title of Form Submissions

#### [Version 2.3.0](https://github.com/Codeinwp/otter-blocks/compare/v2.2.7...v2.3.0) (2023-05-25)

- Add Custom Taxonomy Support to Dynamic Values
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "codeinwp/otter-blocks",
"description": "A set of awesome Gutenberg Blocks by ThemeIsle.",
"type": "wordpress-plugin",
"version": "2.3.0",
"version": "2.3.1",
"require-dev": {
"squizlabs/php_codesniffer": "^3.3",
"wp-coding-standards/wpcs": "^1",
Expand Down
2 changes: 1 addition & 1 deletion development.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function () {
add_filter(
'otter_pro_lc_no_valid_string',
function ( $message ) {
return str_replace( '<a href="%s">', '<a href="' . admin_url( 'options-general.php?page=otter' ) . '">', $message );
return str_replace( '<a href="%s">', '<a href="' . admin_url( 'admin.php?page=otter' ) . '">', $message );
}
);

Expand Down
2 changes: 1 addition & 1 deletion inc/class-pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public function render_metabox_upsell( $post_type ) {
<div class="clear">
<p><?php _e( 'Unlock the full power of WooCommerce Builder by activating Otter Pro license.', 'otter-blocks' ); ?></p>

<a href="<?php echo esc_url( admin_url( 'options-general.php?page=otter' ) ); ?>" target="_blank" class="button button-primary">
<a href="<?php echo esc_url( admin_url( 'admin.php?page=otter' ) ); ?>" target="_blank" class="button button-primary">
<?php _e( 'Activate License', 'otter-blocks' ); ?>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion inc/class-registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public function enqueue_block_editor_assets() {
'should_show_upsell' => Pro::should_show_upsell(),
'assetsPath' => OTTER_BLOCKS_URL . 'assets',
'updatePath' => admin_url( 'update-core.php' ),
'optionsPath' => admin_url( 'options-general.php?page=otter' ),
'optionsPath' => admin_url( 'admin.php?page=otter' ),
'mapsAPI' => $api,
'hasStripeAPI' => Stripe_API::has_keys(),
'globalDefaults' => json_decode( get_option( 'themeisle_blocks_settings_global_defaults', '{}' ) ),
Expand Down
2 changes: 1 addition & 1 deletion inc/integrations/class-form-settings-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public static function get_form_setting_from_wordpress_options( $form_option ) {
$form_emails = get_option( 'themeisle_blocks_form_emails' );
$integration = new Form_Settings_Data( array() );
foreach ( $form_emails as $form ) {
if ( $form['form'] === $option_name ) {
if ( isset( $form['form'] ) && $form['form'] === $option_name ) {

if ( isset( $form['hasCaptcha'] ) ) {
$integration->set_captcha( $form['hasCaptcha'] );
Expand Down
2 changes: 1 addition & 1 deletion inc/plugins/class-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function maybe_redirect() {
}

update_option( 'themeisle_blocks_settings_redirect', false );
wp_safe_redirect( admin_url( 'options-general.php?page=otter' ) );
wp_safe_redirect( admin_url( 'admin.php?page=otter' ) );
exit;
}

Expand Down
6 changes: 3 additions & 3 deletions otter-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Plugin Name: Otter – Page Builder Blocks & Extensions for Gutenberg
* Plugin URI: https://themeisle.com/plugins/otter-blocks
* Description: Create beautiful and attracting posts, pages, and landing pages with Otter – Page Builder Blocks & Extensions for Gutenberg. Otter comes with dozens of Gutenberg blocks that are all you need to build beautiful pages.
* Version: 2.3.0
* Version: 2.3.1
* Author: ThemeIsle
* Author URI: https://themeisle.com
* License: GPL-2.0+
Expand All @@ -26,7 +26,7 @@
define( 'OTTER_BLOCKS_BASEFILE', __FILE__ );
define( 'OTTER_BLOCKS_URL', plugins_url( '/', __FILE__ ) );
define( 'OTTER_BLOCKS_PATH', dirname( __FILE__ ) );
define( 'OTTER_BLOCKS_VERSION', '2.3.0' );
define( 'OTTER_BLOCKS_VERSION', '2.3.1' );
define( 'OTTER_BLOCKS_PRO_SUPPORT', true );
define( 'OTTER_BLOCKS_SHOW_NOTICES', false );

Expand Down Expand Up @@ -66,7 +66,7 @@ function ( $compatibilities ) {
function( $links ) {
array_unshift(
$links,
sprintf( '<a href="%s">%s</a>', admin_url( 'options-general.php?page=otter' ), __( 'Settings', 'otter-blocks' ) )
sprintf( '<a href="%s">%s</a>', admin_url( 'admin.php?page=otter' ), __( 'Settings', 'otter-blocks' ) )
);
return $links;
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "otter-blocks",
"version": "2.3.0",
"version": "2.3.1",
"description": "Otter – Page Builder Blocks & Extensions for Gutenberg",
"scripts": {
"build": "npm-run-all --parallel prod:*",
Expand Down
2 changes: 1 addition & 1 deletion plugins/blocks-animation/blocks-animation.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Blocks Animation: CSS Animations for Gutenberg Blocks
* Plugin URI: https://github.com/Codeinwp/otter-blocks
* Description: Blocks Animation allows you to add CSS Animations to all of your Gutenberg blocks in the most elegent way.
* Version: 2.3.0
* Version: 2.3.1
* Author: ThemeIsle
* Author URI: https://themeisle.com
* License: GPL-3.0+
Expand Down
2 changes: 1 addition & 1 deletion plugins/blocks-css/blocks-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Blocks CSS: CSS Editor for Gutenberg Blocks
* Plugin URI: https://github.com/Codeinwp/otter-blocks
* Description: Blocks CSS allows you add custom CSS to your Blocks straight from the Block Editor (Gutenberg).
* Version: 2.3.0
* Version: 2.3.1
* Author: ThemeIsle
* Author URI: https://themeisle.com
* License: GPL-3.0+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ class="otter_form_record_meta__value"
$url = esc_url( $field['path'] );
if ( isset( $field['saved_in_media'] ) && $field['saved_in_media'] ) {
$url = wp_get_attachment_url( $field['attachment_id'] );
} elseif ( 0 === strpos( $field['path'], 'http' ) ) {
} elseif ( 0 !== strpos( $field['path'], 'http' ) ) {
// If the file is not saved with a server link (external or media library). We need to get the file path relative to the uploads directory so that it can be displayed by the browser.
$url = substr( $url, strpos( $url, '/wp-content' ) );
}
Expand Down
37 changes: 36 additions & 1 deletion plugins/otter-pro/inc/plugins/class-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function init() {
* @access public
*/
public function maybe_sync_patterns() {
if ( ! get_transient( 'otter_pro_patterns' ) ) {
if ( ! get_transient( 'otter_pro_patterns' ) && ! get_transient( 'otter_pro_patterns_refetch' ) ) {
$this->sync_patterns();
}
}
Expand Down Expand Up @@ -72,9 +72,23 @@ public function sync_patterns() {
$response = json_decode( $response, true );

if ( ! is_array( $response ) || isset( $response['message'] ) || 0 === count( $response ) ) {
if ( ! get_transient( 'otter_pro_patterns_refetch' ) ) {
set_transient( 'otter_pro_patterns_refetch', true, HOUR_IN_SECONDS );
}
return;
}

foreach ( $response as $pattern_block ) {
if ( ! $this->check_pattern_structure( $pattern_block ) ) {

if ( ! get_transient( 'otter_pro_patterns_refetch' ) ) {
set_transient( 'otter_pro_patterns_refetch', true, HOUR_IN_SECONDS );
}

return;
}
}

set_transient( 'otter_pro_patterns', $response, WEEK_IN_SECONDS );
}

Expand All @@ -90,6 +104,12 @@ public function register_patterns() {
return;
}

// Fast check to see if we have some corrupted data.
if ( ! $this->check_pattern_structure( $block_patterns[0] ) ) {
delete_transient( 'otter_pro_patterns' );
return;
}

foreach ( $block_patterns as $block_pattern ) {
if ( ! version_compare( get_bloginfo( 'version' ), $block_pattern['minimum'], '>=' ) ) {
continue;
Expand All @@ -99,6 +119,21 @@ public function register_patterns() {
}
}

/**
* Check if the given pattern block has the correct structure.
*
* @param mixed $pattern_block Pattern block to check.
* @return bool
*/
public function check_pattern_structure( $pattern_block ) {

$valid = isset( $pattern_block['slug'] ) && is_string( $pattern_block['slug'] );
$valid = $valid && isset( $pattern_block['title'] ) && is_string( $pattern_block['title'] );
$valid = $valid && isset( $pattern_block['content'] ) && is_string( $pattern_block['content'] );
$valid = $valid && isset( $pattern_block['categories'] ) && is_array( $pattern_block['categories'] );
return $valid && isset( $pattern_block['minimum'] ) && is_numeric( $pattern_block['minimum'] );
}

/**
* Singleton method.
*
Expand Down
6 changes: 3 additions & 3 deletions plugins/otter-pro/otter-pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Plugin Name: Otter Pro
* Plugin URI: https://themeisle.com/plugins/otter-blocks
* Description: Create beautiful and attracting posts, pages, and landing pages with Otter – Page Builder Blocks & Extensions for Gutenberg. Otter comes with dozens of Gutenberg blocks that are all you need to build beautiful pages.
* Version: 2.3.0
* Version: 2.3.1
* Author: ThemeIsle
* Author URI: https://themeisle.com
* License: GPL-2.0+
Expand All @@ -28,7 +28,7 @@
define( 'OTTER_PRO_PATH', dirname( __FILE__ ) );
define( 'OTTER_PRO_BUILD_URL', plugins_url( '/', __FILE__ ) . 'build/pro/' );
define( 'OTTER_PRO_BUILD_PATH', dirname( __FILE__ ) . '/build/pro/' );
define( 'OTTER_PRO_VERSION', '2.3.0' );
define( 'OTTER_PRO_VERSION', '2.3.1' );

require_once dirname( __FILE__ ) . '/autoloader.php';
$autoloader = new \ThemeIsle\OtterPro\Autoloader();
Expand All @@ -54,7 +54,7 @@ function () {
add_filter(
'otter_pro_lc_no_valid_string',
function ( $message ) {
return str_replace( '<a href="%s">', '<a href="' . admin_url( 'options-general.php?page=otter' ) . '">', $message );
return str_replace( '<a href="%s">', '<a href="' . admin_url( 'admin.php?page=otter' ) . '">', $message );
}
);

Expand Down
17 changes: 17 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,23 @@ The Patterns have been designed to make it easier for you to build your site usi

## Changelog ##

##### [Version 2.3.1](https://github.com/Codeinwp/otter-blocks/compare/v2.3.0...v2.3.1) (2023-06-20)

- Added Option to Allow Block Tools to Be Enabled by Default
- Improvements for Social Sharing Block
- Improvements to Posts Block’s Handling of WooCommerce Products
- Fix Dynamic Tags Not Working with Neve Pro Custom Layouts
- Fix Wrong Defaults in Form
- Fix Form Submissions Not Saving to Database If SMTP Fails
- Fix the Option to save Google Fonts Locally Not Working
- Fix Form Option Not Saving
- Fix Illegal String Offset on Minimal Version Check
- Fix the Issue with Otter Menu Pointing to the Old URL
- Fix Form Submission Email Being Used as Post Title of Form Submissions




#### [Version 2.3.0](https://github.com/Codeinwp/otter-blocks/compare/v2.2.7...v2.3.0) (2023-05-25)

- Add Custom Taxonomy Support to Dynamic Values
Expand Down
17 changes: 17 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,23 @@ The Patterns have been designed to make it easier for you to build your site usi

== Changelog ==

##### [Version 2.3.1](https://github.com/Codeinwp/otter-blocks/compare/v2.3.0...v2.3.1) (2023-06-20)

- Added Option to Allow Block Tools to Be Enabled by Default
- Improvements for Social Sharing Block
- Improvements to Posts Block’s Handling of WooCommerce Products
- Fix Dynamic Tags Not Working with Neve Pro Custom Layouts
- Fix Wrong Defaults in Form
- Fix Form Submissions Not Saving to Database If SMTP Fails
- Fix the Option to save Google Fonts Locally Not Working
- Fix Form Option Not Saving
- Fix Illegal String Offset on Minimal Version Check
- Fix the Issue with Otter Menu Pointing to the Old URL
- Fix Form Submission Email Being Used as Post Title of Form Submissions




#### [Version 2.3.0](https://github.com/Codeinwp/otter-blocks/compare/v2.2.7...v2.3.0) (2023-05-25)

- Add Custom Taxonomy Support to Dynamic Values
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/plugins/conditions/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ const AuthorsFieldToken = ( props ) => {
const { getUsers, isResolving } = select( 'core' );

return {
postAuthors: ( getUsers({ who: 'authors', context: 'view' }) ?? []).map( author => author.username ),
postAuthors: ( getUsers({ who: 'authors', context: 'view' }) ?? []).map( author => author.username ?? author.name ).filter( Boolean ),
isLoading: isResolving( 'getUsers', [{ who: 'authors', context: 'view' }])
};
}, []);
Expand Down
7 changes: 4 additions & 3 deletions src/blocks/plugins/options/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ export let NavigatorButton = ({
const Options = () => {
const { isOnboardingVisible, get } = useSelect( select => {
const { isOnboardingVisible } = select( 'themeisle-gutenberg/data' );
const { get } = select( 'core/preferences' );
const get = select( 'core/preferences' )?.get;

return {
isOnboardingVisible: isOnboardingVisible(),
get
isOnboardingVisible: isOnboardingVisible?.(),
get: get
};
}, []);

Expand Down

0 comments on commit a600c56

Please sign in to comment.