• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WooCommerce a2z

WooCommerce a2z

WooCommerce

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / WC_Helper_Updater::transient_update_plugins() – Runs in a cron thread, or in a visitor thread if triggered by _maybe_update_plugins(), or in an auto-update thread.

You appear to be a bot. Output may be restricted

Description

Runs in a cron thread, or in a visitor thread if triggered by _maybe_update_plugins(), or in an auto-update thread.

Usage

$object = WC_Helper_Updater::transient_update_plugins( $transient );

Parameters

$transient
( object ) required – The update_plugins transient object.

Returns

object The same or a modified version of the transient.

Source

File name: woocommerce/includes/admin/helper/class-wc-helper-updater.php
Lines:

1 to 42 of 42
  public static function transient_update_plugins( $transient ) {
    $update_data = self::get_update_data();

    foreach ( WC_Helper::get_local_woo_plugins() as $plugin ) {
      if ( empty( $update_data[ $plugin['_product_id'] ] ) ) {
        continue;
      }

      $data     = $update_data[ $plugin['_product_id'] ];
      $filename = $plugin['_filename'];

      $item = array(
        'id'             => 'woocommerce-com-' . $plugin['_product_id'],
        'slug'           => 'woocommerce-com-' . $data['slug'],
        'plugin'         => $filename,
        'new_version'    => $data['version'],
        'url'            => $data['url'],
        'package'        => $data['package'],
        'upgrade_notice' => $data['upgrade_notice'],
      );

      // We don't want to deliver a valid upgrade package when their subscription has expired.
      // To avoid the generic "no_package" error that empty strings give, we will store an
      // indication of expiration for the `upgrader_pre_download` filter to error on.
      if ( ! self::_has_active_subscription( $plugin['_product_id'] ) ) {
        $item['package'] = 'woocommerce-com-expired-' . $plugin['_product_id'];
      }

      if ( version_compare( $plugin['Version'], $data['version'], '<' ) ) {
        $transient->response[ $filename ] = (object) $item;
        unset( $transient->no_update[ $filename ] );
      } else {
        $transient->no_update[ $filename ] = (object) $item;
        unset( $transient->response[ $filename ] );
      }
    }

    $translations = self::get_translations_update_data();
    $transient->translations = array_merge( isset( $transient->translations ) ? $transient->translations : array(), $translations );

    return $transient;
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 21st August 2020

Primary Sidebar

Information

Function name: WC_Helper_Updater::transient_update_plugins
Class ref: WC_Helper_Updater
Plugin ref: WooCommerce
Version: 4.8.0
Sourcefile: includes/admin/helper/class-wc-helper-updater.php
File ref: includes/admin/helper/class-wc-helper-updater.php
Deprecated?: No
API Letters: H,T,U,W

Footer

WooCommerce a2z
WooCommerce a2z
WooCommerce
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  woocommerce.wp-a2z.org
© Copyright WooCommerce a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites