Skip to content

Commit

Permalink
adding all of the files
Browse files Browse the repository at this point in the history
  • Loading branch information
WillBrubaker committed May 17, 2014
1 parent e045f02 commit c899de3
Show file tree
Hide file tree
Showing 44 changed files with 2,002 additions and 1 deletion.
675 changes: 675 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

974 changes: 974 additions & 0 deletions automatic-post-publishing-scheduler.php

Large diffs are not rendered by default.

Binary file added css/images/animated-overlay.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/maintenance.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_diagonals-thick_18_b81900_40x40.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_diagonals-thick_20_666666_40x40.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_flat_0_aaaaaa_40x100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_flat_10_000000_40x100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_flat_75_ffffff_40x100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_glass_100_f6f6f6_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_glass_100_fdf5ce_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_glass_55_fbf9ee_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_glass_65_ffffff_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_glass_75_dadada_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_glass_75_e6e6e6_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_glass_95_fef1ec_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_gloss-wave_35_f6a828_500x100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_highlight-soft_75_cccccc_1x100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-icons_222222_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-icons_228ef1_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-icons_2e83ff_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-icons_454545_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-icons_888888_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-icons_cd0a0a_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-icons_ef8c08_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/ui-icons_ffd27a_256x240.png
Binary file added css/images/ui-icons_ffffff_256x240.png
5 changes: 5 additions & 0 deletions css/jquery-ui.min.css

Large diffs are not rendered by default.

72 changes: 72 additions & 0 deletions css/scheduler.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#assign_time_slots label {
float: left;
display: block;
width: 50px;
position: relative;
top: 5px;
}

#week-days {
width: 100%;
display: block;
float: left;
text-align: center;
font-size: 1.25em;
font-weight: 400;
}

#week-days label{
float: left;
margin: 10px;
}

#overlay, .overlay {
z-index: 1000;
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 100%;
background: #FFF;
opacity: 0.45;
-moz-opacity: 0.45;
filter: alpha(opacity=45);
display: none;
}

.defined-dates {
border: 1px solid #C0C0C0;
border-radius: 3px;
width: 350px;
padding: 5px;
margin: 5px;
}

.defined-dates div {
margin: 5px;
}
.lone-date {
margin: 5px 10px;
padding: 5px;
}

.preloader {
display: block;
width: 98px;
height: 98px;
position: absolute;
top: 50%;
left: 50%;
margin-top: -20px;
margin-left: -20px;
background: url('../images/maintenance.gif') no-repeat center;
}

label.remove {
color: red;
margin: 1px 2px;
}

form#excluded-dates, form#excluded-days {
position: relative;
}
Binary file added images/maintenance.gif
Binary file added images/wwm_wp_menu.png
Empty file added index.php
Empty file.
51 changes: 51 additions & 0 deletions js/publishnow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
jQuery(document).ready(function($) {

$('input[type="submit"]').on('click', function() {
$('#quick-press').data('button', this.name);
});


$('#quick-press').on('submit', function(e) {
var submitButton = $(this).data('button') || $('input[type="submit"]').get(0).name;
if (submitButton == 'publish') {
myalert("Thanks for your article!", alertText);
}
});

function myalert(title, text) {
var div = $('<div>').html(text).dialog({
title: title,
modal: false,
width: '40%',
close: function() {
$(div).dialog('destroy').remove();
},
buttons: [{
text: "Ok",
click: function() {
$(this).dialog("close");
}
}]
})
};
var alertText = "<p>The article you submitted has been scheduled for a later time to ensure articles are spaced out and published during higher traffic periods. Do not be alarmed, the web mechanic is trying to make sure your article gets the visibility it deserves!</p> <p>Lower traffic periods: Late Nights, Early Mornings, and Weekends are generally avoided.</p>";


$('a.publish-now').on('click', function(e) {
e.preventDefault();
var nonce = $(this).attr('data-nonce');
var split = $(this).attr('href').replace('?', '').split('&').map(function(val) {
return val.split('=');
});
postID = split[0][1];
$.post(ajaxurl, {
'action': 'publish_now',
'pid': postID,
'_wp_nonce': nonce
}, function(data) {
if (data.error) alert(data.error);
else location.reload(true);

});
});
});
127 changes: 127 additions & 0 deletions js/scheduleroptions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
jQuery(document).ready(function($) {
var timeSlotCount = $('.hour_input').length;

$('#time_slots').val(timeSlotCount);
$('#existing_count').val(timeSlotCount);

$('#set_time_slots').on('submit', function(e) {
e.preventDefault();
var timeSlotCount = $('.hour_input').length;
var existingCount = timeSlotCount;
var slotsAskedFor = $('[name="time_slots"]').val();
if (slotsAskedFor == existingCount) {
//nothing to do here
} else if (slotsAskedFor > existingCount) {

for (i = existingCount; i < slotsAskedFor; i++) {
existingCount = i;

$('#new_time_slots').append('<div class="slot_input"><span class="label"><label for="hh[' + i + ']">slot ' + (i + 1) + ' : </label></span><input type="text" class="hour_input" id="hh[' + i + ']" value="" name="hh[' + i + ']" size="2" maxlength="2" autocomplete="off"> : <input type="text" id="mn[' + i + ']" class="mn_input" value="" name="mn[' + i + ']" size="2" maxlength="2" autocomplete="off"> <select name="ampm[' + i + ']" class="ampm_sel"><option value="am">am</option><option value="pm">pm</option></select><br /></div>');
}

} else {
for (i = existingCount; i > slotsAskedFor; i--) {
$('.slot_input:last').remove();
existingCount = i;
}

}
});

$('#assign_time_slots').on('submit', function(e) {
e.preventDefault();

$.post(ajaxurl, $(this).serializeArray(), function(data) {
var i = 0;
var timeSlotCount = $('.hour_input').length;
var existingCount = timeSlotCount;
var slotsAskedFor = $(data).length;

$(data).each(function() {
hh = $(this)[0];
mn = $(this)[1];
ampm = $(this)[2];
$('[name="hh[' + i + ']"]').val(hh);
$('[name="mn[' + i + ']"]').val(mn);
$('[name="ampm[' + i + ']"]').val(ampm);
i++;
});

$('#time_slots').val(slotsAskedFor);
if (slotsAskedFor < existingCount) {
for (i = existingCount; i > slotsAskedFor; i--) {
$('.slot_input:last').remove();
existingCount = i;
}
}

}, 'json');
});

$('.datepicker').datepicker({
onClose: function(date) {
$(this).attr('value', date);
},
altField: $(this).prev()
});

$('#excluded-dates').on('submit', function(e) {
e.preventDefault();
var overlay = $('.overlay', $(this));
overlay.show();
$.post(ajaxurl, $(this).serializeArray(), function(data) {
if (data.error) {
alert(data.error);
overlay.hide();
} else {
location.reload(true);
}
}, 'json');
});

$('#excluded-days').on('submit', function(e) {
e.preventDefault();
var overlay = $('.overlay', $(this));
overlay.show();

$.post(ajaxurl, $(this).serializeArray(), function(data) {
if (data.error) {
alert(data.error);
overlay.hide();
} else {
location.reload(true);
}
}, 'json');
});

$('.defined-dates').on('change', 'input.remove', function() {
$(this).parent().remove();
});

$('#excluded-dates').on('change', 'input.allow', function() {
var counter;
if (true == $(this).prop('checked')) {
counter = (function() {
i = 0;
$('#excluded-dates input[name^="dates_allowed"]').each(function() {
$(this).attr('name', 'dates_allowed[' + i + ']');
i++;
});
return i;
})();
newName = 'dates_allowed[' + counter + ']';
$(this).prev().attr('name', newName);
} else {
counter = (function() {
i = 0;
$('#excluded-dates input[name^="dates_denied"]').each(function() {
$(this).attr('name', 'dates_denied[' + i + ']');
i++;
});
return i;
})();
newName = 'dates_denied[' + counter + ']';
$(this).prev().attr('name', newName);
}
});
});
99 changes: 98 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1 +1,98 @@
initial message
=== Automatic Post Publishing Scheduler ===
Contributors: WilltheWebMechanic
License: GPLv3.0+
Requires at least: 3.6
Tested up to: 3.9.1
Stable tag: 2.0
Tags: posts, publishing, scheduling, admin, author, automatic, blog, free, plugin
Donate Link: http://www.willthewebmechanic.com/automatic-post-publishing-scheduler/

Schedule posts LIKE A BOSS!! Define time slots for publishing and forget about it.

== Description ==

This plugin allows you to gain very precise control over when posts are published to your site.

= Features =

1. Allows the creation of any number of time slots for post publishing
2. Admin users are able to allow or disallow publishing on any given day(s) of the week through a simple interface
3. Further control is allowed by specifying dates that will be explicitly allowed (or disallowed) for publishing, thereby overriding the weekday setting - as an example, if your publishing schedule allows for publishing on Tuesday, but a major holiday falls on Tuesday and you don\'t want publishing to take place on that particular Tuesday, simply specify it in the easy-to-use interface.
4. Any admin/editor user can publish a post 'NOW' by clicking the "publish now" link in the posts screen.
5. Any admin/editor user can alter the scheduled date by using the quick-edit screen.
6. Normal users (authors, etc) can alter the scheduled time/date of their posts, but the defined time slots will still be respected.

== Installation ==

= Option 1 =
* Within your WordPress admin area, navigate to "Plugins".
* Click the "Add New" link near the top of your screen.
* Click the "Upload" link.
* Click the browse button and navigate to wherever you downloaded the zip file to, select the zip file
* Click the "Install Now" button
* Click "Activate Plugin"

= Option 2 =
* Extract the zip file
* Upload (ftp) the resulting `automatic-post-publishing-scheduler` folder to your `/wp-content/plugins/` directory.
* Activate "Automatic Post Publishing Scheduler" through the "Plugins" menu in WordPress

= After Installation: =
* Once activated, your admin menu will have an item labeld "WtWM Plugins", that item has a submenu item called "Scheduler", this is where you can configure your settings.
* Rejoice in how amazingly awesome your posts can now be scheduled.

== Frequently Asked Questions ==

= How can I support the development of this plugin? =

= The most obvious way is to [donate](http://www.willthewebmechanic.com/automatic-post-publishing-scheduler/ "Support Future Development"). However, there are many other ways that you can contribute. =
* By simply [rating](http://wordpress.org/support/view/plugin-reviews/automatic-post-publishing-scheduler "Review this plugin") this plugin you provide me valuable feedback on what is important to the users of this plugin.
* If you find a bug, report it in the [support forums](http://wordpress.org/support/plugin/automatic-post-publishing-scheduler "Get Support").
* If you would like to see more features, [let me know](http://wordpress.org/support/plugin/automatic-post-publishing-scheduler "Feature Request").
* Can you provide artwork for the banner or other assets? Please do - I'll put your name in pixels and will be forever grateful.
* Are you a developer and would like to contribute code to this plugin? Find me on [github](https://github.com/WillBrubaker/automatic-post-publishing-scheduler "Fork Me") and send a pull request (which will also result in your name in pixels).
* [Tweet](http://ctt.ec/BIYrv "Shout it From the Rooftops") about this plugin, write about it on your blog.
* Any of the above actions are truly and greatly appreciated!


== Screenshots ==

1. The admin menu item that this plugin creates and the links to the plugin settings/configuration.
2. Time slot configuration - simple!.
3. Configuration of allowed/disallowed days of the week.
4. Configuration of explicitly allowed/disallowed dates.
5. The datepicker implementation.
6. The 'Publish Now' link - available only to Admin users.
7. The "Quick Edit" interface. Admin users can override scheduled time/date here.

== Changelog ==

= v2.0 =
* Version 2.0 is a major re-do of this plugin, inspired by my recent attendace of WordCamp Miami. Huge shouts to all the people there who inspired me and inspired the re-write of this plugin.

1. Premium features are now **FREE!!**

= v1.3 =
1. minor changes and improvements in efficiency
= v1.2 =
1. Just fixing a typo. Thanks Joseph the random passer-by.
= v1.1 =
1. Now with actual php file goodness.
= v1.0 =
1. Initial Public Release

== Additional Information ==

= To Do List =
* Improvements to UI
* Code optimization and constant improvement
* More features
* Allow custom post types to be assigned to the schedule
* Display upcoming time slots in the post editor and allow post authors to select their time slot
* Make the plugin internationalization friendly
* Use local date/time format settings when outputting dates/times
* User customization of the pop-up message that is displayed when a post is scheduled.
* **Your feature request here.**

= Credits =
* **Your name could be here** make a contribution today! (see the FAQ for suggestions of how you can help with the development)
Binary file added screenshot-1.png
Binary file added screenshot-2.png
Binary file added screenshot-3.png
Binary file added screenshot-4.png
Binary file added screenshot-5.png
Binary file added screenshot-6.png
Binary file added screenshot-7.png

0 comments on commit c899de3

Please sign in to comment.