diff --git a/packages/wordpress/package.json b/packages/wordpress/package.json index abc280ae5..b20170665 100644 --- a/packages/wordpress/package.json +++ b/packages/wordpress/package.json @@ -1,6 +1,6 @@ { "name": "wordpress", - "version": "2.1.2", + "version": "2.1.3", "main": "index.js", "repository": "https://github.com/typebot-io/wordpress.git", "author": "baptisteArno", @@ -10,7 +10,7 @@ }, "scripts": { "deploy": "yarn copy && yarn commit", - "copy": "svn copy ./trunk ./tags/2.1.2", - "commit": "svn ci -m 'Fix shortcode default url'" + "copy": "svn copy ./trunk ./tags/2.1.3", + "commit": "svn ci -m 'Force viewer subdomain'" } } diff --git a/packages/wordpress/trunk/README.txt b/packages/wordpress/trunk/README.txt index 16cfe36dc..44e2d6979 100644 --- a/packages/wordpress/trunk/README.txt +++ b/packages/wordpress/trunk/README.txt @@ -5,7 +5,7 @@ Requires at least: 5.0 Tested up to: 5.9.1 License: GPL 2.0 License URI: http://www.gnu.org/licenses/gpl-2.0.txt -Stable Tag: 2.1.2 +Stable Tag: 2.1.3 Build beautiful conversational forms diff --git a/packages/wordpress/trunk/public/class-typebot-public.php b/packages/wordpress/trunk/public/class-typebot-public.php index 6dcf4acd6..34d5e4ca8 100644 --- a/packages/wordpress/trunk/public/class-typebot-public.php +++ b/packages/wordpress/trunk/public/class-typebot-public.php @@ -22,7 +22,9 @@ class Typebot_Public private function parse_popup_head_code() { - $url = get_option('url'); + $url = str_starts_with(get_option('url'), 'https://typebot.io') + ? 'https://viewer.typebot.io' . '/' . explode('/', get_option('url'))[3] + : get_option('url'); if ( get_option('popup_included_pages') !== null && get_option('popup_included_pages') !== '' @@ -89,7 +91,9 @@ class Typebot_Public private function parse_bubble_head_code() { - $url = get_option('url'); + $url = str_starts_with(get_option('url'), 'https://typebot.io') + ? 'https://viewer.typebot.io' . '/' . explode('/', get_option('url'))[3] + : get_option('url'); $chat_icon = get_option('chat_icon'); if ( get_option('chat_included_pages') !== null && @@ -227,7 +231,9 @@ class Typebot_Public $width = '100%'; $height = '500px'; $bg_color = 'rgba(255, 255, 255, 0)'; - $url = get_option('url'); + $url = str_starts_with(get_option('url'), 'https://typebot.io') + ? 'https://viewer.typebot.io' . '/' . explode('/', get_option('url'))[3] + : get_option('url'); if (is_array($attributes)) { if (array_key_exists('width', $attributes)) { $width = sanitize_text_field($attributes['width']); diff --git a/packages/wordpress/trunk/typebot.php b/packages/wordpress/trunk/typebot.php index b00281865..41813a15d 100644 --- a/packages/wordpress/trunk/typebot.php +++ b/packages/wordpress/trunk/typebot.php @@ -3,7 +3,7 @@ /** * Plugin Name: Typebot * Description: Convert more with conversational forms - * Version: 2.1.2 + * Version: 2.1.3 * Author: Typebot * Author URI: http://typebot.io/ * License: GPL-2.0+ @@ -16,7 +16,7 @@ if (!defined('WPINC')) { die(); } -define('TYPEBOT_VERSION', '2.1.2'); +define('TYPEBOT_VERSION', '2.1.3'); function activate_typebot() {