All-in-One Event Calendar - Version 1.8.2

Version Description

Download this release

Release Info

Developer yani.iliev
Plugin Icon 128x128 All-in-One Event Calendar
Version 1.8.2
Comparing to
See all releases

Code changes from version 1.8.1 to 1.8.2

all-in-one-event-calendar.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: A calendar system with month, week, day, agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
6
  * Author: Timely
7
  * Author URI: http://time.ly/
8
- * Version: 1.8.1
9
  */
10
  @set_time_limit( 0 );
11
  @ini_set( 'memory_limit', '256M' );
@@ -24,7 +24,7 @@ define( 'AI1EC_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
24
  // ==================
25
  // = Plugin Version =
26
  // ==================
27
- define( 'AI1EC_VERSION', '1.8.1' );
28
 
29
  // ====================
30
  // = Database Version =
@@ -34,7 +34,7 @@ define( 'AI1EC_DB_VERSION', 109 );
34
  // ==========================
35
  // = Bundled themes version =
36
  // ==========================
37
- define( 'AI1EC_THEMES_VERSION', 5 );
38
 
39
  // ================
40
  // = Cron Version =
@@ -42,7 +42,7 @@ define( 'AI1EC_THEMES_VERSION', 5 );
42
  define( 'AI1EC_CRON_VERSION', 102 );
43
  define( 'AI1EC_N_CRON_VERSION', 101 );
44
  define( 'AI1EC_N_CRON_FREQ', 'daily' );
45
- define( 'AI1EC_UPDATES_URL', 'http://time.ly/assets/timely-all-in-one-calendar-1.8.2.zip' );
46
 
47
  // ===============
48
  // = Plugin Path =
5
  * Description: A calendar system with month, week, day, agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
6
  * Author: Timely
7
  * Author URI: http://time.ly/
8
+ * Version: 1.8.2
9
  */
10
  @set_time_limit( 0 );
11
  @ini_set( 'memory_limit', '256M' );
24
  // ==================
25
  // = Plugin Version =
26
  // ==================
27
+ define( 'AI1EC_VERSION', '1.8.2' );
28
 
29
  // ====================
30
  // = Database Version =
34
  // ==========================
35
  // = Bundled themes version =
36
  // ==========================
37
+ define( 'AI1EC_THEMES_VERSION', 6 );
38
 
39
  // ================
40
  // = Cron Version =
42
  define( 'AI1EC_CRON_VERSION', 102 );
43
  define( 'AI1EC_N_CRON_VERSION', 101 );
44
  define( 'AI1EC_N_CRON_FREQ', 'daily' );
45
+ define( 'AI1EC_UPDATES_URL', 'http://time.ly/assets/timely-all-in-one-calendar-1.8.3.zip' );
46
 
47
  // ===============
48
  // = Plugin Path =
app/controller/class-ai1ec-themes-controller.php CHANGED
@@ -276,7 +276,12 @@ class Ai1ec_Themes_Controller {
276
  // Get previous version of core themes.
277
  $active_version = get_option( 'ai1ec_themes_version', 1 );
278
 
279
- $files = array();
 
 
 
 
 
280
  if ( $active_version < 2 ) {
281
  // Copy over files updated between AI1EC 1.6 and 1.7 RC1
282
  $files[] = 'vortex/agenda.php';
@@ -312,26 +317,148 @@ class Ai1ec_Themes_Controller {
312
  $files[] = 'vortex/calendar.php';
313
  $files[] = 'vortex/css/calendar.css';
314
  $files[] = 'vortex/css/event.css';
315
- $files[] = 'vortex/event-exceprt.php';
316
  $files[] = 'vortex/event-multi.php';
317
  $files[] = 'vortex/event-single.php';
318
  $files[] = 'vortex/style.css';
319
  }
320
 
 
 
 
 
 
321
  // Remove duplicates.
322
- $files = array_unique( $files );
 
 
 
 
323
 
 
324
  $errors = array();
325
- foreach ( $files as $file ) {
326
- if ( ! copy( $src_dir . $file, $dest_dir . $file ) ) {
327
- $errors[] = sprintf(
328
- __( '<div class="error"><p><strong>There was an error updating one of the files.</strong> Please FTP to your web server and manually copy <pre>%s</pre> to <pre>%s</pre></p></div>', AI1EC_PLUGIN_NAME ),
329
- $src_dir . $file,
330
- $dest_dir . $file
331
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  }
333
  }
334
 
 
 
 
 
 
 
335
  update_option( 'ai1ec_themes_version', AI1EC_THEMES_VERSION );
336
 
337
  if ( $errors ) {
276
  // Get previous version of core themes.
277
  $active_version = get_option( 'ai1ec_themes_version', 1 );
278
 
279
+ $files = array(); // files to copy
280
+ $files_to_delete = array(); // files to delete
281
+ $folders = array(); // folders to copy
282
+ $folders_to_delete = array(); // folders to delete
283
+ $folders_to_make = array(); // folders to make
284
+
285
  if ( $active_version < 2 ) {
286
  // Copy over files updated between AI1EC 1.6 and 1.7 RC1
287
  $files[] = 'vortex/agenda.php';
317
  $files[] = 'vortex/calendar.php';
318
  $files[] = 'vortex/css/calendar.css';
319
  $files[] = 'vortex/css/event.css';
320
+ $files[] = 'vortex/event-excerpt.php';
321
  $files[] = 'vortex/event-multi.php';
322
  $files[] = 'vortex/event-single.php';
323
  $files[] = 'vortex/style.css';
324
  }
325
 
326
+ if ( $active_version < 6 ) {
327
+ // Copy over files updated between AI1EC 1.8 RC3 and AI1EC 1.8.2
328
+ $files[] = 'vortex/event-excerpt.php';
329
+ }
330
+
331
  // Remove duplicates.
332
+ $files = array_unique( $files );
333
+ $files_to_delete = array_unique( $files_to_delete );
334
+ $folders = array_unique( $folders );
335
+ $folders_to_delete = array_unique( $folders_to_delete );
336
+ $folders_to_make = array_unique( $folders_to_make );
337
 
338
+ // array to hold error notifications to the user while updating the themes
339
  $errors = array();
340
+
341
+ // do we have something to update?
342
+ if( count( $files ) > 0 ||
343
+ count( $files_to_delete ) > 0 ||
344
+ count( $folders ) > 0 ||
345
+ count( $folders_to_delete ) > 0 ||
346
+ count( $folders_to_make ) > 0 ) {
347
+
348
+ // WP_Filesystem figures it out by itself, but the filesystem method may be overriden here
349
+ $method = '';
350
+ $url = wp_nonce_url( AI1EC_UPDATE_THEMES_BASE_URL, AI1EC_PLUGIN_NAME . '-theme-updater' );
351
+ if( false === ( $creds = request_filesystem_credentials( $url, $method, false, false ) ) ) {
352
+ // if we get here, then we don't have credentials yet,
353
+ // but have just produced a form for the user to fill in,
354
+ // so stop processing for now
355
+ return false; // stop the normal page form from displaying
356
+ }
357
+
358
+ // now we have some credentials, try to get the wp_filesystem running
359
+ if( ! WP_Filesystem( $creds ) ) {
360
+ // our credentials were no good, ask the user for them again
361
+ request_filesystem_credentials( $url, $method, true, false );
362
+ return false;
363
+ }
364
+
365
+ global $wp_filesystem;
366
+
367
+ // 1. Create new folders
368
+ foreach ( $folders_to_make as $folder_to_make ) {
369
+ // try to create the folder
370
+ if( FALSE === $wp_filesystem->mkdir( $dest_dir . $folder_to_make ) ) {
371
+ // we were not able to create the folder, notify the user
372
+ $errors[] = sprintf(
373
+ __( '<div class="error"><p><strong>There was an error creating one of the theme folders.</strong> Please FTP to your web server and manually create <pre>%s</pre></p></div>', AI1EC_PLUGIN_NAME ),
374
+ $dest_dir . $folder_to_make
375
+ );
376
+ }
377
+ }
378
+
379
+ // 2. Copy folders
380
+ foreach ( $folders as $folder ) {
381
+ // try to copy the folder
382
+ $result = copy_dir( $src_dir . $folder, $dest_dir . $folder );
383
+ if( is_wp_error( $result ) ) {
384
+ // we were not able to copy the folder, notify the user
385
+ $errors[] = sprintf(
386
+ __( '<div class="error"><p><strong>There was an error("%s") while copying theme folders.</strong> Please FTP to your web server and manually copy <pre>%s</pre> to <pre>%s</pre></p></div>', AI1EC_PLUGIN_NAME ),
387
+ $result->get_error_message(),
388
+ $src_dir . $folder,
389
+ $dest_dir . $folder
390
+ );
391
+ }
392
+ }
393
+
394
+ // 3. Copy files
395
+ // loop over files
396
+ foreach ( $files as $file ) {
397
+ // copy only files that exist
398
+ if( $wp_filesystem->exists( $src_dir . $file ) ) {
399
+ // was file copied successfully?
400
+ if ( ! $wp_filesystem->copy( $src_dir . $file, $dest_dir . $file, true, FS_CHMOD_FILE ) ) {
401
+ // If copy failed, chmod file to 0644 and try again.
402
+ $wp_filesystem->chmod( $dest_dir . $file, 0644);
403
+ if ( ! $wp_filesystem->copy( $src_dir . $file, $dest_dir . $file, true, FS_CHMOD_FILE ) ) {
404
+ // we were not able to copy the file, notify the user
405
+ $errors[] = sprintf(
406
+ __( '<div class="error"><p><strong>There was an error updating one of the files.</strong> Please FTP to your web server and manually copy <pre>%s</pre> to <pre>%s</pre></p></div>', AI1EC_PLUGIN_NAME ),
407
+ $src_dir . $file,
408
+ $dest_dir . $file
409
+ );
410
+ }
411
+ }
412
+ }
413
+ }
414
+
415
+ // 4. Remove folders
416
+ foreach ( $folders_to_delete as $folder_to_delete ) {
417
+ // check if folder exist
418
+ if( $wp_filesystem->is_dir( $dest_dir . $folder_to_delete ) ) {
419
+ // folder actions are always recursive
420
+ $recursive = true;
421
+ // try to delete the folder
422
+ if( FALSE === $wp_filesystem->delete( $dest_dir . $folder_to_delete, $recursive ) ) {
423
+ // If delete failed, chmod folder recursively to 0644 and try again.
424
+ $wp_filesystem->chmod( $dest_dir . $folder_to_delete, 0644, $recursive );
425
+ if( FALSE === $wp_filesystem->delete( $dest_dir . $folder_to_delete, $recursive ) ) {
426
+ // we were not able to remove the folder, notify the user
427
+ $errors[] = sprintf(
428
+ __( '<div class="error"><p><strong>There was an error deleting one of the folders.</strong> Please FTP to your web server and manually delete <pre>%s</pre></p></div>', AI1EC_PLUGIN_NAME ),
429
+ $dest_dir . $folder_to_delete
430
+ );
431
+ }
432
+ }
433
+ }
434
+ }
435
+
436
+ // 5. Remove files
437
+ foreach ( $files_to_delete as $file ) {
438
+ // check if file exist
439
+ if( $wp_filesystem->exists( $dest_dir . $file ) ) {
440
+ // try to delete the file
441
+ if( FALSE === $wp_filesystem->delete( $dest_dir . $file ) ) {
442
+ // If delete failed, chmod file to 0644 and try again.
443
+ $wp_filesystem->chmod( $dest_dir . $file, 0644 );
444
+ if( FALSE === $wp_filesystem->delete( $dest_dir . $file ) ) {
445
+ // we were not able to remove the file, notify the user
446
+ $errors[] = sprintf(
447
+ __( '<div class="error"><p><strong>There was an error deleting one of the files.</strong> Please FTP to your web server and manually delete <pre>%s</pre></p></div>', AI1EC_PLUGIN_NAME ),
448
+ $dest_dir . $file
449
+ );
450
+ }
451
+ }
452
+ }
453
  }
454
  }
455
 
456
+ // TODO: Only update the theme version when the update was successful.
457
+ // Otherwise provide a way for the user to review the error log that this
458
+ // update generated and to run the update again, after fixing the reported
459
+ // errors.
460
+
461
+ // Update theme version
462
  update_option( 'ai1ec_themes_version', AI1EC_THEMES_VERSION );
463
 
464
  if ( $errors ) {
app/helper/class-ai1ec-app-helper.php CHANGED
@@ -686,7 +686,7 @@ class Ai1ec_App_Helper {
686
  // Display introductory video notice if not disabled.
687
  if( $ai1ec_settings->show_intro_video ) {
688
  $args = array(
689
- 'label' => __( 'Welcome to the All-in-One Event Calendar, by timely', AI1EC_PLUGIN_NAME ),
690
  'msg' => sprintf(
691
  '<div class="timely"><a href="#ai1ec-video-modal" data-toggle="modal" ' .
692
  'class="button-primary pull-left">%s</a>' .
686
  // Display introductory video notice if not disabled.
687
  if( $ai1ec_settings->show_intro_video ) {
688
  $args = array(
689
+ 'label' => __( 'Welcome to the All-in-One Event Calendar, by Timely', AI1EC_PLUGIN_NAME ),
690
  'msg' => sprintf(
691
  '<div class="timely"><a href="#ai1ec-video-modal" data-toggle="modal" ' .
692
  'class="button-primary pull-left">%s</a>' .
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: calendar, event, events, ics, ics calendar, ical-feed, ics feed, wordpress ics importer, wordpress ical importer, upcoming events, todo, notes, journal, freebusy, availability, web calendar, web events, webcal, google calendar, ical, iCalendar, all-in-one, ai1ec, google calendar sync, ical sync, events sync, holiday calendar, calendar 2011, events 2011, widget, events widget, upcoming events widget, calendar widget, agenda widget
5
  Requires at least: 3.2
6
  Tested up to: 3.4.1
7
- Stable tag: 1.8.1
8
  License: GNU General Public License, version 3 (GPL-3.0)
9
 
10
  A calendar system with month, week, day, agenda views; upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
@@ -82,6 +82,10 @@ http://www.youtube.com/watch?v=XJ-KHOqBKuQ
82
 
83
  == Changelog ==
84
 
 
 
 
 
85
  = Version 1.8.1 =
86
  * Fixed problems that were affecting some hosts
87
 
4
  Tags: calendar, event, events, ics, ics calendar, ical-feed, ics feed, wordpress ics importer, wordpress ical importer, upcoming events, todo, notes, journal, freebusy, availability, web calendar, web events, webcal, google calendar, ical, iCalendar, all-in-one, ai1ec, google calendar sync, ical sync, events sync, holiday calendar, calendar 2011, events 2011, widget, events widget, upcoming events widget, calendar widget, agenda widget
5
  Requires at least: 3.2
6
  Tested up to: 3.4.1
7
+ Stable tag: 1.8.2
8
  License: GNU General Public License, version 3 (GPL-3.0)
9
 
10
  A calendar system with month, week, day, agenda views; upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
82
 
83
  == Changelog ==
84
 
85
+ = Version 1.8.2 =
86
+ * Improved theme updater
87
+ * Fixed some typos in language files
88
+
89
  = Version 1.8.1 =
90
  * Fixed problems that were affecting some hosts
91