| 1 |
<?php |
| 2 |
/* |
| 3 |
* Plugin Name: Buttonizer - Smart Floating & Sticky Buttons |
| 4 |
* Plugin URI: https://buttonizer.io |
| 5 |
* Description: The Buttonizer is a new way to give a boost to your number of interactions, actions and conversions from your website visitor by adding one or multiple Customizable Smart Floating Button in the corner of your website. |
| 6 |
* Version: 3.5.0 |
| 7 |
* Author: Buttonizer |
| 8 |
* Author URI: https://buttonizer.io |
| 9 |
* License: GPLv2 or later |
| 10 |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 11 |
* Text Domain: buttonizer-multifunctional-button |
| 12 |
* Domain Path: /languages |
| 13 |
* |
| 14 |
* |
| 15 |
* SOFTWARE LICENSE INFORMATION |
| 16 |
* |
| 17 |
* Copyright (c) 2017 Buttonizer, all rights reserved. |
| 18 |
* |
| 19 |
* This file is part of Buttonizer |
| 20 |
* |
| 21 |
* For detailed information regarding to the licensing of |
| 22 |
* this software, please review the license.txt or visit: |
| 23 |
* https://buttonizer.io/license/ |
| 24 |
*/ |
| 25 |
|
| 26 |
// Define current Buttonizer version |
| 27 |
define('BUTTONIZER_VERSION', '3.5.0'); |
| 28 |
define('BUTTONIZER_PLUGIN_FILE', __FILE__); |
| 29 |
|
| 30 |
// Get environment vars |
| 31 |
require_once __DIR__ . "/EnvVars.php"; |
| 32 |
|
| 33 |
|
| 34 |
# No script kiddies |
| 35 |
defined('ABSPATH') or die('No script kiddies please!'); |
| 36 |
|
| 37 |
/* ================================================ |
| 38 |
* WELCOME TO THE BUTTONIZER SOURCE CODE! |
| 39 |
* |
| 40 |
* We like to see that you are courious |
| 41 |
* how the code is written. If you |
| 42 |
* are here to try to resolve problems |
| 43 |
* you must be careful, anything |
| 44 |
* can get broken you know... |
| 45 |
* |
| 46 |
* -- KNOWLEDGE BASE -- |
| 47 |
* Did you know you can use our |
| 48 |
* knowledge base? |
| 49 |
* That's free! |
| 50 |
* |
| 51 |
* VISIT: |
| 52 |
* https://r.buttonizer.io/support/knowledgebase |
| 53 |
* |
| 54 |
* -- BUGS FOUND? -- |
| 55 |
* Are you here to look for a bug? |
| 56 |
* Cool! If you found something |
| 57 |
* you can report it to us! |
| 58 |
* |
| 59 |
* Maybe you get a FREE license |
| 60 |
* for 1 website ;) |
| 61 |
* |
| 62 |
* ================================================ |
| 63 |
*/ |
| 64 |
|
| 65 |
// Autoloader |
| 66 |
require_once BUTTONIZER_APP_DIR . "/autoloader.php"; |
| 67 |
|
| 68 |
// Initialize shared core configuration |
| 69 |
\Buttonizer\Core\PluginConfig::init([ |
| 70 |
'name' => BUTTONIZER_NAME, |
| 71 |
'dir' => BUTTONIZER_DIR, |
| 72 |
'app_dir' => BUTTONIZER_APP_DIR, |
| 73 |
'slug' => BUTTONIZER_SLUG, |
| 74 |
'version' => BUTTONIZER_VERSION, |
| 75 |
'plugin_file' => BUTTONIZER_PLUGIN_FILE, |
| 76 |
'base_name' => BUTTONIZER_BASE_NAME, |
| 77 |
'api_uri' => BUTTONIZER_API_URI, |
| 78 |
'api_timeout' => defined("BUTTONIZER_API_TIMEOUT") ? BUTTONIZER_API_TIMEOUT : 20, |
| 79 |
'page_slug' => 'Buttonizer', |
| 80 |
'text_domain' => 'buttonizer-multifunctional-button', |
| 81 |
'review_url' => 'https://r.buttonizer.io/review/wordpress?utm_source=wp-plugin-request-review-btn', |
| 82 |
'product_name' => 'Buttonizer', |
| 83 |
'notice_id' => 'buttonizer-admin-notice', |
| 84 |
'notice_js_function' => 'buttonizerAdminNotice', |
| 85 |
'referral_slug' => 'buttonizer-plugin-menu', |
| 86 |
'siblings' => [ |
| 87 |
'bz_contact_button' => [ |
| 88 |
'token_option' => 'bz_contact_button_site_connection', |
| 89 |
'settings_option' => 'bz_contact_button_settings', |
| 90 |
'account_option' => 'bz_contact_button_account', |
| 91 |
], |
| 92 |
'bz_social_feeds' => [ |
| 93 |
'token_option' => 'bz_social_feeds_site_connection', |
| 94 |
'settings_option' => 'bz_social_feeds_settings', |
| 95 |
'account_option' => 'bz_social_feeds_account', |
| 96 |
], |
| 97 |
], |
| 98 |
]); |
| 99 |
|
| 100 |
// Initialize |
| 101 |
require_once BUTTONIZER_DIR . "/init.php"; |
| 102 |
|
| 103 |
// Uninstall |
| 104 |
register_uninstall_hook(__FILE__, 'pluginUninstallEvent'); |
| 105 |
|
| 106 |
function pluginUninstallEvent() |
| 107 |
{ |
| 108 |
// Skip if the is no API token being used |
| 109 |
if (\Buttonizer\Core\Utils\ApiRequest::getApiToken() === false) { |
| 110 |
return; |
| 111 |
} |
| 112 |
|
| 113 |
try { |
| 114 |
// Invalidate access token for security reasons on uninstall |
| 115 |
(new \Buttonizer\Core\Api\Connection\Disconnect)->disconnect(false); |
| 116 |
} catch (\Error $err) { |
| 117 |
// Errored out, nevermind then |
| 118 |
} |
| 119 |
} |
| 120 |
|