KantanPro

By kantanpro

0+ active installationsVersion 1.3.61

Manage orders, clients, services and invoicing inside WordPress. A business management workspace for small businesses.

Description

KantanPro turns a WordPress page into a workspace where you can manage orders, clients,
services and subcontractors in one place. Add the shortcode [ktpwp_all_tab] to any page,
and logged-in users with editing permission will see the management screen there.

Everything is stored in your own database. The plugin does not require an account,
a subscription, or a connection to any service in order to work.

Main features

  • Work list — list, search and filter orders by progress
  • Documents — create and edit quotations and invoices, and export them as PDF (single or batch)
  • Client management — clients, departments and contacts, with envelope address printing
  • Service management — your products and services with price, quantity and unit
  • Subcontractor management — partner companies and their skills, plus purchase-order email
  • Recurring contracts — recurring billing cycles, initial fees and billing history
  • Staff chat — internal discussion per order (send with Ctrl+Enter)
  • File attachments — drag and drop, multiple files, automatic cleanup
  • Backup — export and import your data as JSON or CSV
  • Consumption tax — reduced tax rates and tax categories, with a per-rate breakdown for qualified invoices
  • Mobile ready — tested for touch operation on iOS and Android devices

Progress tracking

Each order moves through seven stages: Rejected, Estimating, Ordered, In progress,
Completed, Invoiced and Paid. Changing the stage sets the completion date automatically,
and orders approaching their delivery date are highlighted.

PDF and printing

Quotations and invoices can be saved and printed as PDF. On desktop browsers the normal
print dialog is used; on iPad and iPhone the document is produced as a PDF file instead,
because the print dialog does not render reliably there. Invoices can also be exported
in batch, grouped by client.

A separate plugin with more features

The same author also publishes KantanProEX (WP), a separate paid plugin.
This plugin is fully functional on its own: nothing in it is locked, limited or
switched off until you buy or install anything else.
KantanProEX adds:

  • Sales reports — revenue and profit over time, broken down by client and by service
  • Publishing your services on the site and receiving applications as orders
  • Card payments through Stripe
  • Use by several staff members on the same data

Details: https://www.kantanpro.com/product/kantanpro-ex

Third-party libraries

The following MIT-licensed libraries are bundled unmodified in js/lib/
(the download sources are listed in js/lib/SOURCES.txt). They are never loaded from a CDN.

  • html2canvas 1.4.1 — https://github.com/niklasvh/html2canvas
  • jsPDF 2.5.1 — https://github.com/parallax/jsPDF

Printing and PDF output

Order documents, purchase orders, invoices and address labels are produced in the browser
rather than on the server, so that what you see on screen is what you get on paper.

  • On a desktop browser the document is rendered into a hidden iframe and handed to the
    browser’s own print dialog.
  • On iPad and iPhone, and on narrow screens generally, the document is rendered to a PDF
    using the bundled html2canvas and jsPDF libraries and offered as a download. The print
    dialog does not give a usable result on those devices.

Each printed document is a self-contained HTML page that the browser opens on its own, with
its own @page rules and page-break handling. Its styles, and the few lines of script that
trigger the print dialog and close the window afterwards, have to travel inside that
document. wp_enqueue_style() and wp_enqueue_script() only affect the page currently
being viewed, so they cannot be used for it.

This is why some of the plugin’s inline <style> and <script> blocks cannot be removed:
they belong to the print and PDF documents and to e-mail templates, which the guidelines
list as an accepted exception.

Everywhere else the plugin’s stylesheets and scripts are registered and enqueued in the
normal way, and snippets that have to be generated in PHP are attached with
wp_add_inline_script() and wp_add_inline_style(). The plugin’s own admin and
front-end screens emit no inline <script> or <style> blocks.

External services

This plugin can connect to the following external services. Each one is used only when
you actively use the corresponding feature. Nothing is sent while a visitor simply
browses your site.

1. Japan Post Digital Address API (optional, disabled by default)

Used to fill in an address automatically from a postal code on the client and
subcontractor forms. It runs only if you enable it in the plugin’s general settings and
enter the API credentials issued to you by Japan Post. The request is made from your
server (the visitor’s browser never contacts the service directly). When it is disabled —
the default — no address lookup happens and no external service is contacted.

  • Sends to: https://api.da.pf.japanpost.jp (or https://stub-qz73x.da.pf.japanpost.jp if you
    select Japan Post’s test environment)
  • Data sent: the postal code or digital address being looked up, your API credentials (client ID
    and secret), and the IP address of the logged-in user who runs the lookup. Japan Post’s API
    requires the end user’s IP address on every token and search request, so the plugin sends it
    in the X-Forwarded-For header. Site visitors’ data is never sent.
  • When: only at the moment a logged-in user enters a postal code on the client or subcontractor
    form while the feature is enabled. Enabling the feature is the site owner’s consent to this
    transfer; the settings screen shows the same explanation next to the checkbox.
  • Terms of use: https://guide-api.da.pf.japanpost.jp/
  • Privacy policy: https://www.post.japanpost.jp/privacy/

2. OpenAI API (optional, disabled by default)

Used by the data import feature to map the columns of an uploaded file to the plugin’s
fields. It only sends anything if you have entered your own OpenAI API key.

  • Sends to: https://api.openai.com/v1/chat/completions
  • Data sent: the column headings and up to three sample rows of the file you are importing
  • Terms of use: https://openai.com/policies/terms-of-use
  • Privacy policy: https://openai.com/policies/privacy-policy

Installation

  1. Install and activate the plugin. The database tables are created automatically.
  2. Create a page and insert the shortcode [ktpwp_all_tab] into its content.
  3. Open the “KantanPro” menu in the admin area and fill in your company details,
    consumption tax settings and email settings.
  4. Open the page you created. The management screen is displayed there.

FAQ

Who can use the management screen?

The page containing [ktpwp_all_tab] is only rendered for users who are logged in and
have editing permission. Visitors who are not logged in see a login prompt instead of
your business data.

The layout looks broken on mobile

The screens are responsive, but your theme’s CSS can conflict with them. Please check
with a current browser first. If the problem remains, ask on the support forum and
include your theme name.

I get a database error

Database migrations run automatically when the plugin is updated. If an error persists,
deactivate the plugin and activate it again so the migration can run from a clean state.

Does the plugin send my data anywhere?

No, not by default. Your business data stays in your WordPress database. Two optional
features can contact an external service, and each of them is described under
“External services” below. None of them is required to use the plugin.

Screenshots

Changelog

1.3.61 – 2026-11-25

  • Privacy: the Japan Post address lookup settings and this readme now state that the IP address of the user running the lookup is sent to Japan Post (their API requires it).
  • Security: creating an order from the client screen now verifies a dedicated nonce, and the AJAX handlers verify a single nonce action.
  • Security: the shortcode output no longer allows inline event attributes (onclick and the like); the screens attach their behaviour from an enqueued script instead.
  • Fixed: activation no longer redefines the client and order tables with a second, conflicting schema that could shorten columns such as the client category.

1.3.60 – 2026-11-23

  • Security: the business screens now require the Editor role or the KantanPro staff capability (ktpwp_access); Contributors and Authors no longer get access through edit_posts. Existing Contributors and Authors are granted ktpwp_access once on update so nobody is locked out.
  • Security: the SMTP password, Stripe keys, Japan Post API secret and GitHub token are stored encrypted (AES-256-GCM with a key derived from the site salts) and are no longer printed back into the settings screens; leaving a field empty keeps the saved value. Secrets are excluded from settings exports and backups. If you change AUTH_SALT, enter them again.
  • Security: logins are locked for 15 minutes after 5 failed attempts from the same username and address.
  • Security: error responses no longer include internal details such as database errors, and logs no longer contain customer or order data. Developer settings are shown only when WP_ENVIRONMENT_TYPE is local or development.
  • Security: backup CSV cells that spreadsheet software could run as formulas are neutralized and restored on import. HTML escaping in the order screens was unified.
  • Security: dismissing the front-end update notice now requires the staff capability.

1.3.59 – 2026-11-22

  • Security: the admin IP restriction now uses forwarding headers (X-Forwarded-For, CF-Connecting-IP, X-Real-IP) only when the connection comes from a trusted proxy (Cloudflare, a private or loopback address, or addresses listed in the KTPWP_TRUSTED_PROXIES constant or the ktpwp_trusted_proxies filter). Previously a spoofed header could bypass the IP restriction and Basic authentication.

1.3.58 – 2026-11-22

  • Security: the dummy data script and a one-off migration script no longer run when their URL is opened directly; they only run when the plugin loads them from the admin screen.
  • Security: deleting an order now verifies the nonce and the user’s capability again; the old project-name update path without these checks was removed (the screen uses the AJAX handler).
  • Security: files attached to orders are protected from direct web access (.htaccess and index.php in the storage folder) and stored under random names; downloads send X-Content-Type-Options: nosniff.

1.3.57 – 2026-11-20

  • Changed: the plugin no longer fetches or shows any banner in this edition, and no longer opens its own output buffer on the front end.
  • Changed: admin menu page slugs now use the ktpwp- prefix; old links are redirected.
  • Security: query arguments are sanitized when read; the e-mail attachment folder now denies all direct web access and uses random file names.
  • Fixed: REST requests using plain permalinks are no longer blocked for visitors.
  • Fixed: the readme now lists the optional external services accurately.

1.3.56 – 2026-11-15

  • Changed: the staff chat repair query uses $wpdb->prepare() with %i table placeholders.

1.3.55 – 2026-11-14

  • Fixed: Output buffers opened inside AJAX handlers and render functions are now always closed in the same function, including early error responses.
  • Changed: the plugin no longer uses PHP sessions. Screen state (search messages, the last opened order, view counting) is kept per user in user meta.
  • Changed: file operations use WordPress functions (wp_delete_file, WP_Filesystem), dates use gmdate(), and text uses wp_strip_all_tags().
  • Fixed: “Undefined variable $last_id_row” warning on the client and service screens.
  • Fixed: a JavaScript syntax error on the client tab when no client was selected.
  • Fixed: on English sites, short words were replaced inside longer Japanese sentences, producing mixed text. Labels are now translated only when the whole label matches, and form values (user data) are never changed.

1.3.54 – 2026-11-13

  • Fixed: when printing a client invoice with “Mark as invoiced” checked, orders whose prepay/postpay setting was empty stayed “Completed” instead of becoming “Invoiced”.

1.3.51 – 2026-10-12

  • Fixed: when updating from 1.3.48 or earlier, settings (design colors, general settings) could stay at the
    1.3.49 defaults if another page view wrote to a secondary table (such as the staff chat) during the data
    migration. Only the client, order, service and supplier tables now decide whether the site was already in use.
    Settings that 1.3.50 left incomplete are filled from the old values (existing values are kept).

1.3.50 – 2026-10-12

  • Fixed: sites updated from 1.3.48 or earlier showed empty data after updating to 1.3.49, because the
    database tables and options were renamed from ktp_ to ktpwp_ without carrying the data over.
    The old wp_ktp_* tables are now renamed to wp_ktpwp_* and the ktp_* options are copied to ktpwp_*.
    If both the old and the new table contain data, nothing is overwritten and an admin notice lists the tables.
  • Fixed: the automatic database migration could be retried on every page load, writing a large
    amount of database errors to the PHP error log (on nginx + PHP-FPM this caused 502 Bad Gateway).
    Migration files that run when loaded are now recorded as done, database errors are not written to
    the log during migration, and after a failure the next retry waits one hour.

1.3.49 – 2026-10-12

  • Responded to the WordPress.org plugin review of 1.3.48.
  • Prefix: every function, class, option, database table, AJAX action, nonce, script handle and
    JavaScript global now uses the ktpwp_ / KTPWP_ / ktpwp- prefix (the 3-letter ktp_ prefix is gone).
  • No inline
  • Every request handler verifies a nonce before reading input, including list-screen forms,
    the order progress form, cost-item saving, the bulk “mark as invoiced” action and the SMTP
    test e-mail. Navigation-only query arguments (sorting, paging, search terms, record IDs) are
    read through one sanitizing accessor (KTPWP_Request).
  • All $_POST / $_FILES input is unslashed and sanitized at the point of reading; uploaded file
    entries are sanitized field by field.
  • Output and exception messages are escaped; the shortcode output is built as a string and
    filtered through wp_kses with an allow-list.
  • SQL: table and column identifiers use the %i placeholder ($wpdb->prepare); ORDER BY direction
    uses fixed SQL strings. Requires WordPress 6.2+.
  • Migration files no longer leak global variables, and unused legacy migrations were removed.

1.3.48 – 2026-10-09

  • Responded to the WordPress.org plugin review of 1.3.46:
  • Removed the browser-side call to the zipcloud postal API. Postal-code→address lookup now
    runs only through the Japan Post official API, server-side, and only when the site owner
    has explicitly enabled it and entered their own credentials (off by default). No external
    service is contacted without opt-in.
  • Stopped changing PHP’s error-reporting and error-display settings from the plugin. AJAX responses are
    kept clean with output buffering instead, so the plugin no longer changes site-wide PHP
    error settings.
  • Removed a leftover remote cdnjs URL embedded in the bundled jsPDF library; all assets are
    served locally.
  • Hardened the FileMaker-import (OpenAI) feature’s documentation: it is opt-in, uses your
    own API key, and the external services it contacts are listed in the readme.
  • Additional sanitizing of request values written to the debug log, backtick-quoted and
    allowlisted ORDER BY / identifier SQL, and late-escaping of the subcontractor address-label
    button output.

1.3.47 – 2026-10-09

  • Security: the order / purchase-order e-mail attachment handler accepted a file when
    only the client-supplied MIME type matched the allow-list, so a .php file sent with a
    forged Content-Type could be stored and executed. The file extension is now checked
    against the allow-list unconditionally, and the attachment temp directory is hardened
    with an .htaccess that disables script execution and directory listing. The issue
    required an edit-capable account, but a fix is strongly recommended.

1.3.46 – 2026-09-20

  • The plugin’s own screens no longer output inline
  • The only inline blocks left are inside the self-contained documents the plugin builds
    for printing, PDF output and e-mail, which cannot be reached by the enqueue functions.

1.3.45 – 2026-09-20

  • Debug logging now goes through a single function that only writes when WP_DEBUG is
    on. There were over 900 direct error_log() calls, 244 of which were not guarded at
    all and therefore wrote to the log on production sites.
  • Removed the dummy data tool from this package. The tool’s script is not shipped, so
    the admin screen reported “script not found” while still offering buttons that could
    not work.
  • Failed security checks no longer record any part of the submitted nonce value.
  • Documented, in the new “Printing and PDF output” section, why the print, PDF and e-mail
    documents carry their styles and scripts inline.

1.3.44 – 2026-09-20

  • Removed the “Domain Path” header. This package does not ship a languages folder,
    so the header pointed at a directory that does not exist.
  • Removed a leftover comment and a filter relating to plugin auto-updates. The filter
    forced the auto-update UI on for every plugin on the site, which is not this
    plugin’s business, and the comment was enough to trip the plugin updater check.
  • $_SERVER[‘REQUEST_METHOD’] is now read through a single sanitizing helper instead of
    being used directly in 19 places.

1.3.43 – 2026-09-20

  • Stopped forcing a PHP session on every request. The terms-of-service singleton is
    created on every page load and its constructor started a session unconditionally,
    which prevented full-page caching for anonymous visitors. Sessions are now started
    only for logged-in users who can use the business screens, and only where a session
    is actually needed.
  • Removed the wp_ajax_init registration. The action suffix was the generic name
    “init” and the handler it pointed at was unreachable dead code.
  • Nonce checks are no longer substituted by capability checks. Four AJAX handlers
    (staff chat send/delete, supplier tax category, supplier qualified invoice number)
    accepted a request with a missing or invalid nonce as long as the user held an
    editing capability. A valid nonce and a capability check are now both required.
  • ktp_save_delivery_date ran DESCRIBE and ALTER TABLE on the order table before
    verifying the nonce and the user capability. The security checks now run first,
    before any database access.
  • Added the missing nonce checks to the profit display and logged-in users endpoints.
  • Untrusted input is no longer written to the error log. Failed security checks logged
    the raw $_POST array and the received nonce value; they now log only the sanitized
    field names.
  • Sanitization: the supplier and skills nonces are sanitized before wp_verify_nonce(),
    the Authorization header is validated against an allow-list instead of being used
    raw, $_SERVER['REQUEST_METHOD'] and HTTP_X_REQUESTED_WITH are sanitized, and
    $_POST values are unslashed before sanitizing.
  • The supplier update path now checks the user capability in addition to the nonce.
  • Removed unused session helper functions that read and wrote $_SESSION directly.

1.3.42 – 2026-09-19

  • Prefixed the remaining generically named globals and stored keys: the user meta
    last_activity is now ktpwp_last_activity, and two file-scope variables in the
    main plugin file are now prefixed.
  • Removed an unused redirect class that was never instantiated. It read a generic
    external_url post meta key and contained a hard-coded redirect target on the
    author’s own site.

1.3.41 – 2026-09-19

  • Removed the sales-ledger PDF feature and the sales report data endpoints from the
    package. They were still bundled (only the report tab had been removed), which
    left a feature that looked implemented but unavailable. The plugin no longer
    contains any code that is locked, limited or switched off in this edition; the
    list of disabled features is now empty.
  • Removed the edition/staff-limit settings screen and the remaining staff-limit
    logic. There is no limit on staff in this edition.
  • Fixed the backup restore so that it can only write this plugin’s own options
    (ktp_* / ktpwp_*). Previously the options section of an uploaded backup
    file could set any WordPress option. The uploaded file is now validated
    before any existing data is removed, so a broken or empty file no longer wipes
    the plugin’s tables and then fails.
  • Added the missing nonce check on sending an order e-mail, and a nonce and
    capability check on the supplier-cost AJAX requests. Removed two unused AJAX
    actions that wrote data without any nonce check.
  • Required a logged-in user who can edit posts before a list view increments the
    “frequency” counter of a record, and added a capability check to the service
    list, matching the client list.
  • The business screens rendered by the shortcodes are now passed through an
    explicit allow-list of HTML tags and attributes (KTPWP_Kses) instead of being
    returned unescaped. Inline scripts that do not belong in the page body are now
    added through wp_add_inline_script().
  • Header background image URLs are now sanitized as URLs (esc_url_raw).
  • register_setting() calls now pass sanitize_callback in the arguments array.
  • Fixed set_time_limit() being restored with an undefined value (which meant
    “no limit”) when the dummy-data tool failed before saving the original limit.
  • Stopped writing raw $_POST / $_GET / $_SERVER values and nonces to the
    debug log, and removed an unescaped $_SESSION output that nothing wrote to.
  • Fixed the confirmation dialog of the client “delete” button, which never
    appeared because its onclick attribute was malformed, and the “close” button
    of the multiple-search-results popup, which navigated to a broken URL.
  • Fixed the “Information” tab being ignored when selected through the shortcode
    renderer, and a notice caused by an undefined variable there.

1.3.40 – 2026-09-14

  • Fixed plugin activation not creating the required database tables on some
    hosting environments (including WordPress Playground). The environment
    check that ran before table creation required the mysqli PHP extension,
    which some environments do not have, and misread an unlimited
    memory_limit as insufficient. Table creation no longer depends on that
    check, and activation now fails loudly with a clear message instead of
    silently completing with tables missing.
  • Removed the public product listing and inquiry feature entirely, along
    with its CSS, JavaScript and the “sell publicly” fields on the service
    form. It shipped in the package while hidden behind a flag in the free
    edition; it is now not present in the code at all.
  • Fixed a permission check on the shortcode entry point that only verified
    the visitor was logged in, not that they had permission to view business
    data. A logged-in Subscriber could previously see the client, order and
    supplier lists.
  • Fixed several WordPress database error warnings that were logged on
    every relevant page load when a legacy settings table from very old
    versions of the plugin was absent, including one on the very first
    front-end view after activation if the admin dashboard was never opened.
  • Additional hardening: input sanitization on several $_SERVER/$_POST
    reads, nonce handling, translator-facing strings, and removed a handful
    of unused constants and a dead admin-menu registration.

1.3.39 – 2026-09-07

  • Removed the automatic rewriting of the site’s root .htaccess file. The plugin no
    longer appends WebP delivery rules to a file it does not own.
  • Removed the creation of a wp-content/logs directory and the .htaccess/index.php
    files placed in it. The debug log location is left entirely to the WP_DEBUG_LOG
    constant in wp-config.php.

1.3.38 – 2026-09-05

  • Fixed the plugin stylesheet shrinking profile pictures that belong to the theme.
    The rule targeted WordPress’s shared avatar class without any scoping, so author
    boxes, comment avatars and anything else using that class were forced to 32px.
    The rule is now limited to the plugin’s own icons.

1.3.37 – 2026-09-04

  • Fixed the notice suppression for the “translation loading was triggered too early”
    warning raised by other plugins (WooCommerce and friends). It matched on the English
    wording, so on Japanese sites the notice was still printed into the page. It now
    identifies the text domain instead, and never suppresses this plugin’s own domain.

1.3.36 – 2026-09-03

  • Rolls the 1.3.32 through 1.3.35 fixes up into a release for the self-hosted
    (GitHub) distribution. No code changes in this version itself.
  • Removed three build-script backup files that were being packaged into the
    distribution, and excluded that file pattern from future builds.

1.3.35 – 2026-09-03

  • Added a direct-access guard to the three class files that were missing one.

1.3.34 – 2026-09-03

  • Removed unreachable PDF generation code from the order preview script, along with
    the library loader and vendor URLs it was the only consumer of.

1.3.33 – 2026-09-03

  • Removed leftover script and style assets that belonged to the self-hosted update
    checker and the license manager, which are not part of the WordPress.org build.
  • Updated the bundled jsPDF library from 2.5.1 to 4.2.1.

1.3.32 – 2026-09-03

  • All generated script and style output now goes through wp_add_inline_script(),
    wp_add_inline_style() and wp_localize_script().
  • Removed hook registrations that pointed at functions which were never defined.
  • Removed the unprefixed global functions get_logged_in_users(),
    check_activation_key() and add_htmx_to_head(), and an unused admin form file.

1.3.31 – 2026-09-03

  • Removed the report tab and replaced it with an “Information” tab showing the plugin version,
    environment and record counts. Reports are provided by a separate plugin.
  • Removed the custom CSS field. Use the WordPress customizer’s Additional CSS instead.
  • Fixed a cross-site scripting hole where the active_tab cookie was written into an HTML
    attribute without sanitizing.
  • Fixed the data-clear handler leaking buffered output into its JSON response.
  • Hardened input handling across the plugin: nonces, $_SERVER values, pagination arguments
    and search terms are now sanitized before use.
  • Uploads now go through wp_handle_upload() instead of move_uploaded_file().
  • AJAX actions are now prefixed with ktp_ to avoid collisions with other plugins.
  • Scripts and styles that were printed inline are now registered through the WordPress
    enqueue system.
  • The postal code lookup on the subcontractor form moved to its own JavaScript file.

1.3.30 – 2026-08-30

  • Fixed a missing permission check in the internal handlers that return billing candidates
    and order data. Any logged-in user could read that data regardless of their role;
    editing permission is now required.

1.3.29 – 2026-08-30

  • Bundled the PDF and chart libraries (html2canvas, jsPDF, Chart.js) with the plugin so
    that PDF export works where an external CDN is unavailable.
  • Switched to the jQuery shipped with WordPress instead of loading it from a CDN.
  • Renamed the text domain from ktpwp to kantanpro for the WordPress.org translation system.
  • Fixed missing output escaping, including messages shown through wp_die().
  • Raised the minimum WordPress version from 5.0 to 5.9 (wp_date() and str_contains() are used).
  • Fixed places where the free edition described itself as “KantanProEX”.

1.3.28 – 2026-08-17

  • Envelope address printing now prints without margins, so the offsets shown in the preview
    match the printed position exactly and no longer depend on the print dialog’s margin setting.
  • Added a “reset address position” button, returning to the default position for a
    Japanese Nagagata-3 window envelope (16 mm from the top, 33 mm from the left).
  • The preview now shows the sheet on a grey background with a drop shadow, so the paper
    edges are easy to see while positioning.

1.3.27 – 2026-08-17

  • The address block in the print preview can now be dragged to adjust its position, which
    makes it easier to line up with a window envelope. The distance from the top and left
    edges is shown in millimetres while dragging, and the position is saved on release
    (adjusting and saving is limited to administrators).

1.3.25 – 2026-08-07

  • Fixed invoice lines in order emails showing “service name: 0 × 0 = 0” when only the
    service name was filled in. Such lines now show the name alone, without the calculation.

1.3.24 – 2026-08-03

  • Fixed banner CSS and JS being stripped on sites using plugins that combine inline CSS/JS
    (such as WP-Optimize), which made the banner render as two stacked rows. The assets are
    now registered through wp_add_inline_style() and wp_add_inline_script().