PluginProbe
Leyka / 3.0
Leyka v3.0
3.32.3 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.6.1 2.3.7 2.3.8 2.3.9 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1 3.10 3.11 3.11.1 3.12 3.13 3.14 3.15 3.16 3.17 All 89 releases
leyka / leyka.php

leyka.php in Leyka 3.0, at leyka.php

147 lines 5.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if( !defined('WPINC') ) die; // If this file is called directly, abort
2
3 /**
4 * Plugin Name: Leyka
5 * Plugin URI: https://leyka.te-st.ru/
6 * Description: The donations management system for your WP site
7 * Version: 3.0
8 * Author: Teplitsa of social technologies
9 * Author URI: https://te-st.ru
10 * Text Domain: leyka
11 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
12 * Contributors:
13 Lev "ahaenor" Zvyagintsev (ahaenor@gmail.com)
14 Anna "foralien" Ladoshkina (webdev@foralien.com)
15 Denis Cherniatev (denis.cherniatev@gmail.com)
16 Marie Borisyonok (pro100mary@gmail.com)
17 Vladimir Petrozavodsky (petrozavodsky@gmail.com)
18
19 * License: GPLv2 or later
20 Copyright (C) 2012-2018 by Teplitsa of Social Technologies (http://te-st.ru).
21
22 GNU General Public License, Free Software Foundation <http://www.gnu.org/licenses/gpl-2.0.html>
23
24 This program is free software; you can redistribute it and/or modify
25 it under the terms of the GNU General Public License as published by
26 the Free Software Foundation; either version 2 of the License, or
27 (at your option) any later version.
28
29 This program is distributed in the hope that it will be useful,
30 but WITHOUT ANY WARRANTY; without even the implied warranty of
31 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 GNU General Public License for more details.
33
34 You should have received a copy of the GNU General Public License
35 along with this program; if not, write to the Free Software
36 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
37 */
38
39 // Leyka plugin version:
40 if( !defined('LEYKA_VERSION') ) {
41 define('LEYKA_VERSION', '3.0');
42 }
43
44 // Plugin base file:
45 if( !defined('LEYKA_PLUGIN_BASE_FILE') ) { // "leyka.php"
46 define('LEYKA_PLUGIN_BASE_FILE', basename(__FILE__));
47 }
48
49 // Plugin base directory:
50 if( !defined('LEYKA_PLUGIN_DIR_NAME') ) { // Most commonly, "leyka"
51 define('LEYKA_PLUGIN_DIR_NAME', basename(dirname(__FILE__)));
52 }
53
54 // Plugin URL:
55 if( !defined('LEYKA_PLUGIN_BASE_URL') ) {
56 define('LEYKA_PLUGIN_BASE_URL', plugin_dir_url(__FILE__));
57 }
58
59 // Plugin DIR, with trailing slash:
60 if( !defined('LEYKA_PLUGIN_DIR') ) {
61 define('LEYKA_PLUGIN_DIR', plugin_dir_path(__FILE__));
62 }
63
64 // Plugin ID:
65 if( !defined('LEYKA_PLUGIN_INNER_SHORT_NAME') ) { // "leyka/leyka.php"
66 define('LEYKA_PLUGIN_INNER_SHORT_NAME', plugin_basename(__FILE__));
67 }
68
69 // Plugin support email:
70 if( !defined('LEYKA_SUPPORT_EMAIL') ) {
71 define('LEYKA_SUPPORT_EMAIL', 'support@te-st.ru,sidorenko.a@gmail.com');
72 }
73
74 // Plugin support email:
75 if( !defined('LEYKA_DEBUG') ) {
76 define('LEYKA_DEBUG', false);
77 }
78
79 if( !defined('LEYKA_USAGE_STATS_DEV_SERVER_URL') ) {
80 define('LEYKA_USAGE_STATS_DEV_SERVER_URL', 'https://ngo2.ru/leyka-usage-stats/'); // http://leyka-usage-stats.local/
81 }
82
83 if( !defined('LEYKA_USAGE_STATS_PROD_SERVER_URL') ) {
84 define('LEYKA_USAGE_STATS_PROD_SERVER_URL', 'https://ls.te-st.ru/');
85 }
86
87 // Environment checks. If some failed, deactivate the plugin to save WP from possible crushes:
88 if( !defined('PHP_VERSION') || version_compare(PHP_VERSION, '5.6.0', '<') ) {
89
90 echo '<div id="message" class="error"><p><strong>Внимание:</strong> версия PHP ниже <strong>5.6.0</strong>. Лейка нуждается в PHP �
91 отя бы <strong>версии 5.6.0</strong>, чтобы работать корректно. Плагин будет деактивирован.<br /><br />Пожалуйста, направьте вашему �
92 остинг-провайдеру запрос на повышение версии PHP для этого сайта.</p> <p><strong>Warning:</strong> your PHP version is below <strong>5.6.0</strong>. Leyka needs PHP <strong>v5.6.0</strong> or later to work. Plugin will be deactivated.<br /><br />Please contact your hosting provider to upgrade your PHP version.</p></div>';
93
94 die();
95
96 }
97
98 if(get_locale() == 'ru_RU') {
99 load_textdomain('leyka', dirname( realpath(__FILE__) ) . '/languages/leyka-ru_RU.mo'); // load included lang pack
100 }
101 load_plugin_textdomain('leyka', false, basename( dirname( __FILE__ ) ) . '/languages/'); // load langpack by priority
102
103 require_once(LEYKA_PLUGIN_DIR.'inc/leyka-tmp-translations.php');
104 require_once(LEYKA_PLUGIN_DIR.'inc/leyka-functions.php');
105 require_once(LEYKA_PLUGIN_DIR.'inc/leyka-class-options-controller.php');
106 require_once(LEYKA_PLUGIN_DIR.'inc/leyka-polylang.php');
107 require_once(LEYKA_PLUGIN_DIR.'inc/leyka-core.php');
108 require_once(LEYKA_PLUGIN_DIR.'inc/leyka-gateways-api.php');
109 require_once(LEYKA_PLUGIN_DIR.'inc/leyka-class-campaign.php');
110 require_once(LEYKA_PLUGIN_DIR.'inc/leyka-class-donation.php');
111 require_once(LEYKA_PLUGIN_DIR.'inc/leyka-class-payment-form.php');
112 require_once(LEYKA_PLUGIN_DIR.'inc/leyka-class-template-controller.php');
113 require_once(LEYKA_PLUGIN_DIR.'inc/leyka-ajax.php');
114 require_once(LEYKA_PLUGIN_DIR.'inc/leyka-shortcodes.php');
115 require_once(LEYKA_PLUGIN_DIR.'inc/leyka-widgets.php');
116 require_once(LEYKA_PLUGIN_DIR.'inc/leyka-hooks.php');
117
118 /** Automatically include all sub-dirs of /leyka/gateways/ */
119 $gateways_dir = dir(LEYKA_PLUGIN_DIR.'gateways/');
120 if( !$gateways_dir ) {
121 // ?..
122 } else {
123
124 while(false !== ($gateway_id = $gateways_dir->read())) {
125
126 $file_addr = LEYKA_PLUGIN_DIR."gateways/$gateway_id/leyka-class-$gateway_id-gateway.php";
127
128 if($gateway_id !== '.' && $gateway_id !== '..' && file_exists($file_addr)) {
129 require_once($file_addr);
130 }
131
132 }
133
134 $gateways_dir->close();
135
136 }
137
138 function leyka_load_plugin_textdomain() {
139 load_plugin_textdomain('leyka', false, basename( dirname( __FILE__ ) ) . '/languages/');
140 }
141 add_action( 'plugins_loaded', 'leyka_load_plugin_textdomain' );
142
143 register_activation_hook(__FILE__, array('Leyka', 'activate')); // Activation
144 add_action('plugins_loaded', array('Leyka', 'activate')); // Any update needed
145 register_deactivation_hook(__FILE__, array('Leyka', 'deactivate')); // Deactivate
146
147 leyka(); // All systems go