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
2 changes: 1 addition & 1 deletion assets/css/rop_core.css
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ a.active {
font-size: 1.4rem;
}

#rop_core h4,
#rop_core h4:not(.themeisle-sale-title),
#rop_core .h4 {
font-size: 1.2rem;
}
Expand Down
51 changes: 46 additions & 5 deletions includes/admin/class-rop-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ function() use ( $global_settings ) {
return $global_settings->license_type();
}
);

add_filter( 'themeisle_sdk_blackfriday_data', array( $this, 'add_black_friday_data' ) );
}


Expand Down Expand Up @@ -444,10 +446,6 @@ function( $data, $page_slug ) use ( $accounts_count, $is_post_sharing_active ) {
);
}
do_action( 'themeisle_internal_page', ROP_PRODUCT_SLUG, 'dashboard' );

if ( ! defined( 'ROP_PRO_VERSION' ) ) {
do_action( 'themeisle_sdk_load_banner', 'rop' );
}
}

/**
Expand Down Expand Up @@ -682,7 +680,7 @@ public function menu_pages() {
)
);
if ( ! defined( 'REVIVE_NETWORK_VERSION' ) ) {
$rss_to_social = __( 'RSS to Social', 'wpcf7-redirect' ) . '<span id="rop-rn-menu" class="dashicons dashicons-external" style="font-size:initial;"></span>';
$rss_to_social = __( 'RSS to Social', 'tweet-old-post' ) . '<span id="rop-rn-menu" class="dashicons dashicons-external" style="font-size:initial;"></span>';
add_action(
'admin_footer',
function () {
Expand Down Expand Up @@ -1845,4 +1843,47 @@ public function get_languages() {
}
return apply_filters( 'wpml_active_languages', null, array( 'skip_missing' => 1 ) );
}

/**
* Add the Black Friday configuration.
*
* @param array $configs An array of configurations.
*
* @return array The configurations.
*/
public static function add_black_friday_data( $configs ) {
$config = $configs['default'];

// translators: %1$s - HTML tag, %2$s - discount, %3$s - HTML tag, %4$s - product name.
$message_template = __( 'Our biggest sale of the year: %1$sup to %2$s OFF%3$s on %4$s. Don\'t miss this limited-time offer.', 'tweet-old-post' );
$product_label = __( 'Revive Social', 'tweet-old-post' );
$discount = '50%';

$plan = apply_filters( 'product_rop_license_plan', 0 );
$license = apply_filters( 'product_rop_license_key', false );
$is_pro = 0 < $plan;

if ( $is_pro ) {
// translators: %1$s - HTML tag, %2$s - discount, %3$s - HTML tag, %4$s - product name.
$message_template = __( 'Get %1$sup to %2$s off%3$s when you upgrade your %4$s plan or renew early.', 'tweet-old-post' );
$product_label = __( 'Revive Social Pro', 'tweet-old-post' );
$discount = '20%';
}

$product_label = sprintf( '<strong>%s</strong>', $product_label );
$url_params = array(
'utm_term' => $is_pro ? 'plan-' . $plan : 'free',
'lkey' => ! empty( $license ) ? $license : false,
);

$config['message'] = sprintf( $message_template, '<strong>', $discount, '</strong>', $product_label );
$config['sale_url'] = add_query_arg(
$url_params,
tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/rs-bf', 'bfcm', 'revive' ) )
);

$configs[ ROP_PRODUCT_SLUG ] = $config;

return $configs;
}
}
11 changes: 9 additions & 2 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<exclude-pattern>vue/*</exclude-pattern>
<exclude-pattern>dist/*</exclude-pattern>

<arg name="extensions" value="php"/>
<arg name="extensions" value="php" />

<rule ref="WordPress-Core">
<exclude name="Squiz.Commenting.FileComment.SpacingAfterComment" />
Expand Down Expand Up @@ -51,9 +51,16 @@
<rule ref="WordPress-Docs">

</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="tweet-old-post" />
</property>
</properties>
</rule>

<rule ref="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing">
<severity>0</severity>
</rule>

</ruleset>
</ruleset>
22 changes: 14 additions & 8 deletions vue/src/vue-elements/main-page-panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
</h1>
</div>
</div>
<div
id="tsdk_banner"
class="rop-banner"
/>
<toast />
<div
v-if=" is_rest_api_error "
Expand Down Expand Up @@ -64,6 +60,11 @@
</div>
</div>

<div
id="tsdk_banner"
class="rop-banner"
/>

<div class="columns">
<div class="panel column col-9 col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
<div
Expand Down Expand Up @@ -384,8 +385,10 @@
}, 1000);

this.get_toast_message(false);

document.dispatchEvent(new Event('themeisle:banner:init'));

if ( window.tsdk_reposition_notice ) {
window.tsdk_reposition_notice?.();
}
},
created() {
this.$root.$refs.main_page = this;
Expand Down Expand Up @@ -574,9 +577,12 @@
text-decoration: underline;
}

.rop-banner:has(.tsdk-banner-cta) {
.rop-banner:has(.themeisle-sale) {
width: 100%;
margin-top: 15px;
margin-bottom: 30px;
}

#tsdk_banner :is(.themeisle-sale, p) {
margin: 0;
}
</style>
Loading