[WordPress] 外掛分享: GunsNPrices Firearm Specs

首頁 › 外掛目錄 › GunsNPrices Firearm Specs
WordPress 外掛 GunsNPrices Firearm Specs 的封面圖片
全新外掛
安裝啟用
—
尚無評分
剛更新
最後更新
—
問題解決
WordPress 6.4+ PHP 7.4+ v0.1.0 上架:2026-11-29

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「GunsNPrices Firearm Specs」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Gun and ammo product titles already contain the specs, just not in a form a store can filter or compare: Glock 19 Gen 5 9mm 4.02" 15rd Pistol, GLOCK G19 GEN5 9MM 15RD FS, Federal American Eagle 9mm 115gr FMJ 50 Rounds. This plugin reads them and saves the specs on your products.
From a title (and the SKU or part number, if you have one) it reads:

Caliber, normalized to one name per cartridge: 9mm, 9MM LUGER and 9x19 all become 9×19mm Parabellum (293 calibers, handgun, rifle, rimfire, shotgun).
Brand and model for 50 firearm brands, down to the generation and configuration: Glock 19 Gen 5, Sig Sauer P365 XL, Ruger 10/22 Carbine. Accessories, parts, airguns and airsoft are not mistaken for guns.
Magazine capacity: 15rd, 17+1, 10-shot.
Barrel length in inches: 4.02", 16 1/2", 22 BBL, O/U 12/28. Chamber length (3" on shotguns) is not mistaken for the barrel.
Rounds per box for ammunition: 50/Box, Box of 20, 1,000 Rounds.

With WooCommerce

A Firearm & ammo specs tab on the product screen, with a “Fill from title” button. You can correct any value by hand.
Bulk actions on the Products list: “Fill specs from title” (fills empty fields) and “Re-read specs from title (replace)”.
Fill specs for all products in one click on the settings page, in small batches, or wp gunsnprices fill on the command line.
New products are filled automatically the first time they are saved, including products created by CSV import or the REST API (can be turned off).
Cost per round next to the price of ammo, on product pages and in shop lists, for example “$21.99 ($0.44 per round)”. It follows your currency and tax display settings.
The specs in the Additional information tab of the product page.
Optional: copy the specs into global product attributes (pa_caliber, pa_capacity, pa_barrel-length, pa_rounds-per-box, pa_brand, pa_model) so shoppers can filter by caliber or capacity with WooCommerce’s filter blocks. Existing attributes with the same slug are reused, and attributes used for variations are never touched.

Without WooCommerce

Cost per round block and the [gnpfs_cost_per_round] shortcode for reviews, blogs and deal posts: [gnpfs_cost_per_round price="21.99" rounds="50"] shows “$0.44 per round”. The round count can also be read from a title: [gnpfs_cost_per_round price="21.99" title="Federal 9mm 115gr FMJ 50 Rounds"].
Tools → Firearm Specs: paste up to 500 product titles or caliber names and get a table of specs, plus a tab-separated copy for spreadsheets. Handy for cleaning up a product feed or a price list before an import.

Private by design
The parser runs on your server. The plugin makes no requests to other sites, sends no data anywhere, has no tracking and adds no links to your store unless you turn on the optional credit link (off by default).
The parser is the one behind GunsNPrices, a price comparison site for US gun and ammo stores, where it reads about 64,000 store listings. It is also available as a PHP library (composer require gunsnprices/gunsnprices), and for JavaScript and Python.
Accuracy
Measured on 63,755 gun and ammo listings from 40+ US stores. When a title contains the value, the parser gets it right 94 to 98% of the time (caliber 97.8% for firearms, rounds per box 96.6%, magazine capacity 95.6%, barrel length 94.4%), and the model name matches in 99.8% of cases. Many titles simply do not mention the caliber or the barrel length; those fields stay empty and you can fill them in by hand.
Titles in English from US retailers work best.
Third-party code and data
The plugin bundles the gunsnprices PHP library 0.1.0 (https://github.com/gunsnprices/gunsnprices-php, MIT License, vendor-prefixed/gunsnprices/LICENSE.txt) in vendor-prefixed/gunsnprices/, with its namespace renamed so it cannot clash with other plugins. Its model dictionaries and caliber list (vendor-prefixed/gunsnprices/data/models.json and calibers.json) are © GunsNPrices (https://gunsnprices.com) under the Creative Commons Attribution 4.0 license (vendor-prefixed/gunsnprices/LICENSE-DATA.txt), which is compatible with the GPL. The source of the block’s editor script is the shipped blocks/cost-per-round/index.js; there is no build step.

文章
Filter
Mastodon