@ ÞÊ@@¥[Ê  �|Ê�|Ê�8�|Êð�|Ê@ õßÊ@ vÃʘ�|Êÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿo}Êÿÿÿÿއˆ €€!Kʨn}ÊÿÿÿÿBW�1€@�JÊ !«Ê@`É[Ê P‘|Ê8‘|Ê�h‘|Ê ’|Ê@!«Ê@ vÃÊÈ‘|Ê@p×|Êÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàn}Êÿÿÿÿ½ž|€ CKÊ€ìDÊÿÿÿÿò%œ|€`0@À¾°Ê   €’|Êh’|Ê� ˜’|ÊP“|Ê@`±°Ê @ vÃÊ  ø’|Ê@à×|Ê  ÿÿÿÿÿÿÿÿÀEKÊÿÿÿÿ`•ÊÿÿÿÿÿÿÿÿKls·Ð€0- íDÊÿÿÿÿò%œ|€`0pêfÊ ëfÊÐìfÊ�îfÊÀïfÊððfÊ òfÊPófÊ€ôfʰõfÊàöfÊ ùfÊPúfÊ€ûfʰüfÊàýfÊÿfÊ@gÊpgÊ gÊÐgÊgÊ0gÊ`gÊÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ŽJÊÿÿÿÿ½ž|€ �JÊÀ |Êÿÿÿÿò%œ|€`0 gÊÐgÊ gÊ0!gÊ`"gÊ�#gÊÀ$gÊð%gÊ 'gÊP(gÊ€)gʰ*gÊà+gÊ-gÊ@.gÊp/gÊ 0gÊÐ1gÊ3gÊ@8gÊp9gÊ :gÊÐ;gÊ=gÊÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿà…JÊÿÿÿÿŠT…²Ð€À‡JÊÀíDÊÿÿÿÿò%œ|€`00QgÊ`RgÊ�SgÊÀTgÊðUgÊ WgÊPXgÊ€YgʰZgÊà[gÊ]gÊ@^gÊp_gÊÐÐ{ÊÒ{Ê0Ó{Ê`Ô{Ê�Õ{ÊÀÖ{Êð×{Ê Ù{ÊPÚ{Ê€Û{ʰÜ{Êÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¬yY€ Â)Ê`îDÊÿÿÿÿò%œ|€`0àð{Êò{Ê@ó{Ê€ü{ʰý{Êàþ{Ê|Ê@|Êp|Ê |ÊÐ|Ê|Ê0|Ê`|Ê� |ÊÀ |Êð |Ê |ÊP|Ê€|ʰ|Êà|Ê|Ê@|ÊœtrPC?krµ¹lÀDphNrPPDB?or`D<åBr`pD?rpD>UHr@ÿÿÿÿE>Øž@ÊØž@Ê×¢¦‹XñËU/jetpack_vendor/automattic/jetpack-publicize/src/social-image-generator/utilities.phpT/home/joyasper/public_html/wp-content/plugins/woocommerce/src/StoreApi/functions.phpU/home/joyasper/public_html/wp-content/plugins/woocommerce/src/StoreApi/deprecated.phppU/home/joyasper/public_html/wp-content/plugins/woocommerce/vendor/opis/uri/src/Uri.phpT/home/joyasper/public_html/wp-content/plugins/woocommerce/src/Utilities/TimeUtil.phpˆsÊ4R–i""9òAutomattic\Jetpack\is_arrayrlà|Êtö]_懽¦automattic\jetpack\is_array8à|Ê“Ç'h•ù¹Automattic\Jetpack\JSON_HEX_TAGpà|ÊÓËFE;„Âautomattic\jetpack\JSON_HEX_TAG¨à|Ê­Y « (Ùautomattic\jetpack\json_hex_tagàà|ÊU¸Æ'h•ù¹Automattic\Jetpack\JSON_HEX_AMPá|Ê•|FE;„Âautomattic\jetpack\JSON_HEX_AMPPá|ÊÕ]Y « (Ùautomattic\jetpack\json_hex_ampˆá|ÊWñ+ž¡ Сwp.jpI18nLoader.state = jþÿÿÿÈÈ{ÊÀjÀá|Ê2 b»T åAutomattic\Jetpack\did_action0â|ÊHæKèS;>Ìautomattic\jetpack\did_actionhâ|Ê©Ý+�Automattic\Jetpack\defined â|Êé5!y�—jùautomattic\jetpack\definedØâ|ÊGI3²‹ åAutomattic\Jetpack\esc_html__ã|ʇýtžJr>Ìautomattic\jetpack\esc_html__Hã|Êp Åë[fýwp_default_scriptsðÿÿÿ |ÊÀj`sÊŽÖtÕ¸v¸AhoCorasick\MultiStringMatcherðã|ÊXŒLNåºAhoCorasick\MultiStringReplacer(ä|Ê´¡Í6¢ÿ¿Automattic\Block_Delimiter`ä|Ê0�… –wCáAutomattic\Block_Scanner˜ä|ÊSQ£)´þ³Automattic\Jetpack\A8c_Mc_StatsÐä|ÊšËÇ4w…Automattic\Jetpack\Assets\Logoå|ʨ~IJ�¤•Automattic\Jetpack\Blaze@å|ÊX €“ª‹'ÊAutomattic\Jetpack\Blocksxå|Ê�’ –ª‹'ÊAutomattic\Jetpack\Config°å|ÊWÿ¡M±5]¹Automattic\Jetpack\Constantsèå|Êu.8 0h�…Automattic\Jetpack\CookieState æ|Êç›*Ûi›ÏµAutomattic\Jetpack\Current_PlanXæ|ÊdYƒJ�¤•Automattic\Jetpack\Error�æ|ÊW†îšª‹'ÊAutomattic\Jetpack\ErrorsÈæ|ʈeH›ª‹'ÊAutomattic\Jetpack\ExPlatç|Ê­g�J�¤•Automattic\Jetpack\Files8ç|ÊÊtn¯;]¹Automattic\Jetpack\Heartbeatpç|Ê »MSÚ 9òAutomattic\Jetpack\IP\Utils¨ç|ÊÖ *ýº¡…Automattic\Jetpack\Import\Mainàç|ÊñHu¬áåAutomattic\Jetpack\JITMS\JITMè|Ê|µ¯.Ë/src/class-jetpack-crm-data.phpPè|ʶ[«lõ@]¹Automattic\Jetpack\Licensingˆè|ʳ•—X�Automattic\Jetpack\ModulesÀè|ÊVæÚ�Automattic\Jetpack\Partnerøè|ÊAK�¤•Automattic\Jetpack\Paths0é|Ê8ÔFK�¤•Automattic\Jetpack\Planshé|ÊÑbï§²3Ì/src/class-deprecate.php é|ÊŒ77:!9òAutomattic\Jetpack\RedirectØé|Êÿ×lK�¤•Automattic\Jetpack\Rolesê|ÊäÊ(Bï�åAutomattic\Jetpack\Search\CLIHê|Ê÷ÓI‡×¿Ö…Automattic\Jetpack\Search\Plan€ê|Ê›¿pȺ®ÀAutomattic\Jetpack\Search\Stats¸ê|ÊJ‘ÙÓ•åAutomattic\Jetpack\Stats\Mainðê|Ê^³±»ª‹'ÊAutomattic\Jetpack\Status(ë|Ê.)\\ÁAutomattic\Jetpack\Status\Cache`ë|Ê8¯¨9Ù…Automattic\Jetpack\Status\Host˜ë|ÊdMóHŸÁAutomattic\Jetpack\Sync\ActionsÐë|ÊiâÂ…Ú…Automattic\Jetpack\Sync\Healthì|Ê먋J]¹Automattic\Jetpack\Sync\Lock@ì|ʸY먋J]¹Automattic\Jetpack\Sync\Mainxì|ÊŒ ‘ÖKŸÁAutomattic\Jetpack\Sync\Modules°ì|ʘکƜåAutomattic\Jetpack\Sync\Queueèì|ÊTžrŸÚ…Automattic\Jetpack\Sync\Sender í|ÊjuŸÚ…Automattic\Jetpack\Sync\ServerXí|Ê…#ñÆœåAutomattic\Jetpack\Sync\Users�í|Ê$ÀñÆœåAutomattic\Jetpack\Sync\UtilsÈí|Êí%ÀQ!9òAutomattic\Jetpack\Trackingî|Ê,†Ë9�Automattic\Jetpack\Waf\CLI8î|Êjõ'�LJ¾Jetpack_Customize_Control_Titlepî|ÊþøáÚ OøJetpack_IXR_ClientMulticall¨î|ÊQòòȳ«ùJetpack_Modules_Overridesàî|Ên¹ˆ)á–±µPayPal_Payments_Currenciesï|Ê{3)•ø2÷VideoPressUploader\Tus_ClientPï|Ê\³¥¯*ƒÅïVideoPressUploader\Tus_Fileˆï|ÊðSê˜b€ëVideoPress_Divi_Extension array( 'add-to-cart' => $product_id, 'utm_source' => 'pu', 'utm_campaign' => $campaign, ), PluginsHelper::WOO_CART_PAGE_URL ); } return add_query_arg( array( 'renew_product' => $product_id, 'product_key' => $product_key, 'order_id' => $order_id, 'utm_source' => 'pu', 'utm_campaign' => $campaign, ), PluginsHelper::WOO_CART_PAGE_URL ); } /** * Runs on in_plugin_update_message-{file-name}, show a message to install the Woo Marketplace plugin, on plugin update notification, * if the Woo Marketplace plugin isn't already installed. * * @param object $plugin_data TAn array of plugin metadata. * @param object $response An object of metadata about the available plugin update. * * @return void. */ public static function add_install_marketplace_plugin_message( $plugin_data, $response ) { if ( ! empty( $response->package ) || WC_Woo_Update_Manager_Plugin::is_plugin_active() ) { return; } if ( ! WC_Woo_Update_Manager_Plugin::is_plugin_installed() ) { printf( wp_kses( /* translators: 1: Woo Update Manager plugin install URL */ __( ' Install WooCommerce.com Update Manager to update.', 'woocommerce' ), array( 'a' => array( 'href' => array(), ), ) ), esc_url( WC_Woo_Update_Manager_Plugin::generate_install_url() ), ); return; } if ( ! WC_Woo_Update_Manager_Plugin::is_plugin_active() ) { esc_html_e( ' Activate WooCommerce.com Update Manager to update.', 'woocommerce' ); } } /** * Expired and lapsing subscriptions for a product that the merchant should act on. * * Every subscription the account holds for the product counts, wherever it is connected, * because renewing and buying can be done from any store. Nothing is returned while another * subscription still covers the product, so a store that keeps its updates stays quiet. * * @since 11.2.0 * * @param array $subscriptions Every subscription the account holds for the product. * * @return array A pair of subscriptions, each an array or false: the expired one, then the * lapsing one without auto-renew. */ private static function get_renewable_subscriptions( array $subscriptions ): array { if ( empty( $subscriptions ) ) { return array( false, false ); } // A lifetime subscription never lapses, so an expired flag on one is nothing to act on. $active = array_filter( $subscriptions, function ( $subscription ) { return empty( $subscription['expired'] ) || ! empty( $subscription['lifetime'] ); } ); // Nothing covers the product any more, so renewing is what restores updates. if ( empty( $active ) ) { return array( current( $subscriptions ), false ); } $lapsing = array_filter( $active, function ( $subscription ) { return ! empty( $subscription['expiring'] ) && empty( $subscription['autorenew'] ); } ); // One subscription that outlives the others keeps the product covered. if ( count( $lapsing ) !== count( $active ) ) { return array( false, false ); } return array( false, current( $lapsing ) ); } /** * Runs on in_plugin_update_message-{file-name}, show a message if plugins subscription expired or expiring soon. * * @param object $plugin_data An array of plugin metadata. * @param object $response An object of metadata about the available plugin update. * * @return void. */ public static function display_notice_for_expired_and_expiring_subscriptions( $plugin_data, $response ) { $product_id = self::get_product_id_from_update_response( $response ); if ( 0 === $product_id || null !== WC_Helper::get_api_error() ) { return; } self::print_update_row_message( self::get_renewal_notice( self::get_subscriptions_for_product( $product_id ), self::CAMPAIGN_UPDATE_ROW ) ); } /** * Runs on in_plugin_update_message-{file-name}, show a message if plugin is without a subscription. * Only Woo local plugins are passed to this function. * * @see setup_message_for_plugins_without_subscription * @param object $plugin_data An array of plugin metadata. * @param object $response An object of metadata about the available plugin update. * * @return void. */ public static function display_notice_for_plugins_without_subscription( $plugin_data, $response ) { $product_id = self::get_product_id_from_update_response( $response ); if ( 0 === $product_id || null !== WC_Helper::get_api_error() ) { return; } // An empty list after a failed fetch would be a guess, which the guard above rules out. if ( ! empty( self::get_subscriptions_for_product( $product_id ) ) ) { return; } self::print_update_row_message( self::get_purchase_notice( $product_id, self::get_product_page_url_from_update_response( $response ), self::CAMPAIGN_UPDATE_ROW ) ); } /** * Get update data for all extensions, for the WP-CLI extension command. * * Sends the same payload as get_update_data(), so both share one cached response and * report the same installed versions. * * @return array Update data {product_id => data} * @see get_update_data */ public static function get_available_extensions_downloads_data() { return self::_update_check( self::get_update_check_payload() ); } /** * Get update data for all extensions. * * Scans through all subscriptions for the connected user, as well * as all Woo extensions without a subscription, and obtains update * data for each product. * * @return array Update data {product_id => data} */ public static function get_update_data() { return self::_update_check( self::get_update_check_payload() ); } /** * The products to ask WooCommerce.com about, with the file ID and installed version of each. * * Covers every subscription plus every installed plugin and theme carrying a Woo header, * whether or not it has a subscription. Every caller has to send the same payload: the * server decides the autoupdate flag from the installed version, and the response is * cached under a hash of the payload. * * @since 11.2.0 * * @return array Payload keyed by product ID. */ private static function get_update_check_payload(): array { $payload = array(); foreach ( WC_Helper::get_subscriptions() as $subscription ) { $product_id = (int) $subscription['product_id']; $payload[ $product_id ] = array( 'product_id' => $product_id, 'file_id' => '', 'version' => '', ); } $installed = array_merge( WC_Helper::get_local_woo_plugins(), WC_Helper::get_local_woo_themes() ); foreach ( $installed as $data ) { if ( ! isset( $payload[ $data['_product_id'] ] ) ) { $payload[ $data['_product_id'] ] = array( 'product_id' => $data['_product_id'], ); } $payload[ $data['_product_id'] ]['file_id'] = $data['_file_id']; $payload[ $data['_product_id'] ]['version'] = (string) ( $data['Version'] ?? '' ); } return $payload; } /** * Get translations updates information. * * Scans through all subscriptions for the connected user, as well * as all Woo extensions without a subscription, and obtains update * data for each product. * * @return array Update data {product_id => data} */ public static function get_translations_update_data() { $payload = array(); $installed_translations = wp_get_installed_translations( 'plugins' ); $locales = array_values( get_available_languages() ); /** * Filters the locales requested for plugin translations. * * @since 3.7.0 * @since 4.5.0 The default value of the `$locales` parameter changed to include all locales. * * @param array $locales Plugin locales. Default is all available locales of the site. */ $locales = apply_filters( 'plugins_update_check_locales', $locales ); $locales = array_unique( $locales ); // No locales, the response will be empty, we can return now. if ( empty( $locales ) ) { return array(); } // Scan local plugins which may or may not have a subscription. $plugins = WC_Helper::get_local_woo_plugins(); $active_woo_plugins = array_intersect( array_keys( $plugins ), get_option( 'active_plugins', array() ) ); /* * Use only plugins that are subscribed to the automatic translations updates. */ $active_for_translations = array_filter( $active_woo_plugins, function ( $plugin ) use ( $plugins ) { /** * Filters the plugins that are subscribed to the automatic translations updates. * * @since 3.7.0 */ return apply_filters( 'woocommerce_translations_updates_for_' . $plugins[ $plugin ]['slug'], false ); } ); // Nothing to check for, exit. if ( empty( $active_for_translations ) ) { return array(); } if ( wp_doing_cron() ) { $timeout = 30; } else { // Three seconds, plus one extra second for every 10 plugins. $timeout = 3 + (int) ( count( $active_for_translations ) / 10 ); } $request_body = array( 'locales' => $locales, 'plugins' => array(), ); foreach ( $active_for_translations as $active_plugin ) { $plugin = $plugins[ $active_plugin ]; $request_body['plugins'][ $plugin['slug'] ] = array( 'version' => $plugin['Version'] ); } $raw_response = wp_remote_post( 'https://translate.wordpress.com/api/translations-updates/woocommerce', array( 'body' => wp_json_encode( $request_body ), 'headers' => array( 'Content-Type: application/json' ), 'timeout' => $timeout, ) ); // Something wrong happened on the translate server side. $response_code = wp_remote_retrieve_response_code( $raw_response ); if ( 200 !== $response_code ) { return array(); } $response = json_decode( wp_remote_retrieve_body( $raw_response ), true ); // API error, api returned but something was wrong. if ( array_key_exists( 'success', $response ) && false === $response['success'] ) { return array(); } $translations = array(); foreach ( $response['data'] as $plugin_name => $language_packs ) { foreach ( $language_packs as $language_pack ) { // Maybe we have this language pack already installed so lets check revision date. if ( array_key_exists( $plugin_name, $installed_translations ) && array_key_exists( $language_pack['wp_locale'], $installed_translations[ $plugin_name ] ) ) { $installed_translation_revision_time = new DateTime( $installed_translations[ $plugin_name ][ $language_pack['wp_locale'] ]['PO-Revision-Date'] ); $new_translation_revision_time = new DateTime( $language_pack['last_modified'] ); // Skip if translation language pack is not newer than what is installed already. if ( $new_translation_revision_time <= $installed_translation_revision_time ) { continue; } } $translations[] = array( 'type' => 'plugin', 'slug' => $plugin_name, 'language' => $language_pack['wp_locale'], 'version' => $language_pack['version'], 'updated' => $language_pack['last_modified'], 'package' => $language_pack['package'], 'autoupdate' => true, ); } } return $translations; } /** * Validates cached update data and checks if it matches the expected hash. * * Ensures the cached data is properly structured and corresponds to the current * payload to prevent fatal errors and avoid stale cache returns. * * @since 10.3.6 * * @param mixed $data The data retrieved from the transient. * @param string $hash The expected hash to compare against. * @return bool True if the data is valid and hash matches, false otherwise. */ private static function should_use_cached_update_data( $data, $hash ) { if ( ! is_array( $data ) ) { return false; } if ( ! isset( $data['hash'], $data['products'] ) ) { return false; } if ( ! is_string( $data['hash'] ) || ! is_array( $data['products'] ) ) { return false; } return hash_equals( $hash, $data['hash'] ); } /** * Extract the products from a cached update-check payload. * * Used on the paths that serve the previous cache rather than a fresh * response — while rate limited, and on the rate-limited response itself. * * @param mixed $data The data retrieved from the transient, of any shape. * @return array The cached products, or an empty array when there are none. */ private static function get_cached_products( $data ) { return ( is_array( $data ) && isset( $data['products'] ) && is_array( $data['products'] ) ) ? $data['products'] : array(); } /** * Run an update check API call. * * The call is cached based on the payload (product ids, file ids, installed versions). * If the payload changes, the cache is going to miss. The installed version has to be * part of the key: the server decides the autoupdate flag from it, so a response cached * under another version, after an update or a rollback, would carry a decision made for * a build that is no longer installed. * * @param array $payload Information about the plugin to update. * @return array Update data for each requested product. */ private static function _update_check( $payload ) { if ( empty( $payload ) ) { return array(); } ksort( $payload ); $hash = md5( wp_json_encode( $payload ) ); $cache_key = '_woocommerce_helper_updates'; $data = get_transient( $cache_key ); if ( self::should_use_cached_update_data( $data, $hash ) ) { return $data['products']; } // If a previous update-check was rate limited (HTTP 429), honor the // server's reset window and skip the remote call until it passes. This // backoff is independent of the payload hash above, so a changed payload // (or a flushed cache) can't slip past it — but clicking the Marketplace // "Refresh" button bypasses and clears it. Return the last cached // products, if any, rather than an empty set. if ( WC_Helper_API_Backoff::is_rate_limited( WC_Helper_API_Backoff::REQUEST_TYPE_UPDATE_CHECK ) ) { return self::get_cached_products( $data ); } $cached_data = $data; $data = array( 'hash' => $hash, 'updated' => time(), 'products' => array(), 'errors' => array(), ); // Detect if this is a manual refresh button click. $source = WC_Helper_API_Backoff::is_refresh_request() ? 'refresh-button' : ''; $request_body = array( 'products' => $payload ); if ( ! empty( $source ) ) { $request_body['source'] = $source; } if ( WC_Helper::is_site_connected() ) { $request = WC_Helper_API::post( 'update-check', array( 'body' => wp_json_encode( $request_body ), 'authenticated' => true, ) ); } else { $request = WC_Helper_API::post( 'update-check-public', array( 'body' => wp_json_encode( $request_body ), ) ); } $response_code = (int) wp_remote_retrieve_response_code( $request ); if ( 200 !== $response_code ) { $data['errors'][] = 'http-error'; // Respect server-side rate limiting: on a 429, record the reset window so // we hold off on further update-check calls until then, and return the // previously cached products without touching the cache. Caching this // empty result for 12 hours would outlive the reset window, and it would // discard the very products the backoff branch above serves while we wait. if ( 429 === $response_code && is_array( $request ) ) { WC_Helper_API_Backoff::record_from_response( WC_Helper_API_Backoff::REQUEST_TYPE_UPDATE_CHECK, $request ); return self::get_cached_products( $cached_data ); } } else { $data['products'] = json_decode( wp_remote_retrieve_body( $request ), true ); } set_transient( $cache_key, $data, 12 * HOUR_IN_SECONDS ); return $data['products']; } /** * Get the number of products that have updates. * * @return int The number of products with updates. */ public static function get_updates_count() { $cache_key = '_woocommerce_helper_updates_count'; $count = get_transient( $cache_key ); if ( false !== $count ) { return $count; } // Don't fetch any new data since this function in high-frequency. if ( ! get_transient( '_woocommerce_helper_subscriptions' ) ) { return 0; } if ( ! get_transient( '_woocommerce_helper_updates' ) ) { return 0; } $count = 0; $update_data = self::get_update_data(); if ( empty( $update_data ) ) { set_transient( $cache_key, $count, 12 * HOUR_IN_SECONDS ); return $count; } // Scan local plugins. foreach ( WC_Helper::get_local_woo_plugins() as $plugin ) { if ( empty( $update_data[ $plugin['_product_id'] ] ) ) { continue; } if ( ! is_plugin_active( $plugin['_filename'] ) ) { continue; } if ( version_compare( $plugin['Version'], $update_data[ $plugin['_product_id'] ]['version'], '<' ) ) { ++$count; } } // Scan local themes. foreach ( WC_Helper::get_local_woo_themes() as $theme ) { if ( empty( $update_data[ $theme['_product_id'] ] ) ) { continue; } if ( get_stylesheet() !== $theme['_stylesheet'] ) { continue; } if ( version_compare( $theme['Version'], $update_data[ $theme['_product_id'] ]['version'], '<' ) ) { ++$count; } } set_transient( $cache_key, $count, 12 * HOUR_IN_SECONDS ); return $count; } /** * Get the update count to based on the status of the site. * * @return int */ public static function get_updates_count_based_on_site_status() { if ( ! WC_Helper::is_site_connected() ) { return 0; } $count = self::get_updates_count() ?? 0; if ( ! WC_Woo_Update_Manager_Plugin::is_plugin_installed() || ! WC_Woo_Update_Manager_Plugin::is_plugin_active() ) { ++$count; } return $count; } /** * Get the type of woo connect notice to be shown in the WC Settings and Marketplace pages. * - If a store is connected to woocommerce.com or has no installed woo plugins, return 'none'. * - If a store has installed woo plugins but no updates, return 'short'. * - If a store has an installed woo plugin with update, return 'long'. * * @return string The notice type, 'none', 'short', or 'long'. */ public static function get_woo_connect_notice_type() { if ( WC_Helper::is_site_connected() ) { return 'none'; } $woo_plugins = WC_Helper::get_local_woo_plugins(); if ( empty( $woo_plugins ) ) { return 'none'; } $update_data = self::get_update_data(); if ( empty( $update_data ) ) { return 'short'; } // Scan local plugins. foreach ( $woo_plugins as $plugin ) { if ( empty( $update_data[ $plugin['_product_id'] ] ) ) { continue; } if ( version_compare( $plugin['Version'], $update_data[ $plugin['_product_id'] ]['version'], '<' ) ) { return 'long'; } } return 'short'; } /** * Return the updates count markup. * * @return string Updates count markup, empty string if no updates avairable. */ public static function get_updates_count_html() { $count = self::get_updates_count_based_on_site_status(); $count_html = sprintf( ' %d', $count, number_format_i18n( $count ) ); return $count_html; } /** * Flushes cached update data. */ public static function flush_updates_cache() { delete_transient( '_woocommerce_helper_updates' ); delete_transient( '_woocommerce_helper_updates_count' ); delete_site_transient( 'update_plugins' ); delete_site_transient( 'update_themes' ); } /** * Fires when a user successfully updated a theme or a plugin. */ public static function upgrader_process_complete() { delete_transient( '_woocommerce_helper_updates_count' ); WC_Helper::flush_local_woo_products_cache(); } /** * Hooked into the upgrader_pre_download filter in order to better handle error messaging around expired * plugin updates. Initially we were using an empty string, but the error message that no_package * results in does not fit the cause. * * @since 4.1.0 * @param bool $reply Holds the current filtered response. * @param string $package The path to the package file for the update. * @return false|WP_Error False to proceed with the update as normal, anything else to be returned instead of updating. */ public static function block_expired_updates( $reply, $package ) { // Don't override a reply that was set already. if ( false !== $reply ) { return $reply; } // Only for packages with expired subscriptions. if ( 0 !== strpos( $package, 'woocommerce-com-expired-' ) ) { return false; } return new WP_Error( 'woocommerce_subscription_expired', sprintf( // translators: %s: URL of WooCommerce.com subscriptions tab. __( 'Please visit the subscriptions page and renew to continue receiving updates.', 'woocommerce' ), esc_url( admin_url( 'admin.php?page=wc-admin&tab=my-subscriptions&path=%2Fextensions' ) ) ) ); } } WC_Helper_Updater::load(); https://lightningcareercoaching.ca/wp-sitemap-posts-post-1.xmlhttps://lightningcareercoaching.ca/wp-sitemap-posts-page-1.xmlhttps://lightningcareercoaching.ca/wp-sitemap-posts-lp_course-1.xmlhttps://lightningcareercoaching.ca/wp-sitemap-posts-product-1.xmlhttps://lightningcareercoaching.ca/wp-sitemap-taxonomies-category-1.xmlhttps://lightningcareercoaching.ca/wp-sitemap-taxonomies-post_tag-1.xmlhttps://lightningcareercoaching.ca/wp-sitemap-taxonomies-product_cat-1.xmlhttps://lightningcareercoaching.ca/wp-sitemap-taxonomies-course_category-1.xml