Plugin Directory

Changeset 3490507


Ignore:
Timestamp:
03/25/2026 05:01:33 AM (4 days ago)
Author:
nielslange
Message:

Update to version 2.5 from GitHub

Location:
smntcs-simple-events-widget
Files:
2 added
2 deleted
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • smntcs-simple-events-widget/tags/2.5/README.md

    r3260220 r3490507  
    1010![Tag Version](https://img.shields.io/github/tag/nielslange/smntcs-simple-events-widget.svg)
    1111
    12 Sidebar widget to show (upcoming and previous) events.
     12Add event dates to your content and list upcoming or past events in a classic sidebar widget.
     13
     14**SMNTCS Simple Events Widget** is a lightweight way to pin calendar dates to individual posts, pages, or WooCommerce products and show them in the sidebar when visitors browse your site.
     15
     16You pick a start date and, if you want, an end date, right in the editor. Then you drop the **Simple Events Widget** into a widget area and choose whether to show what is still ahead, what has already passed, or both. You can show only the start date or start and end together, change the sort order, add a line break before the title, and dates follow your site’s language and date format.
     17
     18- Event fields (with date picker) on posts, pages, and on products when WooCommerce is active
     19- Widget: upcoming events, previous events, or both
     20- Display start date only or start and end date
     21- Sort order and optional line break between date and title
     22- Classic WordPress widget—use **Customize → Widgets** or your theme’s widget regions
    1323
    1424## Installation
     
    19294. If wanted, also provide an end date of the event.
    20305. Go to `Customize » Widgets`, add the `Simple Events Widget` to the required sidebar.
    21 6. Adjust the widget settings according to you needs.
     316. Adjust the widget settings according to your needs.
    2232
    2333## Plugin page
     
    2636
    2737## Changelog
     38
     39### 2.5 (2025.03.25)
     40
     41- Tested up to WordPress 6.9
     42- Add widget options for event sort order and line break between date and title
     43- Use date_i18n for localized date output
     44- Include WooCommerce products when querying events
     45- Update Composer dev dependencies; replace phpcs.dist.xml with phpcs.xml; refresh GitHub Actions
    2846
    2947### 2.4 (2025.03.23)
  • smntcs-simple-events-widget/tags/2.5/README.txt

    r3260220 r3490507  
    33Contributors:       nielslange
    44Tags:               Simple Events, Event, Widget, Sidebar
    5 Stable tag:         2.4
    6 Tested up to:       6.8
     5Stable tag:         2.5
     6Tested up to:       6.9
    77Requires at least:  3.4
    88Requires PHP:       7.4
     
    1010License URI:        https://www.gnu.org/licenses/gpl-2.0.html
    1111
    12 Sidebar widget to show (upcoming and previous) events.
     12Add event dates to your content and list upcoming or past events in a classic sidebar widget.
    1313
    1414== Description ==
    1515
    16 Sidebar widget to show (upcoming and previous) events.
     16SMNTCS Simple Events Widget is a lightweight way to pin calendar dates to individual posts, pages, or WooCommerce products and show them in the sidebar when visitors browse your site.
     17
     18You pick a start date and, if you want, an end date, right in the editor. Then you drop the *Simple Events Widget* into a widget area and decide whether to show what is still ahead, what has already passed, or both. You can show only the start date or start and end together, change the sort order, add a line break before the title, and dates respect your site’s language and date format.
     19
     20* Event fields (with date picker) on posts, pages, and on products when WooCommerce is active
     21* Widget: upcoming events, previous events, or both
     22* Display start date only or start and end date
     23* Sort order and optional line break between date and title
     24* Classic WordPress widget—place it under **Customize → Widgets** or in your theme’s widget regions
    1725
    1826== Installation ==
     
    23314. If wanted, also provide an end date of the event.
    24325. Go to `Customize » Widgets`, add the `Simple Events Widget` to the required sidebar.
    25 6. Adjust the widget settings according to you needs.
     336. Adjust the widget settings according to your needs.
    2634
    2735== Screenshots ==
     
    3240
    3341== Changelog ==
     42
     43= 2.5 (2025.03.25) =
     44
     45- Tested up to WordPress 6.9
     46- Add widget options for event sort order and line break between date and title
     47- Use date_i18n for localized date output
     48- Include WooCommerce products when querying events
     49- Update Composer dev dependencies; replace phpcs.dist.xml with phpcs.xml; refresh GitHub Actions
    3450
    3551= 2.4 (2025.03.23)
  • smntcs-simple-events-widget/tags/2.5/composer.json

    r2651293 r3490507  
    44    "homepage": "https://wordpress.org/plugins/smntcs-simple-events-widget/",
    55    "type": "wordpress-plugin",
     6    "keywords": [
     7        "WordPress",
     8        "Plugin",
     9        "SMNTCS Simple Events Widget"
     10    ],
     11    "license": "GPL-2.0-or-later",
    612    "authors": [
    713        {
     
    1016        }
    1117    ],
    12     "require": {
    13         "php": ">=7.0"
    14     },
    1518    "require-dev": {
    1619        "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
     
    1821        "overtrue/phplint": "^2.3",
    1922        "phpcompatibility/phpcompatibility-wp": "^2.1",
    20         "squizlabs/php_codesniffer": "^3.6",
     23        "squizlabs/php_codesniffer": "^3.12",
    2124        "vimeo/psalm": "^4.7",
    22         "wp-coding-standards/wpcs": "^2.3"
     25        "wp-coding-standards/wpcs": "^3.1"
    2326    },
    2427    "scripts": {
    25         "phpcbf": "phpcbf --standard=phpcs.dist.xml .",
    26         "phpcs": "phpcs --standard=phpcs.dist.xml .",
     28        "phpcbf": "phpcbf --standard=phpcs.xml .",
     29        "phpcs": "phpcs --standard=phpcs.xml .",
    2730        "phplint": "phplint",
    2831        "psalm": "psalm --no-cache"
  • smntcs-simple-events-widget/tags/2.5/composer.lock

    r3260220 r3490507  
    55        "This file is @generated automatically"
    66    ],
    7     "content-hash": "2b427520ede5ee7ebf10233fd6287850",
     7    "content-hash": "840ab54c03a0249cf4e53c3ee64886b4",
    88    "packages": [],
    99    "packages-dev": [
     
    581581        {
    582582            "name": "doctrine/deprecations",
    583             "version": "1.1.4",
     583            "version": "1.1.5",
    584584            "source": {
    585585                "type": "git",
    586586                "url": "https://github.com/doctrine/deprecations.git",
    587                 "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9"
    588             },
    589             "dist": {
    590                 "type": "zip",
    591                 "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9",
    592                 "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9",
     587                "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38"
     588            },
     589            "dist": {
     590                "type": "zip",
     591                "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
     592                "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
    593593                "shasum": ""
    594594            },
     
    596596                "php": "^7.1 || ^8.0"
    597597            },
    598             "require-dev": {
    599                 "doctrine/coding-standard": "^9 || ^12",
    600                 "phpstan/phpstan": "1.4.10 || 2.0.3",
     598            "conflict": {
     599                "phpunit/phpunit": "<=7.5 || >=13"
     600            },
     601            "require-dev": {
     602                "doctrine/coding-standard": "^9 || ^12 || ^13",
     603                "phpstan/phpstan": "1.4.10 || 2.1.11",
    601604                "phpstan/phpstan-phpunit": "^1.0 || ^2",
    602                 "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
     605                "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12",
    603606                "psr/log": "^1 || ^2 || ^3"
    604607            },
     
    620623            "support": {
    621624                "issues": "https://github.com/doctrine/deprecations/issues",
    622                 "source": "https://github.com/doctrine/deprecations/tree/1.1.4"
    623             },
    624             "time": "2024-12-07T21:18:45+00:00"
     625                "source": "https://github.com/doctrine/deprecations/tree/1.1.5"
     626            },
     627            "time": "2025-04-07T20:06:18+00:00"
    625628        },
    626629        {
     
    10951098        {
    10961099            "name": "php-stubs/wordpress-stubs",
    1097             "version": "v6.7.2",
     1100            "version": "v6.8.1",
    10981101            "source": {
    10991102                "type": "git",
    11001103                "url": "https://github.com/php-stubs/wordpress-stubs.git",
    1101                 "reference": "c04f96cb232fab12a3cbcccf5a47767f0665c3f4"
    1102             },
    1103             "dist": {
    1104                 "type": "zip",
    1105                 "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/c04f96cb232fab12a3cbcccf5a47767f0665c3f4",
    1106                 "reference": "c04f96cb232fab12a3cbcccf5a47767f0665c3f4",
    1107                 "shasum": ""
     1104                "reference": "92e444847d94f7c30f88c60004648f507688acd5"
     1105            },
     1106            "dist": {
     1107                "type": "zip",
     1108                "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/92e444847d94f7c30f88c60004648f507688acd5",
     1109                "reference": "92e444847d94f7c30f88c60004648f507688acd5",
     1110                "shasum": ""
     1111            },
     1112            "conflict": {
     1113                "phpdocumentor/reflection-docblock": "5.6.1"
    11081114            },
    11091115            "require-dev": {
    11101116                "dealerdirect/phpcodesniffer-composer-installer": "^1.0",
    1111                 "nikic/php-parser": "^4.13",
     1117                "nikic/php-parser": "^5.4",
    11121118                "php": "^7.4 || ^8.0",
    11131119                "php-stubs/generator": "^0.8.3",
    11141120                "phpdocumentor/reflection-docblock": "^5.4.1",
    1115                 "phpstan/phpstan": "^1.11",
     1121                "phpstan/phpstan": "^2.1",
    11161122                "phpunit/phpunit": "^9.5",
    11171123                "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.1.1",
     
    11371143            "support": {
    11381144                "issues": "https://github.com/php-stubs/wordpress-stubs/issues",
    1139                 "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.7.2"
    1140             },
    1141             "time": "2025-02-12T04:51:58+00:00"
     1145                "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.8.1"
     1146            },
     1147            "time": "2025-05-02T12:33:34+00:00"
    11421148        },
    11431149        {
     
    13901396        },
    13911397        {
     1398            "name": "phpcsstandards/phpcsextra",
     1399            "version": "1.3.0",
     1400            "source": {
     1401                "type": "git",
     1402                "url": "https://github.com/PHPCSStandards/PHPCSExtra.git",
     1403                "reference": "46d08eb86eec622b96c466adec3063adfed280dd"
     1404            },
     1405            "dist": {
     1406                "type": "zip",
     1407                "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/46d08eb86eec622b96c466adec3063adfed280dd",
     1408                "reference": "46d08eb86eec622b96c466adec3063adfed280dd",
     1409                "shasum": ""
     1410            },
     1411            "require": {
     1412                "php": ">=5.4",
     1413                "phpcsstandards/phpcsutils": "^1.0.9",
     1414                "squizlabs/php_codesniffer": "^3.12.1"
     1415            },
     1416            "require-dev": {
     1417                "php-parallel-lint/php-console-highlighter": "^1.0",
     1418                "php-parallel-lint/php-parallel-lint": "^1.3.2",
     1419                "phpcsstandards/phpcsdevcs": "^1.1.6",
     1420                "phpcsstandards/phpcsdevtools": "^1.2.1",
     1421                "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
     1422            },
     1423            "type": "phpcodesniffer-standard",
     1424            "extra": {
     1425                "branch-alias": {
     1426                    "dev-stable": "1.x-dev",
     1427                    "dev-develop": "1.x-dev"
     1428                }
     1429            },
     1430            "notification-url": "https://packagist.org/downloads/",
     1431            "license": [
     1432                "LGPL-3.0-or-later"
     1433            ],
     1434            "authors": [
     1435                {
     1436                    "name": "Juliette Reinders Folmer",
     1437                    "homepage": "https://github.com/jrfnl",
     1438                    "role": "lead"
     1439                },
     1440                {
     1441                    "name": "Contributors",
     1442                    "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors"
     1443                }
     1444            ],
     1445            "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.",
     1446            "keywords": [
     1447                "PHP_CodeSniffer",
     1448                "phpcbf",
     1449                "phpcodesniffer-standard",
     1450                "phpcs",
     1451                "standards",
     1452                "static analysis"
     1453            ],
     1454            "support": {
     1455                "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues",
     1456                "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy",
     1457                "source": "https://github.com/PHPCSStandards/PHPCSExtra"
     1458            },
     1459            "funding": [
     1460                {
     1461                    "url": "https://github.com/PHPCSStandards",
     1462                    "type": "github"
     1463                },
     1464                {
     1465                    "url": "https://github.com/jrfnl",
     1466                    "type": "github"
     1467                },
     1468                {
     1469                    "url": "https://opencollective.com/php_codesniffer",
     1470                    "type": "open_collective"
     1471                },
     1472                {
     1473                    "url": "https://thanks.dev/u/gh/phpcsstandards",
     1474                    "type": "thanks_dev"
     1475                }
     1476            ],
     1477            "time": "2025-04-20T23:35:32+00:00"
     1478        },
     1479        {
     1480            "name": "phpcsstandards/phpcsutils",
     1481            "version": "1.0.12",
     1482            "source": {
     1483                "type": "git",
     1484                "url": "https://github.com/PHPCSStandards/PHPCSUtils.git",
     1485                "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c"
     1486            },
     1487            "dist": {
     1488                "type": "zip",
     1489                "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c",
     1490                "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c",
     1491                "shasum": ""
     1492            },
     1493            "require": {
     1494                "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0",
     1495                "php": ">=5.4",
     1496                "squizlabs/php_codesniffer": "^3.10.0 || 4.0.x-dev@dev"
     1497            },
     1498            "require-dev": {
     1499                "ext-filter": "*",
     1500                "php-parallel-lint/php-console-highlighter": "^1.0",
     1501                "php-parallel-lint/php-parallel-lint": "^1.3.2",
     1502                "phpcsstandards/phpcsdevcs": "^1.1.6",
     1503                "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0"
     1504            },
     1505            "type": "phpcodesniffer-standard",
     1506            "extra": {
     1507                "branch-alias": {
     1508                    "dev-stable": "1.x-dev",
     1509                    "dev-develop": "1.x-dev"
     1510                }
     1511            },
     1512            "autoload": {
     1513                "classmap": [
     1514                    "PHPCSUtils/"
     1515                ]
     1516            },
     1517            "notification-url": "https://packagist.org/downloads/",
     1518            "license": [
     1519                "LGPL-3.0-or-later"
     1520            ],
     1521            "authors": [
     1522                {
     1523                    "name": "Juliette Reinders Folmer",
     1524                    "homepage": "https://github.com/jrfnl",
     1525                    "role": "lead"
     1526                },
     1527                {
     1528                    "name": "Contributors",
     1529                    "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors"
     1530                }
     1531            ],
     1532            "description": "A suite of utility functions for use with PHP_CodeSniffer",
     1533            "homepage": "https://phpcsutils.com/",
     1534            "keywords": [
     1535                "PHP_CodeSniffer",
     1536                "phpcbf",
     1537                "phpcodesniffer-standard",
     1538                "phpcs",
     1539                "phpcs3",
     1540                "standards",
     1541                "static analysis",
     1542                "tokens",
     1543                "utility"
     1544            ],
     1545            "support": {
     1546                "docs": "https://phpcsutils.com/",
     1547                "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues",
     1548                "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy",
     1549                "source": "https://github.com/PHPCSStandards/PHPCSUtils"
     1550            },
     1551            "funding": [
     1552                {
     1553                    "url": "https://github.com/PHPCSStandards",
     1554                    "type": "github"
     1555                },
     1556                {
     1557                    "url": "https://github.com/jrfnl",
     1558                    "type": "github"
     1559                },
     1560                {
     1561                    "url": "https://opencollective.com/php_codesniffer",
     1562                    "type": "open_collective"
     1563                }
     1564            ],
     1565            "time": "2024-05-20T13:34:27+00:00"
     1566        },
     1567        {
    13921568            "name": "phpdocumentor/reflection-common",
    13931569            "version": "2.2.0",
     
    14441620        {
    14451621            "name": "phpdocumentor/reflection-docblock",
    1446             "version": "5.6.1",
     1622            "version": "5.6.2",
    14471623            "source": {
    14481624                "type": "git",
    14491625                "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
    1450                 "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8"
    1451             },
    1452             "dist": {
    1453                 "type": "zip",
    1454                 "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",
    1455                 "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",
     1626                "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62"
     1627            },
     1628            "dist": {
     1629                "type": "zip",
     1630                "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/92dde6a5919e34835c506ac8c523ef095a95ed62",
     1631                "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62",
    14561632                "shasum": ""
    14571633            },
     
    15021678            "support": {
    15031679                "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
    1504                 "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1"
    1505             },
    1506             "time": "2024-12-07T09:39:29+00:00"
     1680                "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.2"
     1681            },
     1682            "time": "2025-04-13T19:20:35+00:00"
    15071683        },
    15081684        {
     
    17821958        {
    17831959            "name": "squizlabs/php_codesniffer",
    1784             "version": "3.12.0",
     1960            "version": "3.12.2",
    17851961            "source": {
    17861962                "type": "git",
    17871963                "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
    1788                 "reference": "2d1b63db139c3c6ea0c927698e5160f8b3b8d630"
    1789             },
    1790             "dist": {
    1791                 "type": "zip",
    1792                 "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/2d1b63db139c3c6ea0c927698e5160f8b3b8d630",
    1793                 "reference": "2d1b63db139c3c6ea0c927698e5160f8b3b8d630",
     1964                "reference": "6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa"
     1965            },
     1966            "dist": {
     1967                "type": "zip",
     1968                "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa",
     1969                "reference": "6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa",
    17941970                "shasum": ""
    17951971            },
     
    18622038                }
    18632039            ],
    1864             "time": "2025-03-18T05:04:51+00:00"
     2040            "time": "2025-04-13T04:10:18+00:00"
    18652041        },
    18662042        {
     
    20952271        {
    20962272            "name": "symfony/polyfill-ctype",
    2097             "version": "v1.31.0",
     2273            "version": "v1.32.0",
    20982274            "source": {
    20992275                "type": "git",
     
    21542330            ],
    21552331            "support": {
    2156                 "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
     2332                "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0"
    21572333            },
    21582334            "funding": [
     
    21742350        {
    21752351            "name": "symfony/polyfill-intl-grapheme",
    2176             "version": "v1.31.0",
     2352            "version": "v1.32.0",
    21772353            "source": {
    21782354                "type": "git",
     
    22322408            ],
    22332409            "support": {
    2234                 "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0"
     2410                "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0"
    22352411            },
    22362412            "funding": [
     
    22522428        {
    22532429            "name": "symfony/polyfill-intl-normalizer",
    2254             "version": "v1.31.0",
     2430            "version": "v1.32.0",
    22552431            "source": {
    22562432                "type": "git",
     
    23132489            ],
    23142490            "support": {
    2315                 "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0"
     2491                "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0"
    23162492            },
    23172493            "funding": [
     
    23332509        {
    23342510            "name": "symfony/polyfill-mbstring",
    2335             "version": "v1.31.0",
     2511            "version": "v1.32.0",
    23362512            "source": {
    23372513                "type": "git",
    23382514                "url": "https://github.com/symfony/polyfill-mbstring.git",
    2339                 "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341"
    2340             },
    2341             "dist": {
    2342                 "type": "zip",
    2343                 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341",
    2344                 "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341",
    2345                 "shasum": ""
    2346             },
    2347             "require": {
     2515                "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493"
     2516            },
     2517            "dist": {
     2518                "type": "zip",
     2519                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493",
     2520                "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493",
     2521                "shasum": ""
     2522            },
     2523            "require": {
     2524                "ext-iconv": "*",
    23482525                "php": ">=7.2"
    23492526            },
     
    23932570            ],
    23942571            "support": {
    2395                 "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0"
     2572                "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0"
    23962573            },
    23972574            "funding": [
     
    24092586                }
    24102587            ],
    2411             "time": "2024-09-09T11:45:10+00:00"
     2588            "time": "2024-12-23T08:48:59+00:00"
    24122589        },
    24132590        {
    24142591            "name": "symfony/polyfill-php73",
    2415             "version": "v1.31.0",
     2592            "version": "v1.32.0",
    24162593            "source": {
    24172594                "type": "git",
     
    24692646            ],
    24702647            "support": {
    2471                 "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0"
     2648                "source": "https://github.com/symfony/polyfill-php73/tree/v1.32.0"
    24722649            },
    24732650            "funding": [
     
    24892666        {
    24902667            "name": "symfony/polyfill-php80",
    2491             "version": "v1.31.0",
     2668            "version": "v1.32.0",
    24922669            "source": {
    24932670                "type": "git",
    24942671                "url": "https://github.com/symfony/polyfill-php80.git",
    2495                 "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"
    2496             },
    2497             "dist": {
    2498                 "type": "zip",
    2499                 "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
    2500                 "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
     2672                "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608"
     2673            },
     2674            "dist": {
     2675                "type": "zip",
     2676                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
     2677                "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
    25012678                "shasum": ""
    25022679            },
     
    25492726            ],
    25502727            "support": {
    2551                 "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0"
     2728                "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0"
    25522729            },
    25532730            "funding": [
     
    25652742                }
    25662743            ],
    2567             "time": "2024-09-09T11:45:10+00:00"
     2744            "time": "2025-01-02T08:10:11+00:00"
    25682745        },
    25692746        {
     
    27142891        {
    27152892            "name": "symfony/string",
    2716             "version": "v6.4.15",
     2893            "version": "v6.4.21",
    27172894            "source": {
    27182895                "type": "git",
    27192896                "url": "https://github.com/symfony/string.git",
    2720                 "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f"
    2721             },
    2722             "dist": {
    2723                 "type": "zip",
    2724                 "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f",
    2725                 "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f",
     2897                "reference": "73e2c6966a5aef1d4892873ed5322245295370c6"
     2898            },
     2899            "dist": {
     2900                "type": "zip",
     2901                "url": "https://api.github.com/repos/symfony/string/zipball/73e2c6966a5aef1d4892873ed5322245295370c6",
     2902                "reference": "73e2c6966a5aef1d4892873ed5322245295370c6",
    27262903                "shasum": ""
    27272904            },
     
    27802957            ],
    27812958            "support": {
    2782                 "source": "https://github.com/symfony/string/tree/v6.4.15"
     2959                "source": "https://github.com/symfony/string/tree/v6.4.21"
    27832960            },
    27842961            "funding": [
     
    27962973                }
    27972974            ],
    2798             "time": "2024-11-13T13:31:12+00:00"
     2975            "time": "2025-04-18T15:23:29+00:00"
    27992976        },
    28002977        {
     
    30923269        {
    30933270            "name": "wp-coding-standards/wpcs",
    3094             "version": "2.3.0",
     3271            "version": "3.1.0",
    30953272            "source": {
    30963273                "type": "git",
    30973274                "url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
    3098                 "reference": "7da1894633f168fe244afc6de00d141f27517b62"
    3099             },
    3100             "dist": {
    3101                 "type": "zip",
    3102                 "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62",
    3103                 "reference": "7da1894633f168fe244afc6de00d141f27517b62",
    3104                 "shasum": ""
    3105             },
    3106             "require": {
     3275                "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7"
     3276            },
     3277            "dist": {
     3278                "type": "zip",
     3279                "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/9333efcbff231f10dfd9c56bb7b65818b4733ca7",
     3280                "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7",
     3281                "shasum": ""
     3282            },
     3283            "require": {
     3284                "ext-filter": "*",
     3285                "ext-libxml": "*",
     3286                "ext-tokenizer": "*",
     3287                "ext-xmlreader": "*",
    31073288                "php": ">=5.4",
    3108                 "squizlabs/php_codesniffer": "^3.3.1"
    3109             },
    3110             "require-dev": {
    3111                 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6",
     3289                "phpcsstandards/phpcsextra": "^1.2.1",
     3290                "phpcsstandards/phpcsutils": "^1.0.10",
     3291                "squizlabs/php_codesniffer": "^3.9.0"
     3292            },
     3293            "require-dev": {
     3294                "php-parallel-lint/php-console-highlighter": "^1.0.0",
     3295                "php-parallel-lint/php-parallel-lint": "^1.3.2",
    31123296                "phpcompatibility/php-compatibility": "^9.0",
    3113                 "phpcsstandards/phpcsdevtools": "^1.0",
    3114                 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
     3297                "phpcsstandards/phpcsdevtools": "^1.2.0",
     3298                "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
    31153299            },
    31163300            "suggest": {
    3117                 "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
     3301                "ext-iconv": "For improved results",
     3302                "ext-mbstring": "For improved results"
    31183303            },
    31193304            "type": "phpcodesniffer-standard",
     
    31323317                "phpcs",
    31333318                "standards",
     3319                "static analysis",
    31343320                "wordpress"
    31353321            ],
     
    31393325                "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki"
    31403326            },
    3141             "time": "2020-05-13T23:57:56+00:00"
     3327            "funding": [
     3328                {
     3329                    "url": "https://opencollective.com/php_codesniffer",
     3330                    "type": "custom"
     3331                }
     3332            ],
     3333            "time": "2024-03-25T16:39:00+00:00"
    31423334        },
    31433335        {
    31443336            "name": "wp-hooks/wordpress-core",
    3145             "version": "1.9.0",
     3337            "version": "1.10.0",
    31463338            "source": {
    31473339                "type": "git",
    31483340                "url": "https://github.com/wp-hooks/wordpress-core-hooks.git",
    3149                 "reference": "8cc9adaf9a87670ac434d440eb66d06d65ec215c"
    3150             },
    3151             "dist": {
    3152                 "type": "zip",
    3153                 "url": "https://api.github.com/repos/wp-hooks/wordpress-core-hooks/zipball/8cc9adaf9a87670ac434d440eb66d06d65ec215c",
    3154                 "reference": "8cc9adaf9a87670ac434d440eb66d06d65ec215c",
     3341                "reference": "127af21a918a52bcead7ce9b743b17b5d64eb148"
     3342            },
     3343            "dist": {
     3344                "type": "zip",
     3345                "url": "https://api.github.com/repos/wp-hooks/wordpress-core-hooks/zipball/127af21a918a52bcead7ce9b743b17b5d64eb148",
     3346                "reference": "127af21a918a52bcead7ce9b743b17b5d64eb148",
    31553347                "shasum": ""
    31563348            },
     
    31623354                "oomphinc/composer-installers-extender": "^2",
    31633355                "roots/wordpress-core-installer": "^1.0.0",
    3164                 "roots/wordpress-full": "6.7",
     3356                "roots/wordpress-full": "6.8",
    31653357                "wp-hooks/generator": "1.0.0"
    31663358            },
     
    32133405            "support": {
    32143406                "issues": "https://github.com/wp-hooks/wordpress-core-hooks/issues",
    3215                 "source": "https://github.com/wp-hooks/wordpress-core-hooks/tree/1.9.0"
     3407                "source": "https://github.com/wp-hooks/wordpress-core-hooks/tree/1.10.0"
    32163408            },
    32173409            "funding": [
     
    32213413                }
    32223414            ],
    3223             "time": "2024-12-04T23:00:43+00:00"
     3415            "time": "2025-04-16T22:20:41+00:00"
    32243416        }
    32253417    ],
     
    32293421    "prefer-stable": false,
    32303422    "prefer-lowest": false,
    3231     "platform": {
    3232         "php": ">=7.0"
    3233     },
     3423    "platform": {},
    32343424    "platform-dev": {},
    32353425    "plugin-api-version": "2.6.0"
  • smntcs-simple-events-widget/tags/2.5/includes/class-smntcs-simple-events-widget.php

    r3260220 r3490507  
    1919     */
    2020    public function __construct() {
    21         $widget_options = array(
     21        $widget_options = [
    2222            'classname'   => 'smntcs_simple_events_widget',
    2323            'description' => 'Display Simple Events Widget',
    24         );
     24        ];
    2525        parent::__construct( 'smntcs_simple_events_widget', 'Simple Events Widget', $widget_options );
    2626    }
     
    3333     */
    3434    public function widget( $args, $instance ) {
    35         $title     = apply_filters( 'widget_title', $instance['title'] );
    36         $timestamp = current_time( 'timestamp' );
     35        $title = apply_filters( 'widget_title', $instance['title'] );
     36        // Event meta is stored as UTC Unix timestamps; compare using the current instant.
     37        $timestamp = time();
     38
     39        $sort_order = isset( $instance['sort_order'] ) && 'DESC' === $instance['sort_order'] ? 'DESC' : 'ASC';
    3740
    3841        echo wp_kses_post( $args['before_widget'] );
     
    4144        }
    4245
    43         $query_args = array(
    44             'post_type' => array( 'post', 'page' ),
    45             'meta_key'  => 'datepicker_start',
    46             'orderby'   => 'meta_value',
    47             'order'     => 'DESC',
    48         );
     46        $query_args = [
     47            'post_type'      => [ 'post', 'page', 'product' ],
     48            'meta_key'       => 'datepicker_start',
     49            'orderby'        => 'meta_value',
     50            'order'          => $sort_order,
     51            'meta_type'      => 'NUMERIC',
     52            'posts_per_page' => -1,
     53        ];
    4954
    5055        if ( 'upcoming-events' === $instance['display_events'] ) {
    51             $query_args['meta_query'] = array(
    52                 array(
     56            $query_args['meta_query'] = [
     57                [
    5358                    'key'     => 'datepicker_start',
    5459                    'value'   => $timestamp,
    5560                    'compare' => '>=',
    5661                    'type'    => 'NUMERIC',
    57                 ),
    58             );
     62                ],
     63            ];
    5964        }
    6065
    6166        if ( 'previous-events' === $instance['display_events'] ) {
    62             $query_args['meta_query'] = array(
    63                 array(
     67            $query_args['meta_query'] = [
     68                [
    6469                    'key'     => 'datepicker_start',
    6570                    'value'   => $timestamp,
    6671                    'compare' => '<',
    6772                    'type'    => 'NUMERIC',
    68                 ),
    69             );
     73                ],
     74            ];
    7075        }
    7176
    7277        $the_query = new WP_Query( $query_args );
     78
     79        $date_title_separator = ! empty( $instance['date_title_line_break'] ) ? ': <br />' : ': ';
    7380
    7481        if ( $the_query->have_posts() ) {
     
    7784                $the_query->the_post();
    7885                $start_date_meta = get_post_meta( get_the_ID(), 'datepicker_start', true );
    79                 $start_date      = $start_date_meta ? gmdate( get_option( 'date_format' ), intval( $start_date_meta ) ) : __( 'No start date', 'smntcs-simple-events-widget' );
     86                $start_date      = $start_date_meta ? date_i18n( get_option( 'date_format' ), intval( $start_date_meta ), true ) : __( 'No start date', 'smntcs-simple-events-widget' );
    8087                $end_date_meta   = get_post_meta( get_the_ID(), 'datepicker_end', true );
    81                 $end_date        = $end_date_meta ? gmdate( get_option( 'date_format' ), intval( $end_date_meta ) ) : __( 'No end date', 'smntcs-simple-events-widget' );
    82 
    83                 $link = get_permalink();
     88                $end_date        = $end_date_meta ? date_i18n( get_option( 'date_format' ), intval( $end_date_meta ), true ) : __( 'No end date', 'smntcs-simple-events-widget' );
     89                $link            = get_permalink();
    8490
    8591                if ( 'start-and-end-date' === $instance['display_dates'] ) {
    8692                    printf(
    87                         '<li>%s - %s:<br><a href="%s">%s</a><br><br></li>',
     93                        '<li>%s - %s%s<a href="%s">%s</a></li>',
    8894                        esc_html( $start_date ),
    8995                        esc_html( $end_date ),
     96                        wp_kses_post( $date_title_separator ),
    9097                        esc_url( $link ),
    9198                        esc_html( get_the_title() )
     
    93100                } else {
    94101                    printf(
    95                         '<li>%s:<br><a href="%s">%s</a><br><br></li>',
     102                        '<li>%s%s<a href="%s">%s</a></li>',
    96103                        esc_html( $start_date ),
     104                        wp_kses_post( $date_title_separator ),
    97105                        esc_url( $link ),
    98106                        esc_html( get_the_title() )
     
    139147            </select>
    140148        </p>
     149        <p>
     150            <label for="<?php echo esc_attr( $this->get_field_id( 'sort_order' ) ); ?>"><?php esc_html_e( 'Sort order:', 'smntcs-simple-events-widget' ); ?></label>
     151            <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'sort_order' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'sort_order' ) ); ?>">
     152                <option <?php selected( $instance['sort_order'] ?? 'ASC', 'ASC' ); ?> value="ASC"><?php esc_html_e( 'Ascending (earliest first)', 'smntcs-simple-events-widget' ); ?></option>
     153                <option <?php selected( $instance['sort_order'] ?? 'ASC', 'DESC' ); ?> value="DESC"><?php esc_html_e( 'Descending (latest first)', 'smntcs-simple-events-widget' ); ?></option>
     154            </select>
     155        </p>
     156        <p>
     157            <input class="checkbox" type="checkbox" <?php checked( ! empty( $instance['date_title_line_break'] ) ); ?> id="<?php echo esc_attr( $this->get_field_id( 'date_title_line_break' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'date_title_line_break' ) ); ?>" value="1">
     158            <label for="<?php echo esc_attr( $this->get_field_id( 'date_title_line_break' ) ); ?>"><?php esc_html_e( 'Line break between date and title', 'smntcs-simple-events-widget' ); ?></label>
     159        </p>
    141160        <?php
    142161    }
     
    153172        $instance = $old_instance;
    154173
    155         $instance['title']          = strip_tags( $new_instance['title'] );
    156         $instance['display_events'] = strip_tags( $new_instance['display_events'] );
    157         $instance['display_dates']  = strip_tags( $new_instance['display_dates'] );
     174        $instance['title']          = wp_strip_all_tags( $new_instance['title'] );
     175        $instance['display_events'] = wp_strip_all_tags( $new_instance['display_events'] );
     176        $instance['display_dates']  = wp_strip_all_tags( $new_instance['display_dates'] );
     177
     178        $raw_sort                          = isset( $new_instance['sort_order'] ) ? strtoupper( wp_strip_all_tags( $new_instance['sort_order'] ) ) : 'ASC';
     179        $instance['sort_order']            = ( 'DESC' === $raw_sort ) ? 'DESC' : 'ASC';
     180        $instance['date_title_line_break'] = ! empty( $new_instance['date_title_line_break'] ) ? '1' : '';
    158181
    159182        return $instance;
  • smntcs-simple-events-widget/tags/2.5/includes/class-smntcs-simple-events.php

    r2994698 r3490507  
    1919     */
    2020    public function __construct() {
    21         add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
    22         add_filter( 'plugin_action_links_' . plugin_basename( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ), array( $this, 'plugin_settings_link' ) );
    23         add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
    24         add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
    25         add_action( 'save_post', array( $this, 'save_post' ) );
    26         add_action( 'widgets_init', array( $this, 'widgets_init' ) );
     21        add_action( 'plugins_loaded', [ $this, 'load_textdomain' ] );
     22        add_filter( 'plugin_action_links_' . plugin_basename( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ), [ $this, 'plugin_settings_link' ] );
     23        add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] );
     24        add_action( 'add_meta_boxes', [ $this, 'add_meta_boxes' ] );
     25        add_action( 'save_post', [ $this, 'save_post' ] );
     26        add_action( 'widgets_init', [ $this, 'widgets_init' ] );
    2727    }
    2828
     
    5757        $plugin_data = get_plugin_data( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE );
    5858        wp_enqueue_script( 'jquery-ui-datepicker' );
    59         wp_enqueue_script( 'smntcs-simple-events-script', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . 'js/custom.js', array( 'jquery' ), $plugin_data['Version'] );
    60         wp_enqueue_style( 'smntcs-simple-events-styles', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . '/js/jquery-ui.css', array(), $plugin_data['Version'] );
     59        wp_enqueue_script( 'smntcs-simple-events-script', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . 'js/custom.js', [ 'jquery' ], $plugin_data['Version'], true );
     60        wp_enqueue_style( 'smntcs-simple-events-styles', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . '/js/jquery-ui.css', [], $plugin_data['Version'] );
    6161    }
    6262
     
    6767     */
    6868    public function add_meta_boxes() {
    69         add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), array( $this, 'display_callback' ), 'post', 'side' );
    70         add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), array( $this, 'display_callback' ), 'page', 'side' );
     69        add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), [ $this, 'display_callback' ], 'post', 'side' );
     70        add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), [ $this, 'display_callback' ], 'page', 'side' );
     71
     72        // Add meta box for WooCommerce products if WooCommerce is active.
     73        if ( class_exists( 'WooCommerce' ) ) {
     74            add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), [ $this, 'display_callback' ], 'product', 'side' );
     75        }
    7176    }
    7277
     
    108113        // Check for nonce.
    109114        if ( ! isset( $_POST['smntcs_wpnonce'] ) ||
    110              ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['smntcs_wpnonce'] ) ), 'smntcs_add_simple_event' ) ) {
     115            ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['smntcs_wpnonce'] ) ), 'smntcs_add_simple_event' ) ) {
    111116            return;
    112117        }
     
    165170     */
    166171    public static function timestamp_to_date( $timestamp ) {
    167         return gmdate( 'd-m-Y', $timestamp );
     172        return date_i18n( get_option( 'date_format' ), $timestamp );
    168173    }
    169174}
  • smntcs-simple-events-widget/tags/2.5/smntcs-simple-events-widget.php

    r3260220 r3490507  
    33 * Plugin Name:           SMNTCS Simple Events Widget
    44 * Plugin URI:            https://github.com/nielslange/smntcs-simple-events-widget
    5  * Description:           Add meta box to posts and pages, to select event start and end date and show upcoming and previous events as sidebar widget.
     5 * Description:           Add event start and optional end dates on posts, pages, and WooCommerce products; list them in a customizable sidebar widget.
    66 * Author:                Niels Lange
    77 * Author URI:            https://nielslange.de
    88 * Text Domain:           smntcs-simple-events-widget
    9  * Version:               2.4
     9 * Version:               2.5
    1010 * Requires PHP:          7.4
    1111 * Requires at least:     3.4
  • smntcs-simple-events-widget/trunk/README.md

    r3260220 r3490507  
    1010![Tag Version](https://img.shields.io/github/tag/nielslange/smntcs-simple-events-widget.svg)
    1111
    12 Sidebar widget to show (upcoming and previous) events.
     12Add event dates to your content and list upcoming or past events in a classic sidebar widget.
     13
     14**SMNTCS Simple Events Widget** is a lightweight way to pin calendar dates to individual posts, pages, or WooCommerce products and show them in the sidebar when visitors browse your site.
     15
     16You pick a start date and, if you want, an end date, right in the editor. Then you drop the **Simple Events Widget** into a widget area and choose whether to show what is still ahead, what has already passed, or both. You can show only the start date or start and end together, change the sort order, add a line break before the title, and dates follow your site’s language and date format.
     17
     18- Event fields (with date picker) on posts, pages, and on products when WooCommerce is active
     19- Widget: upcoming events, previous events, or both
     20- Display start date only or start and end date
     21- Sort order and optional line break between date and title
     22- Classic WordPress widget—use **Customize → Widgets** or your theme’s widget regions
    1323
    1424## Installation
     
    19294. If wanted, also provide an end date of the event.
    20305. Go to `Customize » Widgets`, add the `Simple Events Widget` to the required sidebar.
    21 6. Adjust the widget settings according to you needs.
     316. Adjust the widget settings according to your needs.
    2232
    2333## Plugin page
     
    2636
    2737## Changelog
     38
     39### 2.5 (2025.03.25)
     40
     41- Tested up to WordPress 6.9
     42- Add widget options for event sort order and line break between date and title
     43- Use date_i18n for localized date output
     44- Include WooCommerce products when querying events
     45- Update Composer dev dependencies; replace phpcs.dist.xml with phpcs.xml; refresh GitHub Actions
    2846
    2947### 2.4 (2025.03.23)
  • smntcs-simple-events-widget/trunk/README.txt

    r3260220 r3490507  
    33Contributors:       nielslange
    44Tags:               Simple Events, Event, Widget, Sidebar
    5 Stable tag:         2.4
    6 Tested up to:       6.8
     5Stable tag:         2.5
     6Tested up to:       6.9
    77Requires at least:  3.4
    88Requires PHP:       7.4
     
    1010License URI:        https://www.gnu.org/licenses/gpl-2.0.html
    1111
    12 Sidebar widget to show (upcoming and previous) events.
     12Add event dates to your content and list upcoming or past events in a classic sidebar widget.
    1313
    1414== Description ==
    1515
    16 Sidebar widget to show (upcoming and previous) events.
     16SMNTCS Simple Events Widget is a lightweight way to pin calendar dates to individual posts, pages, or WooCommerce products and show them in the sidebar when visitors browse your site.
     17
     18You pick a start date and, if you want, an end date, right in the editor. Then you drop the *Simple Events Widget* into a widget area and decide whether to show what is still ahead, what has already passed, or both. You can show only the start date or start and end together, change the sort order, add a line break before the title, and dates respect your site’s language and date format.
     19
     20* Event fields (with date picker) on posts, pages, and on products when WooCommerce is active
     21* Widget: upcoming events, previous events, or both
     22* Display start date only or start and end date
     23* Sort order and optional line break between date and title
     24* Classic WordPress widget—place it under **Customize → Widgets** or in your theme’s widget regions
    1725
    1826== Installation ==
     
    23314. If wanted, also provide an end date of the event.
    24325. Go to `Customize » Widgets`, add the `Simple Events Widget` to the required sidebar.
    25 6. Adjust the widget settings according to you needs.
     336. Adjust the widget settings according to your needs.
    2634
    2735== Screenshots ==
     
    3240
    3341== Changelog ==
     42
     43= 2.5 (2025.03.25) =
     44
     45- Tested up to WordPress 6.9
     46- Add widget options for event sort order and line break between date and title
     47- Use date_i18n for localized date output
     48- Include WooCommerce products when querying events
     49- Update Composer dev dependencies; replace phpcs.dist.xml with phpcs.xml; refresh GitHub Actions
    3450
    3551= 2.4 (2025.03.23)
  • smntcs-simple-events-widget/trunk/composer.json

    r2651293 r3490507  
    44    "homepage": "https://wordpress.org/plugins/smntcs-simple-events-widget/",
    55    "type": "wordpress-plugin",
     6    "keywords": [
     7        "WordPress",
     8        "Plugin",
     9        "SMNTCS Simple Events Widget"
     10    ],
     11    "license": "GPL-2.0-or-later",
    612    "authors": [
    713        {
     
    1016        }
    1117    ],
    12     "require": {
    13         "php": ">=7.0"
    14     },
    1518    "require-dev": {
    1619        "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
     
    1821        "overtrue/phplint": "^2.3",
    1922        "phpcompatibility/phpcompatibility-wp": "^2.1",
    20         "squizlabs/php_codesniffer": "^3.6",
     23        "squizlabs/php_codesniffer": "^3.12",
    2124        "vimeo/psalm": "^4.7",
    22         "wp-coding-standards/wpcs": "^2.3"
     25        "wp-coding-standards/wpcs": "^3.1"
    2326    },
    2427    "scripts": {
    25         "phpcbf": "phpcbf --standard=phpcs.dist.xml .",
    26         "phpcs": "phpcs --standard=phpcs.dist.xml .",
     28        "phpcbf": "phpcbf --standard=phpcs.xml .",
     29        "phpcs": "phpcs --standard=phpcs.xml .",
    2730        "phplint": "phplint",
    2831        "psalm": "psalm --no-cache"
  • smntcs-simple-events-widget/trunk/composer.lock

    r3260220 r3490507  
    55        "This file is @generated automatically"
    66    ],
    7     "content-hash": "2b427520ede5ee7ebf10233fd6287850",
     7    "content-hash": "840ab54c03a0249cf4e53c3ee64886b4",
    88    "packages": [],
    99    "packages-dev": [
     
    581581        {
    582582            "name": "doctrine/deprecations",
    583             "version": "1.1.4",
     583            "version": "1.1.5",
    584584            "source": {
    585585                "type": "git",
    586586                "url": "https://github.com/doctrine/deprecations.git",
    587                 "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9"
    588             },
    589             "dist": {
    590                 "type": "zip",
    591                 "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9",
    592                 "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9",
     587                "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38"
     588            },
     589            "dist": {
     590                "type": "zip",
     591                "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
     592                "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
    593593                "shasum": ""
    594594            },
     
    596596                "php": "^7.1 || ^8.0"
    597597            },
    598             "require-dev": {
    599                 "doctrine/coding-standard": "^9 || ^12",
    600                 "phpstan/phpstan": "1.4.10 || 2.0.3",
     598            "conflict": {
     599                "phpunit/phpunit": "<=7.5 || >=13"
     600            },
     601            "require-dev": {
     602                "doctrine/coding-standard": "^9 || ^12 || ^13",
     603                "phpstan/phpstan": "1.4.10 || 2.1.11",
    601604                "phpstan/phpstan-phpunit": "^1.0 || ^2",
    602                 "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
     605                "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12",
    603606                "psr/log": "^1 || ^2 || ^3"
    604607            },
     
    620623            "support": {
    621624                "issues": "https://github.com/doctrine/deprecations/issues",
    622                 "source": "https://github.com/doctrine/deprecations/tree/1.1.4"
    623             },
    624             "time": "2024-12-07T21:18:45+00:00"
     625                "source": "https://github.com/doctrine/deprecations/tree/1.1.5"
     626            },
     627            "time": "2025-04-07T20:06:18+00:00"
    625628        },
    626629        {
     
    10951098        {
    10961099            "name": "php-stubs/wordpress-stubs",
    1097             "version": "v6.7.2",
     1100            "version": "v6.8.1",
    10981101            "source": {
    10991102                "type": "git",
    11001103                "url": "https://github.com/php-stubs/wordpress-stubs.git",
    1101                 "reference": "c04f96cb232fab12a3cbcccf5a47767f0665c3f4"
    1102             },
    1103             "dist": {
    1104                 "type": "zip",
    1105                 "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/c04f96cb232fab12a3cbcccf5a47767f0665c3f4",
    1106                 "reference": "c04f96cb232fab12a3cbcccf5a47767f0665c3f4",
    1107                 "shasum": ""
     1104                "reference": "92e444847d94f7c30f88c60004648f507688acd5"
     1105            },
     1106            "dist": {
     1107                "type": "zip",
     1108                "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/92e444847d94f7c30f88c60004648f507688acd5",
     1109                "reference": "92e444847d94f7c30f88c60004648f507688acd5",
     1110                "shasum": ""
     1111            },
     1112            "conflict": {
     1113                "phpdocumentor/reflection-docblock": "5.6.1"
    11081114            },
    11091115            "require-dev": {
    11101116                "dealerdirect/phpcodesniffer-composer-installer": "^1.0",
    1111                 "nikic/php-parser": "^4.13",
     1117                "nikic/php-parser": "^5.4",
    11121118                "php": "^7.4 || ^8.0",
    11131119                "php-stubs/generator": "^0.8.3",
    11141120                "phpdocumentor/reflection-docblock": "^5.4.1",
    1115                 "phpstan/phpstan": "^1.11",
     1121                "phpstan/phpstan": "^2.1",
    11161122                "phpunit/phpunit": "^9.5",
    11171123                "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.1.1",
     
    11371143            "support": {
    11381144                "issues": "https://github.com/php-stubs/wordpress-stubs/issues",
    1139                 "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.7.2"
    1140             },
    1141             "time": "2025-02-12T04:51:58+00:00"
     1145                "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.8.1"
     1146            },
     1147            "time": "2025-05-02T12:33:34+00:00"
    11421148        },
    11431149        {
     
    13901396        },
    13911397        {
     1398            "name": "phpcsstandards/phpcsextra",
     1399            "version": "1.3.0",
     1400            "source": {
     1401                "type": "git",
     1402                "url": "https://github.com/PHPCSStandards/PHPCSExtra.git",
     1403                "reference": "46d08eb86eec622b96c466adec3063adfed280dd"
     1404            },
     1405            "dist": {
     1406                "type": "zip",
     1407                "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/46d08eb86eec622b96c466adec3063adfed280dd",
     1408                "reference": "46d08eb86eec622b96c466adec3063adfed280dd",
     1409                "shasum": ""
     1410            },
     1411            "require": {
     1412                "php": ">=5.4",
     1413                "phpcsstandards/phpcsutils": "^1.0.9",
     1414                "squizlabs/php_codesniffer": "^3.12.1"
     1415            },
     1416            "require-dev": {
     1417                "php-parallel-lint/php-console-highlighter": "^1.0",
     1418                "php-parallel-lint/php-parallel-lint": "^1.3.2",
     1419                "phpcsstandards/phpcsdevcs": "^1.1.6",
     1420                "phpcsstandards/phpcsdevtools": "^1.2.1",
     1421                "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
     1422            },
     1423            "type": "phpcodesniffer-standard",
     1424            "extra": {
     1425                "branch-alias": {
     1426                    "dev-stable": "1.x-dev",
     1427                    "dev-develop": "1.x-dev"
     1428                }
     1429            },
     1430            "notification-url": "https://packagist.org/downloads/",
     1431            "license": [
     1432                "LGPL-3.0-or-later"
     1433            ],
     1434            "authors": [
     1435                {
     1436                    "name": "Juliette Reinders Folmer",
     1437                    "homepage": "https://github.com/jrfnl",
     1438                    "role": "lead"
     1439                },
     1440                {
     1441                    "name": "Contributors",
     1442                    "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors"
     1443                }
     1444            ],
     1445            "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.",
     1446            "keywords": [
     1447                "PHP_CodeSniffer",
     1448                "phpcbf",
     1449                "phpcodesniffer-standard",
     1450                "phpcs",
     1451                "standards",
     1452                "static analysis"
     1453            ],
     1454            "support": {
     1455                "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues",
     1456                "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy",
     1457                "source": "https://github.com/PHPCSStandards/PHPCSExtra"
     1458            },
     1459            "funding": [
     1460                {
     1461                    "url": "https://github.com/PHPCSStandards",
     1462                    "type": "github"
     1463                },
     1464                {
     1465                    "url": "https://github.com/jrfnl",
     1466                    "type": "github"
     1467                },
     1468                {
     1469                    "url": "https://opencollective.com/php_codesniffer",
     1470                    "type": "open_collective"
     1471                },
     1472                {
     1473                    "url": "https://thanks.dev/u/gh/phpcsstandards",
     1474                    "type": "thanks_dev"
     1475                }
     1476            ],
     1477            "time": "2025-04-20T23:35:32+00:00"
     1478        },
     1479        {
     1480            "name": "phpcsstandards/phpcsutils",
     1481            "version": "1.0.12",
     1482            "source": {
     1483                "type": "git",
     1484                "url": "https://github.com/PHPCSStandards/PHPCSUtils.git",
     1485                "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c"
     1486            },
     1487            "dist": {
     1488                "type": "zip",
     1489                "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c",
     1490                "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c",
     1491                "shasum": ""
     1492            },
     1493            "require": {
     1494                "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0",
     1495                "php": ">=5.4",
     1496                "squizlabs/php_codesniffer": "^3.10.0 || 4.0.x-dev@dev"
     1497            },
     1498            "require-dev": {
     1499                "ext-filter": "*",
     1500                "php-parallel-lint/php-console-highlighter": "^1.0",
     1501                "php-parallel-lint/php-parallel-lint": "^1.3.2",
     1502                "phpcsstandards/phpcsdevcs": "^1.1.6",
     1503                "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0"
     1504            },
     1505            "type": "phpcodesniffer-standard",
     1506            "extra": {
     1507                "branch-alias": {
     1508                    "dev-stable": "1.x-dev",
     1509                    "dev-develop": "1.x-dev"
     1510                }
     1511            },
     1512            "autoload": {
     1513                "classmap": [
     1514                    "PHPCSUtils/"
     1515                ]
     1516            },
     1517            "notification-url": "https://packagist.org/downloads/",
     1518            "license": [
     1519                "LGPL-3.0-or-later"
     1520            ],
     1521            "authors": [
     1522                {
     1523                    "name": "Juliette Reinders Folmer",
     1524                    "homepage": "https://github.com/jrfnl",
     1525                    "role": "lead"
     1526                },
     1527                {
     1528                    "name": "Contributors",
     1529                    "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors"
     1530                }
     1531            ],
     1532            "description": "A suite of utility functions for use with PHP_CodeSniffer",
     1533            "homepage": "https://phpcsutils.com/",
     1534            "keywords": [
     1535                "PHP_CodeSniffer",
     1536                "phpcbf",
     1537                "phpcodesniffer-standard",
     1538                "phpcs",
     1539                "phpcs3",
     1540                "standards",
     1541                "static analysis",
     1542                "tokens",
     1543                "utility"
     1544            ],
     1545            "support": {
     1546                "docs": "https://phpcsutils.com/",
     1547                "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues",
     1548                "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy",
     1549                "source": "https://github.com/PHPCSStandards/PHPCSUtils"
     1550            },
     1551            "funding": [
     1552                {
     1553                    "url": "https://github.com/PHPCSStandards",
     1554                    "type": "github"
     1555                },
     1556                {
     1557                    "url": "https://github.com/jrfnl",
     1558                    "type": "github"
     1559                },
     1560                {
     1561                    "url": "https://opencollective.com/php_codesniffer",
     1562                    "type": "open_collective"
     1563                }
     1564            ],
     1565            "time": "2024-05-20T13:34:27+00:00"
     1566        },
     1567        {
    13921568            "name": "phpdocumentor/reflection-common",
    13931569            "version": "2.2.0",
     
    14441620        {
    14451621            "name": "phpdocumentor/reflection-docblock",
    1446             "version": "5.6.1",
     1622            "version": "5.6.2",
    14471623            "source": {
    14481624                "type": "git",
    14491625                "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
    1450                 "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8"
    1451             },
    1452             "dist": {
    1453                 "type": "zip",
    1454                 "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",
    1455                 "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",
     1626                "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62"
     1627            },
     1628            "dist": {
     1629                "type": "zip",
     1630                "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/92dde6a5919e34835c506ac8c523ef095a95ed62",
     1631                "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62",
    14561632                "shasum": ""
    14571633            },
     
    15021678            "support": {
    15031679                "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
    1504                 "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1"
    1505             },
    1506             "time": "2024-12-07T09:39:29+00:00"
     1680                "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.2"
     1681            },
     1682            "time": "2025-04-13T19:20:35+00:00"
    15071683        },
    15081684        {
     
    17821958        {
    17831959            "name": "squizlabs/php_codesniffer",
    1784             "version": "3.12.0",
     1960            "version": "3.12.2",
    17851961            "source": {
    17861962                "type": "git",
    17871963                "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
    1788                 "reference": "2d1b63db139c3c6ea0c927698e5160f8b3b8d630"
    1789             },
    1790             "dist": {
    1791                 "type": "zip",
    1792                 "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/2d1b63db139c3c6ea0c927698e5160f8b3b8d630",
    1793                 "reference": "2d1b63db139c3c6ea0c927698e5160f8b3b8d630",
     1964                "reference": "6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa"
     1965            },
     1966            "dist": {
     1967                "type": "zip",
     1968                "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa",
     1969                "reference": "6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa",
    17941970                "shasum": ""
    17951971            },
     
    18622038                }
    18632039            ],
    1864             "time": "2025-03-18T05:04:51+00:00"
     2040            "time": "2025-04-13T04:10:18+00:00"
    18652041        },
    18662042        {
     
    20952271        {
    20962272            "name": "symfony/polyfill-ctype",
    2097             "version": "v1.31.0",
     2273            "version": "v1.32.0",
    20982274            "source": {
    20992275                "type": "git",
     
    21542330            ],
    21552331            "support": {
    2156                 "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
     2332                "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0"
    21572333            },
    21582334            "funding": [
     
    21742350        {
    21752351            "name": "symfony/polyfill-intl-grapheme",
    2176             "version": "v1.31.0",
     2352            "version": "v1.32.0",
    21772353            "source": {
    21782354                "type": "git",
     
    22322408            ],
    22332409            "support": {
    2234                 "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0"
     2410                "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0"
    22352411            },
    22362412            "funding": [
     
    22522428        {
    22532429            "name": "symfony/polyfill-intl-normalizer",
    2254             "version": "v1.31.0",
     2430            "version": "v1.32.0",
    22552431            "source": {
    22562432                "type": "git",
     
    23132489            ],
    23142490            "support": {
    2315                 "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0"
     2491                "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0"
    23162492            },
    23172493            "funding": [
     
    23332509        {
    23342510            "name": "symfony/polyfill-mbstring",
    2335             "version": "v1.31.0",
     2511            "version": "v1.32.0",
    23362512            "source": {
    23372513                "type": "git",
    23382514                "url": "https://github.com/symfony/polyfill-mbstring.git",
    2339                 "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341"
    2340             },
    2341             "dist": {
    2342                 "type": "zip",
    2343                 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341",
    2344                 "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341",
    2345                 "shasum": ""
    2346             },
    2347             "require": {
     2515                "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493"
     2516            },
     2517            "dist": {
     2518                "type": "zip",
     2519                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493",
     2520                "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493",
     2521                "shasum": ""
     2522            },
     2523            "require": {
     2524                "ext-iconv": "*",
    23482525                "php": ">=7.2"
    23492526            },
     
    23932570            ],
    23942571            "support": {
    2395                 "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0"
     2572                "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0"
    23962573            },
    23972574            "funding": [
     
    24092586                }
    24102587            ],
    2411             "time": "2024-09-09T11:45:10+00:00"
     2588            "time": "2024-12-23T08:48:59+00:00"
    24122589        },
    24132590        {
    24142591            "name": "symfony/polyfill-php73",
    2415             "version": "v1.31.0",
     2592            "version": "v1.32.0",
    24162593            "source": {
    24172594                "type": "git",
     
    24692646            ],
    24702647            "support": {
    2471                 "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0"
     2648                "source": "https://github.com/symfony/polyfill-php73/tree/v1.32.0"
    24722649            },
    24732650            "funding": [
     
    24892666        {
    24902667            "name": "symfony/polyfill-php80",
    2491             "version": "v1.31.0",
     2668            "version": "v1.32.0",
    24922669            "source": {
    24932670                "type": "git",
    24942671                "url": "https://github.com/symfony/polyfill-php80.git",
    2495                 "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"
    2496             },
    2497             "dist": {
    2498                 "type": "zip",
    2499                 "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
    2500                 "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
     2672                "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608"
     2673            },
     2674            "dist": {
     2675                "type": "zip",
     2676                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
     2677                "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
    25012678                "shasum": ""
    25022679            },
     
    25492726            ],
    25502727            "support": {
    2551                 "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0"
     2728                "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0"
    25522729            },
    25532730            "funding": [
     
    25652742                }
    25662743            ],
    2567             "time": "2024-09-09T11:45:10+00:00"
     2744            "time": "2025-01-02T08:10:11+00:00"
    25682745        },
    25692746        {
     
    27142891        {
    27152892            "name": "symfony/string",
    2716             "version": "v6.4.15",
     2893            "version": "v6.4.21",
    27172894            "source": {
    27182895                "type": "git",
    27192896                "url": "https://github.com/symfony/string.git",
    2720                 "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f"
    2721             },
    2722             "dist": {
    2723                 "type": "zip",
    2724                 "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f",
    2725                 "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f",
     2897                "reference": "73e2c6966a5aef1d4892873ed5322245295370c6"
     2898            },
     2899            "dist": {
     2900                "type": "zip",
     2901                "url": "https://api.github.com/repos/symfony/string/zipball/73e2c6966a5aef1d4892873ed5322245295370c6",
     2902                "reference": "73e2c6966a5aef1d4892873ed5322245295370c6",
    27262903                "shasum": ""
    27272904            },
     
    27802957            ],
    27812958            "support": {
    2782                 "source": "https://github.com/symfony/string/tree/v6.4.15"
     2959                "source": "https://github.com/symfony/string/tree/v6.4.21"
    27832960            },
    27842961            "funding": [
     
    27962973                }
    27972974            ],
    2798             "time": "2024-11-13T13:31:12+00:00"
     2975            "time": "2025-04-18T15:23:29+00:00"
    27992976        },
    28002977        {
     
    30923269        {
    30933270            "name": "wp-coding-standards/wpcs",
    3094             "version": "2.3.0",
     3271            "version": "3.1.0",
    30953272            "source": {
    30963273                "type": "git",
    30973274                "url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
    3098                 "reference": "7da1894633f168fe244afc6de00d141f27517b62"
    3099             },
    3100             "dist": {
    3101                 "type": "zip",
    3102                 "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62",
    3103                 "reference": "7da1894633f168fe244afc6de00d141f27517b62",
    3104                 "shasum": ""
    3105             },
    3106             "require": {
     3275                "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7"
     3276            },
     3277            "dist": {
     3278                "type": "zip",
     3279                "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/9333efcbff231f10dfd9c56bb7b65818b4733ca7",
     3280                "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7",
     3281                "shasum": ""
     3282            },
     3283            "require": {
     3284                "ext-filter": "*",
     3285                "ext-libxml": "*",
     3286                "ext-tokenizer": "*",
     3287                "ext-xmlreader": "*",
    31073288                "php": ">=5.4",
    3108                 "squizlabs/php_codesniffer": "^3.3.1"
    3109             },
    3110             "require-dev": {
    3111                 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6",
     3289                "phpcsstandards/phpcsextra": "^1.2.1",
     3290                "phpcsstandards/phpcsutils": "^1.0.10",
     3291                "squizlabs/php_codesniffer": "^3.9.0"
     3292            },
     3293            "require-dev": {
     3294                "php-parallel-lint/php-console-highlighter": "^1.0.0",
     3295                "php-parallel-lint/php-parallel-lint": "^1.3.2",
    31123296                "phpcompatibility/php-compatibility": "^9.0",
    3113                 "phpcsstandards/phpcsdevtools": "^1.0",
    3114                 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
     3297                "phpcsstandards/phpcsdevtools": "^1.2.0",
     3298                "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
    31153299            },
    31163300            "suggest": {
    3117                 "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
     3301                "ext-iconv": "For improved results",
     3302                "ext-mbstring": "For improved results"
    31183303            },
    31193304            "type": "phpcodesniffer-standard",
     
    31323317                "phpcs",
    31333318                "standards",
     3319                "static analysis",
    31343320                "wordpress"
    31353321            ],
     
    31393325                "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki"
    31403326            },
    3141             "time": "2020-05-13T23:57:56+00:00"
     3327            "funding": [
     3328                {
     3329                    "url": "https://opencollective.com/php_codesniffer",
     3330                    "type": "custom"
     3331                }
     3332            ],
     3333            "time": "2024-03-25T16:39:00+00:00"
    31423334        },
    31433335        {
    31443336            "name": "wp-hooks/wordpress-core",
    3145             "version": "1.9.0",
     3337            "version": "1.10.0",
    31463338            "source": {
    31473339                "type": "git",
    31483340                "url": "https://github.com/wp-hooks/wordpress-core-hooks.git",
    3149                 "reference": "8cc9adaf9a87670ac434d440eb66d06d65ec215c"
    3150             },
    3151             "dist": {
    3152                 "type": "zip",
    3153                 "url": "https://api.github.com/repos/wp-hooks/wordpress-core-hooks/zipball/8cc9adaf9a87670ac434d440eb66d06d65ec215c",
    3154                 "reference": "8cc9adaf9a87670ac434d440eb66d06d65ec215c",
     3341                "reference": "127af21a918a52bcead7ce9b743b17b5d64eb148"
     3342            },
     3343            "dist": {
     3344                "type": "zip",
     3345                "url": "https://api.github.com/repos/wp-hooks/wordpress-core-hooks/zipball/127af21a918a52bcead7ce9b743b17b5d64eb148",
     3346                "reference": "127af21a918a52bcead7ce9b743b17b5d64eb148",
    31553347                "shasum": ""
    31563348            },
     
    31623354                "oomphinc/composer-installers-extender": "^2",
    31633355                "roots/wordpress-core-installer": "^1.0.0",
    3164                 "roots/wordpress-full": "6.7",
     3356                "roots/wordpress-full": "6.8",
    31653357                "wp-hooks/generator": "1.0.0"
    31663358            },
     
    32133405            "support": {
    32143406                "issues": "https://github.com/wp-hooks/wordpress-core-hooks/issues",
    3215                 "source": "https://github.com/wp-hooks/wordpress-core-hooks/tree/1.9.0"
     3407                "source": "https://github.com/wp-hooks/wordpress-core-hooks/tree/1.10.0"
    32163408            },
    32173409            "funding": [
     
    32213413                }
    32223414            ],
    3223             "time": "2024-12-04T23:00:43+00:00"
     3415            "time": "2025-04-16T22:20:41+00:00"
    32243416        }
    32253417    ],
     
    32293421    "prefer-stable": false,
    32303422    "prefer-lowest": false,
    3231     "platform": {
    3232         "php": ">=7.0"
    3233     },
     3423    "platform": {},
    32343424    "platform-dev": {},
    32353425    "plugin-api-version": "2.6.0"
  • smntcs-simple-events-widget/trunk/includes/class-smntcs-simple-events-widget.php

    r3260220 r3490507  
    1919     */
    2020    public function __construct() {
    21         $widget_options = array(
     21        $widget_options = [
    2222            'classname'   => 'smntcs_simple_events_widget',
    2323            'description' => 'Display Simple Events Widget',
    24         );
     24        ];
    2525        parent::__construct( 'smntcs_simple_events_widget', 'Simple Events Widget', $widget_options );
    2626    }
     
    3333     */
    3434    public function widget( $args, $instance ) {
    35         $title     = apply_filters( 'widget_title', $instance['title'] );
    36         $timestamp = current_time( 'timestamp' );
     35        $title = apply_filters( 'widget_title', $instance['title'] );
     36        // Event meta is stored as UTC Unix timestamps; compare using the current instant.
     37        $timestamp = time();
     38
     39        $sort_order = isset( $instance['sort_order'] ) && 'DESC' === $instance['sort_order'] ? 'DESC' : 'ASC';
    3740
    3841        echo wp_kses_post( $args['before_widget'] );
     
    4144        }
    4245
    43         $query_args = array(
    44             'post_type' => array( 'post', 'page' ),
    45             'meta_key'  => 'datepicker_start',
    46             'orderby'   => 'meta_value',
    47             'order'     => 'DESC',
    48         );
     46        $query_args = [
     47            'post_type'      => [ 'post', 'page', 'product' ],
     48            'meta_key'       => 'datepicker_start',
     49            'orderby'        => 'meta_value',
     50            'order'          => $sort_order,
     51            'meta_type'      => 'NUMERIC',
     52            'posts_per_page' => -1,
     53        ];
    4954
    5055        if ( 'upcoming-events' === $instance['display_events'] ) {
    51             $query_args['meta_query'] = array(
    52                 array(
     56            $query_args['meta_query'] = [
     57                [
    5358                    'key'     => 'datepicker_start',
    5459                    'value'   => $timestamp,
    5560                    'compare' => '>=',
    5661                    'type'    => 'NUMERIC',
    57                 ),
    58             );
     62                ],
     63            ];
    5964        }
    6065
    6166        if ( 'previous-events' === $instance['display_events'] ) {
    62             $query_args['meta_query'] = array(
    63                 array(
     67            $query_args['meta_query'] = [
     68                [
    6469                    'key'     => 'datepicker_start',
    6570                    'value'   => $timestamp,
    6671                    'compare' => '<',
    6772                    'type'    => 'NUMERIC',
    68                 ),
    69             );
     73                ],
     74            ];
    7075        }
    7176
    7277        $the_query = new WP_Query( $query_args );
     78
     79        $date_title_separator = ! empty( $instance['date_title_line_break'] ) ? ': <br />' : ': ';
    7380
    7481        if ( $the_query->have_posts() ) {
     
    7784                $the_query->the_post();
    7885                $start_date_meta = get_post_meta( get_the_ID(), 'datepicker_start', true );
    79                 $start_date      = $start_date_meta ? gmdate( get_option( 'date_format' ), intval( $start_date_meta ) ) : __( 'No start date', 'smntcs-simple-events-widget' );
     86                $start_date      = $start_date_meta ? date_i18n( get_option( 'date_format' ), intval( $start_date_meta ), true ) : __( 'No start date', 'smntcs-simple-events-widget' );
    8087                $end_date_meta   = get_post_meta( get_the_ID(), 'datepicker_end', true );
    81                 $end_date        = $end_date_meta ? gmdate( get_option( 'date_format' ), intval( $end_date_meta ) ) : __( 'No end date', 'smntcs-simple-events-widget' );
    82 
    83                 $link = get_permalink();
     88                $end_date        = $end_date_meta ? date_i18n( get_option( 'date_format' ), intval( $end_date_meta ), true ) : __( 'No end date', 'smntcs-simple-events-widget' );
     89                $link            = get_permalink();
    8490
    8591                if ( 'start-and-end-date' === $instance['display_dates'] ) {
    8692                    printf(
    87                         '<li>%s - %s:<br><a href="%s">%s</a><br><br></li>',
     93                        '<li>%s - %s%s<a href="%s">%s</a></li>',
    8894                        esc_html( $start_date ),
    8995                        esc_html( $end_date ),
     96                        wp_kses_post( $date_title_separator ),
    9097                        esc_url( $link ),
    9198                        esc_html( get_the_title() )
     
    93100                } else {
    94101                    printf(
    95                         '<li>%s:<br><a href="%s">%s</a><br><br></li>',
     102                        '<li>%s%s<a href="%s">%s</a></li>',
    96103                        esc_html( $start_date ),
     104                        wp_kses_post( $date_title_separator ),
    97105                        esc_url( $link ),
    98106                        esc_html( get_the_title() )
     
    139147            </select>
    140148        </p>
     149        <p>
     150            <label for="<?php echo esc_attr( $this->get_field_id( 'sort_order' ) ); ?>"><?php esc_html_e( 'Sort order:', 'smntcs-simple-events-widget' ); ?></label>
     151            <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'sort_order' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'sort_order' ) ); ?>">
     152                <option <?php selected( $instance['sort_order'] ?? 'ASC', 'ASC' ); ?> value="ASC"><?php esc_html_e( 'Ascending (earliest first)', 'smntcs-simple-events-widget' ); ?></option>
     153                <option <?php selected( $instance['sort_order'] ?? 'ASC', 'DESC' ); ?> value="DESC"><?php esc_html_e( 'Descending (latest first)', 'smntcs-simple-events-widget' ); ?></option>
     154            </select>
     155        </p>
     156        <p>
     157            <input class="checkbox" type="checkbox" <?php checked( ! empty( $instance['date_title_line_break'] ) ); ?> id="<?php echo esc_attr( $this->get_field_id( 'date_title_line_break' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'date_title_line_break' ) ); ?>" value="1">
     158            <label for="<?php echo esc_attr( $this->get_field_id( 'date_title_line_break' ) ); ?>"><?php esc_html_e( 'Line break between date and title', 'smntcs-simple-events-widget' ); ?></label>
     159        </p>
    141160        <?php
    142161    }
     
    153172        $instance = $old_instance;
    154173
    155         $instance['title']          = strip_tags( $new_instance['title'] );
    156         $instance['display_events'] = strip_tags( $new_instance['display_events'] );
    157         $instance['display_dates']  = strip_tags( $new_instance['display_dates'] );
     174        $instance['title']          = wp_strip_all_tags( $new_instance['title'] );
     175        $instance['display_events'] = wp_strip_all_tags( $new_instance['display_events'] );
     176        $instance['display_dates']  = wp_strip_all_tags( $new_instance['display_dates'] );
     177
     178        $raw_sort                          = isset( $new_instance['sort_order'] ) ? strtoupper( wp_strip_all_tags( $new_instance['sort_order'] ) ) : 'ASC';
     179        $instance['sort_order']            = ( 'DESC' === $raw_sort ) ? 'DESC' : 'ASC';
     180        $instance['date_title_line_break'] = ! empty( $new_instance['date_title_line_break'] ) ? '1' : '';
    158181
    159182        return $instance;
  • smntcs-simple-events-widget/trunk/includes/class-smntcs-simple-events.php

    r2994698 r3490507  
    1919     */
    2020    public function __construct() {
    21         add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
    22         add_filter( 'plugin_action_links_' . plugin_basename( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ), array( $this, 'plugin_settings_link' ) );
    23         add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
    24         add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
    25         add_action( 'save_post', array( $this, 'save_post' ) );
    26         add_action( 'widgets_init', array( $this, 'widgets_init' ) );
     21        add_action( 'plugins_loaded', [ $this, 'load_textdomain' ] );
     22        add_filter( 'plugin_action_links_' . plugin_basename( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ), [ $this, 'plugin_settings_link' ] );
     23        add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] );
     24        add_action( 'add_meta_boxes', [ $this, 'add_meta_boxes' ] );
     25        add_action( 'save_post', [ $this, 'save_post' ] );
     26        add_action( 'widgets_init', [ $this, 'widgets_init' ] );
    2727    }
    2828
     
    5757        $plugin_data = get_plugin_data( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE );
    5858        wp_enqueue_script( 'jquery-ui-datepicker' );
    59         wp_enqueue_script( 'smntcs-simple-events-script', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . 'js/custom.js', array( 'jquery' ), $plugin_data['Version'] );
    60         wp_enqueue_style( 'smntcs-simple-events-styles', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . '/js/jquery-ui.css', array(), $plugin_data['Version'] );
     59        wp_enqueue_script( 'smntcs-simple-events-script', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . 'js/custom.js', [ 'jquery' ], $plugin_data['Version'], true );
     60        wp_enqueue_style( 'smntcs-simple-events-styles', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . '/js/jquery-ui.css', [], $plugin_data['Version'] );
    6161    }
    6262
     
    6767     */
    6868    public function add_meta_boxes() {
    69         add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), array( $this, 'display_callback' ), 'post', 'side' );
    70         add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), array( $this, 'display_callback' ), 'page', 'side' );
     69        add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), [ $this, 'display_callback' ], 'post', 'side' );
     70        add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), [ $this, 'display_callback' ], 'page', 'side' );
     71
     72        // Add meta box for WooCommerce products if WooCommerce is active.
     73        if ( class_exists( 'WooCommerce' ) ) {
     74            add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), [ $this, 'display_callback' ], 'product', 'side' );
     75        }
    7176    }
    7277
     
    108113        // Check for nonce.
    109114        if ( ! isset( $_POST['smntcs_wpnonce'] ) ||
    110              ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['smntcs_wpnonce'] ) ), 'smntcs_add_simple_event' ) ) {
     115            ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['smntcs_wpnonce'] ) ), 'smntcs_add_simple_event' ) ) {
    111116            return;
    112117        }
     
    165170     */
    166171    public static function timestamp_to_date( $timestamp ) {
    167         return gmdate( 'd-m-Y', $timestamp );
     172        return date_i18n( get_option( 'date_format' ), $timestamp );
    168173    }
    169174}
  • smntcs-simple-events-widget/trunk/smntcs-simple-events-widget.php

    r3260220 r3490507  
    33 * Plugin Name:           SMNTCS Simple Events Widget
    44 * Plugin URI:            https://github.com/nielslange/smntcs-simple-events-widget
    5  * Description:           Add meta box to posts and pages, to select event start and end date and show upcoming and previous events as sidebar widget.
     5 * Description:           Add event start and optional end dates on posts, pages, and WooCommerce products; list them in a customizable sidebar widget.
    66 * Author:                Niels Lange
    77 * Author URI:            https://nielslange.de
    88 * Text Domain:           smntcs-simple-events-widget
    9  * Version:               2.4
     9 * Version:               2.5
    1010 * Requires PHP:          7.4
    1111 * Requires at least:     3.4
Note: See TracChangeset for help on using the changeset viewer.