Plugin Directory

Changeset 3363830


Ignore:
Timestamp:
09/18/2025 09:07:46 AM (7 months ago)
Author:
theorcawp
Message:
  • Added - Freemius SDK
  • Updated - version 1.4
Location:
simple-checkout-page-donationstips-for-woocommerce
Files:
468 added
2 edited

Legend:

Unmodified
Added
Removed
  • simple-checkout-page-donationstips-for-woocommerce/trunk/readme.txt

    r2333927 r3363830  
    11=== Simple checkout page donations/tips for WooCommerce ===
    22
    3 Contributors: rynald0s
     3Contributors: theorcawp
    44Tags:   WooCommerce, donations, tips, WooCommerce tips, WooCommerce donations, donate, gratuity, WooCommerce gratuity, WooCommerce donate, tips
    5 Requires at least: 5.0
    6 Tested up to:      5.4.2
    7 Stable tag:        1.0
    8 WC requires at least: 3.0
    9 WC tested up to: 4.2.0
    10 License: GPLv3 or later License
    11 URI: http://www.gnu.org/licenses/gpl-3.0.html
     5Requires at least: 6.0
     6Tested up to:      6.8
     7Stable tag:        1.4
     8WC requires at least: 6.0
     9WC tested up to: 10.0.4
     10License: GPL-3.0-or-later
     11License URI: https://www.gnu.org/licenses/gpl-3.0.html
    1212
    1313This plugin lets you add custom tips for display in the checkout page. These tips are optional for the customer to add to the cart fee.
     
    3636== Changelog ==
    3737
     38= 1.4 =
     39* Updated - version
     40* Updated - compatible with latest PHP version.
     41* Added   - Freemius SDK
     42
    3843= 1.0 =
    3944
  • simple-checkout-page-donationstips-for-woocommerce/trunk/wc-tipme.php

    r2333927 r3363830  
    33/*
    44 Plugin Name: Simple checkout page donations/tips for WooCommerce
    5  Plugin URI: https://profiles.wordpress.org/rynald0s
     5 Plugin URI: https://profiles.wordpress.org/theorcawp
    66 Description: This plugin lets you add some doantion options to the checkout page.
    7  Author: Rynaldo Stoltz
    8  Author URI: http:rynaldo.com
    9  Version: 1.3
    10  License: GPLv3 or later License
    11  URI: http://www.gnu.org/licenses/gpl-3.0.html
     7 Author: theorcawp
     8 Author URI: https://orcawp.com
     9 text Domain: simple-checkout-page-donationstips-for-woocommerce
     10 Version: 1.4
     11 License: GPLv2 or later
     12 License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    1213 */
    1314
     
    1617}
    1718
     19if ( ! function_exists( 'scpdtfw_fs' ) ) {
     20    // Create a helper function for easy SDK access.
     21    function scpdtfw_fs() {
     22        global $scpdtfw_fs;
     23
     24        if ( ! isset( $scpdtfw_fs ) ) {
     25            // Include Freemius SDK.
     26            require_once dirname( __FILE__ ) . '/freemius/start.php';
     27            $scpdtfw_fs = fs_dynamic_init( array(
     28                'id'                  => '20468',
     29                'slug'                => 'simple-checkout-page-donations-tips-for-woocommerce',
     30                'type'                => 'plugin',
     31                'public_key'          => 'pk_253c2360f48216089e2a35f03eca7',
     32                'is_premium'          => false,
     33                'has_addons'          => false,
     34                'has_paid_plans'      => false,
     35                'menu'                => array(
     36                    'first-path'     => 'plugins.php',
     37                    'account'        => false,
     38                    'contact'        => false,
     39                    'support'        => false,
     40                ),
     41            ) );
     42        }
     43
     44        return $scpdtfw_fs;
     45    }
     46
     47    // Init Freemius.
     48    scpdtfw_fs();
     49    // Signal that SDK was initiated.
     50    do_action( 'scpdtfw_fs_loaded' );
     51}
     52
    1853if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
    1954
    2055function wc_tipme_section( $sections ) {
    21     $sections['wc_tipme_section'] = __( 'Simple donations/tips for WooCommerce', 'woocommerce' );
     56    $sections['wc_tipme_section'] = esc_html__( 'Simple donations/tips for WooCommerce', 'simple-checkout-page-donationstips-for-woocommerce' );
    2257    return $sections;
    2358}
     
    3065    if ( 'wc_tipme_section' === $current_section ) {
    3166
    32         $wc_tipme_settings[] = array( 'title' => __( 'Tips', 'woocommerce' ), 'type' => 'title', 'id' => 'wc_tipme' );
     67        $wc_tipme_settings[] = array( 'title' => esc_html__( 'Tips', 'simple-checkout-page-donationstips-for-woocommerce' ), 'type' => 'title', 'id' => 'wc_tipme' );
    3368
    3469        $wc_tipme_settings[] = array(
    35                 'name'     => __( 'Enable ', 'woocommerce' ),
     70                'name'     => esc_html__( 'Enable ', 'simple-checkout-page-donationstips-for-woocommerce' ),
    3671                'type' => 'checkbox',
    37                 'desc'     => __( 'Enable the plugin', 'woocommerce' ),
     72                'desc'     => esc_html__( 'Enable the plugin', 'simple-checkout-page-donationstips-for-woocommerce' ),
    3873                'id'       => 'wc_tipme_enable',
    3974                'desc_tip' => true
     
    4176
    4277        $wc_tipme_settings[] = array(
    43                 'name'     => __( 'Label ', 'woocommerce' ),
     78                'name'     => esc_html__( 'Label ', 'simple-checkout-page-donationstips-for-woocommerce' ),
    4479                'type' => 'text',
    45                 'desc'     => __( 'Add your own label, such as "Want to give me a tip?"', 'woocommerce' ),
     80                'desc'     => esc_html__( 'Add your own label, such as "Want to give me a tip?"', 'simple-checkout-page-donationstips-for-woocommerce' ),
    4681                'id'       => 'wc_tipme_label',
    4782            );
    4883
    4984        $wc_tipme_settings[] = array(
    50                 'title'    => __( 'Tip option 1', 'woocommerce' ),
    51                 'desc' => __( 'Add your preferred tip amount here', 'woocommerce' ),
     85                'title'    => esc_html__( 'Tip option 1', 'simple-checkout-page-donationstips-for-woocommerce' ),
     86                'desc' => esc_html__( 'Add your preferred tip amount here', 'simple-checkout-page-donationstips-for-woocommerce' ),
    5287                'id'       => 'wc_tipme_option_1',
    53                 'type'     => 'text',
     88                'type'     => 'number',
    5489                'placeholder' => '2',
    5590                'css'      => 'min-width:250px;',
     91                'custom_attributes' => array(
     92                    'min'  => '0',  // no negatives allowed
     93                    'step' => '1',  // only integers, change to 0.01 if decimals allowed
     94                ),
     95                'default' => 2,
    5696            );
    5797
    5898        $wc_tipme_settings[] = array(
    59                 'title'    => __( 'Tip option 2', 'woocommerce' ),
    60                 'desc' => __( 'Add your preferred tip amount here', 'woocommerce' ),
     99                'title'    => esc_html__( 'Tip option 2', 'simple-checkout-page-donationstips-for-woocommerce' ),
     100                'desc' => esc_html__( 'Add your preferred tip amount here', 'simple-checkout-page-donationstips-for-woocommerce' ),
    61101                'id'       => 'wc_tipme_option_2',
    62                 'type'     => 'text',
     102                'type'     => 'number',
    63103                'placeholder' => '5',
    64104                'css'      => 'min-width:350px;',
     105                'custom_attributes' => array(
     106                    'min'  => '0',  // no negatives allowed
     107                    'step' => '1',  // only integers, change to 0.01 if decimals allowed
     108                ),
     109                'default' => 5,
    65110            );
    66111
    67112        $wc_tipme_settings[] = array(
    68                 'title'    => __( 'Tip option 3', 'woocommerce' ),
    69                 'desc' => __( 'Add your preferred tip amount here', 'woocommerce' ),
     113                'title'    => esc_html__( 'Tip option 3', 'simple-checkout-page-donationstips-for-woocommerce' ),
     114                'desc' => esc_html__( 'Add your preferred tip amount here', 'simple-checkout-page-donationstips-for-woocommerce' ),
    70115                'id'       => 'wc_tipme_option_3',
    71                 'type'     => 'text',
     116                'type'     => 'number',
    72117                'placeholder' => '10',
    73118                'css'      => 'min-width:350px;',
     119                'custom_attributes' => array(
     120                    'min'  => '0',  // no negatives allowed
     121                    'step' => '1',  // only integers, change to 0.01 if decimals allowed
     122                ),
     123                'default' => 10,
    74124            );
    75125
     
    101151     
    102152   echo '<div id="checkout-radio">';
    103    echo '<h4>' . get_option('wc_tipme_label') . '</h4>';
     153   echo '<h4>' . esc_html( get_option('wc_tipme_label') ) . '</h4>';
    104154   woocommerce_form_field( 'radio_choice', $args, $chosen );
    105155   echo '</div>';
     
    132182
    133183function wc_tipme_adding_styles() {
    134 wp_register_style('tipme', plugins_url('/assets/css/tipme.css', __FILE__));
     184wp_register_style('tipme', plugins_url('/assets/css/tipme.css', __FILE__), array(), '1.0', 'all');
    135185wp_enqueue_style('tipme');
    136186}
Note: See TracChangeset for help on using the changeset viewer.