Skip to content
Merged
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
117 changes: 0 additions & 117 deletions src/php/Integration/Promotions/Elementor_Pro.php

This file was deleted.

65 changes: 65 additions & 0 deletions src/php/Integration/Promotions/Notices/Elementor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

namespace Code_Snippets\Integration\Promotions\Notices;

/**
* Promotion class for Elementor Custom Code.
*
* @link https://elementor.com/help/custom-code-pro/
*/
class Elementor extends Promotion_Base {

/**
* Get the name of the plugin being promoted.
*
* @return string The name of the plugin.
*/
public function get_plugin_name(): string {
return __( 'Elementor Custom Code', 'code-snippets' );
}

/**
* Get the slug of the plugin being promoted.
*
* @return string The slug of the plugin.
*/
public function get_plugin_slug(): string {
return 'elementor';
}

/**
* Get the admin screens where the promotion should be displayed.
*
* @return array An array of admin screen IDs.
*/
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',
];
}

/**
* Get the heading text for the promotion notice.
*
* @return string The promotion heading.
*/
public function get_promotion_heading(): string {
return __( 'Upgrade to the industry standard for code management', 'code-snippets' );
}

/**
* Get the message text for the promotion notice.
*
* @return string The promotion message.
*/
public function get_promotion_message(): string {
return __( 'Move your custom logic into a dedicated dashboard built for professionals. Experience a cleaner workflow with advanced security and global organization.', 'code-snippets' );
}
}
58 changes: 58 additions & 0 deletions src/php/Integration/Promotions/Notices/Header_Footer_Code.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

namespace Code_Snippets\Integration\Promotions\Notices;

/**
* Promotion class for Header & Footer Code plugin.
*
* @link http://wordpress.org/plugins/head-footer-code
*/
class Header_Footer_Code extends Promotion_Base {

/**
* Get the name of the plugin being promoted.
*
* @return string The plugin name.
*/
public function get_plugin_name(): string {
return __( 'Head & Footer Code', 'code-snippets' );
}

/**
* Get the slug of the plugin being promoted.
*
* @return string The plugin slug.
*/
public function get_plugin_slug(): string {
return 'head-footer-code';
}

/**
* Get the admin screens where the promotion should be displayed.
*
* @return array An array of admin screen IDs.
*/
public function get_plugin_admin_screens(): array {
return [
'tools_page_head-footer-code',
];
}

/**
* Get the heading text for the promotion notice.
*
* @return string The promotion heading.
*/
public function get_promotion_heading(): string {
return __( 'Stop worrying about breaking your site', 'code-snippets' );
}

/**
* Get the message text for the promotion notice.
*
* @return string The promotion message.
*/
public function get_promotion_message(): string {
return __( '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' );
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

namespace Code_Snippets\Integration\Promotions\Notices;

use Code_Snippets\REST_API\Import\Plugins\Header_Footer_Code_Manager_Plugin_Importer;

/**
* Promotion class for Header Footer Code Manager.
*
* @link https://wordpress.org/plugins/header-footer-code-manager/
*/
class Header_Footer_Code_Manager extends Promotion_Base {

/**
* Get the name of the plugin being promoted.
*
* @return string The plugin name.
*/
public function get_plugin_name(): string {
return __( 'Header Footer Code Manager', 'code-snippets' );
}

/**
* Get the slug of the plugin being promoted.
*
* @return string The plugin slug.
*/
public function get_plugin_slug(): string {
return 'header-footer-code-manager';
}

/**
* Get the admin screens where the promotion should be displayed.
*
* @return array An array of admin screen IDs.
*/
public function get_plugin_admin_screens(): array {
return [
'toplevel_page_hfcm-list',
'hfcm_page_hfcm-tools',
'hfcm_page_hfcm-create',
'admin_page_hfcm-update',
];
}

/**
* Get the message text for the promotion notice.
*
* @return string The promotion message.
*/
public function get_promotion_message(): string {
return __( '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' );
}

/**
* Check if the Header Footer Code Manager plugin has any snippets.
*
* @return bool True if there are snippets, false otherwise.
*/
protected function has_snippets(): bool {
$importer = new Header_Footer_Code_Manager_Plugin_Importer();
$data = $importer->get_data();
return ! empty( $data );
}
}
52 changes: 52 additions & 0 deletions src/php/Integration/Promotions/Notices/Insert_HTML_Snippet.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

namespace Code_Snippets\Integration\Promotions\Notices;

/**
* Promotion class for Insert HTML Snippet.
*
* @link https://wordpress.org/plugins/insert-html-snippet/
*/
class Insert_HTML_Snippet extends Promotion_Base {

/**
* Get the name of the plugin being promoted.
*
* @return string The plugin name.
*/
public function get_plugin_name(): string {
return __( 'Insert HTML Snippet', 'code-snippets' );
}

/**
* Get the slug of the plugin being promoted.
*
* @return string The plugin slug.
*/
public function get_plugin_slug(): string {
return 'insert-html-snippet';
}

/**
* Get the admin screens where the promotion should be displayed.
*
* @return array An array of admin screen IDs.
*/
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',
];
}

/**
* Get the message text for the promotion notice.
*
* @return string The promotion message.
*/
public function get_promotion_message(): string {
return __( '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' );
}
}
Loading