Plugin Directory

Changeset 3633701


Ignore:
Timestamp:
08/04/2026 04:52:32 AM (3 months ago)
Author:
gamerhubstore01
Message:

Release 1.3.1

Location:
gamerhub-for-woocommerce
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • gamerhub-for-woocommerce/tags/1.3.1/gamerhub-for-woocommerce.php

    r3633305 r3633701  
    44 * Plugin URI:        https://portal.gamerhubstore.shop
    55 * Description:       Sell game top-ups & vouchers through GamerHub. Auto-fulfills WooCommerce orders on payment and syncs status back via a signed webhook.
    6  * Version:           1.3.0
     6 * Version:           1.3.1
    77 * Author:            GamerHub
    88 * License:           GPL-2.0-or-later
    … …  
    2020}
    2121
    22 define('GAMERHUB_VERSION', '1.3.0');
     22define('GAMERHUB_VERSION', '1.3.1');
    2323define('GAMERHUB_FILE', __FILE__);
    2424define('GAMERHUB_DIR', plugin_dir_path(__FILE__));
  • gamerhub-for-woocommerce/tags/1.3.1/includes/class-gamerhub-orders.php

    r3633305 r3633701  
    702702        $subs = json_decode((string) $item->get_meta('_gamerhub_subs') ?: '[]', true);
    703703        if (is_array($subs) && ! empty($subs)) {
     704            // A qty>1 line is placed one unit at a time, and place() saves _gamerhub_subs after
     705            // EVERY unit so an instant delivery webhook can find the sub it belongs to. That means
     706            // this can be asked for a status while placement is still running, with only some of
     707            // the units in the list — and aggregating a partial list says "all done" as soon as
     708            // those few are done.
     709            //
     710            // That is not cosmetic. refresh_status() would mark the WooCommerce order Complete and
     711            // send the completion email after, say, 3 of 5 units; if unit 4 then FAILED, the order
     712            // is already Complete and can never fall through to On Hold. The customer paid for 5,
     713            // received 3, and the shop believes it is finished. Seen live on order #3226.
     714            //
     715            // Counting against the line quantity is stateless and self-correcting — no in-progress
     716            // flag to leak if the request dies mid-placement. qty=1 lines are unaffected.
     717            $qty = 1;
     718            if (is_object($item) && method_exists($item, 'get_quantity')) {
     719                $qty = max(1, (int) $item->get_quantity());
     720            }
     721            if (count($subs) < $qty) {
     722                return 'pending';   // still being placed — not finished, not failed
     723            }
     724
    704725            return self::agg_status($subs);
    705726        }
  • gamerhub-for-woocommerce/tags/1.3.1/includes/class-gamerhub-settings.php

    r3633305 r3633701  
    203203            'auto_import'    => ! empty($_POST['auto_import']) ? '1' : '0',
    204204            'import_images'  => ! empty($_POST['import_images']) ? '1' : '0',
     205            'needs_shipping' => ! empty($_POST['needs_shipping']) ? '1' : '0',
    205206            // Allow-list, and 'optional' on anything unexpected: a stray value must never make a
    206207            // shop stricter than the owner chose and start refusing add-to-cart.
    … …  
    406407                                <?php esc_html_e('Use GamerHub’s artwork for games I add', 'gamerhub-for-woocommerce'); ?>
    407408                            </label>
     409                            <label style="display:block;margin-top:10px;">
     410                                <input type="checkbox" name="needs_shipping" value="1" <?php checked(gamerhub_opt('needs_shipping', '0'), '1'); ?> />
     411                                <?php esc_html_e('These products need shipping (untick “Virtual”)', 'gamerhub-for-woocommerce'); ?>
     412                            </label>
     413                            <?php self::hint(
     414    __('Leave this OFF unless you deliberately want to collect a shipping address.', 'gamerhub-for-woocommerce'),
     415    __('A top-up is delivered to a game account, so GamerHub marks these products Virtual — WooCommerce then asks for no address and charges no shipping. Turn this on and they become physical goods: WooCommerce will require a shipping method, and a shop that has none configured shows “No shipping options were found” and CANNOT take orders at all. Only turn it on if you have set up shipping zones first. It applies to games you add or sync from then on.', 'gamerhub-for-woocommerce')
     416); ?>
    408417                            <p class="description" style="margin:2px 0 0;max-width:640px;">
    409418                                <?php esc_html_e('The picture is copied into your own Media Library the first time you add a game, so your shop serves it, not us. A game you have already given your own picture is never changed.', 'gamerhub-for-woocommerce'); ?>
  • gamerhub-for-woocommerce/tags/1.3.1/includes/class-gamerhub-sync.php

    r3633305 r3633701  
    258258        $parent->set_status('publish');
    259259        $parent->set_catalog_visibility('visible');
    260         $parent->set_virtual(true);
     260        $parent->set_virtual(! self::needs_shipping());
    261261        $parent->set_downloadable(false);
    262262        $parent->set_attributes([$attr]);
    … …  
    343343            $var->set_attributes(['denomination' => $label]);
    344344            $var->set_status('publish');
    345             $var->set_virtual(true);
     345            $var->set_virtual(! self::needs_shipping());
    346346            $var->set_regular_price((string) $retail);
    347347            $var->set_stock_status(($sku['stock_status'] ?? 'in_stock') !== 'out_of_stock' ? 'instock' : 'outofstock');
    … …  
    10221022        update_option(self::IMAGE_MAP, $map, false);
    10231023        return (int) $id;
     1024    }
     1025
     1026
     1027    /**
     1028     * Should imported products be flagged as needing shipping?
     1029     *
     1030     * Default NO — a top-up is delivered to a game account, so these are Virtual and WooCommerce
     1031     * asks for no address. Turning it on makes them physical goods, and a shop with no shipping
     1032     * zone configured then shows "No shipping options were found" and cannot take orders at all.
     1033     * That is why it is opt-in rather than a per-product guess.
     1034     */
     1035    private static function needs_shipping(): bool
     1036    {
     1037        return gamerhub_opt('needs_shipping', '0') === '1';
    10241038    }
    10251039
    … …  
    19862000        $wc->set_status('publish');
    19872001        $wc->set_catalog_visibility('visible');
    1988         $wc->set_virtual(true);
     2002        $wc->set_virtual(! self::needs_shipping());
    19892003        $wc->set_downloadable(false);
    19902004        $wc->set_sold_individually(true);
  • gamerhub-for-woocommerce/tags/1.3.1/readme.txt

    r3633305 r3633701  
    77WC requires at least: 7.1
    88WC tested up to: 10.9
    9 Stable tag: 1.3.0
     9Stable tag: 1.3.1
    1010License: GPLv2 or later
    1111License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    104104== Changelog ==
    105105
     106= 1.3.1 =
     107* Fixed: an order for several units of the same item could be marked Complete - and the completion email sent - while only some of those units had been delivered. If a later unit then failed, the order was already Complete and could never fall through to On Hold, so a part-delivered order looked finished. An order now waits until every unit has reported.
     108* New: "These products need shipping" (GamerHub -> Setup). GamerHub products are Virtual by default, so WooCommerce asks for no address and charges no shipping. Turn this on only if you have set up shipping zones - a shop with none will show "No shipping options were found" and cannot take orders.
     109
    106110= 1.3.0 =
    107111* **Verify a buyer's game account before they pay.** Games that support it now show a "Verify Account" button under the player fields. It confirms the account exists and shows its name and region, so a mistyped ID is caught before money moves. It never blocks a sale - if the check fails, or is unavailable, the buyer can carry on, and the order records which of the two it was.
    … …  
    150154== Upgrade Notice ==
    151155
     156= 1.3.1 =
     157Fixes a multi-unit order being marked Complete before every unit was delivered, which could hide a failed unit that should have sent the order to On Hold.
     158
    152159= 1.3.0 =
    153160Adds a pre-purchase account check, gift-card codes shown in the order, and game artwork. Fixes prices written up to ten minutes stale, a manual exchange rate losing its currency pair, and add-to-cart checks being discarded on shops running WooCommerce Product Add-ons.
  • gamerhub-for-woocommerce/trunk/gamerhub-for-woocommerce.php

    r3633305 r3633701  
    44 * Plugin URI:        https://portal.gamerhubstore.shop
    55 * Description:       Sell game top-ups & vouchers through GamerHub. Auto-fulfills WooCommerce orders on payment and syncs status back via a signed webhook.
    6  * Version:           1.3.0
     6 * Version:           1.3.1
    77 * Author:            GamerHub
    88 * License:           GPL-2.0-or-later
    … …  
    2020}
    2121
    22 define('GAMERHUB_VERSION', '1.3.0');
     22define('GAMERHUB_VERSION', '1.3.1');
    2323define('GAMERHUB_FILE', __FILE__);
    2424define('GAMERHUB_DIR', plugin_dir_path(__FILE__));
  • gamerhub-for-woocommerce/trunk/includes/class-gamerhub-orders.php

    r3633305 r3633701  
    702702        $subs = json_decode((string) $item->get_meta('_gamerhub_subs') ?: '[]', true);
    703703        if (is_array($subs) && ! empty($subs)) {
     704            // A qty>1 line is placed one unit at a time, and place() saves _gamerhub_subs after
     705            // EVERY unit so an instant delivery webhook can find the sub it belongs to. That means
     706            // this can be asked for a status while placement is still running, with only some of
     707            // the units in the list — and aggregating a partial list says "all done" as soon as
     708            // those few are done.
     709            //
     710            // That is not cosmetic. refresh_status() would mark the WooCommerce order Complete and
     711            // send the completion email after, say, 3 of 5 units; if unit 4 then FAILED, the order
     712            // is already Complete and can never fall through to On Hold. The customer paid for 5,
     713            // received 3, and the shop believes it is finished. Seen live on order #3226.
     714            //
     715            // Counting against the line quantity is stateless and self-correcting — no in-progress
     716            // flag to leak if the request dies mid-placement. qty=1 lines are unaffected.
     717            $qty = 1;
     718            if (is_object($item) && method_exists($item, 'get_quantity')) {
     719                $qty = max(1, (int) $item->get_quantity());
     720            }
     721            if (count($subs) < $qty) {
     722                return 'pending';   // still being placed — not finished, not failed
     723            }
     724
    704725            return self::agg_status($subs);
    705726        }
  • gamerhub-for-woocommerce/trunk/includes/class-gamerhub-settings.php

    r3633305 r3633701  
    203203            'auto_import'    => ! empty($_POST['auto_import']) ? '1' : '0',
    204204            'import_images'  => ! empty($_POST['import_images']) ? '1' : '0',
     205            'needs_shipping' => ! empty($_POST['needs_shipping']) ? '1' : '0',
    205206            // Allow-list, and 'optional' on anything unexpected: a stray value must never make a
    206207            // shop stricter than the owner chose and start refusing add-to-cart.
    … …  
    406407                                <?php esc_html_e('Use GamerHub’s artwork for games I add', 'gamerhub-for-woocommerce'); ?>
    407408                            </label>
     409                            <label style="display:block;margin-top:10px;">
     410                                <input type="checkbox" name="needs_shipping" value="1" <?php checked(gamerhub_opt('needs_shipping', '0'), '1'); ?> />
     411                                <?php esc_html_e('These products need shipping (untick “Virtual”)', 'gamerhub-for-woocommerce'); ?>
     412                            </label>
     413                            <?php self::hint(
     414    __('Leave this OFF unless you deliberately want to collect a shipping address.', 'gamerhub-for-woocommerce'),
     415    __('A top-up is delivered to a game account, so GamerHub marks these products Virtual — WooCommerce then asks for no address and charges no shipping. Turn this on and they become physical goods: WooCommerce will require a shipping method, and a shop that has none configured shows “No shipping options were found” and CANNOT take orders at all. Only turn it on if you have set up shipping zones first. It applies to games you add or sync from then on.', 'gamerhub-for-woocommerce')
     416); ?>
    408417                            <p class="description" style="margin:2px 0 0;max-width:640px;">
    409418                                <?php esc_html_e('The picture is copied into your own Media Library the first time you add a game, so your shop serves it, not us. A game you have already given your own picture is never changed.', 'gamerhub-for-woocommerce'); ?>
  • gamerhub-for-woocommerce/trunk/includes/class-gamerhub-sync.php

    r3633305 r3633701  
    258258        $parent->set_status('publish');
    259259        $parent->set_catalog_visibility('visible');
    260         $parent->set_virtual(true);
     260        $parent->set_virtual(! self::needs_shipping());
    261261        $parent->set_downloadable(false);
    262262        $parent->set_attributes([$attr]);
    … …  
    343343            $var->set_attributes(['denomination' => $label]);
    344344            $var->set_status('publish');
    345             $var->set_virtual(true);
     345            $var->set_virtual(! self::needs_shipping());
    346346            $var->set_regular_price((string) $retail);
    347347            $var->set_stock_status(($sku['stock_status'] ?? 'in_stock') !== 'out_of_stock' ? 'instock' : 'outofstock');
    … …  
    10221022        update_option(self::IMAGE_MAP, $map, false);
    10231023        return (int) $id;
     1024    }
     1025
     1026
     1027    /**
     1028     * Should imported products be flagged as needing shipping?
     1029     *
     1030     * Default NO — a top-up is delivered to a game account, so these are Virtual and WooCommerce
     1031     * asks for no address. Turning it on makes them physical goods, and a shop with no shipping
     1032     * zone configured then shows "No shipping options were found" and cannot take orders at all.
     1033     * That is why it is opt-in rather than a per-product guess.
     1034     */
     1035    private static function needs_shipping(): bool
     1036    {
     1037        return gamerhub_opt('needs_shipping', '0') === '1';
    10241038    }
    10251039
    … …  
    19862000        $wc->set_status('publish');
    19872001        $wc->set_catalog_visibility('visible');
    1988         $wc->set_virtual(true);
     2002        $wc->set_virtual(! self::needs_shipping());
    19892003        $wc->set_downloadable(false);
    19902004        $wc->set_sold_individually(true);
  • gamerhub-for-woocommerce/trunk/readme.txt

    r3633305 r3633701  
    77WC requires at least: 7.1
    88WC tested up to: 10.9
    9 Stable tag: 1.3.0
     9Stable tag: 1.3.1
    1010License: GPLv2 or later
    1111License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    104104== Changelog ==
    105105
     106= 1.3.1 =
     107* Fixed: an order for several units of the same item could be marked Complete - and the completion email sent - while only some of those units had been delivered. If a later unit then failed, the order was already Complete and could never fall through to On Hold, so a part-delivered order looked finished. An order now waits until every unit has reported.
     108* New: "These products need shipping" (GamerHub -> Setup). GamerHub products are Virtual by default, so WooCommerce asks for no address and charges no shipping. Turn this on only if you have set up shipping zones - a shop with none will show "No shipping options were found" and cannot take orders.
     109
    106110= 1.3.0 =
    107111* **Verify a buyer's game account before they pay.** Games that support it now show a "Verify Account" button under the player fields. It confirms the account exists and shows its name and region, so a mistyped ID is caught before money moves. It never blocks a sale - if the check fails, or is unavailable, the buyer can carry on, and the order records which of the two it was.
    … …  
    150154== Upgrade Notice ==
    151155
     156= 1.3.1 =
     157Fixes a multi-unit order being marked Complete before every unit was delivered, which could hide a failed unit that should have sent the order to On Hold.
     158
    152159= 1.3.0 =
    153160Adds a pre-purchase account check, gift-card codes shown in the order, and game artwork. Fixes prices written up to ten minutes stale, a manual exchange rate losing its currency pair, and add-to-cart checks being discarded on shops running WooCommerce Product Add-ons.
Note: See TracChangeset for help on using the changeset viewer.