Skip to content

Commit bec0921

Browse files
release: fixes
- Enhanced security
2 parents 14b2e3d + 48d2f1d commit bec0921

File tree

12 files changed

+213
-96
lines changed

12 files changed

+213
-96
lines changed

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inc/class-main.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ public function about_page() {
579579
'location' => 'otter',
580580
'logo' => esc_url_raw( OTTER_BLOCKS_URL . 'assets/images/logo-alt.png' ),
581581
'has_upgrade_menu' => ! DEFINED( 'OTTER_PRO_VERSION' ),
582-
'upgrade_link' => tsdk_utmify( Pro::get_url(), 'editor', Pro::get_reference() ),
582+
'upgrade_link' => tsdk_translate_link( tsdk_utmify( Pro::get_url(), 'editor', Pro::get_reference() ) ),
583583
'upgrade_text' => __( 'Get Otter Pro', 'otter-blocks' ),
584584
);
585585
}

inc/class-pro.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public function render_metabox_upsell( $post_type ) {
250250
<li><?php _e( 'Priority Support', 'otter-blocks' ); ?></li>
251251
</ul>
252252

253-
<a href="<?php echo esc_url_raw( tsdk_utmify( self::get_url(), 'woobuilder', 'wooproducteditor' ) ); ?>" target="_blank" class="button button-primary">
253+
<a href="<?php echo esc_url_raw( tsdk_translate_link( tsdk_utmify( self::get_url(), 'woobuilder', 'wooproducteditor' ) ) ); ?>" target="_blank" class="button button-primary">
254254
<?php _e( 'Discover Otter Pro', 'otter-blocks' ); ?>
255255
</a>
256256
</div>

inc/class-registration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ public function enqueue_block_editor_assets() {
252252
'hasNeve' => defined( 'NEVE_VERSION' ),
253253
'hasPro' => Pro::is_pro_installed(),
254254
'isProActive' => Pro::is_pro_active(),
255-
'upgradeLink' => tsdk_utmify( Pro::get_url(), 'editor', Pro::get_reference() ),
256-
'patternsLink' => tsdk_utmify( Pro::get_patterns_url(), 'editor', Pro::get_reference() ),
255+
'upgradeLink' => tsdk_translate_link( tsdk_utmify( Pro::get_url(), 'editor', Pro::get_reference() ) ),
256+
'patternsLink' => tsdk_translate_link( tsdk_utmify( Pro::get_patterns_url(), 'editor', Pro::get_reference() ) ),
257257
'should_show_upsell' => Pro::should_show_upsell(),
258258
'assetsPath' => OTTER_BLOCKS_URL . 'assets',
259259
'updatePath' => admin_url( 'update-core.php' ),

inc/plugins/class-dashboard.php

Lines changed: 67 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function form_submissions_callback() {
179179
<img style="max-width: 100%" src="<?php echo esc_url( OTTER_BLOCKS_URL . 'assets/images/form-submissions-upsell.svg' ); ?>" alt="Otter Form Submissions Upsell" />
180180
<h2 style="line-height: 1"><?php esc_html_e( 'Collect Your Form Submissions', 'otter-blocks' ); ?></h2>
181181
<p><?php esc_html_e( 'Store, manage and analyze your form submissions with ease – all in one place. With Otter powerful features, managing submissions has never been simpler.', 'otter-blocks' ); ?></p>
182-
<a href="<?php echo esc_url( tsdk_utmify( 'https://themeisle.com/plugins/otter-blocks/upgrade/', 'form-submissions', 'admin' ) ); ?>" class="button button-primary" target="_blank"><?php esc_html_e( 'Explore Otter PRO', 'otter-blocks' ); ?></a>
182+
<a href="<?php echo esc_url( tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/plugins/otter-blocks/upgrade/', 'form-submissions', 'admin' ) ) ); ?>" class="button button-primary" target="_blank"><?php esc_html_e( 'Explore Otter PRO', 'otter-blocks' ); ?></a>
183183
</div>
184184
</div>
185185
<?php
@@ -192,9 +192,7 @@ public function form_submissions_callback() {
192192
* @access public
193193
*/
194194
public function enqueue_options_assets() {
195-
$wp_upload_dir = wp_upload_dir( null, false );
196-
$basedir = $wp_upload_dir['basedir'] . '/themeisle-gutenberg/';
197-
$asset_file = include OTTER_BLOCKS_PATH . '/build/dashboard/index.asset.php';
195+
$asset_file = include OTTER_BLOCKS_PATH . '/build/dashboard/index.asset.php';
198196

199197
wp_enqueue_style(
200198
'otter-blocks-styles',
@@ -213,55 +211,67 @@ public function enqueue_options_assets() {
213211

214212
wp_set_script_translations( 'otter-blocks-scripts', 'otter-blocks' );
215213

216-
$offer = new LimitedOffers();
217-
218214
wp_localize_script(
219215
'otter-blocks-scripts',
220216
'otterObj',
221-
apply_filters(
222-
'otter_dashboard_data',
223-
array(
224-
'version' => OTTER_BLOCKS_VERSION,
225-
'assetsPath' => OTTER_BLOCKS_URL . 'assets/',
226-
'stylesExist' => is_dir( $basedir ) || boolval( get_transient( 'otter_animations_parsed' ) ),
227-
'hasPro' => Pro::is_pro_installed(),
228-
'upgradeLink' => tsdk_utmify( Pro::get_url(), 'options', Pro::get_reference() ),
229-
'docsLink' => Pro::get_docs_url(),
230-
'showFeedbackNotice' => $this->should_show_feedback_notice(),
231-
'deal' => ! Pro::is_pro_installed() ? $offer->get_localized_data() : array(),
232-
'hasOnboarding' => false !== get_theme_support( FSE_Onboarding::SUPPORT_KEY ),
233-
'days_since_install' => round( ( time() - get_option( 'otter_blocks_install', time() ) ) / DAY_IN_SECONDS ),
234-
'rootUrl' => get_site_url(),
235-
'neveThemePreviewUrl' => esc_url(
236-
add_query_arg(
237-
array(
238-
'theme' => 'neve',
239-
),
240-
admin_url( 'theme-install.php' )
241-
)
217+
$this->get_dashboard_data()
218+
);
219+
220+
$this->load_survey();
221+
}
222+
223+
/**
224+
* Get the dashboard data to store in global object.
225+
*
226+
* @return array
227+
*/
228+
public function get_dashboard_data() {
229+
$wp_upload_dir = wp_upload_dir( null, false );
230+
$basedir = $wp_upload_dir['basedir'] . '/themeisle-gutenberg/';
231+
$offer = new LimitedOffers();
232+
233+
$global_data = array(
234+
'version' => OTTER_BLOCKS_VERSION,
235+
'assetsPath' => OTTER_BLOCKS_URL . 'assets/',
236+
'stylesExist' => is_dir( $basedir ) || boolval( get_transient( 'otter_animations_parsed' ) ),
237+
'hasPro' => Pro::is_pro_installed(),
238+
'upgradeLink' => tsdk_translate_link( tsdk_utmify( Pro::get_url(), 'options', Pro::get_reference() ) ),
239+
'docsLink' => Pro::get_docs_url(),
240+
'showFeedbackNotice' => $this->should_show_feedback_notice(),
241+
'deal' => ! Pro::is_pro_installed() ? $offer->get_localized_data() : array(),
242+
'hasOnboarding' => false !== get_theme_support( FSE_Onboarding::SUPPORT_KEY ),
243+
'days_since_install' => (int) round( ( time() - get_option( 'otter_blocks_install', time() ) ) / DAY_IN_SECONDS ),
244+
'rootUrl' => get_site_url(),
245+
'neveThemePreviewUrl' => esc_url(
246+
add_query_arg(
247+
array(
248+
'theme' => 'neve',
242249
),
243-
'neveThemeActivationUrl' => esc_url(
244-
add_query_arg(
245-
array(
246-
'action' => 'activate',
247-
'stylesheet' => 'neve',
248-
'_wpnonce' => wp_create_nonce( 'switch-theme_neve' ),
249-
),
250-
admin_url( 'themes.php' )
251-
)
250+
admin_url( 'theme-install.php' )
251+
)
252+
),
253+
'neveThemeActivationUrl' => esc_url(
254+
add_query_arg(
255+
array(
256+
'action' => 'activate',
257+
'stylesheet' => 'neve',
258+
'_wpnonce' => wp_create_nonce( 'switch-theme_neve' ),
252259
),
253-
'neveDashboardUrl' => esc_url(
254-
add_query_arg(
255-
array(
256-
'page' => 'neve-welcome',
257-
),
258-
admin_url( 'admin.php' )
259-
)
260+
admin_url( 'themes.php' )
261+
)
262+
),
263+
'neveDashboardUrl' => esc_url(
264+
add_query_arg(
265+
array(
266+
'page' => 'neve-welcome',
260267
),
261-
'neveInstalled' => defined( 'NEVE_VERSION' ),
268+
admin_url( 'admin.php' )
262269
)
263-
)
270+
),
271+
'neveInstalled' => defined( 'NEVE_VERSION' ),
264272
);
273+
274+
return apply_filters( 'otter_dashboard_data', $global_data );
265275
}
266276

267277
/**
@@ -720,6 +730,18 @@ public function form_submissions_widget_content() {
720730
<?php
721731
}
722732

733+
/**
734+
* Load the Formbricks deps from SDK to initiate the survey.
735+
*/
736+
private function load_survey() {
737+
$survey_handler = apply_filters( 'themeisle_sdk_dependency_script_handler', 'survey' );
738+
if ( empty( $survey_handler ) ) {
739+
return;
740+
}
741+
742+
do_action( 'themeisle_sdk_dependency_enqueue_script', 'survey' );
743+
}
744+
723745
/**
724746
* The instance method for the static class.
725747
* Defines and returns the instance of the static class.

inc/server/class-dynamic-content-server.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ public function get( $request ) {
167167

168168
$fallback = sanitize_text_field( $fallback );
169169
$feedback_full_path = realpath( $fallback );
170+
$feedback_full_path = str_contains( $feedback_full_path, WP_CONTENT_DIR );
170171

171172
if ( false !== $feedback_full_path && @getimagesize( $fallback ) ) { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
172173
$path = $feedback_full_path;

otter-blocks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function() {
5656
'is_enabled' => ! defined( 'OTTER_PRO_VERSION' ),
5757
'pro_name' => __( 'Otter Blocks Pro', 'otter-blocks' ),
5858
'logo' => OTTER_BLOCKS_URL . '/assets/images/logo-alt.png',
59-
'cta_link' => tsdk_utmify( 'https://themeisle.com/plugins/otter-blocks/upgrade/?discount=LOYALUSER583&dvalue=60#pricing', 'otter-welcome', 'notice' ),
59+
'cta_link' => tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/plugins/otter-blocks/upgrade/?discount=LOYALUSER583&dvalue=60#pricing', 'otter-welcome', 'notice' ) ),
6060
];
6161
}
6262
);

package-lock.json

Lines changed: 14 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"lasttranslator": "Themeisle Translate Team <[email protected]>"
6565
},
6666
"dependencies": {
67-
"@formbricks/js": "^2.2.0",
6867
"@wordpress/icons": "^9.46.0",
6968
"array-move": "^3.0.1",
7069
"classnames": "^2.5.1",
@@ -80,7 +79,7 @@
8079
},
8180
"devDependencies": {
8281
"@automattic/babel-plugin-replace-textdomain": "^1.0.35",
83-
"@playwright/test": "^1.48.1",
82+
"@playwright/test": "^1.48.2",
8483
"@semantic-release/changelog": "^6.0.3",
8584
"@semantic-release/exec": "^6.0.3",
8685
"@semantic-release/git": "^10.0.1",

plugins/otter-pro/otter-pro.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ function ( $message ) {
5959
);
6060

6161
add_filter( 'otter_pro_hide_license_field', '__return_true' );
62+
add_filter( 'themeisle_sdk_ran_promos', '__return_false' );
6263

6364
if ( ! defined( 'OTTER_BLOCKS_VERSION' ) ) {
6465
add_action(

0 commit comments

Comments
 (0)