Skip to content

Commit

Permalink
Merge pull request #77 from sailthru/IN-1383-Remove_Horizon_Default
Browse files Browse the repository at this point in the history
[IN-1383] Only create "Scout from Sailthru" page when site is Scout-enabled
  • Loading branch information
henrivrod authored Jul 1, 2020
2 parents 91e79e4 + d9b5103 commit 4b644a3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: brownac, lcooper, asilverman, nickgundry, sailthru-wp, automattic,
Tags: personalization, email,
Requires at least: 3.6
Tested up to: 5.4
Stable tag: 3.4.3
Stable tag: 3.4.4

This plugin provides fast and easy integration of the core Sailthru features into your Wordpress site.

Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v3.4.4 (2020-07-01)
Fixed bug where “Scout from Sailthru” page was created for all sites, rather than just Scout-enabled sites.

## v3.4.3 (2020-04-07)
Fixed bug where Sailthru onsite JS would sometimes fail to initialize due to asynchronous loading of scripts

Expand Down
12 changes: 3 additions & 9 deletions classes/class-sailthru-scout.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ function __construct() {
// Register Scout Javascripts.
add_action( 'wp_enqueue_scripts', array( $this, 'register_scout_scripts' ) );

// Attempt to create the page needed for Scout.
$post_id = $this->create_scout_page();

// Load plugin text domain.
add_action( 'init', array( $this, 'load_widget_text_domain' ) );

Expand Down Expand Up @@ -65,7 +62,9 @@ public function register_scout_scripts() {

// Check first, otherwise js could throw errors.
if ( "1" === get_option( 'sailthru_setup_complete' ) ) {


$post_id = $this->create_scout_page();

// If conceirge is on, we want noPageView to be set to true
$conceirge = get_option( 'sailthru_concierge_options' );
/** This filter is documented in class-sailthru-horizon.php */
Expand Down Expand Up @@ -182,11 +181,6 @@ private function escape_filter_tags( $tag ) {
*/
private function create_scout_page() {

// Never run this on public facing pages.
if ( ! is_admin() ) {
return;
}

// -1 = No action has been taken.
$post_id = -1;

Expand Down
4 changes: 2 additions & 2 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Sailthru for WordPress
Plugin URI: http://sailthru.com/
Description: Add the power of Sailthru to your WordPress set up.
Version: 3.4.3
Version: 3.4.4
Author: Sailthru
Author URI: http://sailthru.com
Author Email: [email protected]
Expand Down Expand Up @@ -35,7 +35,7 @@
* @var const $version The current version of the plugin.
*/
if ( ! defined( 'SAILTHRU_PLUGIN_VERSION' ) ) {
define( 'SAILTHRU_PLUGIN_VERSION', '3.4.3' );
define( 'SAILTHRU_PLUGIN_VERSION', '3.4.4' );
}

if ( ! defined( 'SAILTHRU_PLUGIN_PATH' ) ) {
Expand Down
5 changes: 4 additions & 1 deletion views/admin.functions.setup.options.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,14 @@ function sailthru_js_type_callback() {

$html_options = array(
'none' => 'Select',
'horizon_js' => 'Horizon JavaScript',
'personalize_js' => 'Sailthru Script Tag',
'personalize_js_custom' => 'Sailthru Script Tag (custom mode)',
);

if ( $js_type == 'horizon_js' ) {
$html_options['horizon_js'] = 'Horizon (deprecated)';
}

echo '<select id="sailthru_js_type" name="sailthru_setup_options[sailthru_js_type]">';
foreach ( $html_options as $key => $val ) {

Expand Down
1 change: 0 additions & 1 deletion views/widget.scout.admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@


} else {

/*
* If Scout is not on, advise the user
*/
Expand Down

0 comments on commit 4b644a3

Please sign in to comment.