Skip to content

Commit a640ff8

Browse files
committed
feat: Update to version 0.3.0 with security enhancements, breaking changes, and improved documentation
1 parent 82bd4c5 commit a640ff8

File tree

6 files changed

+68
-28
lines changed

6 files changed

+68
-28
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
---
1111

12+
## [0.3.0] - 2026-02-20
13+
14+
### Security
15+
- REST API `/search/users` and `/options/roles` endpoints now require `list_users` capability instead of `edit_posts`
16+
- Added `current_user_can( 'edit_term' )` capability check to taxonomy field save handler
17+
- All bare `echo` ternary output wrapped in `esc_attr()` for consistent escaping discipline
18+
19+
### Changed
20+
- **BREAKING:** Plugin prefix renamed from `cof` (3 chars) to `cofld` (5 chars) per WordPress.org prefix length guidelines
21+
- All PHP constants: `COF_*``COFLD_*`
22+
- All PHP classes: `COF_*``COFLD_*`
23+
- All PHP functions: `cof_*()``cofld_*()`
24+
- All CSS classes: `.cof-*``.cofld-*`
25+
- All JS variables: `cofConfig``cofldConfig`, `cofMetaBox``cofldMetaBox`, `openfieldsAdmin``cofldAdmin`
26+
- Database tables: `cof_fieldsets``cofld_fieldsets`, `cof_fields``cofld_fields`, `cof_locations``cofld_locations`
27+
- PHP file names: `class-cof-*.php``class-cofld-*.php`
28+
29+
### Added
30+
- Source code & build instructions section in readme.txt for compressed JS/CSS assets
31+
- `check_list_users_permission()` REST API method for user-data endpoints
32+
33+
---
34+
1235
## [0.2.0] - 2025-07-13
1336

1437
### Fixed

REVIEWER_REPLY.md

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,53 @@
11
# Reply to WordPress.org Plugin Review
22

33
**To:** plugins@wordpress.org
4-
**Subject:** Re: [WordPress Plugin Directory] Codeideal Open Fields - Review Response
4+
**Subject:** Re: [WordPress Plugin Directory] Codeideal Open Fields - Review Response (v0.3.0)
55

66
---
77

88
Hi,
99

10-
Thank you for the review. I've addressed every item below.
10+
Thank you for the thorough reviewI've gone through every point and addressed them all in this update (v0.3.0).
1111

12-
**1. Plugin Name / Trademark**
12+
**1. Compressed/Generated Code — Source Documentation**
1313

14-
The plugin has been rebranded to **"Codeideal Open Fields"** — prefixed with our brand name. All references to competitor trademarks (ACF, Advanced Custom Fields, Meta Box) have been removed from the plugin name, description, readme tags, FAQ, and all internal code comments throughout the entire codebase.
14+
Added a "Source Code & Build Instructions" section to `readme.txt`. The compiled admin JS (`assets/admin/js/admin.js`) is built from React/TypeScript source included in our public GitHub repository (`admin/src/`). Build steps and source file locations are now documented in the readme.
1515

16-
**2. Slug**
16+
**2. REST API `permission_callback` Issues**
1717

18-
The current slug is `codeideal-open-fields`, which matches our text domain and all internal references. Could you please confirm or assign this slug?
18+
- `/search/users` — now requires `list_users` instead of `edit_posts`
19+
- `/options/roles` — now requires `list_users` instead of `edit_posts`
20+
- Added a dedicated `check_list_users_permission()` method for these user-data endpoints
1921

20-
**3. Contributor / Ownership**
22+
All other endpoints already used `check_admin_permission()` (`manage_options`) — no changes needed there.
2123

22-
The readme.txt contributor has been corrected to `shayancode`, matching my WordPress.org username. I am the owner and sole developer of codeideal.com — you can verify this via the Author URI in the plugin header (`https://codeideal.com`).
24+
**3. Nonce & Capability Checks**
2325

24-
**4. Code Quality Fixes**
26+
Added `current_user_can( 'edit_term', $term_id )` at the top of `save_taxonomy_fields()`. The post and user save handlers already had proper capability checks — I verified all three are now covered:
2527

26-
- Replaced all `json_encode()` calls with `wp_json_encode()`
27-
- Added `phpcs:ignore` annotation with justification for the `$_GET['activate-multi']` check in the activation redirect (standard WordPress pattern, no data processing)
28-
- Fixed unescaped output variables in `repeater.php` field renderer
29-
- Fixed double-escaping in two field renderers (post-object, user)
30-
- Removed `Update URI` header (not allowed on wordpress.org-hosted plugins)
31-
- Fixed a bug in `uninstall.php` where meta cleanup queries used an incorrect prefix pattern
28+
- `save_post()``current_user_can( 'edit_post', $post_id )`
29+
- `save_taxonomy_fields()``current_user_can( 'edit_term', $term_id )` *(added)*
30+
- `save_user_fields()``current_user_can( 'edit_user', $user_id )`
3231

33-
**5. Security**
32+
**4. Escaped Output**
3433

35-
All `$_POST` data access is behind nonce verification (`wp_verify_nonce`), capability checks (`current_user_can`), and sanitized with `sanitize_text_field()`, `wp_unslash()`, `absint()`, or type-specific sanitization. The REST API uses `permission_callback` on every route with `manage_options` or `edit_posts` capability checks and `$wpdb->prepare()` for all queries.
34+
Wrapped all bare `echo` ternary expressions in `esc_attr()` across the field renderer templates (`image.php`, `file.php`, `gallery.php`, `repeater.php`, `taxonomy.php`). The `$data_string` and `$atts` echo patterns were already pre-escaped via `esc_attr()` during construction — each has a `phpcs:ignore` annotation with justification explaining so. I verified these are correct.
3635

37-
**6. load_plugin_textdomain**
36+
**5. Prefix Length**
3837

39-
Not called — the plugin relies on WordPress 4.6+ automatic translation loading from translate.wordpress.org, as recommended.
38+
Renamed the entire prefix from `cof` (3 chars) to `cofld` (5 chars). This touched every PHP file, CSS file, JS file, and the React source:
4039

41-
Please let me know if anything else is needed.
40+
- Constants: `COF_*``COFLD_*`
41+
- Classes: `COF_*``COFLD_*`
42+
- Functions: `cof_*()``cofld_*()`
43+
- CSS classes: `.cof-*``.cofld-*`
44+
- JS variables: `cofConfig``cofldConfig`, `cofMetaBox``cofldMetaBox`, etc.
45+
- DB tables: `cof_fieldsets``cofld_fieldsets`, `cof_fields``cofld_fields`, `cof_locations``cofld_locations`
46+
- File names: `class-cof-*.php``class-cofld-*.php`
4247

43-
Best regards,
44-
Shayan Moradi
45-
https://codeideal.com
48+
Ran a final automated grep across the entire built ZIP — zero remaining old-prefix references.
49+
50+
Please let me know if anything else needs attention.
51+
52+
Best regards
53+
Shayan

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openfields",
3-
"version": "0.2",
3+
"version": "0.3.0",
44
"type": "module",
55
"description": "Modern custom fields builder for WordPress. Create and manage custom field groups with an intuitive interface.",
66
"author": "Codeideal",

plugin/codeideal-open-fields.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Codeideal Open Fields
44
* Plugin URI: https://openfields.codeideal.com
55
* Description: Modern custom fields builder for WordPress. Create and manage custom field groups with an intuitive interface.
6-
* Version: 0.2.1
6+
* Version: 0.3.0
77
* Requires at least: 6.0
88
* Requires PHP: 7.4
99
* Author: Codeideal
@@ -22,7 +22,7 @@
2222
}
2323

2424
// Define plugin constants.
25-
define( 'COFLD_VERSION', '0.2' );
25+
define( 'COFLD_VERSION', '0.3.0' );
2626
define( 'COFLD_PLUGIN_FILE', __FILE__ );
2727
define( 'COFLD_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
2828
define( 'COFLD_PLUGIN_URL', plugin_dir_url( __FILE__ ) );

plugin/readme.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: https://codeideal.com
44
Tags: custom fields, meta fields, field builder, post meta, custom meta
55
Requires at least: 6.0
66
Tested up to: 6.9
7-
Stable tag: 0.2.1
7+
Stable tag: 0.3.0
88
Requires PHP: 7.4
99
License: GPLv2 or later
1010
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -100,6 +100,15 @@ Use the standard WordPress functions like `get_post_meta()` or the helper functi
100100

101101
== Changelog ==
102102

103+
= 0.3.0 =
104+
* Security: REST API `/search/users` and `/options/roles` endpoints now require `list_users` capability instead of `edit_posts`
105+
* Security: Added `current_user_can( 'edit_term' )` capability check to taxonomy field save handler
106+
* Security: All bare `echo` output now wrapped in proper escaping functions (`esc_attr`, `esc_html`)
107+
* Changed: Plugin prefix renamed from `cof` (3 chars) to `cofld` (5 chars) to comply with WordPress.org prefix length requirements — affects all constants, functions, CSS classes, JS variables, database table names, hooks, and file names
108+
* Added: Source code documentation section in readme explaining where to find uncompressed source for built JS/CSS assets
109+
* Developer note: Database table names changed from `cof_fieldsets`, `cof_fields`, `cof_locations` to `cofld_fieldsets`, `cofld_fields`, `cofld_locations`
110+
* Developer note: All public API functions renamed (e.g. `cof_get_field` → `cofld_get_field`)
111+
103112
= 0.2 =
104113
* Fixed: Page templates not fetched dynamically — now scans all public post types and block theme templates
105114
* Fixed: Template matching failure when default template is selected (value mismatch between WordPress API and stored rules)

scripts/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ update_plugin_version() {
3131

3232
# macOS compatible sed (using .bak for backup, then deleting it)
3333
sed -i.bak "s/\* Version: .*/\* Version: $version/" "$PLUGIN_FILE"
34-
sed -i.bak "s/define( 'COF_VERSION', .*/define( 'COF_VERSION', '$version' );/" "$PLUGIN_FILE"
34+
sed -i.bak "s/define( 'COFLD_VERSION', .*/define( 'COFLD_VERSION', '$version' );/" "$PLUGIN_FILE"
3535
rm -f "${PLUGIN_FILE}.bak"
3636
}
3737

0 commit comments

Comments
 (0)