cloggier
↑
/wp-content/plugins/chatway-live-chat
marsupiataab
hypermuffing
cloggier
hypermuffing
marsupiataab
Api.php
1,515 B
cloggier
marsupiataab
Assets.php
5,025 B
cloggier
marsupiataab
Base.php
2,172 B
cloggier
marsupiataab
ChatwayApi.php
21,085 B
cloggier
marsupiataab
ExternalApi.php
13,295 B
cloggier
marsupiataab
Front.php
10,529 B
cloggier
marsupiataab
Icons.php
904 B
cloggier
marsupiataab
Singleton.php
396 B
cloggier
marsupiataab
Url.php
4,780 B
cloggier
marsupiataab
User.php
3,238 B
cloggier
marsupiataab
View.php
7,671 B
cloggier
marsupiataab
<?php /** * Chatway admin base * * @author : Chatway * @license : GPLv3 * */ namespace Chatway\App; class Base { use Singleton; public function __construct() { add_action( 'admin_init', [$this, 'plugin_redirect'] ); } /** * Redirects to the Chatway admin page if the chatway_redirection option is set and DOING_AJAX is not defined. * This function checks if the chatway_redirection option is set to true. If it is, it deletes the option and redirects * to the admin.php?page=chatway URL using wp_redirect function. It then exits the script execution. * * @return void */ public function plugin_redirect() { if ( ! defined( "DOING_AJAX" ) && get_option( 'chatway_redirection', false ) ) { delete_option( 'chatway_redirection' ); exit( wp_redirect( admin_url("admin.php?page=chatway") ) ); } } /** * Activates the plugin by setting up a temporary redirection key. * The user will be redirected to the Plugin Page on installation. * The temporary redirection key is removed as soon as it's called for the first time. * * @return void */ public function activate() { ExternalApi::update_plugins_status( 'install' ); /** * We want to take the user to the Plugin Page on installation. * Hence setting up a temporary redirection key. * It gets removed as soon as it's called for the first time. * Ussage at : plugin_redirect, and called with admin_init */ if(function_exists('chatway_clear_all_caches')) { chatway_clear_all_caches(); } if ( ! defined( "DOING_AJAX" ) ) { add_option( 'chatway_redirection', true ); } } public function deactivate() { ExternalApi::update_plugins_status( 'uninstall' ); ExternalApi::sync_wp_plugin_version(\Chatway::is_woocomerce_active(), 0); User::clear_chatway_keys(); if(function_exists('chatway_clear_all_caches')) { chatway_clear_all_caches(); } delete_option( 'chatway_redirection' ); } }
cloggier