Skip to content

Commit

Permalink
Fix for people using outdated php versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawngee committed Nov 21, 2019
1 parent f3dbad8 commit c7c4ae6
Show file tree
Hide file tree
Showing 22 changed files with 39 additions and 26 deletions.
9 changes: 9 additions & 0 deletions classes/Tools/ToolsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,15 @@ function ( $setting, $oldValue = null, $newValue = null ) {
Tracker::trackSettings();
}
} );
if ( !defined( 'PHP_MAJOR_VERSION' ) || PHP_MAJOR_VERSION < 7 ) {
NoticeManager::instance()->displayAdminNotice(
'warning',
'Media Cloud will stop supporting PHP 5 in the next major release of Media Cloud. You should contact your hosting provider about upgrading.',
true,
'media-cloud-php-56-warning',
30
);
}
}

protected function setup()
Expand Down
2 changes: 1 addition & 1 deletion classes/Wizard/Config/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function description() {
/**
* @return mixed|null
*/
function default() {
function defaultValue() {
return $this->default;
}

Expand Down
2 changes: 1 addition & 1 deletion classes/Wizard/Config/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function introView() {
/**
* @return string|null
*/
public function class() {
public function groupClass() {
return $this->class;
}

Expand Down
2 changes: 1 addition & 1 deletion classes/Wizard/Config/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function next() {
/**
* @return string|null
*/
public function class() {
public function optionClass() {
return $this->class;
}

Expand Down
2 changes: 1 addition & 1 deletion classes/Wizard/Config/Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function id() {
/**
* @return string|null
*/
public function class() {
public function sectionClass() {
return $this->class;
}

Expand Down
4 changes: 2 additions & 2 deletions classes/Wizard/Config/Step.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function type() {
/**
* @return string|null
*/
function class() {
function stepClass() {
return $this->class;
}

Expand Down Expand Up @@ -226,7 +226,7 @@ function next() {
/**
* @return string|null
*/
function return() {
function returnLink() {
return $this->return;
}

Expand Down
4 changes: 2 additions & 2 deletions ilab-media-tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Plugin URI: https://github.com/interfacelab/ilab-media-tools
Description: Automatically upload media to Amazon S3 and integrate with Imgix, a real-time image processing CDN. Boosts site performance and simplifies workflows.
Author: interfacelab
Version: 3.3.2
Version: 3.3.3
Author URI: http://interfacelab.io
*/
// Copyright (c) 2016 Interfacelab LLC. All rights reserved.
Expand Down Expand Up @@ -93,7 +93,7 @@
}

// Version Defines
define( 'MEDIA_CLOUD_VERSION', '3.3.2' );
define( 'MEDIA_CLOUD_VERSION', '3.3.3' );
define( 'MEDIA_CLOUD_INFO_VERSION', '1.0.0' );
// Directory defines
define( 'ILAB_TOOLS_DIR', dirname( __FILE__ ) );
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ No, I'm just one very enthusiastic customer.

== Changelog ==

= 3.3.3 =

* Fixes for PHP 5.6 - people, it's time to upgrade to PHP 7.x!

= 3.3.2 =

* Fix for illegal offset error warning
Expand Down
2 changes: 1 addition & 1 deletion views/wizard/section.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php /** @var \ILAB\MediaCloud\Wizard\Config\Section $section */?>
<?php /** @var bool $initial */?>
<div data-id="{{$section->id()}}" class="wizard-section {{$initial ? 'current' : ''}} {{$section->class()}}" data-initial="{{$initial ? 'true' : 'false'}}" data-display-steps="{{$section->displaySteps() ? 'true' : 'false'}}" tabindex="-1">
<div data-id="{{$section->id()}}" class="wizard-section {{$initial ? 'current' : ''}} {{$section->sectionClass()}}" data-initial="{{$initial ? 'true' : 'false'}}" data-display-steps="{{$section->displaySteps() ? 'true' : 'false'}}" tabindex="-1">
@foreach($section->steps() as $step)
@include('wizard.steps.'.$step->type(), ['step' => $step, 'stepIndex' => $loop->index])
@endforeach
Expand Down
2 changes: 1 addition & 1 deletion views/wizard/steps/form-fields/checkbox.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php /** @var \ILAB\MediaCloud\Wizard\Config\Field $field */?>
<div class="form-field field-checkbox">
<div class="checkbox">
@include('base/fields/checkbox', ['name' => $field->name(), 'value' => $field->default(), 'description' => '', 'conditions' => null])
@include('base/fields/checkbox', ['name' => $field->name(), 'value' => $field->defaultValue(), 'description' => '', 'conditions' => null])
</div>
<div class="title">
{{ $field->title() }}
Expand Down
2 changes: 1 addition & 1 deletion views/wizard/steps/form-fields/hidden.blade.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?php /** @var \ILAB\MediaCloud\Wizard\Config\Field $field */?>
<input type="hidden" name="{{$field->name()}}" value="{{$field->default()}}">
<input type="hidden" name="{{$field->name()}}" value="{{$field->defaultValue()}}">
2 changes: 1 addition & 1 deletion views/wizard/steps/form-fields/number.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php /** @var \ILAB\MediaCloud\Wizard\Config\Field $field */?>
<div class="form-field">
<label for="{{$field->name()}}">{{ $field->title() }}</label>
<input type="number" name="{{$field->name()}}" id="{{$field->name()}}" value="{{$field->default()}}" min="{{$field->min()}}" max="{{$field->max()}}" step="{{$field->step()}}" {{$field->required() ? 'required' : ''}}>
<input type="number" name="{{$field->name()}}" id="{{$field->name()}}" value="{{$field->defaultValue()}}" min="{{$field->min()}}" max="{{$field->max()}}" step="{{$field->step()}}" {{$field->required() ? 'required' : ''}}>
</div>
2 changes: 1 addition & 1 deletion views/wizard/steps/form-fields/password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
<div style="display:none">
<input type="password" tabindex="-1">
</div>
<input type="password" placeholder="{{$field->title()}}" name="{{$field->name()}}" id="{{$field->name()}}" value="{{$field->default()}}" {{$field->required() ? 'required' : ''}}>
<input type="password" placeholder="{{$field->title()}}" name="{{$field->name()}}" id="{{$field->name()}}" value="{{$field->defaultValue()}}" {{$field->required() ? 'required' : ''}}>
</div>
4 changes: 2 additions & 2 deletions views/wizard/steps/form-fields/select.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php /** @var \ILAB\MediaCloud\Wizard\Config\Field $field */?>
<div class="form-field">
<label for="{{$field->name()}}">{{ $field->title() }}</label>
<select name="{{$field->name()}}" id="{{$field->name()}}" value="{{$field->default()}}" required>
<select name="{{$field->name()}}" id="{{$field->name()}}" value="{{$field->defaultValue()}}" required>
@foreach($field->options() as $value => $name)
<option value="{{$value}}" {{($value == $field->default()) ? 'selected' : ''}}>{{$name}}</option>
<option value="{{$value}}" {{($value == $field->defaultValue()) ? 'selected' : ''}}>{{$name}}</option>
@endforeach
</select>
</div>
2 changes: 1 addition & 1 deletion views/wizard/steps/form-fields/text-field.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php /** @var \ILAB\MediaCloud\Wizard\Config\Field $field */?>
<div class="form-field">
<label for="{{$field->name()}}">{{ $field->title() }}</label>
<input type="text" name="{{$field->name()}}" placeholder="{{$field->title()}}" id="{{$field->name()}}" value="{{$field->default()}}" {{$field->required() ? 'required' : ''}}>
<input type="text" name="{{$field->name()}}" placeholder="{{$field->title()}}" id="{{$field->name()}}" value="{{$field->defaultValue()}}" {{$field->required() ? 'required' : ''}}>
</div>
2 changes: 1 addition & 1 deletion views/wizard/steps/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php /** @var \ILAB\MediaCloud\Wizard\Config\Step $step */?>
<?php /** @var int $stepIndex */?>
<div data-id="{{$step->id()}}" data-type="{{$step->type()}}" class="wizard-step wizard-step-{{$step->type()}} {{($stepIndex == 0) ? 'current': ''}} {{$step->class()}}" @if(!empty($step->next())) data-next="{{$step->next()}}" @endif @if(!empty($step->return())) data-return="{{$step->return() ? 'true' : 'false'}}" @endif>
<div data-id="{{$step->id()}}" data-type="{{$step->type()}}" class="wizard-step wizard-step-{{$step->type()}} {{($stepIndex == 0) ? 'current': ''}} {{$step->stepClass()}}" @if(!empty($step->next())) data-next="{{$step->next()}}" @endif @if(!empty($step->returnLink())) data-return="{{$step->returnLink() ? 'true' : 'false'}}" @endif>
<div class="step-contents">
@if(!empty($step->introView()))
<div class="intro">
Expand Down
2 changes: 1 addition & 1 deletion views/wizard/steps/intro.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php /** @var \ILAB\MediaCloud\Wizard\Config\Step $step */?>
<?php /** @var int $stepIndex */?>
<div data-id="{{$step->id()}}" data-type="{{$step->type()}}" class="wizard-step wizard-step-{{$step->type()}} {{($stepIndex == 0) ? 'current': ''}} {{$step->class()}}" @if(!empty($step->next())) data-next="{{$step->next()}}" @endif @if(!empty($step->return())) data-return="{{$step->return() ? 'true' : 'false'}}" @endif>
<div data-id="{{$step->id()}}" data-type="{{$step->type()}}" class="wizard-step wizard-step-{{$step->type()}} {{($stepIndex == 0) ? 'current': ''}} {{$step->stepClass()}}" @if(!empty($step->next())) data-next="{{$step->next()}}" @endif @if(!empty($step->returnLink())) data-return="{{$step->returnLink() ? 'true' : 'false'}}" @endif>
<div class="step-contents">
@if(!empty($step->introView()))
<div class="intro">
Expand Down
2 changes: 1 addition & 1 deletion views/wizard/steps/next.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php /** @var \ILAB\MediaCloud\Wizard\Config\Step $step */?>
<?php /** @var int $stepIndex */?>
<div data-id="{{$step->id()}}" data-type="{{$step->type()}}" class="wizard-step wizard-step-{{$step->type()}} {{($stepIndex == 0) ? 'current': ''}} {{$step->class()}}" @if(!empty($step->next())) data-next="{{$step->next()}}" @endif @if(!empty($step->return())) data-return="{{$step->return() ? 'true' : 'false'}}" @endif>
<div data-id="{{$step->id()}}" data-type="{{$step->type()}}" class="wizard-step wizard-step-{{$step->type()}} {{($stepIndex == 0) ? 'current': ''}} {{$step->stepClass()}}" @if(!empty($step->next())) data-next="{{$step->next()}}" @endif @if(!empty($step->returnLink())) data-return="{{$step->returnLink() ? 'true' : 'false'}}" @endif>
<div class="step-contents">
@if(!empty($step->introView()))
<div class="intro">
Expand Down
8 changes: 4 additions & 4 deletions views/wizard/steps/select.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php /** @var \ILAB\MediaCloud\Wizard\Config\Step $step */?>
<?php /** @var int $stepIndex */?>
<div data-id="{{$step->id()}}" data-type="{{$step->type()}}" class="wizard-step wizard-step-{{$step->type()}} {{($stepIndex == 0) ? 'current': ''}} {{$step->class()}}" @if(!empty($step->next())) data-next="{{$step->next()}}" @endif @if(!empty($step->return())) data-return="{{$step->return() ? 'true' : 'false'}}" @endif>
<div data-id="{{$step->id()}}" data-type="{{$step->type()}}" class="wizard-step wizard-step-{{$step->type()}} {{($stepIndex == 0) ? 'current': ''}} {{$step->stepClass()}}" @if(!empty($step->next())) data-next="{{$step->next()}}" @endif @if(!empty($step->returnLink())) data-return="{{$step->returnLink() ? 'true' : 'false'}}" @endif>
@foreach($step->groups() as $group)
<div class="step-contents step-group" data-id="{{$step->id()}}-group-{{$group->index()}}">
<script type="application/json" id="{{$step->id()}}-group-{{$group->index()}}">
Expand All @@ -13,7 +13,7 @@
@endif

<div class="contents">
<ul class="options {{$group->class()}}">
<ul class="options {{$group->groupClass()}}">
@foreach($group->options() as $option)
<li>
@if(!empty($option->descriptionView()))
Expand All @@ -23,15 +23,15 @@
</div>
@endif
@if(!empty($option->link()))
<a class="{{$option->class()}}" href="{{$option->link()}}" @if(!empty($option->target()))target="{{$option->target()}}" @endif tooltip="{{$option->title()}}">
<a class="{{$option->optionClass()}}" href="{{$option->link()}}" @if(!empty($option->target()))target="{{$option->target()}}" @endif tooltip="{{$option->title()}}">
@if(!empty($option->icon()))
<img src="{{ILAB_PUB_IMG_URL.'/'.$option->icon()}}">
@else
{{$option->title()}}
@endif
</a>
@else
<a class="{{$option->class()}}" href="#" tooltip="{{$option->title()}}" data-next="{{$option->next()}}">
<a class="{{$option->optionClass()}}" href="#" tooltip="{{$option->title()}}" data-next="{{$option->next()}}">
@if(!empty($option->icon()))
<img src="{{ILAB_PUB_IMG_URL.'/'.$option->icon()}}">
@else
Expand Down
2 changes: 1 addition & 1 deletion views/wizard/steps/test.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php /** @var \ILAB\MediaCloud\Wizard\Config\Step $step */?>
<?php /** @var int $stepIndex */?>
<div data-id="{{$step->id()}}" data-type="{{$step->type()}}" class="wizard-step wizard-step-{{$step->type()}} {{($stepIndex == 0) ? 'current': ''}} {{$step->class()}}" @if(!empty($step->next())) data-next="{{$step->next()}}" @endif @if(!empty($step->return())) data-return="{{$step->return() ? 'true' : 'false'}}" @endif>
<div data-id="{{$step->id()}}" data-type="{{$step->type()}}" class="wizard-step wizard-step-{{$step->type()}} {{($stepIndex == 0) ? 'current': ''}} {{$step->stepClass()}}" @if(!empty($step->next())) data-next="{{$step->next()}}" @endif @if(!empty($step->returnLink())) data-return="{{$step->returnLink() ? 'true' : 'false'}}" @endif>
<div class="step-contents">
@if(!empty($step->introView()))
<div class="intro">
Expand Down
2 changes: 1 addition & 1 deletion views/wizard/steps/tutorial.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php /** @var \ILAB\MediaCloud\Wizard\Config\Step $step */?>
<?php /** @var int $stepIndex */?>
<div data-id="{{$step->id()}}" data-type="{{$step->type()}}" class="wizard-step wizard-step-{{$step->type()}} {{($stepIndex == 0) ? 'current': ''}} {{$step->class()}}" @if(!empty($step->next())) data-next="{{$step->next()}}" @endif @if(!empty($step->return())) data-return="{{$step->return() ? 'true' : 'false'}}" @endif>
<div data-id="{{$step->id()}}" data-type="{{$step->type()}}" class="wizard-step wizard-step-{{$step->type()}} {{($stepIndex == 0) ? 'current': ''}} {{$step->stepClass()}}" @if(!empty($step->next())) data-next="{{$step->next()}}" @endif @if(!empty($step->returnLink())) data-return="{{$step->returnLink() ? 'true' : 'false'}}" @endif>
<div class="tutorial-container">
<div class="tutorial">
@include($step->introView())
Expand Down
2 changes: 1 addition & 1 deletion views/wizard/steps/video.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php /** @var \ILAB\MediaCloud\Wizard\Config\Step $step */?>
<?php /** @var int $stepIndex */?>
<div data-id="{{$step->id()}}" data-type="{{$step->type()}}" class="wizard-step wizard-step-{{$step->type()}} {{($stepIndex == 0) ? 'current': ''}} {{$step->class()}}" @if(!empty($step->next())) data-next="{{$step->next()}}" @endif @if(!empty($step->return())) data-return="{{$step->return() ? 'true' : 'false'}}" @endif>
<div data-id="{{$step->id()}}" data-type="{{$step->type()}}" class="wizard-step wizard-step-{{$step->type()}} {{($stepIndex == 0) ? 'current': ''}} {{$step->stepClass()}}" @if(!empty($step->next())) data-next="{{$step->next()}}" @endif @if(!empty($step->returnLink())) data-return="{{$step->returnLink() ? 'true' : 'false'}}" @endif>
<div class="step-contents">
<div class="video">
{!! str_replace('feature=oembed', 'feature=oembed&enablejsapi=1', wp_oembed_get($step->videoUrl())) !!}
Expand Down

0 comments on commit c7c4ae6

Please sign in to comment.