includes/class-fs-plugin-updater.php
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;
        }
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;
        }
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 ; }
This is a special after upgrade handler for migrating modules
that didn't use the '-premium' suffix folder structure before
the migration.

@author Vova Feldman (@svovaf)
@since  1.2.1.6

@param bool  $response   Install response.
@param array $hook_extra Extra arguments passed to hooked filters.
@param array $result     Installation result data.

@return bool
This is a special after upgrade handler for migrating modules that didn t use the - premium suffix folder structure before the migration .