-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhizzle-forms.php
113 lines (94 loc) · 3.18 KB
/
hizzle-forms.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
/**
* Plugin Name: YooForms
* Plugin URI: https://yoostrap.com/yooforms/
* Description: A lightweight forms plugin.
* Version: 1.0.8
* Author: Yoostrap
* Author URI: https://yoostrap.com
* Text Domain: hizzle-forms
* Domain Path: /languages/
* Requires at least: 5.5
* Requires PHP: 7.0
*
* @fs_premium_only /pro/
*/
defined( 'ABSPATH' ) || exit;
// Define constants
if ( ! defined( 'HIZZLE_FORMS_PLUGIN_FILE' ) ) {
define( 'HIZZLE_FORMS_PLUGIN_FILE', __FILE__ );
}
if ( ! defined( 'HIZZLE_FORMS_VERSION' ) ) {
define( 'HIZZLE_FORMS_VERSION', '1.0.8' );
}
if ( ! defined( 'HIZZLE_FORMS_DB_VERSION' ) ) {
define( 'HIZZLE_FORMS_DB_VERSION', 1 );
}
define( 'HF_PATH', plugin_dir_path( __FILE__ ) );
define( 'HF_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets/' );
// Include the auto loader
require HF_PATH . 'vendor/autoload.php';
// Include necessary files
require_once HF_PATH . 'src/functions.php';
require_once HF_PATH . 'src/constants.php';
// Freemius SDK initialization
if ( ! function_exists( 'hf_fs' ) ) {
// Create a helper function for easy SDK access.
function hf_fs() {
global $hf_fs;
if ( ! isset( $hf_fs ) ) {
// Activate multisite network integration.
if ( ! defined( 'WP_FS__PRODUCT_15381_MULTISITE' ) ) {
define( 'WP_FS__PRODUCT_15381_MULTISITE', true );
}
// Include Freemius SDK
require_once HF_PATH . 'freemius/start.php';
$hf_fs = fs_dynamic_init( array(
'id' => '15381',
'slug' => 'hizzle-forms',
'premium_slug' => 'hizzle-forms-pro',
'type' => 'plugin',
'public_key' => 'pk_f965caeb7b47a4d6607381e3b3704',
'is_premium' => true,
'premium_suffix' => 'Starter',
// If your plugin is a serviceware, set this option to false.
'has_premium_version' => true,
'has_addons' => false,
'has_paid_plans' => true,
'trial' => array(
'days' => 7,
'is_require_payment' => false,
),
'menu' => array(
'slug' => 'hizzle-forms',
'first-path' => 'admin.php?page=hizzle-forms-help',
'network' => true,
),
) );
}
return $hf_fs;
}
hf_fs();
do_action( 'hf_fs_loaded' );
}
// Activation hook to create the table
register_activation_hook( __FILE__, 'hizzle_forms_create_table' );
function hizzle_forms_create_table() {
hizzle_forms_create_table_helper();
}
// Check and create the table on admin init
add_action( 'admin_init', 'hizzle_forms_check_and_create_table' );
function hizzle_forms_check_and_create_table() {
hizzle_forms_create_table_helper();
}
/**
* Returns the main plugin instance.
*
* @since 1.0.0
* @return Hizzle\Forms\Plugin
*/
function hizzle_forms() {
return Hizzle\Forms\Plugin::instance();
}
// Initialize the plugin
hizzle_forms();