HEX
Server: Apache/2.4.25 (Debian)
System: Linux server17 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
User: web37 (1062)
PHP: 7.4.30
Disabled: show_source, highlight_file, apache_child_terminate, apache_get_modules, apache_note, apache_setenv, virtual, dl, disk_total_space, posix_getpwnam, posix_getpwuid, posix_mkfifo, posix_mknod, posix_setpgid, posix_setsid, posix_setuid, posix_uname, proc_nice, openlog, syslog, pfsockopen
Upload Files
File: /var/www/web37/htdocs/sexnetzwerk24/wp-content/themes/classipress/framework/kernel/debug.php
<?php
/**
 * Framework debugging
 *
 * @package Framework\Debug
 */

add_action( 'all', 'appthemes_bad_method_visibility' );

/**
 * Prints warning about any hooked method with bad visibility (that are either protected or private)
 * @return void
 */
function appthemes_bad_method_visibility() {
	global $wp_filter;

	$arguments = func_get_args();
	$tag = array_shift( $arguments );

	$errors = new WP_Error;
	if ( ! isset( $wp_filter[ $tag ] ) ) {
		return;
	}

	foreach ( $wp_filter[ $tag ] as $prioritized_callbacks ) {
		foreach ( $prioritized_callbacks as $callback ) {
			$function = $callback['function'];
			if ( is_array( $function ) ) {
				try { 
					$method = new ReflectionMethod( $function[0], $function[1] );
					if ( $method->isPrivate() || $method->isProtected() ) {
						$class = get_class( $function[0] );
						if ( ! $class ) {
							$class = $function[0];
						}

						$errors->add( 'visiblity', $class . '::' . $function[1] . ' was hooked into "' . $tag . '", but is either protected or private.' );
					}
				} catch ( Exception $e ){
					// Failure to replicate method. Might be magic method. Fail silently
				}
			}
		}
	}

	if ( $errors->get_error_messages() ) {
		foreach ( $errors->get_error_messages() as $message ) {
			echo $message;
		}
	}
}