Skip to content

Conversation

@rami-elementor
Copy link
Contributor

Elementor released a new design in WordPress admin, with updated slugs. Promotions for CS should be displayed in the new Custom Code screens.

Promotion in empty archive:
image

Promotion in archive with custom code:
image

Promotion in new custom code:
image

@VerdiH
Copy link
Collaborator

VerdiH commented Jan 20, 2026

Amazing work @rami-elementor !

@imantsk imantsk changed the title Update promotions for Elementor One feat: Update promotions for Elementor One Jan 20, 2026
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file seems a little redundant – we can just initialise Promotions\Elementor from Plugin.

<?php
namespace Code_Snippets;

if ( ! defined( 'ABSPATH' ) ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to include these checks in class files.

<?php
namespace Code_Snippets\Promotions;

if ( ! defined( 'ABSPATH' ) ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

* @return void
*/
public function promotion_in_custom_code_screen() {
if ( ! $this->is_custom_code_screen() ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also check if the 'hide upsell' setting is turned on before printing promos.

<div class="notice notice-info is-dismissible code-snippets-promotion">
<div class="code-snippets-promotion-icon">
<img
src="<?php echo esc_url( plugins_url( 'assets/icon.svg', CODE_SNIPPETS_FILE ) ); ?>"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use PLUGIN_FILE.

<?php esc_html_e( 'Code Snippets Pro provides a powerful and user-friendly alternative to Elementor Custom Code, with cloud sync, advanced features, and an intuitive interface.', 'code-snippets' ); ?>
</p>
<p>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=snippets' ) ); ?>" class="button button-primary">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Plugin::get_menu_url


if ( $this->is_code_snippets_pro() ) {
$link_text = esc_html__( 'Manage CSS snippets', 'code-snippets' );
$url = admin_url( 'admin.php?page=snippets&type=css' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above – please use API function for building URLs.

* @return bool
*/
private function is_code_snippets_pro(): bool {
return defined( 'CODE_SNIPPETS_PRO' ) && CODE_SNIPPETS_PRO;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unreliable – please use Licensing::is_licensed to check the plugin variant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants