Changeset 3488727
- Timestamp:
- 03/23/2026 09:03:25 AM (5 days ago)
- Location:
- decalog
- Files:
-
- 2 added
- 22 edited
- 1 copied
-
tags/4.6.0 (copied) (copied from decalog/trunk)
-
tags/4.6.0/CHANGELOG.md (modified) (2 diffs)
-
tags/4.6.0/admin/class-decalog-admin.php (modified) (1 diff)
-
tags/4.6.0/admin/partials/decalog-admin-settings-about.php (modified) (1 diff)
-
tags/4.6.0/decalog.php (modified) (1 diff)
-
tags/4.6.0/includes/features/class-handlertypes.php (modified) (3 diffs)
-
tags/4.6.0/includes/features/class-inlinehelp.php (modified) (2 diffs)
-
tags/4.6.0/includes/handlers/class-elastichandler.php (modified) (1 diff)
-
tags/4.6.0/includes/handlers/class-opensearchhandler.php (added)
-
tags/4.6.0/includes/libraries/class-libraries.php (modified) (2 diffs)
-
tags/4.6.0/includes/system/class-uuid.php (modified) (1 diff)
-
tags/4.6.0/init.php (modified) (1 diff)
-
tags/4.6.0/readme.txt (modified) (4 diffs)
-
trunk/CHANGELOG.md (modified) (2 diffs)
-
trunk/admin/class-decalog-admin.php (modified) (1 diff)
-
trunk/admin/partials/decalog-admin-settings-about.php (modified) (1 diff)
-
trunk/decalog.php (modified) (1 diff)
-
trunk/includes/features/class-handlertypes.php (modified) (3 diffs)
-
trunk/includes/features/class-inlinehelp.php (modified) (2 diffs)
-
trunk/includes/handlers/class-elastichandler.php (modified) (1 diff)
-
trunk/includes/handlers/class-opensearchhandler.php (added)
-
trunk/includes/libraries/class-libraries.php (modified) (2 diffs)
-
trunk/includes/system/class-uuid.php (modified) (1 diff)
-
trunk/init.php (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
decalog/tags/4.6.0/CHANGELOG.md
r3404120 r3488727 4 4 The 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). 5 5 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 6 24 ## [4.5.0] - 2025-11-27 7 25 … … 12 30 - [BC] Default PHP errors mapping has changed: now, `E_USER_NOTICE`, `E_STRICT` and `E_USER_DEPRECATED` are logged as `debug` events. 13 31 - [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)). 15 33 - The levels of `pre_clear_scheduled_hook` are now debug/info to prevent excessive noise. 16 34 - 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 161 161 $this->current_view = null; 162 162 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 ); 166 166 if ( 'decalog-viewer' === filter_input( INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ) { 167 167 if ( isset( $logid ) && isset( $eventid ) && 0 !== $eventid ) { -
decalog/tags/4.6.0/admin/partials/decalog-admin-settings-about.php
r3195163 r3488727 33 33 $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]' ) ); 34 34 $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' ]; 36 36 $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 ) ); 37 37 -
decalog/tags/4.6.0/decalog.php
r3404120 r3488727 11 11 * Plugin URI: https://perfops.one/decalog 12 12 * Description: Capture and log events, metrics and traces on your site. Make WordPress observable – finally! 13 * Version: 4. 5.014 * Requires at least: 6. 215 * Requires PHP: 8. 113 * Version: 4.6.0 14 * Requires at least: 6.4 15 * Requires PHP: 8.2 16 16 * Author: Pierre Lannoy / PerfOps One 17 17 * Author URI: https://perfops.one -
decalog/tags/4.6.0/includes/features/class-handlertypes.php
r3195163 r3488727 1670 1670 ], 1671 1671 ]; 1672 1673 1672 1674 $this->handlers[] = [ 1673 1675 'version' => DECALOG_VERSION, … … 1679 1681 'help' => decalog_esc_html__( 'Events sent to Elasticsearch.', 'decalog' ), 1680 1682 '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(), 1681 1788 'needs' => [], 1682 1789 'params' => [ 'processors', 'privacy' ], … … 3821 3928 $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"/>'; 3822 3929 $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>'; 3823 3952 // phpcs:ignore 3824 3953 return 'data:image/svg+xml;base64,' . base64_encode( $source ); -
decalog/tags/4.6.0/includes/features/class-inlinehelp.php
r3195163 r3488727 16 16 use Decalog\System\Markdown; 17 17 use Decalog\System\Role; 18 use Decalog\System\UUID; 18 19 19 20 /** … … 94 95 if ( ! ( $this->trace_id = filter_input( INPUT_GET, 'traceid', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ) ) { 95 96 $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 ; 96 106 } 97 107 } -
decalog/tags/4.6.0/includes/handlers/class-elastichandler.php
r3085475 r3488727 52 52 } 53 53 $index = strtolower( str_replace( [ ' ' ], '-', sanitize_text_field( $index ) ) ); 54 $client = \Elastic\Elasticsearch\ClientBuilder::create()->setHosts( [ $url ] )->set BasicAuthentication( $user, $pass )->build();54 $client = \Elastic\Elasticsearch\ClientBuilder::create()->setHosts( [ $url ] )->setSSLVerification(false)->setBasicAuthentication( $user, $pass )->build(); 55 55 $options = [ 56 56 'index' => $index -
decalog/tags/4.6.0/includes/libraries/class-libraries.php
r3195163 r3488727 156 156 'langs' => 'en', 157 157 ]; 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 ]; 158 169 self::$psr4_libraries['guzzlehttp'] = [ 159 170 'name' => 'GuzzleHttp', … … 163 174 // phpcs:ignore 164 175 'author' => 'Michael Dowling', 165 'url' => 'https://github.com/ elastic/elasticsearch-php',176 'url' => 'https://github.com/guzzle/guzzle', 166 177 'license' => 'mit', 167 178 'langs' => 'en', -
decalog/tags/4.6.0/includes/system/class-uuid.php
r2658577 r3488727 54 54 55 55 /** 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 /** 56 78 * Generates a (pseudo) unique ID. 57 79 * 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 13 13 define( 'DECALOG_PRODUCT_ABBREVIATION', 'decalog' ); 14 14 define( 'DECALOG_SLUG', 'decalog' ); 15 define( 'DECALOG_VERSION', '4. 5.0' );15 define( 'DECALOG_VERSION', '4.6.0' ); 16 16 define( 'DECALOG_API_VERSION', '3' ); 17 17 define( 'DECALOG_MONOLOG_VERSION', '2.9.3' ); -
decalog/tags/4.6.0/readme.txt
r3404120 r3488727 2 2 Contributors: PierreLannoy, hosterra 3 3 Tags: logs, error reporting, monitoring, tracing, logging 4 Requires at least: 6. 25 Requires PHP: 8. 16 Tested up to: 6.97 Stable tag: 4. 5.04 Requires at least: 6.4 5 Requires PHP: 8.2 6 Tested up to: 7.0 7 Stable tag: 4.6.0 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 35 35 This 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. 36 36 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.37 Anyway, 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. 38 38 39 39 = Privacy = … … 71 71 == Frequently Asked Questions == 72 72 73 = What are the requirements for this plugin to work? =74 75 You need at least **WordPress 5.2** and **PHP 7.2**.76 77 73 = Can this plugin work on multisite? = 78 74 … … 81 77 = Where can I get support? = 82 78 83 Support is provided via the official [WordPress page](https://wordpress.org/support/plugin/decalog/). 79 Support 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. 84 80 85 81 = Where can I find documentation? = -
decalog/trunk/CHANGELOG.md
r3404120 r3488727 4 4 The 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). 5 5 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 6 24 ## [4.5.0] - 2025-11-27 7 25 … … 12 30 - [BC] Default PHP errors mapping has changed: now, `E_USER_NOTICE`, `E_STRICT` and `E_USER_DEPRECATED` are logged as `debug` events. 13 31 - [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)). 15 33 - The levels of `pre_clear_scheduled_hook` are now debug/info to prevent excessive noise. 16 34 - 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 161 161 $this->current_view = null; 162 162 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 ); 166 166 if ( 'decalog-viewer' === filter_input( INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ) { 167 167 if ( isset( $logid ) && isset( $eventid ) && 0 !== $eventid ) { -
decalog/trunk/admin/partials/decalog-admin-settings-about.php
r3195163 r3488727 33 33 $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]' ) ); 34 34 $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' ]; 36 36 $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 ) ); 37 37 -
decalog/trunk/decalog.php
r3404120 r3488727 11 11 * Plugin URI: https://perfops.one/decalog 12 12 * Description: Capture and log events, metrics and traces on your site. Make WordPress observable – finally! 13 * Version: 4. 5.014 * Requires at least: 6. 215 * Requires PHP: 8. 113 * Version: 4.6.0 14 * Requires at least: 6.4 15 * Requires PHP: 8.2 16 16 * Author: Pierre Lannoy / PerfOps One 17 17 * Author URI: https://perfops.one -
decalog/trunk/includes/features/class-handlertypes.php
r3195163 r3488727 1670 1670 ], 1671 1671 ]; 1672 1673 1672 1674 $this->handlers[] = [ 1673 1675 'version' => DECALOG_VERSION, … … 1679 1681 'help' => decalog_esc_html__( 'Events sent to Elasticsearch.', 'decalog' ), 1680 1682 '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(), 1681 1788 'needs' => [], 1682 1789 'params' => [ 'processors', 'privacy' ], … … 3821 3928 $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"/>'; 3822 3929 $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>'; 3823 3952 // phpcs:ignore 3824 3953 return 'data:image/svg+xml;base64,' . base64_encode( $source ); -
decalog/trunk/includes/features/class-inlinehelp.php
r3195163 r3488727 16 16 use Decalog\System\Markdown; 17 17 use Decalog\System\Role; 18 use Decalog\System\UUID; 18 19 19 20 /** … … 94 95 if ( ! ( $this->trace_id = filter_input( INPUT_GET, 'traceid', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ) ) { 95 96 $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 ; 96 106 } 97 107 } -
decalog/trunk/includes/handlers/class-elastichandler.php
r3085475 r3488727 52 52 } 53 53 $index = strtolower( str_replace( [ ' ' ], '-', sanitize_text_field( $index ) ) ); 54 $client = \Elastic\Elasticsearch\ClientBuilder::create()->setHosts( [ $url ] )->set BasicAuthentication( $user, $pass )->build();54 $client = \Elastic\Elasticsearch\ClientBuilder::create()->setHosts( [ $url ] )->setSSLVerification(false)->setBasicAuthentication( $user, $pass )->build(); 55 55 $options = [ 56 56 'index' => $index -
decalog/trunk/includes/libraries/class-libraries.php
r3195163 r3488727 156 156 'langs' => 'en', 157 157 ]; 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 ]; 158 169 self::$psr4_libraries['guzzlehttp'] = [ 159 170 'name' => 'GuzzleHttp', … … 163 174 // phpcs:ignore 164 175 'author' => 'Michael Dowling', 165 'url' => 'https://github.com/ elastic/elasticsearch-php',176 'url' => 'https://github.com/guzzle/guzzle', 166 177 'license' => 'mit', 167 178 'langs' => 'en', -
decalog/trunk/includes/system/class-uuid.php
r2658577 r3488727 54 54 55 55 /** 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 /** 56 78 * Generates a (pseudo) unique ID. 57 79 * This function does not generate cryptographically secure values, and should not be used for cryptographic purposes. -
decalog/trunk/init.php
r3404120 r3488727 13 13 define( 'DECALOG_PRODUCT_ABBREVIATION', 'decalog' ); 14 14 define( 'DECALOG_SLUG', 'decalog' ); 15 define( 'DECALOG_VERSION', '4. 5.0' );15 define( 'DECALOG_VERSION', '4.6.0' ); 16 16 define( 'DECALOG_API_VERSION', '3' ); 17 17 define( 'DECALOG_MONOLOG_VERSION', '2.9.3' ); -
decalog/trunk/readme.txt
r3404120 r3488727 2 2 Contributors: PierreLannoy, hosterra 3 3 Tags: logs, error reporting, monitoring, tracing, logging 4 Requires at least: 6. 25 Requires PHP: 8. 16 Tested up to: 6.97 Stable tag: 4. 5.04 Requires at least: 6.4 5 Requires PHP: 8.2 6 Tested up to: 7.0 7 Stable tag: 4.6.0 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 35 35 This 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. 36 36 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.37 Anyway, 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. 38 38 39 39 = Privacy = … … 71 71 == Frequently Asked Questions == 72 72 73 = What are the requirements for this plugin to work? =74 75 You need at least **WordPress 5.2** and **PHP 7.2**.76 77 73 = Can this plugin work on multisite? = 78 74 … … 81 77 = Where can I get support? = 82 78 83 Support is provided via the official [WordPress page](https://wordpress.org/support/plugin/decalog/). 79 Support 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. 84 80 85 81 = Where can I find documentation? =
Note: See TracChangeset
for help on using the changeset viewer.