Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/php/class-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ public function load_plugin() {
// Importers.
new Plugins_Import_Manager();
new Files_Import_Manager();
// Initialize promotions.
new Promotions\Elementor_Pro();

// Promotions.
new Promotion_Manager();
}

/**
Expand Down
38 changes: 38 additions & 0 deletions src/php/promotions/admin-notices/elementor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
namespace Code_Snippets\Promotions;

class Elementor extends Promotion_Base {

public function get_plugin_name(): string {
return esc_html__( 'Elementor Custom Code', 'code-snippets' );
}

public function get_plugin_slug(): string {
return 'elementor';
}

public function get_plugin_admin_screens(): array {
return [
// Elementor Core
'elementor_custom_code',
'elementor_page_elementor_custom_code',
// Elementor Pro
'edit-elementor_snippet',
'elementor_snippet',
// New Elementor One
'elementor_page_e-custom-code',
];
}

public function get_promotion_heading(): string {
return esc_html__( 'Upgrade to the Industry Standard for Code Management', 'code-snippets' );
}

public function get_promotion_message(): string {
return esc_html__( 'Move your custom logic into a dedicated dashboard built for professionals. Experience a cleaner workflow with advanced security and global organization.', 'code-snippets' );
}

public function get_promotion_buttons(): array {
return $this->get_default_buttons();
}
}
31 changes: 31 additions & 0 deletions src/php/promotions/admin-notices/head-footer-code.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
namespace Code_Snippets\Promotions;

class Header_Footer_Code extends Promotion_Base {

public function get_plugin_name(): string {
return esc_html__( 'Head & Footer Code', 'code-snippets' );
}

public function get_plugin_slug(): string {
return 'head-footer-code';
}

public function get_plugin_admin_screens(): array {
return [
'tools_page_head-footer-code'
];
}

public function get_promotion_heading(): string {
return esc_html__( 'Stop worrying about breaking your site', 'code-snippets' );
}

public function get_promotion_message(): string {
return esc_html__( 'Why risk manual edits? Migrate to Code Snippets Pro to get enterprise-grade Safe Mode that automatically catches errors before they go live.', 'code-snippets' );
}

public function get_promotion_buttons(): array {
return $this->get_default_buttons();
}
}
42 changes: 42 additions & 0 deletions src/php/promotions/admin-notices/header-footer-code-manager.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
namespace Code_Snippets\Promotions;

use Code_Snippets\Header_Footer_Code_Manager_Importer;

class Header_Footer_Code_Manager extends Promotion_Base {

public function get_plugin_name(): string {
return esc_html__( 'Header Footer Code Manager', 'code-snippets' );
}

public function get_plugin_slug(): string {
return 'header-footer-code-manager';
}

public function get_plugin_admin_screens(): array {
return [
'toplevel_page_hfcm-list',
'hfcm_page_hfcm-tools',
'hfcm_page_hfcm-create',
'admin_page_hfcm-update',
];
}

public function get_promotion_heading(): string {
return esc_html__( 'Clean up your plugin list today', 'code-snippets' );
}

public function get_promotion_message(): string {
return esc_html__( 'Move your functionality to Code Snippets Pro and reduce your dependency on third-party plugins. A leaner dashboard is a more secure dashboard.', 'code-snippets' );
}

public function get_promotion_buttons(): array {
return $this->get_default_buttons( $this->has_snippets() );
}

protected function has_snippets(): bool {
$importer = new Header_Footer_Code_Manager_Importer();
$data = $importer->get_data();
return ! empty( $data );
}
}
34 changes: 34 additions & 0 deletions src/php/promotions/admin-notices/insert-html-snippet.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
namespace Code_Snippets\Promotions;

class Insert_HTML_Snippet extends Promotion_Base {

public function get_plugin_name(): string {
return esc_html__( 'Insert HTML Snippet', 'code-snippets' );
}

public function get_plugin_slug(): string {
return 'insert-html-snippet';
}

public function get_plugin_admin_screens(): array {
return [
'toplevel_page_insert-html-snippet-manage',
'insert-html-snippet_page_insert-html-snippet-settings',
'insert-html-snippet_page_insert-html-snippet-about',
'insert-html-snippet_page_insert-html-snippet-suggest-features',
];
}

public function get_promotion_heading(): string {
return esc_html__( 'Clean up your plugin list today', 'code-snippets' );
}

public function get_promotion_message(): string {
return esc_html__( 'Move your functionality to Code Snippets Pro and reduce your dependency on third-party plugins. A leaner dashboard is a more secure dashboard.', 'code-snippets' );
}

public function get_promotion_buttons(): array {
return $this->get_default_buttons();
}
}
45 changes: 45 additions & 0 deletions src/php/promotions/admin-notices/insert-php-code-snippet.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
namespace Code_Snippets\Promotions;

use Code_Snippets\Insert_PHP_Code_Snippet_Importer;

class Insert_PHP_Code_Snippet extends Promotion_Base {

public function get_plugin_name(): string {
return esc_html__( 'Insert PHP Code Snippet', 'code-snippets' );
}

public function get_plugin_slug(): string {
return 'insert-php-code-snippet';
}

public function get_plugin_admin_screens(): array {
return [
'toplevel_page_insert-php-code-snippet-manage',
'insert-php-code-snippet_page_insert-php-code-snippet-settings',
'insert-php-code-snippet_page_insert-php-code-snippet-about',
'insert-php-code-snippet_page_insert-php-code-snippet-suggest-features',
];
}

public function get_promotion_heading(): string {
return esc_html__( 'Looking for a better way to manage your custom code?', 'code-snippets' );
}

public function get_promotion_message(): string {
return sprintf(
esc_html__( 'Code Snippets provides a powerful and user-friendly alternative to "%s", with cloud sync, advanced features, and an intuitive interface.', 'code-snippets' ),
$this->get_plugin_name()
);
}

public function get_promotion_buttons(): array {
return $this->get_default_buttons( $this->has_snippets() );
}

protected function has_snippets(): bool {
$importer = new Insert_PHP_Code_Snippet_Importer();
$data = $importer->get_data();
return ! empty( $data );
}
}
37 changes: 37 additions & 0 deletions src/php/promotions/admin-notices/insert-php.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
namespace Code_Snippets\Promotions;

class Insert_PHP extends Promotion_Base {

public function get_plugin_name(): string {
return esc_html__( 'Woody Code Snippets', 'code-snippets' );
}

public function get_plugin_slug(): string {
return 'insert-php';
}

public function get_plugin_admin_screens(): array {
return [
'wbcr-snippets',
'edit-wbcr-snippets',
'edit-wbcr-snippet-tags',
'wbcr-snippets_page_winp-new-item',
'wbcr-snippets_page_winp-settings',
'wbcr-snippets_page_snippet-library',
'wbcr-snippets_page_ti-about-insert_php',
];
}

public function get_promotion_heading(): string {
return esc_html__( 'Clean up your plugin list today', 'code-snippets' );
}

public function get_promotion_message(): string {
return esc_html__( 'Move your functionality to Code Snippets Pro and reduce your dependency on third-party plugins. A leaner dashboard is a more secure dashboard.', 'code-snippets' );
}

public function get_promotion_buttons(): array {
return $this->get_default_buttons();
}
}
34 changes: 34 additions & 0 deletions src/php/promotions/admin-notices/wp-headers-and-footers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
namespace Code_Snippets\Promotions;

class WP_Headers_And_Footers extends Promotion_Base {

public function get_plugin_name(): string {
return esc_html__( 'Insert Headers and Footers', 'code-snippets' );
}

public function get_plugin_slug(): string {
return 'wp-headers-and-footers';
}

public function get_plugin_admin_screens(): array {
return [
'settings_page_wp-headers-and-footers'
];
}

public function get_promotion_heading(): string {
return esc_html__( 'Looking for a better way to manage your custom code?', 'code-snippets' );
}

public function get_promotion_message(): string {
return sprintf(
esc_html__( 'Code Snippets provides a powerful and user-friendly alternative to "%s", with cloud sync, advanced features, and an intuitive interface.', 'code-snippets' ),
$this->get_plugin_name()
);
}

public function get_promotion_buttons(): array {
return $this->get_default_buttons();
}
}
Loading