=== BaraTables ===
Contributors: nathannoom
Tags: tables, datatables, charts, csv, shortcode
Requires at least: 5.9
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Build searchable, sortable tables and charts from CSV, manual data, WordPress content, custom queries, or external databases.

== Description ==

BaraTables helps you create interactive tables and charts directly in WordPress. Build a table from WordPress posts, CSV uploads, manual data, or an external MySQL/MariaDB database, then embed it with a shortcode.

Tables can include search, sorting, pagination, filters, export buttons, column visibility controls, and custom layouts. Charts can be created from any BaraTables table and displayed separately with their own shortcode.

**Features:**

* Five data sources: WordPress queries, custom WP_Query JSON, CSV upload, manual entry, and external database connections
* Interactive tables powered by DataTables with sorting, searching, pagination, saved state, scroll controls, and configurable row loading limits
* Dropdown, multi-select, checkbox, and radio column filters with shareable URL state
* Export to CSV or Excel, copy to clipboard, and print
* Column reordering and visibility controls
* Charts powered by ECharts: bar, horizontal bar, line, area, pie, donut, scatter, bubble, funnel, and Gantt
* Row access controls using user metadata and source-specific access columns
* Fully customizable table layout with draggable controls and editable labels
* Responsive design
* Import supported table definitions from JSON

== Installation ==

1. Upload the `baratables` folder to `/wp-content/plugins/`.
2. Activate the plugin through the Plugins menu in WordPress.
3. Go to Tables in the admin menu and create your first table.
4. Use the shortcode `[bara_table id="your-table-slug"]` to embed it.

== Frequently Asked Questions ==

= What data sources are supported? =

WordPress post queries, custom WP_Query arguments supplied as JSON, CSV files from the media library, manual data entry, and external MySQL/MariaDB databases.

= How many rows can a table load? =

Each table loads up to 1,000 rows by default. The Options tab lets administrators choose a limit from 1 to 10,000 rows. The limit applies to tables and charts across every data source.

= Are there limits for manual tables and JSON imports? =

Manual grids support up to 100 columns, 1,000 rows, and 5,000 total editable cells. JSON imports are limited to 10 MB. These safeguards keep the WordPress admin and public pages responsive.

= How do I add a chart? =

Create a table first, then go to Charts and create a new chart linked to that table. Use `[bara_chart id="your-chart-slug"]` to embed it.

= Can I customize the table appearance? =

Yes. The Options tab provides controls for striping, hover effects, borders, compact mode, pagination style, button labels, search text, and info display. You can also arrange layout zones for full control over where controls appear.

= Where can I see examples? =

Visit https://ktisisweb.com/baratables/ for screenshots, feature notes, and styling guidance, or use the Live Preview button on the WordPress.org plugin page for a temporary interactive demo.

== Screenshots ==

1. Frontend chart generated from a BaraTables table.
2. Frontend table with search, filters, CSV and Excel export, column visibility, sorting, and pagination.
3. Table Options tab with saved state, scrolling, row limits, layout, styling, and export controls.
4. Chart builder and chart-type gallery with all supported chart types.

== Changelog ==

= 1.2.0 =
* Added Excel export as a table button option.
* Added horizontal bar, donut, scatter, bubble, and funnel chart types with matching gallery previews.
* Added controls for remembered table state, horizontal scrolling, vertical scroll height, and column auto-sizing.
* Added configurable row loading limits and explicit safeguards for large manual grids and imports.
* Updated ECharts and hardened external database query validation.
* Fixed remembered table state so the selected pagination page survives reloads.

= 1.1.1 =
* Improved table and chart shortcode handling when attributes are missing or malformed.
* Improved custom WP Query date filter handling.
* Fixed excerpt columns to use the WordPress excerpt.
* Improved reliability of tab links in the table and chart builders.
* Improved taxonomy term selection in the table builder on sites with large taxonomies.
* Removed silent row, file, import-size, and field-discovery caps from table data handling.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.2.0 =
Adds Excel export, more chart types, saved-state and scrolling controls, plus configurable safeguards for large datasets.

= 1.1.1 =
Improves shortcode reliability, custom query date filters, excerpt columns, builder tab links, taxonomy term selection, and table data source handling.

= 1.0.0 =
Initial release.

== Third-Party Libraries ==

This plugin bundles the following libraries and admin thumbnail assets:

* [DataTables](https://datatables.net/) v2.3.8 - MIT License
* DataTables Buttons v3.2.6 - MIT License
* DataTables ColReorder v2.1.2 - MIT License
* [Select2](https://select2.org/) v4.1.0-rc.0 - MIT License
* [JSZip](https://stuk.github.io/jszip/) v3.10.1 - MIT License
* [ECharts](https://echarts.apache.org/) v6.1.0 - Apache License 2.0

Source code and uncompressed distribution files for the bundled compressed assets are available here:

* DataTables v2.3.8 source: https://github.com/DataTables/DataTablesSrc/tree/2.3.8
* DataTables v2.3.8 distribution files: https://cdn.datatables.net/2.3.8/
* DataTables Buttons v3.2.6 source: https://github.com/DataTables/Buttons/tree/3.2.6
* DataTables Buttons v3.2.6 distribution files: https://cdn.datatables.net/buttons/3.2.6/
* DataTables ColReorder v2.1.2 source: https://github.com/DataTables/ColReorder/tree/2.1.2
* DataTables ColReorder v2.1.2 distribution files: https://cdn.datatables.net/colreorder/2.1.2/
* Select2 v4.1.0-rc.0 source: https://github.com/select2/select2/tree/4.1.0-rc.0
* Select2 v4.1.0-rc.0 uncompressed JavaScript: https://raw.githubusercontent.com/select2/select2/4.1.0-rc.0/dist/js/select2.js
* Select2 v4.1.0-rc.0 uncompressed CSS: https://raw.githubusercontent.com/select2/select2/4.1.0-rc.0/dist/css/select2.css
* JSZip v3.10.1 source: https://github.com/Stuk/jszip/tree/v3.10.1
* JSZip v3.10.1 uncompressed JavaScript: https://raw.githubusercontent.com/Stuk/jszip/v3.10.1/dist/jszip.js
* ECharts v6.1.0 source: https://github.com/apache/echarts/tree/6.1.0
* ECharts v6.1.0 uncompressed JavaScript: https://raw.githubusercontent.com/apache/echarts/6.1.0/dist/echarts.js
* Apache ECharts example thumbnail source files: https://echarts.apache.org/examples/data/thumb/
* Apache ECharts examples source: https://github.com/apache/echarts-examples

Additional third-party license and notice text is included in assets/vendor/THIRD-PARTY-LICENSES.txt.
