Plugin Directory

Changeset 1124734


Ignore:
Timestamp:
03/31/2015 06:49:43 PM (11 years ago)
Author:
mainehost
Message:

Updating to 1.0.4

Location:
shopp-seo/trunk
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • shopp-seo/trunk/readme.txt

    r1122409 r1124734  
    44Requires at least: 3.9
    55Tested up to: 4.1
    6 Stable tag: 1.0.3
     6Stable tag: 1.0.4
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4444== Changelog ==
    4545
     46= 1.0.4 =
     47
     48* **Tweak**
     49    * The deactivation of Shopp SEO if WordPress SEO is deactivated has been removed and instead replaced with an admin notice. The problem was that when WordPress SEO was being upgraded it would in turn deactivate Shopp SEO. If you did not realize this then you may have had Shopp SEO deactivated for a while, maybe even now.
     50   
    4651= 1.0.3 =
    4752
  • shopp-seo/trunk/sseo.php

    r1122409 r1124734  
    77    Author: Maine Hosting Solutions
    88    Author URI: http://mainehost.com/
    9     Version: 1.0.3 
     9    Version: 1.0.4 
    1010*/
    1111
     
    6969         */
    7070        function __construct() {
    71             require 'constants.php';
     71            // require 'constants.php';
    7272
    7373            register_activation_hook( __FILE__, array($this,'activate'));
    7474
    75             add_action('plugins_loaded', array($this,'maybe_deactivate'));
    76             add_action('admin_init', array($this,'metabox'));
    77             add_action('shopp_product_saved', array($this,'save_fields'));
     75            // add_action('plugins_loaded', array($this,'maybe_deactivate'));
     76            add_action('plugins_loaded', array($this,'notice_check'));
     77            add_action('admin_menu', array($this,'menu'));
    7878            add_action('admin_enqueue_scripts', array($this,'admin_scripts'));
    79             add_action('admin_menu', array($this,'menu'));
    80 
    81             add_action('wpseo_head', array($this,'the_robots'), 40);
    82 
    83             add_filter('wpseo_title', array($this,'the_title'), 30);
    84             add_filter('wpseo_metadesc', array($this,'the_description'), 30);           
    85             add_filter('shopp_meta_description', array($this,'remove_shopp_desc'));
    86         }
     79
     80            DEFINE('SSEO_NAME','Shopp SEO');
     81            DEFINE('SSEO_MENU_NAME','Shopp SEO');
     82
     83            DEFINE('SSEO_SHOPP_NAME','Shopp');
     84            DEFINE('SSEO_WP_SEO_NAME','WordPress SEO by Yoast');
     85
     86            DEFINE('SSEO_SHOPP_PATH','shopp/Shopp.php');
     87            DEFINE('SSEO_WPSEO_PATH','wordpress-seo/wp-seo.php');
     88            DEFINE('SSEO_WPSEOP_PATH','wordpress-seo-premium/wp-seo-premium.php');
     89
     90            // DEFINE('SSEO_DEP_ERROR','<p>%s must be installed and active.</p>');
     91            // DEFINE('SSEO_DEP_DEACT_ERROR','<div class="error"><p>' . SSEO_NAME . ' has been deactivated because %s was deactivated.</p></div>');
     92            DEFINE('SSEO_DEP_ERROR','<div class="error"><p>%s is not installed or active. ' . SSEO_NAME . ' will not function until %s is installed and activated.</p></div>');         
     93        }
     94        /**
     95         * Run when this plugin is activated.
     96         */
     97        function activate() {
     98            $this->check_dependencies();
     99        }       
     100        /**
     101         * Used to check if dependencies are active when a plugin is deactivated.
     102         */
     103        function notice_check() {
     104            // $this->dependencies('deactivate');
     105            $this->dependencies();
     106
     107            if($this->dep_error) {
     108                // require_once(ABSPATH . 'wp-admin/includes/plugin.php');
     109                // deactivate_plugins(plugin_basename( __FILE__ ));
     110                add_action('admin_notices', array($this,'deactivate_notice'));
     111            }
     112            else {
     113                add_action('admin_init', array($this,'metabox'));
     114                add_action('shopp_product_saved', array($this,'save_fields'));
     115                add_action('wpseo_head', array($this,'the_robots'), 40);
     116
     117                add_filter('wpseo_title', array($this,'the_title'), 30);
     118                add_filter('wpseo_metadesc', array($this,'the_description'), 30);           
     119                add_filter('shopp_meta_description', array($this,'remove_shopp_desc'));             
     120            }
     121        }       
    87122        /**
    88123         * Gives an error if trying to activate the plugin without dependencies.
     
    111146         * @param type $stage Whether it's currently activating or deactivating a plugin.
    112147         */
    113         function dependencies($stage) {
     148        // function dependencies($stage) {
     149        function dependencies() {       
    114150            if(!in_array(SSEO_SHOPP_PATH, apply_filters('active_plugins', get_option('active_plugins')))) {
    115                 if($stage == 'activate') $this->dep_error .= sprintf(SSEO_DEP_ERROR, SSEO_SHOPP_NAME);
    116                 else $this->dep_error .= sprintf(SSEO_DEP_DEACT_ERROR, SSEO_SHOPP_NAME);
     151                // if($stage == 'activate') $this->dep_error .= sprintf(SSEO_DEP_ERROR, SSEO_SHOPP_NAME);
     152                // else $this->dep_error .= sprintf(SSEO_DEP_DEACT_ERROR, SSEO_SHOPP_NAME);
     153                $this->dep_error .= sprintf(SSEO_DEP_ERROR, SSEO_SHOPP_NAME, SSEO_SHOPP_NAME);
    117154            }
    118155            if((!in_array(SSEO_WPSEO_PATH, apply_filters('active_plugins', get_option('active_plugins')))) && ((!in_array(SSEO_WPSEOP_PATH, apply_filters('active_plugins', get_option('active_plugins')))))) {
    119                 if($stage == 'activate') $this->dep_error .= sprintf(SSEO_DEP_ERROR, SSEO_WP_SEO_NAME);
    120                 else $this->dep_error .= sprintf(SSEO_DEP_DEACT_ERROR, SSEO_WP_SEO_NAME);
     156                // if($stage == 'activate') $this->dep_error .= sprintf(SSEO_DEP_ERROR, SSEO_WP_SEO_NAME);
     157                // else $this->dep_error .= sprintf(SSEO_DEP_DEACT_ERROR, SSEO_WP_SEO_NAME);
     158                $this->dep_error .= sprintf(SSEO_DEP_ERROR, SSEO_WP_SEO_NAME, SSEO_WP_SEO_NAME);
    121159            }
    122160        }
     
    125163         */
    126164        function check_dependencies() {
    127             $this->dependencies('activate');
     165            // $this->dependencies('activate');
     166            $this->dependencies();
    128167
    129168            if($this->dep_error) $this->br_trigger_error($this->dep_error, E_USER_ERROR);
    130         }
    131         /**
    132          * Run when this plugin is activated.
    133          */
    134         function activate() {
    135             $this->check_dependencies();
    136         }
    137         /**
    138          * Used to check if dependencies are active when a plugin is deactivated.
    139          */
    140         function maybe_deactivate() {
    141             $this->dependencies('deactivate');
    142 
    143             if($this->dep_error) {
    144                 require_once(ABSPATH . 'wp-admin/includes/plugin.php');
    145                 deactivate_plugins(plugin_basename( __FILE__ ));
    146                 add_action('admin_notices', array($this,'deactivate_notice'));
    147             }
    148169        }
    149170        /**
Note: See TracChangeset for help on using the changeset viewer.