-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmembership2.php
More file actions
executable file
·215 lines (184 loc) · 5.44 KB
/
membership2.php
File metadata and controls
executable file
·215 lines (184 loc) · 5.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<?php
/**
* Plugin Name: PS Mitgliedschaften
* Plugin URI: https://cp-psource.github.io/mitgliedschaften-pro/
* Version: 1.3.0
* Description: Das leistungsstärkste, benutzerfreundlichste und flexibelste Mitgliedschafts-Plugin für ClassicPress-Seiten.
* Requires at least: 4.6
* Tested up to: 6.8.1
* Author: PSOURCE
* Author URI: https://github.com/cp-psource/
* License: GPL2
* License URI: http://opensource.org/licenses/GPL-2.0
* Text Domain: membership2
*
* @package Membership2
*/
/**
* Copyright notice
*
* @copyright PSOURCE (https://github.com/cp-psource/)
*
* Authors: DerN3rd
*
*
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
/**
* Initializes constants and create the main plugin object MS_Plugin.
* This function is called *instantly* when this file was loaded.
*
* @since 1.0.0
*/
require 'psource/psource-plugin-update/plugin-update-checker.php';
use YahnisElsts\PluginUpdateChecker\v5\PucFactory;
$myUpdateChecker = PucFactory::buildUpdateChecker(
'https://github.com/cp-psource/mitgliedschaften-pro',
__FILE__,
'mitgliedschaften-pro'
);
//Set the branch that contains the stable release.
$myUpdateChecker->setBranch('master');
function membership2_pro_init_app() {
if ( defined( 'MS_PLUGIN' ) ) {
$plugin_name = 'Mitgliedschaften Pro';
if ( is_admin() ) {
// Can happen in Multisite installs where a sub-site has activated the
// plugin and then the plugin is also activated in network-admin.
printf(
'<div class="notice error"><p><strong>%s</strong>: %s</p></div>',
sprintf(
esc_html__( 'Das Plugin %s konnte nicht geladen werden, da bereits eine andere Version des Plugins geladen ist', 'membership2' ),
$plugin_name
),
esc_html( MS_PLUGIN . ' (v' . MS_PLUGIN_VERSION . ')' )
);
}
return;
}
/**
* Plugin version
*
* @since 1.0.0
*/
define( 'MS_PLUGIN_VERSION', '1.3.0' );
/**
* Free or pro plugin?
* This only affects some display settings, it does not really lock/unlock
* any premium features...
*
* @since 1.0.3.2
*/
define( 'MS_IS_PRO', true );
/**
* Plugin main-file.
*
* @since 1.0.3.0
*/
define( 'MS_PLUGIN_FILE', __FILE__ );
/**
* Plugin identifier constant.
*
* @since 1.0.0
*/
define( 'MS_PLUGIN', plugin_basename( __FILE__ ) );
/**
* Plugin name dir constant.
*
* @since 1.0.0
*/
define( 'MS_PLUGIN_NAME', dirname( MS_PLUGIN ) );
/**
* Plugin name dir constant.
*
* @since 1.0.3
*/
define( 'MS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
/**
* Plugin base dir
*/
define( 'MS_PLUGIN_BASE_DIR', dirname( __FILE__ ) );
$externals = array(
dirname( __FILE__ ) . '/lib/wpmu-lib/core.php',
//dirname( __FILE__ ) . '/lib/wdev-frash/module.php',
);
$cta_label = false;
$drip_param = false;
foreach ( $externals as $path ) {
if ( file_exists( $path ) ) { require_once $path; }
}
/**
* Translation.
*
* Tip:
* The translation files must have the filename [TEXT-DOMAIN]-[locale].mo
* Example: membership2-en_EN.mo / membership2-de_DE.mo
*/
function _membership2_translate_plugin() {
if ( !is_textdomain_loaded('membership2') ) {
load_plugin_textdomain(
'membership2',
false,
dirname( plugin_basename( __FILE__ ) ) . '/languages'
);
}
}
add_action( 'init', '_membership2_translate_plugin' );
if ( (defined( 'WP_DEBUG' ) && WP_DEBUG) || (defined( 'WDEV_DEBUG' ) && WDEV_DEBUG) ) {
// Load development/testing code before the plugin is initialized.
$testfile = dirname( __FILE__ ) . '/tests/wp/init.php';
if ( file_exists( $testfile ) ) { include $testfile; }
}
include MS_PLUGIN_BASE_DIR . '/app/ms-loader.php';
if ( is_dir( MS_PLUGIN_BASE_DIR . '/premium' ) ) {
include MS_PLUGIN_BASE_DIR . '/premium/ms-premium-loader.php';
MS_Premium_Loader::instance();
}
// Initialize the M2 class loader.
$loader = new MS_Loader();
/**
* Create an instance of the plugin object.
*
* This is the primary entry point for the Membership plugin.
*
* @since 1.0.0
*/
MS_Plugin::instance();
/**
* Ajax Logins
*
* @since 1.0.4
*/
MS_Auth::check_ms_ajax();
}
if ( ! function_exists( 'is_plugin_active' ) ) {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
}
//Deactivate free
if ( is_plugin_active( 'membership/membership.php' ) ) {
deactivate_plugins( array( 'membership/membership.php' ) );
}
add_action( 'wp_enqueue_scripts', function() {
if ( ! is_admin() ) {
wp_add_inline_script(
'jquery-core',
'var ajaxurl = "' . esc_js( admin_url( 'admin-ajax.php' ) ) . '";',
'before'
);
}
} );
membership2_pro_init_app();