2
0

feat(wp): ️ Force viewer sub domain

This commit is contained in:
Baptiste Arnaud
2022-03-23 09:20:36 +01:00
parent b16c47adb9
commit f9aba27aae
4 changed files with 15 additions and 9 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "wordpress", "name": "wordpress",
"version": "2.1.2", "version": "2.1.3",
"main": "index.js", "main": "index.js",
"repository": "https://github.com/typebot-io/wordpress.git", "repository": "https://github.com/typebot-io/wordpress.git",
"author": "baptisteArno", "author": "baptisteArno",
@ -10,7 +10,7 @@
}, },
"scripts": { "scripts": {
"deploy": "yarn copy && yarn commit", "deploy": "yarn copy && yarn commit",
"copy": "svn copy ./trunk ./tags/2.1.2", "copy": "svn copy ./trunk ./tags/2.1.3",
"commit": "svn ci -m 'Fix shortcode default url'" "commit": "svn ci -m 'Force viewer subdomain'"
} }
} }

View File

@ -5,7 +5,7 @@ Requires at least: 5.0
Tested up to: 5.9.1 Tested up to: 5.9.1
License: GPL 2.0 License: GPL 2.0
License URI: http://www.gnu.org/licenses/gpl-2.0.txt 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 Build beautiful conversational forms

View File

@ -22,7 +22,9 @@ class Typebot_Public
private function parse_popup_head_code() 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 ( if (
get_option('popup_included_pages') !== null && get_option('popup_included_pages') !== null &&
get_option('popup_included_pages') !== '' get_option('popup_included_pages') !== ''
@ -89,7 +91,9 @@ class Typebot_Public
private function parse_bubble_head_code() 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'); $chat_icon = get_option('chat_icon');
if ( if (
get_option('chat_included_pages') !== null && get_option('chat_included_pages') !== null &&
@ -227,7 +231,9 @@ class Typebot_Public
$width = '100%'; $width = '100%';
$height = '500px'; $height = '500px';
$bg_color = 'rgba(255, 255, 255, 0)'; $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 (is_array($attributes)) {
if (array_key_exists('width', $attributes)) { if (array_key_exists('width', $attributes)) {
$width = sanitize_text_field($attributes['width']); $width = sanitize_text_field($attributes['width']);

View File

@ -3,7 +3,7 @@
/** /**
* Plugin Name: Typebot * Plugin Name: Typebot
* Description: Convert more with conversational forms * Description: Convert more with conversational forms
* Version: 2.1.2 * Version: 2.1.3
* Author: Typebot * Author: Typebot
* Author URI: http://typebot.io/ * Author URI: http://typebot.io/
* License: GPL-2.0+ * License: GPL-2.0+
@ -16,7 +16,7 @@ if (!defined('WPINC')) {
die(); die();
} }
define('TYPEBOT_VERSION', '2.1.2'); define('TYPEBOT_VERSION', '2.1.3');
function activate_typebot() function activate_typebot()
{ {