Changeset 1867790
- Timestamp:
- 05/02/2018 09:46:42 PM (8 years ago)
- Location:
- simple-rating/tags
- Files:
-
- 2 edited
-
1.4.1.5/rating.php (modified) (3 diffs)
-
1.4.1/rating.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-rating/tags/1.4.1.5/rating.php
r1865592 r1867790 13 13 add_action('upgrader_process_complete', 'simple_rating_post_upgrade_compatibility_check', 10, 2); 14 14 add_action('admin_notices', 'simple_rating_incompatibility_notice'); 15 add_action('simple_rating_upgrade', 'simple_rating_upgrade_processor'); 15 16 16 17 function simple_rating_pre_activation() … … 38 39 function simple_rating_post_upgrade_compatibility_check($upgrader, $options) 39 40 { 40 global $wp_version;41 41 $plugin_basename = plugin_basename(__FILE__); 42 $log = fopen('test', 'w');43 42 if ($options['action'] == 'update' && $options['type'] == 'plugin' && count($options['plugins']) > 0) 44 43 { 45 fwrite($log, 'Plugin is being updated to 1.4.1.5' . PHP_EOL);46 44 foreach ($options['plugins'] as $plugin) 47 45 { 48 46 if ($plugin == $plugin_basename) 49 47 { 50 fwrite($log, 'It\'s a plugin we need' . PHP_EOL); 51 if (version_compare(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION, '7.8', '<') || version_compare($wp_version, '3.7', '<')) 52 { 53 set_transient('simple_rating_incompatible', 1); 54 fwrite($log, 'It\'s incompatible' . PHP_EOL); 55 } 48 wp_schedule_single_event(time() + 10, 'simple_rating_upgrade'); 56 49 } 57 50 } 58 51 } 59 fclose($log);60 52 } 61 53 … … 76 68 } 77 69 70 function simple_rating_upgrade_processor() 71 { 72 global $wp_version; 73 if (version_compare(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION, '7.8', '<') || version_compare($wp_version, '3.7', '<')) 74 { 75 set_transient('simple_rating_incompatible', 1); 76 } 77 file_put_contents('abbbbb', 'Processed by 1.4.1.5'); 78 } 79 78 80 ?> -
simple-rating/tags/1.4.1/rating.php
r1865568 r1867790 13 13 add_action('upgrader_process_complete', 'simple_rating_post_upgrade_compatibility_check', 10, 2); 14 14 add_action('admin_notices', 'simple_rating_incompatibility_notice'); 15 add_action('simple_rating_upgrade', 'simple_rating_upgrade_processor'); 15 16 16 17 function simple_rating_pre_activation() … … 38 39 function simple_rating_post_upgrade_compatibility_check($upgrader, $options) 39 40 { 40 global $wp_version;41 41 $plugin_basename = plugin_basename(__FILE__); 42 $log = fopen('test', 'w');43 42 if ($options['action'] == 'update' && $options['type'] == 'plugin' && count($options['plugins']) > 0) 44 43 { 45 fwrite($log, 'Plugin is being updated' . PHP_EOL);46 44 foreach ($options['plugins'] as $plugin) 47 45 { 48 46 if ($plugin == $plugin_basename) 49 47 { 50 fwrite($log, 'It\'s a plugin we need' . PHP_EOL); 51 if (version_compare(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION, '7.8', '<') || version_compare($wp_version, '3.7', '<')) 52 { 53 set_transient('simple_rating_incompatible', 1); 54 fwrite($log, 'It\'s incompatible' . PHP_EOL); 55 } 48 wp_schedule_single_event(time() + 10, 'simple_rating_upgrade'); 56 49 } 57 50 } 58 51 } 59 fclose($log);60 52 } 61 53 … … 76 68 } 77 69 70 function simple_rating_upgrade_processor() 71 { 72 global $wp_version; 73 if (version_compare(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION, '7.8', '<') || version_compare($wp_version, '3.7', '<')) 74 { 75 set_transient('simple_rating_incompatible', 1); 76 } 77 file_put_contents('abbbbb', 'Processed by 1.4.1'); 78 } 79 78 80 ?>
Note: See TracChangeset
for help on using the changeset viewer.