WordPress.org

Ready to get started?Download WordPress

Forums

Schedule Posts Not Working in 2.5 (100 posts)

  1. talia
    Member
    Posted 5 years ago #

    As an update someone said they thought the problem only occurred if you try to schedule up to an hour in advance, however I have trialled this with posts that are scheduled only minutes away and posts that are scheduled several days away. None of them work

    I just checked one that was scheduled 2 days ago.

    It now says
    3 hours ago xxxxx Unpublished

    Very frustrating

  2. talia
    Member
    Posted 5 years ago #

    bumping.

  3. talia
    Member
    Posted 5 years ago #

    anyone know what is happening to fix this?

  4. teamtapper
    Member
    Posted 5 years ago #

    i am having difficulties with post scheduleing too. However, mine wont even let me open the "edit" post publishing date. It stopped working about 24-48 hours ago.

    At the bottom of my internet explorer browser window it says, "Done with page errors". I tried downloading mozilla firefox and still has problems. Deleted Cache/Cookies/Temp. Internet files. Nothing seems to be working, Any Ideas?

  5. talia
    Member
    Posted 5 years ago #

    i haven't tried again in the last 24 hours but I always use firefox

  6. talia
    Member
    Posted 5 years ago #

    this is still not working. i had a post scheduled to go up. now it says "14 hours ago" and unpublished. i scheduled the post about 10 days ago so it should have gone up automatically

  7. Anonymous
    Unregistered
    Posted 5 years ago #

    I'm having the same problem with WordPress 2.6. My scheduled posts worked fine before but after I switched my website to a new server/host, I started getting this problem.

    I wouldn't mind trying that script that AlfietheCoder posted, but I don't understand where I'm supposed to put all that code.

    Any help is appreciated.

  8. talia
    Member
    Posted 5 years ago #

    good idea!

    anyone? this is a problem in 2.5 and 2.6

  9. talia
    Member
    Posted 5 years ago #

    can anyone help? it appears to be code that goes in the sql not the theme editor.

    any other fixes???

  10. talia
    Member
    Posted 5 years ago #

    has anyone got a simple easy to implement solution for this problem?

  11. bransonsparks
    Member
    Posted 5 years ago #

    I am using NearlyFreeSpeech.net for my hosting.

    Following this from talltree over in the tracker fixed it for me:

    status changed from closed to reopened.
    version changed from 2.2 to 2.5.
    resolution deleted.
    I had this problem too while using nearlyfreespeech.net hosting and future posts not working. I made this change to the code and now it works

    in /includes/cron.php search for

    if ( $argyle )
          fputs( $argyle,
               "GET {$parts['path']}?check=" . wp_hash('187425') . " HTTP/1.0\r\n"
             . "Host: {$_SERVER['HTTP_HOST']}\r\n\r\n"
          );
    }

    and replace with

    if ( $argyle ){
          fputs( $argyle,
               "GET {$parts['path']}?check=" . wp_hash('187425') . " HTTP/1.0\r\n"
             . "Host: {$_SERVER['HTTP_HOST']}\r\n\r\n"   );
          fflush($argyle);
          fgets($argyle);
          fclose($argyle);
       }
    }

    Thanks

    Here's the link:
    http://trac.wordpress.org/ticket/3742

    A very, very frustrating problem. Makes WordPress unusable if you're working ahead.

    Thanks,
    Branson

  12. mgoldsworthy
    Member
    Posted 5 years ago #

    thanks branson for the info...although it didn't seem to work for me. anyone else give it a try?

  13. colbyv
    Member
    Posted 5 years ago #

    ditto....no joy {host: 1and1.com, wp 2.5.1}

  14. Anonymous
    Unregistered
    Posted 5 years ago #

    I asked my web host about it and it seems that it was a security issue with them (a firewall or something). They removed it, and since then it seems to be working.

  15. daveatkins
    Member
    Posted 5 years ago #

    Can someone from WordPress please respond to this thread and identify if this is a known bug or if people here just have configuration issues? How is the scheduling "supposed" to work? Should there be a cron job or something running to load a page that checks for posts that need to be published? I set up my own server, so I can do whatever; no issues with hosting providers. But how is it supposed to work?

  16. talia
    Member
    Posted 5 years ago #

    ontheedgecomics - what host are you with? I'm with bluehost

    I have found some more info on this but I'm not 100% certain what to do

    this thread says to create a new php file. Where would I put this file? in the wp-content directory???

    and another thread says

    The software regression ( http://en.wikipedia.org/wiki/Software_regression ) occurred in 2.1, and people don't notice it (in any version later) until they write a future-dated post AND their host has a particular, yet common, configuration.

  17. talia
    Member
    Posted 5 years ago #

    Can anyone please advise where the new php file goes or what I can tell my host to get the compatibility issues fixed?

    Thanks

  18. bransonsparks
    Member
    Posted 5 years ago #

    I just edited my /wp-includes/cron.php file and it worked.

    --Branson

  19. Niteblade
    Member
    Posted 5 years ago #

    Scheduling an update to an existing post also seems to cause this issue. One would have to manually change the setting from "Scheduled" to "Post" for each individual blog post.

    I attempted to use the mySQL code from a previous reply to this thread, however, it didn't work.

    How can I disable scheduled posting altogether?

  20. Niteblade
    Member
    Posted 5 years ago #

    After some digging around, I came upon something that appears to work.

    Executing the below mySQL command will force "future" or "scheduled" posts to become "published" posts:
    UPDATE wp_posts SET post_status = 'publish';

    I took my cue from reading a nice article on Perishable Press that pertained to using mySQL statements to turn "on" and "off" comments.

    I would imagine that this mySQL code can be placed in a .PHP file, and can be executed with a Cron Job for timed and future posting. Would anyone care to come up with the .PHP code? :)

    I'm sure there's more that can be done, so I recommend reading that Perishable Press article. Remember, your mileage might vary with this code.

  21. talia
    Member
    Posted 5 years ago #

    a simple code fix would be great!

  22. talia
    Member
    Posted 5 years ago #

    after speaking with bluehost they said that the initial wordpress installation (i used fantastico) didn't set up a cron job for scheduling future dated posts.

    does anyone know what the cron job should be and how to do that part of the installation?

  23. Rafael Fischmann
    Member
    Posted 5 years ago #

    Same exact problem here, 2.6.1 doesn't fix it yet.

    Posts appear as scheduled and don't go online after the specified time for publishing.

    Sucks!

  24. talia
    Member
    Posted 5 years ago #

    one of the moderators said that a cron job needs to be set up to tell the posts to post but i have no idea how to set that up or what should be in it. does anyone else know?

  25. talia
    Member
    Posted 5 years ago #

    bumping

  26. thresher
    Member
    Posted 5 years ago #

    I'm running WordPress 2.6.1 on IIS. I don't have cron, but I can set up scheduled tasks through my control panel. That and the changes below, gleaned from the posts above, worked for me. However, since scheduled tasks on my hositng account can be no less than hourly, that's how often the posts can appear, regardless of the specific time they are scheduled. A minor inconvenience.

    in /wp-includes/cron.php

    REPLACED:

    $argyle = @ fsockopen( $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01 );
    if ( $argyle )
    fputs( $argyle,
    "GET {$parts['path']}?check=" . md5(DB_PASS . '187425') . " HTTP/1.0\r\n"
    . "Host: {$_SERVER['HTTP_HOST']}\r\n\r\n"
    );
    }

    WITH:

    if ( $argyle ){
    fputs( $argyle,
    "GET {$parts['path']}?check=" . wp_hash('187425') . " HTTP/1.0\r\n"
    . "Host: {$_SERVER['HTTP_HOST']}\r\n\r\n" );
    fflush($argyle);
    fgets($argyle);
    fclose($argyle);
    }
    }

    in /wp-cron.php

    REMOVED:

    if ( $_GET['check'] != wp_hash('187425') )
    exit;

    [b]in control panel[/b]

    Set up scheduled task in control panel for /wp-cron.php.

  27. talia
    Member
    Posted 5 years ago #

    I don't have a cron.php file in wp-includes

    Can someone please post the full code of the cron.php file (not just the changed bits as I don't have a cron file)

    Thanks!!

  28. michaelhartmayer
    Member
    Posted 5 years ago #

    Ok guys, so here's what I did to fix this problem. It's honestly more of a rig, since I just recently starting moding wordpress.

    - Backup your old wp-cron.php

    make this your new wp-cron.php

    <?php
    require_once('./wp-config.php');
    
    		$db = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
    		mysql_select_db(DB_NAME, $db);
    		$myQuery = "SELECT * FROM <code>wp_posts</code> WHERE <code>post_status</code>='future';";
    		$results = mysql_query($myQuery, $db) or die(mysql_error());
    		while($get = mysql_fetch_array($results, MYSQL_BOTH))
    			{
    				$pID		=	$get['ID'];
    				$pDATE		=	$get['post_date_gmt'];
    				$tNow		=	gmdate('Y-m-d H:i:s');
    				$tSET		=	$get['post_status'];
    				if($tNow>$pDATE)
    					{
    						$doPOST = 'PUBLISH!';
    						$doQuery = "UPDATE <code>wp_posts</code> SET <code>post_status</code> = replace(<code>post_status</code>,'future','publish') WHERE <code>ID</code>='$pID'";
    						mysql_query($doQuery);
    					}
    			}
    ?>

    Then I inserted this into my wp-content/themes/theme-name/header.php
    That way a check takes place every time a page is viewed to see if scheduled posts ought to be published.

    require_once(ABSPATH.'wp-cron.php');

    Again, really rough.. but I hope it can serve as a starting point.

    Michael

    PS. Because I'm a nub, you may have to tweak around with the SQL Statement, since the tilde key serves as a markup tag, and I don't know how to make it show up right :P

  29. talia
    Member
    Posted 5 years ago #

    Hi Michael thanks for your help

    Where do you put the require_once etc etc in the header.php? Can it go anywhere or should it be somewhere specific?

  30. michaelhartmayer
    Member
    Posted 5 years ago #

    I can't remember, since I was working on it at work, and I'm at home now. :P I put it in there before anything important happens. The idea is that posts are set to publish before the user sees them. It's sort of a pseudo-cron job, since it's not really relying on chronological cycles but rather page views. If I recall I think it was probably the first thing I dropped into the header.

    Let me know if you can't figure it out, and I'll take a closer look at it.

    Michael

Topic Closed

This topic has been closed to new replies.

About this Topic