Import legacy nurinda.co.id website
This commit is contained in:
1 parent
3f59bb9038
commit
6e21646ac4
13389 files changed
+3246690
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
class WPChromePHP implements iMashDebug {
|
||||
|
||||
public function __construct() {
|
||||
include 'api/chromephp/mashsbChromePhp.php';
|
||||
$this->api = mashsbChromePhp::getInstance();
|
||||
}
|
||||
|
||||
|
||||
public function log( $var, $label = null ) {
|
||||
$this->api->log( $label, $var );
|
||||
}
|
||||
|
||||
public function info( $var, $label = null ) {
|
||||
$this->api->info( $label, $var );
|
||||
}
|
||||
|
||||
public function warn( $var, $label = null ) {
|
||||
$this->api->warn( $label, $var );
|
||||
}
|
||||
|
||||
public function error( $var, $label = null ) {
|
||||
$this->api->error( $label, $var );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
version 3.0
|
||||
This class requires PHP 5 or later.
|
||||
|
||||
ChromePhp is a PHP class to go along with the ChromePhp Google Chrome extension.
|
||||
|
||||
This class allows you to log variables to the Chrome console.
|
||||
|
||||
INSTALLATION
|
||||
1. Download the Chrome extension from: https://chrome.google.com/extensions/detail/noaneddfkdjfnfdakjjmocngnfkfehhd
|
||||
2. Put ChromePhp.php somewhere in your PHP include path
|
||||
3. Click the extension icon on the browser to enable it for the current site
|
||||
3. include 'ChromePhp.php';
|
||||
4. ChromePhp::log('hello world');
|
||||
|
||||
More information can be found here:
|
||||
http://www.chromephp.com
|
||||
+439
@@ -0,0 +1,439 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2012 Craig Campbell
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Server Side Chrome PHP debugger class
|
||||
*
|
||||
* @package ChromePhp
|
||||
* @author Craig Campbell <iamcraigcampbell@gmail.com>
|
||||
*/
|
||||
class mashsbChromePhp
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '3.0';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const HEADER_NAME = 'X-ChromePhp-Data';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const BACKTRACE_LEVEL = 'backtrace_level';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const LOG = 'log';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const WARN = 'warn';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const ERROR = 'error';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const GROUP = 'group';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const INFO = 'info';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const GROUP_END = 'groupEnd';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const GROUP_COLLAPSED = 'groupCollapsed';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_php_version;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $_timestamp;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_json = array(
|
||||
'version' => self::VERSION,
|
||||
'columns' => array('label', 'log', 'backtrace', 'type'),
|
||||
'rows' => array()
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_backtraces = array();
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $_error_triggered = false;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_settings = array(
|
||||
self::BACKTRACE_LEVEL => 1
|
||||
);
|
||||
|
||||
/**
|
||||
* @var ChromePhp
|
||||
*/
|
||||
protected static $_instance;
|
||||
|
||||
/**
|
||||
* Prevent recursion when working with objects referring to each other
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_processed = array();
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
private function __construct()
|
||||
{
|
||||
$this->_php_version = phpversion();
|
||||
$this->_timestamp = $this->_php_version >= 5.1 ? $_SERVER['REQUEST_TIME'] : time();
|
||||
$this->_json['request_uri'] = $_SERVER['REQUEST_URI'];
|
||||
}
|
||||
|
||||
/**
|
||||
* gets instance of this class
|
||||
*
|
||||
* @return ChromePhp
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
if (self::$_instance === null) {
|
||||
self::$_instance = new mashsbChromePhp();
|
||||
}
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* logs a variable to the console
|
||||
*
|
||||
* @param string label
|
||||
* @param mixed value
|
||||
* @param string severity ChromePhp::LOG || ChromePhp::WARN || ChromePhp::ERROR
|
||||
* @return void
|
||||
*/
|
||||
public static function log()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$severity = count($args) == 3 ? array_pop($args) : '';
|
||||
|
||||
// save precious bytes
|
||||
if ($severity == self::LOG) {
|
||||
$severity = '';
|
||||
}
|
||||
|
||||
return self::_log($args + array('type' => $severity));
|
||||
}
|
||||
|
||||
/**
|
||||
* logs a warning to the console
|
||||
*
|
||||
* @param string label
|
||||
* @param mixed value
|
||||
* @return void
|
||||
*/
|
||||
public static function warn()
|
||||
{
|
||||
return self::_log(func_get_args() + array('type' => self::WARN));
|
||||
}
|
||||
|
||||
/**
|
||||
* logs an error to the console
|
||||
*
|
||||
* @param string label
|
||||
* @param mixed value
|
||||
* @return void
|
||||
*/
|
||||
public static function error()
|
||||
{
|
||||
return self::_log(func_get_args() + array('type' => self::ERROR));
|
||||
}
|
||||
|
||||
/**
|
||||
* sends a group log
|
||||
*
|
||||
* @param string value
|
||||
*/
|
||||
public static function group()
|
||||
{
|
||||
return self::_log(func_get_args() + array('type' => self::GROUP));
|
||||
}
|
||||
|
||||
/**
|
||||
* sends an info log
|
||||
*
|
||||
* @param string value
|
||||
*/
|
||||
public static function info()
|
||||
{
|
||||
return self::_log(func_get_args() + array('type' => self::INFO));
|
||||
}
|
||||
|
||||
/**
|
||||
* sends a collapsed group log
|
||||
*
|
||||
* @param string value
|
||||
*/
|
||||
public static function groupCollapsed()
|
||||
{
|
||||
return self::_log(func_get_args() + array('type' => self::GROUP_COLLAPSED));
|
||||
}
|
||||
|
||||
/**
|
||||
* ends a group log
|
||||
*
|
||||
* @param string value
|
||||
*/
|
||||
public static function groupEnd()
|
||||
{
|
||||
return self::_log(func_get_args() + array('type' => self::GROUP_END));
|
||||
}
|
||||
|
||||
/**
|
||||
* internal logging call
|
||||
*
|
||||
* @param string $type
|
||||
* @return void
|
||||
*/
|
||||
protected static function _log(array $args)
|
||||
{
|
||||
$type = $args['type'];
|
||||
unset($args['type']);
|
||||
|
||||
// nothing passed in, don't do anything
|
||||
if (count($args) == 0 && $type != self::GROUP_END) {
|
||||
return;
|
||||
}
|
||||
|
||||
// default to single
|
||||
$label = null;
|
||||
$value = isset($args[0]) ? $args[0] : '';
|
||||
|
||||
$logger = self::getInstance();
|
||||
|
||||
// if there are two values passed in then the first one is the label
|
||||
if (count($args) == 2) {
|
||||
$label = $args[0];
|
||||
$value = $args[1];
|
||||
}
|
||||
|
||||
$logger->_processed = array();
|
||||
$value = $logger->_convert($value);
|
||||
|
||||
$backtrace = debug_backtrace(false);
|
||||
$level = $logger->getSetting(self::BACKTRACE_LEVEL);
|
||||
|
||||
$backtrace_message = 'unknown';
|
||||
if (isset($backtrace[$level]['file']) && isset($backtrace[$level]['line'])) {
|
||||
$backtrace_message = $backtrace[$level]['file'] . ' : ' . $backtrace[$level]['line'];
|
||||
}
|
||||
|
||||
$logger->_addRow($label, $value, $backtrace_message, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* converts an object to a better format for logging
|
||||
*
|
||||
* @param Object
|
||||
* @return array
|
||||
*/
|
||||
protected function _convert($object)
|
||||
{
|
||||
// if this isn't an object then just return it
|
||||
if (!is_object($object)) {
|
||||
return $object;
|
||||
}
|
||||
|
||||
//Mark this object as processed so we don't convert it twice and it
|
||||
//Also avoid recursion when objects refer to each other
|
||||
$this->_processed[] = $object;
|
||||
|
||||
$object_as_array = array();
|
||||
|
||||
// first add the class name
|
||||
$object_as_array['___class_name'] = get_class($object);
|
||||
|
||||
// loop through object vars
|
||||
$object_vars = get_object_vars($object);
|
||||
foreach ($object_vars as $key => $value) {
|
||||
|
||||
// same instance as parent object
|
||||
if ($value === $object || in_array($value, $this->_processed, true)) {
|
||||
$value = 'recursion - parent object [' . get_class($value) . ']';
|
||||
}
|
||||
$object_as_array[$key] = $this->_convert($value);
|
||||
}
|
||||
|
||||
$reflection = new ReflectionClass($object);
|
||||
|
||||
// loop through the properties and add those
|
||||
foreach ($reflection->getProperties() as $property) {
|
||||
|
||||
// if one of these properties was already added above then ignore it
|
||||
if (array_key_exists($property->getName(), $object_vars)) {
|
||||
continue;
|
||||
}
|
||||
$type = $this->_getPropertyKey($property);
|
||||
|
||||
if ($this->_php_version >= 5.3) {
|
||||
$property->setAccessible(true);
|
||||
}
|
||||
|
||||
try {
|
||||
$value = $property->getValue($object);
|
||||
} catch (ReflectionException $e) {
|
||||
$value = 'only PHP 5.3 can access private/protected properties';
|
||||
}
|
||||
|
||||
// same instance as parent object
|
||||
if ($value === $object || in_array($value, $this->_processed, true)) {
|
||||
$value = 'recursion - parent object [' . get_class($value) . ']';
|
||||
}
|
||||
|
||||
$object_as_array[$type] = $this->_convert($value);
|
||||
}
|
||||
return $object_as_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* takes a reflection property and returns a nicely formatted key of the property name
|
||||
*
|
||||
* @param ReflectionProperty
|
||||
* @return string
|
||||
*/
|
||||
protected function _getPropertyKey(ReflectionProperty $property)
|
||||
{
|
||||
$static = $property->isStatic() ? ' static' : '';
|
||||
if ($property->isPublic()) {
|
||||
return 'public' . $static . ' ' . $property->getName();
|
||||
}
|
||||
|
||||
if ($property->isProtected()) {
|
||||
return 'protected' . $static . ' ' . $property->getName();
|
||||
}
|
||||
|
||||
if ($property->isPrivate()) {
|
||||
return 'private' . $static . ' ' . $property->getName();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* adds a value to the data array
|
||||
*
|
||||
* @var mixed
|
||||
* @return void
|
||||
*/
|
||||
protected function _addRow($label, $log, $backtrace, $type)
|
||||
{
|
||||
// if this is logged on the same line for example in a loop, set it to null to save space
|
||||
if (in_array($backtrace, $this->_backtraces)) {
|
||||
$backtrace = null;
|
||||
}
|
||||
|
||||
if ($backtrace !== null) {
|
||||
$this->_backtraces[] = $backtrace;
|
||||
}
|
||||
|
||||
$row = array($label, $log, $backtrace, $type);
|
||||
|
||||
$this->_json['rows'][] = $row;
|
||||
$this->_writeHeader($this->_json);
|
||||
}
|
||||
|
||||
protected function _writeHeader($data)
|
||||
{
|
||||
//ob_start();
|
||||
//@header(self::HEADER_NAME . ': ' . $this->_encode($data));
|
||||
//ob_end_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* encodes the data to be sent along with the request
|
||||
*
|
||||
* @param array $data
|
||||
* @return string
|
||||
*/
|
||||
protected function _encode($data)
|
||||
{
|
||||
return base64_encode(utf8_encode(json_encode($data)));
|
||||
}
|
||||
|
||||
/**
|
||||
* adds a setting
|
||||
*
|
||||
* @param string key
|
||||
* @param mixed value
|
||||
* @return void
|
||||
*/
|
||||
public function addSetting($key, $value)
|
||||
{
|
||||
$this->_settings[$key] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* add ability to set multiple settings in one call
|
||||
*
|
||||
* @param array $settings
|
||||
* @return void
|
||||
*/
|
||||
public function addSettings(array $settings)
|
||||
{
|
||||
foreach ($settings as $key => $value) {
|
||||
$this->addSetting($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gets a setting
|
||||
*
|
||||
* @param string key
|
||||
* @return mixed
|
||||
*/
|
||||
public function getSetting($key)
|
||||
{
|
||||
if (!isset($this->_settings[$key])) {
|
||||
return null;
|
||||
}
|
||||
return $this->_settings[$key];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
[08-Nov-2025 01:48:02 UTC] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php:2
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php on line 2
|
||||
[15-Nov-2025 02:56:26 UTC] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php:2
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php on line 2
|
||||
[11-Dec-2025 17:28:03 UTC] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php:2
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php on line 2
|
||||
[22-Feb-2026 02:33:37 UTC] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php:2
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php on line 2
|
||||
[20-May-2026 08:05:07 Asia/Jakarta] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php:2
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php on line 2
|
||||
[15-Jul-2026 14:36:59 Asia/Jakarta] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php:2
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php on line 2
|
||||
[16-Jul-2026 15:50:56 Asia/Jakarta] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php:2
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php on line 2
|
||||
[21-Aug-2026 12:44:54 Asia/Jakarta] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php:2
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php on line 2
|
||||
[22-Aug-2026 01:28:23 Asia/Jakarta] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php:2
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php on line 2
|
||||
[24-Aug-2026 19:04:38 Asia/Jakarta] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php:2
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/browsers/WPChromePHP.class.php on line 2
|
||||
@@ -0,0 +1,272 @@
|
||||
<?php
|
||||
|
||||
/* MashDebug
|
||||
*
|
||||
* Based on WP Log in browser by MZAWeb
|
||||
* http://wordpress.org/plugins/wp-log-in-browser
|
||||
*
|
||||
* @package MASHSB
|
||||
* @subpackage Classes/debug
|
||||
* @copyright Copyright (c) 2014, René Hermenau
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 2.0.0
|
||||
* @author MZAWeb
|
||||
* @author Rene Hermenau
|
||||
*
|
||||
*/
|
||||
|
||||
if ( class_exists( "MashDebug" ) )
|
||||
return;
|
||||
|
||||
class MashDebug implements iMashDebug {
|
||||
|
||||
private static $instance;
|
||||
private $path;
|
||||
|
||||
private $interfaces = array();
|
||||
private static $timers = array();
|
||||
private static $memory = array();
|
||||
|
||||
public function __construct() {
|
||||
|
||||
$this->path = trailingslashit( dirname( dirname( __FILE__ ) ) );
|
||||
|
||||
$this->_get_interfaces();
|
||||
|
||||
add_action( 'init', array( $this, 'init' ) );
|
||||
add_action( 'shutdown', array( $this, 'shutdown' ) );
|
||||
|
||||
}
|
||||
|
||||
/************* API **************/
|
||||
|
||||
/**
|
||||
*
|
||||
* @param mixed $var
|
||||
* @param string $label
|
||||
*
|
||||
* @return MashDebug
|
||||
*/
|
||||
public function log( $var, $label = null ) {
|
||||
$this->_run( 'log', array( $var, $label ) );
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param mixed $var
|
||||
* @param string $label
|
||||
*
|
||||
* @return MashDebug
|
||||
*/
|
||||
public function info( $var, $label = null ) {
|
||||
$this->_run( 'info', array( $var, $label ) );
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $var
|
||||
* @param string $label
|
||||
*
|
||||
* @return MashDebug
|
||||
*/
|
||||
public function warn( $var, $label = null ) {
|
||||
$this->_run( 'warn', array( $var, $label ) );
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $var
|
||||
* @param string $label
|
||||
*
|
||||
* @return MashDebug
|
||||
*/
|
||||
public function error( $var, $label = null ) {
|
||||
$this->_run( 'error', array( $var, $label ) );
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*
|
||||
* @param string $key
|
||||
* @param bool $log
|
||||
*
|
||||
* @return bool|float
|
||||
*
|
||||
*/
|
||||
public function timer( $key, $log = false ) {
|
||||
if ( !isset( self::$timers[$key] ) ) {
|
||||
$time = microtime();
|
||||
$time = explode( ' ', $time );
|
||||
$time = $time[1] + $time[0];
|
||||
self::$timers[$key] = $time;
|
||||
return false;
|
||||
|
||||
} else {
|
||||
$time = microtime();
|
||||
$time = explode( ' ', $time );
|
||||
$time = $time[1] + $time[0];
|
||||
$finish = $time;
|
||||
$total_time = round( ( $finish - self::$timers[$key] ), 4 );
|
||||
|
||||
if ( $log )
|
||||
$this->log( $total_time, $key );
|
||||
|
||||
unset( self::$timers[$key] );
|
||||
|
||||
return $total_time;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @static
|
||||
*
|
||||
* @param string $key
|
||||
* @param bool $log
|
||||
*
|
||||
* @return bool|float
|
||||
*
|
||||
*/
|
||||
public function memory( $key, $log = false ) {
|
||||
if ( !isset( self::$memory[$key] ) ) {
|
||||
$memory = memory_get_usage();
|
||||
self::$memory[$key] = $memory;
|
||||
|
||||
return false;
|
||||
} else {
|
||||
$memory = memory_get_usage();
|
||||
$total_memory = $memory - self::$memory[$key];
|
||||
|
||||
if ( $log )
|
||||
$this->log( $total_memory, $key );
|
||||
|
||||
unset( self::$memory[$key] );
|
||||
|
||||
return $total_memory;
|
||||
}
|
||||
}
|
||||
|
||||
/************* API **************/
|
||||
|
||||
public function init() {
|
||||
ob_start();
|
||||
}
|
||||
|
||||
public function shutdown() {
|
||||
if ( ob_get_level() )
|
||||
ob_end_flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
private function _should_run() {
|
||||
global $mashsb_options;
|
||||
//$enabled = apply_filters( 'wplinb-enabled', true );
|
||||
$match_wp_debug = apply_filters( 'wplinb-match-wp-debug', false );
|
||||
$enabled = isset($mashsb_options['debug_mode']) ? $mashsb_options['debug_mode'] : false;
|
||||
|
||||
if ( !$enabled )
|
||||
return false;
|
||||
|
||||
if ( !$match_wp_debug )
|
||||
return true;
|
||||
|
||||
if ( WP_DEBUG )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $command
|
||||
* @param array $params
|
||||
*/
|
||||
private function _run( $command, $params = array() ) {
|
||||
|
||||
if ( !$this->_should_run() )
|
||||
return;
|
||||
|
||||
if ( empty( $this->interfaces ) )
|
||||
return;
|
||||
|
||||
foreach ( $this->interfaces as $interface ) {
|
||||
try {
|
||||
call_user_func_array( array( $interface, $command ), $params );
|
||||
} catch ( Exception $e ) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _get_interfaces() {
|
||||
// This will come from the admin config
|
||||
$selected_interfaces = array( 'ChromePHP' );
|
||||
|
||||
$selected_interfaces = apply_filters( 'wplinb-selected-interfaces', $selected_interfaces );
|
||||
|
||||
foreach ( (array)$selected_interfaces as $interface_name ) {
|
||||
$interface = $this->_get_interface( $interface_name );
|
||||
if ( !empty( $interface ) )
|
||||
$this->interfaces[] = $interface;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $interface_name
|
||||
*
|
||||
* @return mixed|null|WPChromePHP
|
||||
*/
|
||||
private function _get_interface( $interface_name ) {
|
||||
|
||||
switch ( $interface_name ) {
|
||||
|
||||
case 'ChromePHP':
|
||||
include $this->path . 'browsers/WPChromePHP.class.php';
|
||||
$interface = new WPChromePHP();
|
||||
break;
|
||||
|
||||
default:
|
||||
$interface = apply_filters( 'wplinb-get-interface', null, $interface_name );
|
||||
|
||||
if ( $interface && !in_array( 'iMashDebug', class_implements( $interface ) ) )
|
||||
$interface = null;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return $interface;
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
* @return MashDebug
|
||||
*
|
||||
* Return an instance of this class. Singleton.
|
||||
*/
|
||||
public static function instance() {
|
||||
if ( !isset( self::$instance ) ) {
|
||||
$className = __CLASS__;
|
||||
self::$instance = new $className;
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !function_exists( 'mashdebug' ) ) {
|
||||
/**
|
||||
* Returns a MashDebug instance.
|
||||
*
|
||||
* @return MashDebug
|
||||
*/
|
||||
function mashdebug() {
|
||||
return MashDebug::instance();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
interface iMashDebug {
|
||||
|
||||
public function log( $var, $label = null );
|
||||
|
||||
public function info( $var, $label = null );
|
||||
|
||||
public function warn( $var, $label = null );
|
||||
|
||||
public function error( $var, $label = null );
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
[08-Nov-2025 01:48:03 UTC] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php:21
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php on line 21
|
||||
[15-Nov-2025 02:56:26 UTC] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php:21
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php on line 21
|
||||
[11-Dec-2025 17:28:03 UTC] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php:21
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php on line 21
|
||||
[22-Feb-2026 02:34:05 UTC] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php:21
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php on line 21
|
||||
[20-May-2026 08:05:07 Asia/Jakarta] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php:21
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php on line 21
|
||||
[15-Jul-2026 14:37:00 Asia/Jakarta] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php:21
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php on line 21
|
||||
[16-Jul-2026 15:50:58 Asia/Jakarta] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php:21
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php on line 21
|
||||
[21-Aug-2026 12:44:54 Asia/Jakarta] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php:21
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php on line 21
|
||||
[22-Aug-2026 01:28:24 Asia/Jakarta] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php:21
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php on line 21
|
||||
[24-Aug-2026 19:04:38 Asia/Jakarta] PHP Fatal error: Uncaught Error: Interface 'iMashDebug' not found in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php:21
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/classes/MashDebug.class.php on line 21
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Output debug notices in footer
|
||||
* @global array $mashsb_options
|
||||
*/
|
||||
function mashsbOutputDebug() {
|
||||
global $mashsb_options, $mashsb_debug;
|
||||
|
||||
if (empty($mashsb_debug)){
|
||||
return '';
|
||||
}
|
||||
|
||||
if (current_user_can('install_plugins') && isset($mashsb_options['debug_mode'])) {
|
||||
echo '<div class="mash-debug" style="display:block;z-index:250000;font-size:12px;text-align:center;">';
|
||||
echo 'MashShare Debug Mode.<br><br>';
|
||||
foreach ($mashsb_debug as $key => $value){
|
||||
echo wp_kses_post($value) . '<br />';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
add_action('wp_footer', 'mashsbOutputDebug', 100);
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
[08-Nov-2025 01:43:53 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php:22
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php on line 22
|
||||
[15-Nov-2025 02:56:16 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php:22
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php on line 22
|
||||
[11-Dec-2025 17:26:02 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php:22
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php on line 22
|
||||
[22-Feb-2026 00:45:35 UTC] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php:22
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php on line 22
|
||||
[20-May-2026 08:04:29 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php:22
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php on line 22
|
||||
[15-Jul-2026 14:30:30 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php:22
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php on line 22
|
||||
[16-Jul-2026 13:45:09 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php:22
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php on line 22
|
||||
[21-Aug-2026 12:44:11 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php:22
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php on line 22
|
||||
[22-Aug-2026 01:25:49 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php:22
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php on line 22
|
||||
[24-Aug-2026 19:02:50 Asia/Jakarta] PHP Fatal error: Uncaught Error: Call to undefined function add_action() in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php:22
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in /home/nurm6544/public_html/wp-content/plugins/mashsharer/includes/debug/debug.php on line 22
|
||||
Reference in new issue
Block a user