.
*/
// function to replace wp_die if it doesn't exist
if ( ! function_exists( 'wp_die' ) ) : function wp_die ($message = 'wp_die') { die( $message ); } endif;
// don't load directly - exit if add_action or plugins_url functions do not exist
if ( ! defined( 'ABSPATH' ) || ! function_exists( 'add_action' ) || ! function_exists( 'plugins_url' ) )
die( 'death by askapache firing squad' );
if ( ! class_exists( 'AA_DEBUG' ) ) :
/******************************************************************************************************************************************************************
PHP DEFINES
* __LINE__ The current line number of the file.
* __FILE__ The full path and filename of the file. If used inside an include, the name of the included file is returned
* __DIR__ The directory of the file. If used inside an include, the directory of the included file is returned. Does not have a trailing slash unless it is the root directory.
* __FUNCTION__ The function name. As of PHP 5 this constant returns the function name as it was declared (case-sensitive). In PHP 4 its value is always lowercased.
* __CLASS__ The class name. As of PHP 5 this constant returns the class name as it was declared (case-sensitive). In PHP 4 its value is always lowercased.
* __METHOD__ The class method name. The method name is returned as it was declared (case-sensitive).
* __NAMESPACE__ The name of the current namespace (case-sensitive). This constant is defined in compile-time
******************************************************************************************************************************************************************/
! defined( '__DIR__' ) && define('__DIR__', realpath(dirname(__FILE__)));
! defined( 'FILE_BINARY' ) && define('FILE_BINARY', 0);
if ( ! defined( 'PHP_VERSION_ID' ) ) {
list( $major, $minor, $bug ) = explode( '.', phpversion(), 3 );
$bug = ( (int) $bug < 10 ) ? '0' . (int) $bug : (int) $bug; // Many distros make up their own versions
define( 'PHP_VERSION_ID', "{$major}0{$minor}$bug" );
! defined( 'PHP_MAJOR_VERSION' ) && define( 'PHP_MAJOR_VERSION', $major );
}
if ( ! defined( 'PHP_EOL' ) ) {
switch ( strtoupper( substr( PHP_OS, 0, 3 ) ) ) {
case 'WIN':
define( 'PHP_EOL', "\r\n" );
break;
case 'DAR':
define( 'PHP_EOL', "\r" );
break;
default:
define( 'PHP_EOL', "\n" );
break;
}
}
/******************************************************************************************************************************************************************
WORDPRESS DEFINES
******************************************************************************************************************************************************************/
! defined( 'WP_CONTENT_DIR' ) && define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only
! defined( 'WP_PLUGIN_DIR' ) && define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash
! defined( 'WP_CONTENT_URL' ) && define( 'WP_CONTENT_URL', WP_SITEURL . '/wp-content' ); // full url
! defined( 'WP_PLUGIN_URL' ) && define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash
! defined( 'CRLF' ) && define( 'CRLF', chr( 13 ) . chr( 10 ) );
/******************************************************************************************************************************************************************
FUNCTION DEFINES
******************************************************************************************************************************************************************/
/** aadv_error_log($msg='')
* since 2.3.2
*/
function aadv_error_log($msg='') {
return error_log( $msg );
}
/** aadv_DEFINE_function()
* since 2.3.3
*/
function aadv_DEFINE_function($f='') {
$funcs = array(
'absint',
'array_walk_recursive',
'curl_setopt_array',
'get_include_path',
'inet_ntop',
'inet_pton',
'ini_get_all',
'is_a',
'is_callable',
'is_scalar',
'md5_file',
'mhash',
'microtime',
'mkdir',
'ob_clean',
'ob_flush',
'ob_get_clean',
'ob_get_flush',
'pathinfo',
'php_ini_loaded_file',
'restore_include_path',
'scandir',
'set_include_path',
'sys_get_temp_dir',
'time_sleep_until',
'var_export',
'wp_die'
);
if ( empty( $f ) ) return $funcs;
switch( $f ) {
case 'absint':
function absint( $maybeint )
{
return abs( intval( $maybeint ) );
}
break;
case 'array_walk_recursive':
function array_walk_recursive(&$input, $funcname)
{
if (!is_callable($funcname))
{
if (is_array($funcname)) $funcname = $funcname[0] . '::' . $funcname[1];
user_error('array_walk_recursive() Not a valid callback ' . $funcname, E_USER_WARNING);
return;
}
if (!is_array($input))
{
user_error('array_walk_recursive() The argument should be an array', E_USER_WARNING);
return;
}
$args = func_get_args();
foreach ($input as $key => $item)
{
$callArgs = $args;
if (is_array($item)) {
$thisCall = 'array_walk_recursive';
$callArgs[1] = $funcname;
} else {
$thisCall = $funcname;
$callArgs[1] = $key;
}
$callArgs[0] = &$input[$key];
call_user_func_array($thisCall, $callArgs);
}
};
break;
case 'curl_setopt_array':
function curl_setopt_array(&$ch, $curl_options)
{
$curl_info=array(
'url'=>'Last effective URL',
'content_type'=>'Content-type of downloaded object',
'http_code'=>'Last received HTTP code',
'header_size'=>'Total size of all headers received',
'request_size'=>'Total size of issued requests, currently only for HTTP requests',
'filetime'=>'Remote time of the retrieved document',
'ssl_verify_result'=>'Result of SSL certification verification requested',
'redirect_count'=>'Total number of redirects',
'total_time'=>'Total transaction time in seconds for last transfer',
'namelookup_time'=>'Time in seconds until name resolving was complete',
'connect_time'=>'Time in seconds it took to establish the connection',
'pretransfer_time'=>'Time in seconds from start until just before file transfer begins',
'size_upload'=>'Total number of bytes uploaded',
'size_download'=>'Total number of bytes downloaded',
'speed_download'=>'Average download speed',
'speed_upload'=>'Average upload speed',
'download_content_length'=>'content-length of download, read from Content-Length: field',
'upload_content_length'=>'Specified size of upload',
'starttransfer_time'=>'Time in seconds until the first byte is about to be transferred',
'redirect_time'=>'Time in seconds of all redirection steps before final transaction was started'
);
foreach ($curl_options as $option => $value) {
if (!curl_setopt($ch, $option, $value)) return false;
}
return true;
}
break;
case 'get_include_path':
function get_include_path()
{
return ini_get('include_path');
};
break;
case 'inet_ntop':
function inet_ntop($in_addr)
{
switch (strlen($in_addr)) {
case 4:
list(,$r) = unpack('N', $in_addr);
return long2ip($r);
case 16:
$r = substr(chunk_split(bin2hex($in_addr), 4, ':'), 0, -1);
$r = preg_replace( array('/(?::?\b0+\b:?){2,}/', '/\b0+([^0])/e'), array('::', '(int)"$1"?"$1":"0$1"'), $r);
return $r;
}
return false;
};
break;
case 'inet_pton':
function inet_pton($address)
{
$r = ip2long($address);
if ($r !== false && $r != -1) return pack('N', $r);
$delim_count = substr_count($address, ':');
if ($delim_count < 1 || $delim_count > 7) return false;
$r = explode(':', $address);
$rcount = count($r);
if (($doub = array_search('', $r, 1)) !== false) {
$length = (!$doub || $doub == $rcount - 1 ? 2 : 1);
array_splice($r, $doub, $length, array_fill(0, 8 + $length - $rcount, 0));
}
$r = array_map('hexdec', $r);
array_unshift($r, 'n*');
$r = call_user_func_array('pack', $r);
return $r;
};
break;
case 'ini_get_all':
function ini_get_all($extension=null)
{
// Sanity check
if ($extension !== null && !is_scalar($extension)) {
user_error('ini_get_all() expects parameter 1 to be string, ' . gettype($extension) . ' given', E_USER_WARNING);
return false;
}
// Get the location of php.ini
ob_start();
phpinfo(INFO_GENERAL);
$info = ob_get_contents();
ob_clean();
$info = explode("\n", $info);
$line = array_values(preg_grep('#php\.ini#', $info));
// Plain vs HTML output
if (substr($line[0], 0, 4) === '
') {
list (, $value) = explode('
', $line[0], 2);
$inifile = trim(strip_tags($value));
} else {
list (, $value) = explode(' => ', $line[0], 2);
$inifile = trim($value);
}
// Check the file actually exists
if (!file_exists($inifile)) {
user_error('ini_get_all() Unable to find php.ini', E_USER_WARNING);
return false;
}
// Check the file is readable
if (!is_readable($inifile)) {
user_error('ini_get_all() Unable to open php.ini', E_USER_WARNING);
return false;
}
// Parse the ini
if ($extension !== null)
{
$ini_all = parse_ini_file($inifile, true);
// Lowercase extension keys
foreach ($ini_all as $key => $value) $ini_arr[strtolower($key)] = $value;
// Check the extension exists
if (isset($ini_arr[$extension])) $ini = $ini_arr[$extension];
else {
user_error("ini_get_all() Unable to find extension '$extension'",E_USER_WARNING);
return false;
}
} else {
$ini = parse_ini_file($inifile);
}
// Order
$ini_lc = array_map('strtolower', array_keys($ini));
array_multisort($ini_lc, SORT_ASC, SORT_STRING, $ini);
// Format
$info = array();
foreach ($ini as $key => $value) $info[$key] = array( 'global_value'=>$value, 'local_value'=>ini_get($key), 'access'=>-1);
return $info;
};
break;
case 'is_a':
function is_a($object, $class)
{
if (!is_object($object)) return false;
if (strtolower(get_class($object)) == strtolower($class)) return true;
else return is_subclass_of($object, $class);
};
break;
case 'is_callable':
function is_callable($var, $syntax_only = false)
{
if (!is_string($var) && !(is_array($var) && count($var) == 2 && isset($var[0], $var[1]) && is_string($var[1]) && (is_string($var[0]) || is_object($var[0])))) return false;
if ($syntax_only) return true;
if (is_string($var)) return function_exists($var);
else if (is_array($var))
{
if (is_string($var[0])) {
$methods = get_class_methods($var[0]);
$method = strtolower($var[1]);
if ($methods) {
foreach ($methods as $classMethod) {
if (strtolower($classMethod) == $method) return true;
}
}
} else {
return method_exists($var[0], $var[1]);
}
}
return false;
};
break;
case 'is_scalar':
function is_scalar($val)
{
return (is_bool($val) || is_int($val) || is_float($val) || is_string($val));
};
break;
case 'md5_file':
function md5_file($filename, $raw_output = false)
{
// Sanity check
if (!is_scalar($filename)) {
user_error('md5_file() expects parameter 1 to be string, ' . gettype($filename) . ' given', E_USER_WARNING);
return;
}
if (!is_scalar($raw_output)) {
user_error('md5_file() expects parameter 2 to be bool, ' . gettype($raw_output) . ' given', E_USER_WARNING);
return;
}
if (!file_exists($filename)) {
user_error('md5_file() Unable to open file', E_USER_WARNING);
return false;
}
// Read the file
if (false === $fh = fopen($filename, 'rb')) {
user_error('md5_file() failed to open stream: No such file or directory', E_USER_WARNING);
return false;
}
clearstatcache();
if ($fsize = @filesize($filename)) {
$data = fread($fh, $fsize);
} else {
$data = '';
while (!feof($fh)) $data .= fread($fh, 8192);
}
fclose($fh);
// Return
$data = md5($data);
if ($raw_output === true) $data = pack('H*', $data);
return $data;
};
break;
case 'mhash':
! defined('MHASH_CRC32') && define('MHASH_CRC32', 0);
! defined('MHASH_MD5') && define('MHASH_MD5', 1);
! defined('MHASH_SHA1') && define('MHASH_SHA1', 2);
! defined('MHASH_HAVAL256') && define('MHASH_HAVAL256', 3);
! defined('MHASH_RIPEMD160') && define('MHASH_RIPEMD160', 5);
! defined('MHASH_TIGER') && define('MHASH_TIGER', 7);
! defined('MHASH_GOST') && define('MHASH_GOST', 8);
! defined('MHASH_CRC32B') && define('MHASH_CRC32B', 9);
! defined('MHASH_HAVAL192') && define('MHASH_HAVAL192', 11);
! defined('MHASH_HAVAL160') && define('MHASH_HAVAL160', 12);
! defined('MHASH_HAVAL128') && define('MHASH_HAVAL128', 13);
! defined('MHASH_TIGER128') && define('MHASH_TIGER128', 14);
! defined('MHASH_TIGER160') && define('MHASH_TIGER160', 15);
! defined('MHASH_MD4') && define('MHASH_MD4', 16);
! defined('MHASH_SHA256') && define('MHASH_SHA256', 17);
! defined('MHASH_ADLER32') && define('MHASH_ADLER32', 18);
function mhash($hashtype, $data, $key = '')
{
switch ($hashtype)
{
case MHASH_MD5:
$key = str_pad((strlen($key) > 64 ? pack("H*", md5($key)) : $key), 64, chr(0x00));
$k_opad = $key ^ (str_pad('', 64, chr(0x5c)));
$k_ipad = $key ^ (str_pad('', 64, chr(0x36)));
return pack("H*", md5($k_opad . pack("H*", md5($k_ipad . $data))));
default:
return false;
break;
}
};
break;
case 'microtime':
function microtime($get_as_float = false)
{
if (!function_exists('gettimeofday'))
{
$time = time();
return $get_as_float ? ($time * 1000000.0) : '0.00000000 ' . $time;
}
$gtod = gettimeofday();
$usec = $gtod['usec'] / 1000000.0;
return $get_as_float ? (float) ($gtod['sec'] + $usec) : (sprintf('%.8f ', $usec) . $gtod['sec']);
};
break;
case 'mkdir':
function mkdir($pathname, $mode = 0777, $recursive = true, $context = null)
{
if (version_compare(PHP_VERSION, '5.0.0', 'gte')) return (func_num_args() > 3) ? mkdir($pathname, $mode, $recursive, $context) : mkdir($pathname, $mode, $recursive);
if (!strlen($pathname)) {
user_error('No such file or directory', E_USER_WARNING);
return false;
}
if (is_dir($pathname))
{
if (func_num_args() == 5) return true;
user_error('File exists', E_USER_WARNING);
return false;
}
$parent_is_dir = mkdir(dirname($pathname), $mode, $recursive, null, 0);
if ($parent_is_dir) return mkdir($pathname, $mode);
user_error('No such file or directory', E_USER_WARNING);
return false;
};
break;
case 'ob_clean':
function ob_clean()
{
if (@ob_end_clean()) return ob_start();
user_error("ob_clean() failed to delete buffer. No buffer to delete.", E_USER_NOTICE);
return false;
};
break;
case 'ob_flush':
function ob_flush()
{
if (@ob_end_flush()) return ob_start();
user_error("ob_flush() Failed to flush buffer. No buffer to flush.", E_USER_NOTICE);
return false;
};
break;
case 'ob_get_clean':
function ob_get_clean()
{
$contents = ob_get_contents();
if ($contents !== false) ob_end_clean();
return $contents;
};
break;
case 'ob_get_flush':
function ob_get_flush()
{
$contents = ob_get_contents();
if ($contents !== false) ob_end_flush();
return $contents;
};
break;
case 'pathinfo':
! defined('PATHINFO_FILENAME') && define('PATHINFO_FILENAME', 8);
function pathinfo($path = false, $options = false)
{
// Sanity check
if (!is_scalar($path)) {
user_error('pathinfo() expects parameter 1 to be string, ' . gettype($path) . ' given', E_USER_WARNING);
return;
}
if (version_compare(PHP_VERSION, '5.2.0', 'ge')) return pathinfo($path, $options);
if ($options & PATHINFO_FILENAME) {
if (strpos($path, '.') !== false) $filename = substr($path, 0, strrpos($path, '.'));
if ($options === PATHINFO_FILENAME) return $filename;
$pathinfo=pathinfo($path, $options);
$pathinfo['filename']=$filename;
return $pathinfo;
}
return pathinfo($path, $options);
};
break;
case 'php_ini_loaded_file':
function php_ini_loaded_file()
{
// Get the location of php.ini
ob_start();
phpinfo(INFO_GENERAL);
$info = ob_get_contents();
ob_clean();
$info = explode("\n", $info);
$line = array_values(preg_grep('#php\.ini#', $info));
// Plain vs HTML output
if (substr($line[0], 0, 4) === '
For super-advanced users, or those with access and knowledge of Apache .htaccess/httpd.conf files'
.' you should check that your error pages are correctly returning a 404 Not Found'
.' HTTP Header and not a 200 OK Header which appears to be the default for many WP installs, this plugin attempts to fix this using PHP, but the best way I have found'
.' is to add the following to your .htaccess file.
This is just a recommendation, this is not editable. Add this to your wp-config.php at the bottom BEFORE the wp-settings is included.';
echo ' This is unneccessary if you can modify your php.ini - See my wp-config.php tutorial.
';
echo '';
$this->t( __FILE__, __CLASS__, __FUNCTION__, __LINE__, '', 5 );
}
/** AA_DEBUG::live_debug()
*/
function live_debug() {
if ( $this->options['debug_live'] !== '1' ) return;
$this->t( __FILE__, __CLASS__, __FUNCTION__, __LINE__, '', 5 );
static $started = false;
/*
register_shutdown_function(
create_function('',
'error_log("overwrite_inis '.error_log("overwrite_inis").'");
'.(ob_start() && array_walk($this->old_inis,create_function('$a,$k', '$vv=strval(@ini_get($k ) ); if ($a!=$vv){@ini_set($k,$a);error_log("$a:@ini_set(\"$k\",\"$vv\");");};'))?ob_get_clean():ob_get_clean())
)
);
*/
if ( $started === true ) {
// using ini_restore for now until i figure out how to make it more secure (from malicious ini settings another plugin might try)
//error_log('restoring old_inis' );
foreach ( (array) $this->old_inis as $key => $val )
ini_restore( $key );
return error_reporting( $this->old_inis['error_reporting'] );
}
/*
static $inis=array(
"session.auto_start" => "0",
"safe_mode" => "0",
"tidy.clean_output" => "0",
"output_buffering" => "1",
"xdebug.default_enable" => "0",
"mbstring.func_overload" => "0",
"html_errors" => "0", // Turn off HTML tags in error messages. The new format for HTML errors produces clickable messages that direct the user to a page describing the error or function in causing the error. These references are affected by docref_root and docref_ext.
"magic_quotes_runtime" => "0",
"magic_quotes_gpc" => "0",
"ignore_repeated_errors" => "0", // Do not log repeated messages. Repeated errors must occur in the same file on the same line unless ignore_repeated_source is set true.
"ignore_repeated_source" => "0", // Ignore source of message when ignoring repeated messages. When this setting is On you will not log errors with repeated messages from different files or sourcelines.
"display_errors" => "0", //This determines whether errors should be printed to the screen as part of the output or if they should be hidden from the user. Value "stderr" sends the errors to stderr instead of stdout. The value is available as of PHP 5.2.4. In earlier versions, this directive was of type boolean. Although display_errors may be set at runtime (with ini_set()), it won't have any affect if the script has fatal errors. This is because the desired runtime action does not get executed.
"display_startup_errors" => "0", //Even when display_errors is on, errors that occur during PHP's startup sequence are not displayed. It's strongly recommended to keep display_startup_errors off, except for debugging.
"xmlrpc_errors" => "0",
"file_uploads" => "1",
"register_globals" => "1",
"register_long_arrays" => "1",
"register_argc_argv" => "1",
"always_populate_raw_post_data" => "1",
"report_memleaks" => "1", // If this parameter is set to Off, then memory leaks will not be shown (on stdout or in the log). This has only effect in a debug compile, and if error_reporting includes E_WARNING in the allowed list
"log_errors" => "1", //Tells whether script error messages should be logged to the server's error log or error_log. This option is thus server-specific.
"track_errors" => "1", // If enabled, the last error message will always be present in the variable $php_errormsg.
"output_handler" => "",
"open_basedir" => "",
"disable_functions" => "",
"error_prepend_string" => "", //String to output before an error message.
"error_append_string" => "", //String to output after an error message.
"auto_prepend_file" => "",
"auto_append_file" => "",
//"docref_root" => "", //The new error format contains a reference to a page describing the error or function causing the error. In case of manual pages you can download the manual in your language and set this ini directive to the URL of your local copy. If your local copy of the manual can be reached by "/manual/" you can simply use docref_root=/manual/. Additional you have to set docref_ext to match the fileextensions of your copy docref_ext=.html. It is possible to use external references. For example you can use docref_root=http://manual/en/ or docref_root="http://landonize.it/?how=url&theme=classic&filter=Landon &url=http%3A%2F%2Fwww.php.net%2F" Most of the time you want the docref_root value to end with a slash "/". But see the second example above which does not have nor need it.
//"docref_ext" => "", //The value of docref_ext must begin with a dot ".".
"log_errors_max_len"=>"0", // Set the maximum length of log_errors in bytes. In error_log information about the source is added. The default is 1024 and 0 allows to not apply any maximum length at all. This length is applied to logged errors, displayed errors and also to $php_errormsg. When an integer is used, the value is measured in bytes. Shorthand notation may also be used.
"xmlrpc_error_number" => "0", //Used as the value of the XML-RPC faultCode element.
//"error_log" => "", // Name of the file where script errors should be logged. The file should be writable by the web server's user. If the special value syslog is used, the errors are sent to the system logger instead. On Unix, this means syslog(3) and on Windows NT it means the event log. The system logger is not supported on Windows 95. See also: syslog(). If this directive is not set, errors are sent to the SAPI error logger. For example, it is an error log in Apache or stderr in CLI.
"request_order" => "GPCES"
);
*/
//error_log('overwriting inis: BEGIN' );
$ini_overwrites = array(
//'precision' => '14',
//'report_zend_debug' => 0,
//'output_handler' => '',
//'session.auto_start' => '0',
//'zlib.output_compression' => 0,
//'output_buffering' => 0,
'open_basedir' => '',
'tidy.clean_output' => 0,
'xdebug.default_enable' => 0,
'mbstring.func_overload' => 0,
'error_prepend_string' => '',
'error_append_string' => '',
'auto_prepend_file' => '',
'auto_append_file' => '',
'disable_functions' => '',
'safe_mode' => 0,
'request_order' => 'GPCES',
'register_globals' => 1,
'register_long_arrays' => 1,
'register_argc_argv' => 1,
'always_populate_raw_post_data' => 1,
'error_reporting' => $this->options['error_reporting'],
'display_errors' => 0,
'display_startup_errors' => 0,
'log_errors' => $this->options['log_errors'],
'html_errors' => 0,
'track_errors' => 1,
'report_memleaks' => 1,
'magic_quotes_runtime' => 0,
'magic_quotes_gpc' => 0,
'ignore_repeated_errors' => 1,
'ignore_repeated_source' => 1,
'log_errors_max_len' => '0'
);
foreach ( $ini_overwrites as $key => $newval ) {
$this->old_inis[ $key ] = ( $key == 'error_reporting' ? error_reporting() : strval( ini_get( $key ) ) );
ini_set( $key, $newval );
}
//$this->SaveOptions();
$started = true;
return true;
}
/** AA_DEBUG::get_plugin_data()
*
* @param string $type
*
* 'plugin-name' => 'AskApache Debug Viewer',
* 'short-name' => 'AA Debug',
* 'description' => 'Displays Advanced Debugging Output',
* 'author' => 'askapache,cduke250',
* 'version' => '2.4.1',
* 'updated' => '12/20/2012 - 9:08 PM',
* 'requires-at-least' => '3.1.0',
* 'tested-up-to' => '3.5',
* 'tags' => 'debug, debugging, error, errors, warning, problem, bug, problems, support, admin, programmer, developer, plugin, development, information, stats, logs, queries, htaccess, password, error, support, askapache, apache, rewrites',
* 'contributors' => 'askapache,cduke250',
* 'wordpress-uri' => 'http://wordpress.org/extend/plugins/askapache-debug-viewer/',
* 'author-uri' => 'http://www.askapache.com/',
* 'donate-uri' => 'http://www.askapache.com/donate/',
* 'plugin-uri' => 'http://www.askapache.com/wordpress/debug-viewer-plugin.html',
* 'role' => 'administrator',
* 'capability' => 'askapache_debug_output',
* 'file' => '~/htdocs/wp-content/plugins/askapache-debug-viewer/askapache-debug-viewer.php',
* 'title' => 'AskApache Debug Viewer',
* 'pb' => 'askapache-debug-viewer/askapache-debug-viewer.php',
* 'page' => 'askapache-debug-viewer.php',
* 'pagenice' => 'askapache-debug-viewer',
* 'nonce' => 'form_askapache-debug-viewer',
* 'hook' => 'settings_page_askapache-debug-viewer',
* 'action' => 'options-general.php?page=askapache-debug-viewer.php',
* 'op' => 'adv7',
*/
function get_plugin_data($force=false,$type='settings') {
$this->t( __FILE__, __CLASS__, __FUNCTION__, __LINE__, '', 10 );
$plugin = get_option( $this->_qn . '_plugin' );
if ( $force === true || ! is_array( $plugin ) || !!! $plugin || ! array_key_exists( 'file', $plugin ) || "{$plugin['file']}" != __FILE__ ) {
$data = $this->_readfile( __FILE__, 1450 );
$mtx = $plugin = array();
preg_match_all( '/[^a-z0-9]+((?:[a-z0-9]{2,25})(?:\ ?[a-z0-9]{2,25})?(?:\ ?[a-z0-9]{2,25})?)\:[\s\t]*(.+)/i', $data, $mtx, PREG_SET_ORDER );
foreach ( $mtx as $m ) {
$mm = trim( str_replace( ' ', '-', strtolower( $m[1] ) ) );
$plugin[ $mm ] = str_replace( array( "\r", "\n", "\t" ), '', trim( $m[2] ) );
}
$plugin['file'] = __FILE__;
$plugin['title'] = '' . $plugin['plugin-name'] . '';
$plugin['author'] = '' . $plugin['author'] . '';
$plugin['pb'] = preg_replace( '|^' . preg_quote( WP_PLUGIN_DIR, '|' ) . '/|', '', __FILE__ );
$plugin['page'] = basename( __FILE__ );
$plugin['pagenice'] = rtrim( $plugin['page'], '.php' );
$plugin['nonce'] = 'form_' . $plugin['pagenice'];
$plugin['hook'] = $type . '_page_' . $plugin['pagenice'];
$plugin['action'] = ( ( $type == 'settings' ) ? 'options-general' : $type ) . '.php?page=' . $plugin['page'];
$plugin['op'] = 'adv7';
}
if ( strpos( $plugin['short-name'], '<' . 'img' ) === false )
$plugin['short-name'] = ' ' . $plugin['short-name'];
$this->t( __FILE__, __CLASS__, __FUNCTION__, __LINE__, '', 10 );
return $plugin;
}
/** AA_DEBUG::ff()
*/
function ff($args) {
$defaults = array(
'form' => 1,
'type' => '',
'id' => '',
'name' => '',
'value' => '',
'title' => '',
'pre' => '