Changeset 3094834
- Timestamp:
- 05/29/2024 09:01:23 PM (2 months ago)
- Location:
- ics-calendar
- Files:
-
- 144 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
ics-calendar/trunk/changelog.txt
r3091100 r3094834 1 1 === ICS Calendar Changelog === 2 3 4 5 6 7 8 9 10 11 12 13 14 2 15 3 16 = 11.1.0 - 2024.05.22 = -
ics-calendar/trunk/class-r34ics.php
r3094815 r3094834 53 53 protected $scripts_registered = false; 54 54 55 protected $list_style_views = array('basic', 'list');56 57 55 protected $shortcode_defaults = array( 58 56 'ajax' => false, … … 156 154 protected $shortcode_dynamic_values = array('guid', 'startdate'); 157 155 156 157 158 158 159 159 160 public function __construct() { … … 171 172 $this->ical_legacy_path = $this->r34ics_path . $this->ical_legacy_path; 172 173 $this->event_legacy_path = $this->r34ics_path . $this->event_legacy_path; 173 $this->list_style_views = apply_filters('r34ics_list_style_views', $this->list_style_views); 174 175 // Define allowed views (must load later so filters can be applied by other plugins) 176 add_action('init', function() { 177 $this->views = apply_filters('r34ics_views', $this->views); 178 $this->list_style_views = apply_filters('r34ics_list_style_views', $this->list_style_views); 179 }, 11); 174 180 175 181 // WP settings … … 1704 1710 'tz' => $tz, 1705 1711 'url' => $url, 1706 'view' => ( 1707 (!empty($currentweek) || $view == 'currentweek') // Deprecated option 1708 ? 'week' 1709 : $view 1710 ), 1712 'view' => (in_array($view, (array)$this->views) ? $view : 'month'), 1711 1713 'weeknumbers' => r34ics_boolean_check($weeknumbers), 1712 1714 'whitetext' => r34ics_boolean_check($whitetext), -
ics-calendar/trunk/ics-calendar.php
r3094815 r3094834 4 4 Plugin URI: https://icscalendar.com 5 5 Description: Turn your Google Calendar, Microsoft Office 365 or Apple iCloud Calendar into a seamlessly integrated, auto-updating, zero-maintenance WordPress experience. 6 Version: 11.2.0 -beta-16 Version: 11.2.0 7 7 Requires at least: 4.9 8 8 Requires PHP: 7.0 … … 35 35 36 36 37 // Load required files 38 require_once(plugin_dir_path(__FILE__) . 'class-r34ics.php'); 39 require_once(plugin_dir_path(__FILE__) . 'functions.php'); 40 require_once(plugin_dir_path(__FILE__) . 'r34ics-ajax.php'); 41 42 43 // Backward compatibility for WP < 5.3 44 if (!function_exists('wp_date')) { 45 require_once(plugin_dir_path(__FILE__) . 'compatibility.php'); 46 } 47 48 49 // Initialize plugin functionality 50 add_action('plugins_loaded', 'r34ics_plugins_loaded'); 51 function r34ics_plugins_loaded() { 52 53 // Instantiate class 54 global $R34ICS; 55 $R34ICS = new R34ICS(); 37 // Check if embedded version is already been loaded, to prevent fatal error on activation 38 if (!class_exists('R34ICS')) { 56 39 57 // Load text domain 58 load_plugin_textdomain('r34ics', false, basename(plugin_dir_path(__FILE__)) . '/i18n/languages/'); 40 // Load required files 41 require_once(plugin_dir_path(__FILE__) . 'class-r34ics.php'); 42 require_once(plugin_dir_path(__FILE__) . 'functions.php'); 43 require_once(plugin_dir_path(__FILE__) . 'r34ics-ajax.php'); 59 44 60 // Conditionally run update function61 if (is_admin() && version_compare(get_option('r34ics_version'), $R34ICS->version, '!=')) { r34ics_update(); }62 45 63 } 64 65 66 // Install 67 register_activation_hook(__FILE__, 'r34ics_install'); 68 function r34ics_install() { 69 global $R34ICS; 70 71 // Flush rewrite rules 72 flush_rewrite_rules(); 73 74 // Remember previous version 75 $previous_version = get_option('r34ics_version'); 76 update_option('r34ics_previous_version', $previous_version); 77 78 // Set version 79 if (isset($R34ICS->version)) { 80 update_option('r34ics_version', $R34ICS->version); 46 // Backward compatibility for WP < 5.3 47 if (!function_exists('wp_date')) { 48 require_once(plugin_dir_path(__FILE__) . 'compatibility.php'); 81 49 } 82 50 83 // New installation; write option to use new defaults84 if (empty($previous_version)) {85 update_option('r34ics_use_new_defaults_10_6', true);86 }87 88 // Prepare deferred admin notices89 $notices = get_option('r34ics_deferred_admin_notices', array());90 91 // Admin notice with link to settings92 $notices['r34ics_first_load'] = array(93 'content' => '<p>' . sprintf(__('Thank you for installing %1$s. Before creating your first calendar shortcode, please visit your %2$sGeneral Settings%3$s page and verify that your site language, timezone and date/time format settings are correct. See our %4$sUser Guide%5$s for more information.', 'r34ics'), '<strong>ICS Calendar</strong>', '<a href="' . admin_url('options-general.php') . '">', '</a>', '<a href="https://icscalendar.com/general-wordpress-settings/" target="_blank">', '</a>') . '</p>',94 'status' => 'info',95 );96 51 97 // Save deferred admin notices 98 update_option('r34ics_deferred_admin_notices', $notices); 99 } 100 101 102 // Updates 103 function r34ics_update() { 104 global $R34ICS; 105 106 // Remember previous version 107 $previous_version = get_option('r34ics_version'); 108 update_option('r34ics_previous_version', $previous_version); 52 // Initialize plugin functionality 53 add_action('plugins_loaded', 'r34ics_plugins_loaded'); 54 function r34ics_plugins_loaded() { 109 55 110 // Update version 111 if (isset($R34ICS->version)) { 112 update_option('r34ics_version', $R34ICS->version); 56 // Instantiate class 57 global $R34ICS; 58 $R34ICS = new R34ICS(); 59 60 // Load text domain 61 load_plugin_textdomain('r34ics', false, basename(plugin_dir_path(__FILE__)) . '/i18n/languages/'); 62 63 // Conditionally run update function 64 if (is_admin() && version_compare(get_option('r34ics_version'), $R34ICS->version, '!=')) { r34ics_update(); } 65 113 66 } 114 67 115 // Version-specific updates 116 // v. 6.11.1 renamed option from 'r34ics_transient_expiration' to 'r34ics_transient_expiration' so it's not a transient itself 117 if (version_compare($previous_version, '6.11.1', '<')) { 118 $transients_expiration = get_option('r34ics_transient_expiration') ? get_option('r34ics_transient_expiration') : 3600; 119 update_option('r34ics_transients_expiration', $transients_expiration); 120 delete_option('r34ics_transient_expiration'); 68 69 // Install 70 register_activation_hook(__FILE__, 'r34ics_install'); 71 function r34ics_install() { 72 global $R34ICS; 73 74 // Flush rewrite rules 75 flush_rewrite_rules(); 76 77 // Remember previous version 78 $previous_version = get_option('r34ics_version'); 79 update_option('r34ics_previous_version', $previous_version); 80 81 // Set version 82 if (isset($R34ICS->version)) { 83 update_option('r34ics_version', $R34ICS->version); 84 } 85 86 // New installation; write option to use new defaults 87 if (empty($previous_version)) { 88 update_option('r34ics_use_new_defaults_10_6', true); 89 } 90 91 // Prepare deferred admin notices 92 $notices = get_option('r34ics_deferred_admin_notices', array()); 93 94 // Admin notice with link to settings 95 $notices['r34ics_first_load'] = array( 96 'content' => '<p>' . sprintf(__('Thank you for installing %1$s. Before creating your first calendar shortcode, please visit your %2$sGeneral Settings%3$s page and verify that your site language, timezone and date/time format settings are correct. See our %4$sUser Guide%5$s for more information.', 'r34ics'), '<strong>ICS Calendar</strong>', '<a href="' . admin_url('options-general.php') . '">', '</a>', '<a href="https://icscalendar.com/general-wordpress-settings/" target="_blank">', '</a>') . '</p>', 97 'status' => 'info', 98 ); 99 100 // Save deferred admin notices 101 update_option('r34ics_deferred_admin_notices', $notices); 121 102 } 122 103 123 // v. 10.7.1 replaces "Load JS and CSS files on wp_enqueue_scripts action" option with check for block themes 124 // Block themes support conditionally enqueuing JS and CSS when the page contains the ICS Calendar shortcode 125 if (version_compare($previous_version, '10.7.1', '<')) { 126 delete_option('r34ics_load_css_js_on_wp_enqueue_scripts'); 104 105 // Updates 106 function r34ics_update() { 107 global $R34ICS; 108 109 // Remember previous version 110 $previous_version = get_option('r34ics_version'); 111 update_option('r34ics_previous_version', $previous_version); 112 113 // Update version 114 if (isset($R34ICS->version)) { 115 update_option('r34ics_version', $R34ICS->version); 116 } 117 118 // Version-specific updates 119 // v. 6.11.1 renamed option from 'r34ics_transient_expiration' to 'r34ics_transient_expiration' so it's not a transient itself 120 if (version_compare($previous_version, '6.11.1', '<')) { 121 $transients_expiration = get_option('r34ics_transient_expiration') ? get_option('r34ics_transient_expiration') : 3600; 122 update_option('r34ics_transients_expiration', $transients_expiration); 123 delete_option('r34ics_transient_expiration'); 124 } 125 126 // v. 10.7.1 replaces "Load JS and CSS files on wp_enqueue_scripts action" option with check for block themes 127 // Block themes support conditionally enqueuing JS and CSS when the page contains the ICS Calendar shortcode 128 if (version_compare($previous_version, '10.7.1', '<')) { 129 delete_option('r34ics_load_css_js_on_wp_enqueue_scripts'); 130 } 131 132 // Prepare deferred admin notices 133 $notices = get_option('r34ics_deferred_admin_notices', array()); 134 135 // Admin notice about refactored R34ICS::_url_get_contents() method 136 if (version_compare($previous_version, '11.0.0', '<')) { 137 $notices['r34ics_refactoring_in_v_11'] = array( 138 'content' => '<p>' . sprintf(__('%1$sPlease note:%2$s %3$s version 11.0 streamlines the way ICS feed URLs are retrieved. This change uses a standard built-in WordPress function, so it should be fully compatible with all existing installations. If you encounter any new issues after upgrading to version 11 or later, please visit the %4$sWordPress Support Forums%5$s for assistance.', 'r34ics'), '<strong>', '</strong>', 'ICS Calendar', '<a href="https://wordpress.org/support/plugin/ics-calendar/" target="_blank">', '</a>') . '</p>', 139 'status' => 'info', 140 ); 141 } 142 else { 143 unset($notices['r34ics_refactoring_in_v_11']); 144 } 145 // Admin notice about new default options 146 if (version_compare($previous_version, '10.6.0', '<')) { 147 $notices['r34ics_new_parameter_defaults_10_6'] = array( 148 'content' => '<p>' . sprintf(__('%1$sPlease note:%2$s %3$s version 10.6 changes the default options for several shortcode settings. In order to maintain consistency, these new defaults are %4$snot%5$s enabled when upgrading from an earlier version. If you would like to learn more about the changes please read our %6$sblog post%7$s, or to switch to the new defaults, turn on the %8$s option on the %9$s settings%10$s page.', 'r34ics'), '<strong>', '</strong>', 'ICS Calendar', '<em>', '</em>', '<a href="https://icscalendar.com/updated-parameter-defaults-in-ics-calendar-10-6/" target="_blank">', '</a>', '<strong>' . __('Use new parameter defaults (v.10.6)', 'r34ics') . '</strong>', '<a href="' . esc_url(r34ics_get_admin_url('settings')) . '">ICS Calendar', '</a>') . '</p>', 149 'status' => 'info', 150 ); 151 } 152 else { 153 unset($notices['r34ics_new_parameter_defaults_10_6']); 154 } 155 156 // Save deferred admin notices 157 update_option('r34ics_deferred_admin_notices', $notices); 158 159 // Purge calendar transients 160 r34ics_purge_calendar_transients(); 161 127 162 } 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 128 179 129 // Prepare deferred admin notices130 $notices = get_option('r34ics_deferred_admin_notices', array());131 132 // Admin notice about refactored R34ICS::_url_get_contents() method133 if (version_compare($previous_version, '11.0.0', '<')) {134 $notices['r34ics_refactoring_in_v_11'] = array(135 'content' => '<p>' . sprintf(__('%1$sPlease note:%2$s %3$s version 11.0 streamlines the way ICS feed URLs are retrieved. This change uses a standard built-in WordPress function, so it should be fully compatible with all existing installations. If you encounter any new issues after upgrading to version 11 or later, please visit the %4$sWordPress Support Forums%5$s for assistance.', 'r34ics'), '<strong>', '</strong>', 'ICS Calendar', '<a href="https://wordpress.org/support/plugin/ics-calendar/" target="_blank">', '</a>') . '</p>',136 'status' => 'info',137 );138 }139 else {140 unset($notices['r34ics_refactoring_in_v_11']);141 }142 // Admin notice about new default options143 if (version_compare($previous_version, '10.6.0', '<')) {144 $notices['r34ics_new_parameter_defaults_10_6'] = array(145 'content' => '<p>' . sprintf(__('%1$sPlease note:%2$s %3$s version 10.6 changes the default options for several shortcode settings. In order to maintain consistency, these new defaults are %4$snot%5$s enabled when upgrading from an earlier version. If you would like to learn more about the changes please read our %6$sblog post%7$s, or to switch to the new defaults, turn on the %8$s option on the %9$s settings%10$s page.', 'r34ics'), '<strong>', '</strong>', 'ICS Calendar', '<em>', '</em>', '<a href="https://icscalendar.com/updated-parameter-defaults-in-ics-calendar-10-6/" target="_blank">', '</a>', '<strong>' . __('Use new parameter defaults (v.10.6)', 'r34ics') . '</strong>', '<a href="' . esc_url(r34ics_get_admin_url('settings')) . '">ICS Calendar', '</a>') . '</p>',146 'status' => 'info',147 );148 }149 else {150 unset($notices['r34ics_new_parameter_defaults_10_6']);151 }152 153 // Save deferred admin notices154 update_option('r34ics_deferred_admin_notices', $notices);155 156 // Purge calendar transients157 r34ics_purge_calendar_transients();158 159 180 } 160 161 162 // Deferred install/update admin notices163 add_action('admin_notices', 'r34ics_deferred_admin_notices');164 function r34ics_deferred_admin_notices() {165 if ($notices = get_option('r34ics_deferred_admin_notices', array())) {166 foreach ((array)$notices as $notice) {167 echo '<div class="notice notice-' . esc_attr($notice['status']) . ' is-dismissible r34ics-admin-notice"><div>' . wp_kses_post($notice['content']) . '</div></div>';168 }169 }170 delete_option('r34ics_deferred_admin_notices');171 }172 173 174 // Purge transients on certain option updates175 add_action('update_option_timezone_string', 'r34ics_purge_calendar_transients'); -
ics-calendar/trunk/readme.txt
r3094815 r3094834 6 6 Tested up to: 6.5.3 7 7 Requires PHP: 7.0 8 Stable tag: 11. 1.08 Stable tag: 11..0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 100 100 == Changelog == 101 101 102 = 11.2.0 -beta-1- 2024.05.29 =102 = 11.2.0 - 2024.05.29 = 103 103 104 104 * Admin: … … 108 108 * Added `fulldateintable` parameter. By default, month and list views show only the day number in the table on desktop breakpoints, and use the date format defined by the `format` parameter for mobile breakpoints. When `fulldateintable="true"` is set, the `format` value will be used to display the date in the table on desktop as well. 109 109 * Miscellaneous: 110 111 110 112 * Modified loading logic to run `r34ics_update()` if the version number has *changed*, not just if it has increased. 111 113 * Updated protected properties of the `R34ICS` class.
Note: See TracChangeset
for help on using the changeset viewer.