PluginProbe
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI / 8.0.2
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI v8.0.2
8.0.3 8.0.1 8.0.2 8.0.0 7.9.9.7 7.9.9.6 7.9.9.5 7.9.9.4 7.9.9.3 7.9.9.2 7.9.9.1 7.9.9 7.9.8 7.9.7 7.9.6 7.9.5 7.9.4 7.9.3 7.9.2 7.9.1 7.9.0 7.8.9 7.8.8 7.8.7 7.8.6 All 45 releases
gamipress / integrations / fluent-support / fluent-support.php

fluent-support.php in GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI 8.0.2, at integrations/fluent-support/fluent-support.php

132 lines 3.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: GamiPress - Fluent Support integration
4 * Plugin URI: https://wordpress.org/plugins/gamipress-fluent-support-integration/
5 * Description: Connect GamiPress with Fluent Support.
6 * Version: 1.0.0
7 * Author: GamiPress
8 * Author URI: https://gamipress.com/
9 * Text Domain: gamipress-fluent-support-integration
10 * Domain Path: /languages/
11 * Requires at least: 4.4
12 * Tested up to: 6.2
13 * License: GNU AGPL v3.0 (http://www.gnu.org/licenses/agpl.txt)
14 *
15 * @package GamiPress\Fluent_Support
16 * @author GamiPress
17 * @copyright Copyright (c) GamiPress
18 */
19
20 final class GamiPress_Integration_Fluent_Support {
21
22 /**
23 * @var GamiPress_Integration_Fluent_Support $instance The one true GamiPress_Integration_Fluent_Support
24 * @since 1.0.0
25 */
26 private static $instance;
27
28 /**
29 * Get active instance
30 *
31 * @access public
32 * @since 1.0.0
33 * @return GamiPress_Integration_Fluent_Support self::$instance The one true GamiPress_Integration_Fluent_Support
34 */
35 public static function instance() {
36 if( !self::$instance ) {
37 self::$instance = new GamiPress_Integration_Fluent_Support();
38 self::$instance->constants();
39 self::$instance->includes();
40 self::$instance->hooks();
41
42 }
43
44 return self::$instance;
45 }
46
47 /**
48 * Setup plugin constants
49 *
50 * @access private
51 * @since 1.0.0
52 * @return void
53 */
54 private function constants() {
55 // Plugin version
56 define( 'GAMIPRESS_FLUENT_SUPPORT_VER', '1.0.0' );
57
58 // Plugin path
59 define( 'GAMIPRESS_FLUENT_SUPPORT_DIR', plugin_dir_path( __FILE__ ) );
60
61 // Plugin URL
62 define( 'GAMIPRESS_FLUENT_SUPPORT_URL', plugin_dir_url( __FILE__ ) );
63 }
64
65 /**
66 * Include plugin files
67 *
68 * @access private
69 * @since 1.0.0
70 * @return void
71 */
72 private function includes() {
73
74 if( $this->meets_requirements() ) {
75
76 require_once GAMIPRESS_FLUENT_SUPPORT_DIR . 'includes/listeners.php';
77 require_once GAMIPRESS_FLUENT_SUPPORT_DIR . 'includes/triggers.php';
78
79 }
80 }
81
82 /**
83 * Setup plugin hooks
84 *
85 * @access private
86 * @since 1.0.0
87 * @return void
88 */
89 private function hooks() {
90
91 }
92
93 /**
94 * Check if there are all plugin requirements
95 *
96 * @since 1.0.0
97 *
98 * @return bool True if installation meets all requirements
99 */
100 private function meets_requirements() {
101
102 if ( ! class_exists( 'GamiPress' ) )
103 return false;
104
105 // Requirements on multisite install
106 if( is_multisite() && is_main_site() && function_exists('gamipress_is_network_wide_active') && gamipress_is_network_wide_active() ) {
107 // On main site, need to check if integrated plugin is installed on any sub site to load all configuration files
108 if( gamipress_is_plugin_active_on_network( 'fluent-support/fluent-support.php' ) )
109 return true;
110 }
111
112 if ( ! defined( 'FLUENT_SUPPORT_VERSION' ) )
113 return false;
114
115 return true;
116
117 }
118
119 }
120
121 /**
122 * The main function responsible for returning the one true GamiPress_Integration_Fluent_Support instance to functions everywhere
123 *
124 * @since 1.0.0
125 * @return \GamiPress_Integration_Fluent_Support The one true GamiPress_Integration_Fluent_Support
126 */
127 function GamiPress_Integration_Fluent_Support() {
128 return GamiPress_Integration_Fluent_Support::instance();
129 }
130 add_action( 'gamipress_pre_init', 'GamiPress_Integration_Fluent_Support' );
131
132