Plugin Directory

Changeset 1665532


Ignore:
Timestamp:
05/26/2017 06:25:08 PM (9 years ago)
Author:
unbouncewordpress
Message:

Releasing version 1.0.34

Location:
unbounce
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • unbounce/tags/1.0.34/UBConfig.php

    r1615299 r1665532  
    66    const UB_PLUGIN_NAME           = 'ub-wordpress';
    77    const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP';
    8     const UB_USER_AGENT            = 'Unbounce WP Plugin 1.0.33';
    9     const UB_VERSION               = '1.0.33';
     8    const UB_USER_AGENT            = 'Unbounce WP Plugin 1.0.34';
     9    const UB_VERSION               = '1.0.34';
    1010
    1111  // Option keys
     
    2424    const UB_PROXY_ERROR_MESSAGE_KEY = 'ub-proxy-error-message';
    2525    const UB_ALLOW_PUBLIC_ADDRESS_X_FORWARDED_FOR = 'ub-allow-public-address-x-forwarded-for';
     26    const UB_PLUGIN_VERSION_KEY      = 'ub-plugin-version';
    2627
    2728    const UB_LOCK_NAME               = 'ub-sql-lock';
  • unbounce/tags/1.0.34/UBDiagnostics.php

    r1615299 r1665532  
    33class UBDiagnostics
    44{
    5 
    65    const SUPPORTED_PHP_VERSION = '5.3';
    76    const SUPPORTED_WP_VERSION = '4.0';
     
    1918        );
    2019    }
    21 
    2220
    2321    public static function system_checks()
     
    3634                UBDiagnostics::SUPPORTED_WP_VERSION,
    3735                '>='
    38             )
    39         );
     36            ),
     37            'SNI Support' => self::hasSNI(),
     38        );
     39    }
     40
     41    public static function hasSNI()
     42    {
     43        return defined('OPENSSL_TLSEXT_SERVER_NAME') && OPENSSL_TLSEXT_SERVER_NAME;
    4044    }
    4145
     
    6165    }
    6266
     67    /**
     68     * Format a variable as condensed human-readable output
     69     * Example: non-assoc arrays are output as [foo, bar] and assoc looks like
     70     * [
     71     *     foo: 'bar'
     72     *     baz: NULL
     73     * ]
     74     * @param mixed $var
     75     * @param int $level
     76     * @return string
     77     */
     78    private static function pp($var, $level = 1)
     79    {
     80        $str = '';
     81        if (is_array($var)) {
     82            $simple = empty($var) ? true : array_keys($var) === range(0, count($var) -1);
     83            $str .= '[';
     84            if ($simple) {
     85                $str .= implode(', ', $var);
     86            } else {
     87                foreach ($var as $key => $value) {
     88                    $str .= "\n" . str_repeat('  ', $level) . "$key: " . self::pp($value, $level + 1);
     89                }
     90            }
     91            $str .= ']';
     92        } else {
     93            $str = var_export($var, true);
     94        }
     95        return $str;
     96    }
     97
    6398    public static function details($domain, $domain_info)
    6499    {
     
    66101        'PHP Version'             => phpversion(),
    67102        'WordPress Version'       => UBDiagnostics::wordpress_version(),
    68         'Unbounce Plugin Version' => '1.0.33',
     103        'Unbounce Plugin Version' => '1.0.34',
     104        'Checks'                  => self::pp(UBDiagnostics::checks($domain, $domain_info)),
     105        'Options'                 => self::pp(UBDiagnostics::ub_options()),
    69106        'Permalink Structure'     => get_option('permalink_structure', ''),
    70107        'Domain'                  => $domain,
    71         'Domain Authorized'       => print_r(UBConfig::is_authorized_domain($domain), true),
    72         'Has Authorized'          => print_r(UBConfig::has_authorized(), true),
    73         'Active Plugins'          => print_r(get_option('active_plugins'), true),
    74         'Plugin Details'          => print_r(get_plugins(), true),
    75         'Curl Version'            => UBDiagnostics::curl_version(),
    76         'Configuration Options'   => print_r(ini_get_all(), true),
    77         'Extensions'              => print_r(get_loaded_extensions(), true),
     108        'Domain Authorized'       => self::pp(UBConfig::is_authorized_domain($domain)),
     109        'Has Authorized'          => self::pp(UBConfig::has_authorized()),
     110        'Active Plugins'          => self::pp(get_option('active_plugins')),
     111        'Plugin Details'          => self::pp(get_plugins()),
     112        'Curl Version'            => self::pp(UBDiagnostics::curl_version()),
     113        'SNI Support'             => self::hasSNI(),
     114        'Configuration Options'   => self::pp(self::phpConfig()),
     115        'Extensions'              => self::pp(get_loaded_extensions()),
    78116        'Operating System'        => php_uname(),
    79         'Checks'                  => print_r(UBDiagnostics::checks($domain, $domain_info), true),
    80         'Options'                 => print_r(UBDiagnostics::ub_options(), true)
    81         );
     117        );
     118    }
     119
     120    private static function phpConfig()
     121    {
     122        return ini_get_all(null, false);
    82123    }
    83124
     
    97138    {
    98139        if (function_exists('curl_version')) {
    99             return print_r(curl_version(), true);
     140            return curl_version();
    100141        } else {
    101142            return 'N/A';
     
    115156        return $last_status !== null && $last_status !== 'FAILURE';
    116157    }
     158
     159    /**
     160     * Perform a sitemap request with default parameters to test communication with unbounce
     161     * @return array
     162     */
     163    public static function testSiteMapRequest()
     164    {
     165        $res = UBConfig::fetch_proxyable_url_set(UBConfig::domain(), null, UBConfig::page_server_domain());
     166        if (!is_array($res) || !isset($res[0])) {
     167            return array(
     168                'status' => 'ERROR',
     169                'result' => var_export($res, true),
     170            );
     171        }
     172        return $res[0];
     173    }
     174
     175    /**
     176     * Retrieve environment details relevant at plugin activation time
     177     * @return array
     178     */
     179    public static function installationDetails()
     180    {
     181        return array(
     182            'php'                 => phpversion(),
     183            'wordpress'           => UBDiagnostics::wordpress_version(),
     184            'plugin_version'      => '1.0.34',
     185            'curl_installed'      => self::is_curl_installed(),
     186            'xml_installed'       => self::is_xml_installed(),
     187            'sni_support'         => self::hasSNI(),
     188            'permalink_structure' => get_option('permalink_structure'),
     189            'domain'              => UBConfig::domain(),
     190            'active_plugins'      => get_option('active_plugins'),
     191            'curl_version'        => UBDiagnostics::curl_version(),
     192            'php_config' => UBUtil::array_select_by_key(
     193                self::phpConfig(),
     194                array(
     195                    'allow_url_fopen', 'cgi.discard_path', 'cgi.fix_pathinfo', 'curl.cainfo', 'default_charset',
     196                    'default_socket_timeout', 'disable_functions', 'display_errors', 'error_reporting',
     197                    'enable_post_data_reading', 'file_uploads', 'implicit_flush', 'memory_limit', 'max_execution_time',
     198                    'max_input_time', 'opcache.enable', 'openssl.cafile', 'openssl.capath', 'output_buffering',
     199                    'output_encoding', 'output_handler', 'post_max_size', 'short_open_tag', 'upload_max_filesize',
     200                )
     201            ),
     202            'php_extensions'      => get_loaded_extensions(),
     203            'os'                  => php_uname(),
     204        );
     205    }
     206
     207    /**
     208     * @param string|null $previousVersion
     209     */
     210    public static function sendActivationEvent($previousVersion = null)
     211    {
     212        if (!self::is_curl_installed()) {
     213            return;
     214        }
     215
     216        $env = self::installationDetails();
     217        $sitemapRequest = self::testSiteMapRequest();
     218        $event = UBEvents::activationEvent($env, $sitemapRequest, $previousVersion);
     219        UBHTTP::send_event_to_events_gateway(UBConfig::remote_log_url(), $event);
     220    }
    117221}
  • unbounce/tags/1.0.34/UBEvents.php

    r1601650 r1665532  
    1818            UBEvents::authorization_event($data)
    1919        );
     20    }
     21
     22    /**
     23     * @param array $environment
     24     * @param array|null $sitemapRequest
     25     * @param string|null $previousVersion
     26     *
     27     * @return array
     28     */
     29    public static function activationEvent($environment, $sitemapRequest, $previousVersion = null)
     30    {
     31        $data = array('environment' => $environment, 'sitemap_request' => $sitemapRequest);
     32
     33        if ($previousVersion) {
     34            $data['previous_version'] = $previousVersion;
     35        }
     36
     37        return UBEvents::event('WordpressActivationEventV1.0', $data);
    2038    }
    2139
  • unbounce/tags/1.0.34/Unbounce-Page.php

    r1615299 r1665532  
    44Plugin URI: http://unbounce.com
    55Description: Unbounce is the most powerful standalone landing page builder available.
    6 Version: 1.0.33
     6Version: 1.0.34
    77Author: Unbounce
    88Author URI: http://unbounce.com
     
    5555    add_option(UBConfig::UB_PROXY_ERROR_MESSAGE_KEY, '');
    5656    add_option(UBConfig::UB_ALLOW_PUBLIC_ADDRESS_X_FORWARDED_FOR, 0);
     57    add_option(UBConfig::UB_PLUGIN_VERSION_KEY, UBConfig::UB_VERSION);
     58
     59    // NOTE: This should be brought back when working on BEE-1136
     60    // @UBDiagnostics::sendActivationEvent();
    5761});
    5862
     
    181185
    182186add_action('admin_init', function () {
     187
     188    // If plugin was updated, send event to unbounce
     189    $pluginVersion = get_option(UBConfig::UB_PLUGIN_VERSION_KEY);
     190    if (UBConfig::UB_VERSION != $pluginVersion) {
     191        @UBDiagnostics::sendActivationEvent($pluginVersion);
     192        update_option(UBConfig::UB_PLUGIN_VERSION_KEY, UBConfig::UB_VERSION);
     193    }
     194
    183195    UBUtil::clear_flash();
    184196
  • unbounce/tags/1.0.34/readme.txt

    r1615299 r1665532  
    44Requires at least: 4.1.5
    55Tested up to: 4.7.3
    6 Stable tag: 1.0.33
     6Stable tag: 1.0.34
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9595== Changelog ==
    9696
     97= 1.0.34 =
     98* New diagnostics entry for SSL's SNI Support on WordPress installations
     99* Better
     100
    97101= 1.0.33 =
    98102* Improved support for PHP 7.1
  • unbounce/tags/1.0.34/templates/diagnostics.php

    r1601650 r1665532  
    6060  </p>
    6161  <textarea id="ub-diagnostics-text" rows="10" cols="100">
    62     <?php
     62<?php
    6363
    64     foreach ($details as $detail_name => $detail) {
    65         echo "[${detail_name}] ${detail}\n";
    66     }
     64foreach ($details as $detail_name => $detail) {
     65    echo "[${detail_name}] ${detail}\n";
     66}
    6767
    6868    ?>
  • unbounce/tags/1.0.34/templates/main_authorized_footer.php

    r1615299 r1665532  
    2222  Click here for troubleshooting and plugin diagnostics
    2323</a>
    24 <p class="ub-version">Unbounce Version 1.0.33</p>
     24<p class="ub-version">Unbounce Version 1.0.34</p>
  • unbounce/tags/1.0.34/templates/main_unauthorized_footer.php

    r1615299 r1665532  
    55  Click here for troubleshooting and plugin diagnostics
    66</a>
    7 <p class="ub-version">Unbounce Version 1.0.33</p>
     7<p class="ub-version">Unbounce Version 1.0.34</p>
  • unbounce/trunk/UBConfig.php

    r1615299 r1665532  
    66    const UB_PLUGIN_NAME           = 'ub-wordpress';
    77    const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP';
    8     const UB_USER_AGENT            = 'Unbounce WP Plugin 1.0.33';
    9     const UB_VERSION               = '1.0.33';
     8    const UB_USER_AGENT            = 'Unbounce WP Plugin 1.0.34';
     9    const UB_VERSION               = '1.0.34';
    1010
    1111  // Option keys
     
    2424    const UB_PROXY_ERROR_MESSAGE_KEY = 'ub-proxy-error-message';
    2525    const UB_ALLOW_PUBLIC_ADDRESS_X_FORWARDED_FOR = 'ub-allow-public-address-x-forwarded-for';
     26    const UB_PLUGIN_VERSION_KEY      = 'ub-plugin-version';
    2627
    2728    const UB_LOCK_NAME               = 'ub-sql-lock';
  • unbounce/trunk/UBDiagnostics.php

    r1615299 r1665532  
    33class UBDiagnostics
    44{
    5 
    65    const SUPPORTED_PHP_VERSION = '5.3';
    76    const SUPPORTED_WP_VERSION = '4.0';
     
    1918        );
    2019    }
    21 
    2220
    2321    public static function system_checks()
     
    3634                UBDiagnostics::SUPPORTED_WP_VERSION,
    3735                '>='
    38             )
    39         );
     36            ),
     37            'SNI Support' => self::hasSNI(),
     38        );
     39    }
     40
     41    public static function hasSNI()
     42    {
     43        return defined('OPENSSL_TLSEXT_SERVER_NAME') && OPENSSL_TLSEXT_SERVER_NAME;
    4044    }
    4145
     
    6165    }
    6266
     67    /**
     68     * Format a variable as condensed human-readable output
     69     * Example: non-assoc arrays are output as [foo, bar] and assoc looks like
     70     * [
     71     *     foo: 'bar'
     72     *     baz: NULL
     73     * ]
     74     * @param mixed $var
     75     * @param int $level
     76     * @return string
     77     */
     78    private static function pp($var, $level = 1)
     79    {
     80        $str = '';
     81        if (is_array($var)) {
     82            $simple = empty($var) ? true : array_keys($var) === range(0, count($var) -1);
     83            $str .= '[';
     84            if ($simple) {
     85                $str .= implode(', ', $var);
     86            } else {
     87                foreach ($var as $key => $value) {
     88                    $str .= "\n" . str_repeat('  ', $level) . "$key: " . self::pp($value, $level + 1);
     89                }
     90            }
     91            $str .= ']';
     92        } else {
     93            $str = var_export($var, true);
     94        }
     95        return $str;
     96    }
     97
    6398    public static function details($domain, $domain_info)
    6499    {
     
    66101        'PHP Version'             => phpversion(),
    67102        'WordPress Version'       => UBDiagnostics::wordpress_version(),
    68         'Unbounce Plugin Version' => '1.0.33',
     103        'Unbounce Plugin Version' => '1.0.34',
     104        'Checks'                  => self::pp(UBDiagnostics::checks($domain, $domain_info)),
     105        'Options'                 => self::pp(UBDiagnostics::ub_options()),
    69106        'Permalink Structure'     => get_option('permalink_structure', ''),
    70107        'Domain'                  => $domain,
    71         'Domain Authorized'       => print_r(UBConfig::is_authorized_domain($domain), true),
    72         'Has Authorized'          => print_r(UBConfig::has_authorized(), true),
    73         'Active Plugins'          => print_r(get_option('active_plugins'), true),
    74         'Plugin Details'          => print_r(get_plugins(), true),
    75         'Curl Version'            => UBDiagnostics::curl_version(),
    76         'Configuration Options'   => print_r(ini_get_all(), true),
    77         'Extensions'              => print_r(get_loaded_extensions(), true),
     108        'Domain Authorized'       => self::pp(UBConfig::is_authorized_domain($domain)),
     109        'Has Authorized'          => self::pp(UBConfig::has_authorized()),
     110        'Active Plugins'          => self::pp(get_option('active_plugins')),
     111        'Plugin Details'          => self::pp(get_plugins()),
     112        'Curl Version'            => self::pp(UBDiagnostics::curl_version()),
     113        'SNI Support'             => self::hasSNI(),
     114        'Configuration Options'   => self::pp(self::phpConfig()),
     115        'Extensions'              => self::pp(get_loaded_extensions()),
    78116        'Operating System'        => php_uname(),
    79         'Checks'                  => print_r(UBDiagnostics::checks($domain, $domain_info), true),
    80         'Options'                 => print_r(UBDiagnostics::ub_options(), true)
    81         );
     117        );
     118    }
     119
     120    private static function phpConfig()
     121    {
     122        return ini_get_all(null, false);
    82123    }
    83124
     
    97138    {
    98139        if (function_exists('curl_version')) {
    99             return print_r(curl_version(), true);
     140            return curl_version();
    100141        } else {
    101142            return 'N/A';
     
    115156        return $last_status !== null && $last_status !== 'FAILURE';
    116157    }
     158
     159    /**
     160     * Perform a sitemap request with default parameters to test communication with unbounce
     161     * @return array
     162     */
     163    public static function testSiteMapRequest()
     164    {
     165        $res = UBConfig::fetch_proxyable_url_set(UBConfig::domain(), null, UBConfig::page_server_domain());
     166        if (!is_array($res) || !isset($res[0])) {
     167            return array(
     168                'status' => 'ERROR',
     169                'result' => var_export($res, true),
     170            );
     171        }
     172        return $res[0];
     173    }
     174
     175    /**
     176     * Retrieve environment details relevant at plugin activation time
     177     * @return array
     178     */
     179    public static function installationDetails()
     180    {
     181        return array(
     182            'php'                 => phpversion(),
     183            'wordpress'           => UBDiagnostics::wordpress_version(),
     184            'plugin_version'      => '1.0.34',
     185            'curl_installed'      => self::is_curl_installed(),
     186            'xml_installed'       => self::is_xml_installed(),
     187            'sni_support'         => self::hasSNI(),
     188            'permalink_structure' => get_option('permalink_structure'),
     189            'domain'              => UBConfig::domain(),
     190            'active_plugins'      => get_option('active_plugins'),
     191            'curl_version'        => UBDiagnostics::curl_version(),
     192            'php_config' => UBUtil::array_select_by_key(
     193                self::phpConfig(),
     194                array(
     195                    'allow_url_fopen', 'cgi.discard_path', 'cgi.fix_pathinfo', 'curl.cainfo', 'default_charset',
     196                    'default_socket_timeout', 'disable_functions', 'display_errors', 'error_reporting',
     197                    'enable_post_data_reading', 'file_uploads', 'implicit_flush', 'memory_limit', 'max_execution_time',
     198                    'max_input_time', 'opcache.enable', 'openssl.cafile', 'openssl.capath', 'output_buffering',
     199                    'output_encoding', 'output_handler', 'post_max_size', 'short_open_tag', 'upload_max_filesize',
     200                )
     201            ),
     202            'php_extensions'      => get_loaded_extensions(),
     203            'os'                  => php_uname(),
     204        );
     205    }
     206
     207    /**
     208     * @param string|null $previousVersion
     209     */
     210    public static function sendActivationEvent($previousVersion = null)
     211    {
     212        if (!self::is_curl_installed()) {
     213            return;
     214        }
     215
     216        $env = self::installationDetails();
     217        $sitemapRequest = self::testSiteMapRequest();
     218        $event = UBEvents::activationEvent($env, $sitemapRequest, $previousVersion);
     219        UBHTTP::send_event_to_events_gateway(UBConfig::remote_log_url(), $event);
     220    }
    117221}
  • unbounce/trunk/UBEvents.php

    r1601650 r1665532  
    1818            UBEvents::authorization_event($data)
    1919        );
     20    }
     21
     22    /**
     23     * @param array $environment
     24     * @param array|null $sitemapRequest
     25     * @param string|null $previousVersion
     26     *
     27     * @return array
     28     */
     29    public static function activationEvent($environment, $sitemapRequest, $previousVersion = null)
     30    {
     31        $data = array('environment' => $environment, 'sitemap_request' => $sitemapRequest);
     32
     33        if ($previousVersion) {
     34            $data['previous_version'] = $previousVersion;
     35        }
     36
     37        return UBEvents::event('WordpressActivationEventV1.0', $data);
    2038    }
    2139
  • unbounce/trunk/Unbounce-Page.php

    r1615299 r1665532  
    44Plugin URI: http://unbounce.com
    55Description: Unbounce is the most powerful standalone landing page builder available.
    6 Version: 1.0.33
     6Version: 1.0.34
    77Author: Unbounce
    88Author URI: http://unbounce.com
     
    5555    add_option(UBConfig::UB_PROXY_ERROR_MESSAGE_KEY, '');
    5656    add_option(UBConfig::UB_ALLOW_PUBLIC_ADDRESS_X_FORWARDED_FOR, 0);
     57    add_option(UBConfig::UB_PLUGIN_VERSION_KEY, UBConfig::UB_VERSION);
     58
     59    // NOTE: This should be brought back when working on BEE-1136
     60    // @UBDiagnostics::sendActivationEvent();
    5761});
    5862
     
    181185
    182186add_action('admin_init', function () {
     187
     188    // If plugin was updated, send event to unbounce
     189    $pluginVersion = get_option(UBConfig::UB_PLUGIN_VERSION_KEY);
     190    if (UBConfig::UB_VERSION != $pluginVersion) {
     191        @UBDiagnostics::sendActivationEvent($pluginVersion);
     192        update_option(UBConfig::UB_PLUGIN_VERSION_KEY, UBConfig::UB_VERSION);
     193    }
     194
    183195    UBUtil::clear_flash();
    184196
  • unbounce/trunk/readme.txt

    r1615299 r1665532  
    44Requires at least: 4.1.5
    55Tested up to: 4.7.3
    6 Stable tag: 1.0.33
     6Stable tag: 1.0.34
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9595== Changelog ==
    9696
     97= 1.0.34 =
     98* New diagnostics entry for SSL's SNI Support on WordPress installations
     99* Better
     100
    97101= 1.0.33 =
    98102* Improved support for PHP 7.1
  • unbounce/trunk/templates/diagnostics.php

    r1601650 r1665532  
    6060  </p>
    6161  <textarea id="ub-diagnostics-text" rows="10" cols="100">
    62     <?php
     62<?php
    6363
    64     foreach ($details as $detail_name => $detail) {
    65         echo "[${detail_name}] ${detail}\n";
    66     }
     64foreach ($details as $detail_name => $detail) {
     65    echo "[${detail_name}] ${detail}\n";
     66}
    6767
    6868    ?>
  • unbounce/trunk/templates/main_authorized_footer.php

    r1615299 r1665532  
    2222  Click here for troubleshooting and plugin diagnostics
    2323</a>
    24 <p class="ub-version">Unbounce Version 1.0.33</p>
     24<p class="ub-version">Unbounce Version 1.0.34</p>
  • unbounce/trunk/templates/main_unauthorized_footer.php

    r1615299 r1665532  
    55  Click here for troubleshooting and plugin diagnostics
    66</a>
    7 <p class="ub-version">Unbounce Version 1.0.33</p>
     7<p class="ub-version">Unbounce Version 1.0.34</p>
Note: See TracChangeset for help on using the changeset viewer.