' . sprintf( esc_html__( 'Redux has detected the Redux Pro plugin is enabled. All featured of Redux Pro are now part of the entire Redux plugin and is no longer required. Please disable the Redux Pro plugin to avoid potential conflicts.', 'redux-framework' ), '' ) . '
';
}
}
require_once __DIR__ . '/inc/classes/class-redux-path.php';
require_once __DIR__ . '/inc/classes/class-redux-functions-ex.php';
require_once __DIR__ . '/inc/classes/class-redux-helpers.php';
require_once __DIR__ . '/inc/classes/class-redux-instances.php';
Redux_Functions_Ex::register_class_path( 'Redux', __DIR__ . '/inc/classes' );
Redux_Functions_Ex::register_class_path( 'Redux', __DIR__ . '/inc/welcome' );
spl_autoload_register( array( $this, 'register_classes' ) );
self::$welcome = new Redux_Welcome();
add_filter( 'debug_information', array( $this, 'add_debug_info' ) );
}
/**
* Add debug info for the WP Site Health screen.
*
* @param array $debug_info Debug data.
*
* @return array
* @throws ReflectionException Exception.
*/
public function add_debug_info( array $debug_info ): array {
// Get browser data.
if ( ! class_exists( 'ReduxBrowser' ) ) {
require_once self::$dir . 'inc/lib/browser.php';
}
$browser = new ReduxBrowser();
$browser_data = array(
'Agent' => $browser->getUserAgent(),
'Browser' => $browser->getBrowser(),
'Version' => $browser->getVersion(),
'Platform' => $browser->getPlatform(),
);
// Set Redux dir permission results to Site Health screen.
$debug_info['wp-filesystem']['fields'][] = array(
'label' => esc_html__( 'The Redux upload directory', 'redux-framework' ),
'value' => wp_is_writable( self::$upload_dir ) ? 'Writable' : 'Not writable',
);
// Set Redux plugin results to Site Health screen.
$debug_info['redux-framework'] = array(
'label' => esc_html__( 'Redux Framework', 'redux-framework' ),
'description' => esc_html__( 'Debug information specific to Redux Framework.', 'redux-framework' ),
'fields' => array(
'version' => array(
'label' => esc_html__( 'Version', 'redux-framework' ),
'value' => self::$version,
),
'installation' => array(
'label' => esc_html__( 'Installation', 'redux-framework' ),
'value' => self::$installed,
),
'data directory' => array(
'label' => esc_html__( 'Data directory', 'redux-framework' ),
'value' => self::$dir,
),
'browser' => array(
'label' => esc_html__( 'Browser', 'redux-framework' ),
'value' => $browser_data,
),
),
);
$redux = Redux::all_instances();
$extensions = array();
if ( ! empty( $redux ) && is_array( $redux ) ) {
foreach ( $redux as $inst => $data ) {
Redux::init( $inst );
$inst_name = ucwords( str_replace( array( '_', '-' ), ' ', $inst ) );
$args = $data->args;
$ext = Redux::get_extensions( $inst );
if ( ! empty( $ext ) && is_array( $ext ) ) {
ksort( $ext );
foreach ( $ext as $name => $arr ) {
$ver = $arr['version'];
$ex = esc_html( ucwords( str_replace( array( '_', '-' ), ' ', $name ) ) );
$extensions[ $ex ] = esc_html( $ver );
}
}
// Output Redux instances.
$debug_info[ 'redux-instance-' . $inst ] = array(
// translators: %s = Instance name.
'label' => sprintf( esc_html__( 'Redux Instance: %s', 'redux-framework' ), $inst_name ),
// translators: %s = Instance name w/ HTML.
'description' => sprintf( esc_html__( 'Debug information for the %s Redux instance.', 'redux-framework' ), '