Skip to content

Commit

Permalink
Issue #71 - Update admin tests for Trace files directory
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed Jun 24, 2018
1 parent 4281f59 commit 2185823
Show file tree
Hide file tree
Showing 9 changed files with 835 additions and 237 deletions.
8 changes: 7 additions & 1 deletion includes/class-trace-logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ public function __construct() {

/**
* Returns the daily trace summary file prefix
*
* If the trace files directory is not set then bw_trace_summary won't be set.
*/
public function get_summary_file_prefix() {
global $bw_trace_summary;
$summary_file = $bw_trace_summary->get_summary_file_prefix();
if ( $bw_trace_summary ) {
$summary_file = $bw_trace_summary->get_summary_file_prefix();
} else {
$summary_file = null;
}
return $summary_file;
}

Expand Down
28 changes: 1 addition & 27 deletions oik-bwtrace.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,37 +85,13 @@ function bw_trace_plugin_startup() {
oik_require( "includes/class-BW-trace-controller.php", "oik-bwtrace" );
global $bw_trace;
$bw_trace = new BW_trace_controller();

//global $bw_trace_options, $bw_action_options;
global $bw_action_options;
//$bw_trace_options = get_option( 'bw_trace_options' );
//if ( !isset( $bw_action_options ) ) {
$bw_action_options = get_option( 'bw_action_options' );
//}
$tracing = bw_trace_status();
//$bw_trace_ip = bw_array_get( $bw_trace_options, "ip", null );
//if ( $bw_trace_ip ) {
// $server = bw_array_get( $_SERVER, "REMOTE_ADDR", null );
// if ( $server ) {
// $tracing = ( $server == $bw_trace_ip );
// } else {
// $tracing = ( $bw_trace_ip === php_sapi_name() );
// }
// }
//$bw_trace_ip = $bw_trace->trace_ip();
//$bw_trace_reset = $bw_trace->reset_status();
//if ( $bw_trace_reset ) {
// oik_require2( "includes/bwtrace.php", "oik-bwtrace" );
// bw_trace_reset();
// }

if ( $tracing ) {
$bw_trace_level = bw_trace_level();
bw_trace_on();


//oik_require2( "includes/bwtrace.php", "oik-bwtrace" );

} else {
bw_trace_off();
}
Expand All @@ -127,7 +103,7 @@ function bw_trace_plugin_startup() {
if ( defined( "BW_COUNT_ON" ) && true == BW_COUNT_ON ) {

oik_require( "includes/oik-action-counts.php", "oik-bwtrace" );
bw_trace_count_plugins_loaded( true );
bw_trace_count_plugins_loaded( true );
$count_hooks = true;
} else {
oik_require( "includes/oik-action-counts.php", "oik-bwtrace" );
Expand All @@ -146,10 +122,8 @@ function bw_trace_plugin_startup() {
}
add_action( "wp_loaded", "oik_bwtrace_plugins_loaded", 9 );
add_filter( "oik_query_libs", "oik_bwtrace_query_libs", 12 );

}


/**
* Implement "wp_loaded" filter for oik-bwtrace
*/
Expand Down
106 changes: 72 additions & 34 deletions tests/data/bb_BB/test_bw_action_options_do_page_bb_BB.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h3 class="hndle">Otpoins</h3>
</tr>
<tr>
<td>
<label for="bw_action_options[trace_status_report]">Tarce 'suhdtwon' satuts rperot And lOg In smuamry flie</label>
<label for="bw_action_options[trace_status_report]">Tarce 'suhdtwon' satuts rperot</label>
</td>
<td>
<input type="hidden" name="bw_action_options[trace_status_report]" value="0" />
Expand Down Expand Up @@ -169,6 +169,44 @@ <h3 class="hndle">Otpoins</h3>
</form>
</div>
</div>
<div class="postbox " id="oik_trace_summary">
<button type="button" class="handlediv" aria-expanded="true">
<span class="screen-reader-text">Tgolge pnael: Dialy Tarce Smuamry</span>
<span class="toggle-indicator" aria-hidden="true">
</span>
</button>
<h3 class="hndle">Dialy Tarce Smuamry</h3>
<div class="inside">
<form method="post" action="options.php">
<table class="form-table">
<input type='hidden' name='option_page' value='bw_summary_options_options' />
<input type="hidden" name="action" value="update" />
<input type="hidden" id="_wpnonce" name="_wpnonce" value="nonsense" />
<input type="hidden" name="_wp_http_referer" value="/" />
<tr>
<td>
<label for="bw_summary_options[summary_file]">Dialy tarce smuamry flie</label>
</td>
<td>
<input type="text" size="60"name="bw_summary_options[summary_file]" id="bw_summary_options[summary_file]" value=" " class="" />
</td>
</tr>
<tr>
<td>
<label for="bw_summary_options[trace_status_report]">LOg tarsncaitnos tO dialy tarce smuamry flie</label>
</td>
<td>
<input type="hidden" name="bw_summary_options[trace_status_report]" value="0" />
<input type="checkbox" name="bw_summary_options[trace_status_report]" id="bw_summary_options[trace_status_report]" checked="checked"/>
</td>
</tr>
</table>
<p>
<input type="submit" name="ok" value="Svae cahgnes" class="button-primary" />
</p>
</form>
</div>
</div>
<div class="postbox " id="oik_trace_info">
<button type="button" class="handlediv" aria-expanded="true">
<span class="screen-reader-text">Tgolge pnael: Ifnroamiton</span>
Expand All @@ -188,205 +226,205 @@ <h3 class="hndle">Ifnroamiton</h3>
<tbody>
<tr>
<td>$wp_version</td>
<td>190</td>
<td>228</td>
<td>WroPderss vreison</td>
</tr>
<tr>
<td>PHP_VERSION</td>
<td>195</td>
<td>233</td>
<td>generic PHP end of life</td>
</tr>
<tr>
<td>WP_DEBUG</td>
<td>200</td>
<td>238</td>
<td>
</td>
</tr>
<tr>
<td>WP_DEBUG_LOG</td>
<td>206</td>
<td>244</td>
<td>
</td>
</tr>
<tr>
<td>WP_DEBUG_DISPLAY</td>
<td>212</td>
<td>250</td>
<td>
</td>
</tr>
<tr>
<td>error_reporting</td>
<td>218</td>
<td>256</td>
<td>
<a href="http://php.net/manual/en/errorfunc.configuration.php#ini.error-reporting">http://php.net/manual/en/errorfunc.configuration.php#ini.error-reporting</a>
</td>
</tr>
<tr>
<td>display_errors</td>
<td>225</td>
<td>263</td>
<td>
<a href="http://php.net/manual/en/errorfunc.configuration.php#ini.display-errors">http://php.net/manual/en/errorfunc.configuration.php#ini.display-errors</a>
</td>
</tr>
<tr>
<td>log_errors</td>
<td>232</td>
<td>270</td>
<td>
<a href="http://php.net/manual/en/errorfunc.configuration.php#ini.log-errors">http://php.net/manual/en/errorfunc.configuration.php#ini.log-errors</a>
</td>
</tr>
<tr>
<td>error_log</td>
<td>239</td>
<td>277</td>
<td>
<a href="http://php.net/manual/en/errorfunc.configuration.php#ini.error-log">http://php.net/manual/en/errorfunc.configuration.php#ini.error-log</a>
</td>
</tr>
<tr>
<td>output_buffering</td>
<td>246</td>
<td>284</td>
<td>SEt tO Off fOr bteetr dteceiton Of Ntocie: Udnfenied mseasegs</td>
</tr>
<tr>
<td>implicit_flush</td>
<td>251</td>
<td>289</td>
<td>
<a href="http://php.net/manual/en/outcontrol.configuration.php#ini.implicit-flush">http://php.net/manual/en/outcontrol.configuration.php#ini.implicit-flush</a>
</td>
</tr>
<tr>
<td>SCRIPT_DEBUG</td>
<td>258</td>
<td>296</td>
<td>
</td>
</tr>
<tr>
<td>JETPACK_DEV_DEBUG</td>
<td>264</td>
<td>302</td>
<td>
</td>
</tr>
<tr>
<td>Mluitiste</td>
<td>270</td>
<td>308</td>
<td>
</td>
</tr>
<tr>
<td>WP_SITEURL</td>
<td>276</td>
<td>314</td>
<td>
</td>
</tr>
<tr>
<td>siteurl</td>
<td>282</td>
<td>320</td>
<a href="https://qw/src">https://qw/src</a>
</td>
<td>
</td>
</tr>
<tr>
<td>WP_HOME</td>
<td>290</td>
<td>328</td>
<td>
</td>
</tr>
<tr>
<td>home</td>
<td>296</td>
<td>334</td>
<a href="https://qw/src">https://qw/src</a>
</td>
<td>
</td>
</tr>
<tr>
<td>ABSPATH</td>
<td>304</td>
<td>342</td>
<td>
</td>
</tr>
<tr>
<td>WP_MEMORY_LIMIT</td>
<td>310</td>
<td>348</td>
<td>
</td>
</tr>
<tr>
<td>BW_TRACE_CONFIG_STARTUP</td>
<td>316</td>
<td>354</td>
<td>
</td>
</tr>
<tr>
<td>BW_TRACE_ON</td>
<td>322</td>
<td>360</td>
<td>
</td>
</tr>
<tr>
<td>BW_COUNT_ON</td>
<td>328</td>
<td>366</td>
<td>
</td>
</tr>
<tr>
<td>BW_TRACE_LEVEL</td>
<td>334</td>
<td>372</td>
<td>
</td>
</tr>
<tr>
<td>BW_TRACE_RESET</td>
<td>340</td>
<td>378</td>
<td>
</td>
</tr>
<tr>
<td>DB_NAME</td>
<td>346</td>
<td>384</td>
<td>
</td>
</tr>
<tr>
<td>MULTISITE</td>
<td>352</td>
<td>390</td>
<td>
</td>
</tr>
<tr>
<td>SUBDOMAIN_INSTALL</td>
<td>358</td>
<td>396</td>
<td>
</td>
</tr>
<tr>
<td>DOMAIN_CURRENT_SITE</td>
<td>364</td>
<td>402</td>
<td>
</td>
</tr>
<tr>
<td>PATH_CURRENT_SITE</td>
<td>370</td>
<td>408</td>
<td>
</td>
</tr>
<tr>
<td>SITE_ID_CURRENT_SITE</td>
<td>376</td>
<td>414</td>
<td>
</td>
</tr>
<tr>
<td>BLOG_ID_CURRENT_SITE</td>
<td>382</td>
<td>420</td>
<td>
</td>
</tr>
<tr>
<td>SUNRISE</td>
<td>388</td>
<td>426</td>
<td>
</td>
</tr>
Expand Down
Loading

0 comments on commit 2185823

Please sign in to comment.