[wp-trac] [WordPress Trac] #22435: Export API

WordPress Trac noreply at wordpress.org
Fri Oct 25 16:25:40 UTC 2013


#22435: Export API
------------------------------------+------------------------------
 Reporter:  nbachiyski              |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Export                  |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |
------------------------------------+------------------------------

Comment (by nbachiyski):

 Oh, we should have definitely done something with the error result of
 `wp_export()` and also, we should’ve buffered the output, I totally agree.

 Few notes on the patch:

 * Instead of adding `wp_die()`s to `wp_export()`, we should process the
 return value of `wp_export()` in `wp-admin/export.php` and add the
 possible `wp_die()` there. One of the ideas of `wp_export()` is that it
 can be used in any context: web, cli, other libraries. If we add a
 `wp_die()` there, we will deprive the callers of control what to do in
 case of an error.
 * It’s strange that in `WP_Export_XML_Over_HTTP` we are both explicitly
 echoing to standard output and then using output buffering to collect the
 result.
 [https://github.com/nb/WordPress/commit/5d2e4e9e34812c16ee75314dae27d42f2601afaa
 This commit] fixes that and makes sure we don't output anything before the
 export process is over.
 ([https://github.com/nb/WordPress/commit/5d2e4e9e34812c16ee75314dae27d42f2601afaa.patch
 a diff file, if needed]).
 * I am on the fence if we should be including the tax loop handling in the
 export, at all. My intuition tells me that we are fixing the problem at
 the wrong level. I have a few questions:
   - Are orphaned terms causing trouble in other parts of WordPress? If
 yes, we should solve this at a higher level.
   - Is this problem known outside of WordPress.com? If not, can we just
 add a filter/action in the export and deal with this locally on
 WordPress.com, instead of adding more code and complexity for everybody.
   - What is the root cause? Can we just fix it, fix all the sites, and not
 bother with adding more code here?

--
Ticket URL: <http://core.trac.wordpress.org/ticket/22435#comment:34>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list