Plugin Directory

Changeset 1124737


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

Updating to 1.1.1

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

Legend:

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

    r1121677 r1124737  
    44Requires at least: 3.9
    55Tested up to: 4.1.1
    6 Stable tag: 1.1.0
     6Stable tag: 1.1.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3838== Changelog ==
    3939
     40= 1.1.1 =
     41
     42* **Tweak**
     43    * The deactivation of SEO Enforcer 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 SEO Enforcer. If you did not realize this then you may have had SEO Enforcer deactivated for a while, maybe even now.
     44
     45* **Bug Fix**
     46    * Title and description lengths could be negative in certain situations and in turn create oddities. I now check for negative values to prevent those oddities.
     47
    4048= 1.1.0 =
     49
    4150* **New**
    42 
    4351    * Truncation exceptions for titles and descriptions.
    4452    * Any exception list now accepts *blog* if you want your blog index to be an exception to a rule.
    4553
    4654* **Known Issues**
    47 
    4855    * Upgrading WordPress SEO will deactivate SEO Enforcer so you have to activate it after the upgrade. I'm hoping to fix this very soon.
    4956
    5057= 1.0.2 =
     58
    5159* Verified compatability with WordPress 4.1.1
    5260
    5361= 1.0.1 =
     62
    5463* **Bug Fixes**
    55 
    5664    * Fixed an issue where the plugin would not activate if WordPress SEO Premium was installed instead of the free version. It should now activate for either version of WordPress SEO.
    5765
    5866= 1.0.0 =
     67
    5968* Initial release of the plugin.
  • seo-enforcer/trunk/seoe.php

    r1121677 r1124737  
    77    Author: Maine Hosting Solutions
    88    Author URI: http://mainehost.com/
    9     Version: 1.1.0 
     9    Version: 1.1.1 
    1010*/
    1111
     
    2424         */
    2525        function __construct() {
    26             require 'constants.php';
     26            // require 'constants.php';
    2727
    2828            register_activation_hook( __FILE__, array($this,'activate'));
    2929
    30             add_action('plugins_loaded', array($this,'maybe_deactivate'));
    31 
    32             if(get_option('seoe_title')) add_filter('wpseo_title', array($this,'title_check'), 99);
    33             if(get_option('seoe_desc')) add_filter('wpseo_metadesc', array($this,'desc_check'), 99);
    34             if(get_option('seoe_h1')) add_filter('the_content', array($this,'content_check'), 99);
    35 
     30            // add_action('plugins_loaded', array($this,'maybe_deactivate'));
     31            add_action('plugins_loaded', array($this,'notice_check'));
    3632            add_action('admin_menu', array($this,'menu'));
     33
     34            DEFINE('SEOE_NAME','SEO Enforcer');
     35            DEFINE('SEOE_MENU_NAME','SEO Enforcer');
     36            DEFINE('SEOE_WP_SEO_NAME','WordPress SEO by Yoast');
     37            DEFINE('SEOE_WPSEO_PATH','wordpress-seo/wp-seo.php');
     38            DEFINE('SEOE_WPSEOP_PATH','wordpress-seo-premium/wp-seo-premium.php');
     39
     40            // DEFINE('SEOE_DEP_ERROR','<p>%s must be installed and active.</p>');
     41            DEFINE('SEOE_DEP_ERROR','<div class="error"><p>%s is not installed or active. ' . SEOE_NAME . ' will not function until %s is installed and activated.</p></div>');
     42            // DEFINE('SEOE_DEP_DEACT_ERROR','<div class="error"><p>%s is not installed or active. ' . SEOE_NAME . ' will not function until %s is installed and activated.</p></div>');           
    3743        }
    3844        /**
     
    4955        function admin() {
    5056            require 'seoe_admin.php';
     57        }   
     58        /**
     59         * Run when this plugin is activated.
     60         */
     61        function activate() {
     62            $this->check_dependencies();
     63        }           
     64        /**
     65         * Used to check if dependencies are active when a plugin is deactivated.
     66         */
     67        // function maybe_deactivate() {
     68        function notice_check() {       
     69            // $this->dependencies('deactivate');
     70            $this->dependencies();
     71
     72            if($this->dep_error) {
     73                // require_once(ABSPATH . 'wp-admin/includes/plugin.php');
     74                // deactivate_plugins(plugin_basename( __FILE__ ));
     75                add_action('admin_notices', array($this,'deactivate_notice'));
     76            }
     77            else {
     78                if(get_option('seoe_title')) add_filter('wpseo_title', array($this,'title_check'), 99);
     79                if(get_option('seoe_desc')) add_filter('wpseo_metadesc', array($this,'desc_check'), 99);
     80                if(get_option('seoe_h1')) add_filter('the_content', array($this,'content_check'), 99);
     81            }
    5182        }       
    5283        /**
     
    76107         * @param type $stage Whether it's currently activating or deactivating a plugin.
    77108         */
    78         function dependencies($stage) {
     109        // function dependencies($stage) {
     110        function dependencies() {       
    79111            if((!in_array(SEOE_WPSEO_PATH, apply_filters('active_plugins', get_option('active_plugins')))) && ((!in_array(SEOE_WPSEOP_PATH, apply_filters('active_plugins', get_option('active_plugins')))))) {
    80                 if($stage == 'activate') $this->dep_error .= sprintf(SEOE_DEP_ERROR, SEOE_WP_SEO_NAME);
    81                 else $this->dep_error .= sprintf(SEOE_DEP_DEACT_ERROR, SEOE_WP_SEO_NAME);
     112                // if($stage == 'activate') $this->dep_error .= sprintf(SEOE_DEP_ERROR, SEOE_WP_SEO_NAME);
     113                // else $this->dep_error .= sprintf(SEOE_DEP_DEACT_ERROR, SEOE_WP_SEO_NAME, SEOE_WP_SEO_NAME);
     114                $this->dep_error .= sprintf(SEOE_DEP_ERROR, SEOE_WP_SEO_NAME, SEOE_WP_SEO_NAME);               
    82115            }
    83116        }
     
    86119         */
    87120        function check_dependencies() {
    88             $this->dependencies('activate');
     121            // $this->dependencies('activate');
     122            $this->dependencies();
    89123
    90124            if($this->dep_error) $this->br_trigger_error($this->dep_error, E_USER_ERROR);
    91         }
    92         /**
    93          * Run when this plugin is activated.
    94          */
    95         function activate() {
    96             $this->check_dependencies();
    97         }
    98         /**
    99          * Used to check if dependencies are active when a plugin is deactivated.
    100          */
    101         function maybe_deactivate() {
    102             $this->dependencies('deactivate');
    103 
    104             if($this->dep_error) {
    105                 require_once(ABSPATH . 'wp-admin/includes/plugin.php');
    106                 deactivate_plugins(plugin_basename( __FILE__ ));
    107                 add_action('admin_notices', array($this,'deactivate_notice'));
    108             }
    109125        }
    110126        /**
     
    145161                    else {
    146162                        $new_length = $length - 3;
     163                        if($new_length < 0) $new_length = 0;
    147164                        $new_title = substr($title, 0, $new_length) . '...';
    148165                    }
     
    195212                    else {
    196213                        $new_length = $length - 3;
     214                        if($new_length < 0) $new_length = 0;
    197215                        $new_desc = substr($desc, 0, $new_length) . '...';                     
    198216                    }
Note: See TracChangeset for help on using the changeset viewer.