PHP Compatibility Checker - Version 1.4.0

Version Description

  • Updated UX for viewing PHP errors to be more intuitive and require less scrolling.
  • Added links for non-technical users who need assistance from developers to fix PHP errors or to test their site in PHP 7 enabled hosting environments.
Download this release

Release Info

Developer wpengine
Plugin Icon 128x128 PHP Compatibility Checker
Version 1.4.0
Comparing to
See all releases

Code changes from version 1.3.2 to 1.4.0

readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === PHP Compatibility Checker ===
2
- Contributors: wpengine, octalmage, stevenkword, Taylor4484, pross
3
  Tags: php 7, php 5.5, php, version, compatibility, checker, wp engine, wpe, wpengine
4
  Requires at least: 3.5
5
- Tested up to: 4.6
6
- Stable tag: 1.3.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -114,6 +114,10 @@ To disclose security issues for this plugin please email WordPress@wpengine.com
114
 
115
  == Changelog ==
116
 
 
 
 
 
117
  = 1.3.2 =
118
  - Added a "Clean up" button and uninstall.php.
119
  - Added phpcompat_phpversions filter.
@@ -183,6 +187,10 @@ To disclose security issues for this plugin please email WordPress@wpengine.com
183
 
184
  == Upgrade Notice ==
185
 
 
 
 
 
186
  = 1.3.2 =
187
  - Added a "Clean up" button and uninstall.php.
188
  - Added phpcompat_phpversions filter.
1
  === PHP Compatibility Checker ===
2
+ Contributors: wpengine, octalmage, stevenkword, Taylor4484, pross, jcross
3
  Tags: php 7, php 5.5, php, version, compatibility, checker, wp engine, wpe, wpengine
4
  Requires at least: 3.5
5
+ Tested up to: 4.7.2
6
+ Stable tag: 1.4.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
114
 
115
  == Changelog ==
116
 
117
+ = 1.4.0 =
118
+ - Updated UX for viewing PHP errors to be more intuitive and require less scrolling.
119
+ - Added links for non-technical users who need assistance from developers to fix PHP errors or to test their site in PHP 7 enabled hosting environments.
120
+
121
  = 1.3.2 =
122
  - Added a "Clean up" button and uninstall.php.
123
  - Added phpcompat_phpversions filter.
187
 
188
  == Upgrade Notice ==
189
 
190
+ = 1.4.0 =
191
+ - Updated UX for viewing PHP errors to be more intuitive and require less scrolling.
192
+ - Added links for non-technical users who need assistance from developers to fix PHP errors or to test their site in PHP 7 enabled hosting environments.
193
+
194
  = 1.3.2 =
195
  - Added a "Clean up" button and uninstall.php.
196
  - Added phpcompat_phpversions filter.
src/css/style.css CHANGED
@@ -1,125 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
- .wpe-results-card
3
- {
4
- background-color: #fff;
5
- border-bottom-color: rgb(221, 221, 221);
6
- border-bottom-style: solid;
7
- border-bottom-width: 1px;
8
- border-left-style: solid;
9
- border-left-width: 6px;
10
- width: 812px;
11
- padding-bottom: 14px;
12
- padding-left: 16px;
13
- padding-right: 16px;
14
- padding-top: 14px;
15
- margin-bottom: 10px;
16
- /*box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.12);*/
17
- }
18
-
19
- .wpe-results-card .inner-left
20
- {
21
  display: inline-block;
22
- letter-spacing: normal;
23
- text-rendering: auto;
24
- vertical-align: top;
25
- width: 48px;
26
  }
27
 
28
- .wpe-results-card .inner-right
29
- {
30
- color: rgb(51, 51, 51);
31
  display: inline-block;
32
- font-family: sans-serif;
33
- letter-spacing: normal;
34
- text-rendering: auto;
35
- vertical-align: top;
36
- width: 450px;
37
- word-spacing: 0px;
38
  }
39
 
40
- .wpe-results-card img
41
- {
42
- width: 25px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
 
45
- .wpe-results-card textarea
46
- {
47
- white-space: nowrap;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  width: 100%;
49
- height: 400px;
50
  }
51
 
52
- .wpe-results-card .view-details
53
- {
54
- font-size: 12px;
55
- color: #c0c0c0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  cursor: pointer;
57
  }
58
 
59
- .wpe-results-card .badge
60
- {
61
- display: inline-block;
62
- color: #fff;
 
 
 
 
63
  text-align: center;
64
- padding: 2px 10px;
 
 
 
 
 
 
 
 
65
  }
66
 
67
- .wpe-update a:link, .wpe-update a:visited, .wpe-update a:hover, .wpe-update a:active { color:#ffffff; cursor: pointer; text-decoration: none; }
 
 
 
 
 
68
 
69
- .wpe-results-card .wpe-update
70
- {
71
- background-color: #0085ba;
72
  }
73
 
74
- .wpe-results-card .warnings
75
- {
76
- margin-left: 5px;
77
- background-color: #f1c40f;
 
78
  }
79
 
80
- .wpe-results-card .errors
81
- {
82
- margin-left: 5px;
83
- background-color: #e74c3c;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  }
85
 
86
- #developerMode textarea
87
- {
88
- width: 100%; height: 500px; background: #FFF; color: #000;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
90
 
91
- #progressbar .ui-progressbar-value
92
- {
93
- background: #0085ba;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  }
95
 
96
- #wpe-progress-count, #wpe-progress-active
97
- {
98
- display: inline;
 
 
 
 
 
 
 
 
99
  }
100
 
101
- /* Tooltip container */
102
- .wpe-tooltip {
103
- position: relative;
104
- display: inline-block;
105
  }
106
 
107
- /* Tooltip text */
108
- .wpe-tooltip .wpe-tooltiptext {
109
- visibility: hidden;
110
- width: 340px;
111
- background-color: black;
112
- color: #fff;
113
- text-align: center;
114
- padding: 5px 0;
115
- border-radius: 6px;
116
- position: absolute;
117
- z-index: 1;
118
- top: -25px;
119
- left: 105%;
120
  }
121
 
122
- /* Show the tooltip text when you mouse over the tooltip container */
123
- .wpe-tooltip:hover .wpe-tooltiptext {
124
- visibility: visible;
125
  }
1
+ .wpe-pcc-wrap .button-primary .dashicons,
2
+ .wpe-pcc-wrap .button-secondary .dashicons {
3
+ line-height: 1.4em;
4
+ }
5
+
6
+ .wpe-pcc-wrap hr {
7
+ margin-top: 20px;
8
+ margin-bottom: 20px;
9
+ }
10
+
11
+ .wpe-pcc-main,
12
+ .wpe-pcc-aside {
13
+ display: table-cell;
14
+ }
15
 
16
+ /* Main container */
17
+ .wpe-pcc-main {
18
+ padding-right: 40px;
19
+ }
20
+
21
+ .wpe-pcc-spinner {
22
+ margin: 4px 0 4px 10px !important;
23
+ padding: 0 !important;
24
+ float: none !important;
25
+ }
26
+
27
+ .wpe-pcc-scan-information {
 
 
 
 
 
 
 
28
  display: inline-block;
 
 
 
 
29
  }
30
 
31
+ #wpe-progress-count {
32
+ margin-left: 10px;
33
+ line-height: 1.8;
34
  display: inline-block;
 
 
 
 
 
 
35
  }
36
 
37
+ /* Sidebar container*/
38
+ .wpe-pcc-aside {
39
+ width: 277px;
40
+ }
41
+
42
+ .wpe-pcc-wrap .wpe-pcc-logo {
43
+ display: block;
44
+ max-width: 182px;
45
+ text-align: center;
46
+ margin: 0 auto;
47
+ }
48
+
49
+ .wpe-pcc-aside h2 {
50
+ line-height: 1.15em;
51
+ text-transform: capitalize;
52
+ }
53
+
54
+ .wpe-pcc-aside-content p {
55
+ margin: 0;
56
+ padding: 0;
57
+ }
58
+
59
+ .wpe-pcc-aside-content {
60
+ border: 1px solid #babec3;
61
+ padding: 20px;
62
+ margin-top: 20px;
63
+ margin-bottom: 20px;
64
+ }
65
+
66
+ .wpe-pcc-aside-content h2:first-child {
67
+ margin-top: 0;
68
  }
69
 
70
+ .wpe-pcc-get-hosting {
71
+ background: #e8e9ea;
72
+ }
73
+
74
+ .wpe-pcc-information .wpe-pcc-button {
75
+ background: #cacdd0;
76
+ color: #87898c;
77
+ }
78
+ .wpe-pcc-information .wpe-pcc-button:hover,
79
+ .wpe-pcc-information .wpe-pcc-button:focus {
80
+ background: #40bac8;
81
+ color: #fff;
82
+ }
83
+
84
+ .wpe-pcc-information input.wpe-pcc-button {
85
+ display: block;
86
+ border: 0 none;
87
  width: 100%;
 
88
  }
89
 
90
+ .wpe-pcc-attention {
91
+ background: #e7e7e7;
92
+ border: 1px dashed #babec3;
93
+ padding: 5px 10px;
94
+ }
95
+
96
+ /* Dev help boxes */
97
+ .wpe-pcc-dev-helper {
98
+ padding-bottom: 35px;
99
+ }
100
+ .wpe-pcc-dev-helper:last-child {
101
+ padding-bottom: 0;
102
+ }
103
+ .wpe-pcc-dev-helper :last-child {
104
+ margin-bottom: 0;
105
+ }
106
+ .wpe-pcc-dev-helper .title {
107
+ margin: 0;
108
+ padding-bottom: 10px;
109
+ text-transform: capitalize;
110
+ }
111
+ .wpe-pcc-dev-helper img+p {
112
+ margin-top: 0;
113
+ }
114
+
115
+ .wpe-pcc-clear-results {
116
+ border: 0 none;
117
+ color: #b4b9be;
118
+ background: none;
119
+ cursor: pointer;
120
+ line-height: 28px;
121
+ margin-left: 10px;
122
+ }
123
+ .wpe-pcc-clear-results:hover,
124
+ .wpe-pcc-clear-results:focus {
125
+ color: #979ea5;
126
  cursor: pointer;
127
  }
128
 
129
+ .wpe-pcc-button {
130
+ display: block;
131
+ padding: 15px;
132
+ margin-top: 20px;
133
+ margin-bottom: 20px;
134
+ text-transform: uppercase;
135
+ font-weight: bold;
136
+ font-size: 14px;
137
  text-align: center;
138
+ background: #40bac8;
139
+ color: #fff;
140
+ text-decoration: none;
141
+ }
142
+ .wpe-pcc-button:hover, .wpe-pcc-button:focus {
143
+ text-decoration: none;
144
+ cursor: pointer;
145
+ background: #3199a5;
146
+ color: #fff;
147
  }
148
 
149
+ .wpe-pcc-button-primary {
150
+ background: #eb6126;
151
+ }
152
+ .wpe-pcc-button-primary:hover, .wpe-pcc-button-primary:focus {
153
+ background: #bf4a18;
154
+ }
155
 
156
+ /* Buttons in sidebar */
157
+ .wpe-pcc-aside-content .wpe-pcc-button {
158
+ max-width: 233px;
159
  }
160
 
161
+ .wpe-pcc-download-report {
162
+ clear: both;
163
+ }
164
+ .wpe-pcc-developer-mode {
165
+ float: right;
166
  }
167
 
168
+ /* Alerts */
169
+ .wpe-pcc-alert {
170
+ background: #fff;
171
+ padding: 10px 20px;
172
+ border-left: 5px solid #fff;
173
+ margin: 5px 0;
174
+ clear: both;
175
+ }
176
+ .wpe-pcc-alert p {
177
+ margin: 0;
178
+ padding: 0;
179
+ }
180
+ .wpe-pcc-alert-details {
181
+ float: right;
182
+ text-decoration: none;
183
+ }
184
+ .wpe-pcc-alert-details:hover, .wpe-pcc-alert-details:focus {
185
+ text-decoration: underline;
186
+ cursor: pointer;
187
+ }
188
+ .wpe-pcc-alert-logs {
189
+ display: block;
190
+ white-space: pre;
191
+ clear: both;
192
+ width: 100%;
193
+ resize: vertical;
194
+ min-height: 250px;
195
+ margin-top: 20px;
196
+ }
197
+ .hide {
198
+ display: none !important;
199
  }
200
 
201
+ /* skipped */
202
+ .wpe-pcc-alert.wpe-pcc-alert-skipped {
203
+ border-color: #999;
204
+ }
205
+ .wpe-pcc-alert-skipped .dashicons-before {
206
+ color: #999;
207
+ }
208
+ /* passed */
209
+ .wpe-pcc-alert.wpe-pcc-alert-passed {
210
+ border-color: #038103;
211
+ }
212
+ .wpe-pcc-alert-passed .dashicons-before {
213
+ color: #038103;
214
+ }
215
+ /* error */
216
+ .wpe-pcc-alert.wpe-pcc-alert-error {
217
+ border-color: #e74c3c;
218
+ }
219
+ .wpe-pcc-alert-error .dashicons-before {
220
+ color: #e74c3c;
221
+ }
222
+ /* warning */
223
+ .wpe-pcc-alert.wpe-pcc-alert-warning {
224
+ border-color: #e8ba1b;
225
+ }
226
+ .wpe-pcc-alert-warning .dashicons-before {
227
+ color: #e8ba1b;
228
  }
229
 
230
+ /* Badges */
231
+ .wpe-pcc-badge {
232
+ display: inline-block;
233
+ margin-right: 5px;
234
+ padding: 2px 7px 5px 7px;
235
+ color: #fff;
236
+ border-radius: 3px;
237
+ line-height: 1em;
238
+ background: #40bac8;
239
+ }
240
+ .wpe-pcc-badge-passed {
241
+ background-color: #038103;
242
+ }
243
+ .wpe-pcc-badge-skipped {
244
+ background-color: #999;
245
+ }
246
+ .wpe-pcc-badge-warnings {
247
+ background-color: #e8ba1b;
248
+ }
249
+ .wpe-pcc-badge-errors {
250
+ background-color: #e74c3c;
251
  }
252
 
253
+ /* Misc */
254
+ .wpe-pcc-wrap a:focus {
255
+ box-shadow: none !important;
256
+ -webkit-box-shadow: none !important;
257
+ }
258
+ .wpe-pcc-bullets {
259
+ list-style: disc;
260
+ padding-left: 20px;
261
+ }
262
+ .wpe-pcc-bullets li {
263
+ margin: 10px 0;
264
  }
265
 
266
+
267
+ #developerMode textarea {
268
+ width: 100%; height: 500px; background: #FFF; color: #000;
 
269
  }
270
 
271
+ #progressbar .ui-progressbar-value {
272
+ background: #0085ba;
 
 
 
 
 
 
 
 
 
 
 
273
  }
274
 
275
+ #wpe-progress-count, #wpe-progress-active {
276
+ display: inline;
 
277
  }
src/images/WPE-IMAGE-Sidebar-Codeable.jpg ADDED
Binary file
src/images/WPE-IMAGE-Sidebar-WPEPartners.jpg ADDED
Binary file
src/js/run.js CHANGED
@@ -9,30 +9,28 @@ jQuery( document ).ready(function($) {
9
  $( '#developermode' ).change(function() {
10
  if ( $(this).is( ':checked' ) ) {
11
  $( '#developerMode' ).show();
12
- $( '#standardMode' ).hide();
13
  } else {
14
  $( '#developerMode' ).hide();
15
- $( '#standardMode' ).show();
16
  }
17
  });
18
  $( '#downloadReport' ).on( 'click', function() {
19
  download( $( '#testResults' ).val(), 'report.txt', 'text/plain' );
 
20
  });
21
- $( document ).on( 'click', '.view-details', function() {
22
  // Get the textarea with is on the same (dom) level.
23
  var textarea = $( this ).siblings( 'textarea' );
24
- if ( 'none' === textarea.css( 'display' ) ) {
25
- textarea.css( 'display' , '' );
26
- } else {
27
- textarea.css( 'display', 'none' );
28
- }
29
  });
30
  $( '#runButton' ).on( 'click', function() {
31
  // Unselect button so it's not highlighted.
32
  $( '#runButton' ).blur();
33
 
34
  // Show the ajax spinner.
35
- $( '.spinner' ).show();
36
  // Empty the results textarea.
37
  resetDisplay();
38
  test_version = $( 'input[name=phptest_version]:checked' ).val();
@@ -43,9 +41,7 @@ jQuery( document ).ready(function($) {
43
  'only_active': only_active,
44
  'startScan': 1
45
  };
46
- // Init and show the Progress Bar
47
- jQuery( '#wpe-progress' ).show();
48
-
49
  // Start the test!
50
  jQuery.post( ajaxurl, data ).always(function() {
51
  // Start timer to check scan status.
@@ -84,9 +80,9 @@ function checkStatus() {
84
  }
85
 
86
  if ( '1' === obj.status ) {
87
- jQuery( '.spinner' ).show();
88
  } else {
89
- jQuery( '.spinner' ).hide();
90
  }
91
 
92
  if ( '0' !== obj.results ) {
@@ -94,18 +90,16 @@ function checkStatus() {
94
  test_version = obj.version;
95
  displayReport( obj.results );
96
  }
97
- jQuery( '#wpe-progress' ).hide();
98
  } else {
99
- jQuery( '#progressbar' ).progressbar({
100
- value: obj.progress
101
- });
102
- jQuery( '#wpe-progress' ).show();
103
-
104
  // Display the current plugin count.
105
- jQuery( '#wpe-progress-count' ).text( ( obj.total - obj.count + 1 ) + '/' + obj.total );
 
 
 
106
 
107
  // Display the object being scanned.
108
- jQuery( '#wpe-progress-active' ).text( obj.activeJob );
109
 
110
  // Requeue the checkStatus call.
111
  timer = setTimeout(function() {
@@ -127,14 +121,13 @@ function checkStatus() {
127
  * Clear previous results.
128
  */
129
  function resetDisplay() {
130
- jQuery( '#progressbar' ).progressbar({
131
- value: 0
132
- });
133
  jQuery( '#testResults' ).text('');
134
- jQuery( '#standardMode' ).html('');
135
- jQuery( '#wpe-progress-count' ).text('');
136
  jQuery( '#wpe-progress-active' ).text('');
137
- jQuery( '#footer' ).hide();
 
 
138
  }
139
  /**
140
  * Loop through a string and count the total matches.
@@ -177,7 +170,6 @@ function displayReport( response ) {
177
  var template = Handlebars.compile( source );
178
 
179
  $( '#testResults' ).text( response );
180
- $( '#footer' ).show();
181
 
182
  // Separate plugins/themes.
183
  var plugins = response.replace( /^\s+|\s+$/g, '' ).split( window.wpephpcompat.name + ':' );
@@ -226,16 +218,24 @@ function displayReport( response ) {
226
  updateAvailable: updateAvailable
227
  };
228
  var html = template( context );
229
- $('#standardMode').append( html );
230
  }
231
 
232
  // Display global compatibility status.
233
- if ( compatible ) {
234
- $( '#standardMode' ).prepend( '<h3>' + window.wpephpcompat.your_wp + ' PHP ' + test_version + ' ' + window.wpephpcompat.compatible + '.</h3>' );
 
 
 
 
 
 
 
235
  } else {
236
  // Display scan stats.
237
- $( '#standardMode' ).prepend( '<p>' + failedCount + ' ' + window.wpephpcompat.out_of + ' ' + plugins.length + ' ' + window.wpephpcompat.are_not + '.</p>' );
238
-
239
- $( '#standardMode' ).prepend( '<h3>' + window.wpephpcompat.is_not + ' ' + test_version + ' ' + window.wpephpcompat.compatible + '.</h3>' );
 
240
  }
241
  }
9
  $( '#developermode' ).change(function() {
10
  if ( $(this).is( ':checked' ) ) {
11
  $( '#developerMode' ).show();
12
+ $( '#wpe-pcc-standardMode' ).hide();
13
  } else {
14
  $( '#developerMode' ).hide();
15
+ $( '#wpe-pcc-standardMode' ).show();
16
  }
17
  });
18
  $( '#downloadReport' ).on( 'click', function() {
19
  download( $( '#testResults' ).val(), 'report.txt', 'text/plain' );
20
+ return false;
21
  });
22
+ $( document ).on( 'click', '.wpe-pcc-alert-details', function() {
23
  // Get the textarea with is on the same (dom) level.
24
  var textarea = $( this ).siblings( 'textarea' );
25
+ textarea.toggleClass( 'hide' );
26
+ return false;
 
 
 
27
  });
28
  $( '#runButton' ).on( 'click', function() {
29
  // Unselect button so it's not highlighted.
30
  $( '#runButton' ).blur();
31
 
32
  // Show the ajax spinner.
33
+ $( '.wpe-pcc-spinner' ).show();
34
  // Empty the results textarea.
35
  resetDisplay();
36
  test_version = $( 'input[name=phptest_version]:checked' ).val();
41
  'only_active': only_active,
42
  'startScan': 1
43
  };
44
+ $( '.wpe-pcc-test-version' ).text(test_version);
 
 
45
  // Start the test!
46
  jQuery.post( ajaxurl, data ).always(function() {
47
  // Start timer to check scan status.
80
  }
81
 
82
  if ( '1' === obj.status ) {
83
+ jQuery( '.wpe-pcc-spinner' ).show();
84
  } else {
85
+ jQuery( '.wpe-pcc-spinner' ).hide();
86
  }
87
 
88
  if ( '0' !== obj.results ) {
90
  test_version = obj.version;
91
  displayReport( obj.results );
92
  }
93
+ jQuery( '#wpe-pcc-progress-count' ).hide();
94
  } else {
 
 
 
 
 
95
  // Display the current plugin count.
96
+ if ( obj.total ) {
97
+ jQuery( '#wpe-pcc-progress-count' ).show();
98
+ jQuery( '#wpe-pcc-progress-count' ).text( '(' + ( obj.total - obj.count + 1 ) + ' of ' + obj.total + ')' );
99
+ }
100
 
101
  // Display the object being scanned.
102
+ jQuery( '#wpe-progress-active' ).html( '<strong>Now scanning:</strong> ' + obj.activeJob );
103
 
104
  // Requeue the checkStatus call.
105
  timer = setTimeout(function() {
121
  * Clear previous results.
122
  */
123
  function resetDisplay() {
 
 
 
124
  jQuery( '#testResults' ).text('');
125
+ jQuery( '#wpe-pcc-standardMode' ).html('');
126
+ jQuery( '#wpe-pcc-progress-count' ).text('');
127
  jQuery( '#wpe-progress-active' ).text('');
128
+ jQuery( '.wpe-pcc-download-report' ).hide();
129
+ jQuery( '.wpe-pcc-results' ).hide();
130
+ jQuery( '.wpe-pcc-information' ).hide();
131
  }
132
  /**
133
  * Loop through a string and count the total matches.
170
  var template = Handlebars.compile( source );
171
 
172
  $( '#testResults' ).text( response );
 
173
 
174
  // Separate plugins/themes.
175
  var plugins = response.replace( /^\s+|\s+$/g, '' ).split( window.wpephpcompat.name + ':' );
218
  updateAvailable: updateAvailable
219
  };
220
  var html = template( context );
221
+ $('#wpe-pcc-standardMode').append( html );
222
  }
223
 
224
  // Display global compatibility status.
225
+ if ( test_version == '7.0' && compatible ) {
226
+ // php 7 ready, and user tested version 7
227
+ jQuery( '.wpe-pcc-download-report' ).show();
228
+ jQuery( '.wpe-pcc-results' ).show();
229
+
230
+ } else if ( compatible ) {
231
+ jQuery( '.wpe-pcc-download-report' ).show();
232
+ jQuery( '.wpe-pcc-results' ).show();
233
+ jQuery( '.wpe-pcc-information-errors' ).show();
234
  } else {
235
  // Display scan stats.
236
+ jQuery( '.wpe-pcc-download-report' ).show();
237
+ $( '#wpe-pcc-standardMode' ).prepend( '<p>' + failedCount + ' ' + window.wpephpcompat.out_of + ' ' + plugins.length + ' ' + window.wpephpcompat.are_not + '.</p>' );
238
+ jQuery( '.wpe-pcc-information-errors' ).show();
239
+ jQuery( '.wpe-pcc-results' ).show();
240
  }
241
  }
src/wpephpcompat.php CHANGED
@@ -188,9 +188,6 @@ class WPEPHPCompat {
188
  }
189
 
190
  if ( ! $this->is_command_line() ) {
191
- // Close the connection to the browser.
192
- $this->close_connection( 'started' );
193
-
194
  /**
195
  * Kill cron after a configurable timeout.
196
  * Subtract 5 from the timeout if we can to avoid race conditions.
@@ -479,29 +476,4 @@ class WPEPHPCompat {
479
  private function is_command_line() {
480
  return defined( 'WP_CLI' ) || defined( 'PHPUNIT_TEST' ) || php_sapi_name() == 'cli';
481
  }
482
-
483
- /**
484
- * Close the connection to the browser but continue processing the operation.
485
- * @since 1.0.0
486
- * @param string $body The message to send to the client.
487
- * @return null
488
- */
489
- private function close_connection( $body ) {
490
- ignore_user_abort( true );
491
- if ( ob_get_length() ) { ob_end_clean(); }
492
- // Start buffering.
493
- ob_start();
494
- // Echo our response.
495
- echo $body;
496
- // Get the length of the buffer.
497
- $size = ob_get_length();
498
- // Close the connection.
499
- header( 'Connection: close\r\n' );
500
- header( 'Content-Encoding: none\r\n' );
501
- header( 'Content-Length: $size' );
502
- // Flush and close the buffer.
503
- ob_end_flush();
504
- // Flush the system output buffer.
505
- flush();
506
- }
507
  }
188
  }
189
 
190
  if ( ! $this->is_command_line() ) {
 
 
 
191
  /**
192
  * Kill cron after a configurable timeout.
193
  * Subtract 5 from the timeout if we can to avoid race conditions.
476
  private function is_command_line() {
477
  return defined( 'WP_CLI' ) || defined( 'PHPUNIT_TEST' ) || php_sapi_name() == 'cli';
478
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479
  }
wpengine-phpcompat.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: PHP Compatibility Checker
4
  Plugin URI: https://wpengine.com
5
  Description: Make sure your plugins and themes are compatible with newer PHP versions.
6
  Author: WP Engine
7
- Version: 1.3.2
8
  Author URI: https://wpengine.com
9
  Text Domain: php-compatibility-checker
10
  */
@@ -94,16 +94,29 @@ class WPEngine_PHPCompat {
94
 
95
  $wpephpc = new \WPEPHPCompat( __DIR__ );
96
 
 
 
 
 
 
 
 
97
  if ( isset( $_POST['startScan'] ) ) {
 
 
 
98
  $test_version = sanitize_text_field( $_POST['test_version'] );
99
  $only_active = sanitize_text_field( $_POST['only_active'] );
100
 
 
 
 
101
  $wpephpc->test_version = $test_version;
102
  $wpephpc->only_active = $only_active;
103
- $wpephpc->clean_after_scan();
 
104
  }
105
 
106
- $wpephpc->start_test();
107
  wp_die();
108
  }
109
  }
@@ -162,6 +175,40 @@ class WPEngine_PHPCompat {
162
  }
163
  }
164
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  /**
166
  * Remove all database options from the database.
167
  *
@@ -218,10 +265,6 @@ class WPEngine_PHPCompat {
218
  wp_enqueue_script( 'wpephpcompat-download', plugins_url( '/src/js/download.min.js', __FILE__ ) );
219
  wp_enqueue_script( 'wpephpcompat', plugins_url( '/src/js/run.js', __FILE__ ), array( 'jquery', 'wpephpcompat-handlebars', 'wpephpcompat-download' ) );
220
 
221
- // Progress Bar
222
- wp_enqueue_script( 'jquery-ui-progressbar' );
223
- wp_enqueue_style( 'jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
224
-
225
  /**
226
  * i18n strings
227
  *
@@ -230,11 +273,11 @@ class WPEngine_PHPCompat {
230
  $strings = array(
231
  'name' => __( 'Name', 'php-compatibility-checker' ),
232
  'compatible' => __( 'compatible', 'php-compatibility-checker' ),
233
- 'are_not' => __( 'plugins/themes are possibly not compatible', 'php-compatibility-checker' ),
234
  'is_not' => __( 'Your WordPress site is possibly not PHP', 'php-compatibility-checker' ),
235
  'out_of' => __( 'out of', 'php-compatibility-checker' ),
236
- 'run' => __( 'Run', 'php-compatibility-checker' ),
237
- 'rerun' => __( 'Re-run', 'php-compatibility-checker' ),
238
  'your_wp' => __( 'Your WordPress site is', 'php-compatibility-checker' ),
239
  );
240
 
@@ -264,96 +307,194 @@ class WPEngine_PHPCompat {
264
  $test_version = get_option( 'wpephpcompat.test_version' );
265
  $only_active = get_option( 'wpephpcompat.only_active' );
266
 
 
 
 
267
  $phpversions = $this->get_phpversions();
268
 
269
  // Assigns defaults for the scan if none are found in the database.
270
- $test_version = ( false !== $test_version ) ? $test_version : '7.0';
271
- $only_active = ( false !== $only_active ) ? $only_active : 'yes';
 
 
 
 
 
 
 
 
272
  ?>
273
- <div class="wrap">
274
- <div style="float: left;">
275
- <h2><?php esc_attr_e( 'WP Engine PHP Compatibility Checker', 'php-compatibility-checker' ); ?></h2>
276
- </div>
277
- <div style="float: right; margin-top: 10px; text-align: right;">
278
- <input type="checkbox" id="developermode" name="developermode" value="yes" /><?php esc_attr_e( 'Developer mode', 'php-compatibility-checker' ); ?>
279
- </div>
280
- <div class="clear">
281
- <p><?php esc_attr_e( 'This plugin will lint theme and plugin code inside your WordPress file system and give you back a report of compatibility issues for you to fix. Compatibility issues are categorized into errors and warnings and will list the file and line number of the offending code, as well as the info about why that line of code is incompatible with the chosen version of PHP. The plugin will also suggest updates to themes and plugins, as a new version may offer compatible code.', 'php-compatibility-checker' ); ?></p>
282
- <p><b><?php esc_attr_e( 'This plugin does not execute your theme and plugin code, as such this plugin cannot detect runtime compatibility issues.', 'php-compatibility-checker' ); ?></b></p>
283
-
284
-
285
- <p><?php printf( __( 'Please note that linting code is not perfect. This plugin cannot detect unused code paths that might be used for backwards compatibility, and thus might show false positives. You can <a href="%1$s">report false positives on our GitHub repo</a>.', 'php-compatibility-checker' ), 'https://github.com/wpengine/phpcompat/wiki/Results' ); ?></p>
286
-
287
- <p><?php printf( __( 'This plugin relies on WP-Cron to scan files in the background. The scan will get stuck if the site&#39s WP-Cron is not running correctly. Please <a href="%1$s">see the FAQ</a> for more information.', 'php-compatibility-checker' ), 'https://wordpress.org/plugins/php-compatibility-checker/faq/' ); ?></p>
288
- </div>
289
- <hr>
290
- <h3 class="title clear"><?php esc_attr_e( 'Scan Options', 'php-compatibility-checker' ); ?></h3>
291
- <table class="form-table">
292
- <tbody>
293
- <tr>
294
- <th scope="row"><label for="phptest_version"><?php esc_attr_e( 'PHP Version', 'php-compatibility-checker' ); ?></label></th>
295
- <td>
296
- <?php
297
- foreach ( $phpversions as $name => $version ) {
298
- printf( '<label><input type="radio" name="phptest_version" value="%s" %s /> %s</label><br>', $version, checked( $test_version, $version, false ), $name );
299
- }
300
- ?>
301
- </td>
302
- </tr>
303
- <tr>
304
- <th scope="row"><label for="active_plugins"><?php esc_attr_e( 'Only Active', 'php-compatibility-checker' ); ?></label></th>
305
- <td><label><input type="radio" name="active_plugins" value="yes" <?php checked( $only_active, 'yes', true ); ?> /> <?php esc_attr_e( 'Only scan active plugins and themes', 'php-compatibility-checker' ); ?></label><br>
306
- <label><input type="radio" name="active_plugins" value="no" <?php checked( $only_active, 'no', true ); ?> /> <?php esc_attr_e( 'Scan all plugins and themes', 'php-compatibility-checker' ); ?></label>
307
- </td>
308
- </tr>
309
- </tbody>
310
- </table>
311
- <hr />
312
- <p>
313
- <div style="display: none;" id="wpe-progress">
314
- <label for=""><?php esc_attr_e( 'Progress', 'php-compatibility-checker' ); ?></label>
315
- <div id="progressbar"></div>
316
- <div id="wpe-progress-count"></div>
317
- <div id="wpe-progress-active"></div>
318
- </div>
319
-
320
- <!-- Area for pretty results. -->
321
- <div id="standardMode"></div>
322
-
323
- <!-- Area for developer results. -->
324
- <div style="display: none;" id="developerMode">
325
- <b><?php esc_attr_e( 'Test Results:', 'php-compatibility-checker' ); ?></b>
326
- <textarea readonly="readonly" id="testResults"></textarea>
327
- </div>
328
-
329
- <div id="footer" style="display: none;">
330
- <?php esc_attr_e( 'Note: PHP Warnings will not cause errors, but could cause compatibility issues with future PHP versions, and could spam your PHP logs.', 'php-compatibility-checker' ); ?><br>
331
- <a id="downloadReport" href="#"><?php esc_attr_e( 'Download Report', 'php-compatibility-checker' ); ?></a>
332
- </div>
333
- </p>
334
- <p>
335
- <input style="float: left;" name="run" id="runButton" type="button" value="<?php esc_attr_e( 'Run', 'php-compatibility-checker' ); ?>" class="button-primary" />
336
- <div class="wpe-tooltip"><input style="float: left; margin-left: 5px;" name="run" id="cleanupButton" type="button" value="<?php esc_attr_e( 'Clean up', 'php-compatibility-checker' ); ?>" class="button" />
337
- <span class="wpe-tooltiptext">This will remove all database options related to this plugin, but it will not stop a scan in progress. If you'd like to completly remove all data wait for the scan to finish before hitting this button.</span></div>
338
- <div style="display:none; visibility: visible; float: left;" class="spinner"></div>
339
- </p>
340
- </div>
341
-
342
- <!-- Results template -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  <script id="result-template" type="text/x-handlebars-template">
344
- <div style="border-left-color: {{#if skipped}}#999999{{else if passed}}#038103{{else}}#e74c3c{{/if}};" class="wpe-results-card">
345
- <div class="inner-left">
346
- {{#if skipped}}<img src="<?php echo esc_url( plugins_url( '/src/images/question.png', __FILE__ ) ); ?>">{{else if passed}}<img src="<?php echo esc_url( plugins_url( '/src/images/check.png', __FILE__ ) ); ?>">{{else}}<img src="<?php echo esc_url( plugins_url( '/src/images/x.png', __FILE__ ) ); ?>">{{/if}}
347
- </div>
348
- <div class="inner-right">
349
- <h3 style="margin: 0px;">{{plugin_name}}</h3>
350
- {{#if skipped}}<?php esc_attr_e( 'Unknown', 'php-compatibility-checker' ); ?>{{else if passed}}PHP {{test_version}} <?php esc_attr_e( 'compatible', 'php-compatibility-checker' ); ?>.{{else}}<b><?php esc_attr_e( 'Possibly not', 'php-compatibility-checker' ); ?></b> PHP {{test_version}} <?php esc_attr_e( 'compatible', 'php-compatibility-checker' ); ?>.{{/if}}<br>
351
- {{update}}<br>
352
- <textarea style="display: none; white-space: pre;">{{logs}}</textarea><a class="view-details"><?php esc_attr_e( 'view details', 'php-compatibility-checker' ); ?></a>
353
- </div>
354
- <?php $update_url = site_url( 'wp-admin/update-core.php' , 'admin' ); ?>
355
- <div style="float:right;">{{#if updateAvailable}}<div class="badge wpe-update"><a href="<?php echo esc_url( $update_url ); ?>"><?php esc_attr_e( 'Update Available', 'php-compatibility-checker' ); ?></a></div>{{/if}}{{#if warnings}}<div class="badge warnings">{{warnings}} <?php esc_attr_e( 'Warnings', 'php-compatibility-checker' ); ?></div>{{/if}}{{#if errors}}<div class="badge errors">{{errors}} <?php esc_attr_e( 'Errors', 'php-compatibility-checker' ); ?></div>{{/if}}</div>
356
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  </script>
358
  <?php
359
  }
4
  Plugin URI: https://wpengine.com
5
  Description: Make sure your plugins and themes are compatible with newer PHP versions.
6
  Author: WP Engine
7
+ Version: 1.4.0
8
  Author URI: https://wpengine.com
9
  Text Domain: php-compatibility-checker
10
  */
94
 
95
  $wpephpc = new \WPEPHPCompat( __DIR__ );
96
 
97
+ foreach ( array( 'test_version', 'only_active' ) as $key ) {
98
+ if ( isset( $_POST[ $key ] ) ) {
99
+ $$key = sanitize_text_field( $_POST[ $key ] );
100
+ }
101
+ }
102
+
103
+ // New scan!
104
  if ( isset( $_POST['startScan'] ) ) {
105
+ // Make sure we clean up after the last test.
106
+ $wpephpc->clean_after_scan();
107
+
108
  $test_version = sanitize_text_field( $_POST['test_version'] );
109
  $only_active = sanitize_text_field( $_POST['only_active'] );
110
 
111
+ // Fork so we can close the connection.
112
+ $this->fork_scan( $test_version, $only_active );
113
+ } else {
114
  $wpephpc->test_version = $test_version;
115
  $wpephpc->only_active = $only_active;
116
+
117
+ $wpephpc->start_test();
118
  }
119
 
 
120
  wp_die();
121
  }
122
  }
175
  }
176
  }
177
 
178
+ /**
179
+ * Make an Ajax call to start the scan in the background.
180
+ *
181
+ * @since 1.3.2
182
+ * @param string $test_version Version of PHP to test.
183
+ * @param string $only_active Scan only active plugins or all?
184
+ * @return null
185
+ */
186
+ function fork_scan( $test_version, $only_active ) {
187
+ $query = array(
188
+ 'action' => 'wpephpcompat_start_test',
189
+ );
190
+
191
+ // Keep track of these variables.
192
+ $body = array(
193
+ 'test_version' => $test_version,
194
+ 'only_active' => $only_active,
195
+ );
196
+
197
+ // Instantly return!
198
+ $args = array(
199
+ 'timeout' => 0.01,
200
+ 'blocking' => false,
201
+ 'body' => $body,
202
+ 'cookies' => $_COOKIE,
203
+ 'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
204
+ );
205
+
206
+ // Build our URL.
207
+ $url = add_query_arg( $query, admin_url( 'admin-ajax.php' ) );
208
+ // POST.
209
+ wp_remote_post( esc_url_raw( $url ), $args );
210
+ }
211
+
212
  /**
213
  * Remove all database options from the database.
214
  *
265
  wp_enqueue_script( 'wpephpcompat-download', plugins_url( '/src/js/download.min.js', __FILE__ ) );
266
  wp_enqueue_script( 'wpephpcompat', plugins_url( '/src/js/run.js', __FILE__ ), array( 'jquery', 'wpephpcompat-handlebars', 'wpephpcompat-download' ) );
267
 
 
 
 
 
268
  /**
269
  * i18n strings
270
  *
273
  $strings = array(
274
  'name' => __( 'Name', 'php-compatibility-checker' ),
275
  'compatible' => __( 'compatible', 'php-compatibility-checker' ),
276
+ 'are_not' => __( 'plugins/themes may not be compatible', 'php-compatibility-checker' ),
277
  'is_not' => __( 'Your WordPress site is possibly not PHP', 'php-compatibility-checker' ),
278
  'out_of' => __( 'out of', 'php-compatibility-checker' ),
279
+ 'run' => __( 'Scan site', 'php-compatibility-checker' ),
280
+ 'rerun' => __( 'Scan site again', 'php-compatibility-checker' ),
281
  'your_wp' => __( 'Your WordPress site is', 'php-compatibility-checker' ),
282
  );
283
 
307
  $test_version = get_option( 'wpephpcompat.test_version' );
308
  $only_active = get_option( 'wpephpcompat.only_active' );
309
 
310
+ // Determine if current site is a WP Engine customer
311
+ $is_wpe_customer = ! empty( $_SERVER['IS_WPE'] ) && $_SERVER['IS_WPE'];
312
+
313
  $phpversions = $this->get_phpversions();
314
 
315
  // Assigns defaults for the scan if none are found in the database.
316
+ $test_version = ( ! empty( $test_version ) ) ? $test_version : '7.0';
317
+ $only_active = ( ! empty( $only_active ) ) ? $only_active : 'yes';
318
+
319
+ // Content variables
320
+ $url_get_hosting = esc_url( 'https://wpeng.in/5a0336/' );
321
+ $url_wpe_agency_partners = esc_url( 'https://wpeng.in/fa14e4/' );
322
+ $url_wpe_customer_upgrade = esc_url( 'https://wpeng.in/407b79/' );
323
+ $url_wpe_logo = esc_url( 'https://wpeng.in/22f22b/' );
324
+ $url_codeable_submit = esc_url( 'https://codeable.io/wp-admin/admin-ajax.php?action=wp_engine_phpcompat' );
325
+
326
  ?>
327
+ <div class="wrap wpe-pcc-wrap">
328
+ <h1><?php _e( 'PHP Compatibility Checker' ) ?></h1>
329
+ <div class="wpe-pcc-main">
330
+ <p><?php _e( 'The PHP Compatibility Checker can be used on any WordPress website on any web host.', 'php-compatibility-checker' ); ?></p>
331
+ <p><?php _e( 'This tool will lint your theme and plugin code on this site and provide you a report of compatibility issues. These issues are categorized into errors and warnings and will list the file and line number of the offending code, as well as the info about why that line of code is incompatible with the chosen version of PHP. This tool will also suggest updates to themes and plugins, as a new version may offer compatible code.', 'php-compatibility-checker' ); ?></p>
332
+ <hr>
333
+ <div class="wpe-pcc-scan-options">
334
+ <h2><?php _e( 'Scan Options' ); ?></h2>
335
+ <table class="form-table wpe-pcc-form-table">
336
+ <tbody>
337
+ <tr>
338
+ <th scope="row"><label for="phptest_version"><?php _e( 'PHP Version', 'php-compatibility-checker' ); ?></label></th>
339
+ <td>
340
+ <fieldset>
341
+ <?php
342
+ foreach ( $phpversions as $name => $version ) {
343
+ printf( '<label><input type="radio" name="phptest_version" value="%s" %s /> %s</label><br>', $version, checked( $test_version, $version, false ), $name );
344
+ } ?>
345
+ </fieldset>
346
+ </td>
347
+ </tr>
348
+ <tr>
349
+ <th scope="row"><label for="active_plugins"><?php _e( 'Plugin / Theme Status', 'php-compatibility-checker' ); ?></label></th>
350
+ <td>
351
+ <fieldset>
352
+ <label><input type="radio" name="active_plugins" value="yes" <?php checked( $only_active, 'yes', true ); ?> /> <?php _e( 'Only scan active plugins and themes', 'php-compatibility-checker' ); ?></label><br>
353
+ <label><input type="radio" name="active_plugins" value="no" <?php checked( $only_active, 'no', true ); ?> /> <?php _e( 'Scan all plugins and themes', 'php-compatibility-checker' ); ?></label>
354
+ </fieldset>
355
+ </td>
356
+ </tr>
357
+ <tr>
358
+ <th scope="row"></th>
359
+ <td>
360
+ <div class="wpe-pcc-run-scan">
361
+ <input name="run" id="runButton" type="button" value="<?php _e( 'Scan site', 'php-compatibility-checker' ); ?>" class="button-secondary" />
362
+ <div class="wpe-pcc-scan-information">
363
+ <span style="display:none; visibility:visible;" class="spinner wpe-pcc-spinner"></span> <span id="wpe-progress-active"></span> <span style="display:none;" id="wpe-pcc-progress-count"></span>
364
+ </div> <!-- /wpe-pcc-scan-information -->
365
+ </div> <!-- /wpe-pcc-run-scan -->
366
+ </td>
367
+ </th>
368
+ </tr>
369
+ </tbody>
370
+ </table>
371
+ </div> <!-- /wpe-pcc-scan-options -->
372
+
373
+ <?php /* Scan results */ ?>
374
+ <div class="wpe-pcc-results" style="display:none;">
375
+ <hr>
376
+ <h2><?php printf( 'Scan Results for PHP <span class="wpe-pcc-test-version">' . $test_version . '</span> Compatibility' ); ?></h2>
377
+
378
+ <?php /* Download report */ ?>
379
+ <div class="wpe-pcc-download-report" style="display:none;">
380
+ <a id="downloadReport" class="button-primary" href="#"><span class="dashicons dashicons-download"></span> <?php _e( 'Download Report', 'php-compatibility-checker' ); ?></a>
381
+ <a class="wpe-pcc-clear-results" name="run" id="cleanupButton"><?php _e( 'Clear results', 'php-compatibility-checker' ); ?></a>
382
+ <?php /* Toggle developer mode */ ?>
383
+ <label class="wpe-pcc-developer-mode">
384
+ <input type="checkbox" id="developermode" name="developermode" value="yes" />
385
+ <?php _e( 'View results as raw text', 'php-compatibility-checker' ); ?>
386
+ </label>
387
+ <hr>
388
+ </div> <!-- /wpe-pcc-download-report -->
389
+
390
+ <?php /* Area for pretty results. */ ?>
391
+ <div id="wpe-pcc-standardMode"></div>
392
+
393
+ <?php /* Area for developer results. */ ?>
394
+ <div style="display:none;" id="developerMode">
395
+ <textarea readonly="readonly" id="testResults"></textarea>
396
+ </div>
397
+
398
+ <p class="wpe-pcc-attention"><?php printf( '<strong>Attention:</strong> Not all errors are show-stoppers. <a target="_blank" href="' . $url_get_hosting . '">Test this site on PHP 7</a> to see if it just works!' ); ?></p>
399
+
400
+ </div> <!-- /wpe-pcc-results -->
401
+
402
+ <div class="wpe-pcc-footer">
403
+ <hr>
404
+ <strong><?php _e( 'Limitations &amp; Caveats' ); ?></strong>
405
+ <ul class="wpe-pcc-bullets">
406
+ <li><?php _e( 'This tool cannot detect unused code paths that might be used for backwards compatibility, potentially showing false positives. We maintain <a target="_blank" href="https://github.com/wpengine/phpcompat/wiki/Results">a whitelist of plugins</a> that can cause false positives.' ); ?></li>
407
+ <li><?php _e( 'This tool does not execute your theme or plugin code, so it cannot detect runtime compatibility issues.' ); ?></li>
408
+ <li><?php _e( 'PHP Warnings could cause compatibility issues with future PHP versions and/or spam your logs.', 'php-compatibility-checker' ); ?></li>
409
+ <li><?php printf( __( 'The scan will get stuck if WP-Cron is not running correctly. Please <a target="_blank" href="%1$s">see the FAQ</a> for more information.', 'php-compatibility-checker' ), 'https://wordpress.org/plugins/php-compatibility-checker/faq/' ); ?></li>
410
+ </ul>
411
+ <p><?php printf( __( 'Report false positives <a target="_blank" href="%1$s">on our GitHub repo</a>.', 'php-compatibility-checker' ), 'https://github.com/wpengine/phpcompat/wiki/Results' ); ?></p>
412
+ </div> <!-- /wpe-pcc-footer -->
413
+ </div> <!-- /wpe-pcc-main -->
414
+
415
+ <?php /* Begin sidebar */ ?>
416
+ <div class="wpe-pcc-aside">
417
+ <a class="wpe-pcc-logo" href="<?php echo $url_wpe_logo; ?>" target="_blank"><svg width="182" height="34" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 268.3 51"><g fill="#40BAC8"><path d="M17.4 51h16.4V38.6l-4-4h-8.5l-3.9 4zM38.6 17.3l-3.9 3.9v8.6l3.9 3.9h12.5V17.3zM33.8 0H17.4v12.5l3.9 3.9h8.5l4-3.9zM51.1 51V38.6l-3.9-4H34.7V51zM4 0L.1 3.9v12.5h16.4V0zM34.7 0v12.5l3.9 3.9h12.5V0zM25.6 27.9c-1.3 0-2.3-1.1-2.3-2.3 0-1.3 1.1-2.3 2.3-2.3 1.3 0 2.3 1.1 2.3 2.3 0 1.2-1 2.3-2.3 2.3zM16.5 17.3H.1v16.4h12.4l4-3.9zM16.5 38.6l-4-4H.1V51h12.4l4-3.9z"/></g><g fill="#162A33"><path d="M86.2 38.6c-.3 0-.4-.1-.5-.4l-4.1-14.5h-.1l-4.1 14.5c-.1.3-.2.4-.5.4h-4.8c-.3 0-.4-.1-.5-.4l-7-25.2c0-.2 0-.4.3-.4h6.3c.3 0 .5.2.5.4L75 28.1h.1l4-15.1c.1-.3.2-.4.5-.4h3.9c.3 0 .4.1.5.4l4.2 15.1h.1L91.5 13c0-.2.2-.4.5-.4h6.3c.2 0 .3.2.3.4l-7 25.2c-.1.3-.2.4-.5.4h-4.9zM103.6 38.6c-.2 0-.4-.2-.4-.4V13c0-.2.2-.4.4-.4H114c6.3 0 9.6 3.6 9.6 8.6s-3.3 8.7-9.6 8.7h-3.8c-.2 0-.2.1-.2.2v8c0 .2-.2.4-.4.4h-6zm13.3-17.3c0-1.8-1.2-2.9-3.3-2.9h-3.4c-.2 0-.2.1-.2.2V24c0 .2.1.2.2.2h3.4c2.1 0 3.3-1.2 3.3-2.9zM132.5 32.2c-.5-1.4-.7-3.1-.7-6.5 0-3.3.3-5.1.7-6.5 1.3-4.1 4.5-6.2 8.6-6.2 4.2 0 7.3 2.1 8.6 6.2.5 1.4.7 3 .7 6.1 0 .3-.2.5-.6.5h-16.3c-.2 0-.3.2-.3.4 0 2.7.2 4.2.6 5.5 1.2 3.7 3.9 5.3 7.5 5.3 3.4 0 5.9-1.5 7.4-3.5.2-.3.5-.3.7-.1l.3.3c.3.2.3.5.1.7-1.7 2.4-4.6 4.1-8.4 4.1-4.5 0-7.5-2.1-8.9-6.3zm16.2-7.8c.2 0 .3-.1.3-.3 0-1.7-.2-3.1-.6-4.3-1.1-3.5-3.7-5.3-7.2-5.3s-6.1 1.7-7.2 5.3c-.4 1.2-.6 2.5-.6 4.3 0 .2.1.3.3.3h15zM173.6 38c-.3 0-.5-.2-.5-.5V22.9c0-5.8-2.4-8.3-7.1-8.3-4.1 0-7.5 2.8-7.5 7.6v15.4c0 .3-.2.5-.5.5h-.5c-.3 0-.5-.2-.5-.5V14.2c0-.3.2-.5.5-.5h.5c.3 0 .5.2.5.5v3.4h.1c1.2-2.8 4-4.5 7.5-4.5 5.5 0 8.6 3.1 8.6 9.4v15c0 .3-.2.5-.5.5h-.6zM182 44.3c-.2-.3-.2-.6.1-.7l.4-.3c.3-.2.5-.1.7.2 1.4 1.8 3.5 2.9 6.5 2.9 4.6 0 7.6-2.3 7.6-8.3V34h-.1c-1.2 2.7-3.3 4.6-7.6 4.6-4.1 0-6.9-2.2-8.1-5.8-.6-1.7-.8-3.9-.8-6.9 0-3 .3-5.2.8-6.9 1.2-3.6 4-5.8 8.1-5.8 4.3 0 6.4 1.9 7.6 4.6h.1v-3.5c0-.3.2-.5.5-.5h.5c.3 0 .5.2.5.5v23.9c0 6.7-3.6 9.7-9.2 9.7-3.5-.1-6.4-1.7-7.6-3.6zm14.6-12.1c.5-1.5.7-3.3.7-6.4 0-3-.2-4.9-.7-6.4-1.2-3.6-3.8-4.9-6.8-4.9-3.3 0-5.7 1.6-6.7 4.8-.5 1.5-.8 3.6-.8 6.4 0 2.8.3 4.9.8 6.4 1.1 3.2 3.4 4.8 6.7 4.8 3 .2 5.7-1.1 6.8-4.7zM207.2 6.1c-.3 0-.5-.2-.5-.5v-2c0-.3.2-.5.5-.5h1.2c.3 0 .5.2.5.5v2.1c0 .3-.2.5-.5.5h-1.2zm.4 31.9c-.3 0-.5-.2-.5-.5V14.2c0-.3.2-.5.5-.5h.5c.3 0 .5.2.5.5v23.3c0 .3-.2.5-.5.5h-.5zM233.5 38c-.3 0-.5-.2-.5-.5V22.9c0-5.8-2.4-8.3-7.1-8.3-4.1 0-7.5 2.8-7.5 7.6v15.4c0 .3-.2.5-.5.5h-.5c-.3 0-.5-.2-.5-.5V14.2c0-.3.2-.5.5-.5h.5c.3 0 .5.2.5.5v3.4h.1c1.2-2.8 4-4.5 7.5-4.5 5.5 0 8.6 3.1 8.6 9.4v15c0 .3-.2.5-.5.5h-.6zM241.4 32.2c-.5-1.4-.7-3.1-.7-6.5 0-3.3.3-5.1.7-6.5 1.3-4.1 4.5-6.2 8.6-6.2 4.2 0 7.3 2.1 8.6 6.2.5 1.4.7 3 .7 6.1 0 .3-.2.5-.6.5h-16.3c-.2 0-.3.2-.3.4 0 2.7.2 4.2.6 5.5 1.2 3.7 3.9 5.3 7.5 5.3 3.4 0 5.9-1.5 7.4-3.5.2-.3.5-.3.7-.1l.3.3c.3.2.3.5.1.7-1.7 2.4-4.6 4.1-8.4 4.1-4.5 0-7.6-2.1-8.9-6.3zm16.1-7.8c.2 0 .3-.1.3-.3 0-1.7-.2-3.1-.6-4.3-1.1-3.5-3.7-5.3-7.2-5.3s-6.1 1.7-7.2 5.3c-.4 1.2-.6 2.5-.6 4.3 0 .2.1.3.3.3h15z"/></g><g><path fill="#162A33" d="M262.3 16.1c0-1.7 1.3-3 3-3s3 1.3 3 3-1.3 3-3 3-3-1.3-3-3zm5.5 0c0-1.5-1.1-2.5-2.5-2.5-1.5 0-2.5 1.1-2.5 2.5 0 1.5 1.1 2.5 2.5 2.5s2.5-1 2.5-2.5zm-3.5 1.7c-.1 0-.1 0-.1-.1v-3.1c0-.1 0-.1.1-.1h1.2c.7 0 1.1.4 1.1 1 0 .4-.2.8-.7.9l.7 1.3c.1.1 0 .2-.1.2h-.3c-.1 0-.1-.1-.2-.1l-.7-1.3h-.7v1.2c0 .1-.1.1-.1.1h-.2zm1.8-2.4c0-.3-.2-.5-.6-.5h-.8v1h.8c.4 0 .6-.2.6-.5z"/></g></svg></a>
418
+
419
+ <div class="wpe-pcc-get-hosting">
420
+ <div class="wpe-pcc-aside-content">
421
+ <?php if ( $is_wpe_customer ) { ?>
422
+ <h2><?php _e( 'Make your site 2x faster by upgrading to PHP 7', 'php-compatibility-checker' ); ?></h2>
423
+ <?php } else { ?>
424
+ <h2><?php _e( 'Make your site 2x faster with PHP 7 WordPress hosting', 'php-compatibility-checker' ); ?></h2>
425
+ <?php } // endif?>
426
+
427
+ <p><?php _e( 'Speed up your site and improve your conversion opportunities by upgrading to PHP 7 on the WP Engine platform.', 'php-compatibility-checker' ); ?></p>
428
+
429
+ <?php if ( $is_wpe_customer ) { ?>
430
+ <a target="_blank" class="wpe-pcc-button wpe-pcc-button-primary" href="<?php echo $url_wpe_customer_upgrade; ?>"><?php _e( 'Upgrade to PHP 7 for free', 'php-compatibility-checker' ); ?></a>
431
+ <?php } else { ?>
432
+ <a target="_blank" class="wpe-pcc-button wpe-pcc-button-primary" href="<?php echo $url_get_hosting; ?>"><?php _e( 'Get PHP 7 Hosting', 'php-compatibility-checker' ); ?></a>
433
+ <p><?php _e( 'Already a WP Engine customer?' ); ?> <a target="_blank" href="<?php echo $url_wpe_customer_upgrade; ?>"><?php _e( 'Click here to upgrade to PHP 7' ); ?></a></p>
434
+ <?php } // endif?>
435
+
436
+ </div> <!-- /wpe-pcc-aside-content -->
437
+ </div> <!-- /wpe-pcc-get-hosting -->
438
+
439
+ <?php /* Status: Errors */ ?>
440
+ <div style="display:none;" class="wpe-pcc-information wpe-pcc-information-errors">
441
+ <div class="wpe-pcc-aside-content">
442
+ <h2><?php _e( 'Need help making this site PHP 7 compatible?', 'php-compatibility-checker' ); ?></h2>
443
+ <div class="wpe-pcc-dev-helper">
444
+ <p class="title"><strong><?php _e( 'Get help from WP Engine partners', 'php-compatibility-checker' ); ?></strong></p>
445
+ <p><?php _e( 'Our agency partners can help make your site PHP 7 compatible.', 'php-compatibility-checker' ); ?></p>
446
+ <a target="_blank" class="wpe-pcc-button" href="<?php echo $url_wpe_agency_partners; ?>"><?php _e( 'Find a WP Engine Partner' , 'php-compatibility-checker' ); ?></a>
447
+ </div> <!-- /wpe-pcc-dev-helper -->
448
+
449
+ <div class="wpe-pcc-dev-helper">
450
+ <p class="title"><strong><?php _e( 'Get PHP 7 ready with Codeable', 'php-compatibility-checker' ); ?></strong></p>
451
+ <p><?php _e( 'Automatically submit this error report to Codeable to get a quick quote from their vetted WordPress developers.' , 'php-compatibility-checker' ); ?></p>
452
+ <form target="_blank" action="<?php echo add_query_arg( array( 'action' => 'wp_engine_phpcompat' ), $url_codeable_submit ); ?>" method="POST">
453
+ <input type="hidden" name="data" value="<?php echo base64_encode( get_option( 'wpephpcompat.scan_results' ) ); ?>" />
454
+ <input type="submit" class="wpe-pcc-button" value="<?php _e( 'Submit to Codeable', 'php-compatibility-checker' ); ?>" />
455
+ </form>
456
+ </div> <!-- /wpe-pcc-dev-helper -->
457
+ </div> <!-- /wpe-pcc-aside-content -->
458
+ </div> <!-- /wpe-pcc-information -->
459
+
460
+ </div> <!-- /wpe-pcc-aside -->
461
+ </div> <!-- /wpe-pcc-wrap -->
462
+ <!-- // end new markup -->
463
+
464
+ <?php /* Results template */ ?>
465
  <script id="result-template" type="text/x-handlebars-template">
466
+ <div class="wpe-pcc-alert wpe-pcc-alert-{{#if skipped}}skipped{{else if passed}}passed{{else}}error{{/if}}">
467
+ <p>
468
+ <?php /* Appropriate icon, based on status */ ?>
469
+ <span class="dashicons-before dashicons-{{#if errors}}no{{else if skipped}}editor-help{{else}}yes{{/if}}"></span>
470
+ <?php /* Name of plugin/theme being tested */ ?>
471
+ <strong>{{plugin_name}} </strong> -
472
+ <?php /* Results status */ ?>
473
+ <span class="wpe-pcc-alert-status">
474
+ {{#if skipped}}
475
+ <span class="wpe-pcc-badge wpe-pcc-badge-skipped"><?php _e( 'Unknown', 'php-compatibility-checker' ); ?></span>
476
+ {{else}}
477
+ {{#if passed}}
478
+ <span class="wpe-pcc-badge wpe-pcc-badge-passed"><?php _e( 'Compatible', 'php-compatibility-checker' ); ?></span>
479
+ {{/if}}
480
+ {{#if warnings}}
481
+ <span class="wpe-pcc-badge wpe-pcc-badge-warnings"><?php _e( 'Warnings:', 'php-compatibility-checker' ); ?> <strong>{{warnings}}</strong></span>
482
+ {{/if}}
483
+ {{#if errors}}
484
+ <span class="wpe-pcc-badge wpe-pcc-badge-errors"><?php _e( 'Errors:', 'php-compatibility-checker' ); ?> <strong>{{errors}}</strong></span>
485
+ {{/if}}
486
+ {{/if}}
487
+ </span>
488
+ <?php /* Check if plugin/theme has an update available */ ?>
489
+ <?php $update_url = site_url( 'wp-admin/update-core.php' , 'admin' ); ?>
490
+ {{#if updateAvailable}}
491
+ (<a href="<?php echo esc_url( $update_url ); ?>"><?php _e( 'Update Available', 'php-compatibility-checker' ); ?></a>)
492
+ {{/if}}
493
+ <?php /* View details link */ ?>
494
+ <a class="wpe-pcc-alert-details" href="#"><?php _e( 'toggle details', 'php-compatibility-checker' ); ?></a>
495
+ <textarea class="wpe-pcc-alert-logs hide">{{logs}}</textarea>
496
+ </p>
497
+ </div> <!-- /wpe-pcc-alert -->
498
  </script>
499
  <?php
500
  }