Linux webm017.cluster130.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid x86_64
PHP/7.4.33
服务器IP :
10.130.20.17
& 您的IP :
216.73.217.47
域名 :
无法读取 [ /etc/named.conf ]
用户 :
koaigpw
上传
终端
新建文件
新建文件夹
Create WP User
登出
+
/
home
/
koaigpw
/
budomat.net.pl
/
wp-content
/
plugins
/
woocommerce
/
src
/
Internal
/
PushNotifications
/
[ 返回根目录 ]
名称
大小
权限
修改时间
操作
..
-
-
-
DataStores
[目录]
drwxr-xr-x
2026-03-03 00:17
Entities
[目录]
drwxr-xr-x
2026-05-26 02:38
Exceptions
[目录]
drwxr-xr-x
2026-03-03 00:17
PushNotifications.php
3.14 KB
-rw-r--r--
2026-03-03 00:17
>_
终端
关闭 ✕
输入 'help' 查看可用命令。
koaigpw@
>
新建文件
文件名
取消
创建
重命名
新名称
取消
重命名
Create WordPress User
Auto (baca dari file CMS)
Manual (isi kredensial DB)
代码编辑器 :
PushNotifications.php
<?php declare(strict_types=1); namespace Automattic\WooCommerce\Internal\PushNotifications; defined( 'ABSPATH' ) || exit; use Automattic\Jetpack\Connection\Manager as JetpackConnectionManager; use Automattic\WooCommerce\Internal\PushNotifications\Entities\PushToken; use Automattic\WooCommerce\Proxies\LegacyProxy; use Automattic\WooCommerce\Utilities\FeaturesUtil; use WC_Logger; use Exception; /** * WC Push Notifications * * Class for setting up the WooCommerce-driven push notifications. * * @since 10.4.0 */ class PushNotifications { /** * Feature name for the push notifications feature. */ const FEATURE_NAME = 'push_notifications'; /** * Roles that can receive push notifications. * * This will be used to gate functionality access to just these roles. */ const ROLES_WITH_PUSH_NOTIFICATIONS_ENABLED = array( 'administrator', 'shop_manager', ); /** * 'Memoized' enablement flag. * * @var bool|null */ private ?bool $enabled = null; /** * Loads the push notifications class. * * @return void * * @since 10.4.0 */ public function register(): void { if ( ! $this->should_be_enabled() ) { return; } add_action( 'init', array( $this, 'register_post_types' ) ); // Library endpoints and scheduled tasks will be registered here. } /** * Registers the push token custom post type. * * @since 10.5.0 * @return void */ public function register_post_types(): void { register_post_type( PushToken::POST_TYPE, array( 'labels' => array( 'name' => __( 'Push Tokens', 'woocommerce' ), 'singular_name' => __( 'Push Token', 'woocommerce' ), ), 'public' => false, 'publicly_queryable' => false, 'show_ui' => false, 'show_in_menu' => false, 'query_var' => false, 'rewrite' => false, 'capability_type' => 'post', 'has_archive' => false, 'hierarchical' => false, 'supports' => array( 'author' ), 'can_export' => false, 'delete_with_user' => true, ) ); } /** * Determines if local push notification functionality should be enabled. * Push notifications require both the feature flag to be enabled and * Jetpack to be connected. Memoize the value so we only check once per * request. * * @return bool * * @since 10.4.0 */ public function should_be_enabled(): bool { if ( null !== $this->enabled ) { return $this->enabled; } if ( ! FeaturesUtil::feature_is_enabled( self::FEATURE_NAME ) ) { $this->enabled = false; return $this->enabled; } try { $proxy = wc_get_container()->get( LegacyProxy::class ); $this->enabled = ( class_exists( JetpackConnectionManager::class ) && $proxy->get_instance_of( JetpackConnectionManager::class )->is_connected() ); } catch ( Exception $e ) { $logger = wc_get_container()->get( LegacyProxy::class )->call_function( 'wc_get_logger' ); if ( $logger instanceof WC_Logger ) { $logger->error( 'Error determining if PushNotifications feature should be enabled: ' . $e->getMessage() ); } $this->enabled = false; } return $this->enabled; } }
关闭
保存