Skip to content

[Refactor]: Rename plugin name from Carousel Kit to rtCarousel#101

Open
theMasudRana wants to merge 12 commits intodevelopfrom
chore/update-plugin-name-rt-carousel
Open

[Refactor]: Rename plugin name from Carousel Kit to rtCarousel#101
theMasudRana wants to merge 12 commits intodevelopfrom
chore/update-plugin-name-rt-carousel

Conversation

@theMasudRana
Copy link
Copy Markdown
Collaborator

@theMasudRana theMasudRana commented Apr 1, 2026

Summary

Describe the change and why it is needed.

Type of change

  • Bug fix
  • New feature
  • Enhancement/refactor
  • Documentation update
  • Test update
  • Build/CI/tooling

Related issue(s)

Closes #
Relates to # (if applicable)

What changed

  • Updated context variable names in editor context and types.
  • Changed CSS class names in SCSS files to reflect new naming convention.
  • Modified block registration and attributes in block.json files for carousel and slide blocks.
  • Adjusted save and edit components to use new class names and context.
  • Updated test cases and bootstrap files to align with the new naming.
  • Ensured all references to "carousel-kit" are replaced with "rt-carousel" across the codebase.

Breaking changes

Does this introduce a breaking change? If yes, describe the impact and migration path below.

  • Yes — migration path: inc/Migration.php
  • No

Testing

Describe how this was tested.

  • Unit tests
  • Manual testing
  • Cross-browser testing (if UI changes)

Test details:

Screenshots / recordings

If applicable, add screenshots or short recordings.

Checklist

  • I have self-reviewed this PR
  • I have added/updated tests where needed
  • I have updated docs where needed
  • I have checked for breaking changes

- Updated context variable names in editor context and types.
- Changed CSS class names in SCSS files to reflect new naming convention.
- Modified block registration and attributes in block.json files for carousel and slide blocks.
- Adjusted save and edit components to use new class names and context.
- Updated test cases and bootstrap files to align with the new naming.
- Ensured all references to "carousel-kit" are replaced with "rt-carousel" across the codebase.
@theMasudRana theMasudRana self-assigned this Apr 1, 2026
@theMasudRana theMasudRana requested a review from Copilot April 1, 2026 06:45
@theMasudRana theMasudRana marked this pull request as ready for review April 1, 2026 06:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the WordPress plugin to rename/rebrand Carousel Kit to rtCarousel (slug/textdomain rt-carousel), updating PHP namespaces/constants, block names, CSS classnames/variables, documentation, and tooling configs to match the new identity.

Changes:

  • Renamed block namespaces/categories/textdomains from carousel-kit/* to rt-carousel/* across block sources, patterns, and tests.
  • Updated PHP namespace/autoloading/constants from Carousel_Kit / CAROUSEL_KIT_* to Rt_Carousel / RT_CAROUSEL_*, and introduced an activation-time migration.
  • Updated docs and build/CI/tooling assets (Composer/NPM configs, PHPCS/PHPStan/PHPUnit/Jest, release ZIP naming, Playground blueprint).

Reviewed changes

Copilot reviewed 61 out of 66 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
uninstall.php Updates uninstall cleanup to new namespace/transient/option names.
tests/phpstan/constants.php Renames PHPStan test constants to RT_CAROUSEL_*.
tests/php/Unit/UnitTestCase.php Updates unit test base namespace/package naming.
tests/php/Unit/Traits/SingletonTest.php Updates Singleton hook name + namespaces used by unit tests.
tests/php/Unit/PluginTest.php Updates assertions for new category slug/title + transient key + block slugs.
tests/php/bootstrap.php Updates PHPUnit bootstrap namespace + constants to RT_CAROUSEL_*.
tests/js/setup.ts Updates Jest setup header comments to rtCarousel naming.
src/types.d.ts Renames global editor context handle to __RT_CAROUSEL_CONTEXT__.
src/blocks/carousel/viewport/edit.tsx Renames inserted/allowed block names + UI strings/textdomain + empty-state class.
src/blocks/carousel/viewport/block.json Renames viewport block name/category/parent/textdomain.
src/blocks/carousel/view.ts Renames interactivity store namespace, Symbol key, wrapper selector, issue link.
src/blocks/carousel/types.ts Updates inline issue link to new repo URL.
src/blocks/carousel/styles/_variants.scss Renames wrapper selector and slide-width CSS var.
src/blocks/carousel/styles/_core.scss Renames wrapper selector + core CSS variables (gap/height/slide-width).
src/blocks/carousel/slide/save.tsx Renames interactivity namespace in saved markup.
src/blocks/carousel/slide/edit.tsx Renames context key used for allowed blocks.
src/blocks/carousel/slide/block.json Renames slide block name/category/parent/textdomain/usesContext.
src/blocks/carousel/save.tsx Renames wrapper class, interactivity namespace, CSS variables, i18n domain.
src/blocks/carousel/index.ts Renames style labels’ textdomain.
src/blocks/carousel/editor.scss Renames editor-only classnames/wrapper selectors.
src/blocks/carousel/editor-context.ts Renames the shared editor React context global key.
src/blocks/carousel/edit.tsx Renames inner block names, classnames, CSS vars, and all i18n textdomains.
src/blocks/carousel/dots/style.scss Renames dots classes and CSS variables.
src/blocks/carousel/dots/save.tsx Renames dots wrapper + dot classnames in saved markup.
src/blocks/carousel/dots/edit.tsx Renames Symbol key, wrapper selector, classes, and i18n domain.
src/blocks/carousel/dots/block.json Renames dots block name/category/ancestor/textdomain.
src/blocks/carousel/controls/style.scss Renames controls classes and CSS variables + selectors.
src/blocks/carousel/controls/save.tsx Renames controls wrapper/button classes + i18n domain.
src/blocks/carousel/controls/edit.tsx Renames wrapper selector/classes + i18n domain.
src/blocks/carousel/controls/components/icons.tsx Renames icon classnames.
src/blocks/carousel/controls/block.json Renames controls block name/category/ancestor/textdomain.
src/blocks/carousel/block.json Renames carousel block name/category/textdomain/providesContext key.
src/blocks/carousel/tests/view.test.ts Updates interactivity namespace/Symbol/wrapper selector; adjusts test context initialization.
rt-carousel.php Adds new plugin entrypoint file with constants + autoloader + activation migration + loader.
readme.txt Updates plugin display name, repo links, install folder name, changelog link.
README.md Updates project name, badges/links, uninstall description, demo and issue URLs.
phpunit.xml.dist Updates coverage include from carousel-kit.php to rt-carousel.php.
phpstan.neon.dist Updates scanned paths from carousel-kit.php to rt-carousel.php.
phpcs.xml.dist Updates ruleset name, scanned file, and allowed textdomain.
package.json Renames package, repo/bugs URLs, and POT generation script output/domain.
package-lock.json Updates lockfile package name to rt-carousel.
Makefile Updates build ZIP slug to rt-carousel.
languages/rt-carousel.pot Renames text domain, plugin metadata strings, and file references.
jest.config.js Updates Jest config displayName and header comment.
index.php Updates @package tag to rt-carousel naming.
inc/Traits/Singleton.php Renames PHP namespace and init hook prefix.
inc/Plugin.php Renames PHP namespace, constants, block category/pattern category slugs/labels, cache key.
inc/Autoloader.php Renames PHP namespace, constants used for autoload path/flag, and i18n strings.
examples/patterns/testimonial-carousel.php Updates pattern headers + block markup to new block names/classes/vars.
examples/patterns/query-loop.php Updates pattern headers + block markup to new block names/classes/vars.
examples/patterns/logo-showcase.php Updates pattern headers, image URL constant, and block markup.
examples/patterns/hero-carousel.php Updates pattern headers, image URL constant, and block markup.
docs/USAGE.md Updates documented block names and examples to rt-carousel/*.
docs/THEMING.md Updates documented CSS variable names and block selector examples.
docs/INSTALLATION.md Updates release ZIP name, repo URL, and Composer package name.
docs/CONTRIBUTING.md Updates project name and produced ZIP name.
docs/API.md Updates interactivity namespace and documented wrapper/Symbol key names.
DEVELOPMENT.md Updates PSR-4 namespace mention for PHP code.
composer.json Renames Composer package name and PSR-4 namespaces for prod/dev autoloading.
carousel-kit.php Removes old plugin entrypoint file.
blueprint.json Updates plugin download URL, WXR import URL, and demo blog title string.
.gitignore Renames ignored ZIP artifact to rt-carousel.zip.
.github/workflows/release.yml Updates release workflow to upload rt-carousel.zip.
.github/ISSUE_TEMPLATE/config.yml Updates security policy link to new repo.
.github/ISSUE_TEMPLATE/bug_report.yml Updates contributing guidelines link to new repo.
Comments suppressed due to low confidence (1)

languages/rt-carousel.pot:6

  • The POT header still says Project-Id-Version: rtCarousel 1.0.3, but the plugin version in rt-carousel.php/package.json is 1.0.4. Please regenerate or update the POT header so it matches the current release version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 1, 2026 07:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 66 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

languages/rt-carousel.pot:6

  • The .pot header still says Project-Id-Version: rtCarousel 1.0.3 while the plugin version in rt-carousel.php is 1.0.4. Regenerate or update the POT header so translation tooling reflects the correct version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 1, 2026 09:40
@theMasudRana theMasudRana changed the title [Refactor]: Carousel Kit plugin to rename from "carousel-kit" to "rt-carousel" [Refactor]: Rename plugin name from Carousel Kit to rtCarousel Apr 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 66 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

languages/rt-carousel.pot:6

  • The POT header still says Project-Id-Version: rtCarousel 1.0.3, but the plugin header/version in this PR is 1.0.4. Regenerate the POT (or update the header) so translation tooling reflects the correct current version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@theMasudRana theMasudRana requested review from sanketio April 1, 2026 09:45
@mi5t4n
Copy link
Copy Markdown
Member

mi5t4n commented Apr 1, 2026

@theMasudRana I don't know why, but I think we do the migration in stages. The first stage will probably to start with which doesn't break things like renaming classes and CSS. Then other breaking changes.

@theMasudRana theMasudRana requested a review from mi5t4n April 1, 2026 14:14
@theMasudRana
Copy link
Copy Markdown
Collaborator Author

Hi @mi5t4n,
Could you please explain how making the changes in stages would help in this case?

We have previously migrated all at once three times (Interactive Carousel → Core Carousel → Carousel Kit).
However, I’m open to any suggestions that could make the migration process smoother.

Thank you.

cc: @danish17

@theMasudRana theMasudRana requested a review from danish17 April 1, 2026 14:19
@mi5t4n
Copy link
Copy Markdown
Member

mi5t4n commented Apr 2, 2026

@theMasudRana Since the plugin is public, we have announced this on our blog as well. We also don't have information on how many users are using this plugin. So, the best approach IMO is to do the following:

  1. Change that doesn't break anything
  2. Changes which breaks but we can do automatic migration.
  3. Changes which breaks but can't be done automatically. (For this, we should at least show notify users before we do the actual changes)

Copilot AI review requested due to automatic review settings April 2, 2026 06:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 66 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 2, 2026 07:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 66 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@theMasudRana
Copy link
Copy Markdown
Collaborator Author

theMasudRana commented Apr 3, 2026

Hello @mi5t4n,

Your suggestion is well thought out, and we can certainly consider that approach. Since the plugin is still quite new, a drop-in replacement with proper testing might also work well for now.

In the current implementation, when the new plugin ZIP is uploaded and rtCarousel is activated, the old version is automatically deactivated, and the migration runs in the background. No user interaction is required, and everything continues to work as before.
And the old Carousel Kit plugin can be deleted safely.

Could you please take a look at the video and let me know if this approach feels smooth enough for now?

@danish17 — It would be great if you could also review the video and share your thoughts.

https://drive.google.com/file/d/1k2EDPbaMR_kbxoZ7lHQBaZDRpxpnqEXt/view?usp=drive_link

Thanks

cc: @vishal4669

Copy link
Copy Markdown

@milindmore22 milindmore22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I guess we will bump version when we are releasing it.

@milindmore22
Copy link
Copy Markdown

Here is what I think of releasing migration

  1. Push Minor update with Plugin title Carousel Kit - Deprecated Install rtCarousel instead version 1.0.5
  2. rtCarousel version 1.1.0
image

Comment on lines +140 to +142
if ( 0 === $result ) {
break;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should consider logging it to indicate why it failed.

Suggested change
if ( 0 === $result ) {
break;
}
if ( 0 === $result ) {
error_log( 'rt_carousel migration: LIKE matched posts but REPLACE changed nothing — possible collation mismatch.' );
break;
}

Comment on lines +119 to +130
$result = $wpdb->query(
$wpdb->prepare(
"UPDATE {$wpdb->posts}
SET post_content = REPLACE(
REPLACE( post_content, 'carousel-kit', 'rt-carousel' ),
'Carousel Kit',
'rtCarousel'
)
WHERE ID IN ({$placeholders})",
...$ids
)
);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LIKE clause will match case variations like Carousel-Kit or CAROUSEL-KIT that the nested REPLACE doesn't handle. When this happens, the post enters the UPDATE but nothing changes, $result hits 0, the loop breaks, and the migration is marked complete — leaving that content unmigrated silently.

Either add REPLACE calls for every casing LIKE can match, or tighten the LIKE patterns to only the exact strings REPLACE handles so unmatched posts never enter the UPDATE.

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.

5 participants