-
Notifications
You must be signed in to change notification settings - Fork 26
refactor: use the new hooks for Black Friday #1069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
e962061
to
de108e4
Compare
img/black-friday.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this no?
if ( self::plan_category( $license_data ) <= 1 ) { | ||
do_action( 'themeisle_sdk_load_banner', 'feedzy' ); | ||
} | ||
if ( in_array( $page_slug, array( 'imports', 'categories', 'settings' ) ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this anymore no, I mean calling twice this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The notice runs only once from the product that is loading.
If we have Otter with Feedzy, and Otter is the one that adds the last hook, the Otter message will be used for Global and product pages.
In the internal pages, we add the hook so that it can render on top of each other.
If we add the hook only on internal pages, then there is no conflict and on the non-product pages, the default message will be displayed.
@@ -77,6 +77,8 @@ function( $data, $page_slug ) { | |||
); | |||
} | |||
|
|||
apply_filters( 'themeisle_sdk_blackfriday_data', array( $this, 'set_black_friday_data' ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be add_filter, no?
$discount = '40%'; | ||
|
||
if ( feedzy_is_pro() ) { | ||
$product_label = __( 'Feedzy RSS Feeds Pro', 'feedzy-rss-feeds' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use Feedzy PRO
* @return array | ||
*/ | ||
public function set_black_friday_data( $config ) { | ||
$product_label = __( 'Feedzy RSS Feeds', 'feedzy-rss-feeds' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use Feedzy
*/ | ||
public function set_black_friday_data( $config ) { | ||
$product_label = __( 'Feedzy RSS Feeds', 'feedzy-rss-feeds' ); | ||
$discount = '40%'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use 70%
|
||
if ( feedzy_is_pro() ) { | ||
$product_label = __( 'Feedzy RSS Feeds Pro', 'feedzy-rss-feeds' ); | ||
$discount = '50%'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use 30%
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use for pro this message Get 30% off when you upgrade your Feedzy Pro plan or renew early.
$config['url'] = add_query_arg( array( | ||
'utm_plugin' => feedzy_is_pro() ? 'feedzy-pro' : 'feedzy-rss-feeds', | ||
'utm_plan' => self::plan_category( $license_data ), | ||
), $config['base_url'] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use here
add_query_arg(
[
'utm_term' => feedzy_is_pro() ? 'plan-' . apply_filters( 'product_feedzy_license_plan', 0 ) : 'free'
],
tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/plugins/feedzy-rss-feeds/blackfriday', 'bfcm', 'feedzy' ) ) );
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Soare-Robert-Daniel lets also include the licensekey as lkey using product_feedzy_license_key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The URL will look this: https://themeisle.com/plugins/feedzy-rss-feeds/blackfriday?utm_source=wpadmin&utm_medium=feedzy&utm_campaign=bfcm&utm_content=feedzy-rss-feedsblackfriday&utm_term=plan-3&lkey=d5498f84bc277aa7043bfc86f185c798
Since this is per user, should we restrict the lkey
only to users who have the capabilities to manage plugins? This is not to leak the key to editors, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, we can. Lets do this in the SDK, by using remove_query_arg if the url contains lkey and the user does not have the right permision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this we have available the $current_product
, should we use this to get the plan (priceID) and the license key directly from the SDK using the product_<slug>
filters instead of having it in each product?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, I think is good as it is.
Plugin build for 746b152 is ready 🛎️!
Note You can preview the changes in the Playground |
$discount = '30%'; | ||
|
||
// translators: %1$s - discount, %2$s - product label. | ||
$config['message'] = sprintf( __( 'Get <strong>%1$s off</strong> when you upgrade your <strong>%2$s</strong> plan or renew early.', 'feedzy-rss-feeds' ), $discount, $product_label ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Soare-Robert-Daniel we need also to use placeholders for html tags, no need to send them for translation.
074f243
to
ea49247
Compare
img/black-friday.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Soare-Robert-Daniel I guess we can delete this no?
Summary
Use the Black Friday hooks from https://github.com/Codeinwp/themeisle-sdk-main/pull/295
Will affect visual aspect of the product
YES
Screenshots
Test instructions
You can use this hook to alternate it:
Check before Pull Request is ready:
Closes https://github.com/Codeinwp/ideas/issues/59