diff --git a/PROJECT.md b/PROJECT.md new file mode 100644 index 0000000..94997dc --- /dev/null +++ b/PROJECT.md @@ -0,0 +1,25 @@ +WordPress plugin for managing Go (Baduk/Weiqi) tournament registrations. Collects player data via frontend forms and exports entries to tournament management systems (Pairgoth, OpenGotha, McMahon, CSV). + +**Relevant files:** +- `main.php` - Plugin entry point with WordPress hooks +- `go-form-plugin/go-form-plugin.php` - Core plugin logic (forms, entries, EGD integration, exports) +- `go-form-plugin/database-schema.sql` - MySQL schema for 4 tables (forms, entries, custom_fields, entry_custom_values) +- `go-form-plugin/export/csv.php` - CSV export handler +- `go-form-plugin/export/pairgoth.php` - Pairgoth JSON export handler +- `go-form-plugin/export/opengotha.php` - OpenGotha XML export handler +- `go-form-plugin/export/mcmahon.php` - McMahon XML export handler +- `go-form-plugin/export/mcmahon-help.php` - McMahon documentation/reference +- `go-form-plugin/templates/form-shortcode.php` - Frontend form template +- `go-form-plugin/templates/settings-page.php` - Admin dashboard template +- `go-form-plugin/templates/table.php` - Entries table display +- `README.md` - Full documentation + +**Nuances:** +- Ranks stored as integers (0-47): 0-29=30k-1k, 30-38=1d-9d, 39-47=1p-9p +- Rating auto-calculated: `rating = (rank * 100) - 900` +- EGD integration: searches `https://europeangodatabase.eu/EGD/GetPlayerDataByData.php` and `GetPlayerDataByPIN.php` +- Uses WordPress nonces, `manage_options` capability, `$wpdb->prepare()` for security +- Foreign keys with CASCADE delete + +## To LLM +Update this file if the changes you have done are worth updating here. The intent of this file is to give you a rough idea of the project, from where you can explore further, if needed. \ No newline at end of file diff --git a/go-form-plugin/go-form-plugin.php b/go-form-plugin/go-form-plugin.php index cd812c2..75d4308 100644 --- a/go-form-plugin/go-form-plugin.php +++ b/go-form-plugin/go-form-plugin.php @@ -233,7 +233,7 @@ function go_form_handle_submission() exit; } add_action('admin_post_go_form_handle_submission', 'go_form_handle_submission'); -Pleadd_action('admin_post_nopriv_go_form_handle_submission', 'go_form_handle_submission'); +add_action('admin_post_nopriv_go_form_handle_submission', 'go_form_handle_submission'); // ========== Shortcode ========== function go_form_shortcode($atts) diff --git a/go-form-plugin/templates/form-shortcode.php b/go-form-plugin/templates/form-shortcode.php index d55271d..5f3692e 100644 --- a/go-form-plugin/templates/form-shortcode.php +++ b/go-form-plugin/templates/form-shortcode.php @@ -100,6 +100,10 @@ +
* Required fields
diff --git a/go-form-plugin/templates/table.php b/go-form-plugin/templates/table.php index dcc0b4c..01c0d36 100644 --- a/go-form-plugin/templates/table.php +++ b/go-form-plugin/templates/table.php @@ -1,69 +1,74 @@ -| N | -First Name | -Last Name | -Rank | -Country | -Club | -EGD Number | -Date Added | - is_public || $show_admin): - echo '' . esc_html($field->field_name) . ' | '; - endif; - endforeach; - ?> - -Rating | -Action | - -
|---|
| = $i + 1 ?> | -= esc_html($e->first_name) ?> | -= esc_html($e->last_name) ?> | -= esc_html($ranks[$e->rank]) ?> | -= esc_html($e->country) ?> | -= esc_html($e->club) ?> | -= esc_html($e->egd_number) ?> | -= esc_html($e->created_at) ?> | +N | +First Name | +Last Name | +Rank | +Country | +Club | +EGD Number | +Date Added | is_public || $show_admin): - echo ''; - $value = go_form_get_custom_value($e->id, $field->id); - if ($field->field_type === 'checkbox') { - echo $value ? 'Yes' : 'No'; - } else { - echo esc_html($value); - } - echo ' | '; + echo '' . esc_html($field->field_name) . ' | '; endif; endforeach; ?> - - -= esc_html($e->rating) ?> | -- Edit - id); ?> - | - +Rating | +Action | -
|---|