Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

Commit

Permalink
Version 2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zackkatz committed Apr 19, 2017
1 parent ebcd169 commit d40a7d2
Show file tree
Hide file tree
Showing 15 changed files with 5 additions and 71 deletions.
76 changes: 5 additions & 71 deletions contact-form-newsletter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Fast Secure Contact Form Newsletter Add-on
Plugin URI: http://www.katzwebservices.com
Description: Integrate Constant Contact with Fast Secure Contact Form
Version: 2.1.1
Version: 2.1.2
Author: Katz Web Services, Inc.
Author URI: http://www.katzwebservices.com
Expand Down Expand Up @@ -33,13 +33,9 @@ class FSCF_CTCT {
* Add actions to load the plugin
*/
public function __construct() {
$this->version = '2.1.1';
$this->version = '2.1.2';
self::$path = plugin_dir_path( __FILE__ );

// PressTrends WordPress Action
add_action('admin_init', array(&$this, 'presstrends'));
add_action('fscfctct_event', array(&$this, 'track_event'), 1, 1 );

/**
* If the server doesn't support PHP 5.3, sorry, but you're outta luck.
*/
Expand All @@ -51,7 +47,6 @@ public function __construct() {
}

require_once(self::$path."ctct_php_library/ConstantContact.php");
require_once(self::$path."nameparse.php");

add_action('fsctf_newsletter_tab', array(&$this, 'adminDisplayForm'));
add_action('admin_init', array(&$this, 'adminProcessSettings'));
Expand Down Expand Up @@ -622,6 +617,8 @@ function generateContactArray(&$data = array(), $post = array(), $form = array()
$fields['emailAddress'] = self::getIfSet($post, 'email');
$fields['emailAddress'] = $fields['emailAddress'] ? $fields['emailAddress'] : self::getIfSet($data, 'from_email');

require_once(self::$path."nameparse.php");

// 1. Parse the from_name parameter for initial data.
$fields = $this->parseName(@$data['from_name'], $fields);

Expand Down Expand Up @@ -823,72 +820,9 @@ function addUpdateContact($fields, $lists) {

return $AddedContact;
}

function track_event($event_name) {
// PressTrends Account API Key & Theme/Plugin Unique Auth Code
$api_key = 'mc9ossbhdx30z6l7x4dnchacxpzhp6e054t4';
$auth = 'fkw7nfo4tk63nr0u6oohfyqxnesb8gc46';
$api_base = 'http://api.presstrends.io/index.php/api/events/track/auth/';
$api_string = $api_base . $auth . '/api/' . $api_key . '/';
$site_url = base64_encode(site_url());
$event_string = $api_string . 'name/' . urlencode($event_name) . '/url/' . $site_url . '/';
wp_remote_get( $event_string );
}

function presstrends() {
// PressTrends Account API Key
$api_key = 'mc9ossbhdx30z6l7x4dnchacxpzhp6e054t4';
$auth = 'fkw7nfo4tk63nr0u6oohfyqxnesb8gc46';
// Start of Metrics
global $wpdb;
$data = get_transient( 'presstrends_cache_data' );
if ( !$data || $data == '' ) {
$api_base = 'http://api.presstrends.io/index.php/api/pluginsites/update/auth/';
$url = $api_base . $auth . '/api/' . $api_key . '/';
$count_posts = wp_count_posts();
$count_pages = wp_count_posts( 'page' );
$comments_count = wp_count_comments();
if ( function_exists( 'wp_get_theme' ) ) {
$theme_data = wp_get_theme();
$theme_name = urlencode( $theme_data->Name );
} else {
$theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
$theme_name = $theme_data['Name'];
}
$plugin_name = '&';
foreach ( get_plugins() as $plugin_info ) {
if(strlen($plugin_name.$plugin_info['Name'] . '&') > 3000) { continue; } // Too long!
$plugin_name .= $plugin_info['Name'] . '&';
}
// CHANGE __FILE__ PATH IF LOCATED OUTSIDE MAIN PLUGIN FILE
$plugin_data = get_plugin_data( __FILE__ );
$posts_with_comments = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' AND comment_count > 0" );
$data = array(
'url' => stripslashes( str_replace( array( 'http://', '/', ':' ), '', site_url() ) ),
'posts' => $count_posts->publish,
'pages' => $count_pages->publish,
'comments' => $comments_count->total_comments,
'approved' => $comments_count->approved,
'spam' => $comments_count->spam,
'pingbacks' => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ),
'post_conversion' => ( $count_posts->publish > 0 && $posts_with_comments > 0 ) ? number_format( ( $posts_with_comments / $count_posts->publish ) * 100, 0, '.', '' ) : 0,
'theme_version' => $plugin_data['Version'],
'theme_name' => $theme_name,
'site_name' => str_replace( ' ', '', get_bloginfo( 'name' ) ),
'plugins' => count( get_option( 'active_plugins' ) ),
'plugin' => urlencode( $plugin_name ),
'wpversion' => get_bloginfo( 'version' ),
);
foreach ( $data as $k => $v ) {
$url .= $k . '/' . $v . '/';
}
wp_remote_get( $url );
set_transient( 'presstrends_cache_data', $data, 60 * 60 * 24 );
}
}
}

$FSCF_CTCT = new FSCF_CTCT;
new FSCF_CTCT;

/**
* Required to trigger tab for FSCF
Expand Down
Empty file modified ctct_php_library/Authentication.php
100644 → 100755
Empty file.
Empty file modified ctct_php_library/Collections.php
100644 → 100755
Empty file.
Empty file modified ctct_php_library/Components.php
100644 → 100755
Empty file.
Empty file modified ctct_php_library/ConstantContact.php
100644 → 100755
Empty file.
Empty file modified ctct_php_library/LICENSE
100644 → 100755
Empty file.
Empty file modified ctct_php_library/README
100644 → 100755
Empty file.
Empty file modified ctct_php_library/config.php
100644 → 100755
Empty file.
Empty file modified ctct_php_library/example_verification.php
100644 → 100755
Empty file.
Empty file modified ctct_php_library/examples/addContact.php
100644 → 100755
Empty file.
Empty file modified ctct_php_library/examples/contactReporting.php
100644 → 100755
Empty file.
Empty file modified ctct_php_library/examples/createcampaign.php
100644 → 100755
Empty file.
Empty file modified ctct_php_library/examples/example_verification.php
100644 → 100755
Empty file.
Empty file modified ctct_php_library/index.php
100644 → 100755
Empty file.
Binary file added favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d40a7d2

Please sign in to comment.