[wp-trac] [WordPress Trac] #33752: Allow plugin admin page to skip including admin-footer.php

WordPress Trac noreply at wordpress.org
Sun Sep 6 08:12:12 UTC 2015


#33752: Allow plugin admin page to skip including admin-footer.php
-------------------------+-----------------------------
 Reporter:  extendwings  |       Owner:
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  Plugins      |     Version:
 Severity:  normal       |  Resolution:  invalid
 Keywords:               |     Focuses:  administration
-------------------------+-----------------------------
Changes (by johnbillion):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 Replying to [comment:2 extendwings]:
 > In [https://github.com/shield-9/two-factor-phone/blob/master/class.two-
 factor-phone.php#L361 my plugin], I'm using `noheader` (url query) and
 `exit` to output XML data.
 > But in [https://github.com/shield-9/two-factor-
 phone/blob/master/tests/phpunit/tests/class.two-factor-phone.php#L329 unit
 test], `exit` aborts PHPUnit, unexpectedly.

 Thanks for the info. Have you tested your patch? The AJAX handler in
 WordPress doesn't output the admin footer (for obvious reasons), so adding
 a conditional there would not affect your plugin.

 Instead, you should split your plugin's `show_twiml_page()` method into
 two. One which handles the AJAX processing and one which generates and
 returns the TwiML. Then you can test the TwiML generation in your unit
 test, and test the AJAX request and response in an integration test.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33752#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list