36 |
37 | 7.2.5. Please update the PHP on your server and try again.', 'plugin_name' ),
40 | [
41 | 'strong' => [],
42 | ]
43 | );
44 | ?>
45 |
46 |
47 |
48 | make( Plugin::class ) )->run();
88 |
89 | /**
90 | * You can use the $injector->make( PluginName\Some\Class::class ) for get any plugin class.
91 | * More detail: https://github.com/wppunk/WPPlugin#dependency-injection-container
92 | */
93 | do_action( 'plugin_name_init', $injector );
94 | }
95 |
96 | add_action( 'plugins_loaded', 'run_plugin_name' );
97 |
--------------------------------------------------------------------------------
/readme.txt:
--------------------------------------------------------------------------------
1 | === Plugin Name ===
2 | Contributors: {AUTHOR}
3 | Donate link: TODO: Fill ( https://your-donate.link )
4 | Tags: TODO: Fill ( tag1, tag2, tag3 )
5 | Requires at least: 5.5
6 | Tested up to: 5.5
7 | Stable tag: 1.0.0
8 | Requires PHP: 7.2.5
9 | License: MIT
10 |
11 | Plugin description in search plugin.
12 |
13 | == Description ==
14 |
15 | Plugin description on plugin page.
16 |
17 | = Features =
18 | * Feature 1
19 | * Feature 2
20 |
21 | == Installation ==
22 |
23 | 1. Upload `plugin-name` folder to the `/wp-content/plugins/` directory.
24 | 2. Activate the plugin through the 'Plugins' menu in WordPress.
25 |
26 | == Frequently Asked Questions ==
27 |
28 | = FAQ Question 1 =
29 |
30 | FAQ Answer 1
31 |
32 | = FAQ Question 2 =
33 |
34 | FAQ Answer 2
35 |
36 | == Changelog ==
37 |
38 | = 1.0.0 =
39 | * Initial release
40 |
41 | == Upgrade Notice ==
42 |
43 | = 1.0.0 =
44 | * Initial release
45 |
46 | == Screenshots ==
47 |
48 | 1. /assets/img/screenshot-1.png
49 |
--------------------------------------------------------------------------------
/src/Admin/SettingsPage.php:
--------------------------------------------------------------------------------
1 | injector = $injector;
57 | }
58 |
59 | /**
60 | * Run plugin
61 | *
62 | * @since {VERSION}
63 | *
64 | * @throws Exception Object doesn't exist.
65 | */
66 | public function run(): void {
67 | is_admin()
68 | ? $this->run_admin()
69 | : $this->run_front();
70 | }
71 |
72 | /**
73 | * Run admin part
74 | *
75 | * @since {VERSION}
76 | *
77 | * @throws InjectionException If a cyclic gets detected when provisioning.
78 | */
79 | private function run_admin(): void {
80 | $this->injector->make( SettingsPage::class )->hooks();
81 | }
82 |
83 | /**
84 | * Run frontend part
85 | *
86 | * @since {VERSION}
87 | *
88 | * @throws InjectionException If a cyclic gets detected when provisioning.
89 | */
90 | private function run_front(): void {
91 | $this->injector->make( Front::class )->hooks();
92 | }
93 |
94 | }
95 |
--------------------------------------------------------------------------------
/templates/admin/settings.php:
--------------------------------------------------------------------------------
1 |
17 |
18 |