-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathiworks-pwa.php
98 lines (85 loc) · 2.41 KB
/
iworks-pwa.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
95
96
97
<?php
/*
Plugin Name: PWA — simple way to Progressive Web App
Text Domain: iworks-pwa
Plugin URI: PLUGIN_URI
Description: PLUGIN_TAGLINE
Version: PLUGIN_VERSION
Author: Marcin Pietrzak
Author URI: http://iworks.pl/
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Copyright 2021-PLUGIN_TILL_YEAR Marcin Pietrzak ([email protected])
this program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* static options
*/
$base = dirname( __FILE__ );
$includes = $base . '/includes';
/**
* get plugin settings
*
* @since 1.0.1
*/
include_once $base . '/etc/options.php';
/**
* @since 1.0.6
*/
if ( ! class_exists( 'iworks_options' ) ) {
include_once $includes . '/iworks/options/options.php';
}
/**
* load
*/
require_once $includes . '/iworks/pwa/class-iworks-pwa-manifest.php';
require_once $includes . '/iworks/pwa/class-iworks-pwa-frontend.php';
require_once $includes . '/iworks/pwa/class-iworks-pwa-apple.php';
require_once $includes . '/iworks/pwa/class-iworks-pwa-microsoft.php';
/**
* run
*/
new iWorks_PWA_manifest;
new iWorks_PWA_Frontend;
new iWorks_PWA_Apple;
new iWorks_PWA_Microsoft;
/**
* admin
*/
if ( is_admin() ) {
require_once $includes . '/iworks/pwa/class-iworks-pwa-administrator.php';
new iWorks_PWA_Administrator;
}
/**
* load options
*
* since 2.6.8
*
*/
global $iworks_pwa_options;
$iworks_pwa_options = null;
function get_iworks_pwa_options() {
global $iworks_pwa_options;
if ( is_object( $iworks_pwa_options ) ) {
return $iworks_pwa_options;
}
$iworks_pwa_options = new iworks_options();
$iworks_pwa_options->set_option_function_name( 'iworks_pwa_options' );
$iworks_pwa_options->set_option_prefix( 'iworks_pwa_' );
if ( method_exists( $iworks_pwa_options, 'set_plugin' ) ) {
$iworks_pwa_options->set_plugin( basename( __FILE__ ) );
}
return $iworks_pwa_options;
}