start.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <div id="akismet-plugin-container">
  2. <div class="akismet-masthead">
  3. <div class="akismet-masthead__inside-container">
  4. <div class="akismet-masthead__logo-container">
  5. <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
  6. </div>
  7. </div>
  8. </div>
  9. <div class="akismet-lower">
  10. <?php Akismet_Admin::display_status(); ?>
  11. <div class="akismet-box">
  12. <h2><?php esc_html_e( 'Eliminate spam from your site', 'akismet' ); ?></h2>
  13. <p><?php esc_html_e( 'Select one of the options below to get started.', 'akismet' ); ?></p>
  14. </div>
  15. <div class="akismet-boxes">
  16. <?php if ( ! Akismet::predefined_api_key() ) { ?>
  17. <?php if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) { ?>
  18. <?php if ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) { ?>
  19. <div class="akismet-box">
  20. <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
  21. <p><?php esc_html_e( 'Use your Jetpack connection to activate Akismet.', 'akismet' ); ?></p>
  22. <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" target="_blank">
  23. <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
  24. <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
  25. <input type="hidden" name="auto-connect" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
  26. <input type="hidden" name="redirect" value="plugin-signup"/>
  27. <input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>"/>
  28. </form>
  29. <?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
  30. <p><?php echo sprintf( esc_html( __( 'You are connected as %s.', 'akismet' ) ), '<b>' . esc_html( $akismet_user->user_login ) . '</b>' ); ?><br /><span class="akismet-jetpack-email"><?php echo esc_html( $akismet_user->user_email ); ?></span></p>
  31. </div>
  32. <?php } elseif ( $akismet_user->status == 'cancelled' ) { ?>
  33. <div class="akismet-box">
  34. <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
  35. <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" target="_blank">
  36. <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
  37. <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
  38. <input type="hidden" name="user_id" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
  39. <input type="hidden" name="redirect" value="upgrade"/>
  40. <input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet' ); ?>"/>
  41. </form>
  42. <p><?php echo esc_html( sprintf( __( 'Your subscription for %s is cancelled.' , 'akismet' ), $akismet_user->user_email ) ); ?></p>
  43. </div>
  44. <?php } elseif ( $akismet_user->status == 'suspended' ) { ?>
  45. <div class="centered akismet-box">
  46. <h3><?php esc_html_e( 'Connected via Jetpack' , 'akismet' ); ?></h3>
  47. <p class="akismet-alert-text"><?php echo esc_html( sprintf( __( 'Your subscription for %s is suspended.' , 'akismet' ), $akismet_user->user_email ) ); ?></p>
  48. <p><?php esc_html_e( 'No worries! Get in touch and we&#8217;ll sort this out.', 'akismet' ); ?></p>
  49. <p><a href="https://akismet.com/contact" class="akismet-button akismet-is-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet' ); ?></a></p>
  50. </div>
  51. <?php } else { // ask do they want to use akismet account found using jetpack wpcom connection ?>
  52. <div class="akismet-box">
  53. <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
  54. <p><?php esc_html_e( 'Use your Jetpack connection to activate Akismet.', 'akismet' ); ?></p>
  55. <form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="akismet-right">
  56. <input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
  57. <input type="hidden" name="action" value="enter-key">
  58. <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
  59. <input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>"/>
  60. </form>
  61. <?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
  62. <p><?php echo sprintf( esc_html( __( 'You are connected as %s.', 'akismet' ) ), '<b>' . esc_html( $akismet_user->user_login ) . '</b>' ); ?><br /><span class="akismet-jetpack-email"><?php echo esc_html( $akismet_user->user_email ); ?></span></p>
  63. </div>
  64. <?php } ?>
  65. <div class="akismet-box">
  66. <h3><?php esc_html_e( 'Or sign up with a different email address', 'akismet' ); ?></h3>
  67. <div class="akismet-right">
  68. <?php Akismet::view( 'get', array( 'text' => __( 'Sign up with a different email address' , 'akismet' ), 'classes' => array( 'akismet-button' ) ) ); ?>
  69. </div>
  70. <p><?php esc_html_e( 'Choose this option to use Akismet independently of your Jetpack connection.', 'akismet' ); ?></p>
  71. </div>
  72. <?php } else { ?>
  73. <div class="akismet-box">
  74. <h3><?php esc_html_e( 'Activate Akismet' , 'akismet' );?></h3>
  75. <div class="akismet-right">
  76. <?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet' ), 'classes' => array( 'akismet-button', 'akismet-is-primary' ) ) ); ?>
  77. </div>
  78. <p><?php esc_html_e( 'Log in or sign up now.', 'akismet' ); ?></p>
  79. </div>
  80. <?php } ?>
  81. <div class="akismet-box">
  82. <h3><?php esc_html_e( 'Or enter an API key', 'akismet' ); ?></h3>
  83. <p><?php esc_html_e( 'Already have your key? Enter it here.', 'akismet' ); ?> <a href="https://docs.akismet.com/getting-started/api-key/" target="_blank"><?php esc_html_e( '(What is an API key?)', 'akismet' ); ?></a></p>
  84. <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post">
  85. <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
  86. <input type="hidden" name="action" value="enter-key">
  87. <p style="width: 100%; display: flex; flex-wrap: nowrap; box-sizing: border-box;">
  88. <input id="key" name="key" type="text" size="15" value="" class="regular-text code" style="flex-grow: 1; margin-right: 1rem;">
  89. <input type="submit" name="submit" id="submit" class="akismet-button" value="<?php esc_attr_e( 'Connect with API key', 'akismet' );?>">
  90. </p>
  91. </form>
  92. </div>
  93. <?php } else { ?>
  94. <div class="akismet-box">
  95. <h2><?php esc_html_e( 'Manual Configuration', 'akismet' ); ?></h2>
  96. <p><?php echo sprintf( esc_html__( 'An Akismet API key has been defined in the %s file for this site.', 'akismet' ), '<code>wp-config.php</code>' ); ?></p>
  97. </div>
  98. <?php } ?>
  99. </div>
  100. </div>
  101. </div>