WP Manifestindependent plugin directory
manifest / events / cannes-festival-medal-tracker

Cannes Festival Medal Tracker

A WordPress plugin to track gold, silver and bronze medals for Cannes Festival and display a live medal board ranking.

by Hernan Cardoso · github.com/hcardoso81/cannes-festival-medal-tracker

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/hcardoso81/cannes-festival-medal-tracker/archive/refs/heads/main.zip

WordPress plugin to import, manage and display festival medal standings by country using GP, gold, silver and bronze medals.

Technology Chips

Requirements

  • WordPress.
  • PHP 7.4 or newer.
  • Composer dependency phpoffice/phpspreadsheet.

Install the Excel reader dependency inside the plugin directory:

composer install

If vendor/autoload.php is missing, the plugin can still load, but Excel imports will show an admin error asking to install PhpSpreadsheet.

Installation

  1. Copy this directory into wp-content/plugins/cannes-festival-medal-tracker.
  2. Run composer install in the plugin directory.
  3. Activate Cannes Festival Medal Tracker in WordPress.
  4. On activation, the plugin creates the table {prefix}_fmb_country_medals.

Excel Format

The first row must contain at least these columns:

  • location: country name.
  • prize: medal prize.

Supported prize values:

  • GP, Grand Prix and Grand Prix Campaign map to GP.
  • Gold Lion, Gold Lion Campaign and Gold map to gold.
  • Silver Lion, Silver Lion Campaign and Silver map to silver.
  • Bronze Lion, Bronze Lion Campaign and Bronze map to bronze.

Rows with empty countries or unrecognized prizes are ignored and reported in the pending preview details. The header row can use different casing, such as Location and Prize, and may appear after an initial title row. Processed row details include the spreadsheet row number, original location, original prize, status and reason. When a location cell contains multiple countries separated by /, the preview states which allowed countries were counted and which non-allowed countries were ignored. For example, Spain / Brazil / Argentina counts Argentina and ignores Spain and Brazil. Ignored row details are also written to logs/fmb-error.log.

Only these Hispanoamerica countries are counted:

  • ARGENTINA
  • BOLIVIA
  • CHILE
  • COLOMBIA
  • COSTA RICA
  • CUBA
  • REPUBLICA DOMINICANA
  • ECUADOR
  • EL SALVADOR
  • GUATEMALA
  • HAITI
  • HONDURAS
  • MEXICO
  • NICARAGUA
  • PANAMA
  • PARAGUAY
  • PERU
  • PUERTO RICO
  • URUGUAY
  • VENEZUELA

Other countries, including Brazil, are ignored and listed in the import summary/log.

Prize synonyms can be extended with the fmb_prize_synonyms filter:

add_filter('fmb_prize_synonyms', static function (array $synonyms): array {
    $synonyms['gp'][] = 'Grand Prix For Good';
    $synonyms['gold'][] = 'Gold';

    return $synonyms;
});

Allowed countries can be extended or replaced with the fmb_allowed_countries filter:

add_filter('fmb_allowed_countries', static function (array $countries): array {
    $countries[] = 'URUGUAY';

    return $countries;
});

Admin Usage

Go to Medal Tracker in the WordPress admin dashboard.

The page lets administrators with manage_options upload an .xlsx, .xls or .csv file. The Generar vista previa button stays disabled until a file is selected. If the selected file was already approved in the import history, the browser asks for confirmation before processing it again. Uploading a file creates a pending preview only; no medal totals are persisted yet. The admin page shows the countries and prize values that will be counted before upload.

The pending preview uses collapsible accordions. One accordion lists every processed row, highlighting counted rows in green and bold while keeping ignored rows visually separate. Another accordion shows the detected medal totals by country and the create/update action that would happen on approval. If a processed file does not produce medal results, the admin UI shows a red warning and keeps the approval action available so the file can still be recorded in the approved import history without changing medal totals.

After reviewing the preview, use Approve and continue to merge the detected medals into the database. Existing countries are incremented; new countries are inserted. The approved import is stored with per-country medal deltas, so it can be undone later from Registro de importaciones. When no medals were detected, approving only records the source file in the import tables. You can also discard the pending preview without changing the database. Approval, undo and discard actions require a nonce, manage_options and browser confirmation.

The upload notice only confirms that the Excel file was processed and points back to the preview; it does not duplicate row details. Registro de importaciones separates pending previews from approved imports: a pending file is marked as not merged and not yet saved in the medal table, while approved imports from the import tables are listed in a collapsible history with filename, approval date, valid rows, ignored rows, country create/update counts, status and undo action when per-country deltas are available. Discarded previews are not added to this history.

The admin page also includes a reset action to delete all medal rows from the plugin table. Reset also clears the pending preview and the approved import history, so Registro de importaciones returns to an empty state. The reset requires manage_options, a nonce, a browser confirmation and typing the exact confirmation phrase reiniciar medallero.

Shortcodes

Country totals:

[medalByCountry]
[medalbycountry]

Medal totals by type:

[medalsTotal]
[medalstotal]

Country detail:

[medalByCountryDetail]
[medalbycountrydetail]

Frontend tables use semantic HTML and the fmb-table CSS class family for customization.

Security

  • Admin page requires manage_options.
  • Upload form uses WordPress nonces.
  • Import approval uses WordPress nonces and browser confirmation before database writes.
  • Reset form uses WordPress nonces and browser confirmation.
  • Uploads are processed with wp_handle_upload.
  • File extensions and MIME types are validated.
  • Database writes use $wpdb->prepare, $wpdb->insert and typed formats.
  • Output is escaped before rendering.

Logs

Import errors are written to:

logs/fmb-error.log

The logs/ directory includes index.php and .htaccess protections. Log files are ignored by Git. Imports that finish with ignored rows also write the ignored row details to the log so invalid source values are not lost.