function _maybe_update_folder_name( $response, $hook_extra, $result ) {
            $basename = $this->_fs->get_plugin_basename();

            if ( true !== $response ||
                 empty( $hook_extra ) ||
                 empty( $hook_extra['plugin'] ) ||
                 $basename !== $hook_extra['plugin']
            ) {
                return $response;
            }

            $active_plugins_basenames = get_option( 'active_plugins' );

            for ( $i = 0, $len = count( $active_plugins_basenames ); $i < $len; $i ++ ) {
                if ( $basename === $active_plugins_basenames[ $i ] ) {
                    // Get filename including extension.
                    $filename = basename( $basename );

                    $new_basename = plugin_basename(
                        trailingslashit( $this->_fs->is_premium() ? $this->_fs->get_premium_slug() : $this->_fs->get_slug() ) .
                        $filename
                    );

                    // Verify that the expected correct path exists.
                    if ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $new_basename ) ) ) {
                        // Override active plugin name.
                        $active_plugins_basenames[ $i ] = $new_basename;
                        update_option( 'active_plugins', $active_plugins_basenames );
                    }

                    break;
                }
            }

            return $response;
        }