Forum Replies Created
-
AuthorPosts
-
szepe.viktor
ParticipantMy post vanishes.
szepe.viktor
ParticipantIf someone is looking for a workaround.
#!/bin/bash # # Keep sending newsletters. Restore schedule if missing. export WP_CLI_CONFIG_PATH="/home/user/public_pm2/wp-cli.yml" if ! /usr/local/bin/wp --quiet cron event run newsletter \ && ! /usr/local/bin/wp eval "wp_schedule_event(time() + 5*60, 'newsletter', 'newsletter');"; then echo "cron-newsletter ERROR." >&2 exit 1 fi
szepe.viktor
ParticipantIf someone is loking for a workaround
#!/bin/bash # # Keep sending newsletters. Restore schedule if missing. export WP_CLI_CONFIG_PATH="/home/***/public_pm2/wp-cli.yml" if ! /usr/local/bin/wp --quiet cron event run newsletter \ && ! /usr/local/bin/wp eval "wp_schedule_event(time() + 5*60, 'newsletter', 'newsletter');"; then echo "cron-newsletter ERROR." >&2 exit 1 fi
szepe.viktor
ParticipantYou just mentioned
Crons are not on database are runtime rescheduled by plugins.
and I’ve missunderstood as “Crons anre not on database. (period)” But they are.
Now I understand that WP core fails to reschedule them:A fatal error while executing a cron or an out of memory can block wordpress to reschedule a periodic cron.
Do you mean by “an out of memory can block wordpress to reschedule a periodic cron” that a not-rescheduled cron will disappear from the database?
I think it will stay sceduled for a time in the past. The entry itself won’t be deleted.szepe.viktor
ParticipantI understand.
Could you make the event fixed. I think it is a more WP-like approach.szepe.viktor
ParticipantI only have suhosin alerts (a PHP extension for security) but it is disabled for CLI.
Do you think a PHP error could remove the event from the database?szepe.viktor
ParticipantThank you.
The thing is wp-cli a WP console tool. It is able to list events.
See: http://wp-cli.org/commands/cron/event/list/Do you have any code in your plugin that removes that event?
szepe.viktor
Participant> Check if wp cli has that event active.
What does it mean that wp cli has it event active?
This simply runs the “newsletter” event.
wp cron event run "newsletter"
I do not understand.
szepe.viktor
ParticipantWhen logging into WP as an admin it is recreated.
Please advise.szepe.viktor
ParticipantOh! And the run thing.
You can set skip-plugins in wp-cli config thus running WordPress faster from CLI.
szepe.viktor
Participantwp-cli is – I quote –
a set of command-line tools for managing WordPress installations.
I prefer runnig background job (mail sending, backup, cache preload etc.) from CLI thus not putting load on the webserver. That is why wp-cron is disabled.
Now I run your main wp-cron event separately because Newsletter demands a more frequent run than other things (twice in an hour for others).wp --quiet --url=http://www.domain.hu/ --path=/home/user/path-to-wordpress cron event run newsletter
See: http://wp-cli.org/commands/cron/event/run/
-
This reply was modified 8 years, 2 months ago by
szepe.viktor.
-
This reply was modified 8 years, 2 months ago by
szepe.viktor.
szepe.viktor
ParticipantI am very sorry. Your plugin was excluded from wp-cli run.
-
This reply was modified 8 years, 2 months ago by
szepe.viktor.
szepe.viktor
ParticipantThe schedule is missing:
wp cron schedule list +---------------------------+------------------------------------------------+----------+ | name | display | interval | +---------------------------+------------------------------------------------+----------+ | w3_cdn_cron_queue_process | [W3TC] CDN queue process (every 900 seconds) | 900 | | w3_pgcache_prime | [W3TC] Page Cache prime (every 900 seconds) | 900 | | hourly | Óránként | 3600 | | w3_cdn_cron_upload | [W3TC] CDN auto upload (every 3600 seconds) | 3600 | | w3_pgcache_cleanup | [W3TC] Page Cache file GC (every 3600 seconds) | 3600 | | twicedaily | Naponta kétszer | 43200 | | daily | Naponta egyszer | 86400 | | w3_minify_cleanup | [W3TC] Minify file GC (every 86400 seconds) | 86400 | +---------------------------+------------------------------------------------+----------+
szepe.viktor
ParticipantClick on the link above then on the anchor text “3 times”
szepe.viktor
Participant(click on the link 3 times )
szepe.viktor
Participantszepe.viktor
ParticipantSorry! Those (the nice URL approach and the admin-post.php call) were mixed in my head.
szepe.viktor
ParticipantAs for the GETs:
http://www.website.net/newsletter/unsubscribe?n=TOKENBASE64
http://www.website.net/newsletter/clicktrack?n=TOKENSTRING
The URL path has the static part: the action,
the GET contains the dynamic part: the user’s token.Please consider using a real (secret) token instead of base64 encoded actual data.
szepe.viktor
ParticipantThe rewritten URLs would be only for the user. These URLs won’t trigger anything.
This short Codex page is about handling POST requests:
http://codex.wordpress.org/Plugin_API/Action_Reference/admin_post_%28action%29
So the forms’ action are always wp-admin/admin-post.phpAs far as I am concerned in PHP security, it is pretty dangerous “to open up” own php files for user interaction.
All plugin files should begin withif (false === defined('ABSPATH')) { die(); }
or similar.
I hope that helps making your plugin(s) better.
Do you need a demo plugin that does POST-ing from a nice URL?szepe.viktor
ParticipantI think your 1×1.gif is a RED dot,
this one is a transparent.
Maybe I am wrong.szepe.viktor
ParticipantThank you!
szepe.viktor
ParticipantI was the one unsubscribing myself before viewing the “page” but after receiving the email.
szepe.viktor
Participant…the reason could be: I’ve unsubscribed my email address meanwhile
Sorry.
szepe.viktor
Participantsorry 🙁
there had been a brake-in on this website and therefore is a rewrite rule:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/wp-admin/
RewriteCond %{REQUEST_URI} !^/wp-include/
RewriteCond %{REQUEST_URI} !^/wp-login\.php
RewriteRule ^(.*/)[^/]*\.php$ $1 [L,R=permanent]now I added a new exception:
RewriteCond %{REQUEST_URI} !^/wp-content/plugins/newsletter/users
I am sorry.
szepe.viktor
Participanton another blog it downloads the csv
I think it is a migration problem from v2.
Do you have anything for me to check?
-
This reply was modified 8 years, 2 months ago by
-
AuthorPosts