Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong sender address when run wp-cron from command-liine #17

Open
NoAnyLove opened this issue Jan 8, 2016 · 1 comment
Open

Wrong sender address when run wp-cron from command-liine #17

NoAnyLove opened this issue Jan 8, 2016 · 1 comment

Comments

@NoAnyLove
Copy link
Contributor

For some reasons (php-fpm request timeout, more accurate cron, etc.), I disable wp-cron by adding define('DISABLE_WP_CRON', true); in wp-config.php, and running wp-cron by adding */10 * * * * /usr/local/bin/php /data/wwwroot/blog/wp-cron.php in crontab.

This causes varaible $_SERVER['SERVER_NAME'] unset when wp-cron triggered from crontab. So the Scheduled Backup will send email with sender emaill address as wordpress without domain name. As a result, the email system simply treat it as a spam.

I think it may be better to improve the way of getting sitename. If the $_SERVER['SERVER_NAME'] is not available, we can sue site_url() function instead.

@NoAnyLove
Copy link
Contributor Author

I tried to fix this in pull#18, it works on my blog with version 4.4.1. This is my first time writing php code, not sure if there is something wrong with my code.

I also try to make it compatible with versions below 3.0.0, but I didn't test it on an old version WordPress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant