<commit_before><?php
namespace Podlove;

class SystemReport {

	private $fields = array();
	private $notices = array();
	private $errors = array();

	public function __construct() {
		
		$this->fields = array(
			'site'        => array( 'title' => 'Website',           'callback' => function() { return get_site_url(); } ),
			'php_version' => array( 'title' => 'PHP Version',       'callback' => function() { return phpversion(); } ),
			'wp_version'  => array( 'title' => 'WordPress Version', 'callback' => function() { return get_bloginfo('version'); } ),
			'curl'        => array( 'title' => 'curl Version',      'callback' => function() {
				$module_loaded = in_array( 'curl', get_loaded_extensions() );
				$function_disabled = stripos( ini_get( 'disable_functions' ), 'curl_exec' ) !== false;
				$out = '';

				if ( $module_loaded ) {
					$curl = curl_version();
					$out .= $curl['version'];
				} else {
					$out .= 'EXTENSION MISSING';
					$this->errors[] = 'curl extension is not loaded';
				}

				if ( $function_disabled ) {
					$out = ' | curl_exec is disabled';
					$this->errors[] = 'curl_exec is disabled';
				}

				return $out;
			} ),
			'allow_url_fopen'     => array( 'callback' => function() { return ini_get( 'allow_url_fopen' ); } ),<commit_msg>check for identical schemes in system report<commit_after><?php
namespace Podlove;

class SystemReport {

	private $fields = array();
	private $notices = array();
	private $errors = array();

	public function __construct() {
		
		$this->fields = array(
			'site'        => array( 'title' => 'Website',           'callback' => function() { return get_site_url(); } ),
			'php_version' => array( 'title' => 'PHP Version',       'callback' => function() { return phpversion(); } ),
			'wp_version'  => array( 'title' => 'WordPress Version', 'callback' => function() { return get_bloginfo('version'); } ),
			'curl'        => array( 'title' => 'curl Version',      'callback' => function() {
				$module_loaded = in_array( 'curl', get_loaded_extensions() );
				$function_disabled = stripos( ini_get( 'disable_functions' ), 'curl_exec' ) !== false;
				$out = '';

				if ( $module_loaded ) {
					$curl = curl_version();
					$out .= $curl['version'];
				} else {
					$out .= 'EXTENSION MISSING';
					$this->errors[] = 'curl extension is not loaded';
				}

				if ( $function_disabled ) {
					$out = ' | curl_exec is disabled';
					$this->errors[] = 'curl_exec is disabled';
				}

				return $out;
			} ),
			'permalinks' => array( 'title' => 'Permalinks', 'callback' => function() {
				$wordpress_permastruct = trim( get_option( 'permalink_structure' ), "/ ");
				$podlove_permastruct   = trim( \Podlove\get_setting( 'custom_episode_slug' ), "/ ");

				if ( $wordpress_permastruct == str_replace( '%podcast%', '%postname%', $podlove_permastruct ) ) {
					$this->errors[] = 'Your permalinks for posts and episodes MUST NOT be identical.
Solution: prefix your posts with "/blog/" or your episodes with "/episode/".
<a href="' . admin_url( 'admin.php?page=podlove_settings_settings_handle' ) . '">edit episode scheme</a> or <a href="' . admin_url( 'options-permalink.php' ) . '">edit post scheme</a>';
					return 'URL SCHEME CONFLICT';
				} else {
					return 'ok';
				}
			} ),
			'allow_url_fopen'     => array( 'callback' => function() { return ini_get( 'allow_url_fopen' ); } ),
{'fraction_non_alphanumeric': 0.18055143788911948, 'fraction_numerical': 0.0, 'mean_word_length': 3.381818181818182, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7209721', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1059, 'n_words': 266}