[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Factory.php
<?php /** * Notification Factory */ declare( strict_types = 1 ); namespace Automattic\WooCommerce\Internal\StockNotifications; use Automattic\WooCommerce\Internal\StockNotifications\Notification; defined( 'ABSPATH' ) || exit; /** * Notification factory class */ class Factory { /** * Get the notification object. * * @param int $notification_id Notification ID to get. * @return Notification|bool */ public static function get_notification( int $notification_id ) { if ( ! $notification_id ) { return false; } try { $notification = new Notification( $notification_id ); return $notification; } catch ( \Exception $e ) { \wc_caught_exception( $e, __FUNCTION__, array( $notification_id ) ); return false; } } /** * Create a dummy notification for preview/testing purposes. * * @return Notification */ public static function create_dummy_notification(): Notification { $notification = new Notification(); // Create a dummy product. $product = new \WC_Product(); $product->set_name( __( 'Dummy Product', 'woocommerce' ) ); $product->set_price( 25 ); $product->set_image_id( get_option( 'woocommerce_placeholder_image', 0 ) ); // Set required notification data. $notification->set_product_id( $product->get_id() ); $notification->set_user_email( 'preview@example.com' ); // Store the dummy product in the notification object for preview. $notification->product = $product; return $notification; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium707.web-hosting.com
Server IP: 198.177.120.115
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium707.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.19 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: urbaoubp
User ID (UID): 1252
Group ID (GID): 1257
Script Owner UID: 1252
Current Dir Owner: 1252