Falling Cherry Flower

Plugin Banner

Falling Cherry Flower

by dogrow

Download
Description

Add [ytmr_falling_flower] to a post, page or Shortcode block to display falling flowers.

Examples:

  • [ytmr_falling_flower]
  • [ytmr_falling_flower type=”autumnleaf” speed=”3″]

The type defaults to cherryflower. Speed must be an integer from 0 (slowest) to 5 (fastest); the default is 2. Invalid values use the defaults.

Only one overlay is created per page. When several shortcodes are rendered, the first one supplies the settings.

Scripts and styles are loaded only when the shortcode is rendered. The animation uses CreateJS/EaselJS, shares its ten images, and is limited to 150 flowers and approximately 50 frames per second. It stops updating in hidden tabs. Visitors can pause or resume the animation using the button at the bottom right. The animation is disabled when the device requests reduced motion and is hidden when printing.

This plugin does not send analytics or contact external services. Images and scripts are served from your site’s configured URLs.

Third-party libraries

CreateJS EaselJS 1.0.0 is bundled under the MIT license. No CDN is required.

  • Project: https://github.com/CreateJS/EaselJS/tree/1.0.0
  • Minified distribution: js/easeljs.min.js
  • Corresponding readable source: js/easeljs.js
  • License: js/EaselJS-LICENSE.txt
  1. Back up any custom images stored inside the old plugin directory BEFORE updating.
  2. Upload the falling-cherry-flower folder to /wp-content/plugins/ and activate the plugin.
  3. Add [ytmr_falling_flower] to a post, page or Shortcode block.

WordPress 6.3 or later and PHP 8.2 or later are required.

Can I use my own images?

Yes. Put ten PNG files named 0.png through 9.png in:

{uploads directory}/falling-cherry-flowers/{image-set-name}/

The uploads directory is normally wp-content/uploads. On multisite, use the uploads directory of the individual site. Image-set names may contain ASCII letters, digits, hyphens and underscores, up to 64 characters.

For example, put the images in wp-content/uploads/falling-cherry-flowers/my-flowers/ and use [ytmr_falling_flower type=”my-flowers”].

The built-in names cherryflower and autumnleaf are reserved. Missing or incomplete sets fall back to cherryflower. Unloadable individual images are skipped; if no image loads, the animation and button stay hidden.

What happens to existing custom images?

Legacy sets inside {plugin directory}/img/{image-set-name}/ are still supported. However, WordPress can replace this directory during an update. Before updating, copy your custom sets to the uploads location above, retaining their names. This plugin does not automatically move or delete your files. For custom names, a complete uploads set takes precedence over a legacy set.

Can I use widgets?

Use a Shortcode block in a block widget area. Modern Text widgets that support WordPress’s standard shortcode processing can also be used. Legacy widgets which relied on this plugin to enable every shortcode should be migrated to a Shortcode block.

Why is the animation not moving?

Check your device’s reduced-motion preference and the pause button. Background tabs are intentionally paused. The theme must call the standard WordPress header/footer hooks. RSS feeds do not include the overlay.

1.1.0

  • Strictly validate speed and image-set names, and safely encode configuration data.
  • Confine custom image paths to their allowed directories.
  • Load assets only for rendered shortcodes, with explicit script dependencies.
  • Retain CreateJS rendering and update to EaselJS 1.0.0, removing unused bundled libraries.
  • Reuse images, fix particle limits, removal and rotation, and use elapsed-time movement.
  • Add pause/resume and reduced-motion support, and stop background-tab updates.
  • Support custom images in uploads, retaining legacy image-set compatibility.
  • Use the first shortcode’s settings when a page contains multiple shortcodes.
  • Require WordPress 6.3 and PHP 8.2 or later.

1.0

  • Initial release.
Back to top