Plugin Directory

Changeset 3751965


Ignore:
Timestamp:
10/17/2026 01:38:55 PM (3 weeks ago)
Author:
quotanto
Message:

Release 1.0.1

Location:
quotanto
Files:
31 added
6 edited

Legend:

Unmodified
Added
Removed
  • quotanto/trunk/assets/quotanto.css

    r3746953 r3751965  
    104104}
    105105
     106/* The quote box printed for a quote cart goes once the last quote-only line is removed, as it would after a reload. */
     107body:not(.quotanto-quote-cart) .quotanto--quote-cart {
     108        display: none;
     109}
     110
    106111/* With hidden prices it shows no prices and no totals either, instead of zeros. */
    107112.quotanto-quote-cart-no-prices .wc-block-cart__sidebar,
  • quotanto/trunk/blocks/request-button/block.json

    r3746953 r3751965  
    33        "apiVersion": 3,
    44        "name": "quotanto/request-button",
    5         "version": "1.0.0",
     5        "version": "1.0.1",
    66        "title": "Request a quote",
    77        "category": "woocommerce",
  • quotanto/trunk/includes/class-quotanto-request-form.php

    r3746953 r3751965  
    392392                                echo '</div>';
    393393                        } elseif ( Quotanto_Catalog::cart_needs_quote() ) {
    394                                 echo '<div class="quotanto" id="quotanto-cart"><p class="quotanto__notice quotanto__notice--error" role="alert">' . esc_html__( 'Remove the products that cannot be quoted to send this cart as a request.', 'quotanto' ) . '</p></div>';
     394                                echo '<div class="quotanto quotanto--quote-cart" id="quotanto-cart"><p class="quotanto__notice quotanto__notice--error" role="alert">' . esc_html__( 'Remove the products that cannot be quoted to send this cart as a request.', 'quotanto' ) . '</p></div>';
    395395                        }
    396396                        return;
    … …  
    440440                $prefill = self::prefill();
    441441                // A cart that can only be quoted shows its form open: it is the only way forward.
    442                 $open = ( '' !== $state && 'sent' !== $state ) || ( null === $product && Quotanto_Catalog::cart_needs_quote() );
     442                $quote_cart = null === $product && Quotanto_Catalog::cart_needs_quote();
     443                $open       = ( '' !== $state && 'sent' !== $state ) || $quote_cart;
    443444
    444445                $hidden = array( 'action' => self::ACTION ) + $hidden + array(
    … …  
    449450
    450451                ?>
    451                 <div class="quotanto" id="<?php echo esc_attr( $id ); ?>">
     452                <div class="quotanto<?php echo esc_attr( $quote_cart ? ' quotanto--quote-cart' : '' ); ?>" id="<?php echo esc_attr( $id ); ?>">
    452453                        <?php self::print_notice( $state ); ?>
    453                         <?php if ( null === $product && Quotanto_Catalog::cart_needs_quote() ) : ?>
     454                        <?php if ( $quote_cart ) : ?>
    454455                        <p class="quotanto__note"><?php esc_html_e( 'These products are sold by quote. Send the cart as a request and we will reply with prices.', 'quotanto' ); ?></p>
    455456                        <?php endif; ?>
    … …  
    527528
    528529        /**
     530         * The visitor's IP for the hourly rate limit.
     531         *
     532         * Uses the address WooCommerce stores on orders, which reads the forwarded headers a proxy such as
     533         * Cloudflare sends; behind a proxy the server's own address is the proxy's, shared by every visitor.
     534         *
     535         * @return string IP address, or 'unknown'.
     536         */
     537        private static function rate_limit_ip(): string {
     538                $ip = class_exists( 'WC_Geolocation' ) ? WC_Geolocation::get_ip_address() : '';
     539
     540                /**
     541                 * Filters the IP address the request form's hourly rate limit counts by.
     542                 *
     543                 * @param string $ip IP address of the visitor, as WooCommerce detects it.
     544                 */
     545                $ip = sanitize_text_field( (string) apply_filters( 'quotanto_rate_limit_ip', $ip ) );
     546
     547                return '' === $ip ? 'unknown' : $ip;
     548        }
     549
     550        /**
    529551         * Redirects back to the page the form was on, with the state.
    530552         *
    … …  
    683705                }
    684706
    685                 $ip_key = 'quotanto_rl_' . md5( isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : 'unknown' );
     707                $ip_key = 'quotanto_rl_' . md5( self::rate_limit_ip() );
    686708                $count  = (int) get_transient( $ip_key );
    687709                if ( $count >= self::RATE_LIMIT ) {
  • quotanto/trunk/languages/quotanto.pot

    r3746953 r3751965  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Quotanto 1.0.0\n"
     5"Project-Id-Version: Quotanto 1.0.1\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/quotanto\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-10-11T20:31:49+02:00\n"
     12"POT-Creation-Date: 2026-10-17T15:17:36+02:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    7777
    7878#: includes/class-quotanto-captcha.php:183
    79 #: includes/class-quotanto-request-form.php:521
     79#: includes/class-quotanto-request-form.php:522
    8080msgid "Please complete the captcha and try again."
    8181msgstr ""
    … …  
    195195msgstr ""
    196196
    197 #: includes/class-quotanto-request-form.php:454
     197#: includes/class-quotanto-request-form.php:455
    198198msgid "These products are sold by quote. Send the cart as a request and we will reply with prices."
    199199msgstr ""
    200200
    201 #: includes/class-quotanto-request-form.php:469
     201#: includes/class-quotanto-request-form.php:470
    202202msgid "Quantity"
    203203msgstr ""
    204204
    205 #: includes/class-quotanto-request-form.php:474
     205#: includes/class-quotanto-request-form.php:475
    206206msgid "Your name"
    207207msgstr ""
    208208
    209 #: includes/class-quotanto-request-form.php:478
     209#: includes/class-quotanto-request-form.php:479
    210210msgid "Email address"
    211211msgstr ""
    212212
    213 #: includes/class-quotanto-request-form.php:483
     213#: includes/class-quotanto-request-form.php:484
    214214#: includes/class-quotanto-settings-page.php:160
    215215msgid "Phone"
    216216msgstr ""
    217217
    218 #: includes/class-quotanto-request-form.php:483
     218#: includes/class-quotanto-request-form.php:484
    219219msgid "Phone (optional)"
    220220msgstr ""
    221221
    222 #: includes/class-quotanto-request-form.php:484
     222#: includes/class-quotanto-request-form.php:485
    223223msgid "Digits, spaces and + ( ) - . only"
    224224msgstr ""
    225225
    226 #: includes/class-quotanto-request-form.php:489
     226#: includes/class-quotanto-request-form.php:490
    227227msgid "Anything we should know?"
    228228msgstr ""
    229229
    230 #: includes/class-quotanto-request-form.php:489
     230#: includes/class-quotanto-request-form.php:490
    231231msgid "Anything we should know? (optional)"
    232232msgstr ""
    233233
    234 #: includes/class-quotanto-request-form.php:507
     234#: includes/class-quotanto-request-form.php:508
    235235msgid "Send request"
    236236msgstr ""
    237237
    238 #: includes/class-quotanto-request-form.php:522
     238#: includes/class-quotanto-request-form.php:523
    239239msgid "Too many requests from this connection. Please try again in an hour."
    240240msgstr ""
    241241
    242 #: includes/class-quotanto-request-form.php:523
     242#: includes/class-quotanto-request-form.php:524
    243243msgid "Please check the form and try again. If the page has been open for a long time, reload it first."
    244244msgstr ""
    245245
    246 #: includes/class-quotanto-request-form.php:524
     246#: includes/class-quotanto-request-form.php:525
    247247msgid "We could not save your request. Please try again in a moment."
    248248msgstr ""
    249249
    250 #: includes/class-quotanto-request-form.php:722
     250#: includes/class-quotanto-request-form.php:744
    251251msgid "Quote requested from the cart."
    252252msgstr ""
    253253
    254 #: includes/class-quotanto-request-form.php:722
     254#: includes/class-quotanto-request-form.php:744
    255255msgid "Quote requested from the product page."
    256256msgstr ""
  • quotanto/trunk/quotanto.php

    r3746953 r3751965  
    44 * Plugin URI:        https://quotanto.com
    55 * Description:       Let customers request a quote, price it in WooCommerce, and let them pay at your normal checkout. Works with block cart and checkout.
    6  * Version:           1.0.0
     6 * Version:           1.0.1
    77 * Requires at least: 6.9
    88 * Requires PHP:      8.1
    … …  
    2121defined( 'ABSPATH' ) || exit;
    2222
    23 define( 'QUOTANTO_VERSION', '1.0.0' );
     23define( 'QUOTANTO_VERSION', '1.0.1' );
    2424define( 'QUOTANTO_FILE', __FILE__ );
    2525define( 'QUOTANTO_DIR', plugin_dir_path( __FILE__ ) );
  • quotanto/trunk/readme.txt

    r3746953 r3751965  
    66Requires PHP: 8.1
    77Requires Plugins: woocommerce
    8 Stable tag: 1.0.0
     8Stable tag: 1.0.1
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    2929* Quotes expire on their own.
    3030
    31 = Everything is free =
     31= Features =
    3232
    3333* Simple and variable products.
    … …  
    105105Built-in spam protection, with no third-party service.
    106106
     107= Does it work behind Cloudflare? =
     108
     109Yes. The hourly request limit counts each visitor, not the proxy.
     110
    107111= Can I add a captcha? =
    108112
    … …  
    133137== Changelog ==
    134138
     139= 1.0.1 =
     140* Fix: Request limit counts each visitor, also behind a proxy.
     141* Fix: Cart quote form hides when the last quote-only product is removed.
     142* Dev: New filter `quotanto_rate_limit_ip`.
     143
    135144= 1.0.0 =
    136145* First release.
Note: See TracChangeset for help on using the changeset viewer.