/**
  * Generates the data for the sections of the email content.
  *
  * @author Leo Fajardo (@leorw)
  * @since  1.1.2
  *
  * @return array
  */
 private function get_email_sections()
 {
     self::require_pluggable_essentials();
     // Retrieve the current user's information so that we can get the user's email, first name, and last name below.
     $current_user = wp_get_current_user();
     // Retrieve the cURL version information so that we can get the version number below.
     $curl_version_information = curl_version();
     $active_plugin = $this->get_active_plugins();
     // Generate the list of active plugins separated by new line.
     $active_plugin_string = '';
     foreach ($active_plugin as $plugin) {
         $active_plugin_string .= sprintf('<a href="%s">%s</a> [v%s]<br>', $plugin['PluginURI'], $plugin['Name'], $plugin['Version']);
     }
     $server_ip = fs_get_ip();
     // Generate the default email sections.
     $sections = array('sdk' => array('title' => 'SDK', 'rows' => array('fs_version' => array('FS Version', $this->version), 'curl_version' => array('cURL Version', $curl_version_information['version']))), 'plugin' => array('title' => 'Plugin', 'rows' => array('name' => array('Name', $this->get_plugin_name()), 'version' => array('Version', $this->get_plugin_version()))), 'site' => array('title' => 'Site', 'rows' => array('address' => array('Address', site_url()), 'host' => array('HTTP_HOST', !empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''), 'server_addr' => array('SERVER_ADDR', '<a href="http://www.projecthoneypot.org/ip_' . $server_ip . '">' . $server_ip . '</a>'))), 'user' => array('title' => 'User', 'rows' => array('email' => array('Email', $current_user->user_email), 'first' => array('First', $current_user->user_firstname), 'last' => array('Last', $current_user->user_lastname))), 'plugins' => array('title' => 'Plugins', 'rows' => array('active_plugins' => array('Active Plugins', $active_plugin_string))));
     // Allow the sections to be modified by other code.
     $sections = $this->apply_filters('email_template_sections', $sections);
     return $sections;
 }
Esempio n. 2
0
    ?>
				<button class="button button-primary" tabindex="1"
				        type="submit"><?php 
    _efs('opt-in-connect');
    ?>
					&nbsp;&#10140;</button>
			</form>
		<?php 
} else {
    ?>
			<form method="post" action="<?php 
    echo WP_FS__ADDRESS;
    ?>
/action/service/user/install/">
				<?php 
    $params = array('user_firstname' => $current_user->user_firstname, 'user_lastname' => $current_user->user_lastname, 'user_nickname' => $current_user->user_nicename, 'user_email' => $current_user->user_email, 'user_ip' => fs_get_ip(), 'plugin_slug' => $slug, 'plugin_id' => $fs->get_id(), 'plugin_public_key' => $fs->get_public_key(), 'plugin_version' => $fs->get_plugin_version(), 'return_url' => wp_nonce_url($fs->_get_admin_page_url('', array('fs_action' => $slug . '_activate_new')), $slug . '_activate_new'), 'account_url' => wp_nonce_url($fs->_get_admin_page_url('account', array('fs_action' => 'sync_user')), 'sync_user'), 'site_uid' => $fs->get_anonymous_id(), 'site_url' => get_site_url(), 'site_name' => get_bloginfo('name'), 'platform_version' => get_bloginfo('version'), 'php_version' => phpversion(), 'language' => get_bloginfo('language'), 'charset' => get_bloginfo('charset'));
    if (WP_FS__SKIP_EMAIL_ACTIVATION && $fs->has_secret_key()) {
        // Even though rand() is known for its security issues,
        // the timestamp adds another layer of protection.
        // It would be very hard for an attacker to get the secret key form here.
        // Plus, this should never run in production since the secret should never
        // be included in the production version.
        $params['ts'] = WP_FS__SCRIPT_START_TIME;
        $params['salt'] = md5(uniqid(rand()));
        $params['secure'] = md5($params['ts'] . $params['salt'] . $fs->get_secret_key());
    }
    ?>
				<?php 
    foreach ($params as $name => $value) {
        ?>
					<input type="hidden" name="<?php 
Esempio n. 3
0
    define('WP_FS__DOMAIN_LOCALHOST', 'wp.freemius');
}
if (!defined('WP_FS__ADDRESS_LOCALHOST')) {
    define('WP_FS__ADDRESS_LOCALHOST', 'http://' . WP_FS__DOMAIN_LOCALHOST . ':8080');
}
if (!defined('WP_FS__TESTING_DOMAIN')) {
    define('WP_FS__TESTING_DOMAIN', 'fswp');
}
if (!defined('WP_FS__API_ADDRESS_LOCALHOST')) {
    define('WP_FS__API_ADDRESS_LOCALHOST', 'http://api.freemius:8080');
}
if (!defined('WP_FS__API_SANDBOX_ADDRESS_LOCALHOST')) {
    define('WP_FS__API_SANDBOX_ADDRESS_LOCALHOST', 'http://sandbox-api.freemius:8080');
}
define('WP_FS__IS_HTTP_REQUEST', isset($_SERVER['HTTP_HOST']));
define('WP_FS__REMOTE_ADDR', fs_get_ip());
if (!defined('WP_FS__IS_PRODUCTION_MODE')) {
    // By default, run with Freemius production servers.
    define('WP_FS__IS_PRODUCTION_MODE', true);
}
define('WP_FS__ADDRESS', WP_FS__IS_PRODUCTION_MODE ? WP_FS__ADDRESS_PRODUCTION : WP_FS__ADDRESS_LOCALHOST);
if (defined('WP_FS__LOCALHOST_IP')) {
    define('WP_FS__IS_LOCALHOST', WP_FS__LOCALHOST_IP === WP_FS__REMOTE_ADDR);
} else {
    define('WP_FS__IS_LOCALHOST', WP_FS__IS_HTTP_REQUEST && is_string(WP_FS__REMOTE_ADDR) && (substr(WP_FS__REMOTE_ADDR, 0, 4) == '127.' || WP_FS__REMOTE_ADDR == '::1'));
}
define('WP_FS__IS_LOCALHOST_FOR_SERVER', !WP_FS__IS_HTTP_REQUEST || false !== strpos($_SERVER['HTTP_HOST'], 'localhost'));
// Set API address for local testing.
if (!WP_FS__IS_PRODUCTION_MODE) {
    define('FS_API__ADDRESS', WP_FS__API_ADDRESS_LOCALHOST);
    define('FS_API__SANDBOX_ADDRESS', WP_FS__API_SANDBOX_ADDRESS_LOCALHOST);