PluginProbe
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI / 8.0.5
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI v8.0.5
8.0.5 8.0.4 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 All 47 releases
← All changes | integrations/ultimate-member/ultimate-member.php +176 -0 7.9.2 → 8.0.5 View file →
@@ -1,0 +1,176 @@
1 +<?php
2 +/**
3 + * Plugin Name: GamiPress - Ultimate Member integration
4 + * Plugin URI: https://wordpress.org/plugins/gamipress-ultimate-member-integration/
5 + * Description: Connect GamiPress with Ultimate Member.
6 + * Version: 1.0.8
7 + * Author: GamiPress
8 + * Author URI: https://gamipress.com/
9 + * Text Domain: gamipress-ultimate-member-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\Ultimate_Member
16 + * @author GamiPress
17 + * @copyright Copyright (c) GamiPress
18 + */
19 +
20 +final class GamiPress_Integration_Ultimate_Member {
21 +
22 + /**
23 + * @var GamiPress_Integration_Ultimate_Member $instance The one true GamiPress_Integration_Ultimate_Member
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 object self::$instance The one true GamiPress_Integration_Ultimate_Member
34 + */
35 + public static function instance() {
36 +
37 + if( !self::$instance ) {
38 + self::$instance = new GamiPress_Integration_Ultimate_Member();
39 + self::$instance->constants();
40 + self::$instance->includes();
41 + self::$instance->hooks();
42 +
43 + }
44 +
45 + return self::$instance;
46 +
47 + }
48 +
49 + /**
50 + * Setup plugin constants
51 + *
52 + * @access private
53 + * @since 1.0.0
54 + * @return void
55 + */
56 + private function constants() {
57 +
58 + // Plugin version
59 + define( 'GAMIPRESS_ULTIMATE_MEMBER_VER', '1.0.8' );
60 +
61 + // Plugin path
62 + define( 'GAMIPRESS_ULTIMATE_MEMBER_DIR', plugin_dir_path( __FILE__ ) );
63 +
64 + // Plugin URL
65 + define( 'GAMIPRESS_ULTIMATE_MEMBER_URL', plugin_dir_url( __FILE__ ) );
66 +
67 + }
68 +
69 + /**
70 + * Include plugin files
71 + *
72 + * @access private
73 + * @since 1.0.0
74 + * @return void
75 + */
76 + private function includes() {
77 +
78 + if( $this->meets_requirements() ) {
79 +
80 + require_once GAMIPRESS_ULTIMATE_MEMBER_DIR . 'includes/admin.php';
81 + require_once GAMIPRESS_ULTIMATE_MEMBER_DIR . 'includes/listeners.php';
82 + require_once GAMIPRESS_ULTIMATE_MEMBER_DIR . 'includes/ultimate-member-profile.php';
83 + require_once GAMIPRESS_ULTIMATE_MEMBER_DIR . 'includes/scripts.php';
84 + require_once GAMIPRESS_ULTIMATE_MEMBER_DIR . 'includes/triggers.php';
85 +
86 + }
87 +
88 + }
89 +
90 + /**
91 + * Setup plugin hooks
92 + *
93 + * @access private
94 + * @since 1.0.0
95 + * @return void
96 + */
97 + private function hooks() {
98 +
99 + // Setup our activation and deactivation hooks
100 + register_activation_hook( __FILE__, array( $this, 'activate' ) );
101 + register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) );
102 +
103 +
104 +
105 + }
106 +
107 + /**
108 + * Activation hook for the plugin.
109 + *
110 + * @since 1.0.0
111 + */
112 + public function activate() {
113 +
114 + if( $this->meets_requirements() ) {
115 +
116 + }
117 +
118 + }
119 +
120 + /**
121 + * Deactivation hook for the plugin.
122 + *
123 + * @since 1.0.0
124 + */
125 + public function deactivate() {
126 +
127 + }
128 +
129 + /**
130 + * Check if there are all plugin requirements
131 + *
132 + * @since 1.0.0
133 + *
134 + * @return bool True if installation meets all requirements
135 + */
136 + private function meets_requirements() {
137 +
138 + if ( ! class_exists( 'GamiPress' ) ) {
139 + return false;
140 + }
141 +
142 + // Multisite feature requires GamiPress 1.4.8
143 + if( is_multisite() ) {
144 +
145 + // Requirements on multisite install
146 + if( is_main_site() && function_exists('gamipress_is_network_wide_active') && gamipress_is_network_wide_active() ) {
147 +
148 + // On main site, need to check if integrated plugin is installed on any sub site to load all configuration files
149 + if( gamipress_is_plugin_active_on_network( 'ultimate-member/ultimate-member.php' ) || gamipress_is_plugin_active_on_network( 'ultimate-member/ultimate-member.php' ) ) {
150 + return true;
151 + }
152 +
153 + }
154 +
155 + }
156 +
157 + if ( ! class_exists( 'UM' ) ) {
158 + return false;
159 + }
160 +
161 + return true;
162 +
163 + }
164 +
165 +}
166 +
167 +/**
168 + * The main function responsible for returning the one true GamiPress_Integration_Ultimate_Member instance to functions everywhere
169 + *
170 + * @since 1.0.0
171 + * @return \GamiPress_Integration_Ultimate_Member The one true GamiPress_Integration_Ultimate_Member
172 + */
173 +function GamiPress_Integration_Ultimate_Member() {
174 + return GamiPress_Integration_Ultimate_Member::instance();
175 +}
176 +add_action( 'gamipress_pre_init', 'GamiPress_Integration_Ultimate_Member' );