| 1 |
<?php |
| 2 |
|
| 3 |
namespace Code_Snippets\Integration\Promotions\Notices; |
| 4 |
|
| 5 |
/** |
| 6 |
* Promotion class for the Woody Code Snippets plugin. |
| 7 |
* |
| 8 |
* @link https://wordpress.org/plugins/insert-php/ |
| 9 |
*/ |
| 10 |
class Insert_PHP extends Promotion_Base { |
| 11 |
|
| 12 |
/** |
| 13 |
* Get the name of the plugin being promoted. |
| 14 |
* |
| 15 |
* @return string The plugin name. |
| 16 |
*/ |
| 17 |
public function get_plugin_name(): string { |
| 18 |
return __( 'Woody Code Snippets', 'code-snippets' ); |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* Get the slug of the plugin being promoted. |
| 23 |
* |
| 24 |
* @return string The plugin slug. |
| 25 |
*/ |
| 26 |
public function get_plugin_slug(): string { |
| 27 |
return 'insert-php'; |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* Get the admin screens where the promotion should be displayed. |
| 32 |
* |
| 33 |
* @return array An array of admin screen IDs. |
| 34 |
*/ |
| 35 |
public function get_plugin_admin_screens(): array { |
| 36 |
return [ |
| 37 |
'wbcr-snippets', |
| 38 |
'edit-wbcr-snippets', |
| 39 |
'edit-wbcr-snippet-tags', |
| 40 |
'wbcr-snippets_page_winp-new-item', |
| 41 |
'wbcr-snippets_page_winp-settings', |
| 42 |
'wbcr-snippets_page_snippet-library', |
| 43 |
'wbcr-snippets_page_ti-about-insert_php', |
| 44 |
]; |
| 45 |
} |
| 46 |
|
| 47 |
/** |
| 48 |
* Get the message text for the promotion notice. |
| 49 |
* |
| 50 |
* @return string The promotion message. |
| 51 |
*/ |
| 52 |
public function get_promotion_message(): string { |
| 53 |
return __( 'Move your functionality to Code Snippets and reduce your dependency on third-party plugins.', 'code-snippets' ); |
| 54 |
} |
| 55 |
} |
| 56 |
|