Skip to content

Commit

Permalink
v 1.0.5 see changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-hoebenreich committed Nov 11, 2021
1 parent a91f255 commit 60ef33f
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 48 deletions.
18 changes: 12 additions & 6 deletions includes/class-wcdp-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ public function __construct() {
public function wcdp_enqueue_scripts() {
//Dependencies
$cssdeps = array('select2',);
$jsdeps = array('jquery',
'selectWoo',
'wc-checkout',
'wc-password-strength-meter',
'select2',
'wc-cart',);
$jsdeps = array(
'jquery',
'selectWoo',
'wc-checkout',
'select2',
'wc-cart',
);

//Require wc-password-strength-meter when necessary
if ( 'yes' === get_option('woocommerce_enable_signup_and_login_from_checkout') && 'no' === get_option( 'woocommerce_registration_generate_password' ) && ! is_user_logged_in() ) {
array_push($jsdeps, 'wc-password-strength-meter');
}

//Register CSS & JS
wp_register_style( 'wc-donation-platform', WCDP_DIR_URL . 'assets/css/wcdp.min.css', $cssdeps, WCDP_VERSION );
Expand Down
20 changes: 15 additions & 5 deletions includes/templates/wcdp_product_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@
<div id="wcdp_donation_form_data" class="panel woocommerce_options_panel hidden">
<div class="options_group">
<p class="wcdp_shortcode form-field">
<label for="wcdp_shortcode"><?php _e( 'Shortcode', 'wc-donation-platform' ); ?></label>
<label for="wcdp_shortcode"><?php esc_html_e( 'Shortcode', 'wc-donation-platform' ); ?></label>
<span class="wrap">
<input type="text" readonly="readonly" onclick="this.select()" value="[wcdp_donation_form id=&quot;<?php echo $post->ID ?>&quot;]">
<input type="text" readonly="readonly" onclick="this.select()" value="[wcdp_donation_form id=&quot;<?php echo $post->ID; ?>&quot;]">
<?php
/* translators: %s & %s: link html (not visible) */
echo wc_help_tip( __( 'Add this shortcode where you want to display the donation form.') . '<a href="https://wcdp.jonh.eu/documentation/getting-started/shortcode/" target="_blank" rel="noopener">'. __('Shortcode Documentation', 'wc-donation-platform') . '</a>' ); ?>
/* translators: %s & %s: link html (not visible) */
echo wc_help_tip( __( 'Add this shortcode where you want to display the donation form.', 'wc-donation-platform') . '<a href="https://wcdp.jonh.eu/documentation/getting-started/shortcode/" target="_blank" rel="noopener">'. __('Shortcode Documentation', 'wc-donation-platform') . '</a>' ); ?>
</span>
</p>
<p class="wcdp_direct_link form-field">
<label><?php esc_html_e( 'Direct Link', 'wc-donation-platform' ); ?></label>
<span class="wrap">
<a href="<?php echo esc_url(wc_get_checkout_url() . '?postid=' . $post->ID ); ?>" target="_blank"><?php echo esc_url(wc_get_checkout_url() . '?postid=' . $post->ID ); ?></a>
</span>
</p>
</div>
Expand Down Expand Up @@ -136,6 +142,10 @@

$(window).bind("load", function() {
show_hide_donable_panel();

if ($('#_regular_price').val() == '') {
$('#_regular_price').val(1);
}
});

$('#wcdp-amount-layout,input#_donable').on('change', function(){
Expand All @@ -150,7 +160,7 @@ function show_hide_donable_panel() {
$( '.show_if_donable' ).hide();
}

if($('#wcdp-amount-layout').val()) {
if($('#wcdp-amount-layout').val() == 1) {
$('.wcdp-settings_field').show();
} else {
$('.wcdp-settings_field').hide();
Expand Down
2 changes: 1 addition & 1 deletion includes/templates/wcdp_step_1_amount.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
'input-id' => 'wcdp_value_other',
'input-value' => '',
'label-id' => 'wcdp_label_custom_amount',
'label-text' => '<div id="wcdp_other">' . esc_html( 'Other', 'wc-donation-platform' ) . '</div><div class="wcdp_cu_field">' . $wcdp_price_field . '</div>',
'label-text' => '<div id="wcdp_other">' . esc_html__( 'Other', 'wc-donation-platform' ) . '</div><div class="wcdp_cu_field">' . $wcdp_price_field . '</div>',
)); ?>
<label class="wcdp-variation-heading" for="donation-amount"><?php esc_attr_e( 'Choose an amount:', 'wc-donation-platform' ); ?></label> <?php
echo WCDP_Form::wcdp_generate_fieldset($args);
Expand Down
75 changes: 44 additions & 31 deletions languages/wc-donation-platform.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the same license as the Donation Platform for WooCommerce: Fundraising & Donation Management plugin.
msgid ""
msgstr ""
"Project-Id-Version: Donation Platform for WooCommerce: Fundraising & Donation Management 1.0.3\n"
"Project-Id-Version: Donation Platform for WooCommerce: Fundraising & Donation Management 1.0.5\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wc-donation-platform-dev\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2021-10-16T18:13:03+02:00\n"
"POT-Creation-Date: 2021-11-11T14:49:40+01:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.4.0\n"
"X-Domain: wc-donation-platform\n"
Expand Down Expand Up @@ -42,43 +42,43 @@ msgstr ""
msgid "Enable to allow this form to be embedded elsewhere using "
msgstr ""

#: includes/class-wcdp-form.php:70
#: includes/class-wcdp-form.php:76
msgid "Only one donation form per page allowed"
msgstr ""

#: includes/class-wcdp-form.php:87
#: includes/class-wcdp-form.php:93
msgid "id is a required attribute"
msgstr ""

#: includes/class-wcdp-form.php:98
#: includes/class-wcdp-form.php:104
msgid "Please log in to donate."
msgstr ""

#: includes/class-wcdp-form.php:206
#: includes/class-wcdp-form.php:212
msgid "Invalid Request: postid missing. Please reload the page and try again. If the problem persists, please contact our support team."
msgstr ""

#: includes/class-wcdp-form.php:208
#: includes/class-wcdp-form.php:214
msgid "Error: invalid nonce. Please reload the page and try again. If the problem persists, please contact our support team."
msgstr ""

#: includes/class-wcdp-form.php:239
#: includes/class-wcdp-form.php:245
msgid "Invalid postid. Please reload the page and try again. If the problem persists, please contact our support team."
msgstr ""

#: includes/class-wcdp-form.php:279
#: includes/class-wcdp-form.php:285
msgid "Could not add donation to cart."
msgstr ""

#: includes/class-wcdp-form.php:282
#: includes/class-wcdp-form.php:288
msgid "Invalid donation amount. Please enter a different donation amount."
msgstr ""

#: includes/class-wcdp-form.php:286
#: includes/class-wcdp-form.php:292
msgid "Invalid donation product status. Please contact our support team."
msgstr ""

#: includes/class-wcdp-form.php:289
#: includes/class-wcdp-form.php:295
msgid "Invalid request. Please reload the page and try again. If the problem persists, please contact our support team."
msgstr ""

Expand Down Expand Up @@ -678,57 +678,66 @@ msgstr ""
msgid "Shortcode"
msgstr ""

#. translators: %s & %s: link html (not visible)
#: includes/templates/wcdp_product_settings.php:19
msgid "Add this shortcode where you want to display the donation form."
msgstr ""

#. translators: %s & %s: link html (not visible)
#: includes/templates/wcdp_product_settings.php:19
msgid "Shortcode Documentation"
msgstr ""

#: includes/templates/wcdp_product_settings.php:32
#: includes/templates/wcdp_product_settings.php:23
msgid "Direct Link"
msgstr ""

#: includes/templates/wcdp_product_settings.php:38
msgid "Layout of Amount suggestions"
msgstr ""

#: includes/templates/wcdp_product_settings.php:34
#: includes/templates/wcdp_product_settings.php:40
msgid "Just input box"
msgstr ""

#: includes/templates/wcdp_product_settings.php:35
#: includes/templates/wcdp_product_settings.php:107
#: includes/templates/wcdp_product_settings.php:41
#: includes/templates/wcdp_product_settings.php:113
msgid "Radio/button selection"
msgstr ""

#: includes/templates/wcdp_product_settings.php:36
#: includes/templates/wcdp_product_settings.php:42
msgid "Input box + Range slider"
msgstr ""

#: includes/templates/wcdp_product_settings.php:37
#: includes/templates/wcdp_product_settings.php:43
msgid "Expert: custom code with action: wcdp_custom_html_amount"
msgstr ""

#: includes/templates/wcdp_product_settings.php:39
#: includes/templates/wcdp_product_settings.php:45
msgid "Design of the amount field."
msgstr ""

#: includes/templates/wcdp_product_settings.php:84
#: includes/templates/wcdp_product_settings.php:90
msgid "Amount Suggestions"
msgstr ""

#: includes/templates/wcdp_product_settings.php:87
#: includes/templates/wcdp_product_settings.php:93
msgid "Display buttons with donation amount suggestions. Create new options by entering a number (decimals seperated by period) and hit space bar."
msgstr ""

#: includes/templates/wcdp_product_settings.php:104
#: includes/templates/wcdp_product_settings.php:110
msgid "Layout of "
msgstr ""

#: includes/templates/wcdp_product_settings.php:106
#: includes/templates/wcdp_product_settings.php:112
msgid "Default layout"
msgstr ""

#: includes/templates/wcdp_product_settings.php:108
#: includes/templates/wcdp_product_settings.php:114
msgid "Expert: custom code with action wcdp_custom_html_"
msgstr ""

#: includes/templates/wcdp_product_settings.php:110
#: includes/templates/wcdp_product_settings.php:116
msgid "Design of the variation selection. Only for variable products."
msgstr ""

Expand All @@ -750,6 +759,10 @@ msgstr ""
msgid "required"
msgstr ""

#: includes/templates/wcdp_step_1_amount.php:76
msgid "Other"
msgstr ""

#: includes/templates/wcdp_step_1_amount.php:78
msgid "Choose an amount:"
msgstr ""
Expand Down Expand Up @@ -956,28 +969,28 @@ msgstr ""
msgid "Donation details"
msgstr ""

#: wc-donation-platform.php:94
#: wc-donation-platform.php:99
msgid "Donation Platform for WooCommerce requires WooCommerce to be installed & activated."
msgstr ""

#. translators: %s required WC version
#: wc-donation-platform.php:97
#: wc-donation-platform.php:102
msgid "Donation Platform for WooCommerce is inactive. This version of Donation Platform for WooCommerce requires WooCommerce %s or newer. Please update WooCommerce."
msgstr ""

#: wc-donation-platform.php:114
#: wc-donation-platform.php:119
msgid "View WCDP settings"
msgstr ""

#: wc-donation-platform.php:114
#: wc-donation-platform.php:119
msgid "Settings"
msgstr ""

#: wc-donation-platform.php:131
#: wc-donation-platform.php:136
msgid "View Documentation of Donation Platform for WooCommerce"
msgstr ""

#: wc-donation-platform.php:131
#: wc-donation-platform.php:136
msgid "Documentation"
msgstr ""

Expand Down
15 changes: 13 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: flinnn
Tags: donation, donations, crowdfunding, fundraising, woocommerce
Requires at least: 5.7
Tested up to: 5.8.1
Stable tag: 1.0.4
Tested up to: 5.8.2
Stable tag: 1.0.5
Requires PHP: 7.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -86,6 +86,17 @@ Since WooCommerce and other plugins don't assume that there are multiple checkou
== Changelog ==
Active development of Donation Platform for WooCommerce: Fundraising & Donation Management is handled [on GitHub](https://github.com/jonas-hoebenreich/wc-donation-platform/).

= 1.0.5 - 2021-11-1 - =

fix: textdomain not loading properly
fix: i18n of "Other" string
fix: Amount Suggestions field not hiding properly
performance: load wc-password-strength-meter only when it is necessary
tweak: set standard price of simple product to 1
tweak: add direct donation link on product edit page
tweak: push supported WC version to 5.9
tweak: push supported WP version to 5.8.1

= 1.0.4 - 2021-11-02 - =

fix: Popup does not open if plugin/theme prevents adding #wcdp-form
Expand Down
11 changes: 8 additions & 3 deletions wc-donation-platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
* Plugin URI: https://wcdp.jonh.eu/
* Description: Donation Platform for WooCommerce unlocks the power of WooCommerce for your online fundraising & crowdfunding.
* Author: Jonas Höbenreich
* Version: 1.0.4
* Version: 1.0.5
* Author URI: https://www.jonh.eu/
* Plugin URI: https://wcdp.jonh.eu/
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: wc-donation-platform
* Domain Path: /languages
* WC requires at least: 4.0.0
* WC tested up to: 5.8.0
* WC tested up to: 5.9.0
*/

if(!defined('ABSPATH')) exit;

define( 'WCDP_DIR', dirname(__FILE__).'/' );
define( 'WCDP_DIR_URL', plugin_dir_url( __FILE__ ) );
const WCDP_VERSION = '1.0.4';
const WCDP_VERSION = '1.0.5';

/**
* Check if WooCommerce is active
Expand Down Expand Up @@ -55,6 +55,11 @@ public function __construct() {
$wcdp_form = new WCDP_Form();
WCDP_Integrator::init();

//Load textdomain
add_action( 'init', function() {
load_plugin_textdomain( 'wc-donation-platform', false, WCDP_DIR . '/languages' );
} );

//Add plugin action links
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array(__CLASS__, 'plugin_action_links') );
add_filter( 'plugin_row_meta', array( __CLASS__, 'plugin_row_meta' ), 10, 2 );
Expand Down

0 comments on commit 60ef33f

Please sign in to comment.