PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 3.3.2
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v3.3.2
3.3.2 3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 All 157 releases
notificationx / vendor / priyomukul / wp-notice / src / Utils / Helper.php

Helper.php in NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar 3.3.2, at vendor/priyomukul/wp-notice/src/Utils/Helper.php

47 lines 863 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace PriyoMukul\WPNotice\Utils;
4
5 use Exception;
6
7 trait Helper {
8
9 public function is_installed( $plugin ) {
10 if ( ! function_exists( 'get_plugins' ) ) {
11 require_once ABSPATH . 'wp-admin/includes/plugin.php';
12 }
13 $plugins = get_plugins();
14
15 return isset( $plugins[ $plugin ] ) ? $plugins[ $plugin ] : false;
16 }
17
18 /**
19 * Get current timestamp
20 * @return integer
21 */
22 public function time() {
23 return intval( current_time( 'timestamp' ) );
24 }
25
26 /**
27 * Make timestamp for a number
28 *
29 * @param string $time
30 *
31 * @return int
32 */
33 public function strtotime( $time = '+7 day' ) {
34 return intval( strtotime( date( 'r', $this->time() ) . " $time" ) );
35 }
36
37 public function date( $time ) {
38 return date( 'd-m-Y h:i:s', $time );
39 }
40
41 /**
42 * @throws Exception
43 */
44 private function error( $message ) {
45 throw new Exception( $message );
46 }
47 }