Plugin Directory

Changeset 3488727


Ignore:
Timestamp:
03/23/2026 09:03:25 AM (5 days ago)
Author:
PierreLannoy
Message:

DecaLog 4.6.0 released from GitHub

Location:
decalog
Files:
2 added
22 edited
1 copied

Legend:

Unmodified
Added
Removed
  • decalog/tags/4.6.0/CHANGELOG.md

    r3404120 r3488727  
    44The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and **DecaLog** adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
    55
     6## [4.6.0] - 2026-03-23
     7
     8### Added
     9- New logger to send events to OpenSearch.
     10- Compatibility with WordPress 7.0.
     11
     12### Changed
     13- Minimal requirements are now PHP 8.2 and WordPress 6.4.
     14- Some strings in `readme.txt` have been updated.
     15
     16### Removed
     17- Compatibility with PHP 8.1.
     18- Compatibility with WordPress 6.2 & 6.3.
     19
     20### Fixed
     21- [SEC005] Authenticated (Admininistrator+) SQL Injection via the `logid` parameter similar to [CVE-2026-2831](https://www.cve.org/CVERecord?id=CVE-2026-2831).
     22- Some typos in libraries acknowledgement.
     23
    624## [4.5.0] - 2025-11-27
    725
     
    1230- [BC] Default PHP errors mapping has changed: now, `E_USER_NOTICE`, `E_STRICT` and `E_USER_DEPRECATED` are logged as `debug` events.
    1331- [BC] Some Action Scheduler events have a lower level (thanks to [Jan Thiel](https://github.com/JanThiel)).
    14 - [WP-CLI] Using `--quiet` now disables logging of events that are not errors. (thanks to [Jan Thiel](https://github.com/JanThiel)).
     32- [WP-CLI] Using `--quiet` now disables logging of events that are not errors (thanks to [Jan Thiel](https://github.com/JanThiel)).
    1533- The levels of `pre_clear_scheduled_hook` are now debug/info to prevent excessive noise.
    1634- The level mapping is now usable earlyer while logging PHP errors (thanks to [s.protasov](https://github.com/pro2s)).
  • decalog/tags/4.6.0/admin/class-decalog-admin.php

    r3404120 r3488727  
    161161        $this->current_view = null;
    162162        add_action( 'load-' . $hook_suffix, [ new InlineHelp(), 'set_contextual_viewer' ] );
    163         $logid   = filter_input( INPUT_GET, 'logid', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
    164         $eventid = filter_input( INPUT_GET, 'eventid', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
    165         $traceid = filter_input( INPUT_GET, 'traceid', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
     163        $logid   = UUID::sanitize_v4( filter_input( INPUT_GET, 'logid', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) );
     164        $eventid = (int) filter_input( INPUT_GET, 'eventid', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
     165        $traceid = (int) filter_input( INPUT_GET, 'traceid', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
    166166        if ( 'decalog-viewer' === filter_input( INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ) {
    167167            if ( isset( $logid ) && isset( $eventid ) && 0 !== $eventid ) {
  • decalog/tags/4.6.0/admin/partials/decalog-admin-settings-about.php

    r3195163 r3488727  
    3333$intro      = sprintf( decalog_esc_html__( '%1$s is a free and open source plugin for WordPress. It integrates other free and open source works (as-is or modified) like: %2$s.', 'decalog' ), '<em>' . DECALOG_PRODUCT_NAME . '</em>', do_shortcode( '[decalog-libraries]' ) );
    3434$trademarks = decalog_esc_html__( 'All brands, icons and graphic illustrations are registered trademarks of their respective owners.', 'decalog' );
    35 $brands     = [ 'Automattic', 'Bugsnag', 'Datadog', 'Elastic Cloud', 'Fluentd Project', 'Functional Software', 'Grafana Labs', 'Google', 'Hosterra', 'InfluxData', 'Nette Foundation', 'New Relic', 'Open Zipkin', 'PagerDuty', 'Pushover', 'Rapid7', 'Raygun', 'Sematext', 'Slack', 'Solarwinds', 'Spatie', 'Sumo Logic', 'The Linux Foundation', 'Uber' ];
     35$brands     = [ 'Automattic', 'Bugsnag', 'Datadog', 'Elastic Cloud', 'Fluentd Project', 'Functional Software', 'Grafana Labs', 'Google', 'Hosterra', 'InfluxData', 'Nette Foundation', 'New Relic', 'Open Zipkin', 'PagerDuty', 'Pushover', 'Rapid7', 'Raygun', 'Sematext', 'Slack', 'Solarwinds', 'Spatie', 'Sumo Logic', 'The Linux Foundation', 'The OpenSearch Software Foundation','Uber' ];
    3636$official   = sprintf( decalog_esc_html__( 'This plugin is not an official software from %s and, as such, is not endorsed or supported by these companies.', 'decalog' ), implode( ', ', $brands ) );
    3737
  • decalog/tags/4.6.0/decalog.php

    r3404120 r3488727  
    1111 * Plugin URI:        https://perfops.one/decalog
    1212 * Description:       Capture and log events, metrics and traces on your site. Make WordPress observable – finally!
    13  * Version:           4.5.0
    14  * Requires at least: 6.2
    15  * Requires PHP:      8.1
     13 * Version:           4.6.0
     14 * Requires at least: 6.4
     15 * Requires PHP:      8.2
    1616 * Author:            Pierre Lannoy / PerfOps One
    1717 * Author URI:        https://perfops.one
  • decalog/tags/4.6.0/includes/features/class-handlertypes.php

    r3195163 r3488727  
    16701670            ],
    16711671        ];
     1672
     1673
    16721674        $this->handlers[] = [
    16731675            'version'       => DECALOG_VERSION,
     
    16791681            'help'          => decalog_esc_html__( 'Events sent to Elasticsearch.', 'decalog' ),
    16801682            'icon'          => $this->get_base64_elasticsearch_icon(),
     1683            'needs'         => [],
     1684            'params'        => [ 'processors', 'privacy' ],
     1685            'configuration' => [
     1686                'url'   => [
     1687                    'type'    => 'string',
     1688                    'show'    => true,
     1689                    'name'    => decalog_esc_html__( 'Service URL', 'decalog' ),
     1690                    'help'    => sprintf( decalog_esc_html__( 'URL where to send logs. Format: %s.', 'decalog' ), '<code>' . htmlentities( '<proto>://<host>:<port>' ) . '</code>' ) . $this->get_substitution_note(),
     1691                    'default' => 'http://localhost:9200',
     1692                    'control' => [
     1693                        'type'    => 'field_input_text',
     1694                        'cast'    => 'string',
     1695                        'enabled' => true,
     1696                    ],
     1697                ],
     1698                'user'  => [
     1699                    'type'    => 'string',
     1700                    'show'    => true,
     1701                    'name'    => decalog_esc_html__( 'Username', 'decalog' ),
     1702                    'help'    => decalog_esc_html__( 'The username of the instance.', 'decalog' ) . $this->get_substitution_note(),
     1703                    'default' => '',
     1704                    'control' => [
     1705                        'type'    => 'field_input_text',
     1706                        'cast'    => 'string',
     1707                        'enabled' => true,
     1708                    ],
     1709                ],
     1710                'pass'  => [
     1711                    'type'    => 'string',
     1712                    'show'    => true,
     1713                    'name'    => decalog_esc_html__( 'Password', 'decalog' ),
     1714                    'help'    => decalog_esc_html__( 'The password of the instance.', 'decalog' ) . $this->get_substitution_note(),
     1715                    'default' => '',
     1716                    'control' => [
     1717                        'type'    => 'field_input_text',
     1718                        'cast'    => 'string',
     1719                        'enabled' => true,
     1720                    ],
     1721                ],
     1722                'index' => [
     1723                    'type'    => 'string',
     1724                    'show'    => true,
     1725                    'name'    => decalog_esc_html__( 'Index', 'decalog' ),
     1726                    'help'    => decalog_esc_html__( 'The index name.', 'decalog' ) . $this->get_substitution_note(),
     1727                    'default' => 'decalog',
     1728                    'control' => [
     1729                        'type'    => 'field_input_text',
     1730                        'cast'    => 'string',
     1731                        'enabled' => true,
     1732                    ],
     1733                ],
     1734                'extended' => [
     1735                    'type'    => 'string',
     1736                    'show'    => true,
     1737                    'name'    => decalog_esc_html__( 'Extended fields', 'decalog' ),
     1738                    'help'    => decalog_esc_html__( 'Fields to add to each logged event (one pair of key=value per line).', 'decalog' ) . '<br/>' . decalog_esc_html__( 'Example:', 'decalog' ) . ' <code>hostname={HOSTNAME}</code> ' . decalog_esc_html__( 'or', 'decalog' ) . ' <code>foo=bar</code> ' . decalog_esc_html__( 'or', 'decalog' ) . ' <code>foobar=42</code>.' . $this->get_substitution_note(),
     1739                    'default' => '',
     1740                    'control' => [
     1741                        'type'    => 'field_input_textarea',
     1742                        'cast'    => 'string',
     1743                        'enabled' => true,
     1744                        'columns' => 50,
     1745                        'lines'   => 5,
     1746                    ],
     1747                ],
     1748            ],
     1749            'init'          => [
     1750                [
     1751                    'type'  => 'configuration',
     1752                    'value' => 'url',
     1753                ],
     1754                [
     1755                    'type'  => 'configuration',
     1756                    'value' => 'user',
     1757                ],
     1758                [
     1759                    'type'  => 'configuration',
     1760                    'value' => 'pass',
     1761                ],
     1762                [
     1763                    'type'  => 'configuration',
     1764                    'value' => 'index',
     1765                ],
     1766                [
     1767                    'type'  => 'configuration',
     1768                    'value' => 'extended',
     1769                ],
     1770                [ 'type' => 'level' ],
     1771                [
     1772                    'type'  => 'literal',
     1773                    'value' => true,
     1774                ],
     1775            ],
     1776        ];
     1777
     1778
     1779        $this->handlers[] = [
     1780            'version'       => DECALOG_VERSION,
     1781            'id'            => 'OpensearchHandler',
     1782            'namespace'     => 'Decalog\\Handler',
     1783            'class'         => 'logging',
     1784            'minimal'       => Logger::DEBUG,
     1785            'name'          => 'OpenSearch - Events',
     1786            'help'          => decalog_esc_html__( 'Events sent to OpenSearch.', 'decalog' ),
     1787            'icon'          => $this->get_base64_opensearch_icon(),
    16811788            'needs'         => [],
    16821789            'params'        => [ 'processors', 'privacy' ],
     
    38213928        $source .= '<defs><circle id="SVGID_1_" cx="40" cy="40" r="32"/></defs><clipPath id="SVGID_2_"><use xlink:href="#SVGID_1_" overflow="visible"/></clipPath><path class="st0" d="M53.7 26H10c-1.1 0-2-.9-2-2V10c0-1.1.9-2 2-2h57c1.1 0 2 .9 2 2v.7C68.9 19.1 62.1 26 53.7 26z"/><defs><circle id="SVGID_3_" cx="40" cy="40" r="32"/></defs><clipPath id="SVGID_4_"><use xlink:href="#SVGID_3_" overflow="visible"/></clipPath><path class="st1" d="M69.1 72H8.2V54h45.7c8.4 0 15.2 6.8 15.2 15.2V72z"/><g><defs><circle id="SVGID_5_" cx="40" cy="40" r="32"/></defs><clipPath id="SVGID_6_"><use xlink:href="#SVGID_5_" overflow="visible"/></clipPath><path class="st2" d="M50.1 49H4.8V31h45.3c5 0 9 4 9 9s-4.1 9-9 9z"/></g><g><defs><circle id="SVGID_7_" cx="40" cy="40" r="32"/></defs><clipPath id="SVGID_8_"><use xlink:href="#SVGID_7_" overflow="visible"/></clipPath><path class="st3" d="M36 31H6.4v18H36c.7-2.7 1.1-5.7 1.1-9s-.4-6.3-1.1-9z"/></g><path class="st4" d="M23.9 12.3c-5.4 3.2-9.9 8-12.7 13.7h23.6c-2.4-5.5-6.2-10.1-10.9-13.7z"/><path class="st5" d="M24.9 68.2c4.6-3.7 8.3-8.6 10.6-14.2H11.2c3 6 7.8 11 13.7 14.2z"/><path class="st6" d="M0 0h80v80H0z"/>';
    38223929        $source .= '</svg>';
     3930        // phpcs:ignore
     3931        return 'data:image/svg+xml;base64,' . base64_encode( $source );
     3932    }
     3933
     3934    /**
     3935     * Returns a base64 svg resource for the OpenSearch icon.
     3936     *
     3937     * @param string $color1 Optional. Color of the icon.
     3938     * @param string $color2 Optional. Color of the icon.
     3939     * @param string $color3 Optional. Color of the icon.
     3940     * @param string $color4 Optional. Color of the icon.
     3941     * @param string $color5 Optional. Color of the icon.
     3942     * @param string $color6 Optional. Color of the icon.
     3943     * @return string The svg resource as a base64.
     3944     * @since 4.6.0
     3945     */
     3946    private function get_base64_opensearch_icon( $color1 = '#005EB8', $color2 = '#003B5C' ) {
     3947        $source  = '<svg viewBox="-8 -8 78 78" fill="none" xmlns="http://www.w3.org/2000/svg">';
     3948        $source  .= '<path d="M61.7374 23.5C60.4878 23.5 59.4748 24.513 59.4748 25.7626C59.4748 44.3813 44.3813 59.4748 25.7626 59.4748C24.513 59.4748 23.5 60.4878 23.5 61.7374C23.5 62.987 24.513 64 25.7626 64C46.8805 64 64 46.8805 64 25.7626C64 24.513 62.987 23.5 61.7374 23.5Z" fill="' . $color1 . '"/>';
     3949        $source  .= '<path d="M48.0814 38C50.2572 34.4505 52.3615 29.7178 51.9475 23.0921C51.0899 9.36725 38.6589 -1.04463 26.9206 0.0837327C22.3253 0.525465 17.6068 4.2712 18.026 10.9805C18.2082 13.8961 19.6352 15.6169 21.9544 16.9399C24.1618 18.1992 26.9978 18.9969 30.2128 19.9011C34.0962 20.9934 38.6009 22.2203 42.063 24.7717C46.2125 27.8295 49.0491 31.3743 48.0814 38Z" fill="' . $color2 . '"/>';
     3950        $source  .= '<path d="M3.91861 14C1.74276 17.5495 -0.361506 22.2822 0.0524931 28.9079C0.910072 42.6327 13.3411 53.0446 25.0794 51.9163C29.6747 51.4745 34.3932 47.7288 33.974 41.0195C33.7918 38.1039 32.3647 36.3831 30.0456 35.0601C27.8382 33.8008 25.0022 33.0031 21.7872 32.0989C17.9038 31.0066 13.3991 29.7797 9.93694 27.2283C5.78746 24.1704 2.95092 20.6257 3.91861 14Z" fill="' . $color1 . '"/>';
     3951        $source  .= '</svg>';
    38233952        // phpcs:ignore
    38243953        return 'data:image/svg+xml;base64,' . base64_encode( $source );
  • decalog/tags/4.6.0/includes/features/class-inlinehelp.php

    r3195163 r3488727  
    1616use Decalog\System\Markdown;
    1717use Decalog\System\Role;
     18use Decalog\System\UUID;
    1819
    1920/**
     
    9495        if ( ! ( $this->trace_id = filter_input( INPUT_GET, 'traceid', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ) ) {
    9596            $this->trace_id = filter_input( INPUT_POST, 'traceid', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
     97        }
     98        if ( $this->log_id ) {
     99            $this->log_id = UUID::sanitize_v4( $this->log_id );
     100        }
     101        if ( $this->event_id ) {
     102            $this->event_id = (int) $this->event_id ;
     103        }
     104        if ( $this->trace_id ) {
     105            $this->trace_id = (int) $this->trace_id ;
    96106        }
    97107    }
  • decalog/tags/4.6.0/includes/handlers/class-elastichandler.php

    r3085475 r3488727  
    5252        }
    5353        $index   = strtolower( str_replace( [ ' ' ], '-', sanitize_text_field( $index ) ) );
    54         $client  = \Elastic\Elasticsearch\ClientBuilder::create()->setHosts( [ $url ] )->setBasicAuthentication( $user, $pass )->build();
     54        $client  = \Elastic\Elasticsearch\ClientBuilder::create()->setHosts( [ $url ] )->setSSLVerification(false)->setBasicAuthentication( $user, $pass )->build();
    5555        $options = [
    5656            'index' => $index
  • decalog/tags/4.6.0/includes/libraries/class-libraries.php

    r3195163 r3488727  
    156156            'langs'   => 'en',
    157157        ];
     158        self::$psr4_libraries['opensearch']   = [
     159            'name'    => 'OpenSearch',
     160            'prefix'  => 'OpenSearch',
     161            'base'    => DECALOG_VENDOR_DIR . 'opensearch/',
     162            'version' => '2.5.1',
     163            // phpcs:ignore
     164            'author'  => 'The OpenSearch Software Foundation',
     165            'url'     => 'https://github.com/opensearch-project/opensearch-php',
     166            'license' => 'apl2',
     167            'langs'   => 'en',
     168        ];
    158169        self::$psr4_libraries['guzzlehttp']   = [
    159170            'name'    => 'GuzzleHttp',
     
    163174            // phpcs:ignore
    164175            'author'  => 'Michael Dowling',
    165             'url'     => 'https://github.com/elastic/elasticsearch-php',
     176            'url'     => 'https://github.com/guzzle/guzzle',
    166177            'license' => 'mit',
    167178            'langs'   => 'en',
  • decalog/tags/4.6.0/includes/system/class-uuid.php

    r2658577 r3488727  
    5454
    5555    /**
     56     * Check if a string is a valid v4 UUID
     57     *
     58     * @param mixed $uuid The string to check
     59     * @return  boolean True if the string is a valid v4 UUID, false otherwise.
     60     * @since  2.0.0
     61     */
     62    public static function is_valid_v4( $uuid ) {
     63        return is_string( $uuid ) && preg_match( '/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', $uuid );
     64    }
     65
     66    /**
     67     * Sanitize a v4 UUID
     68     *
     69     * @param mixed $uuid The string to sanitize
     70     * @return  string The sanitized v4 UUID.
     71     * @since  2.0.0
     72     */
     73    public static function sanitize_v4( $uuid ) {
     74        return self::is_valid_v4( $uuid ) ? (string) $uuid : '00000000-0000-4000-0000-000000000000';
     75    }
     76
     77    /**
    5678     * Generates a (pseudo) unique ID.
    5779     * This function does not generate cryptographically secure values, and should not be used for cryptographic purposes.
  • decalog/tags/4.6.0/init.php

    r3404120 r3488727  
    1313define( 'DECALOG_PRODUCT_ABBREVIATION', 'decalog' );
    1414define( 'DECALOG_SLUG', 'decalog' );
    15 define( 'DECALOG_VERSION', '4.5.0' );
     15define( 'DECALOG_VERSION', '4.6.0' );
    1616define( 'DECALOG_API_VERSION', '3' );
    1717define( 'DECALOG_MONOLOG_VERSION', '2.9.3' );
  • decalog/tags/4.6.0/readme.txt

    r3404120 r3488727  
    22Contributors: PierreLannoy, hosterra
    33Tags: logs, error reporting, monitoring, tracing, logging
    4 Requires at least: 6.2
    5 Requires PHP: 8.1
    6 Tested up to: 6.9
    7 Stable tag: 4.5.0
     4Requires at least: 6.4
     5Requires PHP: 8.2
     6Tested up to: 7.0
     7Stable tag: 4.6.0
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3535This plugin is free and provided without warranty of any kind. Use it at your own risk, I'm not responsible for any improper use of this plugin, nor for any damage it might cause to your site. Always backup all your data before installing a new plugin.
    3636
    37 Anyway, I'll be glad to help you if you encounter issues when using this plugin. Just use the support section of this plugin page.
     37Anyway, I'll be glad to help you if you encounter issues when using this plugin. Please read carefully the FAQ at the bottom of this page before requesting support.
    3838
    3939= Privacy =
     
    7171== Frequently Asked Questions ==
    7272
    73 = What are the requirements for this plugin to work? =
    74 
    75 You need at least **WordPress 5.2** and **PHP 7.2**.
    76 
    7773= Can this plugin work on multisite? =
    7874
     
    8177= Where can I get support? =
    8278
    83 Support is provided via the official [WordPress page](https://wordpress.org/support/plugin/decalog/).
     79Support is provided via the official [WordPress page](https://wordpress.org/support/plugin/decalog/). Because I am human myself, please note that I only answer to support requests made by humans, who behave like humans. This excludes requests or bug reports written by AI or those that do not adhere to basic rules of courtesy.
    8480
    8581= Where can I find documentation? =
  • decalog/trunk/CHANGELOG.md

    r3404120 r3488727  
    44The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and **DecaLog** adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
    55
     6## [4.6.0] - 2026-03-23
     7
     8### Added
     9- New logger to send events to OpenSearch.
     10- Compatibility with WordPress 7.0.
     11
     12### Changed
     13- Minimal requirements are now PHP 8.2 and WordPress 6.4.
     14- Some strings in `readme.txt` have been updated.
     15
     16### Removed
     17- Compatibility with PHP 8.1.
     18- Compatibility with WordPress 6.2 & 6.3.
     19
     20### Fixed
     21- [SEC005] Authenticated (Admininistrator+) SQL Injection via the `logid` parameter similar to [CVE-2026-2831](https://www.cve.org/CVERecord?id=CVE-2026-2831).
     22- Some typos in libraries acknowledgement.
     23
    624## [4.5.0] - 2025-11-27
    725
     
    1230- [BC] Default PHP errors mapping has changed: now, `E_USER_NOTICE`, `E_STRICT` and `E_USER_DEPRECATED` are logged as `debug` events.
    1331- [BC] Some Action Scheduler events have a lower level (thanks to [Jan Thiel](https://github.com/JanThiel)).
    14 - [WP-CLI] Using `--quiet` now disables logging of events that are not errors. (thanks to [Jan Thiel](https://github.com/JanThiel)).
     32- [WP-CLI] Using `--quiet` now disables logging of events that are not errors (thanks to [Jan Thiel](https://github.com/JanThiel)).
    1533- The levels of `pre_clear_scheduled_hook` are now debug/info to prevent excessive noise.
    1634- The level mapping is now usable earlyer while logging PHP errors (thanks to [s.protasov](https://github.com/pro2s)).
  • decalog/trunk/admin/class-decalog-admin.php

    r3404120 r3488727  
    161161        $this->current_view = null;
    162162        add_action( 'load-' . $hook_suffix, [ new InlineHelp(), 'set_contextual_viewer' ] );
    163         $logid   = filter_input( INPUT_GET, 'logid', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
    164         $eventid = filter_input( INPUT_GET, 'eventid', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
    165         $traceid = filter_input( INPUT_GET, 'traceid', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
     163        $logid   = UUID::sanitize_v4( filter_input( INPUT_GET, 'logid', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) );
     164        $eventid = (int) filter_input( INPUT_GET, 'eventid', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
     165        $traceid = (int) filter_input( INPUT_GET, 'traceid', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
    166166        if ( 'decalog-viewer' === filter_input( INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ) {
    167167            if ( isset( $logid ) && isset( $eventid ) && 0 !== $eventid ) {
  • decalog/trunk/admin/partials/decalog-admin-settings-about.php

    r3195163 r3488727  
    3333$intro      = sprintf( decalog_esc_html__( '%1$s is a free and open source plugin for WordPress. It integrates other free and open source works (as-is or modified) like: %2$s.', 'decalog' ), '<em>' . DECALOG_PRODUCT_NAME . '</em>', do_shortcode( '[decalog-libraries]' ) );
    3434$trademarks = decalog_esc_html__( 'All brands, icons and graphic illustrations are registered trademarks of their respective owners.', 'decalog' );
    35 $brands     = [ 'Automattic', 'Bugsnag', 'Datadog', 'Elastic Cloud', 'Fluentd Project', 'Functional Software', 'Grafana Labs', 'Google', 'Hosterra', 'InfluxData', 'Nette Foundation', 'New Relic', 'Open Zipkin', 'PagerDuty', 'Pushover', 'Rapid7', 'Raygun', 'Sematext', 'Slack', 'Solarwinds', 'Spatie', 'Sumo Logic', 'The Linux Foundation', 'Uber' ];
     35$brands     = [ 'Automattic', 'Bugsnag', 'Datadog', 'Elastic Cloud', 'Fluentd Project', 'Functional Software', 'Grafana Labs', 'Google', 'Hosterra', 'InfluxData', 'Nette Foundation', 'New Relic', 'Open Zipkin', 'PagerDuty', 'Pushover', 'Rapid7', 'Raygun', 'Sematext', 'Slack', 'Solarwinds', 'Spatie', 'Sumo Logic', 'The Linux Foundation', 'The OpenSearch Software Foundation','Uber' ];
    3636$official   = sprintf( decalog_esc_html__( 'This plugin is not an official software from %s and, as such, is not endorsed or supported by these companies.', 'decalog' ), implode( ', ', $brands ) );
    3737
  • decalog/trunk/decalog.php

    r3404120 r3488727  
    1111 * Plugin URI:        https://perfops.one/decalog
    1212 * Description:       Capture and log events, metrics and traces on your site. Make WordPress observable – finally!
    13  * Version:           4.5.0
    14  * Requires at least: 6.2
    15  * Requires PHP:      8.1
     13 * Version:           4.6.0
     14 * Requires at least: 6.4
     15 * Requires PHP:      8.2
    1616 * Author:            Pierre Lannoy / PerfOps One
    1717 * Author URI:        https://perfops.one
  • decalog/trunk/includes/features/class-handlertypes.php

    r3195163 r3488727  
    16701670            ],
    16711671        ];
     1672
     1673
    16721674        $this->handlers[] = [
    16731675            'version'       => DECALOG_VERSION,
     
    16791681            'help'          => decalog_esc_html__( 'Events sent to Elasticsearch.', 'decalog' ),
    16801682            'icon'          => $this->get_base64_elasticsearch_icon(),
     1683            'needs'         => [],
     1684            'params'        => [ 'processors', 'privacy' ],
     1685            'configuration' => [
     1686                'url'   => [
     1687                    'type'    => 'string',
     1688                    'show'    => true,
     1689                    'name'    => decalog_esc_html__( 'Service URL', 'decalog' ),
     1690                    'help'    => sprintf( decalog_esc_html__( 'URL where to send logs. Format: %s.', 'decalog' ), '<code>' . htmlentities( '<proto>://<host>:<port>' ) . '</code>' ) . $this->get_substitution_note(),
     1691                    'default' => 'http://localhost:9200',
     1692                    'control' => [
     1693                        'type'    => 'field_input_text',
     1694                        'cast'    => 'string',
     1695                        'enabled' => true,
     1696                    ],
     1697                ],
     1698                'user'  => [
     1699                    'type'    => 'string',
     1700                    'show'    => true,
     1701                    'name'    => decalog_esc_html__( 'Username', 'decalog' ),
     1702                    'help'    => decalog_esc_html__( 'The username of the instance.', 'decalog' ) . $this->get_substitution_note(),
     1703                    'default' => '',
     1704                    'control' => [
     1705                        'type'    => 'field_input_text',
     1706                        'cast'    => 'string',
     1707                        'enabled' => true,
     1708                    ],
     1709                ],
     1710                'pass'  => [
     1711                    'type'    => 'string',
     1712                    'show'    => true,
     1713                    'name'    => decalog_esc_html__( 'Password', 'decalog' ),
     1714                    'help'    => decalog_esc_html__( 'The password of the instance.', 'decalog' ) . $this->get_substitution_note(),
     1715                    'default' => '',
     1716                    'control' => [
     1717                        'type'    => 'field_input_text',
     1718                        'cast'    => 'string',
     1719                        'enabled' => true,
     1720                    ],
     1721                ],
     1722                'index' => [
     1723                    'type'    => 'string',
     1724                    'show'    => true,
     1725                    'name'    => decalog_esc_html__( 'Index', 'decalog' ),
     1726                    'help'    => decalog_esc_html__( 'The index name.', 'decalog' ) . $this->get_substitution_note(),
     1727                    'default' => 'decalog',
     1728                    'control' => [
     1729                        'type'    => 'field_input_text',
     1730                        'cast'    => 'string',
     1731                        'enabled' => true,
     1732                    ],
     1733                ],
     1734                'extended' => [
     1735                    'type'    => 'string',
     1736                    'show'    => true,
     1737                    'name'    => decalog_esc_html__( 'Extended fields', 'decalog' ),
     1738                    'help'    => decalog_esc_html__( 'Fields to add to each logged event (one pair of key=value per line).', 'decalog' ) . '<br/>' . decalog_esc_html__( 'Example:', 'decalog' ) . ' <code>hostname={HOSTNAME}</code> ' . decalog_esc_html__( 'or', 'decalog' ) . ' <code>foo=bar</code> ' . decalog_esc_html__( 'or', 'decalog' ) . ' <code>foobar=42</code>.' . $this->get_substitution_note(),
     1739                    'default' => '',
     1740                    'control' => [
     1741                        'type'    => 'field_input_textarea',
     1742                        'cast'    => 'string',
     1743                        'enabled' => true,
     1744                        'columns' => 50,
     1745                        'lines'   => 5,
     1746                    ],
     1747                ],
     1748            ],
     1749            'init'          => [
     1750                [
     1751                    'type'  => 'configuration',
     1752                    'value' => 'url',
     1753                ],
     1754                [
     1755                    'type'  => 'configuration',
     1756                    'value' => 'user',
     1757                ],
     1758                [
     1759                    'type'  => 'configuration',
     1760                    'value' => 'pass',
     1761                ],
     1762                [
     1763                    'type'  => 'configuration',
     1764                    'value' => 'index',
     1765                ],
     1766                [
     1767                    'type'  => 'configuration',
     1768                    'value' => 'extended',
     1769                ],
     1770                [ 'type' => 'level' ],
     1771                [
     1772                    'type'  => 'literal',
     1773                    'value' => true,
     1774                ],
     1775            ],
     1776        ];
     1777
     1778
     1779        $this->handlers[] = [
     1780            'version'       => DECALOG_VERSION,
     1781            'id'            => 'OpensearchHandler',
     1782            'namespace'     => 'Decalog\\Handler',
     1783            'class'         => 'logging',
     1784            'minimal'       => Logger::DEBUG,
     1785            'name'          => 'OpenSearch - Events',
     1786            'help'          => decalog_esc_html__( 'Events sent to OpenSearch.', 'decalog' ),
     1787            'icon'          => $this->get_base64_opensearch_icon(),
    16811788            'needs'         => [],
    16821789            'params'        => [ 'processors', 'privacy' ],
     
    38213928        $source .= '<defs><circle id="SVGID_1_" cx="40" cy="40" r="32"/></defs><clipPath id="SVGID_2_"><use xlink:href="#SVGID_1_" overflow="visible"/></clipPath><path class="st0" d="M53.7 26H10c-1.1 0-2-.9-2-2V10c0-1.1.9-2 2-2h57c1.1 0 2 .9 2 2v.7C68.9 19.1 62.1 26 53.7 26z"/><defs><circle id="SVGID_3_" cx="40" cy="40" r="32"/></defs><clipPath id="SVGID_4_"><use xlink:href="#SVGID_3_" overflow="visible"/></clipPath><path class="st1" d="M69.1 72H8.2V54h45.7c8.4 0 15.2 6.8 15.2 15.2V72z"/><g><defs><circle id="SVGID_5_" cx="40" cy="40" r="32"/></defs><clipPath id="SVGID_6_"><use xlink:href="#SVGID_5_" overflow="visible"/></clipPath><path class="st2" d="M50.1 49H4.8V31h45.3c5 0 9 4 9 9s-4.1 9-9 9z"/></g><g><defs><circle id="SVGID_7_" cx="40" cy="40" r="32"/></defs><clipPath id="SVGID_8_"><use xlink:href="#SVGID_7_" overflow="visible"/></clipPath><path class="st3" d="M36 31H6.4v18H36c.7-2.7 1.1-5.7 1.1-9s-.4-6.3-1.1-9z"/></g><path class="st4" d="M23.9 12.3c-5.4 3.2-9.9 8-12.7 13.7h23.6c-2.4-5.5-6.2-10.1-10.9-13.7z"/><path class="st5" d="M24.9 68.2c4.6-3.7 8.3-8.6 10.6-14.2H11.2c3 6 7.8 11 13.7 14.2z"/><path class="st6" d="M0 0h80v80H0z"/>';
    38223929        $source .= '</svg>';
     3930        // phpcs:ignore
     3931        return 'data:image/svg+xml;base64,' . base64_encode( $source );
     3932    }
     3933
     3934    /**
     3935     * Returns a base64 svg resource for the OpenSearch icon.
     3936     *
     3937     * @param string $color1 Optional. Color of the icon.
     3938     * @param string $color2 Optional. Color of the icon.
     3939     * @param string $color3 Optional. Color of the icon.
     3940     * @param string $color4 Optional. Color of the icon.
     3941     * @param string $color5 Optional. Color of the icon.
     3942     * @param string $color6 Optional. Color of the icon.
     3943     * @return string The svg resource as a base64.
     3944     * @since 4.6.0
     3945     */
     3946    private function get_base64_opensearch_icon( $color1 = '#005EB8', $color2 = '#003B5C' ) {
     3947        $source  = '<svg viewBox="-8 -8 78 78" fill="none" xmlns="http://www.w3.org/2000/svg">';
     3948        $source  .= '<path d="M61.7374 23.5C60.4878 23.5 59.4748 24.513 59.4748 25.7626C59.4748 44.3813 44.3813 59.4748 25.7626 59.4748C24.513 59.4748 23.5 60.4878 23.5 61.7374C23.5 62.987 24.513 64 25.7626 64C46.8805 64 64 46.8805 64 25.7626C64 24.513 62.987 23.5 61.7374 23.5Z" fill="' . $color1 . '"/>';
     3949        $source  .= '<path d="M48.0814 38C50.2572 34.4505 52.3615 29.7178 51.9475 23.0921C51.0899 9.36725 38.6589 -1.04463 26.9206 0.0837327C22.3253 0.525465 17.6068 4.2712 18.026 10.9805C18.2082 13.8961 19.6352 15.6169 21.9544 16.9399C24.1618 18.1992 26.9978 18.9969 30.2128 19.9011C34.0962 20.9934 38.6009 22.2203 42.063 24.7717C46.2125 27.8295 49.0491 31.3743 48.0814 38Z" fill="' . $color2 . '"/>';
     3950        $source  .= '<path d="M3.91861 14C1.74276 17.5495 -0.361506 22.2822 0.0524931 28.9079C0.910072 42.6327 13.3411 53.0446 25.0794 51.9163C29.6747 51.4745 34.3932 47.7288 33.974 41.0195C33.7918 38.1039 32.3647 36.3831 30.0456 35.0601C27.8382 33.8008 25.0022 33.0031 21.7872 32.0989C17.9038 31.0066 13.3991 29.7797 9.93694 27.2283C5.78746 24.1704 2.95092 20.6257 3.91861 14Z" fill="' . $color1 . '"/>';
     3951        $source  .= '</svg>';
    38233952        // phpcs:ignore
    38243953        return 'data:image/svg+xml;base64,' . base64_encode( $source );
  • decalog/trunk/includes/features/class-inlinehelp.php

    r3195163 r3488727  
    1616use Decalog\System\Markdown;
    1717use Decalog\System\Role;
     18use Decalog\System\UUID;
    1819
    1920/**
     
    9495        if ( ! ( $this->trace_id = filter_input( INPUT_GET, 'traceid', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ) ) {
    9596            $this->trace_id = filter_input( INPUT_POST, 'traceid', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
     97        }
     98        if ( $this->log_id ) {
     99            $this->log_id = UUID::sanitize_v4( $this->log_id );
     100        }
     101        if ( $this->event_id ) {
     102            $this->event_id = (int) $this->event_id ;
     103        }
     104        if ( $this->trace_id ) {
     105            $this->trace_id = (int) $this->trace_id ;
    96106        }
    97107    }
  • decalog/trunk/includes/handlers/class-elastichandler.php

    r3085475 r3488727  
    5252        }
    5353        $index   = strtolower( str_replace( [ ' ' ], '-', sanitize_text_field( $index ) ) );
    54         $client  = \Elastic\Elasticsearch\ClientBuilder::create()->setHosts( [ $url ] )->setBasicAuthentication( $user, $pass )->build();
     54        $client  = \Elastic\Elasticsearch\ClientBuilder::create()->setHosts( [ $url ] )->setSSLVerification(false)->setBasicAuthentication( $user, $pass )->build();
    5555        $options = [
    5656            'index' => $index
  • decalog/trunk/includes/libraries/class-libraries.php

    r3195163 r3488727  
    156156            'langs'   => 'en',
    157157        ];
     158        self::$psr4_libraries['opensearch']   = [
     159            'name'    => 'OpenSearch',
     160            'prefix'  => 'OpenSearch',
     161            'base'    => DECALOG_VENDOR_DIR . 'opensearch/',
     162            'version' => '2.5.1',
     163            // phpcs:ignore
     164            'author'  => 'The OpenSearch Software Foundation',
     165            'url'     => 'https://github.com/opensearch-project/opensearch-php',
     166            'license' => 'apl2',
     167            'langs'   => 'en',
     168        ];
    158169        self::$psr4_libraries['guzzlehttp']   = [
    159170            'name'    => 'GuzzleHttp',
     
    163174            // phpcs:ignore
    164175            'author'  => 'Michael Dowling',
    165             'url'     => 'https://github.com/elastic/elasticsearch-php',
     176            'url'     => 'https://github.com/guzzle/guzzle',
    166177            'license' => 'mit',
    167178            'langs'   => 'en',
  • decalog/trunk/includes/system/class-uuid.php

    r2658577 r3488727  
    5454
    5555    /**
     56     * Check if a string is a valid v4 UUID
     57     *
     58     * @param mixed $uuid The string to check
     59     * @return  boolean True if the string is a valid v4 UUID, false otherwise.
     60     * @since  2.0.0
     61     */
     62    public static function is_valid_v4( $uuid ) {
     63        return is_string( $uuid ) && preg_match( '/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', $uuid );
     64    }
     65
     66    /**
     67     * Sanitize a v4 UUID
     68     *
     69     * @param mixed $uuid The string to sanitize
     70     * @return  string The sanitized v4 UUID.
     71     * @since  2.0.0
     72     */
     73    public static function sanitize_v4( $uuid ) {
     74        return self::is_valid_v4( $uuid ) ? (string) $uuid : '00000000-0000-4000-0000-000000000000';
     75    }
     76
     77    /**
    5678     * Generates a (pseudo) unique ID.
    5779     * This function does not generate cryptographically secure values, and should not be used for cryptographic purposes.
  • decalog/trunk/init.php

    r3404120 r3488727  
    1313define( 'DECALOG_PRODUCT_ABBREVIATION', 'decalog' );
    1414define( 'DECALOG_SLUG', 'decalog' );
    15 define( 'DECALOG_VERSION', '4.5.0' );
     15define( 'DECALOG_VERSION', '4.6.0' );
    1616define( 'DECALOG_API_VERSION', '3' );
    1717define( 'DECALOG_MONOLOG_VERSION', '2.9.3' );
  • decalog/trunk/readme.txt

    r3404120 r3488727  
    22Contributors: PierreLannoy, hosterra
    33Tags: logs, error reporting, monitoring, tracing, logging
    4 Requires at least: 6.2
    5 Requires PHP: 8.1
    6 Tested up to: 6.9
    7 Stable tag: 4.5.0
     4Requires at least: 6.4
     5Requires PHP: 8.2
     6Tested up to: 7.0
     7Stable tag: 4.6.0
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3535This plugin is free and provided without warranty of any kind. Use it at your own risk, I'm not responsible for any improper use of this plugin, nor for any damage it might cause to your site. Always backup all your data before installing a new plugin.
    3636
    37 Anyway, I'll be glad to help you if you encounter issues when using this plugin. Just use the support section of this plugin page.
     37Anyway, I'll be glad to help you if you encounter issues when using this plugin. Please read carefully the FAQ at the bottom of this page before requesting support.
    3838
    3939= Privacy =
     
    7171== Frequently Asked Questions ==
    7272
    73 = What are the requirements for this plugin to work? =
    74 
    75 You need at least **WordPress 5.2** and **PHP 7.2**.
    76 
    7773= Can this plugin work on multisite? =
    7874
     
    8177= Where can I get support? =
    8278
    83 Support is provided via the official [WordPress page](https://wordpress.org/support/plugin/decalog/).
     79Support is provided via the official [WordPress page](https://wordpress.org/support/plugin/decalog/). Because I am human myself, please note that I only answer to support requests made by humans, who behave like humans. This excludes requests or bug reports written by AI or those that do not adhere to basic rules of courtesy.
    8480
    8581= Where can I find documentation? =
Note: See TracChangeset for help on using the changeset viewer.