docs-and-support.php
364 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Docs and Support page template. |
| 4 | * |
| 5 | * @package wp2fa |
| 6 | * @subpackage admin |
| 7 | * @copyright 2026 Melapress |
| 8 | * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 |
| 9 | * @link https://wordpress.org/plugins/wp-2fa/ |
| 10 | * @since 4.1.0 |
| 11 | */ |
| 12 | |
| 13 | declare( strict_types=1 ); |
| 14 | |
| 15 | if ( ! defined( 'ABSPATH' ) ) { |
| 16 | exit; |
| 17 | } |
| 18 | |
| 19 | use WP2FA\Admin\Helpers\WP_Helper; |
| 20 | ?> |
| 21 | |
| 22 | <style> |
| 23 | /* ── Docs and Support page ─────────────────────────────── */ |
| 24 | /* .mp-support-wrap { |
| 25 | max-width: 1200px; |
| 26 | margin: 30px auto; |
| 27 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; |
| 28 | } */ |
| 29 | |
| 30 | /* Main layout: content + sidebar */ |
| 31 | .mp-support-layout { |
| 32 | display: grid; |
| 33 | /* grid-template-columns: 1fr 320px; */ |
| 34 | gap: 28px; |
| 35 | margin-bottom: 24px; |
| 36 | } |
| 37 | |
| 38 | /* Content area (left) */ |
| 39 | /* .mp-support-content { |
| 40 | background: #fff; |
| 41 | border: 1px solid #dcdcde; |
| 42 | border-radius: 8px; |
| 43 | padding: 28px 24px; |
| 44 | } |
| 45 | .mp-support-content h2 { |
| 46 | margin: 0 0 14px; |
| 47 | font-size: 22px; |
| 48 | font-weight: 600; |
| 49 | color: #1d2327; |
| 50 | } |
| 51 | .mp-support-content h3 { |
| 52 | margin: 18px 0 10px; |
| 53 | font-size: 15px; |
| 54 | font-weight: 600; |
| 55 | color: #1d2327; |
| 56 | } |
| 57 | .mp-support-content ul { |
| 58 | margin: 0 0 16px; |
| 59 | padding: 0; |
| 60 | list-style: none; |
| 61 | } |
| 62 | .mp-support-content ul li { |
| 63 | margin-bottom: 6px; |
| 64 | } |
| 65 | .mp-support-content ul li a { |
| 66 | color: #2271b1; |
| 67 | text-decoration: none; |
| 68 | font-size: 14px; |
| 69 | } |
| 70 | .mp-support-content ul li a:hover { |
| 71 | color: #135e96; |
| 72 | text-decoration: underline; |
| 73 | } |
| 74 | .mp-support-content .mp-video-embed { |
| 75 | margin-top: 16px; |
| 76 | } |
| 77 | .mp-support-content .mp-video-embed iframe { |
| 78 | width: 100%; |
| 79 | max-width: 560px; |
| 80 | height: 315px; |
| 81 | border: none; |
| 82 | border-radius: 6px; |
| 83 | } */ |
| 84 | |
| 85 | /* Two-column cards row */ |
| 86 | .mp-support-cards { |
| 87 | display: grid; |
| 88 | grid-template-columns: repeat(2, 1fr); |
| 89 | gap: 24px; |
| 90 | margin-bottom: 24px; |
| 91 | } |
| 92 | .mp-support-card { |
| 93 | background: #fff; |
| 94 | border: 1px solid #dcdcde; |
| 95 | border-radius: 8px; |
| 96 | padding: 28px 24px; |
| 97 | display: flex; |
| 98 | flex-direction: column; |
| 99 | justify-content: space-between; |
| 100 | } |
| 101 | .mp-support-card h3 { |
| 102 | margin: 0 0 10px; |
| 103 | font-size: 16px; |
| 104 | font-weight: 600; |
| 105 | color: #1d2327; |
| 106 | } |
| 107 | .mp-support-card p { |
| 108 | margin: 0 0 18px; |
| 109 | font-size: 13px; |
| 110 | line-height: 1.5; |
| 111 | color: #646970; |
| 112 | } |
| 113 | .mp-support-card-buttons { |
| 114 | display: flex; |
| 115 | gap: 10px; |
| 116 | flex-wrap: wrap; |
| 117 | } |
| 118 | |
| 119 | /* System info togglable card */ |
| 120 | .mp-support-sysinfo { |
| 121 | background: #fff; |
| 122 | border: 1px solid #dcdcde; |
| 123 | border-radius: 8px; |
| 124 | overflow: hidden; |
| 125 | } |
| 126 | .mp-support-sysinfo-header { |
| 127 | display: flex; |
| 128 | align-items: center; |
| 129 | justify-content: space-between; |
| 130 | padding: 20px 24px; |
| 131 | cursor: pointer; |
| 132 | user-select: none; |
| 133 | } |
| 134 | .mp-support-sysinfo-header:hover { |
| 135 | background: #f9f9f9; |
| 136 | } |
| 137 | .mp-support-sysinfo-header h3 { |
| 138 | margin: 0; |
| 139 | font-size: 16px; |
| 140 | font-weight: 600; |
| 141 | color: #1d2327; |
| 142 | } |
| 143 | .mp-support-sysinfo-toggle { |
| 144 | width: 24px; |
| 145 | height: 24px; |
| 146 | transition: transform 0.2s ease; |
| 147 | display: flex; |
| 148 | align-items: center; |
| 149 | justify-content: center; |
| 150 | } |
| 151 | .mp-support-sysinfo-toggle .dashicons { |
| 152 | font-size: 20px; |
| 153 | width: 20px; |
| 154 | height: 20px; |
| 155 | color: #646970; |
| 156 | } |
| 157 | .mp-support-sysinfo.open .mp-support-sysinfo-toggle { |
| 158 | transform: rotate(180deg); |
| 159 | } |
| 160 | .mp-support-sysinfo-body { |
| 161 | display: none; |
| 162 | padding: 0 24px 24px; |
| 163 | } |
| 164 | .mp-support-sysinfo.open .mp-support-sysinfo-body { |
| 165 | display: block; |
| 166 | } |
| 167 | #system-info-textarea { |
| 168 | width: 100%; |
| 169 | height: 300px; |
| 170 | font-family: monospace; |
| 171 | font-size: 12px; |
| 172 | padding: 12px; |
| 173 | border: 1px solid #dcdcde; |
| 174 | border-radius: 4px; |
| 175 | background: #f6f7f7; |
| 176 | resize: vertical; |
| 177 | box-sizing: border-box; |
| 178 | } |
| 179 | |
| 180 | /* Hero / intro section */ |
| 181 | .mp-about-hero { |
| 182 | display: flex; |
| 183 | gap: 0; |
| 184 | background: #f0f0f0; |
| 185 | border-radius: 8px; |
| 186 | overflow: hidden; |
| 187 | margin-bottom: 24px; |
| 188 | background: #fff; |
| 189 | border: 1px solid #dcdcde; |
| 190 | border-radius: 8px; |
| 191 | padding: 28px 24px; |
| 192 | } |
| 193 | .mp-about-hero-text { |
| 194 | flex: 1; |
| 195 | padding: 0 2px; |
| 196 | } |
| 197 | .mp-about-hero-text h2 { |
| 198 | margin: 0 0 14px; |
| 199 | font-size: 22px; |
| 200 | font-weight: 600; |
| 201 | color: #1d2327; |
| 202 | } |
| 203 | .mp-about-hero-text h2.left-title { |
| 204 | padding: 2px 0px 40px 0; |
| 205 | } |
| 206 | .mp-about-hero-text p { |
| 207 | margin: 0; |
| 208 | font-size: 14px; |
| 209 | line-height: 1.6; |
| 210 | color: #3c434a; |
| 211 | } |
| 212 | .mp-about-hero-video { |
| 213 | flex: 1; |
| 214 | display: flex; |
| 215 | align-items: center; |
| 216 | /* justify-content: center; |
| 217 | background: #e8e8e8; |
| 218 | padding: 40px 30px; */ |
| 219 | border: 1px solid #dcdcde; |
| 220 | border-radius: 8px; |
| 221 | } |
| 222 | .mp-about-hero-video iframe { |
| 223 | width: 100%; |
| 224 | height: 100%; |
| 225 | border: 1px solid #dcdcde; |
| 226 | border-radius: 22px; |
| 227 | } |
| 228 | |
| 229 | |
| 230 | /* ── Responsive ──────────────────────────────────────── */ |
| 231 | @media screen and (max-width: 960px) { |
| 232 | .mp-support-layout { |
| 233 | grid-template-columns: 1fr; |
| 234 | } |
| 235 | } |
| 236 | @media screen and (max-width: 782px) { |
| 237 | .mp-support-cards { |
| 238 | grid-template-columns: 1fr; |
| 239 | } |
| 240 | } |
| 241 | @media screen and (max-width: 600px) { |
| 242 | .mp-support-wrap { |
| 243 | margin: 16px; |
| 244 | } |
| 245 | } |
| 246 | @media screen and (max-width: 782px) { |
| 247 | .mp-about-hero { |
| 248 | flex-direction: column; |
| 249 | } |
| 250 | .mp-about-hero-text, |
| 251 | .mp-about-hero-logo { |
| 252 | padding: 28px 24px; |
| 253 | } |
| 254 | } |
| 255 | </style> |
| 256 | |
| 257 | |
| 258 | <div class="main-settings-new"> |
| 259 | <div class="wrap main-left"> |
| 260 | |
| 261 | <div class="mp-about-hero"> |
| 262 | <div class="mp-about-hero-text"> |
| 263 | <h2 class="left-title"><?php \esc_html_e( 'Docs and Support', 'wp-2fa' ); ?></h2> |
| 264 | |
| 265 | <h3><?php \esc_html_e( 'Getting started', 'wp-2fa' ); ?></h3> |
| 266 | <ul> |
| 267 | <li> |
| 268 | <a href="<?php echo \esc_url( 'https://melapress.com/support/kb/wp-2fa-plugin-getting-started/?&utm_source=plugin&utm_medium=wp2fa&utm_campaign=getting_started_help' ); ?>" target="_blank"> |
| 269 | <?php \esc_html_e( 'Getting started with WP 2FA', 'wp-2fa' ); ?> |
| 270 | </a> |
| 271 | </li> |
| 272 | <li> |
| 273 | <a href="<?php echo \esc_url( 'https://melapress.com/support/kb/wp-2fa-configure-2fa-policies-enforce/?&utm_source=plugin&utm_medium=wp2fa&utm_campaign=configure_policies_help' ); ?>" target="_blank"> |
| 274 | <?php \esc_html_e( 'Configuring 2FA policies & making 2FA mandatory', 'wp-2fa' ); ?> |
| 275 | </a> |
| 276 | </li> |
| 277 | <li> |
| 278 | <a href="<?php echo \esc_url( 'https://melapress.com/support/kb/wp-2fa-configure-2fa-front-end-page-wordpress/?&utm_source=plugin&utm_medium=wp2fa&utm_campaign=no_dashboard_page_help' ); ?>" target="_blank"> |
| 279 | <?php \esc_html_e( 'Allowing users to configure 2FA from a website page (no dashboard access)', 'wp-2fa' ); ?> |
| 280 | </a> |
| 281 | </li> |
| 282 | </ul> |
| 283 | </div> |
| 284 | <div class="mp-about-hero-video"> |
| 285 | <iframe src="https://www.youtube.com/embed/vRlX_NNGeFo" title="<?php \esc_attr_e( 'Getting started with WP 2FA', 'wp-2fa' ); ?>" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> |
| 286 | </div> |
| 287 | </div> |
| 288 | |
| 289 | <!-- Two-column cards: Plugin documentation + Plugin Support --> |
| 290 | <div class="mp-support-cards"> |
| 291 | |
| 292 | <!-- Plugin documentation --> |
| 293 | <div class="mp-support-card"> |
| 294 | <div> |
| 295 | <h3><?php \esc_html_e( 'Plugin documentation', 'wp-2fa' ); ?></h3> |
| 296 | <p><?php \esc_html_e( 'For more technical information about the WP 2FA plugin please visit the plugin\'s knowledge base.', 'wp-2fa' ); ?></p> |
| 297 | </div> |
| 298 | <div class="mp-support-card-buttons"> |
| 299 | <a href="<?php echo \esc_url( 'https://melapress.com/support/kb/?utm_source=plugin&utm_medium=wp2fa&utm_campaign=technical_help' ); ?>" class="mp-about-btn-filled" target="_blank"> |
| 300 | <?php \esc_html_e( 'Go to knowledge base', 'wp-2fa' ); ?> |
| 301 | </a> |
| 302 | </div> |
| 303 | </div> |
| 304 | |
| 305 | <!-- Plugin Support --> |
| 306 | <div class="mp-support-card"> |
| 307 | <div> |
| 308 | <h3><?php \esc_html_e( 'Plugin Support', 'wp-2fa' ); ?></h3> |
| 309 | <p><?php \esc_html_e( 'Do you need assistance with the plugin? Have you noticed or encountered an issue while using WP 2FA, or do you just want to report something to us?', 'wp-2fa' ); ?></p> |
| 310 | </div> |
| 311 | <div class="mp-support-card-buttons"> |
| 312 | <a href="<?php echo \esc_url( 'https://melapress.com/support/submit-ticket/?utm_source=plugin&utm_medium=wp2fa&utm_campaign=suppor_ticket' ); ?>" class="mp-about-btn-filled" target="_blank"> |
| 313 | <?php \esc_html_e( 'Open Support ticket', 'wp-2fa' ); ?> |
| 314 | </a> |
| 315 | <a href="<?php echo \esc_url( 'https://melapress.com/contact/?utm_source=plugin&utm_medium=link&utm_campaign=contact_us' ); ?>" class="mp-about-btn-outline" target="_blank"> |
| 316 | <?php \esc_html_e( 'Contact us', 'wp-2fa' ); ?> |
| 317 | </a> |
| 318 | </div> |
| 319 | </div> |
| 320 | |
| 321 | </div> |
| 322 | |
| 323 | <!-- System info toggleable card --> |
| 324 | <div class="mp-support-sysinfo open" id="mp-sysinfo-toggle"> |
| 325 | <div class="mp-support-sysinfo-header" onclick="document.getElementById('mp-sysinfo-toggle').classList.toggle('open');"> |
| 326 | <h3><?php \esc_html_e( 'System info', 'wp-2fa' ); ?></h3> |
| 327 | <div class="mp-support-sysinfo-toggle"> |
| 328 | <span class="dashicons dashicons-arrow-down-alt2"></span> |
| 329 | </div> |
| 330 | </div> |
| 331 | <div class="mp-support-sysinfo-body"> |
| 332 | <form method="post" dir="ltr"> |
| 333 | <textarea readonly="readonly" onclick="this.focus(); this.select()" id="system-info-textarea" name="wsal-sysinfo"><?php echo \esc_textarea( \WP2FA\Admin\Help_Contact_Us::get_sysinfo() ); ?></textarea> |
| 334 | <p class="submit"> |
| 335 | <input type="hidden" name="ppmwp-action" value="download_sysinfo" /> |
| 336 | <button type="button" class="mp-about-btn-filled" id="wp2fa-download-sysinfo"><?php \esc_html_e( 'Download System Info File', 'wp-2fa' ); ?></button> |
| 337 | </p> |
| 338 | </form> |
| 339 | <script> |
| 340 | function wp2faDownloadSysinfo(filename, text) { |
| 341 | var element = document.createElement('a'); |
| 342 | element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); |
| 343 | element.setAttribute('download', filename); |
| 344 | element.style.display = 'none'; |
| 345 | document.body.appendChild(element); |
| 346 | element.click(); |
| 347 | document.body.removeChild(element); |
| 348 | } |
| 349 | jQuery( document ).ready( function() { |
| 350 | jQuery( '#wp2fa-download-sysinfo' ).on( 'click', function( event ) { |
| 351 | event.preventDefault(); |
| 352 | wp2faDownloadSysinfo( 'wp2fa-system-info.txt', jQuery( '#system-info-textarea' ).val() ); |
| 353 | } ); |
| 354 | } ); |
| 355 | </script> |
| 356 | </div> |
| 357 | </div> |
| 358 | |
| 359 | </div> |
| 360 | |
| 361 | <?php include WP_2FA_PATH . 'includes/classes/Admin/Settings/templates/sidebar.php'; ?> |
| 362 | </div> |
| 363 | |
| 364 |