From e5f9c2c8bf55cf0ff02592c6df2f70962ecb878c Mon Sep 17 00:00:00 2001 From: Sami Ahmed Siddiqui Date: Tue, 3 Jan 2023 00:12:18 +0500 Subject: [PATCH] Remove site information to be pass on the other server --- admin/class-custom-permalinks-updates.php | 69 ----------------------- includes/class-custom-permalinks.php | 22 +------- 2 files changed, 1 insertion(+), 90 deletions(-) delete mode 100644 admin/class-custom-permalinks-updates.php diff --git a/admin/class-custom-permalinks-updates.php b/admin/class-custom-permalinks-updates.php deleted file mode 100644 index 2b85fa3..0000000 --- a/admin/class-custom-permalinks-updates.php +++ /dev/null @@ -1,69 +0,0 @@ -method = 'uninstall'; - } - - $this->update_version_details(); - } - - /** - * Fetch site details and sent it to CP. - * - * @since 1.6.0 - * @access private - * - * @return void - */ - private function update_version_details() { - $admin_email = get_bloginfo( 'admin_email' ); - $request_url = 'https://www.custompermalinks.com/plugin-update/'; - $site_name = get_bloginfo( 'name' ); - $site_url = get_bloginfo( 'wpurl' ); - $wp_version = get_bloginfo( 'version' ); - - $updates = array( - 'action' => $this->method, - 'admin_email' => $admin_email, - 'plugin_version' => CUSTOM_PERMALINKS_VERSION, - 'site_name' => $site_name, - 'site_url' => $site_url, - 'wp_version' => $wp_version, - ); - - // Performs an HTTP request using the POST method. - wp_remote_post( - $request_url, - array( - 'method' => 'POST', - 'body' => $updates, - ) - ); - } -} diff --git a/includes/class-custom-permalinks.php b/includes/class-custom-permalinks.php index 2a87c8d..6579cfe 100644 --- a/includes/class-custom-permalinks.php +++ b/includes/class-custom-permalinks.php @@ -95,11 +95,6 @@ private function init_hooks() { array( 'Custom_Permalinks', 'activate_details' ) ); - register_deactivation_hook( - CUSTOM_PERMALINKS_FILE, - array( 'Custom_Permalinks', 'deactivate_details' ) - ); - add_action( 'plugins_loaded', array( $this, 'check_loaded_plugins' ) ); } @@ -133,30 +128,15 @@ public static function add_roles() { } /** - * Sent details when plugin gets activated / updated ans set installed - * version in options table. + * Set installed version in options table. * * @since 1.6.1 * @access public */ public static function activate_details() { - include_once CUSTOM_PERMALINKS_PATH . 'admin/class-custom-permalinks-updates.php'; - new Custom_Permalinks_Updates( 'activate' ); - update_option( 'custom_permalinks_plugin_version', CUSTOM_PERMALINKS_VERSION ); } - /** - * Sent details when plugin gets deactivated. - * - * @since 1.6.1 - * @access public - */ - public static function deactivate_details() { - include_once CUSTOM_PERMALINKS_PATH . 'admin/class-custom-permalinks-updates.php'; - new Custom_Permalinks_Updates( 'deactivate' ); - } - /** * Check if role not exist then call the function to add it. Update site * details if plugin gets updated. Also, loads the plugin language files to