/** * Class Constructor. Defines the args for the extions class * * @since 1.0.0 * @access public * * @param array $sections Panel sections. * @param array $args Class constructor arguments. * @param array $extra_tabs Extra panel tabs. * * @return void */ public function __construct($parent) { $this->parent = $parent; $this->upload_dir = AvadaReduxFramework::$_upload_dir . 'advanced-customizer/'; $this->upload_url = AvadaReduxFramework::$_upload_url . 'advanced-customizer/'; //add_action('wp_head', array( $this, '_enqueue_new' )); if ($parent->args['customizer'] == false) { return; } // Override the AvadaReduxCore class add_filter("avadaredux/extension/{$this->parent->args['opt_name']}/customizer", array($this, 'remove_core_customizer_class')); global $pagenow, $wp_customize; if (!isset($wp_customize) && $pagenow !== "customize.php" && $pagenow !== "admin-ajax.php") { return; } if ($pagenow !== "customize.php" && $pagenow !== "admin-ajax.php" && !isset($GLOBALS['wp_customize'])) { //return; } if (empty($this->_extension_dir)) { $this->_extension_dir = AvadaRedux_Helpers::get_extension_dir(dirname(__FILE__)); $this->_extension_url = AvadaRedux_Helpers::get_extension_url(dirname(__FILE__)); } self::get_post_values(); // Create defaults array $defaults = array(); /* customize_controls_init customize_controls_enqueue_scripts customize_controls_print_styles customize_controls_print_scripts customize_controls_print_footer_scripts */ //add_action('customize_save', ); if (isset($_POST['wp_customize']) && $_POST['wp_customize'] == "on") { $this->parent->args['customizer_only'] = true; } if (isset($_POST['wp_customize']) && $_POST['wp_customize'] == "on" && isset($_POST['customized']) && !empty($_POST['customized']) && !isset($_POST['action'])) { add_action("avadaredux/options/{$this->parent->args['opt_name']}/options", array($this, '_override_values'), 100); } add_action('customize_register', array($this, '_register_customizer_controls')); // Create controls add_action('wp_head', array($this, 'customize_preview_init')); //add_action( 'customize_save', array( $this, 'customizer_save_before' ) ); // Before save add_action('customize_save_after', array(&$this, 'customizer_save_after')); // After save // Add global controls CSS file add_action('customize_controls_print_scripts', array($this, 'enqueue_controls_css')); add_action('customize_controls_init', array($this, 'enqueue_panel_css')); //add_action( 'wp_enqueue_scripts', array( &$this, '_enqueue_previewer_css' ) ); // Enqueue previewer css //add_action( 'wp_enqueue_scripts', array( &$this, '_enqueue_previewer_js' ) ); // Enqueue previewer javascript //add_action( "wp_footer", array( $this, '_enqueue_new' ), 100 ); //$this->_enqueue_new(); }
/** * Validate Color to RGBA * Takes the user's input color value and returns it only if it's a valid color. * * @since AvadaReduxFramework 3.0.3 */ function validate_color_rgba($color) { if ($color == "transparent") { return $color; } $color = str_replace('#', '', $color); if (strlen($color) == 3) { $color = $color . $color; } if (preg_match('/^[a-f0-9]{6}$/i', $color)) { $color = '#' . $color; } return array('hex' => $color, 'rgba' => AvadaRedux_Helpers::hex2rgba($color)); }
/** * Class Constructor. Defines the args for the extions class * * @since 1.0.0 * @access public * * @param array $sections Panel sections. * @param array $args Class constructor arguments. * @param array $extra_tabs Extra panel tabs. * * @return void */ public function __construct($parent) { $this->parent = $parent; if (empty($this->extension_dir)) { //$this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) ); } $this->field_name = 'options_object'; self::$theInstance = $this; $this->is_field = AvadaRedux_Helpers::isFieldInUse($parent, 'options_object'); if (!$this->is_field && $this->parent->args['dev_mode'] && $this->parent->args['show_options_object']) { $this->add_section(); } add_filter('avadaredux/' . $this->parent->args['opt_name'] . '/field/class/' . $this->field_name, array(&$this, 'overload_field_path')); // Adds the local field }
/** * Class Constructor. Defines the args for the extions class * * @since 1.0.0 * @access public * * @param array $sections Panel sections. * @param array $args Class constructor arguments. * @param array $extra_tabs Extra panel tabs. * * @return void */ public function __construct($parent) { $this->parent = $parent; if (empty($this->extension_dir)) { //$this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) ); } $this->field_name = 'import_export'; self::$theInstance = $this; add_action("wp_ajax_avadaredux_link_options-" . $this->parent->args['opt_name'], array($this, "link_options")); add_action("wp_ajax_nopriv_avadaredux_link_options-" . $this->parent->args['opt_name'], array($this, "link_options")); add_action("wp_ajax_avadaredux_download_options-" . $this->parent->args['opt_name'], array($this, "download_options")); add_action("wp_ajax_nopriv_avadaredux_download_options-" . $this->parent->args['opt_name'], array($this, "download_options")); do_action("avadaredux/options/{$this->parent->args['opt_name']}/import", array($this, 'remove_cookie')); $this->is_field = AvadaRedux_Helpers::isFieldInUse($parent, 'import_export'); if (!$this->is_field && $this->parent->args['show_import_export']) { $this->add_section(); } add_filter('avadaredux/' . $this->parent->args['opt_name'] . '/field/class/' . $this->field_name, array(&$this, 'overload_field_path')); // Adds the local field add_filter('upload_mimes', array($this, 'custom_upload_mimes')); }
* * @author AvadaRedux Framework * @package AvadaReduxFramework/Templates * @version: 3.5.4.18 */ $tip_title = __('Developer Mode Enabled', 'avadaredux-framework'); if ($this->parent->dev_mode_forced) { $is_debug = false; $is_localhost = false; $debug_bit = ''; if (AvadaRedux_Helpers::isWpDebug()) { $is_debug = true; $debug_bit = __('WP_DEBUG is enabled', 'avadaredux-framework'); } $localhost_bit = ''; if (AvadaRedux_Helpers::isLocalHost()) { $is_localhost = true; $localhost_bit = __('you are working in a localhost environment', 'avadaredux-framework'); } $conjunction_bit = ''; if ($is_localhost && $is_debug) { $conjunction_bit = ' ' . __('and', 'avadaredux-framework') . ' '; } $tip_msg = __('This has been automatically enabled because', 'avadaredux-framework') . ' ' . $debug_bit . $conjunction_bit . $localhost_bit . '.'; } else { $tip_msg = __('If you are not a developer, your theme/plugin author shipped with developer mode enabled. Contact them directly to fix it.', 'avadaredux-framework'); } ?> <div id="avadaredux-header"> <?php if (!empty($this->parent->args['display_name'])) {
/** * getColorVal. Returns formatted color val in hex or rgba. * * If this field requires any scripts, or css define this function and register/enqueue the scripts/css * * @since 1.0.0 * @access private * @return string */ private function getColorVal() { // No notices $color = ''; $alpha = 1; $rgba = ''; // Must be an array if (is_array($this->value)) { // Enum array to parse values foreach ($this->value as $id => $val) { // Sanitize alpha if ($id == 'alpha') { $alpha = !empty($val) ? $val : 1; } elseif ($id == 'color') { $color = !empty($val) ? $val : ''; } elseif ($id == 'rgba') { $rgba = !empty($val) ? $val : ''; $rgba = AvadaRedux_Helpers::hex2rgba($color, $alpha); } } // Only build rgba output if alpha ia less than 1 if ($alpha < 1 && $alpha != '') { $color = $rgba; } } return $color; }
/** * Show a notice highlighting bad template files */ public function template_file_check_notice() { if ($this->template_path == $this->original_path) { return; } $core_templates = $this->scan_template_files($this->original_path); $outdated = false; foreach ($core_templates as $file) { $developer_theme_file = false; if (file_exists($this->template_path . $file)) { $developer_theme_file = $this->template_path . $file; } if ($developer_theme_file) { $core_version = AvadaRedux_Helpers::get_template_version($this->original_path . $file); $developer_version = AvadaRedux_Helpers::get_template_version($developer_theme_file); if ($core_version && $developer_version && version_compare($developer_version, $core_version, '<')) { ?> <div id="message" class="error avadaredux-message"> <p><?php _e('<strong>Your panel has bundled outdated copies of AvadaRedux Framework template files</strong> – if you encounter functionality issues this could be the reason. Ensure you update or remove them.', 'avadaredux-framework'); ?> </p> </div> <?php return; } } } }
/** * Admin View: Page - Status Report */ if (!defined('ABSPATH')) { exit; } global $wpdb; function avadaredux_get_support_object() { $obj = array(); } function avadaredux_clean($var) { return sanitize_text_field($var); } $sysinfo = AvadaRedux_Helpers::compileSystemStatus(false, true); ?> <div class="wrap about-wrap avadaredux-status"> <h1> <?php esc_html_e('AvadaRedux Framework - System Status', 'avadaredux-framework'); ?> </h1> <div class="about-text"> <?php esc_html_e('Our core mantra at AvadaRedux is backwards compatibility. With hundreds of thousands of instances worldwide, you can be assured that we will take care of you and your clients.', 'avadaredux-framework'); ?> </div> <div class="avadaredux-badge"> <i class="el el-avadaredux"></i>
public function do_action($action, $file = '', $params = '') { if (!empty($params)) { extract($params); } global $wp_filesystem; if (!isset($params['chmod']) || isset($params['chmod']) && empty($params['chmod'])) { if (defined('FS_CHMOD_FILE')) { $chmod = FS_CHMOD_FILE; } else { $chmod = 0644; } } $res = false; if (!isset($recursive)) { $recursive = false; } //$target_dir = $wp_filesystem->find_folder( dirname( $file ) ); // Do unique stuff if ($action == 'mkdir') { if (defined('FS_CHMOD_DIR')) { $chmod = FS_CHMOD_DIR; } else { $chmod = 0755; } $res = $wp_filesystem->mkdir($file); if (!$res) { wp_mkdir_p($file); $res = file_exists($file); if (!$res) { mkdir($file, $chmod, true); $res = file_exists($file); } } } elseif ($action == 'rmdir') { $res = $wp_filesystem->rmdir($file, $recursive); } elseif ($action == 'copy' && !isset($this->filesystem->killswitch)) { if (isset($this->parent->ftp_form) && !empty($this->parent->ftp_form)) { $res = copy($file, $destination); if ($res) { chmod($destination, $chmod); } } else { $res = $wp_filesystem->copy($file, $destination, $overwrite, $chmod); } } elseif ($action == 'move' && !isset($this->filesystem->killswitch)) { $res = $wp_filesystem->copy($file, $destination, $overwrite); } elseif ($action == 'delete') { $res = $wp_filesystem->delete($file, $recursive); } elseif ($action == 'rmdir') { $res = $wp_filesystem->rmdir($file, $recursive); } elseif ($action == 'dirlist') { if (!isset($include_hidden)) { $include_hidden = true; } $res = $wp_filesystem->dirlist($file, $include_hidden, $recursive); } elseif ($action == 'put_contents' && !isset($this->filesystem->killswitch)) { // Write a string to a file if (isset($this->parent->ftp_form) && !empty($this->parent->ftp_form)) { self::load_direct(); $res = self::$direct->put_contents($file, $content, $chmod); } else { $res = $wp_filesystem->put_contents($file, $content, $chmod); } } elseif ($action == 'chown') { // Changes file owner if (isset($owner) && !empty($owner)) { $res = $wp_filesystem->chmod($file, $chmod, $recursive); } } elseif ($action == 'owner') { // Gets file owner $res = $wp_filesystem->owner($file); } elseif ($action == 'chmod') { if (!isset($params['chmod']) || isset($params['chmod']) && empty($params['chmod'])) { $chmod = false; } $res = $wp_filesystem->chmod($file, $chmod, $recursive); } elseif ($action == 'get_contents') { // Reads entire file into a string if (isset($this->parent->ftp_form) && !empty($this->parent->ftp_form)) { self::load_direct(); $res = self::$direct->get_contents($file); } else { $res = $wp_filesystem->get_contents($file); } } elseif ($action == 'get_contents_array') { // Reads entire file into an array $res = $wp_filesystem->get_contents_array($file); } elseif ($action == 'object') { $res = $wp_filesystem; } elseif ($action == 'unzip') { $unzipfile = unzip_file($file, $destination); if ($unzipfile) { $res = true; } } if (!$res) { if ($action == 'dirlist') { if (empty($res) || $res == false || $res == '') { return; } if (is_array($res) && empty($res)) { return; } if (!is_array($res)) { if (count(glob("{$file}*")) == 0) { return; } } } $this->killswitch = true; $this->parent->admin_notices[] = array('type' => 'error', 'msg' => '<strong>' . __('File Permission Issues', 'avadaredux-framework') . '</strong><br/>' . sprintf(__('We were unable to modify required files. Please ensure that <code>%1s</code> has the proper read-write permissions, or modify your wp-config.php file to contain your FTP login credentials as <a href="%2s" target="_blank">outlined here</a>.', 'avadaredux-framework'), AvadaRedux_Helpers::cleanFilePath(trailingslashit(WP_CONTENT_DIR)) . '/uploads/', 'https://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants'), 'id' => 'avadaredux-wp-login', 'dismiss' => false); //add_action( "avadaredux/page/{$this->parent->args['opt_name']}/form/before", array( // $this, // 'ftp_form' //) ); } return $res; }
function support_args() { $this->options = get_option('avadaredux-framework-tracking'); $this->options['dev_mode'] = false; if (!isset($this->options['hash']) || !$this->options['hash'] || empty($this->options['hash'])) { $this->options['hash'] = md5(network_site_url() . '-' . $_SERVER['REMOTE_ADDR']); update_option('avadaredux-framework-tracking', $this->options); } if (isset($_GET['avadaredux_framework_disable_tracking']) && !empty($_GET['avadaredux_framework_disable_tracking'])) { $this->options['allow_tracking'] = false; update_option('avadaredux-framework-tracking', $this->options); } if (isset($_GET['avadaredux_framework_enable_tracking']) && !empty($_GET['avadaredux_framework_enable_tracking'])) { $this->options['allow_tracking'] = true; update_option('avadaredux-framework-tracking', $this->options); } header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); $instances = AvadaReduxFrameworkInstances::get_all_instances(); if (isset($_REQUEST['i']) && !empty($_REQUEST['i'])) { if (is_array($instances) && !empty($instances)) { foreach ($instances as $opt_name => $data) { if (md5($opt_name . '-debug') == $_REQUEST['i']) { $array = $instances[$opt_name]; } if ($data->args['dev_mode']) { $this->options['dev_mode'] = $data->args['dev_mode']; } } } if (isset($array)) { if (isset($array->extensions) && is_array($array->extensions) && !empty($array->extensions)) { foreach ($array->extensions as $key => $extension) { if (isset($extension->{$version})) { $array->extensions[$key] = $extension->{$version}; } else { $array->extensions[$key] = true; } } } if (isset($array->import_export)) { unset($array->import_export); } if (isset($array->debug)) { unset($array->debug); } } else { die; } } else { $array = AvadaRedux_Helpers::trackingObject(); if (is_array($instances) && !empty($instances)) { $array['instances'] = array(); foreach ($instances as $opt_name => $data) { $array['instances'][] = $opt_name; } } $array['key'] = md5(AUTH_KEY . SECURE_AUTH_KEY); } echo @json_encode($array, true); die; }
/** * Field Render Function. * Takes the vars and outputs the HTML for the field in the settings * * @since AvadaReduxFramework 1.0.0 */ function render() { /* * So, in_array() wasn't doing it's job for checking a passed array for a proper value. * It's wonky. It only wants to check the keys against our array of acceptable values, and not the key's * value. So we'll use this instead. Fortunately, a single no array value can be passed and it won't * take a dump. */ // No errors please $defaults = array('width' => true, 'height' => true, 'units_extended' => false, 'units' => 'px', 'mode' => array('width' => false, 'height' => false)); $this->field = wp_parse_args($this->field, $defaults); $defaults = array('width' => '', 'height' => '', 'units' => 'px'); $this->value = wp_parse_args($this->value, $defaults); if (isset($this->value['unit'])) { $this->value['units'] = $this->value['unit']; } /* * Acceptable values checks. If the passed variable doesn't pass muster, we unset them * and reset them with default values to avoid errors. */ // If units field has a value but is not an acceptable value, unset the variable if (isset($this->field['units']) && !AvadaRedux_Helpers::array_in_array($this->field['units'], array('', false, '%', 'in', 'cm', 'mm', 'em', 'ex', 'pt', 'pc', 'px', 'rem'))) { unset($this->field['units']); } //if there is a default unit value but is not an accepted value, unset the variable if (isset($this->value['units']) && !AvadaRedux_Helpers::array_in_array($this->value['units'], array('', '%', 'in', 'cm', 'mm', 'em', 'ex', 'pt', 'pc', 'px'))) { unset($this->value['units']); } /* * Since units field could be an array, string value or bool (to hide the unit field) * we need to separate our functions to avoid those nasty PHP index notices! */ // if field units has a value and IS an array, then evaluate as needed. if (isset($this->field['units']) && !is_array($this->field['units'])) { //if units fields has a value but units value does not then make units value the field value if (isset($this->field['units']) && !isset($this->value['units']) || $this->field['units'] == false) { $this->value['units'] = $this->field['units']; // If units field does NOT have a value and units value does NOT have a value, set both to blank (default?) } else { if (!isset($this->field['units']) && !isset($this->value['units'])) { $this->field['units'] = 'px'; $this->value['units'] = 'px'; // If units field has NO value but units value does, then set unit field to value field } else { if (!isset($this->field['units']) && isset($this->value['units'])) { $this->field['units'] = $this->value['units']; // if unit value is set and unit value doesn't equal unit field (coz who knows why) // then set unit value to unit field } elseif (isset($this->value['units']) && $this->value['units'] !== $this->field['units']) { $this->value['units'] = $this->field['units']; } } } // do stuff based on unit field NOT set as an array } elseif (isset($this->field['units']) && is_array($this->field['units'])) { // nothing to do here, but I'm leaving the construct just in case I have to debug this again. } echo '<fieldset id="' . $this->field['id'] . '" class="avadaredux-dimensions-container" data-id="' . $this->field['id'] . '">'; if (isset($this->field['select2'])) { // if there are any let's pass them to js $select2_params = json_encode($this->field['select2']); $select2_params = htmlspecialchars($select2_params, ENT_QUOTES); echo '<input type="hidden" class="select2_params" value="' . $select2_params . '">'; } // This used to be unit field, but was giving the PHP index error when it was an array, // so I changed it. echo '<input type="hidden" class="field-units" value="' . $this->value['units'] . '">'; /** * Width * */ if ($this->field['width'] === true) { if (!empty($this->value['width']) && strpos($this->value['width'], $this->value['units']) === false) { $this->value['width'] = filter_var($this->value['width'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); if ($this->field['units'] !== false) { $this->value['width'] .= $this->value['units']; } } echo '<div class="field-dimensions-input input-prepend">'; echo '<span class="add-on"><i class="el el-resize-horizontal icon-large"></i></span>'; echo '<input type="text" class="avadaredux-dimensions-input avadaredux-dimensions-width mini ' . $this->field['class'] . '" placeholder="' . __('Width', 'avadaredux-framework') . '" rel="' . $this->field['id'] . '-width" value="' . filter_var($this->value['width'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) . '">'; echo '<input data-id="' . $this->field['id'] . '" type="hidden" id="' . $this->field['id'] . '-width" name="' . $this->field['name'] . $this->field['name_suffix'] . '[width]' . '" value="' . $this->value['width'] . '"></div>'; } /** * Height * */ if ($this->field['height'] === true) { if (!empty($this->value['height']) && strpos($this->value['height'], $this->value['units']) === false) { $this->value['height'] = filter_var($this->value['height'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); if ($this->field['units'] !== false) { $this->value['height'] .= $this->value['units']; } } echo '<div class="field-dimensions-input input-prepend">'; echo '<span class="add-on"><i class="el el-resize-vertical icon-large"></i></span>'; echo '<input type="text" class="avadaredux-dimensions-input avadaredux-dimensions-height mini ' . $this->field['class'] . '" placeholder="' . __('Height', 'avadaredux-framework') . '" rel="' . $this->field['id'] . '-height" value="' . filter_var($this->value['height'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) . '">'; echo '<input data-id="' . $this->field['id'] . '" type="hidden" id="' . $this->field['id'] . '-height" name="' . $this->field['name'] . $this->field['name_suffix'] . '[height]' . '" value="' . $this->value['height'] . '"></div>'; } /** * Units * */ // If units field is set and units field NOT false then // fill out the options object and show it, otherwise it's hidden // and the default units value will apply. if (isset($this->field['units']) && $this->field['units'] !== false) { echo '<div class="select_wrapper dimensions-units" original-title="' . __('Units', 'avadaredux-framework') . '">'; echo '<select data-id="' . $this->field['id'] . '" data-placeholder="' . __('Units', 'avadaredux-framework') . '" class="avadaredux-dimensions avadaredux-dimensions-units select ' . $this->field['class'] . '" original-title="' . __('Units', 'avadaredux-framework') . '" name="' . $this->field['name'] . $this->field['name_suffix'] . '[units]' . '">'; // Extended units, show 'em all if ($this->field['units_extended']) { $testUnits = array('px', 'em', 'rem', '%', 'in', 'cm', 'mm', 'ex', 'pt', 'pc'); } else { $testUnits = array('px', 'em', 'rem', '%'); } if ($this->field['units'] != "" && is_array($this->field['units'])) { $testUnits = $this->field['units']; } if (in_array($this->field['units'], $testUnits)) { echo '<option value="' . $this->field['units'] . '" selected="selected">' . $this->field['units'] . '</option>'; } else { foreach ($testUnits as $aUnit) { echo '<option value="' . $aUnit . '" ' . selected($this->value['units'], $aUnit, false) . '>' . $aUnit . '</option>'; } } echo '</select></div>'; } echo "</fieldset>"; }
public function load_first() { $plugin_dir = AvadaRedux_Helpers::cleanFilePath(WP_PLUGIN_DIR) . '/'; $self_file = AvadaRedux_Helpers::cleanFilePath(__FILE__); $path = str_replace($plugin_dir, '', $self_file); $path = str_replace('class.avadaredux-plugin.php', 'avadaredux-framework.php', $path); if ($plugins = get_option('active_plugins')) { if ($key = array_search($path, $plugins)) { array_splice($plugins, $key, 1); array_unshift($plugins, $path); update_option('active_plugins', $plugins); } } }
public static function get_extension_url($dir) { $ext_dir = AvadaRedux_Helpers::get_extension_dir($dir); $ext_dir = str_replace(wp_normalize_path(WP_CONTENT_DIR), WP_CONTENT_URL, $dir); $ext_url = ''; if (preg_match("/wp-content\\/(.*)/", $ext_dir, $match)) { $ext_url = site_url('/wp-content/' . $match[1]); } return $ext_url; }
public static function getExtensions($opt_name = "", $key = "") { if (empty($opt_name)) { AvadaRedux::getAllExtensions(); if (empty($key)) { return self::$extension_paths; } else { if (isset(self::$extension_paths[$key])) { return self::$extension_paths[$key]; } } } else { if (empty(self::$uses_extensions[$opt_name])) { AvadaRedux::getInstanceExtensions($opt_name); } if (empty(self::$uses_extensions[$opt_name])) { return false; } $instanceExtensions = array(); foreach (self::$uses_extensions[$opt_name] as $extension) { $class_file = end(self::$extensions[$extension]); $name = str_replace('.php', '', basename($extension)); $extension_class = 'AvadaReduxFramework_Extension_' . $name; $instanceExtensions[$extension] = array('path' => $class_file, 'class' => $extension_class, 'version' => AvadaRedux_Helpers::get_template_version($class_file)); } return $instanceExtensions; } return false; }
public static function get_extension_url($dir) { $ext_dir = AvadaRedux_Helpers::get_extension_dir($dir); $ext_url = str_replace(wp_normalize_path(WP_CONTENT_DIR), WP_CONTENT_URL, $ext_dir); return $ext_url; }
private function change_demo_defaults() { if ($this->args['dev_mode'] == true || AvadaRedux_Helpers::isLocalHost() == true) { if (!empty($this->args['admin_bar_links'])) { foreach ($this->args['admin_bar_links'] as $idx => $arr) { if (is_array($arr) && !empty($arr)) { foreach ($arr as $x => $y) { if (strpos(strtolower($y), 'avadaredux') >= 0) { $msg = __('<strong>AvadaRedux Framework Notice: </strong>There are references to the AvadaRedux Framework support site in your config\'s <code>admin_bar_links</code> argument. This is sample data. Please change or remove this data before shipping your product.', 'avadaredux-framework'); $this->display_arg_change_notice('admin', $msg); $this->omit_admin_items = true; continue; } } } } } if (!empty($this->args['share_icons'])) { foreach ($this->args['share_icons'] as $idx => $arr) { if (is_array($arr) && !empty($arr)) { foreach ($arr as $x => $y) { if (strpos(strtolower($y), 'avadaredux') >= 0) { $msg = __('<strong>AvadaRedux Framework Notice: </strong>There are references to the AvadaRedux Framework support site in your config\'s <code>share_icons</code> argument. This is sample data. Please change or remove this data before shipping your product.', 'avadaredux-framework'); $this->display_arg_change_notice('share', $msg); $this->omit_share_icons = true; } } } } } } }
metaboxes => widget areas => shortcodes => icon select => gallery tracking => * */ $iconMap = array('repeater' => 'tags', 'social-profiles' => 'group', 'js-button' => 'hand-down', 'multi-media' => 'picture', 'css-layout' => 'fullscreen', 'color-schemes' => 'adjust-alt', 'custom-fonts' => 'fontsize', 'live-search' => 'search', 'support-faqs' => 'question', 'date-time' => 'calendar', 'premium-support' => 'fire', 'metaboxes' => 'magic', 'widget-areas' => 'inbox-box', 'shortcodes' => 'shortcode', 'icon-select' => 'gallery', 'accordion' => 'lines'); $colors = array('8CC63F', '8CC63F', '0A803B', '25AAE1', '0F75BC', 'F7941E', 'F1592A', 'ED217C', 'BF1E2D', '8569CF', '0D9FD8', '8AD749', 'EECE00', 'F8981F', 'F80E27', 'F640AE'); shuffle($colors); echo '<style type="text/css">'; ?> <?php foreach ($colors as $key => $color) { echo '.theme-browser .theme.color' . esc_html($key) . ' .theme-screenshot{background-color:' . esc_html(AvadaRedux_Helpers::hex2rgba($color, 0.45)) . ';}'; echo '.theme-browser .theme.color' . esc_html($key) . ':hover .theme-screenshot{background-color:' . esc_html(AvadaRedux_Helpers::hex2rgba($color, 0.75)) . ';}'; } echo '</style>'; $color = 1; ?> <div class="wrap about-wrap"> <h1><?php esc_html_e('AvadaRedux Framework - Extensions', 'avadaredux-framework'); ?> </h1> <div class="about-text"> <?php printf(__('Supercharge your AvadaRedux experience. Our extensions provide you with features that will take your products to the next level.', 'avadaredux-framework'), esc_html($this->display_version)); ?> </div>
public function support_hash() { if (!wp_verify_nonce($_POST['nonce'], 'avadaredux-support-hash')) { die; } $data = get_option('avadaredux_support_hash'); $data = wp_parse_args($data, array('check' => '', 'identifier' => '')); $generate_hash = true; $system_info = AvadaRedux_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' => AvadaRedux_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.avadaredux.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('avadaredux_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.", 'avadaredux-framework'); } echo json_encode($return); die(1); }