Skip to content

Merge Fewer Tags Pro into free plugin (v2.0)#49

Open
jdevalk wants to merge 8 commits intodevelopfrom
feature/merge-pro-into-free
Open

Merge Fewer Tags Pro into free plugin (v2.0)#49
jdevalk wants to merge 8 commits intodevelopfrom
feature/merge-pro-into-free

Conversation

@jdevalk
Copy link
Copy Markdown
Member

@jdevalk jdevalk commented Mar 19, 2026

Summary

  • Merge all Fewer Tags Pro features into the free plugin: term merging (including cross-taxonomy), redirect-on-delete prompts, and redirect creation via Redirection plugin or Yoast SEO Premium
  • Strip all licensing/EDD code — no license checks, no EDD updater, no pro admin settings page
  • Upgrade PHPStan from v1.10 to v2.1 for PHP 8.4 compatibility, fix all static analysis issues
  • Bump version to 2.0, update readme with new features, changelog, and FAQ

New files

File Purpose
src/class-option.php Options singleton for merge/redirect state
src/class-admin-ajax.php AJAX handlers for merge, redirect, dismiss, delete-term
src/class-helper.php Redirect notice HTML & redirect tool detection
src/class-redirects.php Redirect creation via Redirection or Yoast SEO Premium
js/fewer-tags.js Merge UI JavaScript (Thickbox modal, Choices.js dropdowns)
js/vendor/choices.min.js + .css Choices.js v10.2.0 vendor library

Modified files

File Changes
fewer-tags.php Version 2.0, FEWER_TAGS_FILE constant, updated description
src/class-plugin.php Integrated merge UI: AJAX routing, modal, scripts, merge action, notices
src/class-admin.php Redirect tool admin notice with install/activate buttons
uninstall.php Cleanup fewer_tags_pro option on uninstall
readme.txt New description, FAQ, changelog for v2.0
.phpcs.xml.dist Exclude all JS from PHPCS (not just .min.js)
phpstan.neon.dist PHPStan v2 compat, external class ignores
composer.json / composer.lock PHPStan v2.1, phpstan-wordpress v2.0

Test plan

  • composer check-cs passes
  • composer phpstan passes (0 errors)
  • Verify "Merge" link appears on tag/category row actions
  • Verify merge modal opens, populates taxonomies and terms via REST API
  • Verify merge executes correctly: posts moved, source term deleted, redirect created
  • Verify delete-and-redirect notice appears after term deletion with redirect options
  • Verify redirect tool warning notice shows when neither Yoast SEO Premium nor Redirection is active
  • Verify existing "fewer tags" threshold functionality still works (tags below threshold hidden, redirected)
  • Verify fewer_tags_pro option is cleaned up on uninstall

🤖 Generated with Claude Code

jdevalk and others added 7 commits March 10, 2025 12:33
Bring all pro features into the free plugin: term merging (including
cross-taxonomy), redirect-on-delete prompts, and redirect creation via
Redirection plugin or Yoast SEO Premium. Strip all EDD licensing code.

Also upgrades PHPStan to v2.1 for PHP 8.4 compatibility and fixes all
resulting static analysis issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The svn command is not available on GitHub Actions runners.
Download the WP test suite from GitHub zip archives instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
curl needs -L to follow GitHub redirects. Also check HTTP status code
instead of file size to distinguish 404 from a valid download.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Resolve conflicts in phpstan.neon.dist (keep PHPStan v2 config) and
composer.lock. Pin php-compatibility to ^9.3 stable to avoid PHPCS 4
conflict with wpcs. Keep develop's svn auto-install in test script.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 19, 2026

Test on Playground
Test this pull request on the Playground or download the zip

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 19, 2026

Composer package changes
Dev Packages Operation Base Target
antecedent/patchwork Upgraded 2.2.1 2.2.3
brain/monkey Changed dev-master a8502a8 dev-master 789a8b0
dealerdirect/phpcodesniffer-composer-installer Upgraded v1.0.0 v1.2.0
hamcrest/hamcrest-php Changed dev-master ea3c21c v2.1.1
myclabs/deep-copy Upgraded 1.x-dev 024473a 1.x-dev 5ee4e97
nikic/php-parser Changed v5.4.0 dev-master 50f0d9c
phar-io/manifest Changed dev-master 54750ef dev-master c581d49
php-stubs/wordpress-stubs Upgraded v6.7.2 v6.9.1
phpcompatibility/php-compatibility Changed dev-develop 9013cd0 9.3.5
phpcompatibility/phpcompatibility-paragonie Upgraded 1.3.3 1.3.4
phpcompatibility/phpcompatibility-wp Changed dev-master bcefd1e 2.1.8
phpcsstandards/phpcsextra Changed dev-develop cf28c84 dev-develop 85b0130
phpcsstandards/phpcsutils Changed dev-develop 060222e dev-develop 8082141
phpstan/extension-installer Upgraded 1.4.x-dev c243505 1.4.x-dev 1754f69
phpstan/phpstan Upgraded 1.12.x-dev 9cd58b5 2.2.x-dev 988d56d
phpunit/php-code-coverage Upgraded 9.2.x-dev 0448d60 9.2.x-dev 653bca7
phpunit/phpunit Upgraded 9.6.x-dev 7fcb379 9.6.x-dev a71778a
sebastian/comparator Upgraded 4.0.x-dev b247957 4.0.x-dev e4df00b
sebastian/exporter Upgraded 4.0.x-dev 78c00df 4.0.x-dev 14c6ba5
sebastian/global-state Upgraded 5.0.x-dev bca7df1 5.0.x-dev b678131
sebastian/recursion-context Upgraded 4.0.x-dev e75bd0f 4.0.x-dev 539c669
squizlabs/php_codesniffer Changed dev-master 82a9ec2 3.x-dev 1017866
szepeviktor/phpstan-wordpress Upgraded v1.3.5 2.x-dev aa722f0
theseer/tokenizer Upgraded 1.2.3 1.3.1
wp-coding-standards/wpcs Upgraded 3.1.0 3.3.0
yoast/phpunit-polyfills Upgraded 1.x-dev e6faedf 1.x-dev 80d5533
yoast/wp-test-utils Changed dev-develop 430933b dev-develop 2090cef
symfony/polyfill-php73 Removed 1.x-dev 0f68c03 -

The lock file had doctrine/instantiator 2.2.x-dev requiring PHP 8.4,
breaking CI jobs running on PHP 7.4. Setting platform.php ensures
composer resolves packages compatible with the minimum PHP version.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@jdevalk jdevalk requested review from aristath and ilicfilip March 19, 2026 14:29
ilicfilip added a commit that referenced this pull request Mar 19, 2026
- Add capability checks (manage_categories) to all AJAX handlers
- Fix XSS: escape slug/taxonomy in HTML attributes and JS href contexts
- Fix XSS: escape term names and URLs in AJAX response messages
- Fix bug: Redirection group option key mismatch (redirect_group vs
  redirection_group) causing new group creation on every merge
- Fix bug: inverted condition always recreating Redirection group
- Fix bug: get_term_link called after term deletion; capture permalink
  in pre_delete_term hook instead
- Add merge action to categories and custom taxonomies, not just tags
- Scope redirect tool admin notice to edit-tags screens only
- Scope MutationObserver to #the-list instead of document.body
- Use rest_base from taxonomy object for REST API endpoints
- Set allowHTML: false on Choices.js instances
- Fix typo: cannnot -> cannot

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant