class-auxels-admin-assets.php
6 years ago
class-auxels-archive-menu-links.php
6 years ago
class-auxels-import-parser.php
8 years ago
class-auxels-import.php
6 years ago
class-auxels-search-post-type.php
6 years ago
class-auxin-admin-dashboard.php
6 years ago
class-auxin-demo-importer.php
6 years ago
class-auxin-dependency-sorting.php
8 years ago
class-auxin-import.php
6 years ago
class-auxin-install.php
6 years ago
class-auxin-master-nav-menu-admin.php
6 years ago
class-auxin-page-template.php
6 years ago
class-auxin-permalink.php
6 years ago
class-auxin-plugin-requirements.php
6 years ago
class-auxin-post-type-base.php
6 years ago
class-auxin-siteorigin-widget.php
6 years ago
class-auxin-svg-support-allowedattributes.php
7 years ago
class-auxin-svg-support-allowedtags.php
7 years ago
class-auxin-svg-support.php
7 years ago
class-auxin-walker-nav-menu-back.php
6 years ago
class-auxin-welcome-sections.php
6 years ago
class-auxin-welcome.php
6 years ago
class-auxin-whitelabel.php
6 years ago
class-auxin-widget-indie.php
6 years ago
class-auxin-widget-shortcode-map.php
6 years ago
class-auxin-widget.php
6 years ago
class-auxin-welcome-sections.php
667 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | class Auxin_Welcome_Sections { |
| 5 | |
| 6 | /** |
| 7 | * Instance of this class. |
| 8 | * |
| 9 | * @var object |
| 10 | */ |
| 11 | protected static $instance = null; |
| 12 | |
| 13 | /** |
| 14 | * Instance of main welcome class. |
| 15 | * |
| 16 | * @var object |
| 17 | */ |
| 18 | public $welcome = null; |
| 19 | |
| 20 | /** |
| 21 | * The slug name to refer to this menu |
| 22 | * |
| 23 | * @since 1.0 |
| 24 | * |
| 25 | * @var string |
| 26 | */ |
| 27 | public $page_slug; |
| 28 | |
| 29 | /** |
| 30 | * List of video tutorilas. |
| 31 | * |
| 32 | * @var array |
| 33 | */ |
| 34 | protected $tutorial_list = null; |
| 35 | |
| 36 | |
| 37 | function __construct(){; |
| 38 | add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_importer' ), 60 ); |
| 39 | add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_templates'), 65 ); |
| 40 | add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_plugins' ), 70 ); |
| 41 | add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_feedback' ), 100 ); |
| 42 | add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_status' ), 110 ); |
| 43 | add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_updates' ), 120 ); |
| 44 | |
| 45 | if( ! defined('THEME_PRO') || ! THEME_PRO ) { |
| 46 | add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_go_pro' ), 120 ); |
| 47 | add_action( 'auxin_admin_before_welcome_section_content', array( $this, 'maybe_add_dashboard_notice') ); |
| 48 | } |
| 49 | |
| 50 | add_action( 'auxin_admin_after_welcome_section_content' , array( $this, 'append_changelog') ); |
| 51 | add_action( 'auxin_admin_after_welcome_section_content' , array( $this, 'append_tutorials') ); |
| 52 | |
| 53 | add_filter( 'auxin_admin_welcome_video_tutorial_list' , array( $this, 'add_video_tutorial_list' ) ); |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Return an instance of this class. |
| 58 | * |
| 59 | * @return object A single instance of this class. |
| 60 | */ |
| 61 | public static function get_instance() { |
| 62 | |
| 63 | // If the single instance hasn't been set, set it now. |
| 64 | if ( null == self::$instance ) { |
| 65 | self::$instance = new self; |
| 66 | } |
| 67 | |
| 68 | return self::$instance; |
| 69 | } |
| 70 | |
| 71 | |
| 72 | /*-----------------------------------------------------------------------------------*/ |
| 73 | /* Adds demos tab in theme about (welcome) page |
| 74 | /*-----------------------------------------------------------------------------------*/ |
| 75 | |
| 76 | public function add_section_updates( $sections ){ |
| 77 | $total_updates = function_exists('auxin_get_total_updates') ? auxin_get_total_updates() : 0; |
| 78 | $update_count = $total_updates ? sprintf(' <span class = "update-plugins count-%1$s"><span class="update-count">%1$s</span></span>', $total_updates ) : ''; |
| 79 | |
| 80 | $sections['updates'] = array( |
| 81 | 'label' => esc_html__( 'Updates', 'auxin-elements' ) . $update_count, |
| 82 | 'description' => '', |
| 83 | 'callback' => 'setup_updates', |
| 84 | 'add_admin_menu' => $total_updates ? true : false |
| 85 | ); |
| 86 | |
| 87 | return $sections; |
| 88 | } |
| 89 | |
| 90 | public function add_section_templates( $sections ){ |
| 91 | |
| 92 | $sections['templates'] = array( |
| 93 | 'label' => esc_html__( 'Template Kits', 'auxin-elements' ), |
| 94 | 'description' => '', |
| 95 | 'callback' => 'setup_templates', |
| 96 | 'add_admin_menu' => true |
| 97 | ); |
| 98 | |
| 99 | return $sections; |
| 100 | } |
| 101 | |
| 102 | public function add_section_importer( $sections ){ |
| 103 | |
| 104 | if( ! empty( $sections['importer'] ) ){ |
| 105 | $sections['importer']['callback'] = 'setup_importer'; |
| 106 | $sections['importer']['add_admin_menu'] = true; |
| 107 | } |
| 108 | |
| 109 | return $sections; |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * Adds a notice after dashboard navigation |
| 114 | * |
| 115 | * @param array $sections |
| 116 | */ |
| 117 | public function maybe_add_dashboard_notice( $sections ){ |
| 118 | echo Auxin_Dashboard_Notice::get_instance()->get_notice( 'auxels-notice-info-dashboard' ); |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * Adds a new section to welcome page |
| 123 | * |
| 124 | * @param array $sections |
| 125 | */ |
| 126 | public function add_section_plugins( $sections ){ |
| 127 | |
| 128 | $sections['plugins'] = array( |
| 129 | 'label' => esc_html__( 'Plugins', 'auxin-elements' ), |
| 130 | 'description' => '', |
| 131 | 'callback' => 'setup_plugins', |
| 132 | 'add_admin_menu' => true |
| 133 | ); |
| 134 | |
| 135 | return $sections; |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * Adds a new section to welcome page |
| 140 | * |
| 141 | * @param array $sections |
| 142 | */ |
| 143 | public function add_section_feedback( $sections ){ |
| 144 | |
| 145 | $sections['feedback'] = array( |
| 146 | 'label' => __( 'Feedback', 'auxin-elements' ), |
| 147 | 'description' => '', |
| 148 | 'callback' => array( $this, 'render_feedback' ) |
| 149 | ); |
| 150 | |
| 151 | return $sections; |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Adds a new section to welcome page |
| 156 | * |
| 157 | * @param array $sections |
| 158 | */ |
| 159 | public function add_section_status( $sections ){ |
| 160 | |
| 161 | $sections['status'] = array( |
| 162 | 'label' => __( 'System Status', 'auxin-elements' ), |
| 163 | 'description' => '', |
| 164 | 'callback' => array( $this, 'render_system_status' ) |
| 165 | ); |
| 166 | |
| 167 | return $sections; |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * Adds a new section to welcome page |
| 172 | * |
| 173 | * @param array $sections |
| 174 | */ |
| 175 | public function add_section_go_pro( $sections ){ |
| 176 | |
| 177 | $sections['go_pro'] = array( |
| 178 | 'label' => esc_html__( 'Go Pro', 'auxin-elements' ), |
| 179 | 'description' => '', |
| 180 | 'url' => esc_url( 'http://phlox.pro/go-pro/?utm_source=phlox-welcome&utm_medium=phlox-free&utm_campaign=phlox-go-pro&utm_content=welcome-tab' ), // optional |
| 181 | 'target' => '_blank', |
| 182 | 'image' => AUXELS_ADMIN_URL . '/assets/images/welcome/rocket-pro.gif', |
| 183 | 'add_admin_menu' => true |
| 184 | ); |
| 185 | |
| 186 | return $sections; |
| 187 | } |
| 188 | |
| 189 | |
| 190 | /** |
| 191 | * Content for status tab in welcome-about page in admin panel |
| 192 | * |
| 193 | * @return void |
| 194 | */ |
| 195 | function render_system_status(){ |
| 196 | ?> |
| 197 | <div class="aux-section-content-box"> |
| 198 | <h3 class="aux-content-title"><?php _e('Some informaition about your WordPress installation which can be helpful for debugging or monitoring your website.', 'auxin-elements' ); ?></h3> |
| 199 | <div class="aux-status-wrapper"> |
| 200 | |
| 201 | <table class="widefat" cellspacing="0"> |
| 202 | <thead> |
| 203 | <tr> |
| 204 | <th colspan="3" data-export-label="WordPress Environment"><?php _e( 'WordPress Environment', 'auxin-elements' ); ?></th> |
| 205 | </tr> |
| 206 | </thead> |
| 207 | <tbody> |
| 208 | <tr> |
| 209 | <td data-export-label="Home URL"><?php _e( 'Home URL', 'auxin-elements' ); ?>:</td> |
| 210 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'The URL of your site\'s homepage.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 211 | <td><?php echo home_url(); ?></td> |
| 212 | </tr> |
| 213 | <tr> |
| 214 | <td data-export-label="Site URL"><?php _e( 'Site URL', 'auxin-elements' ); ?>:</td> |
| 215 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'The root URL of your site.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 216 | <td><?php echo site_url(); ?></td> |
| 217 | </tr> |
| 218 | <tr> |
| 219 | <td data-export-label="WP Version"><?php _e( 'WP Version', 'auxin-elements' ); ?>:</td> |
| 220 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'The version of WordPress installed on your site.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 221 | <td><?php bloginfo('version'); ?></td> |
| 222 | </tr> |
| 223 | <tr> |
| 224 | <td data-export-label="WP Multisite"><?php _e( 'WP Multisite', 'auxin-elements' ); ?>:</td> |
| 225 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'Whether or not you have WordPress Multisite enabled.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 226 | <td><?php if ( is_multisite() ) echo '✔'; else echo '✕'; ?></td> |
| 227 | </tr> |
| 228 | <tr> |
| 229 | <td data-export-label="WP Memory Limit"><?php _e( 'WP Memory Limit', 'auxin-elements' ); ?>:</td> |
| 230 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'The maximum amount of memory (RAM) that your site can use at one time.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 231 | <td><?php |
| 232 | // This field need to make some changes |
| 233 | $server_memory = 0; |
| 234 | if( function_exists( 'ini_get' ) ) { |
| 235 | echo ( ini_get( 'memory_limit') ); |
| 236 | } |
| 237 | ?></td> |
| 238 | </tr> |
| 239 | <tr> |
| 240 | <td data-export-label="WP Permalink"><?php _e( 'WP Permalink', 'auxin-elements' ); ?>:</td> |
| 241 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'The WordPress permalink structer.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 242 | <td><?php echo get_option( 'permalink_structure' ); ?></td> |
| 243 | </tr> |
| 244 | <tr> |
| 245 | <td data-export-label="WP Debug Mode"><?php _e( 'WP Debug Mode', 'auxin-elements' ); ?>:</td> |
| 246 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'Displays whether or not WordPress is in Debug Mode.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 247 | <td><?php if ( defined('WP_DEBUG') && WP_DEBUG ) echo '<mark class="yes">' . '✔' . '</mark>'; else echo '<mark class="no">' . '✕' . '</mark>'; ?></td> |
| 248 | </tr> |
| 249 | <tr> |
| 250 | <td data-export-label="Language"><?php _e( 'Language', 'auxin-elements' ); ?>:</td> |
| 251 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'The current language used by WordPress. Default = English', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 252 | <td><?php echo get_locale() ?></td> |
| 253 | </tr> |
| 254 | </tbody> |
| 255 | </table> |
| 256 | |
| 257 | <table class="widefat" cellspacing="0"> |
| 258 | <thead> |
| 259 | <tr> |
| 260 | <th colspan="3" data-export-label="Server Environment"><?php _e( 'Server Environment', 'auxin-elements' ); ?></th> |
| 261 | </tr> |
| 262 | </thead> |
| 263 | <tbody> |
| 264 | <tr> |
| 265 | <td data-export-label="Server Info"><?php _e( 'Server Info', 'auxin-elements' ); ?>:</td> |
| 266 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'Information about the web server that is currently hosting your site.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 267 | <td><?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); ?></td> |
| 268 | </tr> |
| 269 | <tr> |
| 270 | <td data-export-label="PHP Version"><?php _e( 'PHP Version', 'auxin-elements' ); ?>:</td> |
| 271 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'The version of PHP installed on your hosting server.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 272 | <td><?php |
| 273 | // should add the cpmparsion check for version_compare(PHP_VERSION, '5.0.0', '<') |
| 274 | if ( function_exists( 'phpversion' ) ) echo esc_html( phpversion() ); ?></td> |
| 275 | </tr> |
| 276 | <tr> |
| 277 | <td data-export-label="Server Info"><?php _e( 'Server Info', 'auxin-elements' ); ?>:</td> |
| 278 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'Information about the web server that is currently hosting your site.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 279 | <td><?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); ?></td> |
| 280 | </tr> |
| 281 | <?php if ( function_exists( 'ini_get' ) ) : ?> |
| 282 | <tr> |
| 283 | <td data-export-label="PHP Post Max Size"><?php _e( 'PHP Post Max Size', 'auxin-elements' ); ?>:</td> |
| 284 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'The largest file size that can be contained in one post.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 285 | <td></td> |
| 286 | </tr> |
| 287 | <tr> |
| 288 | <td data-export-label="PHP Time Limit"><?php _e( 'PHP Time Limit', 'auxin-elements' ); ?>:</td> |
| 289 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups)', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 290 | <td><?php |
| 291 | $time_limit = ini_get('max_execution_time'); |
| 292 | //should add the condition |
| 293 | if ( $time_limit < 60 && $time_limit != 0 ) { |
| 294 | echo '<mark class="server-status-error">' . sprintf( __( '%s - We recommend setting max execution time to at least 60. See: <a href="%s" target="_blank">Increasing max execution to PHP</a>', 'auxin-elements' ), $time_limit, 'http://codex.wordpress.org/Common_WordPress_Errors#Maximum_execution_time_exceeded' ) . '</mark>'; |
| 295 | } else { |
| 296 | echo '<mark class="yes">' . $time_limit . '</mark>'; |
| 297 | } |
| 298 | ?> |
| 299 | </td> |
| 300 | </tr> |
| 301 | <tr> |
| 302 | <td data-export-label="PHP Max Input Vars"><?php _e( 'PHP Max Input Vars', 'auxin-elements' ); ?>:</td> |
| 303 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'The maximum number of variables your server can use for a single function to avoid overloads.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 304 | <td><?php echo ini_get('max_input_vars'); ?></td> |
| 305 | </tr> |
| 306 | <tr> |
| 307 | <td data-export-label="SUHOSIN Installed"><?php _e( 'SUHOSIN Installed', 'auxin-elements' ); ?>:</td> |
| 308 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'Suhosin is an advanced protection system for PHP installations. It was designed to protect your servers on the one hand against a number of well known problems in PHP applications and on the other hand against potential unknown vulnerabilities within these applications or the PHP core itself. If enabled on your server, Suhosin may need to be configured to increase its data submission limits.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 309 | <td><?php echo extension_loaded( 'suhosin' ) ? '✔' : '✕'; ?></td> |
| 310 | </tr> |
| 311 | <?php endif; ?> |
| 312 | <tr> |
| 313 | <td data-export-label="MySQL Version"><?php _e( 'MySQL Version', 'auxin-elements' ); ?>:</td> |
| 314 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'The version of MySQL installed on your hosting server.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 315 | <td> |
| 316 | <?php |
| 317 | /** @global wpdb $wpdb */ |
| 318 | global $wpdb; |
| 319 | echo $wpdb->db_version(); |
| 320 | ?> |
| 321 | </td> |
| 322 | </tr> |
| 323 | <tr> |
| 324 | <td data-export-label="Max Upload Size"><?php _e( 'Max Upload Size', 'auxin-elements' ); ?>:</td> |
| 325 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'The largest file size that can be uploaded to your WordPress installation.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 326 | <td><?php echo size_format( wp_max_upload_size() ); ?></td> |
| 327 | </tr> |
| 328 | <tr> |
| 329 | <td data-export-label="Default Timezone is UTC"><?php _e( 'Default Timezone is UTC', 'auxin-elements' ); ?>:</td> |
| 330 | <td class="help"><?php echo '<a href="#" class="help-tip" original-title="' . esc_attr__( 'The default timezone for your server.', 'auxin-elements' ) . '"> ? </a>'; ?></td> |
| 331 | <td><?php |
| 332 | $default_timezone = date_default_timezone_get(); |
| 333 | if ( 'UTC' !== $default_timezone ) { |
| 334 | echo '<mark class="server-status-error">' . '✕ ' . sprintf( __( 'Default timezone is %s - it should be UTC', 'auxin-elements' ), $default_timezone ) . '</mark>'; |
| 335 | } else { |
| 336 | echo '<mark class="yes">' . '✔' . '</mark>'; |
| 337 | } ?> |
| 338 | </td> |
| 339 | </tr> |
| 340 | </tbody> |
| 341 | </table> |
| 342 | |
| 343 | <table class="widefat active-plugins" cellspacing="0" id="status"> |
| 344 | <thead> |
| 345 | <tr> |
| 346 | <th colspan="3" data-export-label="Active Plugins (<?php echo count( (array) get_option( 'active_plugins' ) ); ?>)"><?php _e( 'Active Plugins', 'auxin-elements' ); ?> (<?php echo count( (array) get_option( 'active_plugins' ) ); ?>)</th> |
| 347 | </tr> |
| 348 | </thead> |
| 349 | <tbody> |
| 350 | <?php |
| 351 | $active_plugins = (array) get_option( 'active_plugins', array() ); |
| 352 | |
| 353 | if ( is_multisite() ) { |
| 354 | $active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) ); |
| 355 | } |
| 356 | foreach ( $active_plugins as $plugin ) { |
| 357 | $plugin_data = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); |
| 358 | $dirname = dirname( $plugin ); |
| 359 | $version_string = ''; |
| 360 | $network_string = ''; |
| 361 | if ( ! empty( $plugin_data['Name'] ) ) { |
| 362 | // link the plugin name to the plugin url if available |
| 363 | $plugin_name = esc_html( $plugin_data['Name'] ); |
| 364 | if ( ! empty( $plugin_data['PluginURI'] ) ) { |
| 365 | $plugin_name = '<a href="' . esc_url( $plugin_data['PluginURI'] ) . '" title="' . __( 'Visit plugin homepage' , 'auxin-elements' ) . '" target="_blank">' . $plugin_name . '</a>'; |
| 366 | } |
| 367 | ?> |
| 368 | <tr> |
| 369 | <td><?php echo $plugin_name; ?></td> |
| 370 | <td><?php echo sprintf( _x( 'by %s', 'by author', 'auxin-elements' ), $plugin_data['Author'] ) . ' Version – ' . esc_html( $plugin_data['Version'] ) . $version_string . $network_string; ?></td> |
| 371 | </tr> |
| 372 | <?php |
| 373 | } |
| 374 | } |
| 375 | ?> |
| 376 | </tbody> |
| 377 | </table> |
| 378 | </div> |
| 379 | </div> |
| 380 | <?php |
| 381 | } |
| 382 | |
| 383 | |
| 384 | function render_feedback(){ |
| 385 | // the previous rate of the client |
| 386 | $previous_rate = auxin_get_option( 'user_rating' ); |
| 387 | |
| 388 | $support_tab_url = self_admin_url( 'admin.php?page=auxin-welcome&tab=help' ); |
| 389 | ?> |
| 390 | |
| 391 | <div class="feature-section aux-welcome-page-feedback"> |
| 392 | <div class="aux-section-content-box"> |
| 393 | |
| 394 | <div class="aux-columns-wrap"> |
| 395 | <div class="aux-image-wrap"></div> |
| 396 | <div class="aux-form-wrap"> |
| 397 | <form class="aux-feedback-form" action="<?php echo admin_url( 'admin.php?page=auxin-welcome&tab=feedback'); ?>" method="post" > |
| 398 | |
| 399 | <div class="aux-rating-section"> |
| 400 | <h3 class="aux-content-title"><?php echo wp_sprintf( __( 'How likely are you to recommend %s to a friend?', THEME_DOMAIN ), THEME_NAME_I18N ) ?></h3> |
| 401 | <div class="aux-theme-ratings"> |
| 402 | <?php |
| 403 | for( $i = 1; $i <= 10; $i++ ){ |
| 404 | printf( |
| 405 | '<div class="aux-rate-cell"><input type="radio" name="theme_rate" id="theme-rating%1$s" value="%1$s" %2$s/><label class="rating" for="theme-rating%1$s">%1$s</label></div>', |
| 406 | $i, checked( $previous_rate, $i, false ) |
| 407 | ); |
| 408 | } |
| 409 | ?> |
| 410 | |
| 411 | </div> |
| 412 | <div class="aux-ratings-measure"> |
| 413 | <p><?php _e( "Don't like it", 'auxin-elements' ); ?></p> |
| 414 | <p><?php _e( "Like it so much", 'auxin-elements' ); ?></p> |
| 415 | </div> |
| 416 | </div> |
| 417 | |
| 418 | <div class="aux-feedback-section aux-hide"> |
| 419 | <div class="aux-notice-box aux-notice-blue aux-rate-us-offer aux-hide"> |
| 420 | <img src="<?php echo AUXELS_ADMIN_URL.'/assets/images/welcome/rate-like.svg'; ?>" /> |
| 421 | <p><?php printf( |
| 422 | __('Thanks for using Phlox theme. If you are enjoying this theme, please support us by %s submitting 5 star rate here%s. That would be a huge help for us to continue developing this theme.'), |
| 423 | '<a href="http://phlox.pro/rate/'.THEME_ID.'" target="_black">', |
| 424 | '</a>' |
| 425 | ); ?> |
| 426 | </p> |
| 427 | </div> |
| 428 | <h3 class="aux-feedback-form-title aux-content-title"><?php _e('Please explain why you gave this score (optional)', 'auxin-elements'); ?></h3> |
| 429 | <h4 class="aux-feedback-form-subtitle"> |
| 430 | <?php |
| 431 | printf( __( 'Please do not use this form to get support, in this case please check the %s help section %s', 'auxin-elements' ), |
| 432 | '<a href="' .$this->welcome->get_tab_link('help'). '">', '</a>' ); ?> |
| 433 | </h4> |
| 434 | <textarea placeholder="Enter your feedback here" rows="10" name="feedback" class="large-text"></textarea> |
| 435 | <input type="text" placeholder="Email address (Optional)" name="email" class="text-input" /> |
| 436 | <?php wp_nonce_field( 'phlox_feedback' ); ?> |
| 437 | |
| 438 | <input type="submit" class="aux-wl-button aux-round aux-blue aux-wide" value="<?php esc_attr_e( 'Submit', 'auxin-elements' ); ?>" /> |
| 439 | |
| 440 | <div class="aux-sending-status"> |
| 441 | <img class="ajax-progress aux-hide" src="<?php echo AUXIN_URL; ?>/css/images/elements/saving.gif" /> |
| 442 | <span class="ajax-response aux-hide" ><?php _e( 'Submitting your feedback ..', 'auxin-elements' ); ?></span> |
| 443 | </div> |
| 444 | |
| 445 | </div> |
| 446 | |
| 447 | <?php $this->send_feedback_mail(); ?> |
| 448 | </form> |
| 449 | </div> |
| 450 | </div> |
| 451 | </div> |
| 452 | </div> |
| 453 | |
| 454 | <?php |
| 455 | } |
| 456 | |
| 457 | |
| 458 | private function send_feedback_mail(){ |
| 459 | if ( ! ( ! isset( $_POST['phlox_feedback'] ) || ! wp_verify_nonce( $_POST['phlox_feedback'], 'feedback_send') ) ) { |
| 460 | |
| 461 | $email = ! empty( $_POST["email"] ) ? sanitize_email( $_POST["email"] ) : 'Empty'; |
| 462 | $feedback = ! empty( $_POST["feedback"] ) ? esc_textarea( $_POST["feedback"] ) : ''; |
| 463 | |
| 464 | if( $feedback ){ |
| 465 | wp_mail( 'info@averta.net', 'feedback from phlox dashboard', $feedback . chr(0x0D).chr(0x0A) . 'Email: ' . $email ); |
| 466 | $text = __( 'Thanks for your feedback', 'auxin-elements' ); |
| 467 | } else{ |
| 468 | $text = __('Please try again and fill up at least the feedback field.', 'auxin-elements'); |
| 469 | } |
| 470 | |
| 471 | printf('<p class="notification">%s</p>', $text); |
| 472 | } |
| 473 | } |
| 474 | |
| 475 | |
| 476 | /** |
| 477 | * Display changelogs on welcome page |
| 478 | * |
| 479 | * @param string $tab The tab that we intent to append this section to. |
| 480 | * @return void |
| 481 | */ |
| 482 | function append_changelog( $tab ){ |
| 483 | |
| 484 | if( 'dashboard' !== $tab ){ |
| 485 | return; |
| 486 | } |
| 487 | |
| 488 | // sanitize the theme id |
| 489 | $theme_id = sanitize_key( THEME_ID ); |
| 490 | |
| 491 | $changelog_cache_id = "auxin_cache_remote_changelog__{$theme_id}"; |
| 492 | |
| 493 | // get remote changelog |
| 494 | if( ( false === $changelog_info = get_transient( $changelog_cache_id ) ) || isset( $_GET['flush_transient'] ) ){ |
| 495 | |
| 496 | $changelog_remote = $this->get_remote_changelog( $theme_id ); |
| 497 | |
| 498 | if( is_wp_error( $changelog_remote ) ){ |
| 499 | echo $changelog_remote->get_error_message(); |
| 500 | return; |
| 501 | } else { |
| 502 | $changelog_info = $changelog_remote; |
| 503 | set_transient( $changelog_cache_id, $changelog_remote, 2 * HOUR_IN_SECONDS ); |
| 504 | } |
| 505 | |
| 506 | } |
| 507 | |
| 508 | // print the changelog |
| 509 | if( $changelog_info ){ ?> |
| 510 | <div class="aux-changelog-wrap"> |
| 511 | <div class="aux-changelog-header"> |
| 512 | <h2><?php _e( 'Changelog', 'auxin-elements' ); ?></h2> |
| 513 | <div class="aux-welcome-socials"> |
| 514 | <span><?php _e('Follow Us', 'auxin-elements' ); ?></span> |
| 515 | <div class="aux-welcome-social-items"> |
| 516 | <a href="http://www.twitter.com/averta_ltd" class="aux-social-item aux-social-twitter" target="_blank" title="<?php _e('Follow us on Twitter', 'auxin-elements' ); ?>"></a> |
| 517 | <a href="http://www.facebook.com/averta" class="aux-social-item aux-social-facebook" target="_blank" title="<?php _e('Follow us on Facebook', 'auxin-elements' ); ?>"></a> |
| 518 | <a href="https://www.instagram.com/averta.co/" class="aux-social-item aux-social-instagram"target="_blank" title="<?php _e('Follow us on Instagram', 'auxin-elements' ); ?>"></a> |
| 519 | <a href="https://themeforest.net/user/averta" class="aux-social-item aux-social-envato" target="_blank" title="<?php _e('Follow us on Envato', 'auxin-elements' ); ?>"></a> |
| 520 | <a href="https://www.youtube.com/playlist?list=PL7X-1Jmy1jcdekHe6adxB81SBcrHOmLRS" class="aux-social-item aux-social-youtube" target="_blank" title="<?php _e('Subscribe to Phlox YouTube channel', 'auxin-elements' ); ?>"></a> |
| 521 | </div> |
| 522 | <ul> |
| 523 | |
| 524 | </ul> |
| 525 | </div> |
| 526 | </div> |
| 527 | <div class="aux-changelog-content"> |
| 528 | <div class="aux-changelog-list"><?php echo $changelog_info; ?></div> |
| 529 | </div> |
| 530 | </div> |
| 531 | <?php |
| 532 | } |
| 533 | |
| 534 | } |
| 535 | |
| 536 | |
| 537 | /** |
| 538 | * Display video tutorials on welcome page |
| 539 | * |
| 540 | * @param string $tab The tab that we intent to append this section to. |
| 541 | * @return void |
| 542 | */ |
| 543 | function append_tutorials( $tab ){ |
| 544 | |
| 545 | if( 'help' !== $tab ){ return; } |
| 546 | $video_list = $this->get_video_tutorial_list(); |
| 547 | ?> |
| 548 | <div class="aux-setup-content"> |
| 549 | <div class="aux-video-list aux-grid-list aux-isotope-list" > |
| 550 | |
| 551 | <?php foreach ( $video_list as $video_id => $video_title ) { ?> |
| 552 | <div class="aux-grid-item aux-iso-item grid_4" > |
| 553 | <div class="aux-grid-item-inner"> |
| 554 | <div class="aux-grid-item-media"> |
| 555 | <iframe width="440" height="248" src="https://www.youtube-nocookie.com/embed/<?php echo $video_id; ?>?rel=0&showinfo=0" |
| 556 | frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> |
| 557 | </div> |
| 558 | <div class="aux-grid-item-footer"> |
| 559 | <a class="aux-grid-footer-text-link" href="<?php echo esc_url( 'https://youtu.be/'. $video_id ); ?>" target="_blank"><h3><?php echo esc_html( $video_title ); ?><span class="dashicons dashicons-external"></span></h3></a> |
| 560 | </div> |
| 561 | </div> |
| 562 | </div> |
| 563 | <?php } ?> |
| 564 | |
| 565 | </div> |
| 566 | </div> |
| 567 | <?php |
| 568 | } |
| 569 | |
| 570 | /** |
| 571 | * Collect the plugin filters |
| 572 | * |
| 573 | * @return array plugin filters |
| 574 | */ |
| 575 | private function get_video_tutorial_list(){ |
| 576 | if( empty( $this->tutorial_list ) ){ |
| 577 | $this->tutorial_list = apply_filters( 'auxin_admin_welcome_video_tutorial_list', array() ); |
| 578 | } |
| 579 | |
| 580 | return $this->tutorial_list; |
| 581 | } |
| 582 | |
| 583 | /** |
| 584 | * Collect the video tutorilas |
| 585 | * |
| 586 | * @return array video tutorilas list |
| 587 | */ |
| 588 | public function add_video_tutorial_list( $list ){ |
| 589 | |
| 590 | $new_list = array( |
| 591 | 'W8jkMN7EEdo' => 'Installing Phlox Pro', |
| 592 | 'porrf6QgjuU' => 'Configuring Menu General Options', |
| 593 | 'irSajN7JXQQ' => 'Customizing Header Menu', |
| 594 | 'AU6qT84scSY' => 'Adding a Burger Menu', |
| 595 | 'gVm9EJ6BrAI' => 'Customizing Post Formats', |
| 596 | 'YkXKxgWruDk' => 'Customizing Post Options', |
| 597 | 'UIVE7ZWbSoI' => 'Displaying Blog Slider', |
| 598 | 'b37PUx76ejc' => 'Customizing Blog Page Options', |
| 599 | '09pnnTaYAto' => 'Organizing Blog with Category', |
| 600 | 'NJDnhbI23P4' => 'Displaying About Author Box', |
| 601 | 'W-nqEKUk0Ss' => 'Displaying Related Posts on Blog', |
| 602 | 'qNVie3fELr4' => 'Customizing Page Options', |
| 603 | 'QutPg4W642A' => 'Creating Different Pages with Custom Pages', |
| 604 | '8GiqLqtsWrU' => 'Configuring Layout and Design Options', |
| 605 | 'IWj6vbnjrUE' => 'Specifying Content and Titles Typography', |
| 606 | 'hNU85eRLCQg' => 'Customizing Header Section', |
| 607 | 'mo7hiMIQvv0' => 'Adding a Scroll to Top Button', |
| 608 | 'SefEG3KOYcI' => 'Customizing the Background', |
| 609 | 'RzVFT4UxXtw' => 'Customizing Audio and Video Player', |
| 610 | 'J3GO3Lt22dw' => 'Adding a Frame for Your Website', |
| 611 | 'DueARmwq1q4' => 'Customizing Footer Area', |
| 612 | 'w65-HRbMvMo' => 'Displaying Subfooter', |
| 613 | 'SOcYs6wJsao' => 'Displaying Subfooter Bar', |
| 614 | 'bcQS7iol000' => 'Customizing your Website Login Page', |
| 615 | 'Pi9121CAGgY' => 'Adding Custom CSS and JavaScript', |
| 616 | //'A96MVeK1RCc' => 'Installing Phlox Pro', |
| 617 | 'kYh0z4jo6jM' => 'Creating Audio with Elementor', |
| 618 | 'DiiVuwhNwnU' => 'Creating Button with Elementor', |
| 619 | 'oi7R8iLRvCo' => 'Creating Video with Elementor', |
| 620 | 'gveFqSpfcQQ' => 'Creating Contact Form with Elementor', |
| 621 | 'ZKMypryYnto' => 'Creating Map with Elementor', |
| 622 | 'sOVsUu-2DHw' => 'Contact Box with Elementor' |
| 623 | ); |
| 624 | |
| 625 | return array_merge( $list, $new_list ); |
| 626 | } |
| 627 | |
| 628 | /** |
| 629 | * Retrieves the changelog remotely |
| 630 | * |
| 631 | * @param string $item_name The name of the project that we intend to get the info of |
| 632 | * @return string The changelog context |
| 633 | */ |
| 634 | private function get_remote_changelog( $item_name = '' ){ |
| 635 | |
| 636 | if( empty( $item_name ) ){ |
| 637 | $item_name = THEME_ID; |
| 638 | } |
| 639 | |
| 640 | global $wp_version; |
| 641 | |
| 642 | $args = array( |
| 643 | 'user-agent' => 'WordPress/'. $wp_version.'; '. get_site_url(), |
| 644 | 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 10 ), |
| 645 | 'body' => array( |
| 646 | 'action' => 'text', |
| 647 | 'cat' => 'changelog', |
| 648 | 'item-name' => $item_name, |
| 649 | 'content' => 'list', |
| 650 | 'view' => 'html', |
| 651 | 'limit' => 5 |
| 652 | ) |
| 653 | ); |
| 654 | |
| 655 | $request = wp_remote_get( 'http://api.averta.net/envato/items/', $args ); |
| 656 | |
| 657 | if ( is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) !== 200 ) { |
| 658 | return new WP_Error( 'no_response', 'Error while receiving remote data' ); |
| 659 | } |
| 660 | |
| 661 | $response = $request['body']; |
| 662 | |
| 663 | return $response; |
| 664 | } |
| 665 | |
| 666 | } |
| 667 |