=== Golf Handicap & Slope Changelog ===

= 2.3.0 =
* Added: Scorecard. Enter par, stroke index and length for the 18 holes of each tee (Golf Handicap & Slope > Scorecard, with "copy from" between tees and validation of pars and stroke indexes). The new `[golfhs_scorecard]` shortcode shows the scorecard for every tee with complete hole data, with tabs between tees. On the same page as the calculator the tabs replace the tee dropdown, and the scorecard marks, hole by hole, where the player gets (or gives) strokes and explains it in one sentence.
* Added: `[golfhs_calculator label="…"]` to change the label on the handicap field.
* Added: Tees with incomplete hole data are never shown to visitors; administrators see a note listing them.
* Changed: Database version 1.2.0 (new holes table, created automatically on update).

= 2.2.4 =
* Changed: The calculator now updates automatically while you type and when you change tee – no need to press a button. The "Calculate" button is gone by default; enable it under Settings if you want it (it then lines up with the input fields).
* Added: A `golfhs:result` event (with playing handicap, handicap index and tee data) and a `golfhs:clear` event are dispatched on `document`, so themes can react to the result – for example to show which holes you get strokes on.
* Accessibility: The result box announces changes to screen readers (aria-live).
* Fixed: The label sat right on top of the input, so the focus ring covered its descenders in some themes; inputs taller than 38px overflowed their wrapper.

= 2.2.3 =
* Fixed: The course rating / slope / par values in the tee rows could run together without spacing in narrow content columns (e.g. next to a sidebar). They now keep a gap and wrap when needed.
* Fixed: Tee names such as "Herrer, tee 64" could wrap onto two lines in the green label; the label now grows with the name.

= 2.2.2 =
* Changed: Tee rows in the tables now show "Course rating 72.4 · Slope rating 128 · Par 72" using the site's locale for decimals (e.g. 72,4 in Norwegian) and without trademark symbols. Tee headings and the calculator's tee dropdown now use one translatable format ("Men – Yellow").
* i18n (Norwegian): consistent terminology throughout – "handicap" (not "handikap"), "spillehandicap" for course handicap, "handicapindeks", "utslag" for tee, "herrer/damer" for men/women; shorter, plainer validation messages.

= 2.2.0 =
* Fixed: Calculator showed the wrong sign for plus handicaps on harder tees; calculator and tables now always agree.
* Fixed: A "+" entered for a plus handicap was stripped and treated as a regular handicap; plus and minus are now treated identically.
* Changed: Course handicap is shown with its natural sign (positive = you receive strokes, negative = you must give strokes), with explanatory helper text and a color hint.
* Improved: PHP table and JavaScript calculator now use identical rounding (half up).
* Improved: Removed theme-polluting global CSS and the dead override stylesheet; stylesheets now load only on pages that use a shortcode.
* Improved: Course Rating now accepts comma decimals; cache is cleared on tee reordering; minor security hardening (gender whitelist, color re-validation).

= 2.1.9 =
* Fixed: Admin color preview now updates correctly when changing colors.
* Fixed: Removed console.log statements from production JavaScript.
* Fixed: Deleted unused JavaScript that caused duplicate AJAX requests on tee move.
* Fixed: Custom table colors now apply correctly.
* Fixed: Database error details no longer exposed to the browser client.

= 2.1.8 =
* Fixed: Critical bug where calculator failed due to incorrect data access (object vs array notation for tee data)
* Fixed: Wrong option key for plugin settings caused default colors to always be used
* Fixed: JavaScript referenced non-existent DOM IDs, breaking calculator functionality
* Fixed: Activation migration never ran because version was updated before version check
* Fixed: esc_html() on CSS in wp_add_inline_style() broke dynamic color styling
* Fixed: Consolidated duplicate wp_localize_script calls for golfhs_data
* Fixed: Custom colors from admin settings not applied on frontend (CSS variable override)
* Fixed: Admin preview not reflecting custom color choices (CSS variables instead of hardcoded colors)
* Fixed: "Use Theme Colors" checkbox was misleading — renamed to "Use Plugin Default Colors"
* Fixed: table_columns setting not saving due to strict type comparison (string vs integer)
* Fixed: Inline CSS injection in shortcode conflicted with theme color toggle
* Fixed: Standardized default color to #1e73be across all files
* Fixed: Hardcoded version strings replaced with GOLFHS_VERSION constant
* Fixed: Hardcoded Norwegian strings in admin JS now use localized strings
* Removed: Unused dead code (duplicate calculator JS file, unused PHP method)
* Improved: Reordered tee form fields — Course Rating now appears before Slope Rating
* Improved: Full WordPress Coding Standards compliance (PHPCS)
* Improved: Cleaner JavaScript without unnecessary desktop/mobile DOM splitting
* Improved: All admin JS strings now internationalized via wp_localize_script
* Improved: Removed all debug console.log statements from production code
* Improved: Updated Norwegian translations for new UI text
* Improved: Regenerated .l10n.php translation cache for WordPress 6.5+ compatibility
* Security: Added wp_strip_all_tags() to all wp_add_inline_style() calls

= 2.1.5 =
* Fixed: Added missing translations for calculator labels ("Your handicap", "Which tee?", "Course handicap:")

= 2.1.4 =
* Fixed: Norwegian translation not loading - restored load_plugin_textdomain() function

= 2.1.2 - June 17, 2025 =
* Fixed: Properly escaped all wp_add_inline_style() calls with esc_html() for security and WordPress.org compliance
* Fixed: Removed unnecessary load_plugin_textdomain() call as per WordPress 4.6+ guidelines
* Fixed: Renamed JavaScript objects to use golfhs_ prefix for better namespace compliance
* Fixed: Calculator display bug showing incorrect allocated strokes (showed 9 instead of 8)
* Improved: Mobile responsive layout - input fields now stack vertically on small screens
* Removed: All debug console.log statements for production readiness
* Updated: Contributors list to only 'gudjon' as per WordPress.org requirements
* Fixed: Disabled duplicate calculator script that was overriding correct values
* Improved: All elements now have 100% width on mobile for better user experience

= 2.1.1 - May 21, 2025 =
* Fixed: Changed text domain from 'Golf-Handicap-Slope' to 'golf-handicap-slope' to follow WordPress.org guidelines
* Fixed: Updated all translation strings to use the new text domain
* Fixed: Updated @package comments in all files for consistency

= 2.1.0 - Original version =
* First version uploaded to WordPress.org
