iThemes Sync - Version 2.1.7

Version Description

  • Enhancement: Added support for auto-updates in wordpress 5.5
  • Enhancement: Return environment type for display in Sync dashboard
Download this release

Release Info

Developer oakesjosh
Plugin Icon 128x128 iThemes Sync
Version 2.1.7
Comparing to
See all releases

Code changes from version 2.1.6 to 2.1.7

functions.php CHANGED
@@ -453,6 +453,11 @@ class Ithemes_Sync_Functions {
453
  $details['vcs'] = $vcs_details;
454
  }
455
  }
 
 
 
 
 
456
 
457
  return $details;
458
  }
453
  $details['vcs'] = $vcs_details;
454
  }
455
  }
456
+
457
+ // Get wordpress environment
458
+ if ( is_callable( 'wp_get_environment_type' ) ) {
459
+ $details['environment'] = wp_get_environment_type();
460
+ }
461
 
462
  return $details;
463
  }
history.txt CHANGED
@@ -235,4 +235,7 @@
235
  2.1.5 - 2020-04-03 - Josh Oakes
236
  Bug Fix: Limit the total number of unsent notices that can be queued
237
  2.1.6 - 2020-05-20 - Josh Oakes
238
- Bug Fix: Fixed an issue where a user couldn't be unsynced if already removed from the dashboard
 
 
 
235
  2.1.5 - 2020-04-03 - Josh Oakes
236
  Bug Fix: Limit the total number of unsent notices that can be queued
237
  2.1.6 - 2020-05-20 - Josh Oakes
238
+ Bug Fix: Fixed an issue where a user couldn't be unsynced if already removed from the dashboard
239
+ 2.1.7 - 2020-08-12 - Chris Jean, Josh Oakes
240
+ Enhancement: Added support for auto-updates in wordpress 5.5
241
+ Enhancement: Return environment type for display in Sync dashboard
init.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: iThemes Sync
4
  Plugin URI: http://ithemes.com/sync
5
  Description: Manage updates to your WordPress sites easily in one place.
6
  Author: iThemes
7
- Version: 2.1.6
8
  Author URI: http://ithemes.com/
9
  Domain Path: /lang/
10
  iThemes Package: ithemes-sync
4
  Plugin URI: http://ithemes.com/sync
5
  Description: Manage updates to your WordPress sites easily in one place.
6
  Author: iThemes
7
+ Version: 2.1.7
8
  Author URI: http://ithemes.com/
9
  Domain Path: /lang/
10
  iThemes Package: ithemes-sync
lang/ithemes-sync.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the iThemes Sync package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: iThemes Sync 2.1.5\n"
6
  "Report-Msgid-Bugs-To: http://ithemes.com/support/\n"
7
- "POT-Creation-Date: 2020-05-20 20:44:47+00:00\n"
8
  "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -75,43 +75,43 @@ msgid "To receive automatic updates for %l, use the <a href=\"%s\">iThemes Licen
75
  msgstr ""
76
 
77
  #: lib/updater/admin.php:184 lib/updater/admin.php:190
78
- #: lib/updater/settings-page.php:268
79
  msgid "iThemes Licensing"
80
  msgstr ""
81
 
82
- #: lib/updater/api.php:45
83
  msgid "Unrecognized response from <code>wp_remote_get</code>."
84
  msgstr ""
85
 
86
- #: lib/updater/api.php:61
87
  msgid "Unrecognized response from iThemes API server."
88
  msgstr ""
89
 
90
- #: lib/updater/api.php:309
91
  msgid "Incorrect password. Please make sure that you are supplying your iThemes membership username and password details."
92
  msgstr ""
93
 
94
- #: lib/updater/api.php:313
95
  msgid "Invalid username. Please make sure that you are supplying your iThemes membership username and password details."
96
  msgstr ""
97
 
98
- #: lib/updater/api.php:316
99
  msgid "The licensing server reports that the %1$s (%2$s) product is unknown. Please contact support for assistance."
100
  msgstr ""
101
 
102
- #: lib/updater/api.php:319
103
  msgid "%1$s could not be licensed since the membership account is out of available licenses for this product. You can unlicense the product on other sites or upgrade your membership to one with a higher number of licenses in order to increase the amount of available licenses."
104
  msgstr ""
105
 
106
- #: lib/updater/api.php:322
107
  msgid "%s could not be licensed due to an internal error. Please try to license %s again at a later time. If this problem continues, please contact iThemes support."
108
  msgstr ""
109
 
110
- #: lib/updater/api.php:328
111
  msgid "An unknown error relating to the %1$s product occurred. Please contact iThemes support. Error details: %2$s"
112
  msgstr ""
113
 
114
- #: lib/updater/api.php:330
115
  msgid "An unknown error occurred. Please contact iThemes support. Error details: %s"
116
  msgstr ""
117
 
@@ -121,228 +121,337 @@ msgstr ""
121
  msgid "<p>Unable to get changelog data at this time.</p><p>%1$s (%2$s)</p>"
122
  msgstr ""
123
 
124
- #: lib/updater/server.php:80
125
  msgid "The server could not be contacted. Requests are delayed for %d minute to allow the server to recover."
126
  msgid_plural "The server could not be contacted. Requests are delayed for %d minutes to allow the server to recover."
127
  msgstr[0] ""
128
  msgstr[1] ""
129
 
130
- #: lib/updater/server.php:157
131
  msgid "The server was unable to be contacted."
132
  msgstr ""
133
 
134
- #: lib/updater/server.php:167
135
  msgid "An error occurred when communicating with the iThemes update server: %s (%s)"
136
  msgstr ""
137
 
138
- #: lib/updater/settings-page.php:95 settings-page.php:239
139
  msgid "Settings saved"
140
  msgstr ""
141
 
142
- #: lib/updater/settings-page.php:102
143
  msgid "You must supply an iThemes membership username and password in order to license products."
144
  msgstr ""
145
 
146
- #: lib/updater/settings-page.php:104
147
  msgid "You must supply an iThemes membership username in order to license products."
148
  msgstr ""
149
 
150
- #: lib/updater/settings-page.php:106
151
  msgid "You must supply an iThemes membership password in order to license products."
152
  msgstr ""
153
 
154
- #: lib/updater/settings-page.php:108
155
  msgid "You must select at least one product to license. Ensure that you select the products that you wish to license in the listing below."
156
  msgstr ""
157
 
158
- #: lib/updater/settings-page.php:123
159
  msgid "An unknown server error occurred. Please try to license your products again at another time."
160
  msgstr ""
161
 
162
- #: lib/updater/settings-page.php:143
163
  msgid "Your product subscription has expired"
164
  msgstr ""
165
 
166
- #: lib/updater/settings-page.php:150
167
  msgid "Successfully licensed %l."
168
  msgstr ""
169
 
170
- #: lib/updater/settings-page.php:154 lib/updater/settings-page.php:159
171
  msgid "Unable to license %1$s. Reason: %2$s"
172
  msgstr ""
173
 
174
- #: lib/updater/settings-page.php:167
175
  msgid "You must supply an iThemes membership username and password in order to remove licenses."
176
  msgstr ""
177
 
178
- #: lib/updater/settings-page.php:169
179
  msgid "You must supply an iThemes membership username in order to remove licenses."
180
  msgstr ""
181
 
182
- #: lib/updater/settings-page.php:171
183
  msgid "You must supply an iThemes membership password in order to remove licenses."
184
  msgstr ""
185
 
186
- #: lib/updater/settings-page.php:173
187
  msgid "You must select at least one license to remove. Ensure that you select the licenses that you wish to remove in the listing below."
188
  msgstr ""
189
 
190
- #: lib/updater/settings-page.php:188
191
  msgid "An unknown server error occurred. Please try to remove licenses from your products again at another time."
192
  msgstr ""
193
 
194
- #: lib/updater/settings-page.php:209
195
  msgid "Unknown server error."
196
  msgstr ""
197
 
198
- #: lib/updater/settings-page.php:214
199
  msgid "Successfully removed license from %l."
200
  msgid_plural "Successfully removed licenses from %l."
201
  msgstr[0] ""
202
  msgstr[1] ""
203
 
204
- #: lib/updater/settings-page.php:218
205
  msgid "Unable to remove license from %1$s. Reason: %2$s"
206
  msgstr ""
207
 
208
- #: lib/updater/settings-page.php:290
 
 
 
 
 
209
  msgid "Settings"
210
  msgstr ""
211
 
212
- #: lib/updater/settings-page.php:296
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  msgid "Quick Release Updates"
214
  msgstr ""
215
 
216
- #: lib/updater/settings-page.php:303
217
  msgid "Enable quick release updates"
218
  msgstr ""
219
 
220
- #: lib/updater/settings-page.php:306
221
  msgid "Some products have quick releases that are created to solve specific issues that some users experience. In order to avoid causing users to have updates show up too frequently, automatic updates to these quick releases are disabled by default. Enabling this feature allows quick releases to be available to the automatic update system. Using this option is only recommended if support has requested that you enable it in order to receive a quick release. You should disable this option at a later time after confirming that the quick release solves the issue for you."
222
  msgstr ""
223
 
224
- #: lib/updater/settings-page.php:313
225
  msgid "Save Settings"
226
  msgstr ""
227
 
228
- #: lib/updater/settings-page.php:332 lib/updater/settings-page.php:363
229
- #: lib/updater/settings-page.php:487 lib/updater/settings-page.php:555
230
  msgid "Product"
231
  msgstr ""
232
 
233
- #: lib/updater/settings-page.php:333 lib/updater/settings-page.php:365
234
  msgid "Member"
235
  msgstr ""
236
 
237
- #: lib/updater/settings-page.php:334 lib/updater/settings-page.php:367
238
  msgid "Expiration"
239
  msgstr ""
240
 
241
- #: lib/updater/settings-page.php:335 lib/updater/settings-page.php:368
242
  msgid "Remaining Licenses"
243
  msgstr ""
244
 
245
- #: lib/updater/settings-page.php:351
246
  msgid "Licensed Products"
247
  msgstr ""
248
 
249
- #: lib/updater/settings-page.php:357 lib/updater/settings-page.php:481
250
  msgid "Select All"
251
  msgstr ""
252
 
253
- #: lib/updater/settings-page.php:366
254
  msgid "Product Status"
255
  msgstr ""
256
 
257
- #: lib/updater/settings-page.php:376
258
  msgid "unlimited"
259
  msgstr ""
260
 
261
- #: lib/updater/settings-page.php:417 lib/updater/settings-page.php:511
262
  msgid "Select %s"
263
  msgstr ""
264
 
265
- #: lib/updater/settings-page.php:437
266
  msgid "Remove Licenses"
267
  msgstr ""
268
 
269
- #: lib/updater/settings-page.php:471
270
  msgid "Unlicensed Products"
271
  msgstr ""
272
 
273
- #: lib/updater/settings-page.php:473
274
  msgid "The following products have not been licensed. Licensing a product gives you access to automatic updates from within WordPress."
275
  msgstr ""
276
 
277
- #: lib/updater/settings-page.php:474
278
  msgid "To license products, select the products you wish to license, enter your iThemes membership username and password, and press the License Products button."
279
  msgstr ""
280
 
281
- #: lib/updater/settings-page.php:475
282
  msgid "Need help? <a href=\"%s\">Click here for a quick video tutorial</a>."
283
  msgstr ""
284
 
285
- #: lib/updater/settings-page.php:527
286
  msgid "License Products"
287
  msgstr ""
288
 
289
- #: lib/updater/settings-page.php:547
290
  msgid "Unrecognized Products"
291
  msgstr ""
292
 
293
- #: lib/updater/settings-page.php:549
294
  msgid "The following products were not recognized by the licensing system. This can be due to a bug in the product code, a temporary server issue, or because the product is no longer supported."
295
  msgstr ""
296
 
297
- #: lib/updater/settings-page.php:550
298
  msgid "Please check this page again at a later time to see if the problem resolves itself. If the product remains, please contact <a href=\"%s\">iThemes support</a> and provide them with the details given below."
299
  msgstr ""
300
 
301
- #: lib/updater/settings-page.php:556
302
  msgid "Type"
303
  msgstr ""
304
 
305
- #: lib/updater/settings-page.php:557
306
  msgid "Package"
307
  msgstr ""
308
 
309
- #: lib/updater/settings-page.php:558
310
  msgid "Version"
311
  msgstr ""
312
 
313
- #: lib/updater/settings-page.php:559
314
  msgid "Server Response"
315
  msgstr ""
316
 
317
- #: lib/updater/settings-page.php:569
318
  msgid "Unknown Error"
319
  msgstr ""
320
 
321
- #: lib/updater/settings-page.php:608
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
322
  msgid "%d day"
323
  msgid_plural "%d days"
324
  msgstr[0] ""
325
  msgstr[1] ""
326
 
327
- #: lib/updater/settings-page.php:610
328
  msgid "%d hour"
329
  msgid_plural "%d hours"
330
  msgstr[0] ""
331
  msgstr[1] ""
332
 
333
- #: lib/updater/settings-page.php:612
334
  msgid "%d minute"
335
  msgid_plural "%d minutes"
336
  msgstr[0] ""
337
  msgstr[1] ""
338
 
339
- #: lib/updater/settings-page.php:614
340
  msgid "%d second"
341
  msgid_plural "%d seconds"
342
  msgstr[0] ""
343
  msgstr[1] ""
344
 
345
- #: lib/updater/settings-page.php:617
346
  msgid "%s ago"
347
  msgstr ""
348
 
2
  # This file is distributed under the same license as the iThemes Sync package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: iThemes Sync 2.1.7\n"
6
  "Report-Msgid-Bugs-To: http://ithemes.com/support/\n"
7
+ "POT-Creation-Date: 2020-08-12 14:35:00+00:00\n"
8
  "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
75
  msgstr ""
76
 
77
  #: lib/updater/admin.php:184 lib/updater/admin.php:190
78
+ #: lib/updater/settings-page.php:274
79
  msgid "iThemes Licensing"
80
  msgstr ""
81
 
82
+ #: lib/updater/api.php:57
83
  msgid "Unrecognized response from <code>wp_remote_get</code>."
84
  msgstr ""
85
 
86
+ #: lib/updater/api.php:73
87
  msgid "Unrecognized response from iThemes API server."
88
  msgstr ""
89
 
90
+ #: lib/updater/api.php:321
91
  msgid "Incorrect password. Please make sure that you are supplying your iThemes membership username and password details."
92
  msgstr ""
93
 
94
+ #: lib/updater/api.php:325
95
  msgid "Invalid username. Please make sure that you are supplying your iThemes membership username and password details."
96
  msgstr ""
97
 
98
+ #: lib/updater/api.php:328
99
  msgid "The licensing server reports that the %1$s (%2$s) product is unknown. Please contact support for assistance."
100
  msgstr ""
101
 
102
+ #: lib/updater/api.php:331
103
  msgid "%1$s could not be licensed since the membership account is out of available licenses for this product. You can unlicense the product on other sites or upgrade your membership to one with a higher number of licenses in order to increase the amount of available licenses."
104
  msgstr ""
105
 
106
+ #: lib/updater/api.php:334
107
  msgid "%s could not be licensed due to an internal error. Please try to license %s again at a later time. If this problem continues, please contact iThemes support."
108
  msgstr ""
109
 
110
+ #: lib/updater/api.php:340
111
  msgid "An unknown error relating to the %1$s product occurred. Please contact iThemes support. Error details: %2$s"
112
  msgstr ""
113
 
114
+ #: lib/updater/api.php:342
115
  msgid "An unknown error occurred. Please contact iThemes support. Error details: %s"
116
  msgstr ""
117
 
121
  msgid "<p>Unable to get changelog data at this time.</p><p>%1$s (%2$s)</p>"
122
  msgstr ""
123
 
124
+ #: lib/updater/server.php:104
125
  msgid "The server could not be contacted. Requests are delayed for %d minute to allow the server to recover."
126
  msgid_plural "The server could not be contacted. Requests are delayed for %d minutes to allow the server to recover."
127
  msgstr[0] ""
128
  msgstr[1] ""
129
 
130
+ #: lib/updater/server.php:181
131
  msgid "The server was unable to be contacted."
132
  msgstr ""
133
 
134
+ #: lib/updater/server.php:191
135
  msgid "An error occurred when communicating with the iThemes update server: %s (%s)"
136
  msgstr ""
137
 
138
+ #: lib/updater/settings-page.php:115 settings-page.php:239
139
  msgid "Settings saved"
140
  msgstr ""
141
 
142
+ #: lib/updater/settings-page.php:122
143
  msgid "You must supply an iThemes membership username and password in order to license products."
144
  msgstr ""
145
 
146
+ #: lib/updater/settings-page.php:124
147
  msgid "You must supply an iThemes membership username in order to license products."
148
  msgstr ""
149
 
150
+ #: lib/updater/settings-page.php:126
151
  msgid "You must supply an iThemes membership password in order to license products."
152
  msgstr ""
153
 
154
+ #: lib/updater/settings-page.php:128
155
  msgid "You must select at least one product to license. Ensure that you select the products that you wish to license in the listing below."
156
  msgstr ""
157
 
158
+ #: lib/updater/settings-page.php:143
159
  msgid "An unknown server error occurred. Please try to license your products again at another time."
160
  msgstr ""
161
 
162
+ #: lib/updater/settings-page.php:163
163
  msgid "Your product subscription has expired"
164
  msgstr ""
165
 
166
+ #: lib/updater/settings-page.php:170
167
  msgid "Successfully licensed %l."
168
  msgstr ""
169
 
170
+ #: lib/updater/settings-page.php:174 lib/updater/settings-page.php:179
171
  msgid "Unable to license %1$s. Reason: %2$s"
172
  msgstr ""
173
 
174
+ #: lib/updater/settings-page.php:187
175
  msgid "You must supply an iThemes membership username and password in order to remove licenses."
176
  msgstr ""
177
 
178
+ #: lib/updater/settings-page.php:189
179
  msgid "You must supply an iThemes membership username in order to remove licenses."
180
  msgstr ""
181
 
182
+ #: lib/updater/settings-page.php:191
183
  msgid "You must supply an iThemes membership password in order to remove licenses."
184
  msgstr ""
185
 
186
+ #: lib/updater/settings-page.php:193
187
  msgid "You must select at least one license to remove. Ensure that you select the licenses that you wish to remove in the listing below."
188
  msgstr ""
189
 
190
+ #: lib/updater/settings-page.php:208
191
  msgid "An unknown server error occurred. Please try to remove licenses from your products again at another time."
192
  msgstr ""
193
 
194
+ #: lib/updater/settings-page.php:229
195
  msgid "Unknown server error."
196
  msgstr ""
197
 
198
+ #: lib/updater/settings-page.php:234
199
  msgid "Successfully removed license from %l."
200
  msgid_plural "Successfully removed licenses from %l."
201
  msgstr[0] ""
202
  msgstr[1] ""
203
 
204
+ #: lib/updater/settings-page.php:238
205
  msgid "Unable to remove license from %1$s. Reason: %2$s"
206
  msgstr ""
207
 
208
+ #: lib/updater/settings-page.php:265 lib/updater/settings-page.php:852
209
+ #: lib/updater/settings-page.php:867
210
+ msgid "Successfully updated the Licensed URL."
211
+ msgstr ""
212
+
213
+ #: lib/updater/settings-page.php:295
214
  msgid "Settings"
215
  msgstr ""
216
 
217
+ #: lib/updater/settings-page.php:301 lib/updater/settings-page.php:656
218
+ msgid "Licensed URL"
219
+ msgstr ""
220
+
221
+ #: lib/updater/settings-page.php:306
222
+ msgid "Change"
223
+ msgstr ""
224
+
225
+ #: lib/updater/settings-page.php:310
226
+ msgid "The Licensed URL should be the primary URL of this WordPress network. If this is not set correctly, some features may not function as expected."
227
+ msgstr ""
228
+
229
+ #: lib/updater/settings-page.php:312
230
+ msgid "The Licensed URL should be the primary URL of this WordPress site. If this is not set correctly, some features may not function as expected."
231
+ msgstr ""
232
+
233
+ #: lib/updater/settings-page.php:318
234
  msgid "Quick Release Updates"
235
  msgstr ""
236
 
237
+ #: lib/updater/settings-page.php:325
238
  msgid "Enable quick release updates"
239
  msgstr ""
240
 
241
+ #: lib/updater/settings-page.php:328
242
  msgid "Some products have quick releases that are created to solve specific issues that some users experience. In order to avoid causing users to have updates show up too frequently, automatic updates to these quick releases are disabled by default. Enabling this feature allows quick releases to be available to the automatic update system. Using this option is only recommended if support has requested that you enable it in order to receive a quick release. You should disable this option at a later time after confirming that the quick release solves the issue for you."
243
  msgstr ""
244
 
245
+ #: lib/updater/settings-page.php:335
246
  msgid "Save Settings"
247
  msgstr ""
248
 
249
+ #: lib/updater/settings-page.php:354 lib/updater/settings-page.php:385
250
+ #: lib/updater/settings-page.php:509 lib/updater/settings-page.php:577
251
  msgid "Product"
252
  msgstr ""
253
 
254
+ #: lib/updater/settings-page.php:355 lib/updater/settings-page.php:387
255
  msgid "Member"
256
  msgstr ""
257
 
258
+ #: lib/updater/settings-page.php:356 lib/updater/settings-page.php:389
259
  msgid "Expiration"
260
  msgstr ""
261
 
262
+ #: lib/updater/settings-page.php:357 lib/updater/settings-page.php:390
263
  msgid "Remaining Licenses"
264
  msgstr ""
265
 
266
+ #: lib/updater/settings-page.php:373
267
  msgid "Licensed Products"
268
  msgstr ""
269
 
270
+ #: lib/updater/settings-page.php:379 lib/updater/settings-page.php:503
271
  msgid "Select All"
272
  msgstr ""
273
 
274
+ #: lib/updater/settings-page.php:388
275
  msgid "Product Status"
276
  msgstr ""
277
 
278
+ #: lib/updater/settings-page.php:398
279
  msgid "unlimited"
280
  msgstr ""
281
 
282
+ #: lib/updater/settings-page.php:439 lib/updater/settings-page.php:533
283
  msgid "Select %s"
284
  msgstr ""
285
 
286
+ #: lib/updater/settings-page.php:459
287
  msgid "Remove Licenses"
288
  msgstr ""
289
 
290
+ #: lib/updater/settings-page.php:493
291
  msgid "Unlicensed Products"
292
  msgstr ""
293
 
294
+ #: lib/updater/settings-page.php:495
295
  msgid "The following products have not been licensed. Licensing a product gives you access to automatic updates from within WordPress."
296
  msgstr ""
297
 
298
+ #: lib/updater/settings-page.php:496
299
  msgid "To license products, select the products you wish to license, enter your iThemes membership username and password, and press the License Products button."
300
  msgstr ""
301
 
302
+ #: lib/updater/settings-page.php:497
303
  msgid "Need help? <a href=\"%s\">Click here for a quick video tutorial</a>."
304
  msgstr ""
305
 
306
+ #: lib/updater/settings-page.php:549
307
  msgid "License Products"
308
  msgstr ""
309
 
310
+ #: lib/updater/settings-page.php:569
311
  msgid "Unrecognized Products"
312
  msgstr ""
313
 
314
+ #: lib/updater/settings-page.php:571
315
  msgid "The following products were not recognized by the licensing system. This can be due to a bug in the product code, a temporary server issue, or because the product is no longer supported."
316
  msgstr ""
317
 
318
+ #: lib/updater/settings-page.php:572
319
  msgid "Please check this page again at a later time to see if the problem resolves itself. If the product remains, please contact <a href=\"%s\">iThemes support</a> and provide them with the details given below."
320
  msgstr ""
321
 
322
+ #: lib/updater/settings-page.php:578
323
  msgid "Type"
324
  msgstr ""
325
 
326
+ #: lib/updater/settings-page.php:579
327
  msgid "Package"
328
  msgstr ""
329
 
330
+ #: lib/updater/settings-page.php:580
331
  msgid "Version"
332
  msgstr ""
333
 
334
+ #: lib/updater/settings-page.php:581
335
  msgid "Server Response"
336
  msgstr ""
337
 
338
+ #: lib/updater/settings-page.php:591
339
  msgid "Unknown Error"
340
  msgstr ""
341
 
342
+ #: lib/updater/settings-page.php:643 lib/updater/settings-page.php:748
343
+ msgid "Licensing"
344
+ msgstr ""
345
+
346
+ #: lib/updater/settings-page.php:645
347
+ msgid "Please confirm this site's licensed URL."
348
+ msgstr ""
349
+
350
+ #: lib/updater/settings-page.php:659
351
+ msgid "The Licensed URL should be the primary URL of this WordPress network."
352
+ msgstr ""
353
+
354
+ #: lib/updater/settings-page.php:660 lib/updater/settings-page.php:663
355
+ msgid "If not set correctly, some features may not function as expected."
356
+ msgstr ""
357
+
358
+ #: lib/updater/settings-page.php:662
359
+ msgid "The Licensed URL should be the primary URL of this WordPress site."
360
+ msgstr ""
361
+
362
+ #: lib/updater/settings-page.php:677 lib/updater/settings-page.php:807
363
+ msgid "Save"
364
+ msgstr ""
365
+
366
+ #: lib/updater/settings-page.php:692 lib/updater/settings-page.php:829
367
+ msgid "The licensed URL cannot be blank."
368
+ msgstr ""
369
+
370
+ #: lib/updater/settings-page.php:694 lib/updater/settings-page.php:831
371
+ msgid "The licensed URL must be a valid URL."
372
+ msgstr ""
373
+
374
+ #: lib/updater/settings-page.php:717
375
+ msgid "Successfully set the Licensed URL."
376
+ msgstr ""
377
+
378
+ #: lib/updater/settings-page.php:750
379
+ msgid "The licenses on this site are for <code>%s</code>."
380
+ msgstr ""
381
+
382
+ #: lib/updater/settings-page.php:762
383
+ msgid "License Option"
384
+ msgstr ""
385
+
386
+ #: lib/updater/settings-page.php:769
387
+ msgid "Create new licenses for this site."
388
+ msgstr ""
389
+
390
+ #: lib/updater/settings-page.php:772
391
+ msgid "Use this option if this site was cloned from another site and needs to have its own licenses."
392
+ msgstr ""
393
+
394
+ #: lib/updater/settings-page.php:778
395
+ msgid "Change the existing licenses to be for <code>%s</code>."
396
+ msgstr ""
397
+
398
+ #: lib/updater/settings-page.php:783
399
+ msgid "Note: If the <code>%s</code> site still exists and is different from this site, you will have to create new licenses on that site."
400
+ msgstr ""
401
+
402
+ #: lib/updater/settings-page.php:785
403
+ msgid "Use this option if this site's primary URL has changed from <code>%1$s</code> to <code>%2$s</code>."
404
+ msgstr ""
405
+
406
+ #: lib/updater/settings-page.php:790
407
+ msgid "iThemes Username"
408
+ msgstr ""
409
+
410
+ #: lib/updater/settings-page.php:797
411
+ msgid "iThemes Password"
412
+ msgstr ""
413
+
414
+ #: lib/updater/settings-page.php:823
415
+ msgid "You must supply an iThemes membership username and password in order to change the licensed URL."
416
+ msgstr ""
417
+
418
+ #: lib/updater/settings-page.php:825
419
+ msgid "You must supply an iThemes membership username in order to change the licensed URL."
420
+ msgstr ""
421
+
422
+ #: lib/updater/settings-page.php:827
423
+ msgid "You must supply an iThemes membership password in order to change the licensed URL."
424
+ msgstr ""
425
+
426
+ #: lib/updater/settings-page.php:833
427
+ msgid "You must pick one of the License Option options."
428
+ msgstr ""
429
+
430
+ #: lib/updater/settings-page.php:927
431
  msgid "%d day"
432
  msgid_plural "%d days"
433
  msgstr[0] ""
434
  msgstr[1] ""
435
 
436
+ #: lib/updater/settings-page.php:929
437
  msgid "%d hour"
438
  msgid_plural "%d hours"
439
  msgstr[0] ""
440
  msgstr[1] ""
441
 
442
+ #: lib/updater/settings-page.php:931
443
  msgid "%d minute"
444
  msgid_plural "%d minutes"
445
  msgstr[0] ""
446
  msgstr[1] ""
447
 
448
+ #: lib/updater/settings-page.php:933
449
  msgid "%d second"
450
  msgid_plural "%d seconds"
451
  msgstr[0] ""
452
  msgstr[1] ""
453
 
454
+ #: lib/updater/settings-page.php:936
455
  msgid "%s ago"
456
  msgstr ""
457
 
lib/updater/api.php CHANGED
@@ -28,6 +28,18 @@ class Ithemes_Updater_API {
28
  return self::get_response( 'deactivate_package', compact( 'username', 'password', 'packages' ), false );
29
  }
30
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  public static function get_package_details( $cache = true ) {
32
  $packages = array();
33
 
28
  return self::get_response( 'deactivate_package', compact( 'username', 'password', 'packages' ), false );
29
  }
30
 
31
+ public static function get_licensed_site_url() {
32
+ $packages = array();
33
+
34
+ return self::get_response( 'get_licensed_site_url', compact( 'packages' ), false );
35
+ }
36
+
37
+ public static function set_licensed_site_url( $username, $password, $site_url ) {
38
+ $packages = array();
39
+
40
+ return self::get_response( 'set_licensed_site_url', compact( 'username', 'password', 'site_url', 'packages' ), false );
41
+ }
42
+
43
  public static function get_package_details( $cache = true ) {
44
  $packages = array();
45
 
lib/updater/css/settings-page.css CHANGED
@@ -65,3 +65,136 @@
65
  .widefat.ithemes-updater-listing tr.expired.alt {
66
  background-color: #F9E1DD;
67
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  .widefat.ithemes-updater-listing tr.expired.alt {
66
  background-color: #F9E1DD;
67
  }
68
+
69
+ #ithemes-updater-site-url-confirmation {
70
+ padding-left: 13px;
71
+ }
72
+ #ithemes-updater-site-url-confirmation .ithemes-updater-header {
73
+ background: url( '../images/ithemes-logo-header.png' ) no-repeat;
74
+ height: 30px;
75
+ width: 198px;
76
+ display: block;
77
+ margin: 29px 0 32px;
78
+ }
79
+ #ithemes-updater-site-url-confirmation h2 {
80
+ font-size: 24px;
81
+ }
82
+ #ithemes-updater-site-url-confirmation > p {
83
+ font-size: 16px;
84
+ }
85
+ #ithemes-updater-site-url-confirmation #ithemes-updater-table-wrapper {
86
+ background-color: #FFFFFF;
87
+ padding: 0 20px;
88
+ border: 4px solid #FFFFFF;
89
+ border-radius: 4px;
90
+ max-width: 900px;
91
+ }
92
+ #ithemes-updater-site-url-confirmation form {
93
+ margin: 24px 0;
94
+ }
95
+ #ithemes-updater-site-url-confirmation table {
96
+ margin: 0;
97
+ }
98
+ #ithemes-updater-site-url-confirmation th {
99
+ width: 400px;
100
+ }
101
+ #ithemes-updater-site-url-confirmation td {
102
+ vertical-align: top;
103
+ padding: 20px 0 20px 10px;
104
+ }
105
+ #ithemes-updater-site-url-confirmation th label {
106
+ text-transform: uppercase;
107
+ }
108
+ #ithemes-updater-site-url-confirmation th label+.description {
109
+ padding-top: 10px;
110
+ }
111
+ #ithemes-updater-site-url-confirmation .description {
112
+ font-size: 12px;
113
+ font-weight: normal;
114
+ }
115
+ #ithemes-updater-site-url-confirmation .ithemes-updater-description-warning {
116
+ font-style: italic;
117
+ }
118
+ #ithemes-updater-site-url-confirmation .submit input[type="submit"] {
119
+ font-size: 16px;
120
+ font-weight: bold;
121
+ line-height: 16px;
122
+ padding: 11px 21px;
123
+ border-radius: 4px;
124
+ }
125
+
126
+ #ithemes-updater-relicense {
127
+ padding-left: 13px;
128
+ }
129
+ #ithemes-updater-relicense .ithemes-updater-header {
130
+ background: url( '../images/ithemes-logo-header.png' ) no-repeat;
131
+ height: 30px;
132
+ width: 198px;
133
+ display: block;
134
+ margin: 29px 0 32px;
135
+ }
136
+ #ithemes-updater-relicense h2 {
137
+ font-size: 24px;
138
+ }
139
+ #ithemes-updater-relicense > p {
140
+ font-size: 16px;
141
+ }
142
+ #ithemes-updater-relicense #ithemes-updater-table-wrapper {
143
+ background-color: #FFFFFF;
144
+ padding: 10px;
145
+ border: 4px solid #FFFFFF;
146
+ border-radius: 4px;
147
+ max-width: 900px;
148
+ }
149
+ #ithemes-updater-relicense form {
150
+ margin: 24px 0;
151
+ }
152
+ #ithemes-updater-relicense table {
153
+ margin: 0;
154
+ }
155
+ #ithemes-updater-relicense th {
156
+ width: 250px;
157
+ padding: 10px;
158
+ }
159
+ #ithemes-updater-relicense td {
160
+ vertical-align: top;
161
+ padding: 10px;
162
+ }
163
+ #ithemes-updater-relicense th label {
164
+ text-transform: uppercase;
165
+ }
166
+ #ithemes-updater-relicense th label+.description {
167
+ padding-top: 10px;
168
+ }
169
+ #ithemes-updater-relicense th input {
170
+ margin-top: 10px;
171
+ }
172
+ #ithemes-updater-relicense td input[type="radio"] {
173
+ margin-left: -23px;
174
+ }
175
+ #ithemes-updater-relicense .description {
176
+ font-size: 12px;
177
+ font-weight: normal;
178
+ }
179
+ #ithemes-updater-relicense .ithemes-updater-description-warning {
180
+ font-style: italic;
181
+ margin-top: 10px;
182
+ }
183
+ #ithemes-updater-relicense .ithemes-updater-description-notice {
184
+ font-style: italic;
185
+ margin-top: 10px;
186
+ background-color: #D7F0FC;
187
+ border-radius: 3px;
188
+ color: #366C92;
189
+ padding: 5px 8px 5px 29px;
190
+ }
191
+ #ithemes-updater-relicense .ithemes-updater-description-notice .dashicons-warning {
192
+ margin-left: -23px;
193
+ }
194
+ #ithemes-updater-relicense .submit input[type="submit"] {
195
+ font-size: 16px;
196
+ font-weight: bold;
197
+ line-height: 16px;
198
+ padding: 11px 21px;
199
+ border-radius: 4px;
200
+ }
lib/updater/history.txt CHANGED
@@ -44,3 +44,14 @@
44
  Enhancement: Added ability to manage licensing from WP-CLI.
45
  1.5.1 - 2018-05-03 - Chris Jean
46
  Bug Fix: Fixed fatal error that could occur when clicking the "View details" link for an available plugin update.
 
 
 
 
 
 
 
 
 
 
 
44
  Enhancement: Added ability to manage licensing from WP-CLI.
45
  1.5.1 - 2018-05-03 - Chris Jean
46
  Bug Fix: Fixed fatal error that could occur when clicking the "View details" link for an available plugin update.
47
+ 1.5.2 - 2018-05-25 - Chris Jean
48
+ Bug Fix: Fixed error in error handler for cases where requests for changelog updates fail.
49
+ 1.6.0 - 2020-08-06 - Chris Jean
50
+ Enhancement: Added the ability for the user to manage the licensed site URL.
51
+ 1.6.1 - 2020-08-06 - Chris Jean
52
+ Bug Fix: Fixed bug that can cause licensed site URL management from working properly on some sites on https connections.
53
+ 1.6.2 - 2020-08-07 - Chris Jean
54
+ Bug Fix: Fixed fatal error that can happen when upgrading to the 1.6.1 version of this code:
55
+ Ithemes_Updater_Settings::get_licensed_site_url() in server.php:199".
56
+ 1.6.4 - 2020-08-11 - Chris Jean
57
+ Enhancement: Added support for the auto-update feature introduced in WordPress 5.5.
lib/updater/information.php CHANGED
@@ -39,7 +39,7 @@ class Ithemes_Updater_Information {
39
 
40
  if ( is_wp_error( $changelog ) ) {
41
  /* translators: 1. Error message, 2. Error code */
42
- $changelog = sprintf( __( '<p>Unable to get changelog data at this time.</p><p>%1$s (%2$s)</p>', 'it-l10n-ithemes-sync' ), $response->get_error_message(), $response->get_error_code() );
43
  }
44
 
45
 
39
 
40
  if ( is_wp_error( $changelog ) ) {
41
  /* translators: 1. Error message, 2. Error code */
42
+ $changelog = sprintf( __( '<p>Unable to get changelog data at this time.</p><p>%1$s (%2$s)</p>', 'it-l10n-ithemes-sync' ), $changelog->get_error_message(), $changelog->get_error_code() );
43
  }
44
 
45
 
lib/updater/init.php CHANGED
@@ -58,3 +58,45 @@ function ithemes_updater_filter_update_themes( $update_themes ) {
58
  }
59
  add_filter( 'site_transient_update_themes', 'ithemes_updater_filter_update_themes' );
60
  add_filter( 'transient_update_themes', 'ithemes_updater_filter_update_themes' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  }
59
  add_filter( 'site_transient_update_themes', 'ithemes_updater_filter_update_themes' );
60
  add_filter( 'transient_update_themes', 'ithemes_updater_filter_update_themes' );
61
+
62
+
63
+ function ithemes_updater_get_licensed_site_url() {
64
+ if ( ! class_exists( 'Ithemes_Updater_Settings' ) ) {
65
+ require( $GLOBALS['ithemes_updater_path'] . '/settings.php' );
66
+ }
67
+
68
+ return $GLOBALS['ithemes-updater-settings']->get_licensed_site_url();
69
+ }
70
+
71
+ function ithemes_updater_get_seen_hostnames() {
72
+ if ( ! class_exists( 'Ithemes_Updater_Settings' ) ) {
73
+ require( $GLOBALS['ithemes_updater_path'] . '/settings.php' );
74
+ }
75
+
76
+ return $GLOBALS['ithemes-updater-settings']->get_hostname_history();
77
+ }
78
+
79
+ function ithemes_updater_is_request_on_licensed_site_url() {
80
+ if ( ! class_exists( 'Ithemes_Updater_Settings' ) ) {
81
+ require( $GLOBALS['ithemes_updater_path'] . '/settings.php' );
82
+ }
83
+
84
+ return $GLOBALS['ithemes-updater-settings']->is_request_on_licensed_site_url();
85
+ }
86
+
87
+ function ithemes_updater_get_change_licensed_site_url( $redirect = '' ) {
88
+ return admin_url( 'options-general.php?page=ithemes-licensing&action=change_licensed_site_url&redirect=' . urlencode( $redirect ) );
89
+ }
90
+
91
+ function ithemes_updater_change_licensed_site_url( $redirect = '' ) {
92
+ wp_redirect( ithemes_updater_get_change_licensed_site_url( $redirect ) );
93
+ exit();
94
+ }
95
+
96
+ function ithemes_updater_is_licensed_site_url_confirmed() {
97
+ if ( ! class_exists( 'Ithemes_Updater_Settings' ) ) {
98
+ require( $GLOBALS['ithemes_updater_path'] . '/settings.php' );
99
+ }
100
+
101
+ return $GLOBALS['ithemes-updater-settings']->is_licensed_site_url_confirmed();
102
+ }
lib/updater/load.php CHANGED
@@ -5,7 +5,7 @@ Written by Chris Jean for iThemes.com
5
  */
6
 
7
 
8
- $it_registration_list_version = '1.5.1';
9
  $it_registration_list_library = 'updater';
10
  $it_registration_list_init_file = dirname( __FILE__ ) . '/init.php';
11
 
5
  */
6
 
7
 
8
+ $it_registration_list_version = '1.6.4';
9
  $it_registration_list_library = 'updater';
10
  $it_registration_list_init_file = dirname( __FILE__ ) . '/init.php';
11
 
lib/updater/server.php CHANGED
@@ -56,6 +56,30 @@ class Ithemes_Updater_Server {
56
  return Ithemes_Updater_Server::request( 'package-deactivate', $query, $data );
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  public static function get_package_details( $packages ) {
60
  $query = array();
61
 
@@ -172,10 +196,19 @@ class Ithemes_Updater_Server {
172
  }
173
 
174
  private static function get_site_url() {
175
- if ( is_callable( 'network_home_url' ) ) {
176
- $site_url = network_home_url();
177
- } else {
178
- $site_url = get_bloginfo( 'url' );
 
 
 
 
 
 
 
 
 
179
  }
180
 
181
  $site_url = preg_replace( '/^https/', 'http', $site_url );
56
  return Ithemes_Updater_Server::request( 'package-deactivate', $query, $data );
57
  }
58
 
59
+ public static function get_licensed_site_url( $packages ) {
60
+ $query = array();
61
+
62
+ $data = array(
63
+ 'packages' => $packages
64
+ );
65
+
66
+ return Ithemes_Updater_Server::request( 'licensed-site-url-get', $query, $data );
67
+ }
68
+
69
+ public static function set_licensed_site_url( $username, $password, $site_url, $keys ) {
70
+ $query = array(
71
+ 'user' => $username
72
+ );
73
+
74
+ $data = array(
75
+ 'auth_token' => self::get_password_hash( $username, $password ),
76
+ 'site_url' => $site_url,
77
+ 'keys' => $keys,
78
+ );
79
+
80
+ return Ithemes_Updater_Server::request( 'licensed-site-url-set', $query, $data );
81
+ }
82
+
83
  public static function get_package_details( $packages ) {
84
  $query = array();
85
 
196
  }
197
 
198
  private static function get_site_url() {
199
+ require_once( $GLOBALS['ithemes_updater_path'] . '/settings.php' );
200
+
201
+ // Ensure that a fatal error isn't triggered on upgrade.
202
+ if ( is_callable( array( $GLOBALS['ithemes-updater-settings'], 'get_licensed_site_url' ) ) ) {
203
+ $site_url = $GLOBALS['ithemes-updater-settings']->get_licensed_site_url();
204
+ }
205
+
206
+ if ( empty( $site_url ) ) {
207
+ if ( is_callable( 'network_home_url' ) ) {
208
+ $site_url = network_home_url( '', 'http' );
209
+ } else {
210
+ $site_url = get_bloginfo( 'url' );
211
+ }
212
  }
213
 
214
  $site_url = preg_replace( '/^https/', 'http', $site_url );
lib/updater/settings-page.php CHANGED
@@ -41,30 +41,50 @@ class Ithemes_Updater_Settings_Page {
41
 
42
 
43
  add_action( 'ithemes_updater_settings_page_index', array( $this, 'index' ) );
 
44
  add_action( 'admin_print_styles', array( $this, 'add_styles' ) );
45
  }
46
 
 
 
 
 
47
  public function add_styles() {
48
- wp_enqueue_style( 'ithemes-updater-settings-page-style', "{$this->path_url}/css/settings-page.css" );
49
  }
50
 
51
  public function index() {
52
- $post_data = Ithemes_Updater_Functions::get_post_data( array( 'it-updater-username', 'it-updater-password', 'packages', 'action' ), true );
53
 
54
- if ( empty( $post_data['packages'] ) )
55
  $post_data['packages'] = array();
 
56
 
 
 
 
 
 
 
 
57
 
58
- $action = $post_data['action'];
59
-
60
- if ( 'license_packages' == $action )
61
- $this->license_packages( $post_data );
62
- else if ( 'unlicense_packages' == $action )
63
- $this->unlicense_packages( $post_data );
64
- else if ( 'save_settings' == $action )
65
- $this->save_settings();
 
 
 
 
 
 
66
 
67
- $this->list_packages( $action, $post_data );
 
68
  }
69
 
70
  private function save_settings() {
@@ -219,7 +239,7 @@ class Ithemes_Updater_Settings_Page {
219
  }
220
  }
221
 
222
- public function list_packages( $action, $post_data ) {
223
  require_once( $GLOBALS['ithemes_updater_path'] . '/packages.php' );
224
  $details = Ithemes_Updater_Packages::get_full_details();
225
  $packages = $details['packages'];
@@ -241,39 +261,24 @@ class Ithemes_Updater_Settings_Page {
241
  }
242
 
243
 
244
- if ( ! empty( $this->messages ) ) {
245
- foreach ( $this->messages as $message )
246
- echo "<div class=\"updated fade\"><p><strong>$message</strong></p></div>\n";
247
  }
248
 
249
- if ( ! empty( $this->errors ) ) {
250
- foreach ( $this->errors as $error )
251
- echo "<div class=\"error\"><p><strong>$error</strong></p></div>\n";
252
- }
253
 
254
- if ( ! empty( $this->soft_errors ) ) {
255
- foreach ( $this->soft_errors as $error )
256
- echo "<div class=\"error\"><p><strong>$error</strong></p></div>\n";
257
- }
258
 
259
 
260
  ?>
261
  <div class="wrap">
262
- <?php
263
- if ( version_compare( $GLOBALS['wp_version'], '3.7.10', '<=' ) ) {
264
- screen_icon();
265
- }
266
- ?>
267
-
268
  <h2><?php _e( 'iThemes Licensing', 'it-l10n-ithemes-sync' ); ?></h2>
269
 
270
- <?php $this->list_licensed_products( $licensed, $post_data, $action ); ?>
271
-
272
- <?php $this->list_unlicensed_products( $unlicensed, $post_data, $action ); ?>
273
-
274
- <?php $this->list_unrecognized_products( $unrecognized ); ?>
275
-
276
- <?php $this->show_settings(); ?>
277
  </div>
278
  <?php
279
 
@@ -291,6 +296,23 @@ class Ithemes_Updater_Settings_Page {
291
 
292
  <table class="form-table">
293
  <tbody>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  <tr valign="top">
295
  <th scope="row">
296
  <label for="quick_releases"><?php _e( 'Quick Release Updates', 'it-l10n-ithemes-sync' ); ?></label>
@@ -589,6 +611,303 @@ class Ithemes_Updater_Settings_Page {
589
 
590
  }
591
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
592
  private function get_expiration_string( $expiration_timestamp ) {
593
  $time = time();
594
 
@@ -619,6 +938,19 @@ class Ithemes_Updater_Settings_Page {
619
 
620
  return $expiration;
621
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
622
  }
623
 
624
 
41
 
42
 
43
  add_action( 'ithemes_updater_settings_page_index', array( $this, 'index' ) );
44
+ add_action( 'admin_print_scripts', array( $this, 'add_scripts' ) );
45
  add_action( 'admin_print_styles', array( $this, 'add_styles' ) );
46
  }
47
 
48
+ public function add_scripts() {
49
+ wp_enqueue_script( 'ithemes-updater-settings-page-script', "{$this->path_url}/js/settings-page.js", array(), 2 );
50
+ }
51
+
52
  public function add_styles() {
53
+ wp_enqueue_style( 'ithemes-updater-settings-page-style', "{$this->path_url}/css/settings-page.css", array(), 2 );
54
  }
55
 
56
  public function index() {
57
+ $post_data = Ithemes_Updater_Functions::get_post_data( array( 'it-updater-username', 'it-updater-password', 'packages', 'action', 'site_url', 'redirect', 'relicense_option' ), true );
58
 
59
+ if ( empty( $post_data['packages'] ) ) {
60
  $post_data['packages'] = array();
61
+ }
62
 
63
+ if ( ! empty( $post_data['action'] ) ) {
64
+ $action = $post_data['action'];
65
+ } else if ( ! empty( $_REQUEST['action'] ) ) {
66
+ $action = $_REQUEST['action'];
67
+ } else {
68
+ $action = 'list_packages';
69
+ }
70
 
71
+ if ( 'save_licensed_site_url' === $action ) {
72
+ $this->save_licensed_site_url( $post_data );
73
+ } else if ( 'relicense' === $action ) {
74
+ $this->relicense( $post_data );
75
+ } else if ( 'change_licensed_site_url' === $action || ! $GLOBALS['ithemes-updater-settings']->is_licensed_site_url_confirmed() ) {
76
+ $this->show_licensed_site_url_confirmation_page( $post_data );
77
+ } else {
78
+ if ( 'license_packages' === $action ) {
79
+ $this->license_packages( $post_data );
80
+ } else if ( 'unlicense_packages' === $action ) {
81
+ $this->unlicense_packages( $post_data );
82
+ } else if ( 'save_settings' === $action ) {
83
+ $this->save_settings();
84
+ }
85
 
86
+ $this->list_packages( $action, $post_data );
87
+ }
88
  }
89
 
90
  private function save_settings() {
239
  }
240
  }
241
 
242
+ public function list_packages( $action = 'list_packages', $post_data = array() ) {
243
  require_once( $GLOBALS['ithemes_updater_path'] . '/packages.php' );
244
  $details = Ithemes_Updater_Packages::get_full_details();
245
  $packages = $details['packages'];
261
  }
262
 
263
 
264
+ if ( ! empty( $_REQUEST['updated_url'] ) ) {
265
+ $this->messages[] = __( 'Successfully updated the Licensed URL.', 'it-l10n-ithemes-sync' );
 
266
  }
267
 
 
 
 
 
268
 
269
+ $this->show_notices();
 
 
 
270
 
271
 
272
  ?>
273
  <div class="wrap">
 
 
 
 
 
 
274
  <h2><?php _e( 'iThemes Licensing', 'it-l10n-ithemes-sync' ); ?></h2>
275
 
276
+ <?php
277
+ $this->list_licensed_products( $licensed, $post_data, $action );
278
+ $this->list_unlicensed_products( $unlicensed, $post_data, $action );
279
+ $this->list_unrecognized_products( $unrecognized );
280
+ $this->show_settings();
281
+ ?>
 
282
  </div>
283
  <?php
284
 
296
 
297
  <table class="form-table">
298
  <tbody>
299
+ <tr valign="top">
300
+ <th scope="row">
301
+ <?php _e( 'Licensed URL', 'it-l10n-ithemes-sync' ); ?>
302
+ </th>
303
+ <td>
304
+ <p>
305
+ <code><?php echo $GLOBALS['ithemes-updater-settings']->get_licensed_site_url(); ?></code>
306
+ <a href="<?php echo admin_url( 'options-general.php?page=ithemes-licensing&action=change_licensed_site_url' ); ?>" class="button button-primary"><?php _e( 'Change', 'it-l10n-ithemes-sync' ); ?></a>
307
+ </p>
308
+
309
+ <?php if ( is_multisite() ) : ?>
310
+ <p class="description"><?php _e( 'The Licensed URL should be the primary URL of this WordPress network. If this is not set correctly, some features may not function as expected.', 'it-l10n-ithemes-sync' ); ?></p>
311
+ <?php else : ?>
312
+ <p class="description"><?php _e( 'The Licensed URL should be the primary URL of this WordPress site. If this is not set correctly, some features may not function as expected.', 'it-l10n-ithemes-sync' ); ?></p>
313
+ <?php endif; ?>
314
+ </td>
315
+ </tr>
316
  <tr valign="top">
317
  <th scope="row">
318
  <label for="quick_releases"><?php _e( 'Quick Release Updates', 'it-l10n-ithemes-sync' ); ?></label>
611
 
612
  }
613
 
614
+ public function show_licensed_site_url_confirmation_page( $post_data = array() ) {
615
+ $this->show_notices();
616
+
617
+
618
+ $site_url = $GLOBALS['ithemes-updater-settings']->get_licensed_site_url();
619
+
620
+ if ( empty( $site_url ) ) {
621
+ $site_url = network_home_url();
622
+ }
623
+
624
+
625
+ if ( empty( $post_data['username'] ) || empty( $this->errors ) ) {
626
+ $post_data['username'] = '';
627
+ }
628
+ if ( empty( $post_data['password'] ) || empty( $this->errors ) ) {
629
+ $post_data['password'] = '';
630
+ }
631
+ if ( ! empty( $post_data['redirect'] ) ) {
632
+ $redirect = $post_data['redirect'];
633
+ } else if ( ! empty( $_GET['redirect'] ) ) {
634
+ $redirect = $_GET['redirect'];
635
+ } else {
636
+ $redirect = '';
637
+ }
638
+
639
+
640
+ ?>
641
+ <div class="wrap" id="ithemes-updater-site-url-confirmation">
642
+ <span class="ithemes-updater-header"></span>
643
+ <h2><?php _e( 'Licensing', 'it-l10n-ithemes-sync' ); ?></h2>
644
+
645
+ <p><?php _e( "Please confirm this site's licensed URL.", 'it-l10n-ithemes-sync' ); ?></p>
646
+
647
+ <form id="posts-filter" enctype="multipart/form-data" method="post" action="<?php echo $this->self_url; ?>">
648
+ <?php wp_nonce_field( 'save_licensed_site_url', 'ithemes_updater_nonce' ); ?>
649
+
650
+ <div id="ithemes-updater-settings">
651
+ <div id="ithemes-updater-table-wrapper">
652
+ <table class="form-table">
653
+ <tbody>
654
+ <tr valign="top">
655
+ <th scope="row">
656
+ <label for="site_url"><?php _e( 'Licensed URL', 'it-l10n-ithemes-sync' ); ?></label>
657
+
658
+ <?php if ( is_multisite() ) : ?>
659
+ <p class="description"><?php _e( 'The Licensed URL should be the primary URL of this WordPress network.', 'it-l10n-ithemes-sync' ); ?></p>
660
+ <p class="description ithemes-updater-description-warning"><?php _e( 'If not set correctly, some features may not function as expected.', 'it-l10n-ithemes-sync' ); ?></p>
661
+ <?php else : ?>
662
+ <p class="description"><?php _e( 'The Licensed URL should be the primary URL of this WordPress site.', 'it-l10n-ithemes-sync' ); ?></p>
663
+ <p class="description ithemes-updater-description-warning"><?php _e( 'If not set correctly, some features may not function as expected.', 'it-l10n-ithemes-sync' ); ?></p>
664
+ <?php endif; ?>
665
+ </th>
666
+ <td>
667
+ <label>
668
+ <input id="site_url" class="regular-text" type="text" name="site_url" value="<?php echo esc_attr( $site_url ); ?>" />
669
+ </label>
670
+ </td>
671
+ </tr>
672
+ </tbody>
673
+ </table>
674
+ </div>
675
+
676
+ <p class="submit">
677
+ <input id="save_licensed_site_url" class="button button-primary" type="submit" value="<?php _e( 'Save', 'it-l10n-ithemes-sync' ); ?>" />
678
+ <input type="hidden" name="action" value="save_licensed_site_url" />
679
+ <input type="hidden" name="redirect" value="<?php echo esc_attr( $redirect ); ?>" />
680
+ </p>
681
+ </div>
682
+ </form>
683
+ </div>
684
+ <?php
685
+
686
+ }
687
+
688
+ private function save_licensed_site_url( $data ) {
689
+ check_admin_referer( 'save_licensed_site_url', 'ithemes_updater_nonce' );
690
+
691
+ if ( empty( $data['site_url'] ) ) {
692
+ $this->errors[] = __( 'The licensed URL cannot be blank.', 'it-l10n-ithemes-sync' );
693
+ } else if ( false === filter_var( $data['site_url'], FILTER_VALIDATE_URL ) ) {
694
+ $this->errors[] = __( 'The licensed URL must be a valid URL.', 'it-l10n-ithemes-sync' );
695
+ }
696
+
697
+ if ( ! empty( $this->errors ) ) {
698
+ $this->show_licensed_site_url_confirmation_page( $data );
699
+ return;
700
+ }
701
+
702
+
703
+ $site_url = $GLOBALS['ithemes-updater-settings']->get_site_url( $data['site_url'] );
704
+
705
+ if ( $this->has_license_keys() ) {
706
+ $site_url_from_server = $GLOBALS['ithemes-updater-settings']->get_licensed_site_url_from_server();
707
+
708
+ if ( $site_url_from_server !== $site_url ) {
709
+ $data['site_url'] = $site_url;
710
+ $this->show_relicensing_page( $data );
711
+ return;
712
+ }
713
+ }
714
+
715
+
716
+ $GLOBALS['ithemes-updater-settings']->set_licensed_site_url( $site_url );
717
+ $this->messages[] = __( 'Successfully set the Licensed URL.', 'it-l10n-ithemes-sync' );
718
+
719
+ if ( empty( $data['redirect'] ) ) {
720
+ $redirect = admin_url( 'options-general.php?page=ithemes-licensing&updated_url=true' );
721
+ } else {
722
+ $redirect = $data['redirect'];
723
+ }
724
+
725
+ echo '<input id="ithemes-updater-redirect-to-url" type="hidden" value="' . esc_attr( $redirect ) . '" />' . "\n";
726
+
727
+ $this->list_packages();
728
+ }
729
+
730
+ public function show_relicensing_page( $data = array() ) {
731
+ $this->show_notices();
732
+
733
+ $site_url_from_server = $GLOBALS['ithemes-updater-settings']->get_licensed_site_url_from_server();
734
+
735
+ if ( empty( $data['relicense_option'] ) ) {
736
+ $data['relicense_option'] = 'relicense';
737
+ }
738
+ if ( empty( $data['username'] ) ) {
739
+ $data['username'] = '';
740
+ }
741
+ if ( empty( $data['password'] ) ) {
742
+ $data['password'] = '';
743
+ }
744
+
745
+ ?>
746
+ <div class="wrap" id="ithemes-updater-relicense">
747
+ <span class="ithemes-updater-header"></span>
748
+ <h2><?php _e( 'Licensing', 'it-l10n-ithemes-sync' ); ?></h2>
749
+
750
+ <p><?php printf( __( 'The licenses on this site are for <code>%s</code>.', 'it-l10n-ithemes-sync' ), $site_url_from_server ); ?></p>
751
+
752
+ <form id="posts-filter" enctype="multipart/form-data" method="post" action="<?php echo $this->self_url; ?>">
753
+ <?php wp_nonce_field( 'relicense', 'ithemes_updater_nonce' ); ?>
754
+
755
+ <div id="ithemes-updater-settings">
756
+ <div id="ithemes-updater-table-wrapper">
757
+ <table class="form-table">
758
+ <tbody>
759
+ <tr valign="top">
760
+ <th scope="row">
761
+ <label for="relicense_option">
762
+ <?php _e( 'License Option', 'it-l10n-ithemes-sync' ); ?>
763
+ </label>
764
+ </th>
765
+ <td>
766
+ <p>
767
+ <label>
768
+ <input type="radio" name="relicense_option" value="relicense" <?php if ( 'relicense' === $data['relicense_option'] ) echo 'checked="checked"'; ?> />
769
+ <?php _e( 'Create new licenses for this site.', 'it-l10n-ithemes-sync' ); ?>
770
+ </label>
771
+ </p>
772
+ <p class="description ithemes-updater-description-warning"><?php _e( 'Use this option if this site was cloned from another site and needs to have its own licenses.', 'it-l10n-ithemes-sync' ); ?></p>
773
+ <br />
774
+
775
+ <p>
776
+ <label>
777
+ <input type="radio" name="relicense_option" value="update" <?php if ( 'update' === $data['relicense_option'] ) echo 'checked="checked"'; ?> />
778
+ <?php printf( __( 'Change the existing licenses to be for <code>%s</code>.', 'it-l10n-ithemes-sync' ), $data['site_url'] ); ?>
779
+ </label>
780
+ </p>
781
+ <p class="description ithemes-updater-description-notice">
782
+ <span class="dashicons dashicons-warning"></span>
783
+ <?php printf( __( 'Note: If the <code>%s</code> site still exists and is different from this site, you will have to create new licenses on that site.', 'it-l10n-ithemes-sync' ), $data['site_url'], $site_url_from_server ); ?>
784
+ </p>
785
+ <p class="description ithemes-updater-description-warning"><?php printf( __( 'Use this option if this site\'s primary URL has changed from <code>%1$s</code> to <code>%2$s</code>.', 'it-l10n-ithemes-sync' ), $site_url_from_server, $data['site_url'] ); ?></p>
786
+ </td>
787
+ </tr>
788
+ <tr valign="top">
789
+ <th scope="row" colspan="2">
790
+ <label for="it-updater-username"><?php _e( 'iThemes Username', 'it-l10n-ithemes-sync' ); ?></label>
791
+ <br />
792
+ <input id="it-updater-username" type="text" name="it-updater-username" value="<?php echo esc_attr( $data['username'] ); ?>" />
793
+ </th>
794
+ </tr>
795
+ <tr valign="top">
796
+ <th scope="row" colspan="2">
797
+ <label for="it-updater-password"><?php _e( 'iThemes Password', 'it-l10n-ithemes-sync' ); ?></label>
798
+ <br />
799
+ <input id="it-updater-password" type="password" name="it-updater-password" value="<?php echo esc_attr( $data['password'] ); ?>" />
800
+ </th>
801
+ </tr>
802
+ </tbody>
803
+ </table>
804
+ </div>
805
+
806
+ <p class="submit">
807
+ <input id="relicense" class="button button-primary" type="submit" value="<?php _e( 'Save', 'it-l10n-ithemes-sync' ); ?>" />
808
+ <input type="hidden" name="action" value="relicense" />
809
+ <input type="hidden" name="site_url" value="<?php echo esc_attr( $data['site_url'] ); ?>" />
810
+ <input type="hidden" name="redirect" value="<?php echo esc_attr( $data['redirect'] ); ?>" />
811
+ </p>
812
+ </div>
813
+ </form>
814
+ </div>
815
+ <?php
816
+
817
+ }
818
+
819
+ private function relicense( $data ) {
820
+ check_admin_referer( 'relicense', 'ithemes_updater_nonce' );
821
+
822
+ if ( empty( $data['username'] ) && empty( $data['password'] ) ) {
823
+ $this->errors[] = __( 'You must supply an iThemes membership username and password in order to change the licensed URL.', 'it-l10n-ithemes-sync' );
824
+ } else if ( empty( $data['username'] ) ) {
825
+ $this->errors[] = __( 'You must supply an iThemes membership username in order to change the licensed URL.', 'it-l10n-ithemes-sync' );
826
+ } else if ( empty( $data['password'] ) ) {
827
+ $this->errors[] = __( 'You must supply an iThemes membership password in order to change the licensed URL.', 'it-l10n-ithemes-sync' );
828
+ } else if ( empty( $data['site_url'] ) ) {
829
+ $this->errors[] = __( 'The licensed URL cannot be blank.', 'it-l10n-ithemes-sync' );
830
+ } else if ( false === filter_var( $data['site_url'], FILTER_VALIDATE_URL ) ) {
831
+ $this->errors[] = __( 'The licensed URL must be a valid URL.', 'it-l10n-ithemes-sync' );
832
+ } else if ( empty( $data['relicense_option'] ) || ! in_array( $data['relicense_option'], array( 'relicense', 'update' ) ) ) {
833
+ $this->errors[] = __( 'You must pick one of the License Option options.', 'it-l10n-ithemes-sync' );
834
+ }
835
+
836
+ if ( ! empty( $this->errors ) ) {
837
+ $this->show_relicensing_page( $data );
838
+ return;
839
+ }
840
+
841
+
842
+ if ( 'update' === $data['relicense_option'] ) {
843
+ $response = Ithemes_Updater_API::set_licensed_site_url( $data['username'], $data['password'], $data['site_url'] );
844
+
845
+ if ( is_wp_error( $response ) ) {
846
+ $this->errors[] = Ithemes_Updater_API::get_error_explanation( $response );
847
+ $this->show_relicensing_page( $data );
848
+ return;
849
+ }
850
+
851
+ $GLOBALS['ithemes-updater-settings']->set_licensed_site_url( $data['site_url'] );
852
+ $this->messages[] = __( 'Successfully updated the Licensed URL.', 'it-l10n-ithemes-sync' );
853
+ } else {
854
+ require_once( $GLOBALS['ithemes_updater_path'] . '/keys.php' );
855
+ $keys = Ithemes_Updater_Keys::get();
856
+ $packages = array_keys( $keys );
857
+
858
+ $response = Ithemes_Updater_API::deactivate_package( $data['username'], $data['password'], $packages );
859
+
860
+ if ( is_wp_error( $response ) ) {
861
+ $this->errors[] = Ithemes_Updater_API::get_error_explanation( $response );
862
+ $this->show_relicensing_page( $data );
863
+ return;
864
+ }
865
+
866
+ $GLOBALS['ithemes-updater-settings']->set_licensed_site_url( $data['site_url'] );
867
+ $this->messages[] = __( 'Successfully updated the Licensed URL.', 'it-l10n-ithemes-sync' );
868
+
869
+ $response = Ithemes_Updater_API::activate_package( $data['username'], $data['password'], $packages );
870
+
871
+ if ( is_wp_error( $response ) ) {
872
+ $this->errors[] = Ithemes_Updater_API::get_error_explanation( $response );
873
+ $this->show_relicensing_page( $data );
874
+ return;
875
+ }
876
+ }
877
+
878
+ if ( empty( $data['redirect'] ) ) {
879
+ $redirect = admin_url( 'options-general.php?page=ithemes-licensing&updated_url=true' );
880
+ } else {
881
+ $redirect = $data['redirect'];
882
+ }
883
+
884
+ echo '<input id="ithemes-updater-redirect-to-url" type="hidden" value="' . esc_attr( $redirect ) . '" />' . "\n";
885
+
886
+ $this->list_packages();
887
+ return;
888
+ }
889
+
890
+
891
+ private function show_notices() {
892
+ if ( ! empty( $this->messages ) ) {
893
+ foreach ( $this->messages as $message ) {
894
+ echo "<div class=\"updated fade\"><p><strong>$message</strong></p></div>\n";
895
+ }
896
+ }
897
+
898
+ if ( ! empty( $this->errors ) ) {
899
+ foreach ( $this->errors as $error ) {
900
+ echo "<div class=\"error\"><p><strong>$error</strong></p></div>\n";
901
+ }
902
+ }
903
+
904
+ if ( ! empty( $this->soft_errors ) ) {
905
+ foreach ( $this->soft_errors as $error ) {
906
+ echo "<div class=\"error\"><p><strong>$error</strong></p></div>\n";
907
+ }
908
+ }
909
+ }
910
+
911
  private function get_expiration_string( $expiration_timestamp ) {
912
  $time = time();
913
 
938
 
939
  return $expiration;
940
  }
941
+
942
+ private function has_license_keys() {
943
+ require_once( $GLOBALS['ithemes_updater_path'] . '/keys.php' );
944
+
945
+ $keys = Ithemes_Updater_Keys::get();
946
+ $legacy_keys = Ithemes_Updater_Keys::get_legacy();
947
+
948
+ if ( empty( $keys ) && empty( $legacy_keys ) ) {
949
+ return false;
950
+ }
951
+
952
+ return true;
953
+ }
954
  }
955
 
956
 
lib/updater/settings.php CHANGED
@@ -42,15 +42,17 @@ class Ithemes_Updater_Settings {
42
  private $db_failure = false;
43
 
44
  private $default_options = array(
45
- 'timeout-multiplier' => 1,
46
- 'expiration' => 0,
47
- 'timestamp' => 0,
48
- 'packages' => array(),
49
- 'update_plugins' => array(),
50
- 'update_themes' => array(),
51
- 'use_ca_patch' => false,
52
- 'use_ssl' => true,
53
- 'quick_releases' => false,
 
 
54
  );
55
 
56
 
@@ -140,6 +142,8 @@ class Ithemes_Updater_Settings {
140
  if ( 0 == $this->options['timestamp'] ) {
141
  $this->update();
142
  }
 
 
143
  }
144
 
145
  public function shutdown() {
@@ -215,6 +219,9 @@ class Ithemes_Updater_Settings {
215
  if ( ! isset( $update_plugins->response ) || ! is_array( $update_plugins->response ) ) {
216
  $update_plugins->response = array();
217
  }
 
 
 
218
 
219
  $this->flush();
220
 
@@ -236,6 +243,18 @@ class Ithemes_Updater_Settings {
236
 
237
  if ( $plugin_data['Version'] == $update_data->new_version ) {
238
  unset( $this->options['update_plugins'][$plugin] );
 
 
 
 
 
 
 
 
 
 
 
 
239
  $this->plugins_cleaned = true;
240
  }
241
  }
@@ -249,6 +268,7 @@ class Ithemes_Updater_Settings {
249
  }
250
 
251
  $update_plugins->response = array_merge( $update_plugins->response, $this->options['update_plugins'] );
 
252
  }
253
 
254
  return $update_plugins;
@@ -262,6 +282,9 @@ class Ithemes_Updater_Settings {
262
  if ( ! isset( $update_themes->response ) || ! is_array( $update_themes->response ) ) {
263
  $update_themes->response = array();
264
  }
 
 
 
265
 
266
  $this->flush();
267
 
@@ -277,6 +300,11 @@ class Ithemes_Updater_Settings {
277
  if ( $theme_data->get( 'Version' ) === $update_data['new_version'] ) {
278
  unset( $this->options['update_themes'][$theme] );
279
 
 
 
 
 
 
280
  $this->themes_cleaned = true;
281
  }
282
  }
@@ -289,6 +317,7 @@ class Ithemes_Updater_Settings {
289
  }
290
 
291
  $update_themes->response = array_merge( $update_themes->response, $this->options['update_themes'] );
 
292
  }
293
 
294
  return $update_themes;
@@ -341,6 +370,121 @@ class Ithemes_Updater_Settings {
341
 
342
  return false;
343
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
  }
345
 
346
  new Ithemes_Updater_Settings();
42
  private $db_failure = false;
43
 
44
  private $default_options = array(
45
+ 'timeout-multiplier' => 1,
46
+ 'expiration' => 0,
47
+ 'timestamp' => 0,
48
+ 'packages' => array(),
49
+ 'update_plugins' => array(),
50
+ 'update_plugins_no_update' => array(),
51
+ 'update_themes' => array(),
52
+ 'update_themes_no_update' => array(),
53
+ 'use_ca_patch' => false,
54
+ 'use_ssl' => true,
55
+ 'quick_releases' => false,
56
  );
57
 
58
 
142
  if ( 0 == $this->options['timestamp'] ) {
143
  $this->update();
144
  }
145
+
146
+ $this->update_site_url_history();
147
  }
148
 
149
  public function shutdown() {
219
  if ( ! isset( $update_plugins->response ) || ! is_array( $update_plugins->response ) ) {
220
  $update_plugins->response = array();
221
  }
222
+ if ( ! isset( $update_plugins->no_update ) || ! is_array( $update_plugins->no_update ) ) {
223
+ $update_plugins->no_update = array();
224
+ }
225
 
226
  $this->flush();
227
 
243
 
244
  if ( $plugin_data['Version'] == $update_data->new_version ) {
245
  unset( $this->options['update_plugins'][$plugin] );
246
+
247
+ $update_data_array = (array) $update_data;
248
+
249
+ $update_data_array['icons'] = array();
250
+ $update_data_array['banners'] = array();
251
+ $update_data_array['banners_rtl'] = array();
252
+ $update_data_array['tested'] = '';
253
+ $update_data_array['requires_php'] = '';
254
+ $update_data_array['compatibility'] = new stdClass();
255
+
256
+ $this->options['update_plugins_no_update'][$plugin] = (object) $update_data_array;
257
+
258
  $this->plugins_cleaned = true;
259
  }
260
  }
268
  }
269
 
270
  $update_plugins->response = array_merge( $update_plugins->response, $this->options['update_plugins'] );
271
+ $update_plugins->no_update = array_merge( $update_plugins->no_update, $this->options['update_plugins_no_update'] );
272
  }
273
 
274
  return $update_plugins;
282
  if ( ! isset( $update_themes->response ) || ! is_array( $update_themes->response ) ) {
283
  $update_themes->response = array();
284
  }
285
+ if ( ! isset( $update_themes->no_update ) || ! is_array( $update_themes->no_update ) ) {
286
+ $update_themes->no_update = array();
287
+ }
288
 
289
  $this->flush();
290
 
300
  if ( $theme_data->get( 'Version' ) === $update_data['new_version'] ) {
301
  unset( $this->options['update_themes'][$theme] );
302
 
303
+ $update_data['requires'] = '';
304
+ $update_data['requires_php'] = '';
305
+
306
+ $this->options['update_themes_no_update'][$theme] = $update_data;
307
+
308
  $this->themes_cleaned = true;
309
  }
310
  }
317
  }
318
 
319
  $update_themes->response = array_merge( $update_themes->response, $this->options['update_themes'] );
320
+ $update_themes->no_update = array_merge( $update_themes->no_update, $this->options['update_themes_no_update'] );
321
  }
322
 
323
  return $update_themes;
370
 
371
  return false;
372
  }
373
+
374
+
375
+ /*
376
+ public function get_hostname_history() {
377
+ $this->get_canonical_hostname();
378
+
379
+ return $this->options['hostname_details']['history'];
380
+ }
381
+
382
+ public function get_canonical_hostname() {
383
+ if ( ! is_array( $this->options ) ) {
384
+ $this->load();
385
+ }
386
+
387
+ $hostname = $this->get_hostname();
388
+
389
+ if ( ! isset( $this->options['hostname_details'] ) || ! is_array( $this->options['hostname_details'] ) ) {
390
+ $this->options['hostname_details'] = array();
391
+ $this->options_modified = true;
392
+ }
393
+
394
+ if ( empty( $this->options['hostname_details']['canonical'] ) ) {
395
+ $this->options['hostname_details']['canonical'] = $hostname;
396
+ $this->options_modified = true;
397
+ }
398
+
399
+ if ( empty( $this->options['hostname_details']['history'] ) || ! is_array( $this->options['hostname_details']['history'] ) || ( time() - max( $this->options['hostname_details']['history'] ) > 600 ) ) {
400
+ $this->options['hostname_details']['history'][$hostname] = time();
401
+ $this->options_modified = true;
402
+ }
403
+
404
+ return $this->options['hostname_details']['canonical'];
405
+ }
406
+
407
+ public function update_canonical_hostname( $hostname ) {
408
+ $this->options['hostname_details']['canonical'] = $this->get_hostname( $hostname );
409
+ $this->options_modified = true;
410
+ }
411
+ */
412
+
413
+
414
+
415
+ public function update_site_url_history() {
416
+ $site_url = $this->get_site_url();
417
+
418
+ if ( ! isset( $this->options['site_url_history'] ) || ! is_array( $this->options['site_url_history'] ) ) {
419
+ $this->options['site_url_history'] = array();
420
+ $this->options_modified = true;
421
+ }
422
+
423
+ if ( empty( $this->options['site_url_history'] ) || ! is_array( $this->options['site_url_history'] ) || ( time() - max( $this->options['site_url_history'] ) > 600 ) ) {
424
+ $this->options['site_url_history'][$site_url] = time();
425
+ $this->options_modified = true;
426
+ }
427
+ }
428
+
429
+
430
+
431
+ public function get_site_url( $url = false ) {
432
+ if ( empty( $url ) ) {
433
+ $url = network_home_url();
434
+ }
435
+
436
+ $url = strtolower( preg_replace( '|/$|', '', $url ) );
437
+
438
+ if ( is_ssl() ) {
439
+ $url = preg_replace( '|^https?:|', 'https:', $url );
440
+ } else {
441
+ $url = preg_replace( '|^https?:|', 'http:', $url );
442
+ }
443
+
444
+ return $url;
445
+ }
446
+
447
+ public function is_request_on_licensed_site_url() {
448
+ return $this->get_licensed_site_url() === $this->get_site_url();
449
+ }
450
+
451
+ public function get_licensed_site_url_from_server() {
452
+ $response = Ithemes_Updater_API::get_licensed_site_url();
453
+
454
+ if ( ! is_wp_error( $response ) && is_array( $response ) && ! empty( $response['site_url'] ) ) {
455
+ return $this->get_site_url( "http://{$response['site_url']}" );
456
+ }
457
+
458
+ return '';
459
+ }
460
+
461
+ public function set_licensed_site_url( $url ) {
462
+ $url = $this->get_site_url( $url );
463
+ $url = preg_replace( '|^https?://|', '', $url );
464
+
465
+ $this->options['site_url'] = $url;
466
+ $this->options_modified = true;
467
+ }
468
+
469
+ public function get_licensed_site_url() {
470
+ if ( ! is_array( $this->options ) ) {
471
+ $this->load();
472
+ }
473
+
474
+ if ( empty( $this->options['site_url'] ) ) {
475
+ return false;
476
+ } else {
477
+ return $this->get_site_url( "http://{$this->options['site_url']}" );
478
+ }
479
+ }
480
+
481
+ public function is_licensed_site_url_confirmed() {
482
+ if ( false === $this->get_licensed_site_url() ) {
483
+ return false;
484
+ } else {
485
+ return true;
486
+ }
487
+ }
488
  }
489
 
490
  new Ithemes_Updater_Settings();
lib/updater/updates.php CHANGED
@@ -81,9 +81,11 @@ class Ithemes_Updater_Updates {
81
  $details = Ithemes_Updater_Packages::get_full_details( $response );
82
 
83
  $updates = array(
84
- 'update_themes' => array(),
85
- 'update_plugins' => array(),
86
- 'expiration' => $details['expiration'],
 
 
87
  );
88
 
89
  if ( ! $cached ) {
@@ -105,7 +107,7 @@ class Ithemes_Updater_Updates {
105
 
106
 
107
  foreach ( $details['packages'] as $path => $data ) {
108
- if ( empty( $data['package-url'] ) || version_compare( $data['installed'], $data['available'], '>=' ) ) {
109
  continue;
110
  }
111
 
@@ -113,8 +115,12 @@ class Ithemes_Updater_Updates {
113
  $force_minor_version_update = $GLOBALS['ithemes-updater-settings']->get_option( 'force_minor_version_update' );
114
  $quick_releases = $GLOBALS['ithemes-updater-settings']->get_option( 'quick_releases' );
115
 
116
- if ( ( isset( $data['upgrade'] ) && ! $data['upgrade'] ) && ! $force_minor_version_update && ! $quick_releases ) {
117
- continue;
 
 
 
 
118
  }
119
 
120
  if ( ! $use_ssl ) {
@@ -131,11 +137,20 @@ class Ithemes_Updater_Updates {
131
  'package' => $data['package-url'],
132
  );
133
 
134
- if ( isset( $data['autoupdate'] ) ) {
135
- $update['autoupdate'] = $data['autoupdate'];
136
- }
137
- if ( isset( $data['upgrade_notice'] ) ) {
138
- $update['upgrade_notice'] = $data['upgrade_notice'];
 
 
 
 
 
 
 
 
 
139
  }
140
 
141
  $update = (object) $update;
@@ -148,17 +163,26 @@ class Ithemes_Updater_Updates {
148
  'package' => $data['package-url'],
149
  );
150
 
151
- if ( isset( $data['autoupdate'] ) ) {
152
- $update['autoupdate'] = $data['autoupdate'];
153
- }
154
- if ( isset( $data['upgrade_notice'] ) ) {
155
- $update['upgrade_notice'] = $data['upgrade_notice'];
 
 
 
 
 
156
  }
157
 
158
  $path = dirname( $path );
159
  }
160
 
161
- $updates["update_{$data['type']}s"][$path] = $update;
 
 
 
 
162
  }
163
 
164
 
81
  $details = Ithemes_Updater_Packages::get_full_details( $response );
82
 
83
  $updates = array(
84
+ 'update_themes' => array(),
85
+ 'update_themes_no_update' => array(),
86
+ 'update_plugins' => array(),
87
+ 'update_plugins_no_update' => array(),
88
+ 'expiration' => $details['expiration'],
89
  );
90
 
91
  if ( ! $cached ) {
107
 
108
 
109
  foreach ( $details['packages'] as $path => $data ) {
110
+ if ( empty( $data['package-url'] ) ) {
111
  continue;
112
  }
113
 
115
  $force_minor_version_update = $GLOBALS['ithemes-updater-settings']->get_option( 'force_minor_version_update' );
116
  $quick_releases = $GLOBALS['ithemes-updater-settings']->get_option( 'quick_releases' );
117
 
118
+ $update_available = true;
119
+
120
+ if ( version_compare( $data['installed'], $data['available'], '>=' ) ) {
121
+ $update_available = false;
122
+ } else if ( ( isset( $data['upgrade'] ) && ! $data['upgrade'] ) && ! $force_minor_version_update && ! $quick_releases ) {
123
+ $update_available = false;
124
  }
125
 
126
  if ( ! $use_ssl ) {
137
  'package' => $data['package-url'],
138
  );
139
 
140
+ if ( $update_available ) {
141
+ if ( isset( $data['autoupdate'] ) ) {
142
+ $update['autoupdate'] = $data['autoupdate'];
143
+ }
144
+ if ( isset( $data['upgrade_notice'] ) ) {
145
+ $update['upgrade_notice'] = $data['upgrade_notice'];
146
+ }
147
+ } else {
148
+ $update['icons'] = array();
149
+ $update['banners'] = array();
150
+ $update['banners_rtl'] = array();
151
+ $update['tested'] = '';
152
+ $update['requires_php'] = '';
153
+ $update['compatibility'] = new stdClass();
154
  }
155
 
156
  $update = (object) $update;
163
  'package' => $data['package-url'],
164
  );
165
 
166
+ if ( $update_available ) {
167
+ if ( isset( $data['autoupdate'] ) ) {
168
+ $update['autoupdate'] = $data['autoupdate'];
169
+ }
170
+ if ( isset( $data['upgrade_notice'] ) ) {
171
+ $update['upgrade_notice'] = $data['upgrade_notice'];
172
+ }
173
+ } else {
174
+ $update['requires'] = '';
175
+ $update['requires_php'] = '';
176
  }
177
 
178
  $path = dirname( $path );
179
  }
180
 
181
+ if ( $update_available ) {
182
+ $updates["update_{$data['type']}s"][$path] = $update;
183
+ } else {
184
+ $updates["update_{$data['type']}s_no_update"][$path] = $update;
185
+ }
186
  }
187
 
188
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: ithemes, layotte, oakesjosh
3
  Tags: manage multiple Sites, backup, security, migrate, SEO, manage updates, administration, update manager, reports, sync, google analytics, optimize, uptime, ithemes, customize dashboard, client sites, maintenance, management, google webmaster tools, reporting
4
  Requires at least: 4.5
5
  Requires PHP: 5.6
6
- Tested up to: 5.4
7
- Stable tag: 2.1.6
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/quick-guide-gplv3.html
10
 
@@ -87,6 +87,10 @@ Make steady, reliable income for WordPress maintenance with iThemes Sync Pro’s
87
 
88
  == Changelog ==
89
 
 
 
 
 
90
  = 2.1.6 =
91
  * Bug Fix: Fixed an issue where a user couldn't be unsynced if already removed from the dashboard
92
 
3
  Tags: manage multiple Sites, backup, security, migrate, SEO, manage updates, administration, update manager, reports, sync, google analytics, optimize, uptime, ithemes, customize dashboard, client sites, maintenance, management, google webmaster tools, reporting
4
  Requires at least: 4.5
5
  Requires PHP: 5.6
6
+ Tested up to: 5.5
7
+ Stable tag: 2.1.7
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/quick-guide-gplv3.html
10
 
87
 
88
  == Changelog ==
89
 
90
+ = 2.1.7 =
91
+ * Enhancement: Added support for auto-updates in wordpress 5.5
92
+ * Enhancement: Return environment type for display in Sync dashboard
93
+
94
  = 2.1.6 =
95
  * Bug Fix: Fixed an issue where a user couldn't be unsynced if already removed from the dashboard
96