https://github.com/lgladdy/acf-escaping-debug-plugin
A WordPress plugin to enable debug error logging whenever ACF will modify or remove potentially unsafe when using the shortcode, the_field or the_sub_field
https://github.com/lgladdy/acf-escaping-debug-plugin
acf advanced-custom-fields advanced-custom-fields-pro wordpress wordpress-plugin
Last synced: about 2 months ago
JSON representation
A WordPress plugin to enable debug error logging whenever ACF will modify or remove potentially unsafe when using the shortcode, the_field or the_sub_field
- Host: GitHub
- URL: https://github.com/lgladdy/acf-escaping-debug-plugin
- Owner: lgladdy
- Created: 2024-01-18T15:33:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-19T14:37:26.000Z (over 2 years ago)
- Last Synced: 2024-01-19T18:57:51.367Z (over 2 years ago)
- Topics: acf, advanced-custom-fields, advanced-custom-fields-pro, wordpress, wordpress-plugin
- Language: PHP
- Homepage: https://advancedcustomfields.com/
- Size: 1.95 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## ACF Escaping Debug Plugin
In ACF 6.2.5, the plugin began warning users whenever it detected the value being output was not correctly escaped when using the ACF shortcode, `the_field` or `the_sub_field`
In ACF 6.2.7 due for release in February 2024, ACF will automatically begin escaping the value when `the_field` or `the_sub_field` is used.
ACF will show a warning notice in WordPress admin for this detection, but for performance reasons this notice is limited to the name of the field, it's selector used to output the value, and the function called.
This plugin extends that default logging to output a more detailed version whenever it is detected. The output is sent to the PHP error log via `error_log`.
This plugin should not be used on production, as it has potential to generate a log of error log messages.
### Example Output:
```
[18-Jan-2024 15:36:49 UTC] ***ACF HTML Escaping Debug***
HTML modification detected the value of wysiwyg on post ID 140 via the_sub_field
Raw Value: '
console.log("Repeater Row 3");
'
Escaped Value: 'console.log(“Repeater Row 3”);
'
Template: /Users/liam/Code/local-wp/site.local/wp-content/themes/twentytwentyone/page.php
```