includes/class-fs-plugin-updater.php
function set_update_data( FS_Plugin_Tag $new_version ) {
            $this->_logger->entrance();

            $transient_key = "update_{$this->_fs->get_module_type()}s";

            $transient_data = get_site_transient( $transient_key );

            $transient_data = is_object( $transient_data ) ?
                $transient_data :
                new stdClass();

            // Alias.
            $basename  = $this->_fs->get_plugin_basename();
            $is_plugin = $this->_fs->is_plugin();

            if ( ! isset( $transient_data->response ) ||
                 ! is_array( $transient_data->response )
            ) {
                $transient_data->response = array();
            } else if ( ! empty( $transient_data->response[ $basename ] ) ) {
                $version = $is_plugin ?
                    ( ! empty( $transient_data->response[ $basename ]->new_version ) ?
                        $transient_data->response[ $basename ]->new_version :
                        null
                    ) : ( ! empty( $transient_data->response[ $basename ]['new_version'] ) ?
                        $transient_data->response[ $basename ]['new_version'] :
                        null
                    );

                if ( $version == $new_version->version ) {
                    // The update data is already set.
                    return;
                }
            }

            // Remove the added filters.
            $this->remove_transient_filters();

            $this->_update_details = $this->get_update_details( $new_version );

            // Set update data in transient.
            $transient_data->response[ $basename ] = $is_plugin ?
                $this->_update_details :
                (array) $this->_update_details;

            if ( ! isset( $transient_data->checked ) ||
                 ! is_array( $transient_data->checked )
            ) {
                $transient_data->checked = array();
            }

            // Flag the module as if it was already checked.
            $transient_data->checked[ $basename ] = $this->_fs->get_plugin_version();
            $transient_data->last_checked         = time();

            set_site_transient( $transient_key, $transient_data );

            $this->add_transient_filters();
        }
function set_update_data( FS_Plugin_Tag $new_version ) {
            $this->_logger->entrance();

            $transient_key = "update_{$this->_fs->get_module_type()}s";

            $transient_data = get_site_transient( $transient_key );

            $transient_data = is_object( $transient_data ) ?
                $transient_data :
                new stdClass();

            // Alias.
            $basename  = $this->_fs->get_plugin_basename();
            $is_plugin = $this->_fs->is_plugin();

            if ( ! isset( $transient_data->response ) ||
                 ! is_array( $transient_data->response )
            ) {
                $transient_data->response = array();
            } else if ( ! empty( $transient_data->response[ $basename ] ) ) {
                $version = $is_plugin ?
                    ( ! empty( $transient_data->response[ $basename ]->new_version ) ?
                        $transient_data->response[ $basename ]->new_version :
                        null
                    ) : ( ! empty( $transient_data->response[ $basename ]['new_version'] ) ?
                        $transient_data->response[ $basename ]['new_version'] :
                        null
                    );

                if ( $version == $new_version->version ) {
                    // The update data is already set.
                    return;
                }
            }

            // Remove the added filters.
            $this->remove_transient_filters();

            $this->_update_details = $this->get_update_details( $new_version );

            // Set update data in transient.
            $transient_data->response[ $basename ] = $is_plugin ?
                $this->_update_details :
                (array) $this->_update_details;

            if ( ! isset( $transient_data->checked ) ||
                 ! is_array( $transient_data->checked )
            ) {
                $transient_data->checked = array();
            }

            // Flag the module as if it was already checked.
            $transient_data->checked[ $basename ] = $this->_fs->get_plugin_version();
            $transient_data->last_checked         = time();

            set_site_transient( $transient_key, $transient_data );

            $this->add_transient_filters();
        }
function set_update_data ( FS_Plugin_Tag $ new_version ) { $ this -> _logger -> entrance ( ) ; $ transient_key = "update_{$this->_fs->get_module_type()}s" ; $ transient_data = get_site_transient ( $ transient_key ) ; $ transient_data = is_object ( $ transient_data ) ? $ transient_data : new stdClass ( ) ; // Alias.
 $ basename = $ this -> _fs -> get_plugin_basename ( ) ; $ is_plugin = $ this -> _fs -> is_plugin ( ) ; if ( ! isset ( $ transient_data -> response ) || ! is_array ( $ transient_data -> response ) ) { $ transient_data -> response = array ( ) ; } else if ( ! empty ( $ transient_data -> response [ $ basename ] ) ) { $ version = $ is_plugin ? ( ! empty ( $ transient_data -> response [ $ basename ] -> new_version ) ? $ transient_data -> response [ $ basename ] -> new_version : null ) : ( ! empty ( $ transient_data -> response [ $ basename ] [ 'new_version' ] ) ? $ transient_data -> response [ $ basename ] [ 'new_version' ] : null ) ; if ( $ version == $ new_version -> version ) { // The update data is already set.
 return ; } } // Remove the added filters.
 $ this -> remove_transient_filters ( ) ; $ this -> _update_details = $ this -> get_update_details ( $ new_version ) ; // Set update data in transient.
 $ transient_data -> response [ $ basename ] = $ is_plugin ? $ this -> _update_details : ( array ) $ this -> _update_details ; if ( ! isset ( $ transient_data -> checked ) || ! is_array ( $ transient_data -> checked ) ) { $ transient_data -> checked = array ( ) ; } // Flag the module as if it was already checked.
 $ transient_data -> checked [ $ basename ] = $ this -> _fs -> get_plugin_version ( ) ; $ transient_data -> last_checked = time ( ) ; set_site_transient ( $ transient_key , $ transient_data ) ; $ this -> add_transient_filters ( ) ; }
Update the updates transient with the module's update information.

This method is required for multisite environment.
If a module is site activated (not network) and not on the main site,
the module will NOT be executed on the network level, therefore, the
custom updates logic will not be executed as well, so unless we force
the injection of the update into the updates transient, premium updates
will not work.

@author Vova Feldman (@svovaf)
@since  2.0.0

@param \FS_Plugin_Tag $new_version
Update the updates transient with the module s update information .