Version Description
November 6, 2015 =
Tweak: Better compatibility with upcoming WordPress 4.4 (2b2493c)
Tweak: Minor security improvements
Fix: New and improved Gravity Forms connector, works much better (#780) (thanks Rob!)
Fix: Stream no longer explodes on < PHP 5.3, when trying to tell you that it explodes on < PHP 5.3 (#781)
Fix: Fixed a smal typo (62455c5)
Fix: Multiple Multisite Mistakes Mended (#788)
Fix: Internet Explorer 8 fix!! IE8!? Come on, people, it's 2015. (#789)
Fix: EDD connector bug (#790)
Download this release
Release Info
Developer | lukecarbis |
Plugin | Stream |
Version | 3.0.3 |
Comparing to | |
See all releases |
Code changes from version 3.0.2 to 3.0.3
- classes/class-admin.php +3 -3
- classes/class-db.php +11 -2
- classes/class-install.php +6 -21
- classes/class-log.php +20 -0
- classes/class-plugin.php +1 -1
- classes/class-query.php +10 -5
- classes/class-settings.php +9 -1
- classes/class-uninstall.php +8 -8
- connectors/class-connector-edd.php +2 -2
- connectors/class-connector-gravityforms.php +247 -150
- connectors/class-connector-jetpack.php +1 -1
- connectors/class-connector-posts.php +5 -4
- includes/db-updates.php +11 -14
- readme.md +11 -1
- readme.txt +12 -1
- stream.php +5 -2
- tests/tests/test-class-db.php +1 -1
- ui/js/admin.js +3 -3
classes/class-admin.php
CHANGED
@@ -349,7 +349,7 @@ class Admin {
|
|
349 |
|
350 |
wp_enqueue_style( 'wp-stream-admin', $this->plugin->locations['url'] . 'ui/css/admin.css', array(), $this->plugin->get_version() );
|
351 |
|
352 |
-
$script_screens = array( 'plugins.php'
|
353 |
|
354 |
if ( in_array( $hook, $this->screen_id ) || in_array( $hook, $script_screens ) ) {
|
355 |
wp_enqueue_script( 'select2' );
|
@@ -580,7 +580,7 @@ class Admin {
|
|
580 |
FROM {$wpdb->stream} AS `stream`
|
581 |
LEFT JOIN {$wpdb->streammeta} AS `meta`
|
582 |
ON `meta`.`record_id` = `stream`.`ID`
|
583 |
-
WHERE 1=1 {$where};"
|
584 |
);
|
585 |
}
|
586 |
|
@@ -631,7 +631,7 @@ class Admin {
|
|
631 |
FROM {$wpdb->stream} AS `stream`
|
632 |
LEFT JOIN {$wpdb->streammeta} AS `meta`
|
633 |
ON `meta`.`record_id` = `stream`.`ID`
|
634 |
-
WHERE 1=1 {$where};"
|
635 |
);
|
636 |
}
|
637 |
|
349 |
|
350 |
wp_enqueue_style( 'wp-stream-admin', $this->plugin->locations['url'] . 'ui/css/admin.css', array(), $this->plugin->get_version() );
|
351 |
|
352 |
+
$script_screens = array( 'plugins.php' );
|
353 |
|
354 |
if ( in_array( $hook, $this->screen_id ) || in_array( $hook, $script_screens ) ) {
|
355 |
wp_enqueue_script( 'select2' );
|
580 |
FROM {$wpdb->stream} AS `stream`
|
581 |
LEFT JOIN {$wpdb->streammeta} AS `meta`
|
582 |
ON `meta`.`record_id` = `stream`.`ID`
|
583 |
+
WHERE 1=1 {$where};" // @codingStandardsIgnoreLine $where already prepared
|
584 |
);
|
585 |
}
|
586 |
|
631 |
FROM {$wpdb->stream} AS `stream`
|
632 |
LEFT JOIN {$wpdb->streammeta} AS `meta`
|
633 |
ON `meta`.`record_id` = `stream`.`ID`
|
634 |
+
WHERE 1=1 {$where};" // @codingStandardsIgnoreLine $where already prepared
|
635 |
);
|
636 |
}
|
637 |
|
classes/class-db.php
CHANGED
@@ -99,7 +99,7 @@ class DB {
|
|
99 |
|
100 |
$fields = array( 'object_id', 'site_id', 'blog_id', 'user_id', 'user_role', 'created', 'summary', 'ip', 'connector', 'context', 'action' );
|
101 |
$data = array_intersect_key( $recordarr, array_flip( $fields ) );
|
102 |
-
|
103 |
$result = $wpdb->insert( $this->table, $data );
|
104 |
|
105 |
if ( 1 !== $result ) {
|
@@ -180,7 +180,16 @@ class DB {
|
|
180 |
function existing_records( $column ) {
|
181 |
global $wpdb;
|
182 |
|
183 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
|
185 |
if ( is_array( $rows ) && ! empty( $rows ) ) {
|
186 |
$output_array = array();
|
99 |
|
100 |
$fields = array( 'object_id', 'site_id', 'blog_id', 'user_id', 'user_role', 'created', 'summary', 'ip', 'connector', 'context', 'action' );
|
101 |
$data = array_intersect_key( $recordarr, array_flip( $fields ) );
|
102 |
+
|
103 |
$result = $wpdb->insert( $this->table, $data );
|
104 |
|
105 |
if ( 1 !== $result ) {
|
180 |
function existing_records( $column ) {
|
181 |
global $wpdb;
|
182 |
|
183 |
+
// Sanitize column
|
184 |
+
$allowed_columns = array( 'ID', 'site_id', 'blog_id', 'object_id', 'user_id', 'user_role', 'created', 'summary', 'connector', 'context', 'action', 'ip' );
|
185 |
+
if ( ! in_array( $column, $allowed_columns ) ) {
|
186 |
+
return array();
|
187 |
+
}
|
188 |
+
|
189 |
+
$rows = $wpdb->get_results(
|
190 |
+
$wpdb->prepare( "SELECT $column FROM $wpdb->stream GROUP BY %s", $column ), // @codingStandardsIgnoreLine can't prepare column name
|
191 |
+
'ARRAY_A'
|
192 |
+
);
|
193 |
|
194 |
if ( is_array( $rows ) && ! empty( $rows ) ) {
|
195 |
$output_array = array();
|
classes/class-install.php
CHANGED
@@ -15,13 +15,6 @@ class Install {
|
|
15 |
*/
|
16 |
public $option_key = 'wp_stream_db';
|
17 |
|
18 |
-
/**
|
19 |
-
* Holds the database table prefix
|
20 |
-
*
|
21 |
-
* @var string
|
22 |
-
*/
|
23 |
-
public $table_prefix;
|
24 |
-
|
25 |
/**
|
26 |
* Holds version of database at last update
|
27 |
*
|
@@ -89,15 +82,6 @@ class Install {
|
|
89 |
return;
|
90 |
}
|
91 |
|
92 |
-
/**
|
93 |
-
* Allows devs to alter the tables prefix, default to base_prefix
|
94 |
-
*
|
95 |
-
* @param string $prefix
|
96 |
-
*
|
97 |
-
* @return string
|
98 |
-
*/
|
99 |
-
$this->table_prefix = apply_filters( 'wp_stream_db_tables_prefix', $wpdb->base_prefix );
|
100 |
-
|
101 |
if ( empty( $this->db_version ) ) {
|
102 |
$this->install( $this->plugin->get_version() );
|
103 |
|
@@ -163,7 +147,10 @@ class Install {
|
|
163 |
$missing_tables = array();
|
164 |
|
165 |
foreach ( $this->plugin->db->get_table_names() as $table_name ) {
|
166 |
-
|
|
|
|
|
|
|
167 |
$missing_tables[] = $table_name;
|
168 |
}
|
169 |
}
|
@@ -406,9 +393,7 @@ class Install {
|
|
406 |
|
407 |
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
408 |
|
409 |
-
$
|
410 |
-
|
411 |
-
$sql = "CREATE TABLE {$prefix}stream (
|
412 |
ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
413 |
site_id bigint(20) unsigned NOT NULL DEFAULT '1',
|
414 |
blog_id bigint(20) unsigned NOT NULL DEFAULT '1',
|
@@ -456,7 +441,7 @@ class Install {
|
|
456 |
|
457 |
\dbDelta( $sql );
|
458 |
|
459 |
-
$sql = "CREATE TABLE {$
|
460 |
meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
461 |
record_id bigint(20) unsigned NOT NULL,
|
462 |
meta_key varchar(200) NOT NULL,
|
15 |
*/
|
16 |
public $option_key = 'wp_stream_db';
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
/**
|
19 |
* Holds version of database at last update
|
20 |
*
|
82 |
return;
|
83 |
}
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
if ( empty( $this->db_version ) ) {
|
86 |
$this->install( $this->plugin->get_version() );
|
87 |
|
147 |
$missing_tables = array();
|
148 |
|
149 |
foreach ( $this->plugin->db->get_table_names() as $table_name ) {
|
150 |
+
$table_search = $wpdb->get_var(
|
151 |
+
$wpdb->prepare( 'SHOW TABLES LIKE %s', $table_name )
|
152 |
+
);
|
153 |
+
if ( $table_search !== $table_name ) {
|
154 |
$missing_tables[] = $table_name;
|
155 |
}
|
156 |
}
|
393 |
|
394 |
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
395 |
|
396 |
+
$sql = "CREATE TABLE {$wpdb->base_prefix}stream (
|
|
|
|
|
397 |
ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
398 |
site_id bigint(20) unsigned NOT NULL DEFAULT '1',
|
399 |
blog_id bigint(20) unsigned NOT NULL DEFAULT '1',
|
441 |
|
442 |
\dbDelta( $sql );
|
443 |
|
444 |
+
$sql = "CREATE TABLE {$wpdb->base_prefix}stream_meta (
|
445 |
meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
446 |
record_id bigint(20) unsigned NOT NULL,
|
447 |
meta_key varchar(200) NOT NULL,
|
classes/class-log.php
CHANGED
@@ -114,6 +114,10 @@ class Log {
|
|
114 |
'meta' => (array) $stream_meta,
|
115 |
);
|
116 |
|
|
|
|
|
|
|
|
|
117 |
$result = $this->plugin->db->insert( $recordarr );
|
118 |
|
119 |
$this->debug_backtrace( $recordarr );
|
@@ -156,6 +160,22 @@ class Log {
|
|
156 |
|
157 |
$exclude_settings = isset( $this->plugin->settings->options['exclude_rules'] ) ? $this->plugin->settings->options['exclude_rules'] : array();
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
if ( isset( $exclude_settings['exclude_row'] ) && ! empty( $exclude_settings['exclude_row'] ) ) {
|
160 |
foreach ( $exclude_settings['exclude_row'] as $key => $value ) {
|
161 |
// Prepare values
|
114 |
'meta' => (array) $stream_meta,
|
115 |
);
|
116 |
|
117 |
+
if ( 0 === $recordarr['object_id'] ) {
|
118 |
+
unset( $recordarr['object_id'] );
|
119 |
+
}
|
120 |
+
|
121 |
$result = $this->plugin->db->insert( $recordarr );
|
122 |
|
123 |
$this->debug_backtrace( $recordarr );
|
160 |
|
161 |
$exclude_settings = isset( $this->plugin->settings->options['exclude_rules'] ) ? $this->plugin->settings->options['exclude_rules'] : array();
|
162 |
|
163 |
+
if ( is_multisite() && is_plugin_active_for_network( $this->plugin->locations['plugin'] ) && ! is_network_admin() ) {
|
164 |
+
$multisite_options = (array) get_site_option( 'wp_stream_network', array() );
|
165 |
+
$multisite_exclude_settings = isset( $multisite_options['exclude_rules'] ) ? $multisite_options['exclude_rules'] : array();
|
166 |
+
|
167 |
+
if ( ! empty( $multisite_exclude_settings ) ) {
|
168 |
+
foreach ( $multisite_exclude_settings['exclude_row'] as $key => $rule ) {
|
169 |
+
$exclude_settings['exclude_row'][] = $multisite_exclude_settings['exclude_row'][ $key ];
|
170 |
+
$exclude_settings['author_or_role'][] = $multisite_exclude_settings['author_or_role'][ $key ];
|
171 |
+
$exclude_settings['connector'][] = $multisite_exclude_settings['connector'][ $key ];
|
172 |
+
$exclude_settings['context'][] = $multisite_exclude_settings['context'][ $key ];
|
173 |
+
$exclude_settings['action'][] = $multisite_exclude_settings['action'][ $key ];
|
174 |
+
$exclude_settings['ip_address'][] = $multisite_exclude_settings['ip_address'][ $key ];
|
175 |
+
}
|
176 |
+
}
|
177 |
+
}
|
178 |
+
|
179 |
if ( isset( $exclude_settings['exclude_row'] ) && ! empty( $exclude_settings['exclude_row'] ) ) {
|
180 |
foreach ( $exclude_settings['exclude_row'] as $key => $value ) {
|
181 |
// Prepare values
|
classes/class-plugin.php
CHANGED
@@ -7,7 +7,7 @@ class Plugin {
|
|
7 |
*
|
8 |
* @const string
|
9 |
*/
|
10 |
-
const VERSION = '3.0.
|
11 |
|
12 |
/**
|
13 |
* WP-CLI command
|
7 |
*
|
8 |
* @const string
|
9 |
*/
|
10 |
+
const VERSION = '3.0.3';
|
11 |
|
12 |
/**
|
13 |
* WP-CLI command
|
classes/class-query.php
CHANGED
@@ -125,7 +125,12 @@ class Query {
|
|
125 |
|
126 |
if ( ! empty( $args['search'] ) ) {
|
127 |
$field = ! empty( $args['search_field'] ) ? $args['search_field'] : 'summary';
|
128 |
-
|
|
|
|
|
|
|
|
|
|
|
129 |
}
|
130 |
|
131 |
if ( ! empty( $args['connector'] ) ) {
|
@@ -195,7 +200,7 @@ class Query {
|
|
195 |
|
196 |
if ( ! empty( $value ) ) {
|
197 |
$format = '(' . join( ',', array_fill( 0, count( $value ), $type ) ) . ')';
|
198 |
-
$where .= $wpdb->prepare( " AND $wpdb->stream.%s IN {$format}", $field, $value );
|
199 |
}
|
200 |
}
|
201 |
}
|
@@ -223,7 +228,7 @@ class Query {
|
|
223 |
|
224 |
if ( ! empty( $value ) ) {
|
225 |
$format = '(' . join( ',', array_fill( 0, count( $value ), $type ) ) . ')';
|
226 |
-
$where .= $wpdb->prepare( " AND $wpdb->stream.%s NOT IN {$format}", $field, $value );
|
227 |
}
|
228 |
}
|
229 |
}
|
@@ -303,7 +308,7 @@ class Query {
|
|
303 |
/**
|
304 |
* QUERY THE DATABASE FOR RESULTS
|
305 |
*/
|
306 |
-
$results = $wpdb->get_results( $query );
|
307 |
|
308 |
// Hold the number of records found
|
309 |
$this->found_records = absint( $wpdb->get_var( 'SELECT FOUND_ROWS()' ) );
|
@@ -337,7 +342,7 @@ class Query {
|
|
337 |
implode( ',', $record_ids )
|
338 |
);
|
339 |
|
340 |
-
$meta = $wpdb->get_results( $sql_meta );
|
341 |
$ids_f = array_flip( $record_ids );
|
342 |
|
343 |
foreach ( $meta as $meta_record ) {
|
125 |
|
126 |
if ( ! empty( $args['search'] ) ) {
|
127 |
$field = ! empty( $args['search_field'] ) ? $args['search_field'] : 'summary';
|
128 |
+
|
129 |
+
// Sanitize field
|
130 |
+
$allowed_fields = array( 'ID', 'site_id', 'blog_id', 'object_id', 'user_id', 'user_role', 'created', 'summary', 'connector', 'context', 'action', 'ip' );
|
131 |
+
if ( in_array( $field, $allowed_fields ) ) {
|
132 |
+
$where .= $wpdb->prepare( " AND $wpdb->stream.{$field} LIKE %s", "%{$args['search']}%" ); // @codingStandardsIgnoreLine can't prepare column name
|
133 |
+
}
|
134 |
}
|
135 |
|
136 |
if ( ! empty( $args['connector'] ) ) {
|
200 |
|
201 |
if ( ! empty( $value ) ) {
|
202 |
$format = '(' . join( ',', array_fill( 0, count( $value ), $type ) ) . ')';
|
203 |
+
$where .= $wpdb->prepare( " AND $wpdb->stream.%s IN {$format}", $field, $value ); // @codingStandardsIgnoreLine prepare okay
|
204 |
}
|
205 |
}
|
206 |
}
|
228 |
|
229 |
if ( ! empty( $value ) ) {
|
230 |
$format = '(' . join( ',', array_fill( 0, count( $value ), $type ) ) . ')';
|
231 |
+
$where .= $wpdb->prepare( " AND $wpdb->stream.%s NOT IN {$format}", $field, $value ); // @codingStandardsIgnoreLine prepare okay
|
232 |
}
|
233 |
}
|
234 |
}
|
308 |
/**
|
309 |
* QUERY THE DATABASE FOR RESULTS
|
310 |
*/
|
311 |
+
$results = $wpdb->get_results( $query ); // @codingStandardsIgnoreLine $query already prepared
|
312 |
|
313 |
// Hold the number of records found
|
314 |
$this->found_records = absint( $wpdb->get_var( 'SELECT FOUND_ROWS()' ) );
|
342 |
implode( ',', $record_ids )
|
343 |
);
|
344 |
|
345 |
+
$meta = $wpdb->get_results( $sql_meta ); // @codingStandardsIgnoreLine prepare okay
|
346 |
$ids_f = array_flip( $record_ids );
|
347 |
|
348 |
foreach ( $meta as $meta_record ) {
|
classes/class-settings.php
CHANGED
@@ -569,12 +569,20 @@ class Settings {
|
|
569 |
);
|
570 |
break;
|
571 |
case 'checkbox':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
572 |
$output = sprintf(
|
573 |
'<label><input type="checkbox" name="%1$s[%2$s_%3$s]" id="%1$s[%2$s_%3$s]" value="1" %4$s /> %5$s</label>',
|
574 |
esc_attr( $option_key ),
|
575 |
esc_attr( $section ),
|
576 |
esc_attr( $name ),
|
577 |
-
checked( $
|
578 |
wp_kses_post( $after_field )
|
579 |
);
|
580 |
break;
|
569 |
);
|
570 |
break;
|
571 |
case 'checkbox':
|
572 |
+
if ( isset( $current_value ) ) {
|
573 |
+
$value = $current_value;
|
574 |
+
} elseif ( isset( $default ) ) {
|
575 |
+
$value = $default;
|
576 |
+
} else {
|
577 |
+
$value = 0;
|
578 |
+
}
|
579 |
+
|
580 |
$output = sprintf(
|
581 |
'<label><input type="checkbox" name="%1$s[%2$s_%3$s]" id="%1$s[%2$s_%3$s]" value="1" %4$s /> %5$s</label>',
|
582 |
esc_attr( $option_key ),
|
583 |
esc_attr( $section ),
|
584 |
esc_attr( $name ),
|
585 |
+
checked( $value, 1, false ),
|
586 |
wp_kses_post( $after_field )
|
587 |
);
|
588 |
break;
|
classes/class-uninstall.php
CHANGED
@@ -153,10 +153,8 @@ class Uninstall {
|
|
153 |
|
154 |
global $wpdb;
|
155 |
|
156 |
-
$blog_prefix = $wpdb->get_blog_prefix( $blog_id );
|
157 |
-
|
158 |
// Wildcard matches
|
159 |
-
$wpdb->query( "DELETE FROM {$
|
160 |
|
161 |
// Specific options
|
162 |
foreach ( $this->options as $option ) {
|
@@ -175,7 +173,9 @@ class Uninstall {
|
|
175 |
|
176 |
// Specific user meta
|
177 |
foreach ( $this->user_meta as $meta_key ) {
|
178 |
-
$wpdb->query(
|
|
|
|
|
179 |
}
|
180 |
}
|
181 |
|
@@ -191,14 +191,14 @@ class Uninstall {
|
|
191 |
|
192 |
global $wpdb;
|
193 |
|
194 |
-
$blog_prefix = $wpdb->get_blog_prefix( $blog_id );
|
195 |
-
|
196 |
// Wildcard matches
|
197 |
-
$wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE '{$
|
198 |
|
199 |
// Specific user meta
|
200 |
foreach ( $this->user_meta as $meta_key ) {
|
201 |
-
$wpdb->query(
|
|
|
|
|
202 |
}
|
203 |
}
|
204 |
|
153 |
|
154 |
global $wpdb;
|
155 |
|
|
|
|
|
156 |
// Wildcard matches
|
157 |
+
$wpdb->query( "DELETE FROM {$wpdb->prefix}options WHERE option_name LIKE '%wp_stream%';" );
|
158 |
|
159 |
// Specific options
|
160 |
foreach ( $this->options as $option ) {
|
173 |
|
174 |
// Specific user meta
|
175 |
foreach ( $this->user_meta as $meta_key ) {
|
176 |
+
$wpdb->query(
|
177 |
+
$wpdb->prepare( "DELETE FROM {$wpdb->usermeta} WHERE meta_key = %s;", $meta_key )
|
178 |
+
);
|
179 |
}
|
180 |
}
|
181 |
|
191 |
|
192 |
global $wpdb;
|
193 |
|
|
|
|
|
194 |
// Wildcard matches
|
195 |
+
$wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE '{$wpdb->prefix}%wp_stream%';" );
|
196 |
|
197 |
// Specific user meta
|
198 |
foreach ( $this->user_meta as $meta_key ) {
|
199 |
+
$wpdb->query(
|
200 |
+
$wpdb->prepare( "DELETE FROM {$wpdb->usermeta} WHERE meta_key = '{$wpdb->prefix}%s';", $meta_key )
|
201 |
+
);
|
202 |
}
|
203 |
}
|
204 |
|
connectors/class-connector-edd.php
CHANGED
@@ -344,9 +344,9 @@ class Connector_EDD extends Connector {
|
|
344 |
return false; // Do not track notes, because they're basically logs
|
345 |
} elseif ( 'taxonomies' === $data['connector'] && 'download_category' === $data['context'] ) {
|
346 |
$data['connector'] = $this->name;
|
347 |
-
} elseif ( 'taxonomies' === $data['connector'] && 'download_tag' === $data['
|
348 |
$data['connector'] = $this->name;
|
349 |
-
} elseif ( 'taxonomies' === $data['connector'] && 'edd_log_type' === $data['
|
350 |
return false;
|
351 |
} elseif ( 'settings' === $data['connector'] && 'edd_settings' === $data['args']['option'] ) {
|
352 |
return false;
|
344 |
return false; // Do not track notes, because they're basically logs
|
345 |
} elseif ( 'taxonomies' === $data['connector'] && 'download_category' === $data['context'] ) {
|
346 |
$data['connector'] = $this->name;
|
347 |
+
} elseif ( 'taxonomies' === $data['connector'] && 'download_tag' === $data['context'] ) {
|
348 |
$data['connector'] = $this->name;
|
349 |
+
} elseif ( 'taxonomies' === $data['connector'] && 'edd_log_type' === $data['context'] ) {
|
350 |
return false;
|
351 |
} elseif ( 'settings' === $data['connector'] && 'edd_settings' === $data['args']['option'] ) {
|
352 |
return false;
|
connectors/class-connector-gravityforms.php
CHANGED
@@ -14,7 +14,7 @@ class Connector_GravityForms extends Connector {
|
|
14 |
*
|
15 |
* @const string
|
16 |
*/
|
17 |
-
const PLUGIN_MIN_VERSION = '1.
|
18 |
|
19 |
/**
|
20 |
* Actions registered for this connector
|
@@ -25,22 +25,20 @@ class Connector_GravityForms extends Connector {
|
|
25 |
'gform_after_save_form',
|
26 |
'gform_pre_confirmation_save',
|
27 |
'gform_pre_notification_save',
|
28 |
-
'
|
29 |
-
'
|
30 |
-
'gform_notification_status',
|
31 |
-
'gform_confirmation_status',
|
32 |
-
'gform_form_status_change',
|
33 |
-
'gform_form_reset_views',
|
34 |
'gform_before_delete_form',
|
35 |
-
'
|
36 |
-
'
|
37 |
-
'
|
38 |
-
'
|
39 |
-
'
|
40 |
-
'
|
|
|
|
|
41 |
'gform_delete_lead',
|
42 |
-
'
|
43 |
-
'
|
44 |
'gform_update_status',
|
45 |
'gform_update_is_read',
|
46 |
'gform_update_is_starred',
|
@@ -95,15 +93,20 @@ class Connector_GravityForms extends Connector {
|
|
95 |
*/
|
96 |
public function get_action_labels() {
|
97 |
return array(
|
98 |
-
'created'
|
99 |
-
'updated'
|
100 |
-
'exported'
|
101 |
-
'imported'
|
102 |
-
'added'
|
103 |
-
'deleted'
|
104 |
-
'trashed'
|
105 |
-
'untrashed'
|
106 |
-
'duplicated'
|
|
|
|
|
|
|
|
|
|
|
107 |
);
|
108 |
}
|
109 |
|
@@ -177,16 +180,16 @@ class Connector_GravityForms extends Connector {
|
|
177 |
parent::register();
|
178 |
|
179 |
$this->options = array(
|
180 |
-
'rg_gforms_disable_css'
|
181 |
'label' => esc_html_x( 'Output CSS', 'gravityforms', 'stream' ),
|
182 |
),
|
183 |
-
'rg_gforms_enable_html5'
|
184 |
'label' => esc_html_x( 'Output HTML5', 'gravityforms', 'stream' ),
|
185 |
),
|
186 |
-
'gform_enable_noconflict'
|
187 |
'label' => esc_html_x( 'No-Conflict Mode', 'gravityforms', 'stream' ),
|
188 |
),
|
189 |
-
'rg_gforms_currency'
|
190 |
'label' => esc_html_x( 'Currency', 'gravityforms', 'stream' ),
|
191 |
),
|
192 |
'rg_gforms_captcha_public_key' => array(
|
@@ -204,6 +207,7 @@ class Connector_GravityForms extends Connector {
|
|
204 |
*
|
205 |
* @param array $form
|
206 |
* @param bool $is_new
|
|
|
207 |
*/
|
208 |
public function callback_gform_after_save_form( $form, $is_new ) {
|
209 |
$title = $form['title'];
|
@@ -232,7 +236,6 @@ class Connector_GravityForms extends Connector {
|
|
232 |
* @param array $confirmation
|
233 |
* @param array $form
|
234 |
* @param bool $is_new
|
235 |
-
*
|
236 |
* @return array
|
237 |
*/
|
238 |
public function callback_gform_pre_confirmation_save( $confirmation, $form, $is_new = true ) {
|
@@ -265,7 +268,6 @@ class Connector_GravityForms extends Connector {
|
|
265 |
* @param array $notification
|
266 |
* @param array $form
|
267 |
* @param bool $is_new
|
268 |
-
*
|
269 |
* @return array
|
270 |
*/
|
271 |
public function callback_gform_pre_notification_save( $notification, $form, $is_new = true ) {
|
@@ -297,8 +299,9 @@ class Connector_GravityForms extends Connector {
|
|
297 |
*
|
298 |
* @param array $notification
|
299 |
* @param array $form
|
|
|
300 |
*/
|
301 |
-
public function
|
302 |
$this->log(
|
303 |
sprintf(
|
304 |
__( '"%1$s" notification deleted from "%2$s"', 'stream' ),
|
@@ -320,8 +323,9 @@ class Connector_GravityForms extends Connector {
|
|
320 |
*
|
321 |
* @param array $confirmation
|
322 |
* @param array $form
|
|
|
323 |
*/
|
324 |
-
public function
|
325 |
$this->log(
|
326 |
sprintf(
|
327 |
__( '"%1$s" confirmation deleted from "%2$s"', 'stream' ),
|
@@ -344,6 +348,7 @@ class Connector_GravityForms extends Connector {
|
|
344 |
* @param array $confirmation
|
345 |
* @param array $form
|
346 |
* @param bool $is_active
|
|
|
347 |
*/
|
348 |
public function callback_gform_confirmation_status( $confirmation, $form, $is_active ) {
|
349 |
$this->log(
|
@@ -364,32 +369,13 @@ class Connector_GravityForms extends Connector {
|
|
364 |
);
|
365 |
}
|
366 |
|
367 |
-
/**
|
368 |
-
* Track status change of confirmations
|
369 |
-
*
|
370 |
-
* @param integer $id
|
371 |
-
*/
|
372 |
-
public function callback_gform_form_reset_views( $id ) {
|
373 |
-
$form = $this->get_form( $id );
|
374 |
-
|
375 |
-
$this->log(
|
376 |
-
__( '"%s" form views reset', 'stream' ),
|
377 |
-
array(
|
378 |
-
'title' => $form['title'],
|
379 |
-
'form_id' => $form['id'],
|
380 |
-
),
|
381 |
-
$form['id'],
|
382 |
-
'forms',
|
383 |
-
'updated'
|
384 |
-
);
|
385 |
-
}
|
386 |
-
|
387 |
/**
|
388 |
* Track status change of notifications
|
389 |
*
|
390 |
* @param array $notification
|
391 |
* @param array $form
|
392 |
* @param bool $is_active
|
|
|
393 |
*/
|
394 |
public function callback_gform_notification_status( $notification, $form, $is_active ) {
|
395 |
$this->log(
|
@@ -410,37 +396,6 @@ class Connector_GravityForms extends Connector {
|
|
410 |
);
|
411 |
}
|
412 |
|
413 |
-
/**
|
414 |
-
* Track status change of forms
|
415 |
-
*
|
416 |
-
* @param integer $id
|
417 |
-
* @param string $action
|
418 |
-
*/
|
419 |
-
public function callback_gform_form_status_change( $id, $action ) {
|
420 |
-
$form = $this->get_form( $id );
|
421 |
-
$actions = array(
|
422 |
-
'activated' => esc_html__( 'Activated', 'stream' ),
|
423 |
-
'deactivated' => esc_html__( 'Deactivated', 'stream' ),
|
424 |
-
'trashed' => esc_html__( 'Trashed', 'stream' ),
|
425 |
-
'untrashed' => esc_html__( 'Restored', 'stream' ),
|
426 |
-
);
|
427 |
-
|
428 |
-
$this->log(
|
429 |
-
sprintf(
|
430 |
-
__( '"%1$s" form %2$s', 'stream' ),
|
431 |
-
$form['title'],
|
432 |
-
$actions[ $action ]
|
433 |
-
),
|
434 |
-
array(
|
435 |
-
'form_title' => $form['title'],
|
436 |
-
'form_id' => $id,
|
437 |
-
),
|
438 |
-
$form['id'],
|
439 |
-
'forms',
|
440 |
-
$action
|
441 |
-
);
|
442 |
-
}
|
443 |
-
|
444 |
public function callback_update_option( $option, $old, $new ) {
|
445 |
$this->check( $option, $old, $new );
|
446 |
}
|
@@ -503,31 +458,54 @@ class Connector_GravityForms extends Connector {
|
|
503 |
);
|
504 |
}
|
505 |
|
506 |
-
public function
|
507 |
-
|
508 |
-
|
509 |
$this->log(
|
510 |
-
__( '"%s" form exported', 'stream' ),
|
511 |
array(
|
512 |
'form_title' => $form['title'],
|
513 |
-
'form_id' => $
|
|
|
|
|
514 |
),
|
515 |
-
$
|
516 |
'export',
|
517 |
'exported'
|
518 |
);
|
519 |
-
|
520 |
-
return $dummy;
|
521 |
}
|
522 |
|
523 |
-
public function
|
|
|
|
|
|
|
|
|
|
|
524 |
$this->log(
|
525 |
-
__( '
|
526 |
-
array(
|
|
|
|
|
|
|
|
|
527 |
null,
|
528 |
'export',
|
529 |
'imported'
|
530 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
531 |
|
532 |
return $dummy;
|
533 |
}
|
@@ -551,41 +529,8 @@ class Connector_GravityForms extends Connector {
|
|
551 |
return $dummy;
|
552 |
}
|
553 |
|
554 |
-
public function callback_gform_before_delete_form( $id ) {
|
555 |
-
$form = $this->get_form( $id );
|
556 |
-
|
557 |
-
$this->log(
|
558 |
-
__( '"%s" form deleted', 'stream' ),
|
559 |
-
array(
|
560 |
-
'form_title' => $form['title'],
|
561 |
-
'form_id' => $id,
|
562 |
-
),
|
563 |
-
$form['id'],
|
564 |
-
'forms',
|
565 |
-
'deleted'
|
566 |
-
);
|
567 |
-
}
|
568 |
-
|
569 |
-
public function callback_gform_form_duplicate( $id, $new_id ) {
|
570 |
-
$form = $this->get_form( $id );
|
571 |
-
$new = $this->get_form( $new_id );
|
572 |
-
|
573 |
-
$this->log(
|
574 |
-
__( '"%1$s" form created as duplicate from "%2$s"', 'stream' ),
|
575 |
-
array(
|
576 |
-
'new_form_title' => $new['title'],
|
577 |
-
'form_title' => $form['title'],
|
578 |
-
'form_id' => $id,
|
579 |
-
'new_id' => $new_id,
|
580 |
-
),
|
581 |
-
$new_id,
|
582 |
-
'forms',
|
583 |
-
'duplicated'
|
584 |
-
);
|
585 |
-
}
|
586 |
-
|
587 |
public function callback_gform_delete_lead( $lead_id ) {
|
588 |
-
$lead =
|
589 |
$form = $this->get_form( $lead['form_id'] );
|
590 |
|
591 |
$this->log(
|
@@ -601,7 +546,12 @@ class Connector_GravityForms extends Connector {
|
|
601 |
);
|
602 |
}
|
603 |
|
604 |
-
public function
|
|
|
|
|
|
|
|
|
|
|
605 |
$lead = \GFFormsModel::get_lead( $lead_id );
|
606 |
$form = $this->get_form( $lead['form_id'] );
|
607 |
|
@@ -619,8 +569,8 @@ class Connector_GravityForms extends Connector {
|
|
619 |
);
|
620 |
}
|
621 |
|
622 |
-
public function
|
623 |
-
$lead =
|
624 |
$form = $this->get_form( $lead['form_id'] );
|
625 |
|
626 |
$this->log(
|
@@ -638,7 +588,7 @@ class Connector_GravityForms extends Connector {
|
|
638 |
}
|
639 |
|
640 |
public function callback_gform_update_status( $lead_id, $status, $prev = '' ) {
|
641 |
-
$lead =
|
642 |
$form = $this->get_form( $lead['form_id'] );
|
643 |
|
644 |
if ( 'active' === $status && 'trash' === $prev ) {
|
@@ -676,22 +626,31 @@ class Connector_GravityForms extends Connector {
|
|
676 |
);
|
677 |
}
|
678 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
679 |
public function callback_gform_update_is_read( $lead_id, $status ) {
|
680 |
-
$lead
|
681 |
-
$form
|
|
|
682 |
|
683 |
$this->log(
|
684 |
sprintf(
|
685 |
-
__( '
|
686 |
$lead_id,
|
687 |
-
$status
|
|
|
688 |
$form['title']
|
689 |
),
|
690 |
array(
|
691 |
-
'lead_id'
|
692 |
-
'
|
693 |
-
'form_id'
|
694 |
-
'
|
695 |
),
|
696 |
$lead_id,
|
697 |
'entries',
|
@@ -699,30 +658,168 @@ class Connector_GravityForms extends Connector {
|
|
699 |
);
|
700 |
}
|
701 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
702 |
public function callback_gform_update_is_starred( $lead_id, $status ) {
|
703 |
-
$lead
|
704 |
-
$form
|
|
|
|
|
705 |
|
706 |
$this->log(
|
707 |
sprintf(
|
708 |
-
__( '
|
709 |
$lead_id,
|
710 |
-
$status
|
|
|
711 |
$form['title']
|
712 |
),
|
713 |
array(
|
714 |
-
'lead_id'
|
715 |
-
'
|
716 |
-
'form_id'
|
717 |
-
'
|
718 |
),
|
719 |
$lead_id,
|
720 |
'entries',
|
721 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
722 |
);
|
723 |
}
|
724 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
725 |
private function get_form( $form_id ) {
|
726 |
-
return
|
727 |
}
|
728 |
}
|
14 |
*
|
15 |
* @const string
|
16 |
*/
|
17 |
+
const PLUGIN_MIN_VERSION = '1.9.14';
|
18 |
|
19 |
/**
|
20 |
* Actions registered for this connector
|
25 |
'gform_after_save_form',
|
26 |
'gform_pre_confirmation_save',
|
27 |
'gform_pre_notification_save',
|
28 |
+
'gform_pre_notification_deleted',
|
29 |
+
'gform_pre_confirmation_deleted',
|
|
|
|
|
|
|
|
|
30 |
'gform_before_delete_form',
|
31 |
+
'gform_post_form_trashed',
|
32 |
+
'gform_post_form_restored',
|
33 |
+
'gform_post_form_activated',
|
34 |
+
'gform_post_form_deactivated',
|
35 |
+
'gform_post_form_duplicated',
|
36 |
+
'gform_post_form_views_deleted',
|
37 |
+
'gform_post_export_entries',
|
38 |
+
'gform_forms_post_import',
|
39 |
'gform_delete_lead',
|
40 |
+
'gform_post_note_added',
|
41 |
+
'gform_pre_note_deleted',
|
42 |
'gform_update_status',
|
43 |
'gform_update_is_read',
|
44 |
'gform_update_is_starred',
|
93 |
*/
|
94 |
public function get_action_labels() {
|
95 |
return array(
|
96 |
+
'created' => esc_html_x( 'Created', 'gravityforms', 'stream' ),
|
97 |
+
'updated' => esc_html_x( 'Updated', 'gravityforms', 'stream' ),
|
98 |
+
'exported' => esc_html_x( 'Exported', 'gravityforms', 'stream' ),
|
99 |
+
'imported' => esc_html_x( 'Imported', 'gravityforms', 'stream' ),
|
100 |
+
'added' => esc_html_x( 'Added', 'gravityforms', 'stream' ),
|
101 |
+
'deleted' => esc_html_x( 'Deleted', 'gravityforms', 'stream' ),
|
102 |
+
'trashed' => esc_html_x( 'Trashed', 'gravityforms', 'stream' ),
|
103 |
+
'untrashed' => esc_html_x( 'Restored', 'gravityforms', 'stream' ),
|
104 |
+
'duplicated' => esc_html_x( 'Duplicated', 'gravityforms', 'stream' ),
|
105 |
+
'activated' => esc_html_x( 'Activated', 'gravityforms', 'stream' ),
|
106 |
+
'deactivated' => esc_html_x( 'Deactivated', 'gravityforms', 'stream' ),
|
107 |
+
'views_deleted' => esc_html_x( 'Views Reset', 'gravityforms', 'stream' ),
|
108 |
+
'starred' => esc_html_x( 'Starred', 'gravityforms', 'stream' ),
|
109 |
+
'unstarred' => esc_html_x( 'Unstarred', 'gravityforms', 'stream' ),
|
110 |
);
|
111 |
}
|
112 |
|
180 |
parent::register();
|
181 |
|
182 |
$this->options = array(
|
183 |
+
'rg_gforms_disable_css' => array(
|
184 |
'label' => esc_html_x( 'Output CSS', 'gravityforms', 'stream' ),
|
185 |
),
|
186 |
+
'rg_gforms_enable_html5' => array(
|
187 |
'label' => esc_html_x( 'Output HTML5', 'gravityforms', 'stream' ),
|
188 |
),
|
189 |
+
'gform_enable_noconflict' => array(
|
190 |
'label' => esc_html_x( 'No-Conflict Mode', 'gravityforms', 'stream' ),
|
191 |
),
|
192 |
+
'rg_gforms_currency' => array(
|
193 |
'label' => esc_html_x( 'Currency', 'gravityforms', 'stream' ),
|
194 |
),
|
195 |
'rg_gforms_captcha_public_key' => array(
|
207 |
*
|
208 |
* @param array $form
|
209 |
* @param bool $is_new
|
210 |
+
* @return void
|
211 |
*/
|
212 |
public function callback_gform_after_save_form( $form, $is_new ) {
|
213 |
$title = $form['title'];
|
236 |
* @param array $confirmation
|
237 |
* @param array $form
|
238 |
* @param bool $is_new
|
|
|
239 |
* @return array
|
240 |
*/
|
241 |
public function callback_gform_pre_confirmation_save( $confirmation, $form, $is_new = true ) {
|
268 |
* @param array $notification
|
269 |
* @param array $form
|
270 |
* @param bool $is_new
|
|
|
271 |
* @return array
|
272 |
*/
|
273 |
public function callback_gform_pre_notification_save( $notification, $form, $is_new = true ) {
|
299 |
*
|
300 |
* @param array $notification
|
301 |
* @param array $form
|
302 |
+
* @return void
|
303 |
*/
|
304 |
+
public function callback_gform_pre_notification_deleted( $notification, $form ) {
|
305 |
$this->log(
|
306 |
sprintf(
|
307 |
__( '"%1$s" notification deleted from "%2$s"', 'stream' ),
|
323 |
*
|
324 |
* @param array $confirmation
|
325 |
* @param array $form
|
326 |
+
* @return void
|
327 |
*/
|
328 |
+
public function callback_gform_pre_confirmation_deleted( $confirmation, $form ) {
|
329 |
$this->log(
|
330 |
sprintf(
|
331 |
__( '"%1$s" confirmation deleted from "%2$s"', 'stream' ),
|
348 |
* @param array $confirmation
|
349 |
* @param array $form
|
350 |
* @param bool $is_active
|
351 |
+
* @return void
|
352 |
*/
|
353 |
public function callback_gform_confirmation_status( $confirmation, $form, $is_active ) {
|
354 |
$this->log(
|
369 |
);
|
370 |
}
|
371 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
/**
|
373 |
* Track status change of notifications
|
374 |
*
|
375 |
* @param array $notification
|
376 |
* @param array $form
|
377 |
* @param bool $is_active
|
378 |
+
* @return void
|
379 |
*/
|
380 |
public function callback_gform_notification_status( $notification, $form, $is_active ) {
|
381 |
$this->log(
|
396 |
);
|
397 |
}
|
398 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
public function callback_update_option( $option, $old, $new ) {
|
400 |
$this->check( $option, $old, $new );
|
401 |
}
|
458 |
);
|
459 |
}
|
460 |
|
461 |
+
public function callback_gform_post_export_entries( $form, $start_date, $end_date, $fields ) {
|
462 |
+
unset( $fields );
|
|
|
463 |
$this->log(
|
464 |
+
__( '"%s" form entries exported', 'stream' ),
|
465 |
array(
|
466 |
'form_title' => $form['title'],
|
467 |
+
'form_id' => $form['id'],
|
468 |
+
'start_date' => empty( $start_date ) ? null : $start_date,
|
469 |
+
'end_date' => empty( $end_date ) ? null : $end_date,
|
470 |
),
|
471 |
+
$form['id'],
|
472 |
'export',
|
473 |
'exported'
|
474 |
);
|
|
|
|
|
475 |
}
|
476 |
|
477 |
+
public function callback_gform_forms_post_import( $forms ) {
|
478 |
+
$forms_total = count( $forms );
|
479 |
+
$forms_label = ( 1 === $forms_total ) ? 'form' : 'forms';
|
480 |
+
$forms_ids = wp_list_pluck( $forms, 'id' );
|
481 |
+
$forms_titles = wp_list_pluck( $forms, 'title' );
|
482 |
+
|
483 |
$this->log(
|
484 |
+
__( '%d ' . $forms_label . ' imported', 'stream' ),
|
485 |
+
array(
|
486 |
+
'count' => $forms_total,
|
487 |
+
'ids' => $forms_ids,
|
488 |
+
'titles' => $forms_titles,
|
489 |
+
),
|
490 |
null,
|
491 |
'export',
|
492 |
'imported'
|
493 |
);
|
494 |
+
}
|
495 |
+
|
496 |
+
public function callback_gform_export_separator( $dummy, $form_id ) {
|
497 |
+
$form = $this->get_form( $form_id );
|
498 |
+
|
499 |
+
$this->log(
|
500 |
+
__( '"%s" form exported', 'stream' ),
|
501 |
+
array(
|
502 |
+
'form_title' => $form['title'],
|
503 |
+
'form_id' => $form_id,
|
504 |
+
),
|
505 |
+
$form_id,
|
506 |
+
'export',
|
507 |
+
'exported'
|
508 |
+
);
|
509 |
|
510 |
return $dummy;
|
511 |
}
|
529 |
return $dummy;
|
530 |
}
|
531 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
532 |
public function callback_gform_delete_lead( $lead_id ) {
|
533 |
+
$lead = $this->get_lead( $lead_id );
|
534 |
$form = $this->get_form( $lead['form_id'] );
|
535 |
|
536 |
$this->log(
|
546 |
);
|
547 |
}
|
548 |
|
549 |
+
public function callback_gform_post_note_added( $note_id, $lead_id, $user_id, $user_name, $note, $note_type ) {
|
550 |
+
unset( $user_id );
|
551 |
+
unset( $user_name );
|
552 |
+
unset( $note );
|
553 |
+
unset( $note_type );
|
554 |
+
|
555 |
$lead = \GFFormsModel::get_lead( $lead_id );
|
556 |
$form = $this->get_form( $lead['form_id'] );
|
557 |
|
569 |
);
|
570 |
}
|
571 |
|
572 |
+
public function callback_gform_pre_note_deleted( $note_id, $lead_id ) {
|
573 |
+
$lead = $this->get_lead( $lead_id );
|
574 |
$form = $this->get_form( $lead['form_id'] );
|
575 |
|
576 |
$this->log(
|
588 |
}
|
589 |
|
590 |
public function callback_gform_update_status( $lead_id, $status, $prev = '' ) {
|
591 |
+
$lead = $this->get_lead( $lead_id );
|
592 |
$form = $this->get_form( $lead['form_id'] );
|
593 |
|
594 |
if ( 'active' === $status && 'trash' === $prev ) {
|
626 |
);
|
627 |
}
|
628 |
|
629 |
+
/**
|
630 |
+
* Callback fired when an entry is read/unread
|
631 |
+
*
|
632 |
+
* @param int $lead_id
|
633 |
+
* @param int $status
|
634 |
+
* @return void
|
635 |
+
*/
|
636 |
public function callback_gform_update_is_read( $lead_id, $status ) {
|
637 |
+
$lead = $this->get_lead( $lead_id );
|
638 |
+
$form = $this->get_form( $lead['form_id'] );
|
639 |
+
$status = ( ! empty( $status ) ) ? esc_html__( 'read', 'stream' ) : esc_html__( 'unread', 'stream' );
|
640 |
|
641 |
$this->log(
|
642 |
sprintf(
|
643 |
+
__( 'Entry #%1$d marked as %2$s on form #%3$d ("%4$s")', 'stream' ),
|
644 |
$lead_id,
|
645 |
+
$status,
|
646 |
+
$form['id'],
|
647 |
$form['title']
|
648 |
),
|
649 |
array(
|
650 |
+
'lead_id' => $lead_id,
|
651 |
+
'lead_status' => $status,
|
652 |
+
'form_id' => $form['id'],
|
653 |
+
'form_title' => $form['title'],
|
654 |
),
|
655 |
$lead_id,
|
656 |
'entries',
|
658 |
);
|
659 |
}
|
660 |
|
661 |
+
/**
|
662 |
+
* Callback fired when an entry is starred/unstarred
|
663 |
+
*
|
664 |
+
* @param int $lead_id
|
665 |
+
* @param int $status
|
666 |
+
* @return void
|
667 |
+
*/
|
668 |
public function callback_gform_update_is_starred( $lead_id, $status ) {
|
669 |
+
$lead = $this->get_lead( $lead_id );
|
670 |
+
$form = $this->get_form( $lead['form_id'] );
|
671 |
+
$status = ( ! empty( $status ) ) ? esc_html__( 'starred', 'stream' ) : esc_html__( 'unstarred', 'stream' );
|
672 |
+
$action = $status;
|
673 |
|
674 |
$this->log(
|
675 |
sprintf(
|
676 |
+
__( 'Entry #%1$d %2$s on form #%3$d ("%4$s")', 'stream' ),
|
677 |
$lead_id,
|
678 |
+
$status,
|
679 |
+
$form['id'],
|
680 |
$form['title']
|
681 |
),
|
682 |
array(
|
683 |
+
'lead_id' => $lead_id,
|
684 |
+
'lead_status' => $status,
|
685 |
+
'form_id' => $form['id'],
|
686 |
+
'form_title' => $form['title'],
|
687 |
),
|
688 |
$lead_id,
|
689 |
'entries',
|
690 |
+
$action
|
691 |
+
);
|
692 |
+
}
|
693 |
+
|
694 |
+
/**
|
695 |
+
* Callback fired when a form is deleted
|
696 |
+
*
|
697 |
+
* @param int $form_id Form ID
|
698 |
+
* @return void
|
699 |
+
*/
|
700 |
+
public function callback_gform_before_delete_form( $form_id ) {
|
701 |
+
$this->log_form_action( $form_id, 'deleted' );
|
702 |
+
}
|
703 |
+
|
704 |
+
/**
|
705 |
+
* Callback fired when a form is trashed
|
706 |
+
*
|
707 |
+
* @param int $form_id Form ID
|
708 |
+
* @return void
|
709 |
+
*/
|
710 |
+
public function callback_gform_post_form_trashed( $form_id ) {
|
711 |
+
$this->log_form_action( $form_id, 'trashed' );
|
712 |
+
}
|
713 |
+
|
714 |
+
/**
|
715 |
+
* Callback fired when a form is restored
|
716 |
+
*
|
717 |
+
* @param int $form_id Form ID
|
718 |
+
* @return void
|
719 |
+
*/
|
720 |
+
public function callback_gform_post_form_restored( $form_id ) {
|
721 |
+
$this->log_form_action( $form_id, 'untrashed' );
|
722 |
+
}
|
723 |
+
|
724 |
+
/**
|
725 |
+
* Callback fired when a form is activated
|
726 |
+
*
|
727 |
+
* @param int $form_id Form ID
|
728 |
+
* @return void
|
729 |
+
*/
|
730 |
+
public function callback_gform_post_form_activated( $form_id ) {
|
731 |
+
$this->log_form_action( $form_id, 'activated' );
|
732 |
+
}
|
733 |
+
|
734 |
+
/**
|
735 |
+
* Callback fired when a form is deactivated
|
736 |
+
*
|
737 |
+
* @param int $form_id Form ID
|
738 |
+
* @return void
|
739 |
+
*/
|
740 |
+
public function callback_gform_post_form_deactivated( $form_id ) {
|
741 |
+
$this->log_form_action( $form_id, 'deactivated' );
|
742 |
+
}
|
743 |
+
|
744 |
+
/**
|
745 |
+
* Callback fired when a form is duplicated
|
746 |
+
*
|
747 |
+
* @param int $form_id Form ID
|
748 |
+
* @return void
|
749 |
+
*/
|
750 |
+
public function callback_gform_post_form_duplicated( $form_id ) {
|
751 |
+
$this->log_form_action( $form_id, 'duplicated' );
|
752 |
+
}
|
753 |
+
|
754 |
+
/**
|
755 |
+
* Callback fired when a form's views are reset
|
756 |
+
*
|
757 |
+
* @param int $form_id Form ID
|
758 |
+
* @return void
|
759 |
+
*/
|
760 |
+
public function callback_gform_post_form_views_deleted( $form_id ) {
|
761 |
+
$this->log_form_action( $form_id, 'views_deleted' );
|
762 |
+
}
|
763 |
+
|
764 |
+
/**
|
765 |
+
* Track status change of forms
|
766 |
+
*
|
767 |
+
* @param int $form_id
|
768 |
+
* @param string $action
|
769 |
+
* @return void
|
770 |
+
*/
|
771 |
+
public function log_form_action( $form_id, $action ) {
|
772 |
+
$form = $this->get_form( $form_id );
|
773 |
+
|
774 |
+
if ( empty( $form ) ) {
|
775 |
+
return;
|
776 |
+
}
|
777 |
+
|
778 |
+
$actions = array(
|
779 |
+
'activated' => esc_html__( 'Activated', 'stream' ),
|
780 |
+
'deactivated' => esc_html__( 'Deactivated', 'stream' ),
|
781 |
+
'trashed' => esc_html__( 'Trashed', 'stream' ),
|
782 |
+
'untrashed' => esc_html__( 'Restored', 'stream' ),
|
783 |
+
'duplicated' => esc_html__( 'Duplicated', 'stream' ),
|
784 |
+
'deleted' => esc_html__( 'Deleted', 'stream' ),
|
785 |
+
'views_deleted' => esc_html__( 'Views Reset', 'stream' ),
|
786 |
+
);
|
787 |
+
|
788 |
+
$this->log(
|
789 |
+
sprintf(
|
790 |
+
__( 'Form #%1$d ("%2$s") %3$s', 'stream' ),
|
791 |
+
$form_id,
|
792 |
+
$form['title'],
|
793 |
+
strtolower( $actions[ $action ] )
|
794 |
+
),
|
795 |
+
array(
|
796 |
+
'form_id' => $form_id,
|
797 |
+
'form_title' => $form['title'],
|
798 |
+
'form_status' => strtolower( $action ),
|
799 |
+
),
|
800 |
+
$form['id'],
|
801 |
+
'forms',
|
802 |
+
$action
|
803 |
);
|
804 |
}
|
805 |
|
806 |
+
/**
|
807 |
+
* Helper function to get a single entry
|
808 |
+
*
|
809 |
+
* @param int $lead_id Lead ID
|
810 |
+
* @return array
|
811 |
+
*/
|
812 |
+
private function get_lead( $lead_id ) {
|
813 |
+
return \GFFormsModel::get_lead( $lead_id );
|
814 |
+
}
|
815 |
+
|
816 |
+
/**
|
817 |
+
* Helper function to get a single form
|
818 |
+
*
|
819 |
+
* @param int $form_id Form ID
|
820 |
+
* @return array
|
821 |
+
*/
|
822 |
private function get_form( $form_id ) {
|
823 |
+
return \GFFormsModel::get_form_meta( $form_id );
|
824 |
}
|
825 |
}
|
connectors/class-connector-jetpack.php
CHANGED
@@ -77,7 +77,7 @@ class Connector_Jetpack extends Connector {
|
|
77 |
public function get_action_labels() {
|
78 |
return array(
|
79 |
'activated' => esc_html_x( 'Activated', 'jetpack', 'stream' ),
|
80 |
-
'deactivated' => esc_html_x( '
|
81 |
'register' => esc_html_x( 'Connected', 'jetpack', 'stream' ),
|
82 |
'disconnect' => esc_html_x( 'Disconnected', 'jetpack', 'stream' ),
|
83 |
'authorize' => esc_html_x( 'Link', 'jetpack', 'stream' ),
|
77 |
public function get_action_labels() {
|
78 |
return array(
|
79 |
'activated' => esc_html_x( 'Activated', 'jetpack', 'stream' ),
|
80 |
+
'deactivated' => esc_html_x( 'Deactivated', 'jetpack', 'stream' ),
|
81 |
'register' => esc_html_x( 'Connected', 'jetpack', 'stream' ),
|
82 |
'disconnect' => esc_html_x( 'Disconnected', 'jetpack', 'stream' ),
|
83 |
'authorize' => esc_html_x( 'Link', 'jetpack', 'stream' ),
|
connectors/class-connector-posts.php
CHANGED
@@ -363,18 +363,19 @@ class Connector_Posts extends Connector {
|
|
363 |
global $wpdb;
|
364 |
|
365 |
$revision_id = $wpdb->get_var( // db call okay
|
366 |
-
|
367 |
-
|
|
|
368 |
FROM $wpdb->posts AS p
|
369 |
WHERE p.post_date {$operator} %s
|
370 |
AND p.post_type = 'revision'
|
371 |
AND p.post_parent = %d
|
372 |
ORDER BY p.post_date {$order}
|
373 |
-
LIMIT 1
|
374 |
-
",
|
375 |
$revision->post_date,
|
376 |
$revision->post_parent
|
377 |
)
|
|
|
378 |
);
|
379 |
|
380 |
$revision_id = absint( $revision_id );
|
363 |
global $wpdb;
|
364 |
|
365 |
$revision_id = $wpdb->get_var( // db call okay
|
366 |
+
// @codingStandardsIgnoreStart
|
367 |
+
$wpdb->prepare(
|
368 |
+
"SELECT p.ID
|
369 |
FROM $wpdb->posts AS p
|
370 |
WHERE p.post_date {$operator} %s
|
371 |
AND p.post_type = 'revision'
|
372 |
AND p.post_parent = %d
|
373 |
ORDER BY p.post_date {$order}
|
374 |
+
LIMIT 1",
|
|
|
375 |
$revision->post_date,
|
376 |
$revision->post_parent
|
377 |
)
|
378 |
+
// @codingStandardsIgnoreEnd prepare okay
|
379 |
);
|
380 |
|
381 |
$revision_id = absint( $revision_id );
|
includes/db-updates.php
CHANGED
@@ -10,17 +10,14 @@
|
|
10 |
function wp_stream_update_302( $db_version, $current_version ) {
|
11 |
global $wpdb;
|
12 |
|
13 |
-
$
|
14 |
-
$prefix = $plugin->install->table_prefix;
|
15 |
-
|
16 |
-
$stream_entries = $wpdb->get_results( "SELECT * FROM {$prefix}stream" );
|
17 |
foreach ( $stream_entries as $entry ) {
|
18 |
$class = 'Connector_' . $entry->context;
|
19 |
if ( class_exists( $class ) ) {
|
20 |
$connector = new $class();
|
21 |
-
$wpdb->update( $
|
22 |
} else {
|
23 |
-
$wpdb->update( $
|
24 |
}
|
25 |
}
|
26 |
|
@@ -41,17 +38,17 @@ function wp_stream_update_auto_300( $db_version, $current_version ) {
|
|
41 |
global $wpdb;
|
42 |
|
43 |
// Get only the author_meta values that are double-serialized
|
44 |
-
$
|
45 |
-
$prefix = $plugin->install->table_prefix;
|
46 |
-
|
47 |
-
$wpdb->query( "RENAME TABLE {$prefix}stream TO {$prefix}stream_tmp, {$prefix}stream_context TO {$prefix}stream_context_tmp" );
|
48 |
|
|
|
49 |
$plugin->install->install( $current_version );
|
50 |
|
51 |
-
$stream_entries = $wpdb->get_results( "SELECT * FROM {$
|
52 |
|
53 |
foreach ( $stream_entries as $entry ) {
|
54 |
-
$context = $wpdb->get_row(
|
|
|
|
|
55 |
|
56 |
$new_entry = array(
|
57 |
'site_id' => $entry->site_id,
|
@@ -70,10 +67,10 @@ function wp_stream_update_auto_300( $db_version, $current_version ) {
|
|
70 |
$new_entry['object_id'] = $entry->object_id;
|
71 |
}
|
72 |
|
73 |
-
$wpdb->insert( $
|
74 |
}
|
75 |
|
76 |
-
$wpdb->query( "DROP TABLE {$
|
77 |
|
78 |
return $current_version;
|
79 |
}
|
10 |
function wp_stream_update_302( $db_version, $current_version ) {
|
11 |
global $wpdb;
|
12 |
|
13 |
+
$stream_entries = $wpdb->get_results( "SELECT * FROM {$wpdb->base_prefix}stream" );
|
|
|
|
|
|
|
14 |
foreach ( $stream_entries as $entry ) {
|
15 |
$class = 'Connector_' . $entry->context;
|
16 |
if ( class_exists( $class ) ) {
|
17 |
$connector = new $class();
|
18 |
+
$wpdb->update( $wpdb->base_prefix . 'stream', array( 'connector' => $connector->name ), array( 'ID' => $entry->ID ) );
|
19 |
} else {
|
20 |
+
$wpdb->update( $wpdb->base_prefix . 'stream', array( 'connector' => strtolower( $entry->connector ) ), array( 'ID' => $entry->ID ) );
|
21 |
}
|
22 |
}
|
23 |
|
38 |
global $wpdb;
|
39 |
|
40 |
// Get only the author_meta values that are double-serialized
|
41 |
+
$wpdb->query( "RENAME TABLE {$wpdb->base_prefix}stream TO {$wpdb->base_prefix}stream_tmp, {$wpdb->base_prefix}stream_context TO {$wpdb->base_prefix}stream_context_tmp" );
|
|
|
|
|
|
|
42 |
|
43 |
+
$plugin = wp_stream_get_instance();
|
44 |
$plugin->install->install( $current_version );
|
45 |
|
46 |
+
$stream_entries = $wpdb->get_results( "SELECT * FROM {$wpdb->base_prefix}stream_tmp" );
|
47 |
|
48 |
foreach ( $stream_entries as $entry ) {
|
49 |
+
$context = $wpdb->get_row(
|
50 |
+
$wpdb->prepare( "SELECT * FROM {$wpdb->base_prefix}stream_context_tmp WHERE record_id = %s LIMIT 1", $entry->ID )
|
51 |
+
);
|
52 |
|
53 |
$new_entry = array(
|
54 |
'site_id' => $entry->site_id,
|
67 |
$new_entry['object_id'] = $entry->object_id;
|
68 |
}
|
69 |
|
70 |
+
$wpdb->insert( $wpdb->base_prefix . 'stream', $new_entry );
|
71 |
}
|
72 |
|
73 |
+
$wpdb->query( "DROP TABLE {$wpdb->base_prefix}stream_tmp, {$wpdb->base_prefix}stream_context_tmp" );
|
74 |
|
75 |
return $current_version;
|
76 |
}
|
readme.md
CHANGED
@@ -8,7 +8,7 @@ Stream is the easiest and safest way to track content changes happening to your
|
|
8 |
**Tags:** [actions](https://wordpress.org/plugins/tags/actions), [activity](https://wordpress.org/plugins/tags/activity), [activity log](https://wordpress.org/plugins/tags/activity log), [activity logs](https://wordpress.org/plugins/tags/activity logs), [admin actions](https://wordpress.org/plugins/tags/admin actions), [analytics](https://wordpress.org/plugins/tags/analytics), [audit](https://wordpress.org/plugins/tags/audit), [audit log](https://wordpress.org/plugins/tags/audit log), [audit logs](https://wordpress.org/plugins/tags/audit logs), [change](https://wordpress.org/plugins/tags/change), [changes](https://wordpress.org/plugins/tags/changes), [dashboard](https://wordpress.org/plugins/tags/dashboard), [log](https://wordpress.org/plugins/tags/log), [logs](https://wordpress.org/plugins/tags/logs), [stream](https://wordpress.org/plugins/tags/stream), [tracking](https://wordpress.org/plugins/tags/tracking), [troubleshooting](https://wordpress.org/plugins/tags/troubleshooting), [wp stream](https://wordpress.org/plugins/tags/wp stream)
|
9 |
**Requires at least:** 3.7
|
10 |
**Tested up to:** 4.2
|
11 |
-
**Stable tag:** 3.0.
|
12 |
**License:** [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html)
|
13 |
|
14 |
[![Build Status](https://travis-ci.org/xwp/stream.png?branch=master)](https://travis-ci.org/xwp/stream) [![Join the chat at https://gitter.im/xwp/stream](https://badges.gitter.im/Joinhat.svg)](https://gitter.im/xwp/stream)
|
@@ -89,6 +89,16 @@ Thank you for wanting to make Stream better for everyone! We salute you.
|
|
89 |
|
90 |
## Changelog ##
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
### 3.0.2 - October 2, 2015 ###
|
93 |
* Tweak: Helper function for running Stream queries added ([#774](https://github.com/xwp/stream/pull/774))
|
94 |
* Tweak: Migration dialog removed ([76e809f](https://github.com/xwp/stream/commit/76e809f9abb3dd691b755cf943b50a76a3ffb488))
|
8 |
**Tags:** [actions](https://wordpress.org/plugins/tags/actions), [activity](https://wordpress.org/plugins/tags/activity), [activity log](https://wordpress.org/plugins/tags/activity log), [activity logs](https://wordpress.org/plugins/tags/activity logs), [admin actions](https://wordpress.org/plugins/tags/admin actions), [analytics](https://wordpress.org/plugins/tags/analytics), [audit](https://wordpress.org/plugins/tags/audit), [audit log](https://wordpress.org/plugins/tags/audit log), [audit logs](https://wordpress.org/plugins/tags/audit logs), [change](https://wordpress.org/plugins/tags/change), [changes](https://wordpress.org/plugins/tags/changes), [dashboard](https://wordpress.org/plugins/tags/dashboard), [log](https://wordpress.org/plugins/tags/log), [logs](https://wordpress.org/plugins/tags/logs), [stream](https://wordpress.org/plugins/tags/stream), [tracking](https://wordpress.org/plugins/tags/tracking), [troubleshooting](https://wordpress.org/plugins/tags/troubleshooting), [wp stream](https://wordpress.org/plugins/tags/wp stream)
|
9 |
**Requires at least:** 3.7
|
10 |
**Tested up to:** 4.2
|
11 |
+
**Stable tag:** 3.0.3
|
12 |
**License:** [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html)
|
13 |
|
14 |
[![Build Status](https://travis-ci.org/xwp/stream.png?branch=master)](https://travis-ci.org/xwp/stream) [![Join the chat at https://gitter.im/xwp/stream](https://badges.gitter.im/Joinhat.svg)](https://gitter.im/xwp/stream)
|
89 |
|
90 |
## Changelog ##
|
91 |
|
92 |
+
### 3.0.3 - November 6, 2015 ###
|
93 |
+
* Tweak: Better compatibility with upcoming WordPress 4.4 ([2b2493c](https://github.com/xwp/stream/commit/2b2493ccb3ef6cba5aeb773433fdb5f0d414e8f3))
|
94 |
+
* Tweak: Minor security improvements
|
95 |
+
* Fix: New and improved Gravity Forms connector, works much better ([#780](https://github.com/xwp/stream/pull/780)) (thanks [Rob](https://github.com/rob)!)
|
96 |
+
* Fix: Stream no longer explodes on < PHP 5.3, when trying to tell you that it explodes on < PHP 5.3 ([#781](https://github.com/xwp/stream/pull/781))
|
97 |
+
* Fix: Fixed a smal typo ([62455c5](https://github.com/xwp/stream/commit/62455c518b95ddaf5e6c6c0733e7d03e5aa1311c))
|
98 |
+
* Fix: Multiple Multisite Mistakes Mended ([#788](https://github.com/xwp/stream/pull/788))
|
99 |
+
* Fix: Internet Explorer 8 fix!! IE8!? Come on, people, it's 2015. ([#789](https://github.com/xwp/stream/pull/789))
|
100 |
+
* Fix: EDD connector bug ([#790](https://github.com/xwp/stream/pull/790))
|
101 |
+
|
102 |
### 3.0.2 - October 2, 2015 ###
|
103 |
* Tweak: Helper function for running Stream queries added ([#774](https://github.com/xwp/stream/pull/774))
|
104 |
* Tweak: Migration dialog removed ([76e809f](https://github.com/xwp/stream/commit/76e809f9abb3dd691b755cf943b50a76a3ffb488))
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: fjarrett, lukecarbis, shadyvb, westonruter, stream, xwp
|
|
3 |
Tags: actions, activity, activity log, activity logs, admin actions, analytics, audit, audit log, audit logs, change, changes, dashboard, log, logs, stream, tracking, troubleshooting, wp stream
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 4.2
|
6 |
-
Stable tag: 3.0.
|
7 |
License: GPLv2 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -77,6 +77,17 @@ Thank you for wanting to make Stream better for everyone! We salute you.
|
|
77 |
|
78 |
== Changelog ==
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
= 3.0.2 - October 2, 2015 =
|
81 |
|
82 |
* Tweak: Helper function for running Stream queries added ([#774](https://github.com/xwp/stream/pull/774))
|
3 |
Tags: actions, activity, activity log, activity logs, admin actions, analytics, audit, audit log, audit logs, change, changes, dashboard, log, logs, stream, tracking, troubleshooting, wp stream
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 4.2
|
6 |
+
Stable tag: 3.0.3
|
7 |
License: GPLv2 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
77 |
|
78 |
== Changelog ==
|
79 |
|
80 |
+
= 3.0.3 - November 6, 2015 =
|
81 |
+
|
82 |
+
* Tweak: Better compatibility with upcoming WordPress 4.4 ([2b2493c](https://github.com/xwp/stream/commit/2b2493ccb3ef6cba5aeb773433fdb5f0d414e8f3))
|
83 |
+
* Tweak: Minor security improvements
|
84 |
+
* Fix: New and improved Gravity Forms connector, works much better ([#780](https://github.com/xwp/stream/pull/780)) (thanks [Rob](https://github.com/rob)!)
|
85 |
+
* Fix: Stream no longer explodes on < PHP 5.3, when trying to tell you that it explodes on < PHP 5.3 ([#781](https://github.com/xwp/stream/pull/781))
|
86 |
+
* Fix: Fixed a smal typo ([62455c5](https://github.com/xwp/stream/commit/62455c518b95ddaf5e6c6c0733e7d03e5aa1311c))
|
87 |
+
* Fix: Multiple Multisite Mistakes Mended ([#788](https://github.com/xwp/stream/pull/788))
|
88 |
+
* Fix: Internet Explorer 8 fix!! IE8!? Come on, people, it's 2015. ([#789](https://github.com/xwp/stream/pull/789))
|
89 |
+
* Fix: EDD connector bug ([#790](https://github.com/xwp/stream/pull/790))
|
90 |
+
|
91 |
= 3.0.2 - October 2, 2015 =
|
92 |
|
93 |
* Tweak: Helper function for running Stream queries added ([#774](https://github.com/xwp/stream/pull/774))
|
stream.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Stream
|
4 |
* Plugin URI: https://wp-stream.com/
|
5 |
* Description: Stream tracks logged-in user activity so you can monitor every change made on your WordPress site in beautifully organized detail. All activity is organized by context, action and IP address for easy filtering. Developers can extend Stream with custom connectors to log any kind of action.
|
6 |
-
* Version: 3.0.
|
7 |
* Author: XWP
|
8 |
* Author URI: https://xwp.co/
|
9 |
* License: GPLv2+
|
@@ -34,7 +34,10 @@ if ( ! version_compare( PHP_VERSION, '5.3', '>=' ) ) {
|
|
34 |
add_action( 'shutdown', 'wp_stream_fail_php_version' );
|
35 |
} else {
|
36 |
require __DIR__ . '/classes/class-plugin.php';
|
37 |
-
$
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
/**
|
3 |
* Plugin Name: Stream
|
4 |
* Plugin URI: https://wp-stream.com/
|
5 |
* Description: Stream tracks logged-in user activity so you can monitor every change made on your WordPress site in beautifully organized detail. All activity is organized by context, action and IP address for easy filtering. Developers can extend Stream with custom connectors to log any kind of action.
|
6 |
+
* Version: 3.0.3
|
7 |
* Author: XWP
|
8 |
* Author URI: https://xwp.co/
|
9 |
* License: GPLv2+
|
34 |
add_action( 'shutdown', 'wp_stream_fail_php_version' );
|
35 |
} else {
|
36 |
require __DIR__ . '/classes/class-plugin.php';
|
37 |
+
$plugin_class_name = 'WP_Stream\Plugin';
|
38 |
+
if ( class_exists( $plugin_class_name ) ) {
|
39 |
+
$GLOBALS['wp_stream'] = new $plugin_class_name();
|
40 |
+
}
|
41 |
}
|
42 |
|
43 |
/**
|
tests/tests/test-class-db.php
CHANGED
@@ -107,7 +107,7 @@ class Test_DB extends WP_StreamTestCase {
|
|
107 |
|
108 |
private function dummy_stream_data() {
|
109 |
return array(
|
110 |
-
'object_id' =>
|
111 |
'site_id' => '1',
|
112 |
'blog_id' => get_current_blog_id(),
|
113 |
'user_id' => '1',
|
107 |
|
108 |
private function dummy_stream_data() {
|
109 |
return array(
|
110 |
+
'object_id' => 9,
|
111 |
'site_id' => '1',
|
112 |
'blog_id' => get_current_blog_id(),
|
113 |
'user_id' => '1',
|
ui/js/admin.js
CHANGED
@@ -233,7 +233,7 @@ jQuery( function( $ ) {
|
|
233 |
var all_hidden = true;
|
234 |
|
235 |
// If all filters are hidden, hide the button
|
236 |
-
if ( $( 'div.metabox-prefs [
|
237 |
all_hidden = false;
|
238 |
}
|
239 |
|
@@ -255,7 +255,7 @@ jQuery( function( $ ) {
|
|
255 |
}
|
256 |
}
|
257 |
|
258 |
-
if ( $( 'div.metabox-prefs [
|
259 |
$( 'div.date-interval' ).show();
|
260 |
} else {
|
261 |
$( 'div.date-interval' ).hide();
|
@@ -264,7 +264,7 @@ jQuery( function( $ ) {
|
|
264 |
$( 'div.actions select.chosen-select' ).each( function() {
|
265 |
var name = $( this ).prop( 'name' );
|
266 |
|
267 |
-
if ( $( 'div.metabox-prefs [
|
268 |
$( this ).prev( '.select2-container' ).show();
|
269 |
} else {
|
270 |
$( this ).prev( '.select2-container' ).hide();
|
233 |
var all_hidden = true;
|
234 |
|
235 |
// If all filters are hidden, hide the button
|
236 |
+
if ( $( 'div.metabox-prefs [name="date-hide"]' ).is( ':checked' ) ) {
|
237 |
all_hidden = false;
|
238 |
}
|
239 |
|
255 |
}
|
256 |
}
|
257 |
|
258 |
+
if ( $( 'div.metabox-prefs [name="date-hide"]' ).is( ':checked' ) ) {
|
259 |
$( 'div.date-interval' ).show();
|
260 |
} else {
|
261 |
$( 'div.date-interval' ).hide();
|
264 |
$( 'div.actions select.chosen-select' ).each( function() {
|
265 |
var name = $( this ).prop( 'name' );
|
266 |
|
267 |
+
if ( $( 'div.metabox-prefs [name="' + name + '-hide"]' ).is( ':checked' ) ) {
|
268 |
$( this ).prev( '.select2-container' ).show();
|
269 |
} else {
|
270 |
$( this ).prev( '.select2-container' ).hide();
|