Title: &#8220;Saving Draft&#8221; Hangs / Errors Since Update
Last modified: March 25, 2017

---

# “Saving Draft” Hangs / Errors Since Update

 *  Resolved [Aaron Richardson](https://wordpress.org/support/users/n3rdabl3/)
 * (@n3rdabl3)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/)
 * Good morning!
 * I updated to the latest version of The SEO Framework this morning and ever since
   I’ve been running into a few problems.
 * First of all, when writing posts I’ve noticed that it hangs “Saving Draft…” and
   I’m unable to Save, Publish, or Schedule any posts until I refresh the page or
   go back to the Edit Posts page.
 * In addition, when using the “Quick Edit” option, whenever I save, I’m given this
   error:
 * > Notice: The_SEO_Framework\Query::can_cache_query was called incorrectly. You’ve
   > initiated a method that uses queries too early. (This message was added in 
   > version 2.9.0 of The SEO Framework.) In /home/admin/web/n3rdabl3.co.uk/public_html/
   > wp-content/plugins/autodescription/inc/classes/query.class.php on line 64.
 * Any possible fixes would be great, however until then I might have to revert 
   to the previous version of the plugin (if that’s at all possible?)

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Plugin Author [Sybre Waaijer](https://wordpress.org/support/users/cybr/)
 * (@cybr)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/#post-8956626)
 * Hi [@n3rdabl3](https://wordpress.org/support/users/n3rdabl3/) and [@jfarsen](https://wordpress.org/support/users/jfarsen/),
 * Thanks for the bug reports!
 * I can’t confirm the first issue (updating posts), I can confirm the second one(
   quick edit)!
 * **About the first issue:**
    Do you maintain debug logs or do you see errors? 
   Please post them or [send them to me confidentially as .txt or .zip](https://theseoframework.com/contact/).
 * Alternatively, could you send me a list of your active plugins/themes?
 * **About the second issue:**
    This is exactly why I implemented the “doing it 
   wrong” notice, to find and prevent errors in third party implementation; unfortunately,
   it’s an error internally as well found in unlikely places.
 * The second error also prevents The SEO Bar from being output, this issue is affected
   by all versions.
 * **Temporarily resolution for second issue:**
    You should be able to work correctly
   if `WP_DEBUG` is turned off. The notice prevents POST from running (which would
   otherwise save the options, publish the page, etc.).
 * Working on a patch right now! If you find any more issues, please let me know.
   Thanks!
 * **Rolling back to earlier versions:**
    1. Grab a copy of your favorite version [here](https://wordpress.org/plugins/autodescription/developers/).
    2. Login to your website’s file browser through FTP.
    3. Overwrite contents of `wp-content/plugins/autodescription/`.
    4. The plugin is fully forwards-compatible. So no issues should be present.
 * Cheers!
 *  [vralle](https://wordpress.org/support/users/vit-1/)
 * (@vit-1)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/#post-8958694)
 * Hi!
    Confirm first bug: new post -> add text + title (2-3 min) -> “Publish” button
   has disabled state.
 * No PHP Notice. No error events in chrome console.
 * Clean WP 4.7.3 + only The SEO Framework 2.9.0
 * PHP 7.1
 * WP config:
 *     ```
       /* AutoSave Interval. */
       define('AUTOSAVE_INTERVAL', 60 * 60 * 60 * 24 * 365); // autosave 1x per year
       /* Disable Post Revisions. */
       define('WP_POST_REVISIONS', false);
       /* Media Trash. */
       define('MEDIA_TRASH', false);
       /* Trash Days. */
       define('EMPTY_TRASH_DAYS', 0);
       /* Disable the Plugin and Theme Editor */
       define('DISALLOW_FILE_EDIT', true);
   
       /* PHP Memory */
       define('WP_MEMORY_LIMIT', '128M');
       define('WP_MAX_MEMORY_LIMIT', '192M');
   
       define('WP_DEBUG_DISPLAY', true);
       define('SCRIPT_DEBUG', true);
       define('SAVEQUERIES', true);
       define('WP_DEBUG_LOG', false);
   
       /* Compression */
       define('COMPRESS_CSS', false);
       define('COMPRESS_SCRIPTS', false);
       define('CONCATENATE_SCRIPTS', false);
       define('WP_LOCAL_DEV', true);
       ```
   
 *  Plugin Author [Sybre Waaijer](https://wordpress.org/support/users/cybr/)
 * (@cybr)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/#post-8958819)
 * [@vit-1](https://wordpress.org/support/users/vit-1/) perfect! Thanks for that
   🙂 I can now also replicate it.
 * 2.9.1 release will be within 8 hours if everything goes alright.
 *  Plugin Author [Sybre Waaijer](https://wordpress.org/support/users/cybr/)
 * (@cybr)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/#post-8958871)
 * **Quick update:**
    This all has to do with `WP_DEBUG` being turned on. These 
   issues can be resolved when `WP_DEBUG` is turned off, which should always be 
   the case on live sites.
 * Alternatively, if you wish to use permanent debugging on live sites, please add
   a mu-plugin with the following line to prevent such collisions:
 *     ```
       ini_set( 'error_log', WP_CONTENT_DIR . '/error.log' );
       ```
   
 * And add the following to `wp-config.php`:
 *     ```
       define('WP_DEBUG_DISPLAY', false);
       ```
   
 * That way, your debug output will always be put in a file so it won’t hinder the
   visitors or admins.
 * This is also why I didn’t spot this error earlier, my apologies.
 * **The cause:**
    Both errors are caused by a very early WordPress action to save
   a post object. This in turn fires the doing it wrong notice within The SEO Framework,
   because it’s determining the cache key to clear the transient cache. Now, I’ve
   added a “doing it wrong” notice to prevent mixed output mistakes. But, because
   WordPress’ query isn’t initiated completely at this stage, it will fire.
 * This clearly is a case of code debt, where I assume query states automatically(
   which actually works fine) through a god method. But, because we know the objects,
   this shouldn’t be used. A patch is on its way that will solve all related issues.
 * Thanks again for the bug reports and sticking around! 🙂
 *  Plugin Author [Sybre Waaijer](https://wordpress.org/support/users/cybr/)
 * (@cybr)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/#post-8959486)
 * This should be fixed as of 2.9.1 🙂
 * If you find any more issues, do let me know!
 * Have a wonderful Monday! 😀
 *  Thread Starter [Aaron Richardson](https://wordpress.org/support/users/n3rdabl3/)
 * (@n3rdabl3)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/#post-8959745)
 * Hey [@cybr](https://wordpress.org/support/users/cybr/),
 * Thank you for the regular updates on this issue, I’ve installed 2.9.1 and will
   report back if I run into any problems again!
 *  [Jared Atchison](https://wordpress.org/support/users/jaredatch/)
 * (@jaredatch)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/#post-9037571)
 * The issue with this error and how’s it’s triggers is that it includes AJAX requests,
   which causes false positives.
 * IMO it really needs to contain a DOING_AJAX check during init.
 *  Plugin Author [Sybre Waaijer](https://wordpress.org/support/users/cybr/)
 * (@cybr)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/#post-9037626)
 * Hi [@jaredatch](https://wordpress.org/support/users/jaredatch/),
 * Are you still encountering issues, internally or otherwise with 3rd party implementations?
 * The idea behind the internal query state checking is that it will always output
   the expected values… ergo it is to prevent duplicated descriptions, wrong canonical
   URLs, etc…
 * When these checks happen on AJAX, we’re dealing with advanced objects that haven’t
   been accounted for yet, whereas some rather require dedicated method calls (we’re
   still talking about code debt).
    As a solution, in simple English: In AJAX we
   can’t determine the state. So, we should know it beforehand and then call dedicated
   methods that accept such a state as input parameters or are otherwise dedicated
   to such state, without it checking the query.
 * The SEO Framework will eventually transition into being completely compatible
   with AJAX and REST requests through its API. But for now, it’s statically implemented
   and otherwise unaccounted for. So, you’d unfortunately have to copy the methods
   for now if you’d alternatively query issues.
 *  [Jared Atchison](https://wordpress.org/support/users/jaredatch/)
 * (@jaredatch)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/#post-9037756)
 * Thanks for the quick response.
 * The issue we’re encountering is with our plugin WPForms ([https://wordpress.org/plugins/wpforms-lite/](https://wordpress.org/plugins/wpforms-lite/)).
 * In our form builder, we have an AJAX function the fires and runs `wp_update_post`.
   The appears to trigger an issue in the plugin.
 * From our customer:
 * > When attempting to add new form fields via WPForms admin UI, it just hangs.
   > Chome Dev Tools Console shows:
   > _Notice: The\_SEO\_FrameworkQuery::can\_cache\_query was called incorrectly.
   > You’ve initiated a method that uses queries too early. (This message was added
   > in version 2.9.0 of The SEO Framework.) In /path/to/wordpress/wp-content/plugins/
   > autodescription/inc/classes/query.class.php on line 64._
   > Turning off error reporting makes the console log output go away and fields
   > are then able to be added.
 *  Plugin Author [Sybre Waaijer](https://wordpress.org/support/users/cybr/)
 * (@cybr)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/#post-9037961)
 * Hi [@jaredatch](https://wordpress.org/support/users/jaredatch/),
 * That’s very clear! Thanks 🙂
 * I’ll go check it out. If I find anything, it will be released with version 2.9.2
   this week (or shortly after).
 * Cheers!
 *  [Jared Atchison](https://wordpress.org/support/users/jaredatch/)
 * (@jaredatch)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/#post-9038043)
 * Thanks!
 * Actually, the AJAX call in question first runs `get_posts` then runs `wp_update_post`.
 * Looking at the code my guess is that the wp_query->query isn’t going to be set
   for AJAX (the check is probably triggered from get_posts?) requests as their 
   is no primary core query.
 *  Plugin Author [Sybre Waaijer](https://wordpress.org/support/users/cybr/)
 * (@cybr)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/#post-9041816)
 * Hi [@jaredatch](https://wordpress.org/support/users/jaredatch/),
 * Did the user update to TSF 2.9.1 yet? Because I couldn’t reproduce the issue.
 * In TSF 2.9.1 I created cache key generation by type, where the ID is already 
   known.
    This inclusively fixes any AJAX issues with post updates.
 * [get_meta_output_cache_key()](https://github.com/sybrew/the-seo-framework/blob/963edf26c60ac4f4aa932d0427addab0894727a4/inc/classes/cache.class.php#L869-L894)
   is used in 2.9.0 and before.
    [get_meta_output_cache_key_by_type()](https://github.com/sybrew/the-seo-framework/blob/963edf26c60ac4f4aa932d0427addab0894727a4/inc/classes/cache.class.php#L896-L917)
   is used in 2.9.1 and later.
 *  [Jared Atchison](https://wordpress.org/support/users/jaredatch/)
 * (@jaredatch)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/#post-9049427)
 * Thanks for the details. I didn’t look at the version number originally but I’ll
   see if updating resolves things. Appreciate it.

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘“Saving Draft” Hangs / Errors Since Update’ is closed to new replies.

 * ![](https://ps.w.org/autodescription/assets/icon.svg?rev=3000376)
 * [The SEO Framework – Fast, Automated, Effortless.](https://wordpress.org/plugins/autodescription/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autodescription/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autodescription/)
 * [Active Topics](https://wordpress.org/support/plugin/autodescription/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autodescription/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autodescription/reviews/)

## Tags

 * [hang](https://wordpress.org/support/topic-tag/hang/)

 * 14 replies
 * 5 participants
 * Last reply from: [Jared Atchison](https://wordpress.org/support/users/jaredatch/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/saving-draft-hangs-errors-since-update/#post-9049427)
 * Status: resolved