HEX
Server: Apache
System: Linux p3plzcpnl504902.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: nhqyemt2u0zd (3690907)
PHP: 7.2.34
Disabled: NONE
Upload Files
File: /home/nhqyemt2u0zd/www/wp-content/plugins/official-facebook-pixel/core/FacebookPluginUtils.php
<?php
/*
 * Copyright (C) 2017-present, Facebook, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

/**
 * @package FacebookPixelPlugin
 */

namespace FacebookPixelPlugin\Core;

defined('ABSPATH') or die('Direct access not allowed');

/**
 * Helper functions
 */
class FacebookPluginUtils {
  /**
   * Returns true if id is a positive non-zero integer
   *
   * @access public
   * @param string $pixel_id
   * @return bool
   */
  public static function isPositiveInteger($pixel_id) {
    return isset($pixel_id) && ctype_digit($pixel_id) && $pixel_id !== '0';
  }

  /**
   * Whether current user is Administrator.
   */
  public static function isAdmin() {
    return current_user_can('install_plugins');
  }
}