-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvmfa-folder-exporter.php
More file actions
65 lines (55 loc) · 2.05 KB
/
vmfa-folder-exporter.php
File metadata and controls
65 lines (55 loc) · 2.05 KB
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
<?php
/**
* Plugin Name: Virtual Media Folders - Folder Exporter
* Plugin URI: https://github.com/soderlind/vmfa-folder-exporter
* Description: Export folders (or subtrees) as ZIP archives with optional CSV manifests. Add-on for Virtual Media Folders.
* Version: 1.3.0
* Requires at least: 6.8
* Requires PHP: 8.3
* Requires Plugins: virtual-media-folders
* Author: Per Soderlind
* Author URI: https://soderlind.no
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: vmfa-folder-exporter
* Domain Path: /languages
*
* @package VmfaFolderExporter
*/
declare(strict_types=1);
namespace VmfaFolderExporter;
defined( 'ABSPATH' ) || exit;
// Plugin constants.
define( 'VMFA_FOLDER_EXPORTER_VERSION', '1.3.0' );
define( 'VMFA_FOLDER_EXPORTER_FILE', __FILE__ );
define( 'VMFA_FOLDER_EXPORTER_PATH', plugin_dir_path( __FILE__ ) );
define( 'VMFA_FOLDER_EXPORTER_URL', plugin_dir_url( __FILE__ ) );
define( 'VMFA_FOLDER_EXPORTER_BASENAME', plugin_basename( __FILE__ ) );
// Require Composer autoloader.
if ( file_exists( VMFA_FOLDER_EXPORTER_PATH . 'vendor/autoload.php' ) ) {
require_once VMFA_FOLDER_EXPORTER_PATH . 'vendor/autoload.php';
}
// Initialize Action Scheduler early (must be loaded before plugins_loaded).
use VirtualMediaFolders\Addon\ActionSchedulerLoader;
ActionSchedulerLoader::maybe_load( VMFA_FOLDER_EXPORTER_PATH );
/**
* Initialize the plugin.
*
* @return void
*/
function init(): void {
// Update checker via GitHub releases.
if ( ! class_exists( \Soderlind\WordPress\GitHubUpdater::class) ) {
require_once __DIR__ . '/class-github-updater.php';
}
\Soderlind\WordPress\GitHubUpdater::init(
github_url: 'https://github.com/soderlind/vmfa-folder-exporter',
plugin_file: VMFA_FOLDER_EXPORTER_FILE,
plugin_slug: 'vmfa-folder-exporter',
name_regex: '/vmfa-folder-exporter\.zip/',
branch: 'main',
);
// Boot the plugin.
Plugin::get_instance()->init();
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\\init', 15 );