1
|
|
|
<?php |
|
|
|
|
2
|
|
|
/** |
3
|
|
|
* Navigation tabs |
4
|
|
|
* |
5
|
|
|
* @access public |
6
|
|
|
* @since 1.9 |
7
|
|
|
* @return void |
8
|
|
|
*/ |
9
|
|
|
function yikes_easy_mc_welcome_tabs() { |
|
|
|
|
10
|
|
|
$section = isset( $_GET['section'] ) ? $_GET['section'] : 'getting-started'; |
11
|
|
|
?> |
12
|
|
|
<h2 class="nav-tab-wrapper welcome-page-tabs"> |
13
|
|
|
<a class="nav-tab <?php echo $section == 'getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'getting-started' ), 'admin.php' ) ) ); ?>"> |
14
|
|
|
<span class="dashicons dashicons-admin-home"></span> <?php _e( 'Getting Started', 'yikes-inc-easy-mailchimp-extender' ); ?> |
15
|
|
|
</a> |
16
|
|
|
<a class="nav-tab <?php echo $section == 'whats-new' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'whats-new' ), 'admin.php' ) ) ); ?>"> |
17
|
|
|
<span class="dashicons dashicons-warning"></span> <?php _e( "What's New", 'yikes-inc-easy-mailchimp-extender' ); ?> |
18
|
|
|
</a> |
19
|
|
|
<a class="nav-tab <?php echo $section == 'add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'add-ons' ), 'admin.php' ) ) ); ?>"> |
20
|
|
|
<span class="dashicons dashicons-admin-plugins"></span> <?php _e( "Add-Ons", 'yikes-inc-easy-mailchimp-extender' ); ?> |
21
|
|
|
</a> |
22
|
|
|
<a class="nav-tab <?php echo $section == 'knowledge-base' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'knowledge-base' ), 'admin.php' ) ) ); ?>"> |
23
|
|
|
<span class="dashicons dashicons-welcome-learn-more"></span> <?php _e( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ); ?> |
24
|
|
|
</a> |
25
|
|
|
<a class="nav-tab <?php echo $section == 'credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'credits' ), 'admin.php' ) ) ); ?>"> |
26
|
|
|
<span class="dashicons dashicons-arrow-left-alt2"></span><?php _e( 'Credits', 'yikes-inc-easy-mailchimp-extender' ); ?><span class="dashicons dashicons-arrow-right-alt2"></span> |
27
|
|
|
</a> |
28
|
|
|
</h2> |
29
|
|
|
<?php |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
function yikes_easy_mc_welcome_body() { |
|
|
|
|
33
|
|
|
$section = isset( $_GET['section'] ) ? $_GET['section'] : 'getting-started'; |
34
|
|
|
if( isset( $section ) ) { |
35
|
|
|
include_once( plugin_dir_path( dirname( __FILE__ ) ) . '/welcome-page/welcome-sections/' . $section . '-section.php' ); |
36
|
|
|
} |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
// Display custom PHP warning if <= 5.3 |
40
|
|
|
do_action( 'yikes_easy_mc_php_warning' ); |
41
|
|
|
?> |
42
|
|
|
<div class="wrap about-wrap welcome-page-about-wrap"> |
43
|
|
|
|
44
|
|
|
<div id="yikes-mailchimp-logo"></div> |
45
|
|
|
|
46
|
|
|
<h2 class="welcome-title"> |
47
|
|
|
Easy Forms for MailChimp by YIKES | <?php echo __( 'MailChimp Done Right' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
48
|
|
|
</h2> |
49
|
|
|
|
50
|
|
|
<p class="about-text"> |
51
|
|
|
<?php |
52
|
|
|
// check if this is a fresh install |
53
|
|
|
if( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) { |
54
|
|
|
echo sprintf( __( 'Welcome to the most powerful MailChimp integration for WordPress. Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!' , 'yikes-inc-easy-mailchimp-extender' ) , $this->version ); |
55
|
|
|
} else { |
56
|
|
|
// else thank you for updating :) |
57
|
|
|
echo sprintf( __( 'Thank you for updating to the latest version! Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!' , 'yikes-inc-easy-mailchimp-extender' ) , $this->version ); |
58
|
|
|
} |
59
|
|
|
?> |
60
|
|
|
</p> |
61
|
|
|
|
62
|
|
|
<?php |
63
|
|
|
// Display our tabs |
64
|
|
|
yikes_easy_mc_welcome_tabs(); |
65
|
|
|
yikes_easy_mc_welcome_body(); |
66
|
|
|
?> |
67
|
|
|
|
68
|
|
|
</div> |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.