-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheacSoftwareRegistry_Distribution_SDK.php
executable file
·84 lines (78 loc) · 2.68 KB
/
eacSoftwareRegistry_Distribution_SDK.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
<?php
/**
* EarthAsylum Consulting {eac} Software Registration Server - Distribution SDK
*
* @category WordPress Plugin
* @package {eac}SoftwareRegistry Distribution SDK
* @author Kevin Burkholder <KBurkholder@EarthAsylum.com>
* @copyright Copyright (c) 2024 EarthAsylum Consulting <www.earthasylum.com>
* @uses {eac}SoftwareRegistry
*
* @wordpress-plugin
* Plugin Name: {eac}SoftwareRegistry Distribution SDK
* Description: Software Registration Server Distribution SDK - generate custom PHP packages that can be include in your project to register your product with your registration server.
* Version: 1.1.1
* Requires at least: 5.8
* Tested up to: 6.7
* Requires PHP: 7.4
* Plugin URI: https://swregistry.earthasylum.com/software-registry-sdk/
* Author: EarthAsylum Consulting
* Author URI: http://www.earthasylum.com
* License: GPLv3 or later
* License URI: https://www.gnu.org/licenses/gpl.html
* Text Domain: eacSoftwareRegistry
* Domain Path: /languages
*/
/**
* This simple plugin file responds to the 'eacSoftwareRegistry_load_extensions' filter to load additional extensions.
* Using this method prevents overwriting extensions when the plugin is updated or reinstalled.
*/
namespace EarthAsylumConsulting;
define('EAC_SOFTWARE_REGISTRY_SDK', dirname(__FILE__));
class eacSoftwareRegistry_Distribution_SDK
{
/**
* constructor method
*
* @return void
*/
public function __construct()
{
/**
* eacSoftwareRegistry_load_extensions - get the extensions directory to load
*
* @param array $extensionDirectories - array of [plugin_slug => plugin_directory]
* @return array updated $extensionDirectories
*/
add_filter( 'eacSoftwareRegistry_load_extensions', function($extensionDirectories)
{
/*
* Enable update notice (self hosted or wp hosted)
*/
eacSoftwareRegistry::loadPluginUpdater(__FILE__,'wp');
/*
* Add links on plugins page
*/
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ),function($pluginLinks, $pluginFile, $pluginData)
{
return array_merge(
[
'settings' => eacSoftwareRegistry::getSettingsLink($pluginData,'distribution'),
'documentation' => eacSoftwareRegistry::getDocumentationLink($pluginData),
'support' => eacSoftwareRegistry::getSupportLink($pluginData),
],
$pluginLinks
);
},20,3
);
/*
* Add our extension to load
*/
$extensionDirectories[ plugin_basename( __FILE__ ) ] = [plugin_dir_path( __FILE__ )];
return $extensionDirectories;
}
);
}
}
new \EarthAsylumConsulting\eacSoftwareRegistry_Distribution_SDK();
?>