PluginProbe
Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder / 3.6.0
Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder v3.6.0
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 / includes / managers / class-fs-contact-form-manager.php

class-fs-contact-form-manager.php in Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder 3.6.0, at freemius/includes/managers/class-fs-contact-form-manager.php

84 lines 2.1 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) 2024, Freemius, Inc.
5 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6 * @since 2.9.0
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 class FS_Contact_Form_Manager {
14
15 # region Singleton
16
17 /**
18 * @var FS_Contact_Form_Manager
19 */
20 private static $_instance;
21
22 /**
23 * @return FS_Contact_Form_Manager
24 */
25 static function instance() {
26 if ( ! isset( self::$_instance ) ) {
27 self::$_instance = new FS_Contact_Form_Manager();
28 }
29
30 return self::$_instance;
31 }
32
33 private function __construct() {
34 }
35
36 #endregion
37
38 /**
39 * Retrieves the query params needed to load the Freemius Contact Form in the context of the plugin.
40 *
41 * @param Freemius $fs
42 *
43 * @return array<string, string>
44 */
45 public function get_query_params( Freemius $fs ) {
46 $context_params = array(
47 'plugin_id' => $fs->get_id(),
48 'plugin_public_key' => $fs->get_public_key(),
49 'plugin_version' => $fs->get_plugin_version(),
50 );
51
52 // Get site context secure params.
53 if ( $fs->is_registered() ) {
54 $context_params = array_merge( $context_params, FS_Security::instance()->get_context_params(
55 $fs->get_site(),
56 time(),
57 'contact'
58 ) );
59 }
60
61 return array_merge( $_GET, array_merge( $context_params, array(
62 'plugin_version' => $fs->get_plugin_version(),
63 'wp_login_url' => wp_login_url(),
64 'site_url' => Freemius::get_unfiltered_site_url(),
65 // 'wp_admin_css' => get_bloginfo('wpurl') . "/wp-admin/load-styles.php?c=1&load=buttons,wp-admin,dashicons",
66 ) ) );
67 }
68
69 /**
70 * Retrieves the standalone link to the Freemius Contact Form.
71 *
72 * @param Freemius $fs
73 *
74 * @return string
75 */
76 public function get_standalone_link( Freemius $fs ) {
77 $query_params = $this->get_query_params( $fs );
78
79 $query_params['is_standalone'] = 'true';
80 $query_params['parent_url'] = admin_url( add_query_arg( null, null ) );
81
82 return WP_FS__ADDRESS . '/contact/?' . http_build_query( $query_params );
83 }
84 }