redux_loaded ) { return; } $this->redux_loaded = true; add_action( 'admin_menu', array( $this, 'admin_menus' ) ); if ( isset( $_GET['page'] ) ) { if ( substr( $_GET['page'], 0, 6 ) == "redux-" ) { $version = explode( '.', ReduxFramework::$_version ); $this->display_version = $version[0] . '.' . $version[1]; add_filter( 'admin_footer_text', array( $this, 'change_wp_footer' ) ); add_action( 'admin_head', array( $this, 'admin_head' ) ); } else { $this->check_version(); } } else { $this->check_version(); } update_option( 'redux_version_upgraded_from', ReduxFramework::$_version ); } public function check_version() { global $pagenow; if ( $pagenow == "admin-ajax.php" || ( $GLOBALS['pagenow'] == "customize" && isset( $_GET['theme'] ) && ! empty( $_GET['theme'] ) ) ) { return; } $saveVer = Redux_Helpers::major_version( get_option( 'redux_version_upgraded_from' ) ); $curVer = Redux_Helpers::major_version( ReduxFramework::$_version ); $compare = false; if ( Redux_Helpers::isLocalHost() ) { $compare = true; } else if ( class_exists( 'ReduxFrameworkPlugin' ) ) { $compare = true; } else { $redux = ReduxFrameworkInstances::get_all_instances(); if ( is_array( $redux ) ) { foreach ( $redux as $panel ) { if ( $panel->args['dev_mode'] == 1 ) { $compare = true; break; } } } } if ( $compare ) { $redirect = false; if ( empty( $saveVer ) ) { $redirect = true; // First time } // Removing redirect except for the first time with the plugin installed. :) Less annoying until we actually use this page. //else if ( version_compare( $curVer, $saveVer, '>' ) ) { // $redirect = true; // Previous version //} if ( $redirect && ! defined( 'WP_TESTS_DOMAIN' ) && ReduxFramework::$_as_plugin ) { add_action( 'init', array( $this, 'do_redirect' ) ); } } } public function do_redirect() { if ( ! defined( 'WP_CLI' ) ) { wp_redirect( admin_url( 'tools.php?page=redux-about' ) ); exit(); } } public function change_wp_footer() { echo __( 'If you like Redux please leave us a ★★★★★ rating. A huge thank you from Redux in advance!', 'redux-framework' ); } public function support_hash() { if ( ! wp_verify_nonce( $_POST['nonce'], 'redux-support-hash' ) ) { die(); } $data = get_option( 'redux_support_hash' ); $data = wp_parse_args( $data, array( 'check' => '', 'identifier' => '' ) ); $generate_hash = true; $system_info = Redux_Helpers::compileSystemStatus(); $newHash = md5( json_encode( $system_info ) ); $return = array(); if ( $newHash == $data['check'] ) { unset( $generate_hash ); } $post_data = array( 'hash' => md5( network_site_url() . '-' . $_SERVER['REMOTE_ADDR'] ), 'site' => esc_url( home_url( '/' ) ), 'tracking' => Redux_Helpers::getTrackingObject(), 'system_status' => $system_info, ); //$post_data = json_encode( $post_data ); $post_data = serialize( $post_data ); if ( isset( $generate_hash ) && $generate_hash ) { $data['check'] = $newHash; $data['identifier'] = ""; $response = wp_remote_post( 'http://support.redux.io/v1/', array( 'method' => 'POST', 'timeout' => 65, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'compress' => true, 'headers' => array(), 'body' => array( 'data' => $post_data, 'serialize' => 1 ) ) ); if ( is_wp_error( $response ) ) { echo json_encode( array( 'status' => 'error', 'message' => $response->get_error_message() ) ); die( 1 ); } else { $response_code = wp_remote_retrieve_response_code( $response ); if ( $response_code == 200 ) { $response = wp_remote_retrieve_body( $response ); $return = json_decode( $response, true ); if ( isset( $return['identifier'] ) ) { $data['identifier'] = $return['identifier']; update_option( 'redux_support_hash', $data ); } } else { $response = wp_remote_retrieve_body( $response ); echo json_encode( array( 'status' => 'error', 'message' => $response ) ); } } } if ( ! empty( $data['identifier'] ) ) { $return['status'] = "success"; $return['identifier'] = $data['identifier']; } else { $return['status'] = "error"; $return['message'] = esc_html__( "Support hash could not be generated. Please try again later.", 'redux-framework' ); } echo json_encode( $return ); die( 1 ); } /** * Register the Dashboard Pages which are later hidden but these pages * are used to render the Welcome and Credits pages. * * @access public * @since 1.4 * @return void */ public function admin_menus() { $page = 'add_management_page'; // About Page $page( esc_html__( 'Welcome to Redux Framework', 'redux-framework' ), esc_html__( 'Redux Framework', 'redux-framework' ), $this->minimum_capability, 'redux-about', array( $this, 'about_screen' ) ); // Changelog Page $page( esc_html__( 'Redux Framework Changelog', 'redux-framework' ), esc_html__( 'Redux Framework Changelog', 'redux-framework' ), $this->minimum_capability, 'redux-changelog', array( $this, 'changelog_screen' ) ); // Support Page $page( esc_html__( 'Get Support', 'redux-framework' ), esc_html__( 'Get Support', 'redux-framework' ), $this->minimum_capability, 'redux-support', array( $this, 'get_support' ) ); // Support Page $page( esc_html__( 'Redux Extensions', 'redux-framework' ), esc_html__( 'Redux Extensions', 'redux-framework' ), $this->minimum_capability, 'redux-extensions', array( $this, 'redux_extensions' ) ); // Credits Page $page( esc_html__( 'The people that develop Redux Framework', 'redux-framework' ), esc_html__( 'The people that develop Redux Framework', 'redux-framework' ), $this->minimum_capability, 'redux-credits', array( $this, 'credits_screen' ) ); // Status Page $page( esc_html__( 'Redux Framework Status', 'redux-framework' ), esc_html__( 'Redux Framework Status', 'redux-framework' ), $this->minimum_capability, 'redux-status', array( $this, 'status_screen' ) ); //remove_submenu_page( 'tools.php', 'redux-about' ); remove_submenu_page( 'tools.php', 'redux-status' ); remove_submenu_page( 'tools.php', 'redux-changelog' ); remove_submenu_page( 'tools.php', 'redux-getting-started' ); remove_submenu_page( 'tools.php', 'redux-credits' ); remove_submenu_page( 'tools.php', 'redux-support' ); remove_submenu_page( 'tools.php', 'redux-extensions' ); } /** * Hide Individual Dashboard Pages * * @access public * @since 1.4 * @return void */ public function admin_head() { // Badge for welcome page //$badge_url = ReduxFramework::$_url . 'assets/images/redux-badge.png'; ?>

'; require_once 'views/about.php'; } /** * Render Changelog Screen * * @access public * @since 2.0.3 * @return void */ public function changelog_screen() { // Stupid hack for Wordpress alerts and warnings echo '

'; require_once 'views/changelog.php'; } /** * Render Changelog Screen * * @access public * @since 2.0.3 * @return void */ public function redux_extensions() { // Stupid hack for Wordpress alerts and warnings echo '

'; require_once 'views/extensions.php'; } /** * Render Get Support Screen * * @access public * @since 1.9 * @return void */ public function get_support() { // Stupid hack for Wordpress alerts and warnings echo '

'; require_once 'views/support.php'; } /** * Render Credits Screen * * @access public * @since 1.4 * @return void */ public function credits_screen() { // Stupid hack for Wordpress alerts and warnings echo '

'; require_once 'views/credits.php'; } /** * Render Status Report Screen * * @access public * @since 1.4 * @return void */ public function status_screen() { // Stupid hack for Wordpress alerts and warnings echo '

'; require_once 'views/status_report.php'; } /** * Parse the Redux readme.txt file * * @since 2.0.3 * @return string $readme HTML formatted readme file */ public function parse_readme() { if ( file_exists( ReduxFramework::$_dir . 'inc/fields/raw/parsedown.php' ) ) { require_once ReduxFramework::$_dir . 'inc/fields/raw/parsedown.php'; $Parsedown = new Parsedown(); $data = @wp_remote_get( ReduxFramework::$_url . '../CHANGELOG.md' ); if ( isset( $data ) && ! empty( $data ) ) { $data = @wp_remote_retrieve_body( $data ); return $Parsedown->text( trim( str_replace( '# Redux Framework Changelog', '', $data ) ) ); } } return ''; } public function actions() { ?>

Docs Review Us Donate Tweet

get_contributors(); if ( empty ( $contributors ) ) { return ''; } $contributor_list = ''; return $contributor_list; } /** * Retreive list of contributors from GitHub. * * @access public * @since 1.4 * @return array $contributors List of contributors */ public function get_contributors() { $contributors = get_transient( 'redux_contributors' ); if ( false !== $contributors ) { return $contributors; } $response = wp_remote_get( 'https://api.github.com/repos/ReduxFramework/redux-framework/contributors', array( 'sslverify' => false ) ); if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { return array(); } $contributors = json_decode( wp_remote_retrieve_body( $response ) ); if ( ! is_array( $contributors ) ) { return array(); } set_transient( 'redux_contributors', $contributors, 3600 ); return $contributors; } } new Redux_Welcome();