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/thrive-leads/thrive-leads.php +142 -0 7.9.2 → 8.0.5 View file →
@@ -1,0 +1,142 @@
1 +<?php
2 +/**
3 + * Plugin Name: GamiPress - Thrive Leads integration
4 + * Plugin URI: https://wordpress.org/plugins/gamipress-thrive-leads-integration/
5 + * Description: Connect GamiPress with Thrive Leads.
6 + * Version: 1.0.0
7 + * Author: GamiPress
8 + * Author URI: https://gamipress.com/
9 + * Text Domain: gamipress-thrive-leads-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\Thrive_Leads
16 + * @author GamiPress
17 + * @copyright Copyright (c) GamiPress
18 + */
19 +
20 +final class GamiPress_Integration_Thrive_Leads {
21 +
22 + /**
23 + * @var GamiPress_Integration_Thrive_Leads $instance The one true GamiPress_Integration_Thrive_Leads
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_Thrive_Leads self::$instance The one true GamiPress_Integration_Thrive_Leads
34 + */
35 + public static function instance() {
36 +
37 + if( !self::$instance ) {
38 +
39 + self::$instance = new GamiPress_Integration_Thrive_Leads();
40 + self::$instance->constants();
41 + self::$instance->includes();
42 + self::$instance->hooks();
43 +
44 + }
45 +
46 + return self::$instance;
47 +
48 + }
49 +
50 + /**
51 + * Setup plugin constants
52 + *
53 + * @access private
54 + * @since 1.0.0
55 + * @return void
56 + */
57 + private function constants() {
58 +
59 + // Plugin version
60 + define( 'GAMIPRESS_THRIVE_LEADS_VER', '1.0.6' );
61 +
62 + // Plugin path
63 + define( 'GAMIPRESS_THRIVE_LEADS_DIR', plugin_dir_path( __FILE__ ) );
64 +
65 + // Plugin URL
66 + define( 'GAMIPRESS_THRIVE_LEADS_URL', plugin_dir_url( __FILE__ ) );
67 +
68 + }
69 +
70 + /**
71 + * Include plugin files
72 + *
73 + * @access private
74 + * @since 1.0.0
75 + * @return void
76 + */
77 + private function includes() {
78 +
79 + if( $this->meets_requirements() ) {
80 +
81 + require_once GAMIPRESS_THRIVE_LEADS_DIR . 'includes/admin.php';
82 + require_once GAMIPRESS_THRIVE_LEADS_DIR . 'includes/functions.php';
83 + require_once GAMIPRESS_THRIVE_LEADS_DIR . 'includes/listeners.php';
84 + require_once GAMIPRESS_THRIVE_LEADS_DIR . 'includes/triggers.php';
85 +
86 + }
87 + }
88 +
89 + /**
90 + * Setup plugin hooks
91 + *
92 + * @access private
93 + * @since 1.0.0
94 + * @return void
95 + */
96 + private function hooks() {
97 +
98 + }
99 +
100 + /**
101 + * Check if there are all plugin requirements
102 + *
103 + * @since 1.0.0
104 + *
105 + * @return bool True if installation meets all requirements
106 + */
107 + private function meets_requirements() {
108 +
109 + if ( ! class_exists( 'GamiPress' ) ) {
110 + return false;
111 + }
112 +
113 + // Requirements on multisite install
114 + if( is_multisite() && gamipress_is_network_wide_active() && is_main_site() ) {
115 +
116 + // On main site, need to check if integrated plugin is installed on any sub site to load all configuration files
117 + if( gamipress_is_plugin_active_on_network( 'thrive-leads/thrive-leads.php' ) ) {
118 + return true;
119 + }
120 +
121 + }
122 +
123 + if ( ! defined( 'TVE_LEADS_PATH' ) ) {
124 + return false;
125 + }
126 +
127 + return true;
128 +
129 + }
130 +
131 +}
132 +
133 +/**
134 + * The main function responsible for returning the one true GamiPress_Integration_Thrive_Leads instance to functions everywhere
135 + *
136 + * @since 1.0.0
137 + * @return \GamiPress_Integration_Thrive_Leads The one true GamiPress_Integration_Thrive_Leads
138 + */
139 +function GamiPress_Integration_Thrive_Leads() {
140 + return GamiPress_Integration_Thrive_Leads::instance();
141 +}
142 +add_action( 'gamipress_pre_init', 'GamiPress_Integration_Thrive_Leads' );