PluginProbe
Code Snippets / 3.10.1
Code Snippets v3.10.1
3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 3.0.1 All 64 releases
code-snippets / php / Integration / Promotions / Notices / Header_Footer_Code_Manager.php

Header_Footer_Code_Manager.php in Code Snippets 3.10.1, at php/Integration/Promotions/Notices/Header_Footer_Code_Manager.php

66 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Code_Snippets\Integration\Promotions\Notices;
4
5 use Code_Snippets\REST_API\Import\Plugins\Header_Footer_Code_Manager_Plugin_Importer;
6
7 /**
8 * Promotion class for Header Footer Code Manager.
9 *
10 * @link https://wordpress.org/plugins/header-footer-code-manager/
11 */
12 class Header_Footer_Code_Manager extends Promotion_Base {
13
14 /**
15 * Get the name of the plugin being promoted.
16 *
17 * @return string The plugin name.
18 */
19 public function get_plugin_name(): string {
20 return __( 'Header Footer Code Manager', 'code-snippets' );
21 }
22
23 /**
24 * Get the slug of the plugin being promoted.
25 *
26 * @return string The plugin slug.
27 */
28 public function get_plugin_slug(): string {
29 return 'header-footer-code-manager';
30 }
31
32 /**
33 * Get the admin screens where the promotion should be displayed.
34 *
35 * @return array An array of admin screen IDs.
36 */
37 public function get_plugin_admin_screens(): array {
38 return [
39 'toplevel_page_hfcm-list',
40 'hfcm_page_hfcm-tools',
41 'hfcm_page_hfcm-create',
42 'admin_page_hfcm-update',
43 ];
44 }
45
46 /**
47 * Get the message text for the promotion notice.
48 *
49 * @return string The promotion message.
50 */
51 public function get_promotion_message(): string {
52 return __( 'Move your functionality to Code Snippets and reduce your dependency on third-party plugins.', 'code-snippets' );
53 }
54
55 /**
56 * Check if the user should see the migration button.
57 *
58 * @return bool Whether the user should see the migration button.
59 */
60 public function show_migration_button(): bool {
61 $importer = new Header_Footer_Code_Manager_Plugin_Importer();
62 $data = $importer->get_data();
63 return ! empty( $data );
64 }
65 }
66