Plugin Directory

Changeset 1865568


Ignore:
Timestamp:
04/27/2018 08:04:03 PM (8 years ago)
Author:
FlyerUA
Message:

Still testing

File:
1 edited

Legend:

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

    r1865564 r1865568  
    1313add_action('upgrader_process_complete', 'simple_rating_post_upgrade_compatibility_check', 10, 2);
    1414add_action('admin_notices', 'simple_rating_incompatibility_notice');
    15 
    1615
    1716function simple_rating_pre_activation()
     
    4140    global $wp_version;
    4241    $plugin_basename = plugin_basename(__FILE__);
    43     if (is_plugin_active($plugin_basename))
     42    $log = fopen('test', 'w');
     43    if ($options['action'] == 'update' && $options['type'] == 'plugin' && count($options['plugins']) > 0)
    4444    {
    45         if ($options['action'] == 'update' && $options['type'] == 'plugin' && count($options['plugins']) > 0)
     45        fwrite($log, 'Plugin is being updated' . PHP_EOL);
     46        foreach ($options['plugins'] as $plugin)
    4647        {
    47             foreach ($options['plugins'] as $plugin)
     48            if ($plugin == $plugin_basename)
    4849            {
    49                 if ($plugin == $plugin_basename)
     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', '<'))
    5052                {
    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                     }
     53                    set_transient('simple_rating_incompatible', 1);
     54                    fwrite($log, 'It\'s incompatible' . PHP_EOL);
    5555                }
    5656            }
    5757        }
    5858    }
     59    fclose($log);
    5960}
    6061
Note: See TracChangeset for help on using the changeset viewer.