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