Skip to content

Commit

Permalink
Specify version of Node and disable Renovate for Composer because of …
Browse files Browse the repository at this point in the history
…old PHP versions (#1072)
  • Loading branch information
kasparsd authored Mar 20, 2020
1 parent 598c590 commit 4c60b9c
Show file tree
Hide file tree
Showing 21 changed files with 410 additions and 161 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
services:
- mysql

before_install:
- nvm install
- nvm use

install:
- npm install
- export DEV_LIB_PATH="vendor/xwp/wp-dev-lib/scripts"
Expand Down
2 changes: 1 addition & 1 deletion alerts/class-alert-type-ifttt.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public function notify_ifttt( $alert, $recordarr ) {
* @return string
*/
$date_format = apply_filters( 'wp_stream_alert_ifttt_date_format', 'Y-m-d H:i:s', $alert, $recordarr );
$date = date( $date_format, strtotime( $created ) );
$date = gmdate( $date_format, strtotime( $created ) );

$url = 'https://maker.ifttt.com/trigger/' . $alert->alert_meta['event_name'] . '/with/key/' . $alert->alert_meta['maker_key'];

Expand Down
2 changes: 1 addition & 1 deletion classes/class-alerts-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public function enqueue_scripts( $page ) {
wp_register_style(
'wp-stream-alerts-list-css',
$this->plugin->locations['url'] . 'ui/css/alerts-list.' . $min . 'css',
[],
array(),
$this->plugin->get_version()
);

Expand Down
2 changes: 1 addition & 1 deletion classes/class-export.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function build_record( $item, $columns ) {
foreach ( array_keys( $columns ) as $column_name ) {
switch ( $column_name ) {
case 'date':
$created = date( 'Y-m-d H:i:s', strtotime( $record->created ) );
$created = gmdate( 'Y-m-d H:i:s', strtotime( $record->created ) );
$row_out[ $column_name ] = get_date_from_gmt( $created, 'Y/m/d h:i:s A' );
break;

Expand Down
2 changes: 1 addition & 1 deletion classes/class-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public function column_default( $item, $column_name ) {

switch ( $column_name ) {
case 'date':
$created = date( 'Y-m-d H:i:s', strtotime( $record->created ) );
$created = gmdate( 'Y-m-d H:i:s', strtotime( $record->created ) );
$date_string = sprintf(
'<time datetime="%s" class="relative-time record-created">%s</time>',
wp_stream_get_iso_8601_extended_date( strtotime( $record->created ) ),
Expand Down
8 changes: 4 additions & 4 deletions classes/class-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,22 @@ public function query( $args ) {
}

if ( ! empty( $args['date_from'] ) ) {
$date = get_gmt_from_date( date( 'Y-m-d H:i:s', strtotime( $args['date_from'] . ' 00:00:00' ) ) );
$date = get_gmt_from_date( gmdate( 'Y-m-d H:i:s', strtotime( $args['date_from'] . ' 00:00:00' ) ) );
$where .= $wpdb->prepare( " AND DATE($wpdb->stream.created) >= %s", $date );
}

if ( ! empty( $args['date_to'] ) ) {
$date = get_gmt_from_date( date( 'Y-m-d H:i:s', strtotime( $args['date_to'] . ' 23:59:59' ) ) );
$date = get_gmt_from_date( gmdate( 'Y-m-d H:i:s', strtotime( $args['date_to'] . ' 23:59:59' ) ) );
$where .= $wpdb->prepare( " AND DATE($wpdb->stream.created) <= %s", $date );
}

if ( ! empty( $args['date_after'] ) ) {
$date = get_gmt_from_date( date( 'Y-m-d H:i:s', strtotime( $args['date_after'] ) ) );
$date = get_gmt_from_date( gmdate( 'Y-m-d H:i:s', strtotime( $args['date_after'] ) ) );
$where .= $wpdb->prepare( " AND DATE($wpdb->stream.created) > %s", $date );
}

if ( ! empty( $args['date_before'] ) ) {
$date = get_gmt_from_date( date( 'Y-m-d H:i:s', strtotime( $args['date_before'] ) ) );
$date = get_gmt_from_date( gmdate( 'Y-m-d H:i:s', strtotime( $args['date_before'] ) ) );
$where .= $wpdb->prepare( " AND DATE($wpdb->stream.created) < %s", $date );
}

Expand Down
2 changes: 1 addition & 1 deletion connectors/class-connector-mercator.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function get_context_labels() {
*
* @filter wp_stream_action_links_{connector}
*
* @param array $links
* @param array $links
* @param Record $record
*
* @return array
Expand Down
6 changes: 5 additions & 1 deletion connectors/class-connector-user-switching.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ public function log_override( $data ) {
* @param Connectors $connectors The Connectors object instance
*/
public function callback_wp_stream_after_connectors_registration( array $labels, Connectors $connectors ) {
$action = wp_stream_filter_input( INPUT_GET, 'action' ) ?: wp_stream_filter_input( INPUT_POST, 'action' );
$action = wp_stream_filter_input( INPUT_GET, 'action' );

if ( ! $action ) {
$action = wp_stream_filter_input( INPUT_POST, 'action' );
}

if ( ! $action ) {
return;
Expand Down
4 changes: 2 additions & 2 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function wp_stream_get_iso_8601_extended_date( $time = false, $offset = 0 ) {
$offset_string = sprintf( 'Etc/GMT%s%s', $offset < 0 ? '+' : '-', abs( $offset ) );

$timezone = new DateTimeZone( $offset_string );
$date = new DateTime( date( 'Y-m-d H:i:s.' . $micro_seconds, $microtime ), $timezone );
$date = new DateTime( gmdate( 'Y-m-d H:i:s.' . $micro_seconds, $microtime ), $timezone );

return sprintf(
'%s%03d%s',
Expand Down Expand Up @@ -131,7 +131,7 @@ function wp_stream_is_cron_enabled() {
* @return string
*/
function wp_stream_min_suffix() {
$min = '';
$min = '';
$is_script_debugging = ! defined( 'SCRIPT_DEBUG' ) || false === SCRIPT_DEBUG;

if ( apply_filters( 'wp_stream_load_min_assets', $is_script_debugging ) ) {
Expand Down
14 changes: 7 additions & 7 deletions includes/lib/Carbon.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,14 @@ public static function minValue()
*/
public static function create($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
{
$year = ($year === null) ? date('Y') : $year;
$month = ($month === null) ? date('n') : $month;
$day = ($day === null) ? date('j') : $day;
$year = ($year === null) ? gmdate('Y') : $year;
$month = ($month === null) ? gmdate('n') : $month;
$day = ($day === null) ? gmdate('j') : $day;

if ($hour === null) {
$hour = date('G');
$minute = ($minute === null) ? date('i') : $minute;
$second = ($second === null) ? date('s') : $second;
$hour = gmdate('G');
$minute = ($minute === null) ? gmdate('i') : $minute;
$second = ($second === null) ? gmdate('s') : $second;
} else {
$minute = ($minute === null) ? 0 : $minute;
$second = ($second === null) ? 0 : $second;
Expand Down Expand Up @@ -2211,4 +2211,4 @@ public function isBirthday(Carbon $dt)
{
return $this->month === $dt->month && $this->day === $dt->day;
}
}
}
Loading

0 comments on commit 4c60b9c

Please sign in to comment.