Skip to content

Commit

Permalink
Merge branch 'release/1.4.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornharvold committed Feb 21, 2024
2 parents fc5a19e + 8222e95 commit b9fd4f0
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: MB-Jan, bjornharvold
Tags: wink2travel, travel, hotel, booking, affiliate network
Requires at least: 4.7
Tested up to: 6.4
Stable tag: 1.4.6
Version: 1.4.6
Stable tag: 1.4.7
Version: 1.4.7
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down
2 changes: 1 addition & 1 deletion includes/elements/elementor/winkaccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function _register_controls() {
protected function render() {

$settings = $this->get_settings_for_display();
echo wp_kses(do_shortcode('[winkaccount]'));
echo do_shortcode('[winkaccount]');

}
}
2 changes: 1 addition & 1 deletion includes/elements/elementor/winkcontent.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function _register_controls() {
}
protected function render() {
$settings = $this->get_settings_for_display();
echo wp_kses(do_shortcode('[winkcontent layoutid="'.esc_html($settings['layoutid']).'"]'));
echo do_shortcode('[winkcontent layoutid="'.esc_html($settings['layoutid']).'"]');

}
}
2 changes: 1 addition & 1 deletion includes/elements/elementor/winkitinerary.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function _register_controls() {
protected function render() {

$settings = $this->get_settings_for_display();
echo wp_kses(do_shortcode('[winkitinerary]'));
echo do_shortcode('[winkitinerary]');

}
}
2 changes: 1 addition & 1 deletion includes/elements/elementor/winkitineraryform.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function _register_controls() {
protected function render() {

$settings = $this->get_settings_for_display();
echo wp_kses(do_shortcode('[winkitineraryform]'));
echo do_shortcode('[winkitineraryform]');

}
}
2 changes: 1 addition & 1 deletion includes/elements/elementor/winklookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function _register_controls() {
protected function render() {

$settings = $this->get_settings_for_display();
echo wp_kses(do_shortcode('[winklookup]'));
echo do_shortcode('[winklookup]');

}
}
2 changes: 1 addition & 1 deletion includes/elements/elementor/winksearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function _register_controls() {
protected function render() {

$settings = $this->get_settings_for_display();
echo wp_kses(do_shortcode('[winksearch]'));
echo do_shortcode('[winksearch]');

}
}
46 changes: 42 additions & 4 deletions wink.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Wink Affiliate WordPress Plugin
* Description: This plugin integrates your Wink affiliate account with WordPress. It integrates with Gutenberg, Elementor, Avada, WPBakery and as shortcodes.
* Version: 1.4.6
* Version: 1.4.7
* Author: Wink
* Author URI: https://wink.travel/
* License: GPL-3.0
Expand Down Expand Up @@ -31,8 +31,8 @@ function __construct() {
$this->clientSecretKey = 'winkSecret';
$this->environment = 'winkEnvironment';
$this->environmentVal = get_option($this->environment, 'production');
$this->pluginURL = wp_kses(trailingslashit( plugin_dir_url( __FILE__ ) ) );
$this->settingsURL = wp_kses(admin_url( '/customize.php?autofocus[section]='.$this->section));
$this->pluginURL = esc_url(trailingslashit( plugin_dir_url( __FILE__ ) ) );
$this->settingsURL = esc_url(admin_url( '/customize.php?autofocus[section]='.$this->section));
add_action( 'customize_register', array( $this,'addSettings' ) ); // adding plugin settings to WP Customizer
add_action('admin_notices', array( $this,'adminNotice' ) ); // adding admin notice if client id has not been entered
//add_shortcode('wink', array( $this,'blockHandler' ) ); // Adding Shortcode
Expand Down Expand Up @@ -243,7 +243,45 @@ function winkRenderSilentRefresh( $atts ){
header('Content-type: text/html');
//$dir = plugin_dir_path( __FILE__ );
if (file_exists(dirname(realpath(__FILE__)).'/includes/silent-refresh.html')) {
echo wp_kses(file_get_contents(dirname(realpath(__FILE__)).'/includes/silent-refresh.html'));
echo "<html>
<body>
<script>
var checks = [
/[\?|&|#]code=/,
/[\?|&|#]error=/,
/[\?|&|#]token=/,
/[\?|&|#]id_token=/
];
function isResponse(str) {
if (!str) return false;
for (var i = 0; i < checks.length; i++) {
if (str.match(checks[i])) return true;
}
return false;
}
var message = isResponse(location.hash)
? location.hash
: '#' + location.search;
// console.log('message', message);
if (window.parent && window.parent !== window) {
// if loaded as an iframe during silent refresh
window.parent.postMessage(message, location.origin);
} else if (window.opener && window.opener !== window) {
// if loaded as a popup during initial login
window.opener.postMessage(message, location.origin);
} else {
// last resort for a popup which has been through redirects and can't use window.opener
localStorage.setItem('auth_hash', message);
localStorage.removeItem('auth_hash');
}
</script>
</body>
</html>";
}
die();
}
Expand Down

0 comments on commit b9fd4f0

Please sign in to comment.