Repository navigation
Expand file tree
/
Copy pathread-offline.php
More file actions
52 lines (47 loc) · 1.67 KB
/
Copy pathread-offline.php
File metadata and controls
52 lines (47 loc) · 1.67 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
<?php
/**
* Plugin bootstrap for Read Offline.
*
* @package ReadOffline
* @wordpress-plugin
* Plugin Name: Read Offline
* Description: Export posts and pages to PDF, EPUB, and Markdown for offline reading or reuse.
* Version: 2.3.1
* Author: Per Soderlind
* Text Domain: read-offline
* Requires at least: 6.8
* Requires PHP: 8.3
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Queue-aware REST hooks (safe to include even if not used).
if ( file_exists( __DIR__ . '/includes/queue-hooks.php' ) ) {
require_once __DIR__ . '/includes/queue-hooks.php';
}
// Load Composer autoload if available.
$autoload = __DIR__ . '/vendor/autoload.php';
if ( file_exists( $autoload ) ) {
require_once $autoload;
} elseif ( file_exists( __DIR__ . '/includes/autoload-fallback.php' ) ) {
// If no Composer autoload, register a lightweight fallback for bundled libs.
require_once __DIR__ . '/includes/autoload-fallback.php';
}
// Include the generic updater class.
if ( ! class_exists( 'Soderlind\WordPress\GitHub_Plugin_Updater' ) ) {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-github-plugin-updater.php';
}
// Initialize the updater with configuration.
$read_offline_updater = \Soderlind\WordPress\GitHub_Plugin_Updater::create_with_assets(
'https://github.com/soderlind/read-offline',
__FILE__,
'read-offline',
'/read-offline\.zip/',
'main'
);
// Load polyfills for vendor libs (e.g., PHPePub on PHP 8+).
require_once __DIR__ . '/includes/phpepub-polyfills.php';
// Autoload classes.
require_once __DIR__ . '/includes/class-read-offline-loader.php';
// Initialize plugin.
add_action( 'plugins_loaded', array( 'Read_Offline_Loader', 'init' ) );