Skip to content
Snippets Groups Projects
Commit b6b23a5e authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

Merge branch 'feature/activate-link' into 'main'

feature(popup): changed content

See merge request !9
parents 51d68ba7 6af90b68
No related branches found
No related tags found
1 merge request!9feature(popup): changed content
Pipeline #11798 passed with warnings
## [1.1.4] - 2021-08-18
### Changed
- popup content
## [1.1.3] - 2021-08-16 ## [1.1.3] - 2021-08-16
### Added ### Added
- popup css - popup css
......
...@@ -105,7 +105,7 @@ export default class ActivationReminder extends React.Component { ...@@ -105,7 +105,7 @@ export default class ActivationReminder extends React.Component {
</Row> </Row>
<Row className={"activation"}> <Row className={"activation"}>
<Col> <Col>
Already have a license key? <a target="_top" href={this.props.subscriptions_url}>Activate it!</a> Already have a license key? <a target="_blank" href={this.props.how_to_activate_link}>Learn how to activate it in your store →</a>
</Col> </Col>
</Row> </Row>
</Container> </Container>
......
...@@ -14,6 +14,7 @@ document.addEventListener( 'DOMContentLoaded', function () { ...@@ -14,6 +14,7 @@ document.addEventListener( 'DOMContentLoaded', function () {
subscriptions_url={element.getAttribute( 'data-subscriptions_url' )} subscriptions_url={element.getAttribute( 'data-subscriptions_url' )}
buy_plugin_url={element.getAttribute( 'data-buy_plugin_url' )} buy_plugin_url={element.getAttribute( 'data-buy_plugin_url' )}
read_more_url={element.getAttribute( 'data-read_more_url' )} read_more_url={element.getAttribute( 'data-read_more_url' )}
how_to_activate_link={element.getAttribute( 'data-how_to_activate_link' )}
/>, element ); />, element );
} }
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -115,6 +115,7 @@ class PrepareActivationReminderCommand extends BaseCommand ...@@ -115,6 +115,7 @@ class PrepareActivationReminderCommand extends BaseCommand
$file_contents = str_replace( 'script-version', rand(1, 1000), $file_contents ); $file_contents = str_replace( 'script-version', rand(1, 1000), $file_contents );
$file_contents = str_replace( 'logo-url', $settings->get_logo_url(), $file_contents ); $file_contents = str_replace( 'logo-url', $settings->get_logo_url(), $file_contents );
$file_contents = str_replace( 'buy-plugin-url', $settings->get_buy_plugin_url(), $file_contents ); $file_contents = str_replace( 'buy-plugin-url', $settings->get_buy_plugin_url(), $file_contents );
$file_contents = str_replace( 'how-to-activate-link', $settings->get_how_to_activate_link(), $file_contents );
$file_contents = str_replace( 'new Reminder();', 'new ' . $short_classname . '();', $file_contents ); $file_contents = str_replace( 'new Reminder();', 'new ' . $short_classname . '();', $file_contents );
file_put_contents( $class_file, $file_contents ); file_put_contents( $class_file, $file_contents );
} }
......
...@@ -9,6 +9,7 @@ class Settings { ...@@ -9,6 +9,7 @@ class Settings {
const LOGO_URL = 'logo-url'; const LOGO_URL = 'logo-url';
const BUY_PLUGIN_URL = 'buy-plugin-url'; const BUY_PLUGIN_URL = 'buy-plugin-url';
const ACTIVATION_REMINDER = 'activation-reminder'; const ACTIVATION_REMINDER = 'activation-reminder';
const HOW_TO_ACTIVATE_LINK = 'how-to-activate-link';
/** /**
* @var string * @var string
...@@ -30,17 +31,24 @@ class Settings { ...@@ -30,17 +31,24 @@ class Settings {
*/ */
private $buy_plugin_url; private $buy_plugin_url;
/**
* @var string
*/
private $how_to_activate_link;
/** /**
* @param string $plugin_title * @param string $plugin_title
* @param string $plugin_dir * @param string $plugin_dir
* @param string $logo_url * @param string $logo_url
* @param string $buy_plugin_url * @param string $buy_plugin_url
* @param string $how_to_activate_link
*/ */
public function __construct( string $plugin_title, string $plugin_dir, string $logo_url, string $buy_plugin_url ) { public function __construct( string $plugin_title, string $plugin_dir, string $logo_url, string $buy_plugin_url, string $how_to_activate_link ) {
$this->plugin_title = $plugin_title; $this->plugin_title = $plugin_title;
$this->plugin_dir = $plugin_dir; $this->plugin_dir = $plugin_dir;
$this->logo_url = $logo_url; $this->logo_url = $logo_url;
$this->buy_plugin_url = $buy_plugin_url; $this->buy_plugin_url = $buy_plugin_url;
$this->how_to_activate_link = $how_to_activate_link;
} }
/** /**
...@@ -71,6 +79,13 @@ class Settings { ...@@ -71,6 +79,13 @@ class Settings {
return $this->buy_plugin_url; return $this->buy_plugin_url;
} }
/**
* @return string
*/
public function get_how_to_activate_link(): string {
return $this->how_to_activate_link;
}
/** /**
* *
*/ */
...@@ -86,6 +101,7 @@ class Settings { ...@@ -86,6 +101,7 @@ class Settings {
self::PLUGIN_DIR, self::PLUGIN_DIR,
self::LOGO_URL, self::LOGO_URL,
self::BUY_PLUGIN_URL, self::BUY_PLUGIN_URL,
self::HOW_TO_ACTIVATE_LINK,
]; ];
foreach ( $settings_fields as $field ) { foreach ( $settings_fields as $field ) {
if ( ! isset( $settings[ self::ACTIVATION_REMINDER ][ $field ] ) ) { if ( ! isset( $settings[ self::ACTIVATION_REMINDER ][ $field ] ) ) {
...@@ -106,7 +122,8 @@ class Settings { ...@@ -106,7 +122,8 @@ class Settings {
$settings[ self::ACTIVATION_REMINDER ][ self::PLUGIN_TITLE ], $settings[ self::ACTIVATION_REMINDER ][ self::PLUGIN_TITLE ],
$settings[ self::ACTIVATION_REMINDER ][ self::PLUGIN_DIR ], $settings[ self::ACTIVATION_REMINDER ][ self::PLUGIN_DIR ],
$settings[ self::ACTIVATION_REMINDER ][ self::LOGO_URL ], $settings[ self::ACTIVATION_REMINDER ][ self::LOGO_URL ],
$settings[ self::ACTIVATION_REMINDER ][ self::BUY_PLUGIN_URL ] $settings[ self::ACTIVATION_REMINDER ][ self::BUY_PLUGIN_URL ],
$settings[ self::ACTIVATION_REMINDER ][ self::HOW_TO_ACTIVATE_LINK ],
); );
} }
......
...@@ -36,7 +36,7 @@ class Reminder { ...@@ -36,7 +36,7 @@ class Reminder {
$cookie_name = md5( site_url() . 'plugin-dir' ); $cookie_name = md5( site_url() . 'plugin-dir' );
$subscriptions_url = admin_url( 'admin.php?page=wpdesk-licenses' ); $subscriptions_url = admin_url( 'admin.php?page=wpdesk-licenses' );
$read_more_url = 'https://flexibleshipping.com'; $read_more_url = 'https://flexibleshipping.com';
echo "<span class=\"wpdesk-activation-reminder\" data-plugin_title=\"plugin-title\" data-plugin_dir=\"plugin-dir\" data-logo_url=\"$logo_url\" data-cookie_name=\"$cookie_name\" data-subscriptions_url=\"$subscriptions_url\" data-buy_plugin_url=\"buy-plugin-url\" data-read_more_url=\"$read_more_url\"></span>"; echo "<span class=\"wpdesk-activation-reminder\" data-plugin_title=\"plugin-title\" data-plugin_dir=\"plugin-dir\" data-logo_url=\"$logo_url\" data-cookie_name=\"$cookie_name\" data-subscriptions_url=\"$subscriptions_url\" data-buy_plugin_url=\"buy-plugin-url\" data-read_more_url=\"$read_more_url\" data-how_to_activate_link=\"how-to-activate-link\"></span>";
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment