Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
b9702e2
refactor: update changelog script to use npx and remove conventional-…
theMasudRana Feb 20, 2026
ec94099
chore: update CHANGELOG for version 1.0.1 with bug fixes and new feat…
theMasudRana Feb 20, 2026
deaef43
chore: remove unused dependency scrivo/highlight.php from composer files
theMasudRana Feb 24, 2026
2760527
feat: add .distignore file to exclude unnecessary files from WordPres…
theMasudRana Feb 24, 2026
2268cb8
feat: add localization support and update package.json for repository…
theMasudRana Feb 24, 2026
e8cdd4a
feat: add readme.txt with plugin details and installation instructions
theMasudRana Feb 24, 2026
4e5fe9f
feat: update license and version in carousel-kit.php; add index.php f…
theMasudRana Feb 24, 2026
c3826fc
feat: add screenshot for plugin preview in WordPress.org
theMasudRana Feb 24, 2026
c4e35cd
feat: update .distignore to refine exclusions for WordPress.org distr…
theMasudRana Feb 24, 2026
11ae3a9
Merge branch 'develop' of https://github.com/rtCamp/carousel-kit into…
theMasudRana Feb 25, 2026
818d69c
fix(styles): remove unnecessary grid-template-columns property
theMasudRana Feb 26, 2026
e69596a
refactor(styles): improve transition effects and clean up unused prop…
theMasudRana Feb 26, 2026
1149c55
fix: CSS linting issues
theMasudRana Feb 26, 2026
9874909
Merge branch 'develop' of https://github.com/rtCamp/carousel-kit into…
theMasudRana Feb 26, 2026
6c1e473
refactor: Remove unrelated changes from current PR
theMasudRana Feb 26, 2026
d69e3f0
Merge pull request #67 from rtCamp/fix/non-applicable-css
theMasudRana Feb 26, 2026
8219d76
Merge pull request #46 from rtCamp/fix/dependabot-issues
theMasudRana Feb 26, 2026
1086467
Merge pull request #68 from rtCamp/fix/css-refactor
theMasudRana Feb 26, 2026
712f3b4
Merge branch 'develop' of https://github.com/rtCamp/carousel-kit into…
theMasudRana Mar 2, 2026
bdd4b52
feat: add placeholder logos and update hero carousel pattern
theMasudRana Mar 2, 2026
e5ee596
feat: update .distignore to exclude README.md and enhance carousel-ki…
theMasudRana Mar 2, 2026
cd5e061
feat: Updated pot file
theMasudRana Mar 2, 2026
e32acaf
feat: update PHP requirement to 8.2, bump stable tag to 1.0.3, and ad…
theMasudRana Mar 3, 2026
acd5906
chore: format package.json for consistency in spacing
theMasudRana Mar 3, 2026
bd25e48
chore: remove upgrade notice section from readme.txt
theMasudRana Mar 3, 2026
49ac3b2
chore: remove version field from package.json
theMasudRana Mar 3, 2026
3a52e05
feat: update PHP requirement to 8.2 and reorder contributors in plugi…
theMasudRana Mar 3, 2026
3deb4aa
chore: remove version field from package-lock.json
theMasudRana Mar 3, 2026
65a5190
docs: add link to full changelog in readme.txt
theMasudRana Mar 3, 2026
fceb313
chore: remove version field from package-lock.json
theMasudRana Mar 3, 2026
4077c28
fix: update file paths in phpcs and phpstan configuration
theMasudRana Mar 3, 2026
a0a1b45
feat: implement autoloader for PHP classes and refactor constant defi…
theMasudRana Mar 3, 2026
02d49a7
fix: ignore phpcs warning for including pattern file from a fixed dir…
theMasudRana Mar 3, 2026
9c73548
fix: update script paths in composer.json and improve constant defini…
theMasudRana Mar 3, 2026
3bdc9e0
fix: update POT-Creation-Date and add missing autoloader error message
theMasudRana Mar 3, 2026
08e51fd
chore: update @wordpress/scripts to version 31.5.0
theMasudRana Mar 3, 2026
e1b9e23
feat: add new screenshot image and remove outdated PNG file
theMasudRana Mar 3, 2026
353646b
fix: clean up .distignore by removing unnecessary files and directories
theMasudRana Mar 3, 2026
7ffdd9a
fix: remove outdated screenshots description from readme
theMasudRana Mar 3, 2026
71381db
fix: update dist target to exclude additional configuration and devel…
theMasudRana Mar 4, 2026
d33bf17
fix: ensure direct access to Autoloader.php exits gracefully
theMasudRana Mar 4, 2026
6a05ac9
fix: update package dependencies for minimatch and serialize-javascript
theMasudRana Mar 4, 2026
46f0f7a
fix: update script paths in composer.json to use local binaries
theMasudRana Mar 5, 2026
22cb27c
feat: update README with minimum requirements and add uninstall funct…
theMasudRana Mar 5, 2026
320a3ec
fix: update WordPress minimum requirement to 6.6 in README, INSTALLAT…
theMasudRana Mar 5, 2026
295b2b3
fix: update contributors list in plugin header and readme.txt
theMasudRana Mar 5, 2026
c9e877d
fix: update package-lock.json to remove unused dependency and upgrade…
theMasudRana Mar 5, 2026
6a23832
fix: update tested up to version in readme.txt from 6.9.1 to 6.9
theMasudRana Mar 6, 2026
1eea8d8
fix: correct release link in INSTALLATION.md and update node_modules …
theMasudRana Mar 6, 2026
03ce762
fix: update @wordpress/scripts version to allow minor updates
theMasudRana Mar 6, 2026
a57d369
Merge pull request #57 from rtCamp/feat/prepair-for-wp-org
theMasudRana Mar 6, 2026
057d1ae
chore(release): Prepare v1.0.4 release (#76)
theMasudRana Mar 10, 2026
13a040b
Fix: Wide Alignment + Block Tree Selection (#70)
theMasudRana Mar 12, 2026
378e4ee
fix: add direct access protection to example pattern files (#84)
theMasudRana Mar 12, 2026
aebfdeb
feat: add new asset images and replace old screenshot (#86)
theMasudRana Mar 16, 2026
7b1804c
build(deps-dev): bump basic-ftp from 5.1.0 to 5.2.0 (#64)
dependabot[bot] Mar 19, 2026
d8b7e89
build(deps): bump flatted from 3.3.3 to 3.4.2 (#91)
dependabot[bot] Mar 19, 2026
bc9978e
Add Issue and PR templates. (#81)
deepaklalwani97 Mar 24, 2026
71de050
fix: add initialized state to CarouselContext to track carousel initi…
mi5t4n Mar 26, 2026
f73890e
Support Vertical Alignment on Carousel Slide (#89)
bhubbard Mar 26, 2026
3cbb280
build(deps): bump picomatch (#94)
dependabot[bot] Mar 26, 2026
977a1fe
build(deps): bump yaml from 1.10.2 to 1.10.3 (#96)
dependabot[bot] Mar 26, 2026
a1308c6
fix: exclude composer.json and composer.lock from distribution packag…
theMasudRana Mar 30, 2026
d4c07a7
build(deps-dev): bump lodash-es from 4.17.23 to 4.18.1 (#102)
dependabot[bot] Apr 2, 2026
d0fa559
build(deps-dev): bump lodash from 4.17.23 to 4.18.1 (#105)
dependabot[bot] Apr 2, 2026
dec79c8
Fix[Controls]: Block Toolbar persists when selected block moves out o…
yogeshbhutkar Apr 7, 2026
dcccaf7
feat: add wp-env configuration for WP development setup (#109)
yogeshbhutkar Apr 7, 2026
9788ed7
[Refactor]: Rename plugin name from Carousel Kit to rtCarousel (#101)
theMasudRana Apr 8, 2026
1d16ee6
fix: restore vertical scroll for Query Loop carousel (#104)
Sukhendu2002 Apr 8, 2026
edc8699
Add support for the progress bar. (#90)
bhubbard Apr 8, 2026
93c8a48
build(deps-dev): bump basic-ftp from 5.2.0 to 5.2.1 (#111)
dependabot[bot] Apr 9, 2026
4c74f8b
build(deps-dev): bump basic-ftp from 5.2.1 to 5.2.2 (#112)
dependabot[bot] Apr 12, 2026
cda5bc3
[Chore]: Preparation for 1.1.0 version release (#110)
theMasudRana Apr 13, 2026
85bec2d
[Fix]: Merge conflicts with main v1.1.0 (#114)
theMasudRana Apr 13, 2026
a4cfaae
Release `v1.0.4` (#85) (#116)
theMasudRana Apr 13, 2026
43c64e3
chore: update version to 2.0.0 and prepare for release (#117)
theMasudRana Apr 13, 2026
e736d05
Sync `develop` with `main` to resolve conflicts (#119)
theMasudRana Apr 16, 2026
a765037
build(deps-dev): bump follow-redirects from 1.15.11 to 1.16.0 (#120)
dependabot[bot] Apr 16, 2026
592bde2
Merge branch 'main' into fix/reconcile-history-with-main
danish17 Apr 16, 2026
488fc74
Merge pull request #122 from rtCamp/fix/reconcile-history-with-main
danish17 Apr 16, 2026
04dde30
[Release]: Publish new version 2.0.0 by merging develop into main (#1…
theMasudRana May 4, 2026
279a464
Fix: Replace automatic plugin deactivation with admin notice (#129)
theMasudRana May 4, 2026
366031e
Fix carousel dot focus loss with VoiceOver activation (#127)
deepakpra May 4, 2026
b7a2240
Add a11y announcements for carousel slide changes (#125)
deepakpra May 4, 2026
9fd863d
[Release]: Prepare release for 2.0.1 (#130)
theMasudRana May 4, 2026
bd40f00
Merge branch 'main' into develop
danish17 May 7, 2026
242275c
Merge pull request #134 from rtCamp/fix/reconcile-history-main
danish17 May 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## [2.0.1](https://github.com/rtCamp/rt-carousel/compare/v2.0.0...v2.0.1) (2026-05-04)


### Features

* add a11y announcements for carousel slide changes ([#125](https://github.com/rtCamp/rt-carousel/issues/125)) ([b7a2240](https://github.com/rtCamp/rt-carousel/commit/b7a2240))


### Bug Fixes

* carousel dot focus loss with VoiceOver activation ([#127](https://github.com/rtCamp/rt-carousel/issues/127)) ([366031e](https://github.com/rtCamp/rt-carousel/commit/366031e))


### Refactors

* replace automatic plugin deactivation with admin notice ([#129](https://github.com/rtCamp/rt-carousel/issues/129)) ([279a464](https://github.com/rtCamp/rt-carousel/commit/279a464))


## [2.0.0](https://github.com/rtCamp/rt-carousel/compare/v1.0.4...v2.0.0) (2026-04-13)


Expand Down
12 changes: 12 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ Thank you for your interest in contributing! We welcome all contributions, from
- **JavaScript/TypeScript**: We use the standard WordPress ESLint config. Run `npm run lint:js` to check.
- **CSS/SCSS**: We use Stylelint. Run `npm run lint:css` to check.

## Block `save()` Changes

If your changes modify a block's `save()` output — including `data-wp-context`, HTML structure, class names, or new elements — you **must** add a deprecation entry in the block's `deprecated.tsx`.

1. Copy the previous `save()` function into the `deprecated` array.
2. Include the `attributes` and `supports` from the old version (copy the full `supports` from `block.json` — don't simplify it, or alignment/color classes will fail validation).
3. For blocks with inner blocks, use `useInnerBlocksProps.save()` in the deprecated `save()` function, just like the current save does.

Without this, existing content will show "Block contains unexpected or invalid content" errors in the editor.

See the [Block Deprecation API](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-deprecation/) for details.

## Building the Plugin

To create a production-ready ZIP file:
Expand Down
20 changes: 10 additions & 10 deletions examples/patterns/hero-carousel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
exit;
}

$pattern_images_url = trailingslashit( RT_CAROUSEL_URL . '/examples/data/images' );
$hero_slide_one = $pattern_images_url . 'slide-autoplay-1.webp';
$hero_slide_two = $pattern_images_url . 'slide-autoplay-2.webp';
$hero_slide_three = $pattern_images_url . 'slide-autoplay-3.webp';
$rt_carousel_images_url = trailingslashit( RT_CAROUSEL_URL . '/examples/data/images' );
$rt_carousel_slide_one = $rt_carousel_images_url . 'slide-autoplay-1.webp';
$rt_carousel_slide_two = $rt_carousel_images_url . 'slide-autoplay-2.webp';
$rt_carousel_slide_three = $rt_carousel_images_url . 'slide-autoplay-3.webp';
?>

<!-- wp:rt-carousel/carousel {"loop":true,"autoplay":true,"autoplayDelay":5000,"ariaLabel":"Hero Carousel","metadata":{"categories":["rt-carousel"],"patternName":"rt-carousel/hero-carousel","name":"rtCarousel: Hero Carousel"},"align":"wide","className":"wp-block-carousel-carousel"} -->
<div class="wp-block-rt-carousel-carousel alignwide rt-carousel wp-block-carousel-carousel" role="region" aria-roledescription="carousel" aria-label="Hero Carousel" dir="ltr" data-axis="x" data-loop="true" data-wp-interactive="rt-carousel/carousel" data-wp-context="{&quot;options&quot;:{&quot;loop&quot;:true,&quot;dragFree&quot;:false,&quot;align&quot;:&quot;start&quot;,&quot;containScroll&quot;:&quot;trimSnaps&quot;,&quot;direction&quot;:&quot;ltr&quot;,&quot;axis&quot;:&quot;x&quot;,&quot;slidesToScroll&quot;:1},&quot;autoplay&quot;:{&quot;delay&quot;:5000,&quot;stopOnInteraction&quot;:true,&quot;stopOnMouseEnter&quot;:false},&quot;isPlaying&quot;:true,&quot;timerIterationId&quot;:0,&quot;selectedIndex&quot;:-1,&quot;scrollSnaps&quot;:[],&quot;canScrollPrev&quot;:false,&quot;canScrollNext&quot;:false,&quot;scrollProgress&quot;:0,&quot;slideCount&quot;:0,&quot;ariaLabelPattern&quot;:&quot;Go to slide %d&quot;}" data-wp-init="callbacks.initCarousel" style="--rt-carousel-gap:0px"><!-- wp:rt-carousel/carousel-viewport {"className":"wp-block-carousel-carousel-viewport"} -->
<div class="wp-block-rt-carousel-carousel-viewport embla wp-block-carousel-carousel-viewport">
<div class="embla__container"><!-- wp:rt-carousel/carousel-slide {"className":"wp-block-carousel-carousel-slide"} -->
<div class="wp-block-rt-carousel-carousel-slide embla__slide wp-block-carousel-carousel-slide" role="group" aria-roledescription="slide" data-wp-interactive="rt-carousel/carousel" data-wp-class--is-active="callbacks.isSlideActive" data-wp-bind--aria-current="callbacks.isSlideActive"><!-- wp:cover {"url":"<?php echo esc_url( $hero_slide_one ); ?>","dimRatio":30,"minHeight":600,"minHeightUnit":"px"} -->
<div class="wp-block-cover" style="min-height:600px"><img class="wp-block-cover__image-background" alt="" src="<?php echo esc_url( $hero_slide_one ); ?>" data-object-fit="cover" /><span aria-hidden="true" class="wp-block-cover__background has-background-dim-30 has-background-dim"></span>
<div class="wp-block-rt-carousel-carousel-slide embla__slide wp-block-carousel-carousel-slide" role="group" aria-roledescription="slide" data-wp-interactive="rt-carousel/carousel" data-wp-class--is-active="callbacks.isSlideActive" data-wp-bind--aria-current="callbacks.isSlideActive"><!-- wp:cover {"url":"<?php echo esc_url( $rt_carousel_slide_one ); ?>","dimRatio":30,"minHeight":600,"minHeightUnit":"px"} -->
<div class="wp-block-cover" style="min-height:600px"><img class="wp-block-cover__image-background" alt="" src="<?php echo esc_url( $rt_carousel_slide_one ); ?>" data-object-fit="cover" /><span aria-hidden="true" class="wp-block-cover__background has-background-dim-30 has-background-dim"></span>
<div class="wp-block-cover__inner-container"><!-- wp:heading {"textAlign":"center","level":1,"textColor":"white"} -->
<h1 class="wp-block-heading has-text-align-center has-white-color has-text-color">Welcome to Our Site</h1>
<!-- /wp:heading -->
Expand All @@ -44,8 +44,8 @@
<!-- /wp:rt-carousel/carousel-slide -->

<!-- wp:rt-carousel/carousel-slide {"className":"wp-block-carousel-carousel-slide"} -->
<div class="wp-block-rt-carousel-carousel-slide embla__slide wp-block-carousel-carousel-slide" role="group" aria-roledescription="slide" data-wp-interactive="rt-carousel/carousel" data-wp-class--is-active="callbacks.isSlideActive" data-wp-bind--aria-current="callbacks.isSlideActive"><!-- wp:cover {"url":"<?php echo esc_url( $hero_slide_two ); ?>","dimRatio":30,"minHeight":600,"minHeightUnit":"px"} -->
<div class="wp-block-cover" style="min-height:600px"><img class="wp-block-cover__image-background" alt="" src="<?php echo esc_url( $hero_slide_two ); ?>" data-object-fit="cover" /><span aria-hidden="true" class="wp-block-cover__background has-background-dim-30 has-background-dim"></span>
<div class="wp-block-rt-carousel-carousel-slide embla__slide wp-block-carousel-carousel-slide" role="group" aria-roledescription="slide" data-wp-interactive="rt-carousel/carousel" data-wp-class--is-active="callbacks.isSlideActive" data-wp-bind--aria-current="callbacks.isSlideActive"><!-- wp:cover {"url":"<?php echo esc_url( $rt_carousel_slide_two ); ?>","dimRatio":30,"minHeight":600,"minHeightUnit":"px"} -->
<div class="wp-block-cover" style="min-height:600px"><img class="wp-block-cover__image-background" alt="" src="<?php echo esc_url( $rt_carousel_slide_two ); ?>" data-object-fit="cover" /><span aria-hidden="true" class="wp-block-cover__background has-background-dim-30 has-background-dim"></span>
<div class="wp-block-cover__inner-container"><!-- wp:heading {"textAlign":"center","level":1,"textColor":"white"} -->
<h1 class="wp-block-heading has-text-align-center has-white-color has-text-color">Build Something Amazing</h1>
<!-- /wp:heading -->
Expand All @@ -60,8 +60,8 @@
<!-- /wp:rt-carousel/carousel-slide -->

<!-- wp:rt-carousel/carousel-slide {"className":"wp-block-carousel-carousel-slide"} -->
<div class="wp-block-rt-carousel-carousel-slide embla__slide wp-block-carousel-carousel-slide" role="group" aria-roledescription="slide" data-wp-interactive="rt-carousel/carousel" data-wp-class--is-active="callbacks.isSlideActive" data-wp-bind--aria-current="callbacks.isSlideActive"><!-- wp:cover {"url":"<?php echo esc_url( $hero_slide_three ); ?>","dimRatio":30,"minHeight":600,"minHeightUnit":"px"} -->
<div class="wp-block-cover" style="min-height:600px"><img class="wp-block-cover__image-background" alt="" src="<?php echo esc_url( $hero_slide_three ); ?>" data-object-fit="cover" /><span aria-hidden="true" class="wp-block-cover__background has-background-dim-30 has-background-dim"></span>
<div class="wp-block-rt-carousel-carousel-slide embla__slide wp-block-carousel-carousel-slide" role="group" aria-roledescription="slide" data-wp-interactive="rt-carousel/carousel" data-wp-class--is-active="callbacks.isSlideActive" data-wp-bind--aria-current="callbacks.isSlideActive"><!-- wp:cover {"url":"<?php echo esc_url( $rt_carousel_slide_three ); ?>","dimRatio":30,"minHeight":600,"minHeightUnit":"px"} -->
<div class="wp-block-cover" style="min-height:600px"><img class="wp-block-cover__image-background" alt="" src="<?php echo esc_url( $rt_carousel_slide_three ); ?>" data-object-fit="cover" /><span aria-hidden="true" class="wp-block-cover__background has-background-dim-30 has-background-dim"></span>
<div class="wp-block-cover__inner-container"><!-- wp:heading {"textAlign":"center","level":1,"textColor":"white"} -->
<h1 class="wp-block-heading has-text-align-center has-white-color has-text-color">Join Our Community</h1>
<!-- /wp:heading -->
Expand Down
22 changes: 11 additions & 11 deletions examples/patterns/logo-showcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
exit;
}

$pattern_images_url = trailingslashit( RT_CAROUSEL_URL . '/examples/data/images' );
$logo_one = $pattern_images_url . 'logo-placeholder-1.svg';
$logo_two = $pattern_images_url . 'logo-placeholder-2.svg';
$logo_three = $pattern_images_url . 'logo-placeholder-3.svg';
$logo_four = $pattern_images_url . 'logo-placeholder-4.svg';
$logo_five = $pattern_images_url . 'logo-placeholder-5.svg';
$rt_carousel_images_url = trailingslashit( RT_CAROUSEL_URL . '/examples/data/images' );
$rt_carousel_logo_one = $rt_carousel_images_url . 'logo-placeholder-1.svg';
$rt_carousel_logo_two = $rt_carousel_images_url . 'logo-placeholder-2.svg';
$rt_carousel_logo_three = $rt_carousel_images_url . 'logo-placeholder-3.svg';
$rt_carousel_logo_four = $rt_carousel_images_url . 'logo-placeholder-4.svg';
$rt_carousel_logo_five = $rt_carousel_images_url . 'logo-placeholder-5.svg';
?>

<!-- wp:rt-carousel/carousel {"loop":true,"autoplayDelay":3000,"autoplayStopOnInteraction":false,"ariaLabel":"Partner Logos","metadata":{"categories":["rt-carousel"],"patternName":"rt-carousel/logo-showcase","name":"rtCarousel: Logo Showcase"},"className":"wp-block-carousel-carousel is-style-columns-3"} -->
Expand All @@ -28,35 +28,35 @@
<div class="wp-block-rt-carousel-carousel-viewport embla wp-block-carousel-carousel-viewport">
<div class="embla__container"><!-- wp:rt-carousel/carousel-slide {"className":"wp-block-carousel-carousel-slide"} -->
<div class="wp-block-rt-carousel-carousel-slide embla__slide wp-block-carousel-carousel-slide" role="group" aria-roledescription="slide" data-wp-interactive="rt-carousel/carousel" data-wp-class--is-active="callbacks.isSlideActive" data-wp-bind--aria-current="callbacks.isSlideActive"><!-- wp:image {"width":"200px","sizeSlug":"full","linkDestination":"none","align":"center","className":"is-style-rounded"} -->
<figure class="wp-block-image aligncenter size-full is-resized is-style-rounded"><img src="<?php echo esc_url( $logo_one ); ?>" alt="Partner Logo 1" style="width:200px" /></figure>
<figure class="wp-block-image aligncenter size-full is-resized is-style-rounded"><img src="<?php echo esc_url( $rt_carousel_logo_one ); ?>" alt="Partner Logo 1" style="width:200px" /></figure>
<!-- /wp:image -->
</div>
<!-- /wp:rt-carousel/carousel-slide -->

<!-- wp:rt-carousel/carousel-slide {"className":"wp-block-carousel-carousel-slide"} -->
<div class="wp-block-rt-carousel-carousel-slide embla__slide wp-block-carousel-carousel-slide" role="group" aria-roledescription="slide" data-wp-interactive="rt-carousel/carousel" data-wp-class--is-active="callbacks.isSlideActive" data-wp-bind--aria-current="callbacks.isSlideActive"><!-- wp:image {"width":"200px","sizeSlug":"full","linkDestination":"none","align":"center","className":"is-style-rounded"} -->
<figure class="wp-block-image aligncenter size-full is-resized is-style-rounded"><img src="<?php echo esc_url( $logo_two ); ?>" alt="Partner Logo 2" style="width:200px" /></figure>
<figure class="wp-block-image aligncenter size-full is-resized is-style-rounded"><img src="<?php echo esc_url( $rt_carousel_logo_two ); ?>" alt="Partner Logo 2" style="width:200px" /></figure>
<!-- /wp:image -->
</div>
<!-- /wp:rt-carousel/carousel-slide -->

<!-- wp:rt-carousel/carousel-slide {"className":"wp-block-carousel-carousel-slide"} -->
<div class="wp-block-rt-carousel-carousel-slide embla__slide wp-block-carousel-carousel-slide" role="group" aria-roledescription="slide" data-wp-interactive="rt-carousel/carousel" data-wp-class--is-active="callbacks.isSlideActive" data-wp-bind--aria-current="callbacks.isSlideActive"><!-- wp:image {"width":"200px","sizeSlug":"full","linkDestination":"none","align":"center","className":"is-style-rounded"} -->
<figure class="wp-block-image aligncenter size-full is-resized is-style-rounded"><img src="<?php echo esc_url( $logo_three ); ?>" alt="Partner Logo 3" style="width:200px" /></figure>
<figure class="wp-block-image aligncenter size-full is-resized is-style-rounded"><img src="<?php echo esc_url( $rt_carousel_logo_three ); ?>" alt="Partner Logo 3" style="width:200px" /></figure>
<!-- /wp:image -->
</div>
<!-- /wp:rt-carousel/carousel-slide -->

<!-- wp:rt-carousel/carousel-slide {"className":"wp-block-carousel-carousel-slide"} -->
<div class="wp-block-rt-carousel-carousel-slide embla__slide wp-block-carousel-carousel-slide" role="group" aria-roledescription="slide" data-wp-interactive="rt-carousel/carousel" data-wp-class--is-active="callbacks.isSlideActive" data-wp-bind--aria-current="callbacks.isSlideActive"><!-- wp:image {"width":"200px","sizeSlug":"full","linkDestination":"none","align":"center","className":"is-style-rounded"} -->
<figure class="wp-block-image aligncenter size-full is-resized is-style-rounded"><img src="<?php echo esc_url( $logo_four ); ?>" alt="Partner Logo 4" style="width:200px" /></figure>
<figure class="wp-block-image aligncenter size-full is-resized is-style-rounded"><img src="<?php echo esc_url( $rt_carousel_logo_four ); ?>" alt="Partner Logo 4" style="width:200px" /></figure>
<!-- /wp:image -->
</div>
<!-- /wp:rt-carousel/carousel-slide -->

<!-- wp:rt-carousel/carousel-slide {"className":"wp-block-carousel-carousel-slide"} -->
<div class="wp-block-rt-carousel-carousel-slide embla__slide wp-block-carousel-carousel-slide" role="group" aria-roledescription="slide" data-wp-interactive="rt-carousel/carousel" data-wp-class--is-active="callbacks.isSlideActive" data-wp-bind--aria-current="callbacks.isSlideActive"><!-- wp:image {"width":"200px","sizeSlug":"full","linkDestination":"none","align":"center","className":"is-style-rounded"} -->
<figure class="wp-block-image aligncenter size-full is-resized is-style-rounded"><img src="<?php echo esc_url( $logo_five ); ?>" alt="Partner Logo 5" style="width:200px" /></figure>
<figure class="wp-block-image aligncenter size-full is-resized is-style-rounded"><img src="<?php echo esc_url( $rt_carousel_logo_five ); ?>" alt="Partner Logo 5" style="width:200px" /></figure>
<!-- /wp:image -->
</div>
<!-- /wp:rt-carousel/carousel-slide -->
Expand Down
55 changes: 38 additions & 17 deletions inc/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,23 @@ protected function setup_hooks(): void {
add_filter( 'block_categories_all', [ $this, 'register_block_category' ] );
add_action( 'init', [ $this, 'register_pattern_category' ] );
add_action( 'init', [ $this, 'register_block_patterns' ] );
add_action( 'admin_init', [ $this, 'deactivate_legacy_plugin' ] );
add_action( 'admin_notices', [ $this, 'legacy_plugin_notice' ] );
add_action( 'network_admin_notices', [ $this, 'legacy_plugin_notice' ] );
}

/**
* Deactivate the legacy "Carousel Kit" plugin if still active.
* Show an admin notice if the legacy "Carousel Kit" plugin is still active.
*
* Handles both single-site and network-wide activations.
*/
public function deactivate_legacy_plugin(): void {
$old_plugin = 'carousel-kit/carousel-kit.php';
public function legacy_plugin_notice(): void {
$old_plugin = 'carousel-kit/carousel-kit.php';
$network_wide = is_multisite() && is_plugin_active_for_network( $old_plugin );

if ( ! is_plugin_active( $old_plugin ) ) {
return;
}

$network_wide = is_multisite() && is_plugin_active_for_network( $old_plugin );
if ( $network_wide && ! current_user_can( 'manage_network_plugins' ) ) {
return;
}
Expand All @@ -63,21 +64,41 @@ public function deactivate_legacy_plugin(): void {
return;
}

// Silent flag prevents deactivation hooks from firing redirect.
deactivate_plugins( $old_plugin, true, $network_wide );

if ( is_plugin_active( $old_plugin ) ) {
// Only show the notice in the matching admin context.
if ( is_network_admin() !== $network_wide ) {
return;
}

add_action(
'admin_notices',
static function (): void {
printf(
'<div class="notice notice-info is-dismissible"><p>%s</p></div>',
esc_html__( 'The old "Carousel Kit" plugin has been deactivated. rtCarousel is its replacement.', 'rt-carousel' )
);
}
if ( $network_wide ) {
$deactivate_url = wp_nonce_url(
add_query_arg(
[
'action' => 'deactivate',
'plugin' => $old_plugin,
'networkwide' => '1',
],
network_admin_url( 'plugins.php' )
),
'deactivate-plugin_' . $old_plugin
);
} else {
$deactivate_url = wp_nonce_url(
add_query_arg(
[
'action' => 'deactivate',
'plugin' => $old_plugin,
],
admin_url( 'plugins.php' )
),
'deactivate-plugin_' . $old_plugin
);
}

printf(
'<div class="notice notice-warning is-dismissible"><p>%s <a href="%s">%s</a></p></div>',
esc_html__( 'The "Carousel Kit" plugin is still active. rtCarousel is its replacement — please deactivate Carousel Kit.', 'rt-carousel' ),
esc_url( $deactivate_url ),
esc_html__( 'Deactivate Carousel Kit', 'rt-carousel' )
);
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rt-carousel",
"version": "2.0.0",
"version": "2.0.1",
"description": "Carousel block using Embla and WordPress Interactivity API",
"author": "rtCamp",
"private": true,
Expand Down
Loading
Loading