-
Notifications
You must be signed in to change notification settings - Fork 2
/
bootstrap.php
72 lines (71 loc) · 3.08 KB
/
bootstrap.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
<?php
/**
* Plugin Name:
* Plugin URI:
* Description:
* Version: 1.0
* Author: Jigoshop
* Author URI: https://www.jigoshop.com
* Init File Version: 1.5
* Init File Date: 22.08.2016
*/
// Define plugin name
define('JIGOSHOP_PLUGIN_NAME_NAME', 'Plugin Name');
add_action('plugins_loaded', function () {
load_plugin_textdomain('plugin_textdomain', false, dirname(plugin_basename(__FILE__)) . '/languages/');
if (class_exists('\Jigoshop\Core')) {
//Check version.
if (\Jigoshop\addRequiredVersionNotice(JIGOSHOP_PLUGIN_NAME_NAME, '2.0')) {
return;
}
//Check license.
$licence = new \Jigoshop\Licence(__FILE__, '111111', 'http://www.jigoshop.com');
if (!$licence->isActive()) {
return;
}
// Define plugin directory for inclusions
define('JIGOSHOP_PLUGIN_NAME_DIR', dirname(__FILE__));
// Define plugin URL for assets
define('JIGOSHOP_PLUGIN_NAME_URL', plugins_url('', __FILE__));
//Init components.
require_once(JIGOSHOP_PLUGIN_NAME_DIR . '/src/Jigoshop/Extension/PluginName/Common.php');
if (is_admin()) {
require_once(JIGOSHOP_PLUGIN_NAME_DIR . '/src/Jigoshop/Extension/PluginName/Admin.php');
} else {
require_once(JIGOSHOP_PLUGIN_NAME_DIR . '/src/Jigoshop/Extension/PluginName/Shop.php');
}
} elseif (class_exists('jigoshop')) {
//Check version.
if (jigoshop_add_required_version_notice(JIGOSHOP_PLUGIN_NAME_NAME, '1.17')) {
return;
}
//Check license.
$licence = new jigoshop_licence_validator(__FILE__, '111111', 'http://www.jigoshop.com');
if (!$licence->is_licence_active()) {
return;
}
// Define plugin directory for inclusions
define('JIGOSHOP_PLUGIN_NAME_DIR', dirname(__FILE__) . '/Jigoshop1x');
// Define plugin URL for assets
define('JIGOSHOP_PLUGIN_NAME_URL', plugins_url('', __FILE__) . '/Jigoshop1x');
//Init components.
require_once(JIGOSHOP_PLUGIN_NAME_DIR . '/src/to/old/plugin/start/file.php');
} else {
add_action('admin_notices', function () {
echo '<div class="error"><p>';
printf(__('%s requires Jigoshop plugin to be active. Code for plugin %s was not loaded.',
'plugin_textdomain'), JIGOSHOP_PLUGIN_NAME_NAME, JIGOSHOP_PLUGIN_NAME_NAME);
echo '</p></div>';
});
}
});
// this code need to be moved to the initial admin class
if (is_admin()) {
add_filter('plugin_action_links_' . plugin_basename(__FILE__), function ($links) {
$links[] = '<a href="https://www.jigoshop.com/documentation/plugin_name" target="_blank">Documentation</a>';
$links[] = '<a href="https://www.jigoshop.com/support/" target="_blank">Support</a>';
$links[] = '<a href="https://wordpress.org/support/view/plugin-reviews/jigoshop#postform" target="_blank">Rate Us</a>';
$links[] = '<a href="https://www.jigoshop.com/product-category/extensions/" target="_blank">More plugins for Jigoshop</a>';
return $links;
});
}