| 1 |
<?php |
| 2 |
/** |
| 3 |
* Settings > Tools view |
| 4 |
* |
| 5 |
* @package ConvertKit |
| 6 |
* @author ConvertKit |
| 7 |
*/ |
| 8 |
|
| 9 |
?> |
| 10 |
<div class="metabox-holder"> |
| 11 |
<div id="debug-log" class="postbox"> |
| 12 |
<h2><?php esc_html_e( 'Debug Log', 'convertkit' ); ?></h2> |
| 13 |
<p class="description"> |
| 14 |
<?php esc_html_e( 'Use this tool to help debug Kit plugin functionality.', 'convertkit' ); ?><br /> |
| 15 |
<?php esc_html_e( 'For performance, the last 500 lines of the log are displayed. Use the Download Log option to review the full log.', 'convertkit' ); ?><br /> |
| 16 |
</p> |
| 17 |
|
| 18 |
<textarea readonly="readonly" id="debug-log-textarea" class="large-text convertkit-monospace" rows="15"><?php echo esc_textarea( $log->read() ); ?></textarea> |
| 19 |
|
| 20 |
<?php |
| 21 |
if ( $log->exists() ) { |
| 22 |
?> |
| 23 |
<p> |
| 24 |
<?php |
| 25 |
submit_button( |
| 26 |
__( 'Download log', 'convertkit' ), |
| 27 |
'primary', |
| 28 |
'convertkit-download-debug-log', |
| 29 |
false |
| 30 |
); |
| 31 |
?> |
| 32 |
<input type="submit" name="convertkit-clear-debug-log" id="convertkit-clear-debug-log" class="button button-secondary" value="<?php esc_attr_e( 'Clear log', 'convertkit' ); ?>" /> |
| 33 |
</p> |
| 34 |
<p><?php esc_html_e( 'Log file', 'convertkit' ); ?>: <code><?php echo esc_attr( $log->get_filename() ); ?></code></p> |
| 35 |
<?php |
| 36 |
} |
| 37 |
?> |
| 38 |
</div><!-- .postbox --> |
| 39 |
|
| 40 |
<div id="system-info" class="postbox"> |
| 41 |
<h2><?php esc_html_e( 'System Info', 'convertkit' ); ?></h2> |
| 42 |
<p class="description"><?php esc_html_e( 'Use this tool to send system info to support when necessary.', 'convertkit' ); ?></p> |
| 43 |
|
| 44 |
<textarea readonly="readonly" id="system-info-textarea" class="large-text convertkit-monospace" rows="15"><?php echo esc_textarea( $system_info ); ?></textarea> |
| 45 |
|
| 46 |
<p> |
| 47 |
<?php |
| 48 |
submit_button( |
| 49 |
__( 'Download system info', 'convertkit' ), |
| 50 |
'primary', |
| 51 |
'convertkit-download-system-info', |
| 52 |
false |
| 53 |
); |
| 54 |
?> |
| 55 |
</p> |
| 56 |
</div><!-- .postbox --> |
| 57 |
|
| 58 |
<div id="export" class="postbox"> |
| 59 |
<h2><?php esc_html_e( 'Export Configuration', 'convertkit' ); ?></h2> |
| 60 |
|
| 61 |
<p class="description"> |
| 62 |
<?php esc_html_e( 'Downloads this plugin\'s configuration as a JSON file.', 'convertkit' ); ?><br /> |
| 63 |
<strong> |
| 64 |
<?php esc_html_e( 'This file includes sensitive API credentials. Use with caution.', 'convertkit' ); ?> |
| 65 |
</strong> |
| 66 |
</p> |
| 67 |
|
| 68 |
<p> |
| 69 |
<?php |
| 70 |
submit_button( |
| 71 |
__( 'Export', 'convertkit' ), |
| 72 |
'primary', |
| 73 |
'convertkit-export', |
| 74 |
false |
| 75 |
); |
| 76 |
?> |
| 77 |
</p> |
| 78 |
</div><!-- .postbox --> |
| 79 |
|
| 80 |
<div id="import" class="postbox"> |
| 81 |
<h2><?php esc_html_e( 'Import Configuration', 'convertkit' ); ?></h2> |
| 82 |
|
| 83 |
<p class="description"> |
| 84 |
<?php esc_html_e( 'Imports a configuration file generated by this plugin.', 'convertkit' ); ?><br /> |
| 85 |
<strong> |
| 86 |
<?php esc_html_e( 'This will overwrite any existing settings stored on this installation.', 'convertkit' ); ?><br /> |
| 87 |
</strong> |
| 88 |
</p> |
| 89 |
|
| 90 |
<input type="file" name="import" /> |
| 91 |
|
| 92 |
<p> |
| 93 |
<?php |
| 94 |
submit_button( |
| 95 |
__( 'Import', 'convertkit' ), |
| 96 |
'primary', |
| 97 |
'convertkit-import', |
| 98 |
false |
| 99 |
); |
| 100 |
?> |
| 101 |
</p> |
| 102 |
</div><!-- .postbox --> |
| 103 |
|
| 104 |
<?php |
| 105 |
// Importers. |
| 106 |
foreach ( $importers as $importer ) { |
| 107 |
?> |
| 108 |
<div id="import-<?php echo esc_attr( $importer['name'] ); ?>" class="postbox"> |
| 109 |
<h2> |
| 110 |
<?php |
| 111 |
printf( |
| 112 |
/* translators: %s: Importer title */ |
| 113 |
esc_html__( '%s: Migrate Configuration', 'convertkit' ), |
| 114 |
esc_html( $importer['title'] ) |
| 115 |
); |
| 116 |
?> |
| 117 |
</h2> |
| 118 |
|
| 119 |
<p class="description"> |
| 120 |
<?php |
| 121 |
if ( ! empty( $importer['description'] ) ) { |
| 122 |
echo esc_html( $importer['description'] ); |
| 123 |
} else { |
| 124 |
printf( |
| 125 |
/* translators: %s: Importer title */ |
| 126 |
esc_html__( 'Automatically replace %s form shortcodes and blocks with Kit form shortcodes and blocks.', 'convertkit' ), |
| 127 |
esc_html( $importer['title'] ) |
| 128 |
); |
| 129 |
} |
| 130 |
?> |
| 131 |
<br /> |
| 132 |
</p> |
| 133 |
|
| 134 |
<table class="widefat striped"> |
| 135 |
<thead> |
| 136 |
<tr> |
| 137 |
<th> |
| 138 |
<?php |
| 139 |
printf( |
| 140 |
/* translators: %s: Importer title */ |
| 141 |
esc_html__( '%s Form', 'convertkit' ), |
| 142 |
esc_html( $importer['title'] ) |
| 143 |
); |
| 144 |
?> |
| 145 |
</th> |
| 146 |
<th><?php esc_html_e( 'Kit Form', 'convertkit' ); ?></th> |
| 147 |
</tr> |
| 148 |
</thead> |
| 149 |
<tbody> |
| 150 |
<?php |
| 151 |
foreach ( $importer['forms'] as $importer_form_id => $importer_form_title ) { |
| 152 |
?> |
| 153 |
<tr> |
| 154 |
<td><?php echo esc_html( $importer_form_title ); ?></td> |
| 155 |
<td> |
| 156 |
<select name="_wp_convertkit_integration_<?php echo esc_attr( $importer['name'] ); ?>_settings[<?php echo esc_attr( $importer_form_id ); ?>]"> |
| 157 |
<?php |
| 158 |
foreach ( $forms->get() as $form ) { |
| 159 |
?> |
| 160 |
<option value="<?php echo esc_attr( $form['id'] ); ?>"><?php echo esc_html( $form['name'] ); ?></option> |
| 161 |
<?php |
| 162 |
} |
| 163 |
?> |
| 164 |
</select> |
| 165 |
</td> |
| 166 |
</tr> |
| 167 |
<?php |
| 168 |
} |
| 169 |
?> |
| 170 |
</tbody> |
| 171 |
</table> |
| 172 |
|
| 173 |
<p> |
| 174 |
<?php |
| 175 |
submit_button( |
| 176 |
__( 'Migrate', 'convertkit' ), |
| 177 |
'primary', |
| 178 |
'convertkit-import-' . $importer['name'], |
| 179 |
false |
| 180 |
); |
| 181 |
?> |
| 182 |
</p> |
| 183 |
</div><!-- .postbox --> |
| 184 |
<?php |
| 185 |
} |
| 186 |
|
| 187 |
wp_nonce_field( 'convertkit-settings-tools', '_convertkit_settings_tools_nonce' ); |
| 188 |
?> |
| 189 |
</div><!-- .metabox-holder --> |
| 190 |
|