SILENT KILLERPanel

Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > pinterest-for-woocommerce > src


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//ameliagraphics.com/wp-content/plugins/pinterest-for-woocommerce/src

NameTypeSizeLast ModifiedActions
API Directory - -
Admin Directory - -
Exception Directory - -
MultichannelMarketing Directory - -
Notes Directory - -
Product Directory - -
Tracking Directory - -
Utilities Directory - -
View Directory - -
AdCredits.php File 8406 bytes August 26 2024 16:35:44.
AdCreditsCoupons.php File 1461 bytes August 26 2024 16:35:44.
AdsCreditCurrency.php File 1946 bytes May 20 2025 15:25:46.
Billing.php File 4901 bytes August 26 2024 16:35:44.
CommerceIntegration.php File 7185 bytes December 04 2024 18:47:06.
Compat.php File 952 bytes November 16 2021 18:14:38.
Crypto.php File 3718 bytes June 23 2025 21:16:30.
FeedFileOperations.php File 4680 bytes August 26 2024 16:35:44.
FeedGenerator.php File 22733 bytes August 26 2024 16:35:44.
FeedRegistration.php File 7230 bytes December 04 2024 18:47:06.
FeedStatusService.php File 20815 bytes March 18 2025 17:31:36.
Feeds.php File 13838 bytes December 04 2024 18:47:06.
Heartbeat.php File 1882 bytes October 23 2024 17:23:10.
LocalFeedConfigs.php File 3327 bytes September 24 2024 11:32:30.
LocaleMapper.php File 3167 bytes March 18 2025 17:31:36.
Logger.php File 3132 bytes August 26 2024 16:35:44.
Merchants.php File 6575 bytes September 24 2024 11:32:30.
PinterestApiException.php File 2767 bytes December 04 2024 18:47:06.
PinterestShippingZone.php File 7161 bytes February 16 2022 03:57:48.
PinterestSyncSettings.php File 3016 bytes August 26 2024 16:35:44.
PluginActivate.php File 785 bytes June 18 2022 00:23:22.
PluginHelper.php File 2537 bytes October 11 2022 17:51:18.
PluginUpdate.php File 11166 bytes May 29 2025 17:27:42.
ProductFeedStatus.php File 4453 bytes August 26 2024 16:35:44.
ProductSync.php File 6351 bytes September 24 2024 11:32:30.
ProductsXmlFeed.php File 17527 bytes February 11 2025 16:39:50.
RefreshToken.php File 3769 bytes August 26 2024 16:35:44.
RichPins.php File 9177 bytes August 26 2024 16:35:44.
SaveToPinterest.php File 3525 bytes April 26 2023 13:47:12.
Shipping.php File 8372 bytes February 16 2022 03:57:48.
TrackerSnapshot.php File 2574 bytes August 26 2024 16:35:44.
Tracking.php File 7488 bytes August 29 2024 22:54:16.
WPConsentAPI.php File 1178 bytes June 16 2025 21:44:24.
error_log File 260 bytes June 23 2025 21:16:32.

Reading File: /home/codekrsu//ameliagraphics.com/wp-content/plugins/pinterest-for-woocommerce/src/Logger.php

<?php
/**
 * Pinterest for WooCommerce Logger
 *
 * @version     1.0.0
 * @package     Pinterest_For_WooCommerce/API
 */

namespace Automattic\WooCommerce\Pinterest;

use WP_Error;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class responsible for logging stuff
 */
class Logger {

	/**
	 * The single instance of the class.
	 *
	 * @var \WC_Logger
	 * @since 1.0.0
	 */
	public static $logger;

	/**
	 * The log_file_name.
	 *
	 * @var string
	 */
	protected static $log_file_name = \PINTEREST_FOR_WOOCOMMERCE_LOG_PREFIX;

	/**
	 * Always log errors, Logging of debug messages can be disabled via a filter.
	 *
	 * @param string $message The message to be logged.
	 * @param string $level   The level/context of the message.
	 * @param string $feature Used to direct logs to a separate file.
	 * @param bool   $force   Used to bypass system settings and force the logs.
	 *
	 * @return void
	 */
	public static function log( $message, $level = 'debug', $feature = null, $force = false ): void {

		$allow_logging = true;
		if ( 'debug' === $level ) {
			$allow_logging = Pinterest_For_WooCommerce()::get_setting( 'enable_debug_logging' );
		}

		if ( $force ) {
			$allow_logging = true;
		}

		if ( empty( $allow_logging ) || ! function_exists( 'wc_get_logger' ) ) {
			return;
		}

		if ( ! self::$logger ) {
			self::$logger = wc_get_logger();
		}

		$handler = array( 'source' => self::$log_file_name . ( is_null( $feature ) ? '' : '-' . $feature ) );

		self::$logger->log( $level, $message, $handler );
	}

	/**
	 * Helper for Logging API requests.
	 *
	 * @param string   $url   The URL of the request.
	 * @param string[] $args  The Arguments of the request.
	 * @param string   $level The default level/context of the message to be logged.
	 *
	 * @return void
	 */
	public static function log_request( $url, $args, $level = 'debug' ) {
		unset( $args['headers'] );
		$method = $args['method'] ?? 'POST';
		$data   = ! empty( $args['body'] ) ? $args['body'] : '--- EMPTY STRING ---';
		$data   = is_array( $data ) ? wp_json_encode( $data ) : $data;
		self::log( "{$method} Request: " . $url . "\n\n" . $data . "\n", $level );
	}

	/**
	 *  Helper for Logging API responses.
	 *
	 * @param array|WP_Error $response The body of the response.
	 * @param string         $level    The default level/context of the message to be logged.
	 *
	 * @return void
	 */
	public static function log_response( $response, $level = 'debug' ) {
		if ( is_wp_error( $response ) ) {
			$level = 'error';
			$data  = $response->get_error_code() . ': ' . $response->get_error_message();
		} else {
			// Collecting response data.
			$status  = wp_remote_retrieve_response_code( $response );
			$message = wp_remote_retrieve_response_message( $response );
			$body    = wp_remote_retrieve_body( $response );
			$headers = wp_remote_retrieve_headers( $response );
			if ( is_object( $headers ) ) {
				$headers = $headers->getAll();
			}

			$data = 'Status: ' . $status . ' ' . $message . "\n\n" . 'Headers: ' . wp_json_encode( $headers ) . "\n\n" . 'Body: ' . $body;
		}

		self::log( 'Response: ' . "\n\n" . $data . "\n", $level );
	}
}


SILENT KILLER Tool