Skip to content

Commit

Permalink
Merge pull request #7 from pluginever/release/1.0.2
Browse files Browse the repository at this point in the history
Prepare release v1.0.2
  • Loading branch information
kawsarahmedr authored Oct 23, 2024
2 parents 5633dd3 + 809b87d commit 5282c19
Show file tree
Hide file tree
Showing 25 changed files with 480 additions and 44 deletions.
85 changes: 85 additions & 0 deletions .assets/css/_halloween.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
.notice.notice-halloween {
position: relative;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
border: 1px solid #5900a8;
border-left-width: 4px;
.notice-content {
max-width: 75%;
color: #ffffff;
h3 {
color: #ffffff;
font-size: 1.6rem;
line-height: 1.3;
}
p {
font-size: .9rem;
line-height: 1.6;
}
}
.notice-footer {
justify-content: space-between;
border-top: 1px solid #5900a8;
.footer-btn {
display: flex;
gap: 20px;
}
.halloween-upgrade-btn {
background-color: #ffffff;
padding: 5px 12px;
color: #4203A0;
border-radius: 3px;
&:hover{
background-color: #D6CDE4;
}
}
.halloween-remind-btn {
background-color: #FFFFFF52;
padding: 5px 12px;
color: #FFFFFF;
border-radius: 3px;
&:hover{
background-color: #FFFFFF66;
}
}
.halloween-remove-btn {
color: #ffffff;
&:hover{
color: #D6CDE4;
}
}
.halloween-dismiss-btn{
position: absolute;
top: 20px;
right: 30px;
color: #FFFFFF;
&:hover {
color: #D6CDE4;
}
}
.halloween-footer-text {
float: right;
color: #ffffff;
}
}
@media screen and (max-width: 500px ) {
background-position:right;
.notice-body {
align-items: flex-start;
padding-top: 36px;
}
.notice-footer {
flex-direction: column;
.footer-btn {
flex-direction: column;
align-items: center;
gap: 10px;
}
.halloween-dismiss-btn {
top: 8px;
right: 20px;
}
}
}
}
5 changes: 1 addition & 4 deletions src/css/admin-common.scss → .assets/css/admin-common.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
//@import "../../../lib/Lib/assets/css/layout";
//@import "../../../lib/Lib/assets/css/card";
//@import "../../../lib/Lib/assets/css/grid";

@import "halloween.scss";
.select2-container--default {
.select2-results__option--highlighted[aria-selected],
.select2-results__option--highlighted[data-selected]{
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
35 changes: 35 additions & 0 deletions .assets/images/halloween-banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions .assets/images/halloween-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .assets/images/plugin-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,3 @@ Thumbs.db
*.*.map

# Build related files
src
/src/
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A powerful and user-friendly WordPress plugin designed to seamlessly integrate donation functionality into the WooCommerce platform. This plugin is the ultimate solution for effortlessly managing and receiving donations for a charitable organization, a non-profit, or a business looking to support a cause.",
"homepage": "https://pluginever.com/plugins/wc-donation-manager/",
"type": "wordpress-plugin",
"license": "GPL-3.0-or-later",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.4"
},
Expand Down
69 changes: 69 additions & 0 deletions includes/Admin/Notices.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php

namespace WooCommerceDonationManager\Admin;

defined( 'ABSPATH' ) || exit; // Exit if accessed directly.

/**
* Notices class.
*
* @since 1.0.0
*/
class Notices {

/**
* Notices constructor.
*
* @since 1.0.0
*/
public function __construct() {
add_action( 'admin_init', array( $this, 'admin_notices' ) );
}

/**
* Admin notices.
*
* @since 1.0.0
*/
public function admin_notices() {
$installed_time = get_option( 'wcdm_installed' );
$current_time = wp_date( 'U' );

// Halloween's promotion notice.
$halloween_time = date_i18n( strtotime( '2024-11-11 00:00:00' ) );
if ( $current_time < $halloween_time ) {
WCDM()->notices->add(
array(
'message' => __DIR__ . '/views/notices/halloween.php',
'dismissible' => false,
'notice_id' => 'wcdm_halloween_promotion',
'style' => 'border-left-color: #8500ff;background-image: url("' . esc_url( WCDM()->get_assets_url( 'images/halloween-banner.svg' ) ) . '");',
'class' => 'notice-halloween',
)
);
}

if ( ! defined( 'WCDM_PRO_VERSION' ) ) {
WCDM()->notices->add(
array(
'message' => __DIR__ . '/views/notices/upgrade.php',
'notice_id' => 'wcdm_upgrade',
'style' => 'border-left-color: #0542fa;',
'dismissible' => false,
)
);
}

// Show after 5 days.
if ( $installed_time && $current_time > ( $installed_time + ( 5 * DAY_IN_SECONDS ) ) ) {
WCDM()->notices->add(
array(
'message' => __DIR__ . '/views/notices/review.php',
'dismissible' => false,
'notice_id' => 'wcdm_review',
'style' => 'border-left-color: #0542fa;',
)
);
}
}
}
55 changes: 55 additions & 0 deletions includes/Admin/views/notices/halloween.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
/**
* Admin notice: Halloween offer.
*
* @package WooCommerceDonationManager
* @since 1.1.2
* @return void
*/

defined( 'ABSPATH' ) || exit; // Exit if accessed directly.

?>
<div class="notice-body">
<div class="notice-icon">
<img src="<?php echo esc_url( WCDM()->get_assets_url( 'images/halloween-icon.svg' ) ); ?>" alt="WooCommerce Donation Manager Halloween Offer">
</div>
<div class="notice-content">
<h3>
<?php esc_html_e( 'Limited Time Offer! PluginEver Halloween Sale: 30% OFF!!', 'wc-donation-manager' ); ?>
</h3>
<p>
<?php
echo wp_kses_post(
sprintf(
// translators: 1.Offer Percentage, 2. Coupon Code.
__( 'Spectacular Halloween Deal! Get %1$s on all premium plugins with code %2$s. Don\'t miss out — this offer vanishes soon! 👻', 'wc-donation-manager' ),
'<strong>' . esc_attr( '30% OFF' ) . '</strong>',
'<strong>' . esc_attr( 'BIGTREAT30' ) . '</strong>'
)
);
?>
</p>
</div>
</div>
<div class="notice-footer">
<div class="footer-btn">
<a href="<?php echo esc_url( WCDM()->plugin_uri . '?utm_source=plugin&utm_medium=notice&utm_campaign=halloween-2024&discount=bigtreat30' ); ?>" class="primary halloween-upgrade-btn" target="_blank">
<span class="dashicons dashicons-cart"></span>
<?php esc_html_e( 'Claim your discount!!', 'wc-donation-manager' ); ?>
</a>
<a href="#" class="halloween-remind-btn" data-snooze="<?php echo esc_attr( WEEK_IN_SECONDS ); ?>">
<span class="dashicons dashicons-clock"></span>
<?php esc_html_e( 'Remind me later', 'wc-donation-manager' ); ?>
</a>
<a href="#" class="primary halloween-remove-btn" data-dismiss>
<span class="dashicons dashicons-remove"></span>
<?php esc_html_e( 'Never show this again!', 'wc-donation-manager' ); ?>
</a>
<a href="#" class="primary halloween-dismiss-btn" data-dismiss>
<span class="dashicons dashicons-dismiss"></span>
<?php esc_html_e( 'DISMISS', 'wc-donation-manager' ); ?>
</a>
</div>
<strong class="halloween-footer-text"><?php esc_html_e( 'Valid until November 10, 2024', 'wc-donation-manager' ); ?></strong>
</div>
48 changes: 48 additions & 0 deletions includes/Admin/views/notices/review.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/**
* Admin notice for review.
*
* @package WooCommerceDonationManager
* @since 1.0.0
* @return void
*/

defined( 'ABSPATH' ) || exit;

?>
<div class="notice-body">
<div class="notice-icon">
<img src="<?php echo esc_attr( WCDM()->get_assets_url( 'images/plugin-icon.png' ) ); ?>" alt="WooCommerce Donation Manager">
</div>
<div class="notice-content">
<h3>
<?php esc_html_e( 'Enjoying WooCommerce Donation Manager?', 'wc-donation-manager' ); ?>
</h3>
<p>
<?php
echo wp_kses_post(
sprintf(
// translators: %1$s: WooCommerce Donation Manager WP ORG link, %2$s: Coupon code.
__( 'We hope you had a wonderful experience using %1$s. Please take a moment to show us your support by leaving a 5-star review on <a href="%2$s" target="_blank"><strong>WordPress.org</strong></a>. Thank you! 😊', 'wc-donation-manager' ),
'<a href="ttps://wordpress.org/plugins/wc-donation-manager/" target="_blank"><strong>WooCommerce Donation Manager</strong></a>',
'https://wordpress.org/support/plugin/wc-donation-manager/reviews/?filter=5#new-post'
)
);
?>
</p>
</div>
</div>
<div class="notice-footer">
<a class="primary" href="https://wordpress.org/support/plugin/wc-donation-manager/reviews/?filter=5#new-post" target="_blank">
<span class="dashicons dashicons-heart"></span>
<?php esc_html_e( 'Sure, I\'d love to help!', 'wc-donation-manager' ); ?>
</a>
<a href="#" data-snooze>
<span class="dashicons dashicons-clock"></span>
<?php esc_html_e( 'Maybe later', 'wc-donation-manager' ); ?>
</a>
<a href="#" data-dismiss>
<span class="dashicons dashicons-smiley"></span>
<?php esc_html_e( 'I\'ve already left a review', 'wc-donation-manager' ); ?>
</a>
</div>
42 changes: 42 additions & 0 deletions includes/Admin/views/notices/upgrade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
* Admin notice for upgrade.
*
* @package WooCommerceDonationManager
* @since 1.0.0
* @return void
*/

defined( 'ABSPATH' ) || exit;

?>
<div class="notice-body">
<div class="notice-icon">
<img src="<?php echo esc_attr( WCDM()->get_assets_url( 'images/plugin-icon.png' ) ); ?>" alt="WooCommerce Donation Manager">
</div>
<div class="notice-content">
<h3><?php esc_attr_e( 'Flash Sale Alert!', 'wc-donation-manager' ); ?></h3>
<p>
<?php
echo wp_kses_post(
sprintf(
// translators: %1$s: WooCommerce Donation Manager ORG link, %2$s: Coupon code.
__( 'Get access to %1$s with a <strong>20%% discount</strong> for the next <strong>72 hours</strong> only! Use coupon code %2$s at checkout. Hurry up, the offer ends soon.', 'wc-donation-manager' ),
'<a href="https://pluginever.com/?utm_source=plugin&utm_medium=notice&utm_campaign=flash-sale" target="_blank"><strong>All Plugins</strong></a>',
'<strong>FLASH20</strong>'
)
);
?>
</p>
</div>
</div>
<div class="notice-footer">
<a class="primary" href="https://pluginever.com/?utm_source=plugin&utm_medium=notice&utm_campaign=flash-sale" target="_blank">
<span class="dashicons dashicons-cart"></span>
<?php esc_attr_e( 'Claim discount ow', 'wc-donation-manager' ); ?>
</a>
<a href="#" data-snooze="<?php echo esc_attr( WEEK_IN_SECONDS ); ?>">
<span class="dashicons dashicons-clock"></span>
<?php esc_attr_e( 'Maybe later', 'wc-donation-manager' ); ?>
</a>
</div>
1 change: 1 addition & 0 deletions includes/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public function on_init() {
Admin\Settings::instance(),
Admin\Actions::class,
Admin\Metaboxes::class,
Admin\Notices::class,
)
);
}
Expand Down
Loading

0 comments on commit 5282c19

Please sign in to comment.