HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/html/ielts-store/wp-content/plugins/woocommerce-zapier/legacy/Admin/SystemStatus.php
<?php

namespace OM4\Zapier\Admin;

use OM4\WooCommerceZapier\LegacyMigration\ExistingUserUpgrade;
use OM4\Zapier\Plugin;
use OM4\Zapier\Feed\FeedFactory;

defined( 'ABSPATH' ) || exit;

/**
 * Adds various debugging information to the WooCommerce System Status screen
 *
 * @deprecated 2.0.0.
 */
class SystemStatus {

	/**
	 * Constructor
	 */
	public function __construct() {
		add_filter( 'wc_zapier_system_status_rows', array( $this, 'woocommerce_system_status_rows' ) );
	}

	/**
	 * Add our own debugging information to the WooCommerce Status screen.
	 *
	 * Executed by the `wc_zapier_system_status_rows` WooCommerce filter.
	 *
	 * @param array $posting data to be displayed on the WooCommerce status screen.
	 *
	 * @return mixed
	 */
	public function woocommerce_system_status_rows( $posting ) {
		// Pending Cron Tasks.
		$cron_array     = _get_cron_array();
		$num_cron_tasks = 0;
		foreach ( (array) $cron_array as $time => $cron ) {
			if ( 'version' === $time ) {
				continue;
			}
			foreach ( (array) $cron as $hook => $task ) {
				foreach ( (array) $task as $id => $details ) {
					if ( strpos( $hook, 'zapier_triggered_' ) !== false ) {
						$num_cron_tasks++;
					}
				}
			}
		}
		$note    = '';
		$success = true;
		if ( 0 === $num_cron_tasks ) {
			$note = '0';
		} elseif ( 1 === $num_cron_tasks ) {
			// 1 pending cron task.
			// Translators: %1$d: number of Zapier cron tasks. %2$s: URL of the WooCommerce Zapier documentation.
			$note    = sprintf( __( '%1$d pending Legacy cron task. Your WordPress cron may not be working correctly. Please see <a href="%2$s">here for troubleshooting steps</a>.', 'woocommerce-zapier' ), $num_cron_tasks, esc_url( Plugin::DOCUMENTATION_URL . '#troubleshooting' ) );
			$success = false;
		} else {
			// More than 1 pending cron tasks.
			// Translators: %1$d: number of Zapier cron tasks. %2$s: URL of the WooCommerce Zapier documentation.
			$note    = sprintf( __( '%1$d pending Legacy cron tasks. Your WordPress cron may not be working correctly. Please see <a href="%2$s">here for troubleshooting steps</a>.', 'woocommerce-zapier' ), $num_cron_tasks, esc_url( Plugin::DOCUMENTATION_URL . '#troubleshooting' ) );
			$success = false;
		}
		$posting['zapier_cron_tasks'] = array(
			'name'    => __( 'Legacy Cron Tasks', 'woocommerce-zapier' ),
			'note'    => $note,
			'success' => $success,
		);

		// Number of active Zapier Feeds.
		$feeds                               = FeedFactory::get_enabled_feeds();
		$num_feeds                           = count( $feeds );
		$posting['zapier_legacy_feed_count'] = array(
			'name'    => __( 'Active Legacy Feeds', 'woocommerce-zapier' ),
			'note'    => sprintf(
				// Translators: 1: Count of the active Legacy Zapier Feeds. 2: Migration Deadline. 3: Opening Link HTML Tag. 4: Closing Link HTML Tag.
				__( '%1$d active Legacy Feed(s) need to be migrated before %2$s. %3$sMigrate Your Zaps Now%4$s', 'woocommerce-zapier' ),
				$num_feeds,
				ExistingUserUpgrade::get_migration_deadline(),
				'<a href=" ' . ExistingUserUpgrade::MIGRATION_GUIDE_URL . '" target="_blank">',
				'</a>'
			),
			'success' => false,
		);

		// List each active Zapier Legacy Feeds.
		$i = 0;
		foreach ( $feeds as $feed ) {
			$i++;
			$posting[ 'zapier_legacy_feed_' . $feed->id() ] = array(
				// Translators: %d: Number of the current Zapier Feed.
				'name' => sprintf( __( 'Legacy Feed #%d', 'woocommerce-zapier' ), $i ),
				'note' => sprintf(
				// Translators: 1: Feed Name. 2: Trigger Name. 3: Webhook URL.
					__(
						'%1$s<br />
- Trigger: %2$s<br />
- Webhook URL: %3$s',
						'woocommerce-zapier'
					),
					$feed->title(),
					$feed->trigger()->get_trigger_title(),
					$feed->webhook_url()
				),
			);
		}
		return $posting;
	}
}