-
Notifications
You must be signed in to change notification settings - Fork 3
fix(plugin-check): resolve naming convention violations by unifying prefixes #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Rename 8 constants to comply with WordPress naming conventions: - WPTAGORDER_* → WP_TAG_ORDER_* (7 constants) - WTO_SETTING_ARGS → WP_TAG_ORDER_SETTING_ARGS (1 constant) Updated all references in 6 files: - wp-tag-order.php - includes/functions.php - includes/index.php - includes/rest-api.php - options/index.php Also added prefix unification documentation. Part of prefix unification to resolve Plugin Check violations. PHPStan: ✓ No errors, Syntax check: ✓ Pass
Rename 15 utility functions to comply with WordPress naming: - wto_meta_key → wp_tag_order_meta_key - wto_form_field_name → wp_tag_order_form_field_name - wto_is_array_empty → wp_tag_order_is_array_empty - wto_array_diff_interactive → wp_tag_order_array_diff_interactive - wto_get_non_hierarchical_taxonomies → wp_tag_order_get_non_hierarchical_taxonomies - wto_get_enabled_taxonomies → wp_tag_order_get_enabled_taxonomies - wto_is_enabled_taxonomy → wp_tag_order_is_enabled_taxonomy - wto_has_enabled_taxonomy → wp_tag_order_has_enabled_taxonomy - wto_get_post_types_by_taxonomy → wp_tag_order_get_post_types_by_taxonomy - wto_has_tag_posttype → wp_tag_order_has_tag_posttype - wto_strposa → wp_tag_order_strposa - wto_replace_script_tag → wp_tag_order_replace_script_tag - wto_has_reorder_controller_in_metaboxes → wp_tag_order_has_reorder_controller_in_metaboxes Updated all call sites in 6 files. Part of prefix unification to resolve Plugin Check violations. PHPStan: ✓ No errors, Syntax check: ✓ Pass
- Rename 18 functions from wpto_* to wp_tag_order_* - includes/rest-api.php (8 REST API functions) - includes/index.php (7 admin functions) - includes/functions.php (5 utility functions) - Update all callback strings in register_rest_route - Update all add_action hooks - Update all function call sites Part of prefix unification to comply with WordPress naming conventions and resolve Plugin Check violations.
- Rename 5 functions from wptagorder_* to wp_tag_order_* - wp_tag_order_notice_php_version_wrong - wp_tag_order_check_php_version - wp_tag_order_handle_php_version_error - wp_tag_order_php_version_check - wp_tag_order_add_github_link - Update add_action and add_filter hooks - Update all internal function calls Part of prefix unification to comply with WordPress naming conventions and resolve Plugin Check violations.
Update all test files to reference the new unified function names after prefix unification from wpto_*/wto_* to wp_tag_order_*. Changes: - tests/FunctionTests.php: Update @Covers annotations and function calls - tests/RestApiTests.php: Update @Covers, function calls, and filter names - tests/IndexTests.php: Update @Covers and function calls - tests/class-test-tag-updater.php: Update filter names and function calls Part of prefix unification to comply with WordPress naming conventions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
includes/rest-api.php
Outdated
|
|
||
| // Get all non-hierarchical taxonomies for reference. | ||
| $available_taxonomies = apply_filters( 'wpto_non_hierarchical_taxonomies', wto_get_non_hierarchical_taxonomies() ); | ||
| $available_taxonomies = apply_filters( 'wpto_non_hierarchical_taxonomies', wp_tag_order_get_non_hierarchical_taxonomies() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Filter Naming Mismatch Breaks Functionality
Filter names wpto_enabled_taxonomies and wpto_non_hierarchical_taxonomies were not updated to match the new naming convention (wp_tag_order_enabled_taxonomies and wp_tag_order_non_hierarchical_taxonomies), while the test files were updated to use the new names. This creates a mismatch where tests hook into non-existent filters, causing test failures and breaking any external code that might filter these values.
- Update wto_meta_key() to wp_tag_order_meta_key() in CategoryTemplateTests.php - Update filter names in rest-api.php: - wpto_allowed_post_types → wp_tag_order_allowed_post_types - wpto_enabled_taxonomies → wp_tag_order_enabled_taxonomies - wpto_non_hierarchical_taxonomies → wp_tag_order_non_hierarchical_taxonomies Fixes PHPUnit errors caused by undefined function and filter name mismatches.
Summary
Resolve WordPress Plugin Check naming convention violations by unifying all function and constant prefixes to the WordPress-compliant format.
Changes
wp_tag_order_*wptagorder_*→wp_tag_order_*(5 functions)wpto_*→wp_tag_order_*(18 functions)wto_*→wp_tag_order_*(15 functions)WP_TAG_ORDER_*Breaking Changes
None - all changes are internal implementation only. Public APIs remain unchanged:
get_the_tags_ordered(), etc./wp-json/wp-tag-order/v1/...WP_Tag_Order\Verification
Related
Fixes WordPress Plugin Check violations from Actions runs:
Note
Renames internal functions, constants, filters, and callbacks to the WP-compliant
wp_tag_order_*/WP_TAG_ORDER_*prefixes and updates all call sites and tests.wp_tag_order_*(e.g., meta key helpers, casting utilities, validators, AJAX helpers, script tag filter, metabox handlers, REST handlers, permission checks).WP_TAG_ORDER_*(meta key prefix, REST namespace, options/actions, PHP version minimum, settings args).wp_tag_order_*(e.g.,wp_tag_order_enabled_taxonomies,wp_tag_order_non_hierarchical_taxonomies,plugin_row_metacallback).includes/functions.php,index.php,category-template.php,rest-api.php,class-tag-updater.phpupdated to new names and meta key builderwp_tag_order_meta_key().WP_TAG_ORDER_*constants.Written by Cursor Bugbot for commit 6179d70. This will update automatically on new commits. Configure here.