Support Forum

Post By Email Beta Test

39 Answers

New Answer

AR Andy Ritchings
Andy Ritchings
Member

Yellow Swordfish said
What about of you force the cron task to run manually from the cron admin panel?

And are there any entries now in the email log?

 

Works if I manually run the cron.

Email log populates as I would expect.

YS Yellow Swordfish
Yellow Swordfish
Member

Ok – so good news is that PBE seems to be working for you. But there seems to be an issue with your WP Cron processing.

What about other Cron tasks? Are they being actioned? Like the SP statistics for example which should update hourly. A good test is to write a blog post and schedule it to be published at a future time – say 10 minutes. And then to see if actually does get automatically published as it should.

I can think of no reason PBE Cron would not function like all other WP Cron tasks but it is probably worth finding out if that is possible.

AR Andy Ritchings
Andy Ritchings
Member

All very strange!

 

Here is my cron list

cron.png

 

The scheduled post published fine on the website.

YS Yellow Swordfish
Yellow Swordfish
Member

Strange indeed.
Ok another question. If you go and look at the mail account where you have some emails waiting to be posted – did the plugin delete the ones already processed?

AR Andy Ritchings
Andy Ritchings
Member

Yes looks like the processed emails have been deleted

 

EDIT

When I manually run the cron, yes it deletes the emails in the mailbox.

As I said I have 3 mailboxes set up. What I have just realised is, when the cron is running automatically – the first mail box is accessed and it looks like the email is processed. (I have just found the email right at the the forum topics).

There must be some interruption as this processed email:

1)Isn’t deleted, it is marked as read however

2)Each time the automatic cron runs, it re-posts the same email (this is in the form of a reply to the original post)

3)There is no “last Post” details in the forum view page

4)The number of posts tally against the new topic on the forum view page is zero – which is obviously incorrect as there is a post!

4)The other two mail boxes aren’t touched (Still un-read in the mail boxes)

5)On the Forum home page, the icon changes to new post, but the “last post” area is not updated with the new email topic

YS Yellow Swordfish
Yellow Swordfish
Member

Something is causing an error when the post is processed clearly.
What about the forum error log (Toolbox) Any actual ‘fatal errors’ reported there?

AR Andy Ritchings
Andy Ritchings
Member

No errors in there. Just some notices re subscriptions plugin.

 

I’ve tired deactivating all the other SP plugins, uninstalling and re-installing post by email. No difference unfortunately.

I don’t understand code too well, but are there really many differences between manual and automatic crons?

YS Yellow Swordfish
Yellow Swordfish
Member

No real difference. WP Cron is not true, server side Cron (they should have used a different name really). It is only actioned when someone accesses the site. So when the site is requested, Wo looks at the Cron list to see if any task has been scheduled to run since the last site access and now and if found runs it. That’s the theory.

So manually running the task is just the same really.

I need to think about what might be going on here and confer with the team.

Meanwhile – is it at all possible that there is an email waiting in your inbox that might – due to some content or other – be causing an issue that is stopping things working. If there is any chance you could take a look at them to see if you can spot anything unusual it would be perhaps helpful. Not sure what I have in mind here exactly but you might spot something… I guess if there is anything embedded other than just plain text for example.

AR Andy Ritchings
Andy Ritchings
Member

The mail box is empty apart from 1 plain text email with “Test” as the subject and “Test” as the message.

YS Yellow Swordfish
Yellow Swordfish
Member

So our best assessment is that the Cron just doesn’t run. and I have no real idea why this might be the case when other cron tasks clearly are running and no errors are being reported.

Steve… any ideas why the cron job for this task would not run. Can be run manually and other tasks do appear to be functioning.

MP Mr Papa
Mr Papa
Member

no, not really…  its almost as if its erroring out… but then should be something in the error log…

as a test, can you add

do_action(‘sph_emailpost_cron’);

in your spFunctions.php file?  and see if emails get processed?

that is overkill and will force the cron to run on every page load, so wouldnt want that there permanently, but wont hurt for testing…

AR Andy Ritchings
Andy Ritchings
Member

I added do_action(‘sph_emailpost_cron’); below the last add_filter in my spFunctions.php this gave me a site-wide 500 Http error.

 

This is my functions file – 

<?php
# ————————————————————————————–
#
# Simple:Press Theme custom function file
# Theme : Default
# File : custom functions
# Author : Simple:Press
#
# The ‘functions’ file can be used for custom functions & is loaded with each template
#
# ————————————————————————————–

add_action(‘init’, ‘spDefault_textdomain’);

# load the theme textdomain for tranlations
function spDefault_textdomain() {
sp_theme_localisation(‘spDefault’);
}

if (function_exists(‘sp_FontResizer’)) {
add_action(‘sph_BeforeDisplayStart’, ‘spDefault_spShowFontResize’);
}

function spDefault_spShowFontResize() {
$tipMinus = __sp(‘decrease forum font size’);
$tipReset = __sp(‘reset forum font size’);
$tipPlus = __sp(‘increase font size’);
sp_FontResizer(‘tagClass=spFontSizeControl spRight’, $tipMinus, $tipReset, $tipPlus);
sp_InsertBreak(‘direction-right’);
}
/* Functions for Breadcrumb Z-Index Sorting */
function spSortBreadcrumbs($breadCrumbs, $a=”, $crumbEnd=”, $crumbSpace=”, $treeCount=”) {
global $no;
$no = substr_count($breadCrumbs, ‘spLink’) + 2;
$breadCrumbs = preg_replace_callback(
‘|href=|’,
create_function(
‘$matches’,
‘global $no; $no–; return ‘ID=”BreadcrumbPosition’.$no.'” ” style=”z-index:’.$no.'” ‘.$matches[0];’
),
$breadCrumbs);

return $breadCrumbs;
}
add_filter(‘sph_BreadCrumbs’, ‘spSortBreadcrumbs’);

?>

MP Mr Papa
Mr Papa
Member

I dont see:

do_action('sph_emailpost_cron');

in there…  also, be sure to use caution when copying that… do a raw code copy to make sure the single quotes come out right… or retype them by hand…

AR Andy Ritchings
Andy Ritchings
Member

Re-copied and pasted in case I did it wrong!

What I have just realised that if there emails in the mailbox I get the 500 http error. If there are no emails then it loads.

<?php
# ————————————————————————————–
#
# Simple:Press Theme custom function file
# Theme : Default
# File : custom functions
# Author : Simple:Press
#
# The ‘functions’ file can be used for custom functions & is loaded with each template
#
# ————————————————————————————–

add_action(‘init’, ‘spDefault_textdomain’);

# load the theme textdomain for tranlations
function spDefault_textdomain() {
sp_theme_localisation(‘spDefault’);
}

if (function_exists(‘sp_FontResizer’)) {
add_action(‘sph_BeforeDisplayStart’, ‘spDefault_spShowFontResize’);
}

function spDefault_spShowFontResize() {
$tipMinus = __sp(‘decrease forum font size’);
$tipReset = __sp(‘reset forum font size’);
$tipPlus = __sp(‘increase font size’);
sp_FontResizer(‘tagClass=spFontSizeControl spRight’, $tipMinus, $tipReset, $tipPlus);
sp_InsertBreak(‘direction-right’);
}
/* Functions for Breadcrumb Z-Index Sorting */
function spSortBreadcrumbs($breadCrumbs, $a=”, $crumbEnd=”, $crumbSpace=”, $treeCount=”) {
global $no;
$no = substr_count($breadCrumbs, ‘spLink’) + 2;
$breadCrumbs = preg_replace_callback(
‘|href=|’,
create_function(
‘$matches’,
‘global $no; $no–; return ‘ID=”BreadcrumbPosition’.$no.'” ” style=”z-index:’.$no.'” ‘.$matches[0];’
),
$breadCrumbs);

return $breadCrumbs;
}
add_filter(‘sph_BreadCrumbs’, ‘spSortBreadcrumbs’);

do_action(‘sph_emailpost_cron’);

?>

MP Mr Papa
Mr Papa
Member

so it means you are getting the errors while processing the emails… and that code segment is correct…

but will need Andy on what might be heading south while processing the emails…

might help him out if would be able to provide him with some ftp access so he can insert some debug code… if so, do so via pm please…