echo cnSystem_Info::describeTable(CN_ENTRY_TABLE_META);
?>

DESCRIBE <?php 
echo CN_TERMS_TABLE . PHP_EOL;
echo cnSystem_Info::describeTable(CN_TERMS_TABLE);
?>

DESCRIBE <?php 
echo CN_TERM_TAXONOMY_TABLE . PHP_EOL;
echo cnSystem_Info::describeTable(CN_TERM_TAXONOMY_TABLE);
?>

DESCRIBE <?php 
echo CN_TERM_RELATIONSHIP_TABLE . PHP_EOL;
echo cnSystem_Info::describeTable(CN_TERM_RELATIONSHIP_TABLE);
?>

-- Connections Folder Permissions

Image Path Exists:          <?php 
echo cnFormatting::toYesNo(is_dir(CN_IMAGE_PATH)) . PHP_EOL;
?>
Image Path Writeable:       <?php 
echo cnFormatting::toYesNo(is_writeable(CN_IMAGE_PATH)) . PHP_EOL;
?>

Template Path Exists:       <?php 
echo cnFormatting::toYesNo(is_dir(CN_CUSTOM_TEMPLATE_PATH)) . PHP_EOL;
?>
Template Path Writeable:    <?php 
 /**
  * AJAX callback to email the system info.
  *
  * @access private
  * @since  8.3
  * @static
  */
 public static function emailSystemInfo()
 {
     $form = new cnFormObjects();
     check_ajax_referer($form->getNonce('email_system_info'), 'nonce');
     if (!current_user_can('manage_options')) {
         wp_send_json(-2);
     }
     /**
      * Since email is sent via an ajax request, let's check for the appropriate header.
      * @link http://davidwalsh.name/detect-ajax
      */
     if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || 'xmlhttprequest' != strtolower($_SERVER['HTTP_X_REQUESTED_WITH'])) {
         wp_send_json(-3);
     }
     $user = wp_get_current_user();
     $atts = array('from_email' => $user->user_email, 'from_name' => $user->display_name, 'to_email' => $_POST['email'], 'subject' => $_POST['subject'], 'message' => $_POST['message']);
     $response = cnSystem_Info::email($atts);
     if ($response) {
         // Success, send success code.
         wp_send_json(1);
     } else {
         /** @var PHPMailer $phpmailer */
         global $phpmailer;
         wp_send_json($phpmailer->ErrorInfo);
     }
 }
示例#3
0
    /**
     * Callback to display the system info.
     *
     * @access public
     * @since  8.3
     * @static
     *
     * @uses   do_action()
     * @uses   _e()
     * @uses   esc_url()
     * @uses   self_admin_url()
     * @uses   cnSystem_Info::display()
     * @uses   wp_nonce_field()
     */
    public static function systemInfo()
    {
        /**
         * Run before the display of the system info
         *
         * @since 8.3
         */
        do_action('cn_tools_system_before');
        ?>

		<div class="postbox">
			<h3><span><?php 
        _e('System Information', 'connections');
        ?>
</span></h3>

			<div class="inside">

					<textarea readonly="readonly" onclick="this.focus();this.select()"
					          name="cn-system-info"
					          title="<?php 
        _e('To copy the System Info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'connections');
        ?>
"
					          style="display: block; width: 100%; height: 500px; font-family: 'Consolas', 'Monaco', monospace; white-space: pre; overflow: auto;">
<?php 
        // Non standard indentation needed for plain-text display.
        cnSystem_Info::display();
        ?>
					</textarea>

				<?php 
        // Form used to download .txt file
        ?>
				<form method="post" enctype="multipart/form-data" action="<?php 
        echo esc_url(self_admin_url('admin-ajax.php'));
        ?>
">
					<input type="hidden" name="action" value="download_system_info"/>
					<?php 
        wp_nonce_field('download_system_info');
        ?>
					<?php 
        submit_button(__('Download System Info as Text File', 'connections'), 'secondary', 'submit');
        ?>
				</form>
			</div><!-- .inside -->
		</div><!-- .postbox -->

		<?php 
        wp_enqueue_script('cn-system-info');
        /**
         * Run after the display of the system info.
         *
         * @since 8.3
         */
        do_action('cn_tools_system_after');
    }