PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.3.2
Adminify – White Label, Admin Menu Editor, Login Customizer v4.3.2
4.3.2 4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 All 165 releases
adminify / Libs / freemius / includes / managers / class-fs-contact-form-manager.php

class-fs-contact-form-manager.php in Adminify – White Label, Admin Menu Editor, Login Customizer 4.3.2, at Libs/freemius/includes/managers/class-fs-contact-form-manager.php

86 lines 2.2 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 // Intentionally using add_query_arg( '', '' ) to preserve the legacy behavior of resolving the current admin URL.
81 $query_params['parent_url'] = admin_url( add_query_arg( '', '' ) );
82
83 return WP_FS__ADDRESS . '/contact/?' . http_build_query( $query_params );
84 }
85 }
86