GithubHelp home page GithubHelp logo

humanmade / repeatable-posts Goto Github PK

View Code? Open in Web Editor NEW
48.0 22.0 12.0 260 KB

A WordPress plugin that enables the creation of repeating posts

Home Page: http://engineering.hmn.md

License: GNU General Public License v2.0

PHP 97.83% CSS 0.58% JavaScript 1.59%

repeatable-posts's Introduction

Repeatable Posts
Designate a post as repeatable and it'll be copied and re-published on a weekly basis.
Coverage via Codecov
Scrutinizer Code Quality Score
Build Status
A Human Made project. Maintained by @willmot.

How does it work?

Once you set a post as repeating and publish it an exact copy of that post is made and scheduled for publishing a week after the publish date of the original post. Once that repeat post is published it is again copied and set to publish the week after that. This continues until the heat death of the universe, or until you remove the plugin, whichever comes first.

Why does it exist?

We use this on our internal blogs to schedule recurring reminders and announcements. For example every week a "weekly updates" post is published, prompting everyone to comment with what they've been working on that week.

Want to contribute?

There's likely some issues already, if not create some! Any code changes should be submitted as Pull Requests. Thanks!

Interested in joining in on the fun? Join us, and become human!

UI

Repeating and repeat posts are highlighted as such on the edit posts page.


When editing a post you can easily set whether it should repeat.


Repeat posts show a convenient link back to the original.

Changelog

0.4

  • Increase test coverage above 85%
  • Introduce additional daily & monthly repeating intervals. Props @noplanman.

0.3

  • Introduce unit tests
  • Fix several critical bugs

0.2

  • Refactor based on feedback from Human Made team

0.1

  • Initial release

License

Repeatable Posts is licensed under the GPLv2 or later.

Credits

Created by Human Made.

Written and maintained by Tom Willmot.

repeatable-posts's People

Contributors

dashaluna avatar ipstenu avatar noplanman avatar roborourke avatar willmot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

repeatable-posts's Issues

Make repeatable posts compatible with Gutenberg.

The new block editor is now in core and the interface by which one interacts with a repeating post (to pause, alter or delete it) is not visible in the post sidebar. Basically it's non-obvious as to how to alter an existing repeating post.

I'm currently assuming that deleting the next post that's due to repeat is sufficient, but that isn't clear.

Include use case in readme.md

I'm trying to think of a good use case for this plugin, maybe if you suggest a couple in the readme file then people like me won't need to think.

Creating duplicate posts like crazy

We had to disable this internally as it created about 400 duplicate posts. WordPress.org ran into the same issue when they tried to use it on the WCEU site.

Need to track down issue and fix.

Repeating post is marked as such even though a Repeat post is not created for it (due to be scheduled in the past)

A Repeat post is created only if date of a Repeating post + it's schedule is in the future.

When you setup a post to be a Repeating post with a schedule such that a Repeat post date happens to be in the past (read example below), the Repeat post is not created. However, the Repeating post is marked as Repeating. This is confusing!

Solution: an error message should be displayed in such case while trying to save a post with a Repeating schedule. That post won't be saved as Repeating post.

Example: main post (that we're wanting to set as a Repeating post) is published on the 10th October and we're setting it to be a Daily Repeating post. So a daily repeat post would have been scheduled for the 11th October. However, if present time (when we're saving changes) is anything past the 11th October, say the 12th October - then Repeat post date is in the past and therefore it is not published.

Unit Test

Because it's the right thing to do

Repeating posts list

It might make sense to add a new link to the posts lists to easily display all repeating posts in one list.
When handling a whole bunch of posts, this makes it easier to manage repeatable ones.

Something like this:
repeating-posts

Code Review

Suggestion: Have an 'end date'

Current this runs until the heat death of the universe. It would be nice to have the ability to stop repeating on a date or after X times.

Better stop repeating UX

Currently it's not obvious how to stop a post repeating. It should be.

There are two ways to stop a post repeating currently:

  1. Edit the original post and set it to not repeat.
  2. Delete the next scheduled post so that the repeat cycle is broken.

1 should really be the only intentional way, but needs to be made more obvious as a users natural inclination is to edit the current post or the next scheduled post rather than the original.

2 is almost a bug as it's not clear that the users intention was that the repeating should be canceled just because they deleted the next scheduled post, maybe they just wanted to skip that week for example...

Custom Post Types

This looks to be exactly what I need for my site but it doesn't currently work with custom post types. Would this be possible to implement? I have a custom post type called track and need it to work with that.
Cheers.
Rick

Allow filter next post title

Use case: we have weekly update posts for company to write what they have been up to that week. We manually change the post title to include week number and year of that post.

`hm-post-repeat` meta is added to both Repeating and Repeat posts

The Repeating (aka main) post should have hm-post-repeat meta key with the value of repeat schedule (daily, weekly, etc).

The Repeat (aka clone) post should not have that meta key.

However, when creating a post and setting it as a repeat post and saving it; both Repeating and Repeat post have got hm-post-repeat meta key.

Suggestion: Add unpublish option

This may seem like a strange suggestion when reading only the title, but please hear me out :)

For a website i'm (heavily) working on, I have a lot of seasonal relevant posts. Preferably, I would like these posts to only appear when they are in season.

An example for repeating + unpublishing

Let's say that we have a generic post about Christmas. The post should become visible every year in December (thus repeatable). Since the post isn't relevant the rest of the year it should be unpublished on the first of January (either change from 'published' to 'draft' or 'remove' altogether. Perhaps this implementation can possibly be combined with #5 ?).

I'm curious to hear what others think of this idea (interesting, useless?)

How could this 'unpublishing' be achieved?

An idea for implementation is as follows:

  1. option to set an unpublish date from the admin interface
  2. when saving the post, either save OR remove the unpublish date from the post's meta info. Which of these actions is executed is dependent of user input.
  3. when the meta info changes, set a scheduled event to unpublish the post, or remove an earlier set scheduled event (if any).

Extra:
4. upon post delete / restore, trigger action nr. 3.

...and repeatable unpublishing?

For repeatable posts, one could hook into the scheduling of the next post, and correct the unpublish date in the meta info with the repeat interval.

Support repeating on more intervals

Currently weekly is hardcoded, we should support more intervals.

At a minimum we might as well support the built in WordPress cron intervals, hourly, twice-daily, daily, weekly, fortnightly, monthly.

Release on the .org plugin directory

Before we release to the world we should.

  • Make sure someone else in HM has code reviewed my dodgy code
  • Create a plugin icon
  • Create a plugin banner
  • Make sure the plugin is setup for translations
  • Add a readme.txt
  • Add some unit tests

Add a fortnightly recurrence

Fortnightly is quite a common need (we need it for our fortnightly Operations team hangout agenda post), let's add it as a default.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.