=== Charts QR-Barcodes ===
Tags: post-timeline, line chart, pie chart, chart, graph, polar chart, doughnut chart, bar graph, horizontal bar graph, absolute, percent, QRCode, IPFlag, webcounter, useragent, Bulawappen
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Version: 11.2.127
Stable tag: 11.2.127
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.2

== Description ==
Webcounter, shortcodes for QRCodes, IP2Flag, bar, line and Pie, Donut Pie, Polar Pie, Radar, Horizontal Bar, monthly post archive as bar chart, use as html widget too

[carlogo] displays maufacturer logo for car brands
[complogo] displays maufactorer logo for computer brands
[qrcode] creates qrcodes, [ipflag] shows country name of visitor (IP shortened for GDPR) - visitor info browser and details optional
[webcounter] shortcode to gather and admin-display stats about visitors (ip shortened for GRPR compliance)

Color palette for charts can be accentcolor with shares or random (colorful light colors) or given values

== Installation ==
= Uploading in WordPress Dashboard =
* Navigate to the 'Add New' in the plugins dashboard
* Navigate to the 'Upload' area
* Select chartscodes.zip from your computer
* Click 'Install Now'
* Activate the plugin in the Plugin dashboard


== Shortcodes ==
	Zeile  129: add_shortcode('gd_chart', [$this, 'shortcode']);
	Zeile 1122: add_shortcode( 'qrcode', function ( $atts, $content = null ) {
	Zeile 1201: add_shortcode('ipflag', function ($atts = [], $content = null) {
	Zeile 1206: add_shortcode('webcounter', function ($atts = [], $content = null) {
	Zeile 1288: add_shortcode('bulawappen', 'bulawappen_shortcode');
	Zeile 1292: add_shortcode('kfzkennzeichen', function($atts) {
	Zeile 1353: add_shortcode('complogo', 'complogo_shortcode');
	Zeile 1397: add_shortcode('carlogo', 'carlogo_shortcode');
in ipflag-webcounter:
	Zeile   32: add_shortcode('ipflag', array($this, 'shortcode'));
	Zeile   33: add_shortcode( 'webcounter', array($this, 'writevisitortodatabase') );



=== WP GD Charts (Pure PHP) ===================================================================================

Render Line, Pie, Horizontal/Vertical Bar, and Polar (Radar) charts using only PHP + GD. No JS, no external libs. Supports multi-series, grouped, stacked, and 100% stacked bars. Responsive <img> via srcset.

**Features**
- Chart types: line, pie, vertical bar (vbar), horizontal bar (hbar), polar (radar)
- Single & multi-series
- Grouped bars, stacked bars, and 100% stacked bars (normalize)
- Legends and simple axes/grid
- Responsive `<img>` with `srcset` (optional HiDPI via `dpi`)
- Caching to uploads (`/wp-content/uploads/gd-charts/`)

**Security/Privacy**
- No external requests; server-side PNG generation only
- Respects WordPress sanitization for query params
- Compatible with restrictive CSP settings

== Usage ==

Line chart:
```
[gd_chart type="line" title="Visits" data="Jan:120|Feb:180|Mar:150"]
```

vertical bar:
```
[gd_chart type="vbar" title="Visits" data="Jan:120|Feb:180|Mar:150"]
```

horizontal bar:
```
[gd_chart type="hbar" title="Visits" data="Jan:120|Feb:180|Mar:150"]
```

Polar (radar):
```
[gd_chart type="polar" title="Skills" data="Jan:120|Feb:180|Mar:150" table=1 table_pos=only]
```

Pie:
```
[gd_chart type="pie" title="Browsers" data="Chrome:62|Safari:20|Firefox:10|Edge:8"]
```

Table:
add : table=1 parameter and table_pos=only   oder table_pos=above (zusätzlich). Wenn nur table=1 wird sie unter dem Bild gezeigt.

== Shortcode Attributes ==
- `type` (string): `line|pie|vbar|hbar|polar` (default `line`)
- `data` (string): `Label:Value|Label2:Value2`  
- `title` (string): Chart title (optional)
- `legend` (`true|false`): show legend (default `true`)
- `width` (int): render width in px (default `640`)
- `height` (int): render height in px (default `360`)
- `bg`, `fg`, `grid` (hex): colors like `#ffffff`
- `colors` (csv hex): series colors, e.g. `#1e88e5,#e53935,#43a047`
- `max` (float): axis max (ignored for pie/polar; for 100% stacked also ignored)
- `dpi` (1..3): render scaling for HiDPI (server-side); combine with responsive display
- `responsive` (`true|false`): outputs `<img>` without width/height and with `srcset` (default `true`)
- `class`, `style`, `alt`: passed to `<img>`

== Notes & Tips ==
- **Responsiveness:** Add CSS `.gd-chart{max-width:100%;height:auto;}` (the plugin adds inline styles when `responsive="true"`).
- **HiDPI:** Use `dpi="2"`; the shortcode builds a `2x` srcset for sharper images on retina displays.
- **Caching:** Images are cached for 7 days. Changing any shortcode parameter invalidates the cache.
- **Pie with multi-series:** Uses only the first series for convenience.
- **Locales:** Decimal commas in input are supported (e.g., `1,5`).

== Troubleshooting ==
- Blank image: Ensure PHP GD is installed/enabled.
- 404 on image: Check that `admin-post.php` is accessible and pretty permalinks don’t block query args.
- Wrong colors: Verify `#RRGGBB` values.
- Cut-off labels: Increase `height` or reduce category count.


	
==================================  QRCodes Shortcode Usage ==========================================================

Shortcode for creating qrcode and barcode images locally hosted. no external sources used, just php:

[qrcode type="code-39" text="Hallo Welt" ]
[qrcode type="ean-13" text="9780201379624" ]
[qrcode text="tel:+49304030568956834058340" ]
[qrcode text="Meine Oma ist heute da" size=3 ]

Barcode QRCode library taken from: https://github.com/kreativekorp/barcode
In order to output barcodes, [qrcode] will be used. Attributes:

format ... One of:
    png
    gif
    jpeg
    svg

 text ... A text that should be in the image qrcode. 
 size ... Size of the qrcode (2 for x2)
 margin ... margin in pixel 
 type  ... one of:
    upc-a          code-39         qr     dmtx
    upc-e          code-39-ascii   qr-l   dmtx-s
    ean-8          code-93         qr-m   dmtx-r
    ean-13         code-93-ascii   qr-q   gs1-dmtx
    ean-13-pad     code-128        qr-h   gs1-dmtx-s
    ean-13-nopad   codabar                gs1-dmtx-r
    ean-128        itf

``` Additional options to be set in code 
w - Width of image. Overrides sf or sx.
h - Height of image. Overrides sf or sy.
sf - Scale factor. Default is 1 for linear barcodes or 4 for matrix barcodes.
sx - Horizontal scale factor. Overrides sf.
sy - Vertical scale factor. Overrides sf.
p - Padding. Default is 10 for linear barcodes or 0 for matrix barcodes.
pv - Top and bottom padding. Default is value of p.
ph - Left and right padding. Default is value of p.
pt - Top padding. Default is value of pv.
pl - Left padding. Default is value of ph.
pr - Right padding. Default is value of ph.
pb - Bottom padding. Default is value of pv.
bc - Background color in #RRGGBB format.
cs - Color of spaces in #RRGGBB format.
cm - Color of modules in #RRGGBB format.
tc - Text color in #RRGGBB format. Applies to linear barcodes only.
tf - Text font for SVG output. Default is monospace. Applies to linear barcodes only.
ts - Text size. For SVG output, this is in points and the default is 10. For PNG, GIF, or JPEG output, this is the GD library built-in font number from 1 to 5 and the default is 1. Applies to linear barcodes only.
th - Distance from text baseline to bottom of modules. Default is 10. Applies to linear barcodes only.
ms - Module shape. One of: s for square, r for round, or x for X-shaped. Default is s. Applies to matrix barcodes only.
md - Module density. A number between 0 and 1. Default is 1. Applies to matrix barcodes only.
wq - Width of quiet area units. Default is 1. Use 0 to suppress quiet area.
wm - Width of narrow modules and spaces. Default is 1.
ww - Width of wide modules and spaces. Applies to Code 39, Codabar, and ITF only. Default is 3.
wn - Width of narrow space between characters. Applies to Code 39 and Codabar only. Default is 1.
```


===================================== IPFlag  Usage =================================================================

Resolves IP address to ISO 3166-1 alpha-2 two-letter country code and name and displays country flag image if required.
IPFlag resolves IP address to [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) two-letter country code and name using [ip-countryside](http://code.google.com/p/ip-countryside/) generated database and displays country flag if required. In contrast to other IP to country solutions this one allows you to create and update database your self using 5 Regional Internet Registrars (RIR) databases: AFRINIC, APNIC, ARIN, LACNIC and RIPE and ip-countryside open source application that does the work of generating database for you. You can also update IP to country database automatically with single click or schedule weekly automatic updates.
Gets the ip mapping for ipv4 and ipv6 from db-ip.com (lite free version) that is updated once a month.


IPFlag feature highlights
*   IPFlag database can be updated using single click without updating IPFlag plugin.
*   IPFlag database can be auto updated weekly without updating IPFlag plugin.
*   Because of the way IPFlag database is created it has probably the most accurate IP to country database you can find.
*   Database updates are generated using open source [ip-countryside](http://code.google.com/p/ip-countryside/) application.
*   IPFlag provides PHP function to retrieve country code and country name for given IP address (see FAQ for more)
*   IPFlag provides PHP function to retrieve country flag image for given country, 248 flag images provided by [Mark James](http://www.famfamfam.com)

== IPFlag Shortcode ==
	`[ipflag ip="123.20.30.0" iso="mx" details=1 browser=1]`
			'ip' => null,  // provide an ip like 10.20.30.40
			'iso' => null, // provide ISO code to get country flag
			'name' => null,  // provide country name in english please, you will result a flag in german
			'showland' => 0,   // show country name
			'showgeo' => 1,   // show geocoordinates
			'details' => 0,   // get more details like ip net and referrer about the viewer who called this page
			'browser' => 0,  // show user agent string and browser info

liefert eine Flagge und das Land zu einer IP odr einem IP-Netz. Die letzte IP-Ziffer wird wegen DSGVO anonymisiert<br>
iso="xx" liefert die Flagge zum ISO-Land oder die EU-Flagge für private und unbekannte Netzwerke<br>
showland=1 zeigt ISO und Land hinter der Flagge an
browser=1 liefert Betriebssystem und Browser des Besuchers, details=1 liefert den Referrer, das IP-Netz<br><br>

== Webcounter Shortcode ==

	`[webcounter admin=0]`

zählt Seitenzugriffe und füllt Statistikdatenbank, admin=1 zum Auswerten mit Adminrechten
Ist die Admin /webcounter-Seite aufgerufen, kann über das Eingabefeld oder den optionalen URL-Parameter ?items=x die Ausgabe-Anzahl einiger Listeneinträge verändert werden.

== Frequently Asked Questions ==
= How do I test is IPFlag installed properly? =
You can place `[ipflag]` shortcode to add current IP address country name and flag image to your page or post. To display country name and flag image of IP address other than current you can use this shortcode like  `[ipflag ip="some_ip_address"]`. For more details to display there are shortcode parameters: details=1 and browser=1, both defaulting to 0

= Can you provide example for fetching country info and flag for imaginary `123.123.123.123` IP address from country Croatia? =
You can use something like this:

```
// Query database with following IP address
$ip_address = '123.123.123.123';

$country = pb_chartscodes_ip_country($ip_address);
if ($country) {
    $code = $country['code'];
    $name = $country['name'];
    $flag = pb_chartscodes_flag_html($code);
}
```


=========================================== Bulawappen Shortcode ===============================================
Use Shortcode: [bulawappen land="Nordrhein-Westfalen" oder land="nw"]

	      'scale' => '',     		// sm = 32px  xs=21px
	      'land' => 'Nordrhein-Westfalen',  // Bundesland oder 2 Buchstaben-Kürzel
 
liefert das Wappen vom Bundesland in 30x50px, Eingabe xx Landeskürzel oder Länderbezeichnung mit ue statt ü


=========================================== kfzkennzeichen Shortcode ===============================================

Use Shortcode:		[kfzkennzeichen nr="Kennzeichen bis zum Bindestrich"]</code>
				
		'scale' => '',     		// sm = 32px  xs=21px
		'nr' => 'DO',     		// Gibt anhand des Ortscodes deutscher Kennzeichen Name, Herleitung und Bundesland mit Wappen aus
		
liefert den Zulassungsbezirk, das Bundesland und das kleine Wappen vom Bundesland in 21x30px

=========================================== Carlogo Shortcode ===============================================
Use Shortcode: [carlogo brand="mercedes" scale="sm"]

		      'scale' => '',     		// sm = 32px  xs=21px
		      'brand' => '0unknown',  // Autohersteller  - all=show all logos with countries and flag

to display logo and link to german webpage or car manufacturer

=========================================== Computerbrand logo Shortcode ===============================================
Use Shortcode: [complogo brand="lenovo" scale="sm"]

		      'scale' => '',     		// sm = 32px  xs=21px
		      'brand' => '0unknown',  // Computerhersteller

to display logo and link to german webpage or computer manufacturer

=====================================================================================================================


== Changelog ==

= 11.1.112 =
Bundesländerwappen Shortcode bulawappen, mit parameter land und scale
scale-parameter sm und xs bei carlogo, herstellerlogo shortdoce fixed

= 11.1.109 =
fontawesome updates, some icons added. only needed when not penguin-mod theme

= 11.1.107 =
[Carlogos] updated and their origin land iso added to display flag of origin on shortcode use.
Shortcode parameter "brand=all" added to display a panel aof all supported car brands with origin country 

= 11.1.101 =
girocode improved and iban generator für germany added
forms to convert blz und konto to iban
iban and bic prüfung (international)
EPC-Code (Girocode) generieren, mit und ohne Text (noformat=1)

= 11.1.92 =
ipflag shortcode showland=1 added to display land and iso in clear text