| @@ -1,147 +1,127 @@ | ||
| 1 | -<?php | |
| 2 | -/* | |
| 3 | -Plugin Name: Buttonizer - Smart Floating Action Button | |
| 4 | -Plugin URI: https://buttonizer.pro | |
| 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: 1.0.4 | |
| 7 | -Author: Buttonizer | |
| 8 | -Author URI: https://buttonizer.pro | |
| 9 | -License: GPL2 | |
| 10 | -License URI: https://www.gnu.org/licenses/gpl-2.0.html | |
| 11 | -Text Domain: wporg | |
| 12 | -*/ | |
| 13 | -/* | |
| 14 | -This program is free software; you can redistribute it and/or | |
| 15 | -modify it under the terms of the GNU General Public License | |
| 16 | -as published by the Free Software Foundation; either version 2 | |
| 17 | -of the License, or (at your option) any later version. | |
| 18 | - | |
| 19 | -This program is distributed in the hope that it will be useful, | |
| 20 | -but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 21 | -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 22 | -GNU General Public License for more details. | |
| 23 | - | |
| 24 | -You should have received a copy of the GNU General Public License | |
| 25 | -along with this program; if not, write to the Free Software | |
| 26 | -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
| 27 | - | |
| 28 | -Copyright 2017 Buttonizer | |
| 29 | -*/ | |
| 30 | - | |
| 31 | -define('BUTTONIZER_NAME', 'buttonizer'); | |
| 32 | -define('BUTTONIZER_DIR', dirname(__FILE__)); | |
| 33 | -define('BUTTONIZER_PLUGIN_DIR', __FILE__ ); | |
| 34 | -define('BUTTONIZER_VERSION','1.0.4'); | |
| 35 | - | |
| 36 | -# No script kiddies | |
| 37 | -defined( 'ABSPATH' ) or die('No script kiddies please!'); | |
| 38 | - | |
| 39 | -/* ================================================ | |
| 40 | - * WELCOME TO THE BUTTONIZER SOURCE CODE! | |
| 41 | - * | |
| 42 | - * We like to see that you are courious | |
| 43 | - * how the code is written. When you | |
| 44 | - * are here to try to resolve problems | |
| 45 | - * you must be carefully, anything | |
| 46 | - * can get broken you know... | |
| 47 | - * | |
| 48 | - * -- KNOWLEDGE BASE -- | |
| 49 | - * Did you know you can use our | |
| 50 | - * knowledge base? | |
| 51 | - * That's free! | |
| 52 | - * | |
| 53 | - * VISIT: | |
| 54 | - * https://knowledge.buttonizer.pro | |
| 55 | - * | |
| 56 | - * -- BUGS FOUND? -- | |
| 57 | - * Are you here to look for a bug? | |
| 58 | - * Cool! If you found something | |
| 59 | - * you can report it to us! | |
| 60 | - * | |
| 61 | - * Maybe you get a FREE license | |
| 62 | - * for 1 website ;) | |
| 63 | - * | |
| 64 | - * ================================================ | |
| 65 | - */ | |
| 66 | - | |
| 67 | -if(!class_exists("\\Buttonizer\\Maintain")) { | |
| 68 | - /* Install, deactivate and remove Buttonizer */ | |
| 69 | - require BUTTONIZER_DIR . '/classes/default/maintain.php'; | |
| 70 | - | |
| 71 | - // Main stuff | |
| 72 | - require BUTTONIZER_DIR . '/classes/default/main.php'; | |
| 73 | - | |
| 74 | - // License stuff | |
| 75 | - require BUTTONIZER_DIR . '/classes/default/license.php'; | |
| 76 | - | |
| 77 | - // Admin stuff | |
| 78 | - require BUTTONIZER_DIR . '/classes/admin/InitializeAdmin.php'; | |
| 79 | -} | |
| 80 | - | |
| 81 | -/* | |
| 82 | - * License setup | |
| 83 | - */ | |
| 84 | -$oButtonizer = new Buttonizer\License(); | |
| 85 | -$oButtonizer->init(); | |
| 86 | - | |
| 87 | -if(!function_exists("ButtonizerLicense")) { | |
| 88 | - function ButtonizerLicense() { | |
| 89 | - global $oButtonizer; | |
| 90 | - | |
| 91 | - return $oButtonizer->get(); | |
| 92 | - } | |
| 93 | -} | |
| 94 | - | |
| 95 | -/* | |
| 96 | - * Installation, removing and initiallization | |
| 97 | - */ | |
| 98 | -$oButtonizerMaintain = new Buttonizer\Maintain(true, 'init'); | |
| 99 | - | |
| 100 | -/* | |
| 101 | - * Buttonizer admin stuff or button | |
| 102 | - */ | |
| 103 | -if(is_admin()) { | |
| 104 | - // Load admin page | |
| 105 | - new Buttonizer\Admin\InitializeAdmin(); | |
| 106 | -} | |
| 107 | -else | |
| 108 | -{ | |
| 109 | - // Buttonizer button | |
| 110 | - new Buttonizer\Button($oButtonizerMaintain->isMobile()); | |
| 111 | -} | |
| 112 | - | |
| 113 | -/* LAST FEW FUNCTIONS */ | |
| 114 | -if(!function_exists("buttonizer_custom_connect_message_on_update")) { | |
| 115 | - function buttonizer_custom_connect_message_on_update( | |
| 116 | - $message, | |
| 117 | - $user_first_name, | |
| 118 | - $plugin_title, | |
| 119 | - $user_login, | |
| 120 | - $site_link, | |
| 121 | - $freemius_link | |
| 122 | - ) { | |
| 123 | - return sprintf( | |
| 124 | - __fs( 'hey-x' ) . '<br>' . | |
| 125 | - __( 'Hey %2$s! We want to ask you to help us to improve Buttonizer! If you opt-in, some data about your usage of %2$s will be sent to %5$s. If you skip this, that\'s no problem! %2$s will still be improved!', 'buttonizer' ), | |
| 126 | - $user_first_name, | |
| 127 | - '<b>' . $plugin_title . '</b>', | |
| 128 | - '<b>' . $user_login . '</b>', | |
| 129 | - $site_link, | |
| 130 | - $freemius_link | |
| 131 | - ); | |
| 132 | - } | |
| 133 | -} | |
| 134 | - | |
| 135 | -$oButtonizer->get()->add_action('after_uninstall', 'buttonizer_uninstall_cleanup'); | |
| 136 | - | |
| 137 | -// System, buttonizer is loaded | |
| 138 | -do_action('buttonizer_loaded'); | |
| 139 | - | |
| 140 | -// if(defined("BUTTONIZER_DEFINED")) { | |
| 141 | -// echo "<div style='clear: both;'></div><img src='". plugins_url('/assets/buttonizer.png', BUTTONIZER_PLUGIN_DIR) ."' style='height: 40px; margin-right: 10px; float: left; vertical-align: top;'> Hey, looks like you try to install me (Buttonizer), while you already have an older version (or the free version) installed and activated? Deactivate all older Buttonizer plugins before trying again.<div style='clear: both; height: 20px'></div>"; | |
| 142 | -// trigger_error("Error", E_USER_ERROR); | |
| 143 | -// exit; | |
| 144 | -// } | |
| 145 | - | |
| 146 | -// Ok, define | |
| 147 | -define('BUTTONIZER_DEFINED','1.0'); | |
| 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.6.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.6.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 | + // The migration bookkeeping is this plugin's own, and nothing should | |
| 109 | + // outlive the plugin that wrote it: a leftover entry makes a later install | |
| 110 | + // believe this site was already handed over. The old system's options are | |
| 111 | + // left where they are — those are the user's buttons, not bookkeeping. | |
| 112 | + if (class_exists('\\Buttonizer\\Migration\\MigrationState')) { | |
| 113 | + delete_option(\Buttonizer\Migration\MigrationState::OPTION); | |
| 114 | + } | |
| 115 | + | |
| 116 | + // Skip if the is no API token being used | |
| 117 | + if (\Buttonizer\Core\Utils\ApiRequest::getApiToken() === false) { | |
| 118 | + return; | |
| 119 | + } | |
| 120 | + | |
| 121 | + try { | |
| 122 | + // Invalidate access token for security reasons on uninstall | |
| 123 | + (new \Buttonizer\Core\Api\Connection\Disconnect)->disconnect(false); | |
| 124 | + } catch (\Error $err) { | |
| 125 | + // Errored out, nevermind then | |
| 126 | + } | |
| 127 | +} | |