Bani Honar Toolkit
Visitor statistics, link shortener, QR codes, barcodes, post duplicator and page shield in one modular plugin.
Install in
Bani Honar Toolkit is a small, modular plugin. Every feature is a module that you can switch on or off from one dashboard, and developers can add their own modules.
Included modules
- Link Shortener – short links on your own domain, with random or custom case-sensitive codes, click counts and a choice of redirect type.
- QR Code Generator – QR codes for a link, a page of your site or any text, in many looks and with a logo, plus a contact card (vCard) that saves a phone number into Android and iPhone contacts, a Wi-Fi code that joins a network, and an Event code that adds a date to the calendar. PNG and SVG downloads.
- Barcode Generator – linear product barcodes (EAN-13, EAN-8, UPC-A, Code 128, Code 39, ITF and ITF-14) with the check digit added for you, as PNG or SVG.
- Visitor Stats (off by default) – every visit with its source, country, device and page, a filterable log with CSV download, and IP blocking. No cookies.
- Post Duplicator – copy posts, pages and custom content with one click, and edit a live page safely through a hidden draft.
- Page Shield (off by default) – makes casual copying of your pages harder, with no effect on search engines.
- Contact the IT team – a tab to write a suggestion, criticism or problem report by e-mail.
- Profile Pictures – upload a profile picture from the profile screen, no Gravatar needed.
Every option of every module is described in the questions at the start of the FAQ.
فارسی
افزونه چندمنظوره، ماژولار و قابل توسعه برای وردپرس: آمار کامل بازدید (چند بازدید، از کجا، با چه آدرس IP و از کدام کشور، با چه دستگاه و چه مدلی)، کوتاهکنندهی لینک با دامنهی خودتان، کیو آر کد با شکلهای ظاهری بسیار و «ذخیره مستقیم مخاطب» برای اندروید و آیفون، محافظ صفحه، تکثیر نوشته و برگه با «ویرایش امن» صفحههای زنده، آپلود تصویر پروفایل بدون گراواتار.
For developers
Extend BHTK_Module and register your module on the bhtk_register_modules action. It gets a dashboard card, an on/off switch and its own section on the Settings screen.
add_action( 'bhtk_register_modules', function ( $plugin ) { $plugin->register_module( new My_Module() ); } );
Use the bhtk_capability filter to change the capability needed to use the toolkit (default: manage_options).
Use the bhtk_languages filter to add an interface language: add_filter( 'bhtk_languages', function ( $languages ) { $languages['de'] = array( 'name' => 'Deutsch', 'english' => 'German', 'locale' => 'de_DE', 'rtl' => false, 'calendar' => 'gregorian' ); return $languages; } );
Third-party code
The QR Code Generator uses the MIT-licensed “QR Code Generator for JavaScript” by Kazuhiko Arase (version 2.0.4), included in assets/js/vendor/. QR Code is a registered trademark of DENSO WAVE INCORPORATED.
Privacy
The Post Duplicator stores no personal data. It marks copies and safe-edit drafts with four small custom fields (_bhtk_clone_of, _bhtk_fork_of, _bhtk_open_fork, _bhtk_fork_time) that hold post numbers and a time; they are removed when you delete all toolkit data.
The link shortener stores, for each link: the code, the destination, an optional note, the click count, the time of the last click, who created it and when. Visitors are not identified or logged by it.
The Visitor Stats module is off by default. While it is on, one small request is sent from the visitor’s browser to your own website for every page opened (at most 600 views a minute are recorded for the whole site; developers can change this with the bhtk_visits_max_per_minute filter), and your site stores: the date and time, the IP address (or the address with its last part removed, if you choose so), the country, the page address and title, the referring website, campaign tags (utm_), the browser’s User-Agent text and the device details derived from it, screen size, language and time zone. A random session code lives in the browser’s sessionStorage; no cookies are set. Visits older than the retention period you choose (365 days by default) are deleted automatically, and you can delete everything or download it at any time. An IP address can be personal data in some countries: if your visitors are protected by such a law, mention the counting in your privacy policy.
A visit from a logged-in member also stores that member’s user id; the name and e-mail address are read from the WordPress user when you open the details. Words typed into the search box of your website (?s=) are stored with the visit. Visitor Stats never reads or stores a computer name, a file path or an e-mail address from the visitor’s device: browsers do not allow websites to read them.
The country is read from your CDN or server first (Cloudflare, ArvanCloud, CloudFront and others) and from earlier visits of the same address. The option “Find the country online when the server does not know it” is off by default. Only when you switch it on, and only when the country cannot be read in another way, the visitor IP address is sent to an outside lookup service. See the section “External services” below for what is sent, to whom, and the terms and privacy policy of each service. Without that option no address leaves your server. Nothing else is sent to outside services.
The toolkit adds suggested text to the privacy policy guide (Settings > Privacy), and connects Visitor Stats to the WordPress tools Tools > Export Personal Data and Tools > Erase Personal Data: visits of a member are found by e-mail address. When a user account is deleted, the visits of that user stay as anonymous statistics.
The Contact tab sends nothing from your website; it only opens the e-mail program of the person who presses a button.
External services
Bani Honar Toolkit can connect to two kinds of outside service: the translation service of WordPress.org (to get the translation of the plugin language you choose, and to know which languages exist) and, only if you switch it on, an IP-address-to-country lookup used by the Visitor Stats module. The Link Shortener, QR Code Generator, Barcode Generator, Post Duplicator, Page Shield and Profile Pictures modules never contact an outside service: QR codes and barcodes are drawn in the browser and profile pictures are stored on your own site.
Translations (WordPress.org)
- What it is and what it is for: WordPress.org’s own translation service, the one WordPress uses to update the translations of your plugins. It is used (1) to know which languages have a translation of this plugin, so that they appear in the “Plugin language” list, and (2) to download the translation of the language in use, because WordPress downloads a translation only for the site language.
- When it runs: only when an administrator is logged in and opens a toolkit screen, and only on the administration side, never for visitors. The list of languages is read when the Settings screen is opened, at most twice a day. The translation of the plugin language in use is downloaded when it is missing or when WordPress.org has a newer one; a failed attempt is not repeated for an hour. Nothing is requested for English, which is built in, or for a translation that is installed and up to date, and no scheduled task or button is involved.
- What is sent: to
api.wordpress.org, with the WordPress functiontranslations_api(), the plugin name (slug) and version, the WordPress version and the language of your site, exactly as WordPress does for its own translation updates; the request also carries the web address of your site in the User-Agent, as every request that WordPress sends to WordPress.org does. The translation package is then downloaded fromdownloads.wordpress.organd nothing else is accepted. No visitor data and no personal data is sent. - What comes back: the list of languages with their names and dates, and a small package with the translation files (
.poand.mo), which the WordPress upgrader saves inwp-content/languages/plugins/. - Service: WordPress.org, Privacy Policy.
IP-address-to-country lookup (Visitor Stats, optional, off by default)
- What it is and what it is for: a free web service that tells which country an IP address belongs to. It is used only to fill in the country of a visit when your CDN or server did not provide it and the address was not already known from an earlier visit.
- When it runs: only after an administrator ticks “Find the country online when the server does not know it” under Bani Honar Toolkit > Visitor Stats > Settings. Then one request is made for a visit from a public IP address whose country is unknown, and an hourly background task retries up to 20 recent addresses whose country is still unknown. If a service fails, lookups pause for ten minutes.
- What is sent: the visitor’s IP address (inside the request address) and the plugin name and version in the User-Agent header, for example
BaniHonarToolkit/1.2.0. Like any web request, the service also sees your server’s IP address. No page address, cookie, name, e-mail or other visitor detail is sent. If you also tick “Hide the last part of every IP address”, your site saves only the shortened address, but the full address is still used for that single lookup and is not stored. - What comes back: a two-letter country code, which is saved with the visit.
- The “Check the country lookup” button (Visitor Stats > Settings): only when an administrator presses it, the plugin asks each service about the public example address
8.8.8.8(a well-known public DNS address, not a visitor) to find out whether your server can reach the services. No visitor data is sent. It works even when the option above is off, because it is a manual test and nothing is stored. - Which service: you choose it in the settings. “Automatic” tries ipwho.is first and then GeoJS.
Services used:
- ipwho.is (free endpoint of the IPWhois API,
https://ipwho.is/{ip}): Terms of Service and Privacy Policy. - GeoJS (
https://get.geojs.io/v1/ip/country/{ip}.json): Terms of Service and Privacy Policy.
If you do not want any address to leave your server, leave the option off, or answer from a local database with the bhtk_geo_lookup filter, which skips the online services. If you use the option, mention it in your own privacy policy; the plugin adds suggested text to Settings > Privacy.
Links that open another website only when you click them (for example “Write in Gmail” on the Contact us tab, or the Google Search Console link in Visitor Stats) are ordinary links; the plugin itself sends nothing to those sites.
Written by Joobi from the project's own listing. See the source page
1.2.0
- New module: Barcode Generator (new “Barcode” tab). Linear barcodes: EAN-13, EAN-8 and UPC-A (the check digit is added for you and a wrong one is explained), Code 128 (all Latin text; it picks the shortest of its three character sets), Code 39 (with an optional check character), ITF and ITF-14 (with the frame of cartons). The numbers are printed in the real EAN/UPC layout with long guard bars. Colors or a transparent background, bar height, image size and white border can be chosen; PNG and SVG download and copy to the clipboard. Persian and Arabic digits are accepted. Drawn in the browser; nothing is uploaded or stored.
- QR Code Generator: new Wi-Fi tab (network name, hidden network, password, encryption none / WPA-WPA2 / WEP): phones join the network when they scan the code.
- QR Code Generator: new Event tab (title, place, start, end): the code adds the event to the calendar of the phone.
- QR Code Generator: many more designs. Seventeen dot shapes (was eight), eight corner-frame shapes (was four), eight corner-dot shapes (was four), eighteen ready-made styles (was nine), radial and diagonal gradients and a transparent background. Every shape and every style was checked with a real barcode reader.
- Languages: the Install button and the Translations box are gone. The translation of the plugin language is now installed automatically with the WordPress upgrader when an administrator opens a toolkit screen (and updated when WordPress.org has a newer one), and the “Plugin language” list grows by itself: every language that has a translation on WordPress.org, or is already installed on the site, appears with its own name, text direction and calendar. Nothing runs in the background and nothing is requested for visitors; the “External services” section describes the exact requests.
- New 3D header and tabs: a raised glossy logo tile, floating cards and a glass cube that lean towards the mouse pointer and move only while it is over the header (so the screens stay light), a perspective floor, a plain sharp title, and tabs with icons that press down like keys. It works in right-to-left and left-to-right screens, on phones, and stands still for people who ask their system for less motion.
- QR Code Generator and Barcode Generator: the default code color is now the brand blue (#1B396C) instead of black.
- Tabs that do not fit in one line wrap in a tidy way, and the QR tabs wrap too.
- Translations updated for every new text.
- Checked again with the automated tests (including new tests for the barcodes, the languages and the header), with the WordPress.org package build, and in a real browser with a real barcode reader.
1.1.0
- QR Code Generator: many more looks. Eight dot shapes, four corner-frame shapes, four corner-dot shapes, a two-color gradient, separate corner colors, nine ready-made styles with thumbnails, and a logo in the middle (the error-correction level is raised automatically and the logo never covers more than a safe part). PNG and SVG downloads look the same as the screen; a warning appears when the colors are too close to scan reliably.
- QR Code Generator: new “Contact” tab. The code saves a name, phone numbers, e-mail, website, company and address directly into the contacts of Android and iPhone phones (vCard 3.0). A plain phone-number code is also possible.
- QR Code Generator: the “Or pick one of your short links” list now also holds the pages and the blog posts of your website, in separate groups.
- Visitor Stats: the visitor’s country was shown as “unknown” on most sites, because WordPress cannot find a country by itself and the online lookup is off by default (privacy). The country is now also read from more CDN headers, copied from an earlier visit of the same address, and estimated from the visitor’s time zone when nothing else knows it (an option, on by default, no data leaves your site). An hourly task fills in old “unknown” visits. A new “Check the country lookup” button tests the optional online services, and the overview tells you when many countries are unknown and what to do.
- Contact tab: a notice asks people not to send code files or any other files unless the team asks for them, because the automatic mail filter blocks such senders.
- Languages: a new Translations box in the settings with an Install / Update button. The WordPress.org package has no translation files, and WordPress downloads a translation only for the site language, so choosing Persian or Turkish inside the plugin on an English site used to leave the screens in English. Saving a language whose translation is missing (or pressing the button) downloads the official translation from WordPress.org through the WordPress upgrader. Until a translation exists the screens now also read left to right, so English text is no longer laid out right to left.
- Languages: the list of interface languages is now one registry (name, English name, locale, direction, calendar) instead of two fixed languages. Adding a new language needs only a translation file and one entry (or the
bhtk_languagesfilter); text direction, dates and country names follow it. Addeddocs/ADDING-A-LANGUAGE.mdand a helper scriptbin/i18n.pyin the GitHub repository. - Deleting the plugin with “Delete all toolkit data” now also removes the QR Code Generator options and the short-lived caches.
- Readme: the long Description made the directory cut the page (WordPress.org adds every extra section to the Description and allows 2500 words). The Description is now short and the details of every module are the first questions of the FAQ.
- Small screen fixes: the second gradient color no longer triggers the “colors are too close” warning by default, the IP search box shows its whole hint, and long drop-down texts (calendar, address source, redirect type) are no longer cut off.
- Translations updated for every new text.
- Checked again with the automated tests, with the WordPress.org package build, and for PHP 7.4 syntax; no new warnings or notices.
1.0.0
First public release. Before this release the toolkit went through many rounds of testing and changes while it was used inside the agency, and everything that was built and tested in that time is part of 1.0.0:
- Link Shortener: short links on your own domain with random or custom case-sensitive codes, click counter, redirect type, optional path prefix, search, edit and delete. A short link never hides a real page.
- QR Code Generator: PNG and SVG download, colors, size and error correction, Persian text, drawn in the browser.
- Visitor Stats (off by default): overview with chart, sources (search engines, social networks, messengers, campaigns), countries, devices with brand and model, systems and browsers, visit log with filters, details and CSV download, website search words, logged-in members, Jalali or Gregorian dates, retention period, IP exclusion list, and blocking of IP addresses and IPv4 ranges (temporary or permanent, with protection against blocking yourself).
- Post Duplicator: duplicate posts, pages and custom content from the lists, the bulk actions menu, the admin bar and the editor, with a title pattern and copy options, and “Edit safely” – edit a live page through a hidden draft and publish it into the live page with one click (revision saved, conflict warning, address and comments kept). Elementor and block data are copied byte for byte.
- Page Shield (off by default): blocked right-click menu, developer shortcuts and image dragging, and hidden WordPress version details. Every option is off until you tick it, and none of them affects search engines; options that could lower the search ranking are deliberately not offered.
- Profile Pictures: upload a profile picture from the profile screen, no Gravatar needed. Pictures are checked and saved again as small squares.
- Contact tab: suggestions, criticism, problem reports, security reports and module requests for the IT team (it@banihonarpars.ir). Each card opens Gmail or your mail program with a ready text, and can copy the whole message; nothing is sent from your website.
- A language setting in the plugin settings, with a complete translation.
- Privacy: the online country lookup is off by default, suggested privacy policy text, support for WordPress “Export Personal Data” and “Erase Personal Data”, and anonymous statistics when a user is deleted.
- Security review: every action checks permission and nonce, database queries are prepared, all output is escaped, CSV files are protected against spreadsheet formulas, short links accept only http and https, uploaded pictures are re-saved. Two findings were fixed: blocking can no longer be avoided with a forged proxy header, and the visit counter has a per-minute ceiling against floods.
- Tested again and again: about 430 automated checks, which were repeated after every change, on a test stand-in for WordPress. Please test the plugin on your own site before using it in production.
- Migration: links and settings of the older “BHAC” plugin are copied automatically the first time the toolkit is activated.
Follow this listing's changes (Atom feed)