diff --git a/admin/css/custom-style.css b/admin/css/custom-style.css index c7e85b10..31a7b4cc 100644 --- a/admin/css/custom-style.css +++ b/admin/css/custom-style.css @@ -82,3 +82,9 @@ .schedule_noti_p{ margin: 0; } + +/* sweet alert css */ + +.swal-overlay { + background-color: rgba(43, 165, 137, 0.45); +} diff --git a/admin/js/custom-script.js b/admin/js/custom-script.js index ff2432b0..f6e013a9 100644 --- a/admin/js/custom-script.js +++ b/admin/js/custom-script.js @@ -2,22 +2,20 @@ jQuery(document).ready(function($) { // timepicker function $('#man_times').chungTimePicker({ viewType: 1, - callback: function(e) { - - // triggered after selecting - alert("hello"); - - - } }); + // sweet alert js + $('.swal_alert_show').on('click',function(){ + swal('You have to activate pro version first!'); + }) // check active which option $("#pts_form input:checkbox,#man_form input:checkbox").click(function(){ var this_name = $(this).attr("name"); //alert(this_name); - if(this_name === 'pub_check'){ + if(this_name === 'pub_check') + { $('#pub_check').attr("checked",true); $('#cal_check').attr("checked",false); }else if(this_name === 'cal_check'){ diff --git a/admin/manage-schedule/assets/icon-256x256.png b/admin/manage-schedule/assets/icon-256x256.png new file mode 100644 index 00000000..ca07a87f Binary files /dev/null and b/admin/manage-schedule/assets/icon-256x256.png differ diff --git a/admin/manage-schedule/build/git-to-svn.sh b/admin/manage-schedule/build/git-to-svn.sh new file mode 100644 index 00000000..9571a4b8 --- /dev/null +++ b/admin/manage-schedule/build/git-to-svn.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# This build script is called from a Jenkins job. +# When I push my local git repository to Github, Jenkins automatically commits it to SVN repo on WordPress.org. + +# Removes the last trunk dir from local SVN +rm -rf /media/sf_D_DRIVE/Dropbox/Producao/publish-to-schedule/trunk/ + +# Re-crates trunk +mkdir /media/sf_D_DRIVE/Dropbox/Producao/publish-to-schedule/trunk + +# Clone repository from GitHub +git clone https://github.com/alexbenfica/Publish-to-Schedule-WordPress-plugin.git /media/sf_D_DRIVE/Dropbox/Producao/publish-to-schedule/trunk/ + +# Removes git files from SVN trunk +rm -rf /media/sf_D_DRIVE/Dropbox/Producao/publish-to-schedule/trunk/.git + +# Still can't make it work without typing password... so call a script to commit to SVN using password in command line. +sh /media/sf_D_DRIVE/DevelOffline/publish-to-schedule/commit-to-svn.sh \ No newline at end of file diff --git a/admin/manage-schedule/humans.txt b/admin/manage-schedule/humans.txt new file mode 100644 index 00000000..c1cd919a --- /dev/null +++ b/admin/manage-schedule/humans.txt @@ -0,0 +1,29 @@ + ___ _ _ _ _ + / _ \_ _| |__ | (_)___| |__ + / /_)/ | | | '_ \| | / __| '_ \ +/ ___/| |_| | |_) | | \__ \ | | | +\/ \__,_|_.__/|_|_|___/_| |_| + + _ +| |_ ___ +| __|/ _ \ +| |_| (_) | + \__|\___/ + + __ _ _ _ +/ _\ ___| |__ ___ __| |_ _| | ___ +\ \ / __| '_ \ / _ \/ _` | | | | |/ _ \ +_\ \ (__| | | | __/ (_| | |_| | | __/ +\__/\___|_| |_|\___|\__,_|\__,_|_|\___| + + + We are the humans behind Publish to Schedule! + +/* TEAM */ +Name: Alex Benfica +Title: Developer +Twitter: alextben + +/* META */ +Updated: 2016/02/09 +See: http://humanstxt.org/ \ No newline at end of file diff --git a/admin/manage-schedule/lang/pt_BR.mo b/admin/manage-schedule/lang/pt_BR.mo new file mode 100644 index 00000000..11ed3a04 Binary files /dev/null and b/admin/manage-schedule/lang/pt_BR.mo differ diff --git a/admin/manage-schedule/lang/pt_BR.po b/admin/manage-schedule/lang/pt_BR.po new file mode 100644 index 00000000..89c6fa60 --- /dev/null +++ b/admin/manage-schedule/lang/pt_BR.po @@ -0,0 +1,421 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PTS\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-19 16:57-0200\n" +"PO-Revision-Date: 2012-12-19 16:54-0300\n" +"Last-Translator: Alex \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: _e;__\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-Language: Portuguese\n" +"X-Poedit-SearchPath-0: ..\n" + +#: ../publish-to-schedule.php:46 +msgid "US" +msgstr "BR" + +#: ../publish-to-schedule.php:48 +msgid "USD" +msgstr "BRL" + +#: ../publish-to-schedule.php:96 +msgid "Pub. to Schedule" +msgstr "Pub. p. Agendar" + +#: ../publish-to-schedule.php:269 +msgid "Please donate. Even 1 dollar will help me a lot! Seriously!" +msgstr "Por favor, doe! Mesmo um real já ajuda muito! Sério!" + +#: ../publish-to-schedule.php:271 +msgid "Donate" +msgstr "Doação" + +#: ../publish-to-schedule.php:339 ../publish-to-schedule.php:988 +msgid "Plugin version" +msgstr "Versão do plugin" + +#: ../publish-to-schedule.php:360 ../publish-to-schedule.php:366 +#: ../publish-to-schedule.php:1107 ../publish-to-schedule.php:1129 +msgid "Your WordPress timezone settings might be incorrect!" +msgstr "As config. de timezone do seu WordPress podem estar incorretas!" + +#: ../publish-to-schedule.php:362 +msgid "See details" +msgstr "Detalhes" + +#: ../publish-to-schedule.php:368 +msgid "Please tell the blog admin!" +msgstr "Por favor informe ao administrador do blog!" + +#: ../publish-to-schedule.php:456 +msgid "Post already scheduled for a future date!" +msgstr "Artigo já agendado para uma data futura!" + +#: ../publish-to-schedule.php:458 +msgid "In this case, the plugin will do nothing!" +msgstr "Neste caso, o plugin não fará nada!" + +#: ../publish-to-schedule.php:575 +msgid "post at " +msgstr "artigo às" + +#: ../publish-to-schedule.php:577 +msgid "Edit post" +msgstr "Editar artigo" + +#: ../publish-to-schedule.php:582 ../publish-to-schedule.php:626 +msgid "of" +msgstr "de" + +#: ../publish-to-schedule.php:628 +msgid "Availble day!" +msgstr "Dia disponível" + +#: ../publish-to-schedule.php:639 +msgid "Too late to publish" +msgstr "Passou da hora" + +#: ../publish-to-schedule.php:714 +msgid "" +"To publish in a different date and bypass the plugin, first choose the " +"schedule date from the WordPress controls above and then click the Schedule " +"button!" +msgstr "" +"Para publicar em uma data diferente e ignorar o plugin, primeiro escolha " +"pelo WordPress a data a ser agendada (acima) e depois clique no botão " +"Agendar." + +#: ../publish-to-schedule.php:721 +msgid "Will be schedule to" +msgstr "Será agendado para" + +#: ../publish-to-schedule.php:723 +msgid "at" +msgstr "às" + +#: ../publish-to-schedule.php:755 +msgid "Could not find a suitable date to this post!" +msgstr "Não foi possível definir a data deste artigo!" + +#: ../publish-to-schedule.php:756 +msgid "No changes will be made to this post date!" +msgstr "Nenhuma mudança será feita na data deste artigo." + +#: ../publish-to-schedule.php:757 +msgid "Something is wrong!" +msgstr "Algo está errado!" + +#: ../publish-to-schedule.php:758 +msgid "Please contact the plugin developer!" +msgstr "Por favor entre em contato com o desenvolvedor do plugin." + +#: ../publish-to-schedule.php:959 +msgid "You must check \"Yes\" for at least 1 day of week! " +msgstr "Você precisar marcar \"Sim\" para pelo menos 1 dia da semana!" + +#: ../publish-to-schedule.php:962 +msgid "Options saved!" +msgstr "Opções armazenadas!" + +#: ../publish-to-schedule.php:991 +msgid "Options" +msgstr "Opções" + +#: ../publish-to-schedule.php:1008 +msgid "" +"Which days of week posts are allowed to be auto-scheduled?
(The schedule " +"happens only when you click the \"Pub. to Schedule\" button!)" +msgstr "" +"Para quais dias da semana você quer ter artigos agendados?
(O " +"agendamento ocorre apenas quando você clica no botão \"Pub. p. Agendar\".)" + +#: ../publish-to-schedule.php:1010 +msgid "Put 0 in a day when you do not want posts to be scheduled!" +msgstr "Coloque 0 em um dia em que você não quer que sejam agendados artigos." + +#: ../publish-to-schedule.php:1013 +msgid "" +"Example: if you put 0 on Sunday, this plugin will never schedule a post to " +"be published on Sundays.
But still, if you want to schedule an article " +"to be published in a Sunday, just schedule it using the standard schedule " +"button of WordPress and it will be published on the date you choose, " +"ignoring all options below!
" +msgstr "" +"Exemplo: se você colocar 0 no Domingo, este plugin nunca irá agendar um " +"artigo para ser publicado em um Domingo.
Mas ainda assim, se você quiser " +"agendar um artigo para ser publicado em um Domingo, simplesmente agende-no " +"da maneira usual, clicando no botão agendar do WordPress e ele será " +"publicado na data que você escolher, ignorando todas as opções abaixo." + +#: ../publish-to-schedule.php:1015 +msgid "For each day, set how many posts will be scheduled!" +msgstr "Para cada dia, determine quantos artigos devem ser agendados." + +#: ../publish-to-schedule.php:1024 +msgid "Sunday" +msgstr "Domingo" + +#: ../publish-to-schedule.php:1025 +msgid "Monday" +msgstr "Segunda" + +#: ../publish-to-schedule.php:1026 +msgid "Tuesday" +msgstr "Terça" + +#: ../publish-to-schedule.php:1027 +msgid "Wednesday" +msgstr "Quarta" + +#: ../publish-to-schedule.php:1028 +msgid "Thursday" +msgstr "Quinta" + +#: ../publish-to-schedule.php:1029 +msgid "Friday" +msgstr "Sexta" + +#: ../publish-to-schedule.php:1030 +msgid "Saturday" +msgstr "Sábado" + +#: ../publish-to-schedule.php:1074 +msgid "" +"Specify the time interval in which you want to have your posts scheduled!" +msgstr "" +"Defina o intervalo de horários em que você quer seus artigos agendados!" + +#: ../publish-to-schedule.php:1077 +msgid "" +"Example: posts will only be scheduled to be published in this time interval." +"
But still, if you do via WordPress schedule button, you can schedule " +"for any time you want!" +msgstr "" +"Exemplo: os artigos serão agendados para serem publicados neste intervalo " +"detempo.
Mas se preferir, pode clicar no botão Agendar do WordPress para " +"publicar em qualquer outro horário que escolher!" + +#: ../publish-to-schedule.php:1083 +msgid "Start Time" +msgstr "Horário inicial" + +#: ../publish-to-schedule.php:1084 +msgid " (defaults to 00:00)" +msgstr "(padrão em 00:00)" + +#: ../publish-to-schedule.php:1088 +msgid "End Time" +msgstr "Horário final" + +#: ../publish-to-schedule.php:1089 +msgid " (defaults to 23:59)" +msgstr "(padrão em 23:59)" + +#: ../publish-to-schedule.php:1109 +msgid "The date and time we detect : " +msgstr "Data e hora detectada:" + +#: ../publish-to-schedule.php:1125 +msgid "Your timezone configuration and server time seems to be OK!" +msgstr "Sua configuração de timezone e hora do servidor parece estar correta!" + +#: ../publish-to-schedule.php:1131 +msgid "According to your web server" +msgstr "De acordo com o seu servidor web" + +#: ../publish-to-schedule.php:1133 +msgid "the GMT time is: " +msgstr "o horário GMT é:" + +#: ../publish-to-schedule.php:1135 +msgid "The timezone configured in your" +msgstr "O timezone configurado em sua" + +#: ../publish-to-schedule.php:1135 +msgid "WordPress settings" +msgstr "configuração do WordPress" + +#: ../publish-to-schedule.php:1135 +msgid "is" +msgstr "é" + +#: ../publish-to-schedule.php:1137 +msgid "so your server think that is your local time is: " +msgstr "assim, seu servidor web pensa que seu horário local é:" + +#: ../publish-to-schedule.php:1138 +msgid "but this is different from time on you machine now!" +msgstr "mas ele é diferente do horário em seu computador agora!" + +#: ../publish-to-schedule.php:1140 +msgid "" +"If the difference is not too big (less than 2h or 3h) you problably will not " +"have side effects and the plugin should work fine!" +msgstr "" +"Se a diferença não for muito grande (menos de 2 ou 3 horas) você " +"provavelmente não terá efeitos colaterais e o plugin deverá funcionar " +"normalmente!" + +#: ../publish-to-schedule.php:1142 +msgid "" +"Othewise, with big time differences, you can have issues with the real time " +"that each post will be scheduled!" +msgstr "" +"Por outro lado, com grandes diferenças de horário você poderá ter " +"divergências com relação ao horário real para o qual seus artigos serão " +"agendados!" + +#: ../publish-to-schedule.php:1144 +msgid "" +"Sometimes you have to set a different timezone to compensate daylight saving " +"time or a missconfigured server time! " +msgstr "" +"Não é incomum que você precise escolher um timezone diferente do seu real " +"para compensar o horário de verão ou a hora errada do seu servidor web!" + +#: ../publish-to-schedule.php:1147 +msgid "" +"If you can, change the timezone to correct this, refresh this page and this " +"message will be shown anymore!" +msgstr "" +"Se for possível, altere a a sua configuração de timezone para corrigir isto, " +"atualize a página e você não verá mais esta mensagem!" + +#: ../publish-to-schedule.php:1168 +msgid "" +"How much information you want to see near the \"Publish\" button (on post " +"edit screen)?" +msgstr "" +"Quanta informação você quer ver próximo ao botão \"Publicar\" (na tela de " +"criação de artigos)?" + +#: ../publish-to-schedule.php:1174 +msgid " Show all information availble!" +msgstr "Mostrar toda informação disponível!" + +#: ../publish-to-schedule.php:1176 +msgid " I want to see how this plugin works!" +msgstr "Eu quero ver como este plugin funciona!" + +#: ../publish-to-schedule.php:1178 +msgid " (Might be a lot of text! Good for debugging purposes or enthusiats!)" +msgstr "(Pode ser muito texto! Bom para debugar e para entusiastas!)" + +#: ../publish-to-schedule.php:1187 +msgid " Just do the magic!" +msgstr "Não quero ver isso!" + +#: ../publish-to-schedule.php:1189 +msgid " Only show the calculated \"auto schedule date\" for the post!" +msgstr "Apenas mostre a data calculada para o agendamento do post!" + +#: ../publish-to-schedule.php:1201 +msgid "Do you like this plugin?" +msgstr "Você gosta deste plugin?" + +#: ../publish-to-schedule.php:1215 +msgid "Tweet" +msgstr "Twite" + +#: ../publish-to-schedule.php:1215 +msgid "about it" +msgstr "sobre ele" + +#: ../publish-to-schedule.php:1218 +msgid "Rate it" +msgstr "Avalie-o" + +#: ../publish-to-schedule.php:1218 +msgid "on the repository!" +msgstr "no repositório!" + +#: ../publish-to-schedule.php:1223 +msgid "Help with translation!" +msgstr "Ajude na tradução" + +#: ../publish-to-schedule.php:1225 +msgid "We dont have this plugin translated to your language yet!" +msgstr "Não temos este plugin traduzido em seu idioma ainda!" + +#: ../publish-to-schedule.php:1231 +msgid "The languages already translated are: " +msgstr "Os idiomas atualmente traduzidos são:" + +#: ../publish-to-schedule.php:1244 +msgid "If you speak any of these and are native in" +msgstr "Se você fala um destes e é nativo em " + +#: ../publish-to-schedule.php:1248 +msgid "help translating this plugin to you language!" +msgstr "ajude a traduzir este plugin para o seu idioma." + +#: ../publish-to-schedule.php:1265 +msgid "Statistics" +msgstr "Estatísticas" + +#: ../publish-to-schedule.php:1267 +msgid "Help make this plugin even better!" +msgstr "Ajude a fazer este plugin ainda melhor!" + +#: ../publish-to-schedule.php:1269 +msgid "Allow plugin usage statistics to be shared with its developer." +msgstr "Compartilhar com o desenvolvedor estatísticas de utilização do plugin." + +#: ../publish-to-schedule.php:1274 +msgid "Yes" +msgstr "Sim" + +#: ../publish-to-schedule.php:1275 +msgid "No" +msgstr "Não" + +#: ../publish-to-schedule.php:1287 +msgid "Did it save you a lot of time?" +msgstr "Ele lhe ajudou a economizar um bom tempo?" + +#: ../publish-to-schedule.php:1289 +msgid "Ohh yes... it certainly did!" +msgstr "Ohh sim! Certamente que sim!" + +#: ../publish-to-schedule.php:1292 +msgid "Since you installed this plugin" +msgstr "Desde que instalou este plugin" + +#: ../publish-to-schedule.php:1297 +msgid " posts were automatically scheduled, saving your time!" +msgstr "artigos foram automaticamente agendados, poupando seu tempo!" + +#: ../publish-to-schedule.php:1313 +msgid "Consider making a donation" +msgstr "Porque não faz uma doação" + +#: ../publish-to-schedule.php:1317 +msgid "" +"Trust-me - even 1 dollar will make me happy... but you can choose any " +"amount! :)" +msgstr "" +"Acredite - mesmo 1 real já dá alguma alegria... mas você pode escolher outor " +"valor se quiser! :)" + +#: ../publish-to-schedule.php:1322 +msgid "Save all changes" +msgstr "Salvar todas as alterações" + +#: ../publish-to-schedule.php:1352 +msgid "Settings" +msgstr "Configurações" + +#~ msgid "" +#~ "For the days you select, the plugin will schedule only 1 post each day." +#~ msgstr "" +#~ "Para os dias que você selecionar, o plugin irá agendar apenas 1 artigo em " +#~ "cada dia." diff --git a/admin/manage-schedule/lang/publish-to-schedule.pot b/admin/manage-schedule/lang/publish-to-schedule.pot new file mode 100644 index 00000000..0d67e69c --- /dev/null +++ b/admin/manage-schedule/lang/publish-to-schedule.pot @@ -0,0 +1,384 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-19 16:57-0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../publish-to-schedule.php:46 +msgid "US" +msgstr "" + +#: ../publish-to-schedule.php:48 +msgid "USD" +msgstr "" + +#: ../publish-to-schedule.php:96 +msgid "Pub. to Schedule" +msgstr "" + +#: ../publish-to-schedule.php:269 +msgid "Please donate. Even 1 dollar will help me a lot! Seriously!" +msgstr "" + +#: ../publish-to-schedule.php:271 +msgid "Donate" +msgstr "" + +#: ../publish-to-schedule.php:339 ../publish-to-schedule.php:988 +msgid "Plugin version" +msgstr "" + +#: ../publish-to-schedule.php:360 ../publish-to-schedule.php:366 +#: ../publish-to-schedule.php:1107 ../publish-to-schedule.php:1129 +msgid "Your WordPress timezone settings might be incorrect!" +msgstr "" + +#: ../publish-to-schedule.php:362 +msgid "See details" +msgstr "" + +#: ../publish-to-schedule.php:368 +msgid "Please tell the blog admin!" +msgstr "" + +#: ../publish-to-schedule.php:456 +msgid "Post already scheduled for a future date!" +msgstr "" + +#: ../publish-to-schedule.php:458 +msgid "In this case, the plugin will do nothing!" +msgstr "" + +#: ../publish-to-schedule.php:575 +msgid "post at " +msgstr "" + +#: ../publish-to-schedule.php:577 +msgid "Edit post" +msgstr "" + +#: ../publish-to-schedule.php:582 ../publish-to-schedule.php:626 +msgid "of" +msgstr "" + +#: ../publish-to-schedule.php:628 +msgid "Availble day!" +msgstr "" + +#: ../publish-to-schedule.php:639 +msgid "Too late to publish" +msgstr "" + +#: ../publish-to-schedule.php:714 +msgid "" +"To publish in a different date and bypass the plugin, first choose the " +"schedule date from the WordPress controls above and then click the Schedule " +"button!" +msgstr "" + +#: ../publish-to-schedule.php:721 +msgid "Will be schedule to" +msgstr "" + +#: ../publish-to-schedule.php:723 +msgid "at" +msgstr "" + +#: ../publish-to-schedule.php:755 +msgid "Could not find a suitable date to this post!" +msgstr "" + +#: ../publish-to-schedule.php:756 +msgid "No changes will be made to this post date!" +msgstr "" + +#: ../publish-to-schedule.php:757 +msgid "Something is wrong!" +msgstr "" + +#: ../publish-to-schedule.php:758 +msgid "Please contact the plugin developer!" +msgstr "" + +#: ../publish-to-schedule.php:959 +msgid "You must check \"Yes\" for at least 1 day of week! " +msgstr "" + +#: ../publish-to-schedule.php:962 +msgid "Options saved!" +msgstr "" + +#: ../publish-to-schedule.php:991 +msgid "Options" +msgstr "" + +#: ../publish-to-schedule.php:1008 +msgid "" +"Which days of week posts are allowed to be auto-scheduled?
(The schedule " +"happens only when you click the \"Pub. to Schedule\" button!)" +msgstr "" + +#: ../publish-to-schedule.php:1010 +msgid "Put 0 in a day when you do not want posts to be scheduled!" +msgstr "" + +#: ../publish-to-schedule.php:1013 +msgid "" +"Example: if you put 0 on Sunday, this plugin will never schedule a post to " +"be published on Sundays.
But still, if you want to schedule an article " +"to be published in a Sunday, just schedule it using the standard schedule " +"button of WordPress and it will be published on the date you choose, " +"ignoring all options below!
" +msgstr "" + +#: ../publish-to-schedule.php:1015 +msgid "For each day, set how many posts will be scheduled!" +msgstr "" + +#: ../publish-to-schedule.php:1024 +msgid "Sunday" +msgstr "" + +#: ../publish-to-schedule.php:1025 +msgid "Monday" +msgstr "" + +#: ../publish-to-schedule.php:1026 +msgid "Tuesday" +msgstr "" + +#: ../publish-to-schedule.php:1027 +msgid "Wednesday" +msgstr "" + +#: ../publish-to-schedule.php:1028 +msgid "Thursday" +msgstr "" + +#: ../publish-to-schedule.php:1029 +msgid "Friday" +msgstr "" + +#: ../publish-to-schedule.php:1030 +msgid "Saturday" +msgstr "" + +#: ../publish-to-schedule.php:1074 +msgid "" +"Specify the time interval in which you want to have your posts scheduled!" +msgstr "" + +#: ../publish-to-schedule.php:1077 +msgid "" +"Example: posts will only be scheduled to be published in this time interval." +"
But still, if you do via WordPress schedule button, you can schedule " +"for any time you want!" +msgstr "" + +#: ../publish-to-schedule.php:1083 +msgid "Start Time" +msgstr "" + +#: ../publish-to-schedule.php:1084 +msgid " (defaults to 00:00)" +msgstr "" + +#: ../publish-to-schedule.php:1088 +msgid "End Time" +msgstr "" + +#: ../publish-to-schedule.php:1089 +msgid " (defaults to 23:59)" +msgstr "" + +#: ../publish-to-schedule.php:1109 +msgid "The date and time we detect : " +msgstr "" + +#: ../publish-to-schedule.php:1125 +msgid "Your timezone configuration and server time seems to be OK!" +msgstr "" + +#: ../publish-to-schedule.php:1131 +msgid "According to your web server" +msgstr "" + +#: ../publish-to-schedule.php:1133 +msgid "the GMT time is: " +msgstr "" + +#: ../publish-to-schedule.php:1135 +msgid "The timezone configured in your" +msgstr "" + +#: ../publish-to-schedule.php:1135 +msgid "WordPress settings" +msgstr "" + +#: ../publish-to-schedule.php:1135 +msgid "is" +msgstr "" + +#: ../publish-to-schedule.php:1137 +msgid "so your server think that is your local time is: " +msgstr "" + +#: ../publish-to-schedule.php:1138 +msgid "but this is different from time on you machine now!" +msgstr "" + +#: ../publish-to-schedule.php:1140 +msgid "" +"If the difference is not too big (less than 2h or 3h) you problably will not " +"have side effects and the plugin should work fine!" +msgstr "" + +#: ../publish-to-schedule.php:1142 +msgid "" +"Othewise, with big time differences, you can have issues with the real time " +"that each post will be scheduled!" +msgstr "" + +#: ../publish-to-schedule.php:1144 +msgid "" +"Sometimes you have to set a different timezone to compensate daylight saving " +"time or a missconfigured server time! " +msgstr "" + +#: ../publish-to-schedule.php:1147 +msgid "" +"If you can, change the timezone to correct this, refresh this page and this " +"message will be shown anymore!" +msgstr "" + +#: ../publish-to-schedule.php:1168 +msgid "" +"How much information you want to see near the \"Publish\" button (on post " +"edit screen)?" +msgstr "" + +#: ../publish-to-schedule.php:1174 +msgid " Show all information availble!" +msgstr "" + +#: ../publish-to-schedule.php:1176 +msgid " I want to see how this plugin works!" +msgstr "" + +#: ../publish-to-schedule.php:1178 +msgid " (Might be a lot of text! Good for debugging purposes or enthusiats!)" +msgstr "" + +#: ../publish-to-schedule.php:1187 +msgid " Just do the magic!" +msgstr "" + +#: ../publish-to-schedule.php:1189 +msgid " Only show the calculated \"auto schedule date\" for the post!" +msgstr "" + +#: ../publish-to-schedule.php:1201 +msgid "Do you like this plugin?" +msgstr "" + +#: ../publish-to-schedule.php:1215 +msgid "Tweet" +msgstr "" + +#: ../publish-to-schedule.php:1215 +msgid "about it" +msgstr "" + +#: ../publish-to-schedule.php:1218 +msgid "Rate it" +msgstr "" + +#: ../publish-to-schedule.php:1218 +msgid "on the repository!" +msgstr "" + +#: ../publish-to-schedule.php:1223 +msgid "Help with translation!" +msgstr "" + +#: ../publish-to-schedule.php:1225 +msgid "We dont have this plugin translated to your language yet!" +msgstr "" + +#: ../publish-to-schedule.php:1231 +msgid "The languages already translated are: " +msgstr "" + +#: ../publish-to-schedule.php:1244 +msgid "If you speak any of these and are native in" +msgstr "" + +#: ../publish-to-schedule.php:1248 +msgid "help translating this plugin to you language!" +msgstr "" + +#: ../publish-to-schedule.php:1265 +msgid "Statistics" +msgstr "" + +#: ../publish-to-schedule.php:1267 +msgid "Help make this plugin even better!" +msgstr "" + +#: ../publish-to-schedule.php:1269 +msgid "Allow plugin usage statistics to be shared with its developer." +msgstr "" + +#: ../publish-to-schedule.php:1274 +msgid "Yes" +msgstr "" + +#: ../publish-to-schedule.php:1275 +msgid "No" +msgstr "" + +#: ../publish-to-schedule.php:1287 +msgid "Did it save you a lot of time?" +msgstr "" + +#: ../publish-to-schedule.php:1289 +msgid "Ohh yes... it certainly did!" +msgstr "" + +#: ../publish-to-schedule.php:1292 +msgid "Since you installed this plugin" +msgstr "" + +#: ../publish-to-schedule.php:1297 +msgid " posts were automatically scheduled, saving your time!" +msgstr "" + +#: ../publish-to-schedule.php:1313 +msgid "Consider making a donation" +msgstr "" + +#: ../publish-to-schedule.php:1317 +msgid "" +"Trust-me - even 1 dollar will make me happy... but you can choose any " +"amount! :)" +msgstr "" + +#: ../publish-to-schedule.php:1322 +msgid "Save all changes" +msgstr "" + +#: ../publish-to-schedule.php:1352 +msgid "Settings" +msgstr "" diff --git a/admin/manage-schedule/license.txt b/admin/manage-schedule/license.txt new file mode 100644 index 00000000..88822058 --- /dev/null +++ b/admin/manage-schedule/license.txt @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + diff --git a/admin/manage-schedule/manage-schedule.php b/admin/manage-schedule/manage-schedule.php new file mode 100644 index 00000000..7e40dcf5 --- /dev/null +++ b/admin/manage-schedule/manage-schedule.php @@ -0,0 +1,1473 @@ + + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-28857513-1']); + _gaq.push(['_trackPageview']); + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); + _gaq.push(['_setCustomVar', 1,'Site URL','" . get_option('home') . "', 1 ]); + _gaq.push(['_setCustomVar', 2,'Articles scheduled','" . $options['pts_statistics_total_work'] . "',1]); + _gaq.push(['_setCustomVar', 3,'WP Language','" . get_bloginfo('language') . "',1]); + "; + + + if ($getCode) { + return $analyticsCode; + } else { + print $analyticsCode; + } +} + + + + + +# creates a js function that will compare the cliet time with the server time, passed as variables... +function wpsp_scheduled_createJsToCompareTime($HTMLWrong,$HTMLOK){ + + + $HTMLWrong = trim($HTMLWrong); + $HTMLOK = trim($HTMLOK); + + # minutes... + $maxAllowedDif = 20; + + # seconds... + $phplocal = current_time('timestamp', $gmt = 0); + + # minutes... + $phplocal = $phplocal / 60; + + # minutes in a day... + $phplocal = $phplocal % 1440; + + + $jsCT = ' + + + + + + '; + + + return $jsCT; +} + + + + +# show information near the publish button... +function wpsp_scheduled_postInfo(){ + global $post; + global $pts_donateURL; + global $plName; + global $pts_debug; + + + if($pts_debug){ + echo '
'; + echo '
'; + echo ''.$plName.' - Debug active!'; + echo '
'; + echo '
'; + } + + + # do not show info for published posts... + if($post->post_status == 'publish'){ + return; + } + + # do not show info for scheduled posts... + if($post->post_status == 'future'){ + return; + } + + # do not show info for pages... + if($post->post_type != 'post'){ + return; + } + + + + # only change the text of publish button when plugin is active... + //add_filter( 'gettext', 'wpsp_scheduled_change_publish_button', 10, 2 ); + + + # insert Google analytics code to monitor plugin usage. + add_action('admin_footer', 'wpsp_scheduled_insertAnalytics',12); + + + + + + echo '
'; + + + # show diferent messages for admin and non admin users... + if(current_user_can('install_plugins')){ + $msgTimeWrong = '
'. + __('Your WordPress timezone settings might be incorrect!','wp-scheduled-posts'). + ' ( '. + __('See details','wp-scheduled-posts').' )
'; + } + else{ + $msgTimeWrong = '
'. + __('Your WordPress timezone settings might be incorrect!','wp-scheduled-posts'). + ' ( '. + __('Please tell the blog admin!','wp-scheduled-posts'). + ' )
'; + + } + + + + echo wpsp_scheduled_createJsToCompareTime($msgTimeWrong,''); + # div usada para reportar hora incorreta... + echo '
'; + + echo ''; + + echo wpsp_scheduled_findNextSlot($post); + + + echo '
'; +} +add_action( 'post_submitbox_misc_actions', 'wpsp_scheduled_postInfo' ); + + + + + + + + + +function wpsp_scheduled_getMaxPostsDay($datetimeCheck){ + + global $options; + + + # id day of week is allowed... (replaces ) + $opt = 'pts_'.date('w',$datetimeCheck); + + /* + print_r($datetimeCheck); + print_r($options); + print_r($opt); + echo '
'; + */ + + # translate the old style option no\yes para 0\1+ + if($options[$opt] == 'no'){ + return 0; + } + if($options[$opt] == 'yes'){ + return 1; + } + if($options[$opt] != ''){ + return $options[$opt]; + } + else{ + return 1; + } +} + + + +# return the next date and time for post. +function wpsp_scheduled_findNextSlot($post,$changePost = False){ + global $wpdb; + global $table_prefix; + global $pts_debug; + global $activate_pub_option; + + //if(isset($activate_pub_option) && !empty($activate_pub_option)){ + + # if is a draft or pending with a date in future, means that it were published already, mas back to draft or pending... + if(($post->post_status == 'draft') or ($post->post_status == 'pending')){ + if( strtotime($post->post_date) > strtotime(date(current_time('mysql', $gmt = 0))) ){ + $msg = ''; + $msg .= __('Post already scheduled for a future date!', 'wp-scheduled-posts'); + $msg .= '
'; + $msg .= __('In this case, the plugin will do nothing!', 'wp-scheduled-posts'); + if($changePost == False){ + return $msg; + } + else{ + return null; + } + } + } + + + # load plugin configurations... + $options = get_option(basename(__FILE__, ".php")); + + # get start and end minutes from 0 to 1440-1 + $startMinute = date('H',strtotime($options['pts_start'])) * 60 + date('i',strtotime($options['pts_start']));; + $endMinute = date('H',strtotime($options['pts_end'])) * 60 + date('i',strtotime($options['pts_end']));; + + $msg = ''; + + + # dates from today... + $startDate = date('Ymd', strtotime(current_time('mysql', $gmt = 0))); + + + + if($pts_debug and True){ + $msg .= 'DEBUG: $startDate = ' . $startDate . '
'; + } + + if($pts_debug and True){ + $msg .= 'DEBUG: $options = ' . print_r($options,True) . '
'; + } + + + + $sql = ' + select + ID, + DATE_FORMAT(post_date,"%Y%m%d") as dtfind, + post_author, + post_date, + post_date_gmt, + post_title, + post_status, + guid + from '. $table_prefix . 'posts + where ID <> '.$post->ID.' + and post_status in ("publish","future") + and post_type = "post" + and post_date >= "'. $startDate .'" + order by post_date ASC + + + '; + $recentPosts = $wpdb->get_results($sql); + + $maxDaysFuture = 5000; + + + if($pts_debug and True){ + $msg .= $sql; + } + + + + + # next dates allowed to publish... + for($offset=0;$offset<$maxDaysFuture;$offset+=1){ + + # must be set every run of this for... + $cssDayAllowed = 'color:green; text-decoration:none;'; + $cssDayForbid = 'color:red; text-decoration:line-through;'; + $cssDayTooLate = 'color:green; text-decoration:line-through;'; + + $datetimeCheck = strtotime(current_time('mysql', $gmt = 0) . ' + '.$offset.' days'); + $dt = date("Ymd",$datetimeCheck); + $msg .= '' . date(get_option('date_format'),$datetimeCheck) . ' - '.__(date("l",$datetimeCheck),'pts').'
'; + + + $maxPostsThisDay = wpsp_scheduled_getMaxPostsDay($datetimeCheck); + $nPostsDay = 0; + + + + # if there are no posts in the day... + if(count($recentPosts)){ + + $thereArePosts = False; + + foreach($recentPosts as $rp){ + + if($rp->dtfind == $dt){ + $thereArePosts = True; + $nPostsDay += 1; + + + # garante o agendamento para hoarios posteriores no mesmo dia. + #$startMinute = date('H',$rp->post_date) * 60 + date('i',$rp->post_date); + #echo date('i',$rp->post_date); + #echo $startMinute . '
'; + + #break; + } + } + + + + + + if($nPostsDay >= $maxPostsThisDay){ + + $msgThereIsPost = ''; + + if(($nPostsDay == 1) & ($maxPostsThisDay == 1)){ + $msgThereIsPost .= ' | ' . __('post at ','wp-scheduled-posts'); + $msgThereIsPost .= ' '; + $msgThereIsPost .= ''. + date(get_option('time_format'),strtotime($rp->post_date)).''; + } + else{ + $msgThereIsPost .= " ($nPostsDay " . __('of','wp-scheduled-posts') . ' '. "$maxPostsThisDay)"; + } + + $msg = str_replace('',$msgThereIsPost,$msg); + # default style for positive day of week + $msg = str_replace('',$cssDayAllowed,$msg); + $msg = str_replace('','',$msg); + + continue; + } + else{ + $msg = str_replace('','',$msg); + } + } + else{ + $msg = str_replace('','',$msg); + } + + + + + + + + if($nPostsDay >= $maxPostsThisDay){ + # change style for not allowed + $msg = str_replace('',$cssDayForbid,$msg); + $msg = str_replace('','',$msg); + continue; + } + + #choose the start time that will be used to sort the post time... + $startSort = $startMinute; + + /* + if($pts_debug and True){ + $msg .= 'DEBUG: $dt = ' . $dt . '
'; + $msg .= 'DEBUG: date("Ymd",$startDate) = ' . date("Ymd",strtotime($startDate)) . '
'; + } + */ + + + $msgDayAvailble = ''; + + $msgDayAvailble .= " ( $nPostsDay " . __('of','wp-scheduled-posts') . ' '. "$maxPostsThisDay ) "; + + $msgDayAvailble .= ' | ' . __('Availble day!','wp-scheduled-posts') . ''; + + # if the day is today... check to see if there is time to publish within the time window configured... + if($dt == date("Ymd",strtotime($startDate))){ + #$msg .= '- esta data e hoje! Ainda da tempo?
'; + # https://codex.wordpress.org/Function_Reference/current_time + $nowLocal = current_time('mysql', $gmt = 0); + # gete user local time in minutes... + $nowTotalMinutes = date('H',strtotime($nowLocal)) * 60 + date('i',strtotime($nowLocal));; + + if($nowTotalMinutes > $endMinute){ + $msgTooLateToday = ' | ' . __('Too late to publish','wp-scheduled-posts'); + $msg = str_replace('',$cssDayTooLate,$msg); + $msg = str_replace('',$msgTooLateToday,$msg); + + #$msg .= '- Hoje mas ja passou da hora de publicar.
'; + continue; + } + if($nowTotalMinutes < $startMinute){ + #$msg .= '- OK! Artigo sera agendado.
'; + $msg = str_replace('',$msgDayAvailble,$msg); + } + if($nowTotalMinutes >= $startMinute){ + #$msg .= '- OK! Artigo sera agendado.
'; + $msg = str_replace('',$msgDayAvailble,$msg); + $startSort = $nowTotalMinutes; + } + } + else{ + $msg = str_replace('',$msgDayAvailble,$msg); + #$msg .= '- OK! Artigo sera agendado.
'; + } + + $msg = str_replace('',$cssDayAllowed,$msg); + + + + + + + # replaces if were not replaced before... + $msg = str_replace('','',$msg); + + + # find the time... randon! + # even not necessary... but using seed for rand... + # using post-id to guarante the same time after click post... + # http://www.php.net/manual/pt_BR/function.srand.php + srand(intval(sqrt($post->ID) * 10000)); + + $minutePublish = rand($startSort,$endMinute); + if($minutePublish==0){ + #avoid divide by zero on module (%)... + $minutePublish += 1; + } + + + # if next date is today... and it is the first post... publish 3 minute in future! + if((date("Ymd",$datetimeCheck) == date("Ymd",strtotime($startDate)) & ($nPostsDay == 0))){ + $minutePublish = $startSort + 3; + } + + $dthrPublish = date("Y-m-d",$datetimeCheck) .' '. intval($minutePublish/60) .':'. $minutePublish%60; + + + // next time schedule fix + + global $wpdb; + $my_prefix = 'psm_'; + $my_table = $my_prefix. 'manage_schedule'; + //date_default_timezone_set('Asia/Dhaka'); + + $future_post_date=array(); + $my_query = new WP_Query( array( 'post_type'=>'post', 'posts_per_page' => -1, 'order' => 'ASC','post_status' => array( 'future' ), ) ); + + while ($my_query->have_posts()) : $my_query->the_post(); + $post_date = strtotime(get_the_time( 'Y-m-d H:i' )); + array_push($future_post_date,$post_date); + endwhile; + + //echo $mytheme_timezone = get_option('timezone_string'); + //date_default_timezone_set($mytheme_timezone); + + $sql = "SELECT * FROM ".$my_table; + $day_schedules = $wpdb->get_results($sql, ARRAY_A); + + $all_day_schedule = array(); + $ctime=current_time( 'timestamp' ); //die(); + $today_bar=date("l",$ctime); //die();// use timezone return:Sunday + $todat_timestamp=date("Y-m-d H:i",$ctime); // use timezone + foreach($day_schedules as $day_schedule){ + if(strtolower($today_bar) === strtolower($day_schedule['day'])) + { + $nvar_2 = strtotime(date("Y-m-d")." ".$day_schedule['schedule']); + $todat_timestamp = strtotime($todat_timestamp); + if($nvar_2 > $todat_timestamp) + array_push($all_day_schedule,$nvar_2); + } + else + { + $new_var = strtotime("Next ".$day_schedule['day']." ".$day_schedule['schedule']); + array_push($all_day_schedule,$new_var); + } + } + + + function nextWeek($presentWk){ + $presentWk2=array(); + $pr_wk = count($presentWk); + for($d=0;$d<$pr_wk;$d++){ + $presentWk2[$d] = strtotime(date('Y-m-d H:i',$presentWk[$d]).' +7 day'); + + } + return $presentWk2; + } + + sort($all_day_schedule); + + + $tt = count($all_day_schedule); + $fp = count($future_post_date); + + $deserved_date = ""; + for($i=0;$i<52;$i++) + { + for($j=0;$j<$tt;$j++) + { + //echo date("Y-m-d H:i",$all_day_schedule[$j])."
"; + if(!in_array($all_day_schedule[$j],$future_post_date)) + { + $deserved_date = $all_day_schedule[$j]; + //date("Y-m-d H:i",$deserved_date)."
"; + break; + } + else + { + + $all_day_schedule = nextWeek($all_day_schedule); + } + + } + if($deserved_date) + { + break; + } + } + + + + + # parcial message... not complete. + $msgT = ''; + + $msgByPass = __('To publish in a different date and bypass the plugin, first choose the schedule date from the WordPress controls above and then click the Schedule button!', 'wp-scheduled-posts'); + + #$msgByPass = '' . $msgByPass . ''; + #$msgT .= '
'; + global $activate_pub_option; + global $activate_cal_option; + $get_cal_op = get_option('cal_active_option'); + $activate_cal_option = html_entity_decode(stripslashes($get_cal_op)); + if(!empty($activate_cal_option)){ + $dthrPublish=date("Y-m-d H:i:s",$deserved_date); + } + + $msgT .= '

'; + + $msgT .= ''; + $msgT .= 'or '; + + $msgT .= __(date("l",strtotime($dthrPublish)),'wp-scheduled-posts') . ', ' . date(get_option('date_format'),strtotime($dthrPublish)) . ' '. __('at','') .' ' . date(get_option('time_format') , strtotime($dthrPublish)); + + + $msgT .= ''; + $msgT .= '

'; + + #$msgT .= '
'; + + + # uses only to debug and show logs on main screen... + if(!$changePost){ + if($options['pts_infosize'] == 'all'){ + return $msg . $msgT; + } + else{ + return $msgT; + } + + } + else{ + # statistics to show how many post the plugin helps to schedule... + if(array_key_exists('pts_statistics_total_work',$options)){ + $options['pts_statistics_total_work'] = $options['pts_statistics_total_work'] + 1; + } + else{ + $options['pts_statistics_total_work'] = 1; + } + update_option(basename(__FILE__, ".php"), $options); + return $dthrPublish; + } + } + + if(!$changePost){ + return + __('Could not find a suitable date to this post!','wp-scheduled-posts').'
'. + __('No changes will be made to this post date!','wp-scheduled-posts').'
'. + __('Something is wrong!','wp-scheduled-posts').'
'. + __('Please contact the plugin developer!','wp-scheduled-posts'); + } + else{ + return null; + } + + //}//end + +} + + + +# this is where the magic happens... :) +function wpsp_scheduled_do_publish_schedule($post){ + global $wpdb; + global $pts_debug; + global $activate_pub_option; + + + //if(isset($activate_pub_option) && !empty($activate_pub_option)){ + $newDate = wpsp_scheduled_findNextSlot($post,True); + + # do nothing if cant find date... + if($newDate == null){ + return $post; + } + + # do nothing for pages! Should act only on post! + if($post->post_type != 'post'){ + return; + } + + + + # changes post_date and pos_date_gmt + $post->post_date = $newDate; + + # sum the timezone offset to get the right gmt time... + $gmt_offset = get_option('gmt_offset') * (-1); + + # treatment to deal with things like GMT-2:30... + $gmt_offsetHours = intval($gmt_offset); + $gmt_offsetMinutes = ($gmt_offset - $gmt_offsetHours) * 60; + # add the plus signal to concatenate on string time math below... the minus comes by default... + if($gmt_offsetHours > 0){ + $gmt_offsetHours = '+'.$gmt_offsetHours; + } + if($gmt_offsetMinutes > 0){ + $gmt_offsetMinutes = '+'.$gmt_offsetMinutes; + } + + $post->post_date_gmt = date('Y-m-d H:i:s', strtotime($newDate .' ' .$gmt_offsetHours. ' hours ' .$gmt_offsetMinutes. ' minutes' )); + + if($pts_debug){ + echo 'Date and GMT date for the new post:
'; + echo $post->post_date; + echo '
'; + echo $post->post_date_gmt; + echo '
'; + } + + + + # changes post_status to be scheduled... + $post->post_status = 'future'; + if(isset($_POST['schedule_btn_post'])) + { + wp_update_post($post); + return $post; + }else + { + return true; + } +} + + + +# Define the options menu +function wpsp_scheduled_option_menu() { + global $plName; + if (function_exists('current_user_can')) { + if (!current_user_can('manage_options')) return; + } else { + global $user_level; + get_currentuserinfo(); + if ($user_level < 8) return; + } + if (function_exists('add_menu_page')) { + //add_options_page($plName, $plName, "manage_options", __FILE__, 'wpsp_scheduled_options_page'); + + add_submenu_page( 'wp-scheduled-posts',__( 'Pro Setting'), __( 'Pro Setting'), "manage_options", 'pro-setting', 'wpsp_scheduled_options_page'); + } +} +# Install the option in the WordPress configuration menu +add_action('admin_menu', 'wpsp_scheduled_option_menu',999); + + + + +# Prepare the default set of options +$default_options['pts_start'] = '00:00'; +$default_options['pts_end'] = '23:59'; +$default_options['pts_infosize'] = 'parcial'; +$default_options['pts_allowstats'] = 'yes'; + + +// the plugin options are stored in the options table under the name of the plugin file sans extension +add_option(basename(__FILE__, ".php"), $default_options); + +// This method displays, stores and updates all the options +function wpsp_scheduled_options_page(){ + global $wpdb; + global $plName; + global $plUrl; + global $pts_debug; + global $pts_show_donate; + global $activate_pub_option; + + + # insert Google analytics code to monitor plugin usage. + add_action('admin_footer', 'wpsp_scheduled_insertAnalytics',12); + + + $bit = explode("&",$_SERVER['REQUEST_URI']); + // This bit stores any updated values when the Update button has been pressed + if (isset($_POST['update_options'])) { + + if(isset($_POST['pub_check'])) { + $pubs = $_POST['pub_check']; + delete_option('cal_active_option'); + add_option('pub_active_option',$pubs); + //add_option('cal_active_option',""); + echo "

Activated!

"; + }elseif(isset($_POST['cal_check'])){ + $cals = $_POST['cal_check']; + delete_option('pub_active_option'); + add_option('cal_active_option',$cals); + //add_option('pub_active_option',""); + echo "

Manual Time Activated!

"; + }else{ + delete_option('pub_active_option'); + echo "

Deactivated!

"; + } + //else{ + // echo 'nai'; + //} + + # loads before change with post values... + $options = get_option(basename(__FILE__, ".php")); + + // Fill up the options array as necessary + $options['pts_start'] = $_POST['pts_start']; // like having business hours + $options['pts_end'] = $_POST['pts_end']; + + $options['pts_0'] = $_POST['pts_0']; + $options['pts_1'] = $_POST['pts_1']; + $options['pts_2'] = $_POST['pts_2']; + $options['pts_3'] = $_POST['pts_3']; + $options['pts_4'] = $_POST['pts_4']; + $options['pts_5'] = $_POST['pts_5']; + $options['pts_6'] = $_POST['pts_6']; + + $options['pts_infosize'] = @$_POST['pts_infosize']; + + $options['pts_allowstats'] = @$_POST['pts_allowstats']; + + + # if all weeks are NO... change the monday to YES + $allNo = 0; + for($i=0;$i<7;$i++){ + if($options['pts_'.$i] == 'no'){ + $allNo += 1; + } + else{ + break; + } + } + if($allNo == 7){ + $options['pts_1'] = 'Yes'; + } + + + + while (strlen($options['pts_start']) < 5) $options['pts_start'] = "0" . $options['pts_start']; + while (strlen($options['pts_end']) < 5) $options['pts_end'] = "0" . $options['pts_end']; + if (!gmdate('H:i',strtotime($options['pts_start']))) $options['pts_start'] = '00:00'; //guarantee a valid time + if (!gmdate('H:i',strtotime($options['pts_end']))) $options['pts_end'] = '23:59'; + $time = explode(":",$options['pts_start']); + if (strlen($time[0]) < 2) $time[0] = '0' . $time[0]; + if (strlen($time[1]) < 2) $time[1] = '0' . $time[1]; + $options['pts_start'] = date("H:i",mktime($time[0],$time[1],0,9,11,2001)); // convert overruns + $time = explode(":",$options['pts_end']); + if (strlen($time[0]) < 2) $time[0] = '0' . $time[0]; + if (strlen($time[1]) < 2) $time[1] = '0' . $time[1]; + $options['pts_end'] = date("H:i",mktime($time[0],$time[1],0,9,11,2001)); + + // store the option values under the plugin filename + update_option(basename(__FILE__, ".php"), $options); + + // Show a message to say we've done something + if($allNo == 7){ + echo '

' . __('You must check "Yes" for at least 1 day of week! ', 'psm') . '

'; + } + else{ + echo '

' . __('Options saved!', 'psm') . '

'; + } + + } else { + $options = get_option(basename(__FILE__, ".php")); + } + + + + # OPTIONS SCREEN + //now we drop into html to display the option page form + ?> +
+ + +

+ + + +
+
+ + Check To Active + + + >Check To Active + + + +
+ + + '.$plName.' - Debug active!'; + } + ?> + + + + + + + + + + + + + + + + + + +
: + " + value="" style="width: 40px;"/> +
+ + +

+ + + + + + + + + + +
: +
: +
+ + + '. __('Your WordPress timezone settings might be incorrect!', 'wp-scheduled-posts'). + '' + . __('The date and time we detect : ') . '' + .date(get_option('date_format').', '.get_option('time_format'),current_time('timestamp', $gmt = 1)). + ''; + + + + $msgTimeOK =' + +

'. __('Your timezone configuration and server time seems to be OK!','wp-scheduled-posts'). + '

' + .' '.date(get_option('date_format').', '.get_option('time_format'),current_time('timestamp', $gmt = 0)).''; + + + $msgTimeWrong = '

' + . __('Your WordPress timezone settings might be incorrect!', 'wp-scheduled-posts'). + '

' + . __('According to your web server','wp-scheduled-posts') . + ', ' + . __('the GMT time is: ','wp-scheduled-posts') . ' '.date(get_option('date_format').', '.get_option('time_format'),current_time('timestamp', $gmt = 1)).'.'. + '
' + . __('The timezone configured in your','wp-scheduled-posts').' '.__('WordPress settings','wp-scheduled-posts').' '.__('is','wp-scheduled-posts') .': '.get_option('gmt_offset').', '. + '
' + . __('so your server think that is your local time is: ','wp-scheduled-posts') . ' '.date(get_option('date_format').', '.get_option('time_format'),current_time('timestamp', $gmt = 0)).' ... ' + . __('but this is different from time on you machine now!','wp-scheduled-posts'). + '
' + . __('If the difference is not too big (less than 2h or 3h) you problably will not have side effects and the plugin should work fine!','wp-scheduled-posts'). + '
' + . __('Othewise, with big time differences, you can have issues with the real time that each post will be scheduled!','wp-scheduled-posts'). + '
' + . __('Sometimes you have to set a different timezone to compensate daylight saving time or a missconfigured server time! ','wp-scheduled-posts'). + + '
' + . __('If you can, change the timezone to correct this, refresh this page and this message will be shown anymore!','wp-scheduled-posts') + ; + + + + + # javascript to compare the times... + echo wpsp_scheduled_createJsToCompareTime($msgTimeWrong,$msgTimeOK); + + # div usada para reportar hora incorreta... + echo '
'; + + echo ''; + + ?> + +
+ +
+ 'post', 'posts_per_page' => -1, 'order' => 'ASC','post_status' => array( 'future' ), ) ); + + while ($my_query->have_posts()) : $my_query->the_post(); + $post_date = the_date('Y-m-d H:i:s', '', '', FALSE); + //array_push($future_post_date,$post_date); + endwhile; + + ?> + + query($sql); + + if($insert) + { + $massage = "Manual schedule has been set for ".$man_days; + }else + { + $massage = "Something Wrong!"; + } + }else + { + $massage = "Field must not be empty!"; + } + + } + + + //select psm_manage_schedule data + $sql = "SELECT * FROM ".$my_table; + $schedules = $wpdb->get_results($sql, ARRAY_A); + + ?> + +
+ + + Active + + >Active + + +
+ + + + + + +
+ + + +

+
+ + + + + + + + + +
+ get_results($sql, ARRAY_A); + } + + if(isset($_GET['sun_id'])){ + $sun_id = $_GET['sun_id']; + $sql = "DELETE FROM ".$my_table." WHERE id='$sun_id' "; + $delete_sun = $wpdb->get_results($sql, ARRAY_A); + } + + if(isset($_GET['mon_id'])){ + $mon_id = $_GET['mon_id']; + $sql = "DELETE FROM ".$my_table." WHERE id='$mon_id' "; + $delete_mon = $wpdb->get_results($sql, ARRAY_A); + } + + if(isset($_GET['tue_id'])){ + $tue_id = $_GET['tue_id']; + $sql = "DELETE FROM ".$my_table." WHERE id='$tue_id' "; + $delete_tue = $wpdb->get_results($sql, ARRAY_A); + } + + if(isset($_GET['wed_id'])){ + $wed_id = $_GET['wed_id']; + $sql = "DELETE FROM ".$my_table." WHERE id='$wed_id' "; + $delete_wed = $wpdb->get_results($sql, ARRAY_A); + } + + if(isset($_GET['thu_id'])){ + $thu_id = $_GET['thu_id']; + $sql = "DELETE FROM ".$my_table." WHERE id='$thu_id' "; + $delete_thu = $wpdb->get_results($sql, ARRAY_A); + } + + if(isset($_GET['fri_id'])){ + $fri_id = $_GET['fri_id']; + $sql = "DELETE FROM ".$my_table." WHERE id='$fri_id' "; + $delete_fri = $wpdb->get_results($sql, ARRAY_A); + } + + + + /*========================================== + All select query for every days + ==========================================*/ + + $sql = "SELECT * FROM ".$my_table." WHERE day='saturday'"; + $sat_schedules = $wpdb->get_results($sql, ARRAY_A); + + $sql = "SELECT * FROM ".$my_table." WHERE day='sunday'"; + $sun_schedules = $wpdb->get_results($sql, ARRAY_A); + + $sql = "SELECT * FROM ".$my_table." WHERE day='monday'"; + $mon_schedules = $wpdb->get_results($sql, ARRAY_A); + + $sql = "SELECT * FROM ".$my_table." WHERE day='tuesday'"; + $tue_schedules = $wpdb->get_results($sql, ARRAY_A); + + $sql = "SELECT * FROM ".$my_table." WHERE day='wednesday'"; + $wed_schedules = $wpdb->get_results($sql, ARRAY_A); + + $sql = "SELECT * FROM ".$my_table." WHERE day='thursday'"; + $thu_schedules = $wpdb->get_results($sql, ARRAY_A); + + $sql = "SELECT * FROM ".$my_table." WHERE day='friday'"; + $fri_schedules = $wpdb->get_results($sql, ARRAY_A); + ?> + +
    +
  • + sat + '.$sat.' x'; + } + ?> + +
  • +
  • + sun + '.$sun.' x'; + }else{ + echo '-'; + } + } + ?> +
  • +
  • + mon + '.$mon.' x'; + }else{ + echo '-'; + } + } + ?> +
  • +
  • + tue + '.$tue.' x'; + }else{ + echo '-'; + } + } + ?> +
  • +
  • + wed + '.$wed.' x'; + }else{ + echo '-'; + } + } + ?> +
  • +
  • + thu + '.$thu.' x'; + }else{ + echo '-'; + } + } + ?> +
  • +
  • + fri + '.$fri.' x'; + }else{ + echo '-'; + } + } + ?> +
  • +
+ +
+ + Activated Missed Schedule!"; + } + else + { + delete_option('miss_schedule_active_option'); + echo "

Deactivated Missed Schedule!

"; + } + + } + global $wpdb; + $get_miss_op = get_option('miss_schedule_active_option'); + $activate_miss_option = html_entity_decode(stripslashes($get_miss_op)); + ?> +
+ + Active Missed Schedule + + + >Active Missed Schedule + + + +
+ + + + + + +
+ ' . __('Settings','wp-scheduled-posts') .''; + array_unshift($links, $settings_link); + return $links; +} +$plugin = plugin_basename(__FILE__); +add_filter("plugin_action_links_$plugin", 'wpsp_scheduled_settings_link' ); + diff --git a/admin/manage-schedule/nbproject/project.properties b/admin/manage-schedule/nbproject/project.properties new file mode 100644 index 00000000..d37ef956 --- /dev/null +++ b/admin/manage-schedule/nbproject/project.properties @@ -0,0 +1,7 @@ +include.path=${php.global.include.path} +php.version=PHP_54 +source.encoding=UTF-8 +src.dir=. +tags.asp=false +tags.short=false +web.root=. diff --git a/admin/manage-schedule/nbproject/project.xml b/admin/manage-schedule/nbproject/project.xml new file mode 100644 index 00000000..8e59b598 --- /dev/null +++ b/admin/manage-schedule/nbproject/project.xml @@ -0,0 +1,9 @@ + + + org.netbeans.modules.php.project + + + Publish To Schedule - WordPress Plugin + + + diff --git a/admin/manage-schedule/screenshot-1.jpg b/admin/manage-schedule/screenshot-1.jpg new file mode 100644 index 00000000..c79fe4d9 Binary files /dev/null and b/admin/manage-schedule/screenshot-1.jpg differ diff --git a/admin/manage-schedule/screenshot-2.jpg b/admin/manage-schedule/screenshot-2.jpg new file mode 100644 index 00000000..33518cb5 Binary files /dev/null and b/admin/manage-schedule/screenshot-2.jpg differ diff --git a/admin/manage-schedule/screenshot-3.jpg b/admin/manage-schedule/screenshot-3.jpg new file mode 100644 index 00000000..321140d9 Binary files /dev/null and b/admin/manage-schedule/screenshot-3.jpg differ diff --git a/admin/scheduled-calendar/scheduled.php b/admin/scheduled-calendar/scheduled.php index 377a9996..0bc91698 100644 --- a/admin/scheduled-calendar/scheduled.php +++ b/admin/scheduled-calendar/scheduled.php @@ -73,7 +73,7 @@ function wpsp_scheduled_list_add_management_page() { $page = add_submenu_page( pluginsFOLDER, __('Schedule Calendar', 'psm'), __('Schedule Calendar', 'psm'), 'manage_options', 'cal', array(&$this, 'edcal_list_admin')); add_action( "admin_print_scripts-$page", array(&$this, 'edcal_scripts')); - add_submenu_page( pluginsFOLDER, __('Free VS Pro', 'psm'), __('Free VS Pro', 'psm'), 'manage_options', 'f_vs_p', array(&$this, 'show_menu')); + //add_submenu_page( pluginsFOLDER, __('Free VS Pro', 'psm'), __('Free VS Pro', 'psm'), 'manage_options', 'f_vs_p', array(&$this, 'show_menu')); diff --git a/wp-scheduled-posts.php b/wp-scheduled-posts.php index 35e996e9..a8b3e1a5 100755 --- a/wp-scheduled-posts.php +++ b/wp-scheduled-posts.php @@ -81,6 +81,7 @@ function start_plugin() { wp_enqueue_style( 'chung-timepicker', plugins_URLPATH . 'admin/css/chung-timepicker.css' ); wp_enqueue_script( 'custom-script', plugins_URLPATH . 'admin/js/custom-script.js', array('jquery'), '1.0.0', false ); wp_enqueue_script( 'main-chung-timepicker', plugins_URLPATH . 'admin/js/chung-timepicker.js', array('jquery'), '1.0.0', false ); + wp_enqueue_script( 'sweet-alert-js', 'https://unpkg.com/sweetalert/dist/sweetalert.min.js', array('jquery'), '1.0.0', false ); } } @@ -90,7 +91,7 @@ function start_plugin() { $wpsp_op = new wpsp_addon(); include('admin/scheduled-calendar/scheduled.php'); -//include('admin/manage-schedule/manage-schedule.php'); +include('admin/manage-schedule/manage-schedule.php'); include('admin/wpsp-missed-schedule/wpsp-missed-schedule.php'); }