Esempio n. 1
0
/**
 * Update settings of plugin to reflect new version
 *
 * @since 2.0
 */
function wprss_update()
{
    // Update the database version setting.
    update_option('wprss_db_version', WPRSS_DB_VERSION);
    // Initialize settings
    wprss_settings_initialize();
}
Esempio n. 2
0
/**
 * Update settings of plugin to reflect new version
 *
 * @since 2.0
 */
function wprss_update()
{
    // Update the database version setting.
    update_option('wprss_db_version', WPRSS_DB_VERSION);
    // Initialize settings
    wprss_settings_initialize();
    // At version 4.7.5 tracking was disabled
    $settings = get_option('wprss_settings_general');
    $settings['tracking'] = '0';
    update_option('wprss_settings_general', $settings);
}
Esempio n. 3
0
/**
 * Update settings of plugin to reflect new version
 *
 * @since 2.0
 */
function wprss_update()
{
    // Update the database version setting.
    update_option('wprss_db_version', WPRSS_DB_VERSION);
    // Initialize settings
    wprss_settings_initialize();
    // Open Link Behavior Name Fix
    $settings = get_option('wprss_settings_general');
    if ($settings['open_dd'] === 'New window' || $settings['open_dd'] === __('New window', WPRSS_TEXT_DOMAIN)) {
        $settings['open_dd'] = 'blank';
    } else {
        if ($settings['open_dd'] === 'Lightbox' || $settings['open_dd'] === __('Lightbox', WPRSS_TEXT_DOMAIN)) {
            $settings['open_dd'] = 'lightbox';
        } else {
            if ($settings['open_dd'] === 'Self' || $settings['open_dd'] === __('Self', WPRSS_TEXT_DOMAIN)) {
                $settings['open_dd'] = 'self';
            }
        }
    }
    // At version 4.7.5 tracking was disabled
    $settings['tracking'] = '0';
    update_option('wprss_settings_general', $settings);
}
Esempio n. 4
0
/**
 * Plugin activation procedure
 *
 * @since  1.0
 * @return void
 */
function wprss_activate()
{
    /* Prevents activation of plugin if compatible version of WordPress not found */
    if (!wprss_wp_min_version_satisfied()) {
        deactivate_plugins(basename(__FILE__));
        // Deactivate plugin
        wp_die(sprintf(__('This plugin requires WordPress version %1$s or higher.'), WPRSS_WP_MIN_VERSION), 'WP RSS Aggregator', array('back_link' => true));
    }
    wprss_settings_initialize();
    flush_rewrite_rules();
    wprss_schedule_fetch_all_feeds_cron();
    // Get the previous welcome screen version
    $pwsv = get_option('wprss_pwsv', '0.0');
    // If the aggregator version is higher than the previous version ...
    if (version_compare(WPRSS_VERSION, $pwsv, '>')) {
        // Sets a transient to trigger a redirect upon completion of activation procedure
        set_transient('_wprss_activation_redirect', true, 30);
    }
    include_once ABSPATH . 'wp-admin/includes/plugin.php';
    // Check if WordPress SEO is activate, if yes set its options for hiding the metaboxes on the wprss_feed and wprss_feed_item screens
    if (is_plugin_active('wordpress-seo/wp-seo.php')) {
        $wpseo_titles = get_option('wpseo_titles', array());
        if (isset($wpseo_titles['hideeditbox-wprss_feed'])) {
            $wpseo_titles['hideeditbox-wprss_feed'] = TRUE;
            $wpseo_titles['hideeditbox-wprss_feed_item'] = TRUE;
        }
        update_option('wpseo_titles', $wpseo_titles);
    }
}
Esempio n. 5
0
/**
 * Plugin activation procedure
 *
 * @since  1.0
 * @return void
 */
function wprss_activate()
{
    /* Prevents activation of plugin if compatible version of WordPress not found */
    if (version_compare(get_bloginfo('version'), '3.3', '<')) {
        deactivate_plugins(basename(__FILE__));
        // Deactivate plugin
        wp_die(__('This plugin requires WordPress version 3.3 or higher.'), 'WP RSS Aggregator', array('back_link' => true));
    }
    wprss_settings_initialize();
    flush_rewrite_rules();
    wprss_schedule_fetch_all_feeds_cron();
    // Get the previous welcome screen version
    $pwsv = get_option('wprss_pwsv', '0.0');
    // If the aggregator version is higher than the previous version ...
    if (version_compare(WPRSS_VERSION, $pwsv, '>')) {
        // Sets a transient to trigger a redirect upon completion of activation procedure
        set_transient('_wprss_activation_redirect', true, 30);
    }
}