Plugin Directory

Changeset 1867790


Ignore:
Timestamp:
05/02/2018 09:46:42 PM (8 years ago)
Author:
FlyerUA
Message:

More testing

Location:
simple-rating/tags
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • simple-rating/tags/1.4.1.5/rating.php

    r1865592 r1867790  
    1313add_action('upgrader_process_complete', 'simple_rating_post_upgrade_compatibility_check', 10, 2);
    1414add_action('admin_notices', 'simple_rating_incompatibility_notice');
     15add_action('simple_rating_upgrade', 'simple_rating_upgrade_processor');
    1516
    1617function simple_rating_pre_activation()
     
    3839function simple_rating_post_upgrade_compatibility_check($upgrader, $options)
    3940{
    40     global $wp_version;
    4141    $plugin_basename = plugin_basename(__FILE__);
    42     $log = fopen('test', 'w');
    4342    if ($options['action'] == 'update' && $options['type'] == 'plugin' && count($options['plugins']) > 0)
    4443    {
    45         fwrite($log, 'Plugin is being updated to 1.4.1.5' . PHP_EOL);
    4644        foreach ($options['plugins'] as $plugin)
    4745        {
    4846            if ($plugin == $plugin_basename)
    4947            {
    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');
    5649            }
    5750        }
    5851    }
    59     fclose($log);
    6052}
    6153
     
    7668}
    7769
     70function 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
    7880?>
  • simple-rating/tags/1.4.1/rating.php

    r1865568 r1867790  
    1313add_action('upgrader_process_complete', 'simple_rating_post_upgrade_compatibility_check', 10, 2);
    1414add_action('admin_notices', 'simple_rating_incompatibility_notice');
     15add_action('simple_rating_upgrade', 'simple_rating_upgrade_processor');
    1516
    1617function simple_rating_pre_activation()
     
    3839function simple_rating_post_upgrade_compatibility_check($upgrader, $options)
    3940{
    40     global $wp_version;
    4141    $plugin_basename = plugin_basename(__FILE__);
    42     $log = fopen('test', 'w');
    4342    if ($options['action'] == 'update' && $options['type'] == 'plugin' && count($options['plugins']) > 0)
    4443    {
    45         fwrite($log, 'Plugin is being updated' . PHP_EOL);
    4644        foreach ($options['plugins'] as $plugin)
    4745        {
    4846            if ($plugin == $plugin_basename)
    4947            {
    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');
    5649            }
    5750        }
    5851    }
    59     fclose($log);
    6052}
    6153
     
    7668}
    7769
     70function 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
    7880?>
Note: See TracChangeset for help on using the changeset viewer.