Skip to content

Commit

Permalink
build(wp): 🏗️ Add wordpress plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Feb 25, 2022
1 parent 64990fc commit 27bff8c
Show file tree
Hide file tree
Showing 24 changed files with 1,337 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ test-results
.docusaurus
.cache-loader
build

# Wordpress
.svn
tags
11 changes: 11 additions & 0 deletions packages/wordpress/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# [Typebot](https://www.typebot.io "Typebot")

![WordPress version](https://img.shields.io/wordpress/plugin/v/typebot.svg) ![WordPress Rating](https://img.shields.io/wordpress/plugin/r/typebot.svg) ![WordPress Downloads](https://img.shields.io/wordpress/plugin/dt/typebot.svg)

Welcome to the Typebot WordPress Plugin GitHub repository. This is the code source and the center of active development. Here you can browse the source, look at open issues, and contribute to the project.

The project is still a mess. I'd like to make it fully automatic (with GitHub workflows). It would be great to have a repo similar to [this one](https://github.com/plausible/wordpress)

## Getting Started

// TO-DO
Binary file added packages/wordpress/assets/banner-1544x500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/wordpress/assets/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions packages/wordpress/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "wordpress",
"version": "2.0.0",
"main": "index.js",
"repository": "https://github.com/typebot-io/wordpress.git",
"author": "Baptiste Arnaud <contact@baptiste-arnaud.fr>",
"license": "MIT",
"devDependencies": {
"@prettier/plugin-php": "^0.17.3"
},
"scripts": {
"deploy": "yarn copy && yarn commit",
"copy": "svn copy ./trunk ./tags/2.0.0",
"commit": "svn ci -m 'Support Typebot 2.0'"
}
}
339 changes: 339 additions & 0 deletions packages/wordpress/trunk/LICENSE.txt

Large diffs are not rendered by default.

90 changes: 90 additions & 0 deletions packages/wordpress/trunk/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
=== Typebot | Build beautiful conversational forms ===
Contributors: baptisteArno
Tags: typebot, forms, surveys, quizzes, form builder, survey builder, quiz builder, custom forms, mobile forms, payment forms, order forms, feedback forms, enquiry forms, stripe, dropbox, google sheets, mailchimp, salesforce, hubspot, activecampaign, infusionsoft, asana, hipchat, slack, trello, zendesk
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.0.0

Build beautiful conversational forms

== Description ==
Collect 4x more responses with your conversational forms using Typebot.

👉 Build beautiful conversational forms and embed them directly in your applications without a line of code.
👉 Typebot helps you publish forms that feel native to your product and it provides the best experience for your users.
👉 With Typebot, you collect the answer as soon as the user answers the first question. You get to know exactly when the user tends to drop your form.

This plugin relies on Typebot which is a tool that allows you to create conversational forms and directly integrate them on your Wordpress site.
💁‍♂️ More information about Typebot: https://www.typebot.io/
👨🏼‍💻 How Typebot handles collected data: https://www.typebot.io/privacy-policies

== Installation ==
1. Add the plugin folder to the /wp-content/plugins/ directory
2. Activate the plugin through the ‘Plugins’ menu in WordPress
3. Activate your Typebot with the "Typebot" admin button located in the sidebar

== Changelog ==
= 2.0.0 =
* Support for Typebot 2.0

= 1.4.8 =
* Fix shortcodes

= 1.4.7 =
* Fix minor bug

= 1.4.6 =
* Fix loading bug

= 1.4.5 =
* Remove external dependencies

= 1.4.4 =
* Improve input sanitizing and make the plugin more secure.

= 1.4.3 =
* Fix XSS risk in admin panel

= 1.4.2 =
* Fix styles bug in admin panels. Fix minor security issues.

= 1.4.1 =
* Make the library more reliable

= 1.4.0 =
* Introduce new typebot lib and give access to open / close commands for popups and bubbles

= 1.3.3 =
* Add `url` option to shortcodes in order to add multiple typebots on the same page.

= 1.3.0 =
* Adding wordpress user variables support. More info here: http://docs.typebot.io/embed/wordpress#personalize-user-experience-hidden-variables

= 1.2.3 =
* Add "Don't show message when opened or closed once" option

= 1.2.2 =
* Fix delete user bug.

= 1.2.1 =
* Can set publish or full URL (for custom domains).

= 1.2.0 =
* Add advanced setup where you can paste the code from Typebot.

= 1.1.2 =
* Bug fixes

= 1.1.1 =
* Add chat button icon customization

= 1.1.0 =
* Add path to include for chat and bubble to only display them on specific path patterns

= 1.0.1 =
* Transparency by default for the Standard embed with a shortcode

= 1.0.0 =
* Init new plugin 🥰
88 changes: 88 additions & 0 deletions packages/wordpress/trunk/admin/class-typebot-admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?php
if (!defined("ABSPATH")) {
exit();
}

class Typebot_Admin
{
private $version;

public function __construct($version)
{
$this->version = $version;
}

public function enqueue_styles($hook)
{
if ($hook === "toplevel_page_typebot/settings") {
wp_enqueue_style(
"bulma",
plugin_dir_url(__FILE__) . "css/bulma.min.css",
[],
$this->version,
"all"
);
}
}

public function my_admin_menu()
{
add_menu_page(
"Typebot Settings",
"Typebot",
"manage_options",
"typebot/settings.php",
[$this, "typebot_settings_callback"],
"dashicons-format-chat",
250
);
}

public function typebot_settings_callback()
{
require_once "partials/typebot-admin-display.php";
}

public function register_typebot_settings()
{
register_setting("typebot", "publish_id", [
"sanitize_callback" => "sanitize_text_field",
]);
register_setting("typebot", "embed_type", [
"sanitize_callback" => "sanitize_text_field",
]);
register_setting("typebot", "popup_delay", [
"sanitize_callback" => "sanitize_text_field",
]);
register_setting("typebot", "bubble_delay", [
"sanitize_callback" => "sanitize_text_field",
]);
register_setting("typebot", "avatar", [
"sanitize_callback" => "sanitize_text_field",
]);
register_setting("typebot", "text_content", [
"sanitize_callback" => "sanitize_text_field",
]);
register_setting("typebot", "button_color", [
"sanitize_callback" => "sanitize_text_field",
]);
register_setting("typebot", "chat_included_pages", [
"sanitize_callback" => "sanitize_text_field",
]);
register_setting("typebot", "popup_included_pages", [
"sanitize_callback" => "sanitize_text_field",
]);
register_setting("typebot", "chat_icon", [
"sanitize_callback" => "sanitize_text_field",
]);
register_setting("typebot", "custom_code", [
"sanitize_callback" => "sanitize_text_field",
]);
register_setting("typebot", "config_type", [
"sanitize_callback" => "sanitize_text_field",
]);
register_setting("typebot", "dont_show_callout_twice", [
"sanitize_callback" => "sanitize_text_field",
]);
}
}
1 change: 1 addition & 0 deletions packages/wordpress/trunk/admin/css/bulma.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/wordpress/trunk/admin/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php // Silence is golden
Loading

2 comments on commit 27bff8c

@vercel
Copy link

@vercel vercel bot commented on 27bff8c Feb 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 27bff8c Feb 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.