PluginProbe
Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder / 1.4.3
Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder v1.4.3
3.6.0 3.5.0 trunk 1.0.10 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.6.1 1.0.7 1.0.8 1.0.9 1.1 1.1.1 1.2 1.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.5 1.5.1 All 110 releases
buttonizer-multifunctional-button / freemius / templates / contact.php

contact.php in Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder 1.4.3, at freemius/templates/contact.php

124 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Freemius
4 * @copyright Copyright (c) 2015, Freemius, Inc.
5 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6 * @since 1.0.3
7 */
8
9 /**
10 * Note for WordPress.org Theme/Plugin reviewer:
11 * Freemius is an SDK for plugin and theme developers. Since the core
12 * of the SDK is relevant both for plugins and themes, for obvious reasons,
13 * we only develop and maintain one code base.
14 *
15 * This code (and page) will not run for wp.org themes (only plugins).
16 *
17 * In addition, this page loads an i-frame. We intentionally named it 'frame'
18 * so it will pass the "Theme Check" that is looking for the string "i" . "frame".
19 *
20 * UPDATE:
21 * After ongoing conversations with the WordPress.org TRT we received
22 * an official approval for including i-frames in the theme's WP Admin setting's
23 * page tab (the SDK will never add any i-frames on the sitefront). i-frames
24 * were never against the guidelines, but we wanted to get the team's blessings
25 * before we move forward. For the record, I got the final approval from
26 * Ulrich Pogson (@grapplerulrich), a team lead at the TRT during WordCamp
27 * Europe 2017 (June 16th, 2017).
28 *
29 * If you have any questions or need clarifications, please don't hesitate
30 * pinging me on slack, my username is @svovaf.
31 *
32 * @author Vova Feldman (@svovaf)
33 * @since 1.2.2
34 */
35
36 if ( ! defined( 'ABSPATH' ) ) {
37 exit;
38 }
39
40 wp_enqueue_script( 'jquery' );
41 wp_enqueue_script( 'json2' );
42 fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.min.js' );
43 fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
44 fs_enqueue_local_style( 'fs_checkout', '/admin/common.css' );
45
46 $fs = freemius( $VARS['id'] );
47 $slug = $fs->get_slug();
48
49 $context_params = array(
50 'plugin_id' => $fs->get_id(),
51 'plugin_public_key' => $fs->get_public_key(),
52 'plugin_version' => $fs->get_plugin_version(),
53 );
54
55
56 // Get site context secure params.
57 if ( $fs->is_registered() ) {
58 $context_params = array_merge( $context_params, FS_Security::instance()->get_context_params(
59 $fs->get_site(),
60 time(),
61 'contact'
62 ) );
63 }
64
65 $query_params = array_merge( $_GET, array_merge( $context_params, array(
66 'plugin_version' => $fs->get_plugin_version(),
67 'wp_login_url' => wp_login_url(),
68 'site_url' => get_site_url(),
69 // 'wp_admin_css' => get_bloginfo('wpurl') . "/wp-admin/load-styles.php?c=1&load=buttons,wp-admin,dashicons",
70 ) ) );
71
72 $view_params = array(
73 'id' => $VARS['id'],
74 'page' => strtolower( $fs->get_text_inline( 'Contact', 'contact' ) ),
75 );
76 fs_require_once_template('secure-https-header.php', $view_params);
77
78 $has_tabs = $fs->_add_tabs_before_content();
79
80 if ( $has_tabs ) {
81 $query_params['tabs'] = 'true';
82 }
83 ?>
84 <div id="fs_contact" class="wrap fs-section fs-full-size-wrapper">
85 <div id="frame"></div>
86 <script type="text/javascript">
87 (function ($) {
88 $(function () {
89
90 var
91 // Keep track of the i-frame height.
92 frame_height = 800,
93 base_url = '<?php echo WP_FS__ADDRESS ?>',
94 src = base_url + '/contact/?<?php echo http_build_query($query_params) ?>#' + encodeURIComponent(document.location.href),
95
96 // Append the i-frame into the DOM.
97 frame = $('<i' + 'frame " src="' + src + '" width="100%" height="' + frame_height + 'px" scrolling="no" frameborder="0" style="background: transparent;"><\/i' + 'frame>')
98 .appendTo('#frame');
99
100 FS.PostMessage.init(base_url);
101 FS.PostMessage.receive('height', function (data) {
102 var h = data.height;
103 if (!isNaN(h) && h > 0 && h != frame_height) {
104 frame_height = h;
105 $('#frame i' + 'frame').height(frame_height + 'px');
106 }
107 });
108 });
109 })(jQuery);
110 </script>
111 </div>
112 <?php
113 if ( $has_tabs ) {
114 $fs->_add_tabs_after_content();
115 }
116
117 $params = array(
118 'page' => 'contact',
119 'module_id' => $fs->get_id(),
120 'module_type' => $fs->get_module_type(),
121 'module_slug' => $slug,
122 'module_version' => $fs->get_plugin_version(),
123 );
124 fs_require_template( 'powered-by.php', $params );