PluginProbe
Timed Content / 2.96
Timed Content v2.96
2.99 trunk 1.0 1.1 1.2 2.0 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.10 2.11 2.12 2.15 2.2 2.3 2.3.1 2.4 2.5 2.5.1 2.50 2.51 2.52 All 67 releases
timed-content / readme.txt

readme.txt in Timed Content 2.96, at readme.txt

463 lines 19.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 === Timed Content ===
2
3 Contributors: kjvtough, awelzel
4 Tags: timed content, marketing tool, schedule
5 Requires at least: 3.8
6 Tested up to: 6.8
7 Stable tag: 2.96
8 License: GPL2
9
10 Plugin to show or hide portions of a Page or Post based on specific date/time characteristics.
11
12 == Description ==
13
14 The Timed Content plugin allows users to specify that a portion of a Page or Post should appear/be visible or disappear/be invisible based on given time characteristics. You can also make portions of a Post or Page be visible at certain dates and times; you can even set up a schedule!
15
16 The plugin adds the following:
17
18 * A "client-side" shortcode that allows the marking of content to appear or disappear after a given time interval; a "fade" effect is included. This functionality is intended to be used for special effects only, as content marked in this manner is still visible in the HTML source and, therefore, not a secure method of hiding content.
19 * Two "server-side" shortcodes that allow the marking of content to be visible only during specified date/time intervals. This functionality **can** be used as a secure method of hiding content, because the marked content will be included in the Page/Post **only** when viewed in the specified date/time intervals.
20
21 A TinyMCE dialog is included to help users build the shortcodes. See the Screenshots tab for more info.
22
23 == Installation ==
24
25 1. Extract the contents of the package to the `/wp-content/plugins/timed-content` directory
26 2. Activate the plugin through the 'Plugins' menu in WordPress
27
28 == Frequently Asked Questions ==
29
30 = Projected dates/times seem to be fixed to a certain start date - why? =
31
32 Since it makes no sense to get all values of the past, the projected dates/times will not display all available dates but will limit the start date to the current date minus a certain value depending on the interval.
33
34 For hourly intervals: start at current date minus 1 day
35 For daily intervals: start at current date minus 7 days
36 For weekly intervals: start at current date minus 21 days
37 For monthly intervals: start at current date minus 80 days
38 For yearly intervals: start at current date minus 380 days
39
40 Example: you set a rule to start on January 1, 2013 with daily repetetion. To get all the possible dates for that rule until today and a few weeks in the future this would mean to calculate more than ten(!) years or 3650 values until today. But most likely you don't want to see the dates from 10 years ago but the values how they will be now and some repetitions into the future.
41
42
43 = Old rules after updating to version 2.50 =
44
45 In versions prior to 2.50 the date/time format was not handled very well which caused quite some confusion. Therefore version 2.50 now uses a fixed format similar to ISO 8601: yyyy-mm-dd HH:MM
46
47 Existing shortcodes and rules containing dates in the format mm/dd/yyyy should still work, but when editing rules the date value is converted to the new format.
48
49 To be sure, you should check your existing rules and shortcodes if you upgraded from a version below 2.50.
50
51 = Using Timed Content in Gutenberg =
52
53 If you want to use Timed Content with Gutenberg you have to add a "Classic" block. There is no way to show or hide other content blocks with Timed Content.
54
55 == Screenshots ==
56
57 1. An example showing use of the `[timed-content-client]` shortcode. The "alarm clock" button on the editor menubar brings up a dialog box to help build the Timed Content shortcodes.
58 2. The "Add Timed Content shortcode" dialog showing the Client tab. Check the attribute you want to add and fill in the textboxes.
59 3. The "Add Timed Content shortcode" dialog showing the Server tab. Check the attribute you want to add, then click on the Date and Time textboxes.
60 4. The date and time pickers help you format a correct date and time. Here's the jQuery UI Datepicker in action.
61 5. The "Add Timed Content shortcode" dialog showing the Timed Content Rules tab.
62
63 == Changelog ==
64
65 = 2.96 =
66
67 * Internal code refactoring for frequency option.
68 * Fix adjustment for DST switches to keep start/end time constant.
69
70 = 2.95 =
71
72 * Updated compatibility information for WordPress.
73
74 = 2.94 =
75
76 * Fix PHP warning in rule calculation.
77
78 = 2.93 =
79
80 * Fix interval calculation for monthly rules.
81 * Fix DST adjustments in calculation for certain rule combinations.
82
83 = 2.92 =
84
85 * Fixed output of incorrect time values in projected dates/times.
86
87 = 2.91 =
88
89 * Updated compatibility information for WordPress.
90 * Added additional weekday ordinal "fifth", where only the fifth ordinal of a weekday of a month will be used if it exists and not the last ordinal, regardless if the weekday is repeated four or five times.
91
92 = 2.90 =
93
94 * Use WordPress timezone setting as default for new server side rules and when server side shortcodes don't contain a
95 timezone in the date/time parameter.
96
97 = 2.82 =
98
99 * Updated compatibility information for WordPress.
100
101 = 2.81 =
102
103 * Updated compatibility information for WordPress.
104
105 = 2.80 =
106
107 * Updated compatibility information for WordPress.
108
109 = 2.79 =
110
111 * Fix backend code for admin dashboard "right now" output of timed content rule links.
112
113 = 2.78 =
114
115 * Fixed a JavaScript error message in the backend UI.
116
117 = 2.77 =
118
119 * Updated compatibility information for WordPress.
120
121 = 2.76 =
122
123 * Fixed a bug which caused server side "hide" rules not to work any longer.
124
125 = 2.75 =
126
127 * Fixed a bug which caused client side "hide" rules not to work any longer.
128
129 = 2.74 =
130
131 * Fixed compatibility issue with PHP 7.
132
133 = 2.73 =
134
135 * Fixed security issue with client side shortcodes which allowed to insert raw HTML and JavaScript via the shortcode.
136 * Refactored codebase according to WordPress Core coding guidelines.
137 * Adjusted time calculation to keep time in rules independent of current DST.
138 * Fixed a bug when creating new a server side rule and leaving the editor without saving it.
139
140 = 2.72 =
141
142 * Fixed deprecation warnings with PHP 8.1.
143
144 = 2.71 =
145
146 * Changed loading translations to support using custom translations by LOCO Translate.
147
148 = 2.70 =
149
150 * The number of calculated date/time values is limited to avoid too many values for very long periods.
151
152 = 2.69 =
153
154 * Updated compatibility for WordPress 6.0
155
156 = 2.68 =
157
158 * Fixed a problem with shortcodes on pages without post object.
159
160 = 2.67 =
161
162 * Refactor backend code to avoid errors in situations when there is no current post but a post is expected.
163
164 = 2.66 =
165
166 * Updated compatibility information for WordPress 5.8.
167
168 = 2.65 =
169
170 * Fixed a PHP warning which could occur if no exceptions are defined in a rule.
171
172 = 2.64 =
173
174 * Fixed empty TinyMCE dialog.
175
176 = 2.62-2.63 =
177
178 * Fixed PHP 7.3 compatibility issues.
179
180 = 2.61 =
181
182 * Fixed PHP notice when using rules without exceptions.
183
184 = 2.60 =
185
186 * Fixed broken handling of rule exceptions.
187 * Changed label for intervals in rule editor.
188
189 = 2.58 =
190
191 * Changed the way how debug output is generated to the old variant without HTML sanitizing to make it easier to understand the output (thanks to Enrico Bacis for this).
192
193 = 2.57 =
194
195 * Extended `debug` parameter: it's now also possible to show debug output only if content is hidden (thanks to Enrico Bacis for this).
196
197 = 2.56 =
198
199 * Use of 'UTC' instead of '+0000' as default time zone to avoid problems with older PHP versions (eventhough you should better update to a supported PHP version).
200
201 = 2.55 =
202
203 * Better handling of shortcodes with invalid timezones to avoid unhandled runtime exceptions.
204 * Improved debug output.
205
206 = 2.54 =
207
208 * Default date values for new rules will now be in the correct format and not in the local date format of WordPress.
209
210 = 2.53 =
211
212 * Added support for old shortcodes with localized date formats again. Every date/time which can be used in `strtotime()` should work now as well.
213 * Improved format of debug output.
214
215 = 2.52 =
216
217 * Fixed a bug for server side shortcodes without or invalid "hide" attribute which did always hide the content.
218
219 = 2.51 =
220
221 * Fixed a bug where the "hide" attribute of server side shortcodes did not get parsed correctly.
222
223 = 2.50 =
224
225 * Major code refactoring and cleanup - please check your existing rules and shortcodes if they still work as expected and change them if needed!
226 * Increased minimum required WordPress version to 3.8
227 * Date format for new shortcodes and rules is now always "yyyy-mm-dd HH:MM" (similar to ISO 8601)
228 * Existing dates in rules and shortcodes will be parsed as "mm/dd/yyyy HH:MM" if they contain slashes
229 * Time values containing "AM" or "PM" will still work but converted to 24h format internally
230
231 = 2.15 =
232
233 * Fixed 404 error caused by wrong URL for jquery date/time picker localization.
234 * Current date/time in TinyMCE dialog will be displayed as "yyyy-mm-dd HH:MM" as well.
235
236 = 2.10 =
237
238 * Fixed a problem with unexpected `p` elements inside server side timed content sections.
239
240 = 2.9 =
241
242 * Changed default sort order of the rules in the backend to the title.
243
244 = 2.8 =
245
246 * Added debug parameter `tctest`.
247
248 = 2.7 =
249
250 * Fixed deprecated class constructors.
251
252 = 2.6 =
253
254 * New action hooks.
255 * `[timed-content-rule]` shortcode now accepts a Timed Content Rule name as well as an ID.
256 * Streamlined i18n for date/time pickers (Use values available in Wordpress settings and `$wp_locale` when available, combined *-i18n.js files into one).
257 * Some developer docs in the `readme.txt`
258
259 = 2.5.1 =
260
261 * Fixed `current_time()` bug in __rulesShowHTML() introduced in 2.5.
262
263 = 2.5 =
264
265 * Removed dependency on jQuery UI Dialog; now uses Thickbox.
266 * Added and modified `fix_date_i18n()` from https://core.trac.wordpress.org/ticket/25768 to better handle DST and timezones with i18n.
267 * Added custom filter `timed_content_filter_override` so admins can modify/replace `timed_content_filter` if necessary.
268 * Using built-in spinner image now instead of `wpspin.gif`
269
270 = 2.4 =
271
272 * Removed `timed-content-admin-tinymce.js` (No need anymore; required JS variables now hooked directly into editor). Fixes incompatibility with OptimizePress.
273
274 = 2.3.1 =
275
276 * Fixed minor bugs related to Exception Dates.
277 * Optimized rule periods arrays (array only needs 'status' and 'time' when it's meant to be human-readable).
278 * Added custom filter `timed_content_filter` to emulate `apply_filter( 'the_content', ... )` functionality for content.
279
280 = 2.3 =
281
282 * Fixed bug when setting up weekly recurrence for Timed Content Rules.
283 * NEW! Exception Dates (dates on which your Timed Content Rule shouldn't run).
284
285 = 2.2 =
286
287 * Much improved i18n
288 * New Spanish translation - Many thanks to Andrew Kurtis and Jelena Kovacevic from WebHostingHub (Nueva traducción de español - Muchas gracias a Andrew Kurtis y Jelena Kovacevic desde WebHostingHub).
289
290 = 2.1.5 =
291
292 * Unified dashicons among all of my plugins.
293 * Minor improvements in TinyMCE dialog UI and Date/Time UI controls.
294
295 = 2.1.4 =
296
297 * Fixed TinyMCE editor button for TinyMCE 4.x.
298
299 = 2.1.3 =
300
301 * Removed support for PHP4 in `customFieldsInterface.php`.
302 * Fixed Wordpress version check for deciding which image to use for TinyMCE button.
303 * Fixed "Strict Standards" warning in PHP 5.4 in `__getNextWeek()`.
304
305 = 2.1.2 =
306
307 * Dashicons support for WP 3.8 + added. Support for old-style icons in Admin/TinyMCE is deprecated.
308 * Added versioning to all `wp_enqueue_style()` calls.
309
310 = 2.1.1 =
311
312 * CSS for JQuery UI now loaded locally as required by Wordpress plugin repository rules.
313 * Improved UX on TinyMCE dialog and Timed Content Rules detail page.
314
315 = 2.1 =
316
317 * Fixed inconsistency in how the days of week to repeat on were being set up between the front and back ends.
318 * Fixed variable scope bug that occurred on activation.
319 * Improved i18n.
320
321 = 2.0 =
322
323 * Added Timed Content Rules.
324 * Replaced AnyTime plugin with jQuery UI Timepicker (http://fgelinas.com/code/timepicker) and Wordpress's internal jQuery UI Datepicker.
325 * HTML code created by `[timed-content-client]` can now either be enclosed in either `<div>` or `<span>` tags.
326 * Debugging statements for `[timed-content-server]` now displayed on Post/Page (only if logged in and have the rights to edit that Post/Page - no more digging into the HTML source).
327 * Improved code documentation.
328
329 = 1.2 =
330
331 * Upgraded AnyTime jQuery plugin.
332 * `timed-content.js` is now always loaded (Size > 1KB, so not a lot of extra overhead); fixes bug when multiple/nested shortcodes are used.
333
334 = 1.1 =
335
336 * Fixed some internal filename discrepancies.
337
338 = 1.0 =
339
340 * Initial release.
341
342 == Examples ==
343
344 `[timed-content-client show="1:00"]Show me after one minute. Since we don't want a fade-in, we can leave it out of the "show" attribute completely.[/timed-content-client]`
345
346 `[timed-content-client show="1:00:1000"]Show me after one minute with a 1000 millisecond (1 second) fade-in.[/timed-content-client]`
347
348 `[timed-content-client hide="1:00:1000"]Hide me after one minute with a 1000 millisecond (1 second) fade-out.[/timed-content-client]`
349
350 `[timed-content-client show="1:00:500" hide="5:00:2000"]Show me after one minute with a 500 millisecond (a half-second) fade-in, then hide me after five minutes with a 2000 millisecond (2 seconds) fade-out.[/timed-content-client]`
351
352 `[timed-content-server show="2013-09-13 20:30:00 -0600"]Show me starting at 8:30 PM Central Standard Time on September 13th, 2013. I will not be displayed before then.[/timed-content-server]`
353
354 `[timed-content-server hide="2013-09-13 20:30:00 America/Chicago"]Hide me starting at 8:30 PM Central Daylight Time (i.e., the same timezone as Chicago) on September 13th, 2013. I will not be displayed after then[/timed-content-server]`
355
356 `[timed-content-server show="2013-09-13 20:30:00 -0600" hide="2013-09-13 21:30:00 -0600"]Show me starting at 8:30 PM Central Standard Time on September 13th, 2013, then hide me an hour later. I will not be displayed before or after then.[/timed-content-server]`
357
358 `[timed-content-rule id="164"]Display me based on the settings for the Timed Content Rule whoseID is 164.[/timed-content-rule]`
359
360 == Usage ==
361
362 NOTE: All shortcodes can be built using the TinyMCE dialog. When in doubt, use the dialog to create correctly formed shortcodes.
363
364 **The timed-content-client shortcode**
365
366 `[timed-content-client show="mm:ss:fff" hide="mm:ss:fff"]Example Text[/timed-content-client]`
367
368 * `show` - Specifies the time interval after loading the web page when the marked content should be displayed. The attribute consists of three parts,
369 separated by colons: `mm` - minutes, `ss` - seconds, and `fff` - if greater than `0`, a fade-in effect lasting `fff` milliseconds is applied.
370 * `hide` - Specifies the time interval after loading the web page when the marked content should be hidden. The attribute consists of three parts,
371 separated by colons: `mm` - minutes, `ss` - seconds, and `fff` - if greater than `0`, a fade-out effect lasting `fff` milliseconds is applied.
372
373 Both attributes are optional, but at least one attribute must be included. Leading zeros (0) are optional. The shortcode's behaviour depends on which attributes are used:
374
375 * `show` only - Marked content is initially not visible, then appears `mm` minutes and `ss` seconds after loading with a `fff` millisecond fade-in.
376 * `hide` only - Marked content is initially visible, then disappears `mm` minutes and `ss` seconds after loading with a `fff` millisecond fade-out.
377 * `show` and `hide` - Marked content is initially not visible, then appears according to the values set in `show`, then disappears according to the values set in `hide`.
378
379 Your users must have JavaScript enabled for this shortcode to work.
380
381 **The timed-content-server shortcode**
382
383 `[timed-content-server show="datetime" hide="datetime" debug="true|false|when_hidden"]Example Text[/timed-content-server]`
384
385 * `show` - Specifies the date/time when the marked content should start being included on the web page.
386 * `hide` - Specifies the date/time after which the marked content should stop being included on the web page.
387 * `debug` - If `true`, adds some debugging statements to the web page as HTML comments. If `when_hidden`, the debugging statements are added only when the content is hidden. Defaults to `false`.
388
389 The date and time are expected to be yyyy-mm-dd HH:MM (similar to ISO 8601), for example `2019-04-07 15:30` for April 7, 2019, 15:30. For backward compatiblity old "human readable" date formats should also work, but these should not be used any longer!
390
391 In addition you can provide a timezone in the date/time parameter either as name or as offset like `2019-04-07 15:30 America/Chicago` or `2019-04-07 15:30 +0200`. If you do not provide a timezone, the WordPress timezone setting will be used as default.
392
393 Both `show` and `hide` attributes are optional, but at least one attribute must be included. The shortcode's behaviour depends on which attributes are used:
394
395 * `show` only - Marked content is outputted only after the date/time set here.
396 * `hide` only - Marked content is outputted only before the date/time set here.
397 * `show` and `hide` - Marked content is outputted only during the time period defined by the `show` and `hide` attributes.
398
399 **The timed-content-rule shortcode**
400
401 `[timed-content-rule id="{rule_id}|{rule_name}"]Example Text[/timed-content-rule]`
402
403 You can find the correct shortcode from the Timed Content Rules overview page, or use the TinyMCE dialog.
404
405 **Testing server side rules**
406
407 For testing the behaviour of server side rules at specific times, you may use the GET parameter `tctest` in an URL, followed by date and time in the format `YYYY-MM-DD+hh:mm:ss`. This works only you are logged in with a user which has the right to edit the displayed page or post. For example: `http://mysite.example?tctest=2018-02-10+19:16:00` will show the content as if it was February 10, 2018 at 19:16.
408
409 == Developer Documentation ==
410
411 **Action hooks**
412
413 `add_action( "timed_content_server_show", "{function_name}", {priority_level}, 4 );`
414
415 Fired when the `[timed-content-server]` shortcode is encountered *AND* the content is to be displayed based on the shortcode's show/hide attributes. Functions using this hook should accept the following arguments in order:
416
417 * `$post_id` - the ID of the currently displayed Post/Page
418 * `$show` - the value of the `show` attribute. If not set, defaults to "1970-Jan-01 00:00:00 +000"
419 * `$hide` - the value of the `hide` attribute. If not set, defaults to "2038-Jan-19 03:14:07 +000"
420 * `$content` - The content enclosed by the shortcode
421
422 `add_action( "timed_content_server_hide", "{function_name}", {priority_level}, 4 );`
423
424 Fired when the `[timed-content-server]` shortcode is encountered *AND* the content is to be hidden based on the shortcode's show/hide attributes. Functions using this hook should accept the following arguments in order:
425
426 * `$post_id` - the ID of the currently displayed Post/Page
427 * `$show` - the value of the `show` attribute. If not set, defaults to "1970-Jan-01 00:00:00 +000"
428 * `$hide` - the value of the `hide` attribute. If not set, defaults to "2038-Jan-19 03:14:07 +000"
429 * `$content` - The content enclosed by the shortcode
430
431 `add_action( "timed_content_rule_show", "{function_name}", {priority_level}, 3 );`
432
433 Fired when the `[timed-content-rule]` shortcode is encountered *AND* the content is to be displayed based on the Timed Content Rule's properties. Functions using this hook should accept the following arguments in order:
434
435 * `$post_id` - the ID of the currently displayed Post/Page
436 * `$rule_id` - the ID of the Timed Content Rule being called. Use `get_post_meta( $rule_id )` to get the Rule's properties.
437 * `$content` - The content enclosed by the shortcode
438
439 `add_action( "timed_content_rule_hide", "{function_name}", {priority_level}, 3 );`
440
441 Fired when the `[timed-content-rule]` shortcode is encountered *AND* the content is to be hidden based on the Timed Content Rule's properties. Functions using this hook should accept the following arguments in order:
442
443 * `$post_id` - the ID of the currently displayed Post/Page
444 * `$rule_id` - the ID of the Timed Content Rule being called. Use `get_post_meta( $rule_id )` to get the Rule's properties.
445 * `$content` - The content enclosed by the shortcode
446
447 **Filter hooks**
448
449 `timed_content_filter`
450
451 Filter for any content enclosed by a Timed Content shortcode. Implements the same filters as `the_content`:
452
453 * `wptexturize`
454 * `convert_smilies`
455 * `convert_chars`
456 * `wpautop`
457 * `prepend_attachment`
458 * `do_shortcode`
459
460 `timed_content_filter_override`
461
462 Replaces the `timed_content_filter` with another pre-existing filter to use for any content enclosed by a Timed Content shortcode. Any function hooked into this filter must return the name of a filter (as a string).
463