-
Notifications
You must be signed in to change notification settings - Fork 5
/
eightshift-forms.php
94 lines (78 loc) · 2.09 KB
/
eightshift-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
<?php
/**
* Plugin Name: Eightshift Forms
* Plugin URI: https://github.com/infinum/eightshift-forms
* Description: Eightshift Forms is a complete form builder plugin that utilizes modern Block editor features with multiple third-party integrations, bringing your project to a new level.
* Author: WordPress team @Infinum
* Author URI: https://eightshift.com/
* Version: 5.6.4
* Text Domain: eightshift-forms
*
* @package EightshiftForms
*/
declare(strict_types=1);
namespace EightshiftForms;
use EightshiftForms\Main\Main;
use EightshiftForms\Testfilters\Testfilters;
use EightshiftForms\Cache\ManifestCache;
/**
* If this file is called directly, abort.
*/
if (! \defined('WPINC')) {
die;
}
/**
* Bailout, if the plugin is not loaded via Composer.
*/
$autoloadPath = __DIR__ . '/vendor/autoload.php';
$autoloadVendorPath = __DIR__ . '/vendor-prefixed/autoload.php';
if (!\file_exists($autoloadPath) || !\file_exists($autoloadVendorPath)) {
return;
}
/**
* Require the Composer autoloader.
*/
$loader = require $autoloadPath;
require $autoloadVendorPath;
if (\class_exists(PluginFactory::class)) {
/**
* The code that runs during plugin activation.
*/
\register_activation_hook(
__FILE__,
function () {
PluginFactory::activate();
}
);
/**
* The code that runs during plugin deactivation.
*/
\register_deactivation_hook(
__FILE__,
function () {
PluginFactory::deactivate();
}
);
}
/**
* Set all the cache for the plugin.
*/
if (\class_exists(ManifestCache::class)) {
(new ManifestCache())->setProjectCache();
}
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*/
if (\class_exists(Main::class)) {
$sep = \DIRECTORY_SEPARATOR;
(new Main($loader->getPrefixesPsr4(), __NAMESPACE__))->register();
// Require public helper class.
require __DIR__ . "{$sep}src{$sep}Helpers{$sep}publicHelper.php";
// Require test filters.
require __DIR__ . "{$sep}testFilters{$sep}testFilters.php";
(new Testfilters())->register();
}