• Resolved CoFOX

    (@coyotech)


    How secure is this plugin does it somehow activate php in content to allow it do these conditional statements? Also If only put a start time and end time but no day will the content be displayed daily. Also can it be set to display only on certain days like Mon, Wed and Fri only.

Viewing 1 replies (of 1 total)
  • Plugin Author Gabriel Serafini

    (@gserafini)

    Hi @coyotech,

    The end_day_time shortcode parameter is the only required one. The value contained in this attribute (and start_day_time as well) is parsed by the PHP strtotime() function. It doesn’t “activate” PHP in the content, so is pretty secure as far as I know.

    You can read through the code to see what specifically happens, but basically it compares the end day / time with the start day / time, and if it’s inside that timeframe it will show the content included inside the shortcode.

    The function expects to be given a string containing an English date format and will try to parse that format into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 UTC), relative to the timestamp given in now, or the current time if now is not supplied.

    I believe tt won’t currently work to show content on multiple days in a single shortcode, but I think you could probably use the shortcode 3 times in your post to accomplish what you’re asking. Something like:

    [display_during start_day_time="Mon 12:01 am" end_day_time="Mon 11:59 pm" message=""]YOUR_CONTENT_TO_DISPLAY_ON_MONDAY[/display_during][display_during start_day_time="Wed 12:01 am" end_day_time="Wed 11:59 pm" message=""]YOUR_CONTENT_TO_DISPLAY_ON_WEDNESDAY[/display_during][display_during start_day_time="Fri 12:01 am" end_day_time="Fri 11:59 pm" message=""]YOUR_CONTENT_TO_DISPLAY_ON_FRIDAY[/display_during]

    You’d have to experiment with it to see about using it to show content during a set time period only. If it doesn’t work when you try just putting time in, you could extend the example above to specify each day of the week.

Viewing 1 replies (of 1 total)

The topic ‘How secure is this plugin’ is closed to new replies.