Changeset 1124737
- Timestamp:
- 03/31/2015 06:51:51 PM (11 years ago)
- Location:
- seo-enforcer/trunk
- Files:
-
- 1 deleted
- 2 edited
-
constants.php (deleted)
-
readme.txt (modified) (2 diffs)
-
seoe.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
seo-enforcer/trunk/readme.txt
r1121677 r1124737 4 4 Requires at least: 3.9 5 5 Tested up to: 4.1.1 6 Stable tag: 1.1. 06 Stable tag: 1.1.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 38 38 == Changelog == 39 39 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 40 48 = 1.1.0 = 49 41 50 * **New** 42 43 51 * Truncation exceptions for titles and descriptions. 44 52 * Any exception list now accepts *blog* if you want your blog index to be an exception to a rule. 45 53 46 54 * **Known Issues** 47 48 55 * Upgrading WordPress SEO will deactivate SEO Enforcer so you have to activate it after the upgrade. I'm hoping to fix this very soon. 49 56 50 57 = 1.0.2 = 58 51 59 * Verified compatability with WordPress 4.1.1 52 60 53 61 = 1.0.1 = 62 54 63 * **Bug Fixes** 55 56 64 * 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. 57 65 58 66 = 1.0.0 = 67 59 68 * Initial release of the plugin. -
seo-enforcer/trunk/seoe.php
r1121677 r1124737 7 7 Author: Maine Hosting Solutions 8 8 Author URI: http://mainehost.com/ 9 Version: 1.1. 09 Version: 1.1.1 10 10 */ 11 11 … … 24 24 */ 25 25 function __construct() { 26 require 'constants.php';26 // require 'constants.php'; 27 27 28 28 register_activation_hook( __FILE__, array($this,'activate')); 29 29 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')); 36 32 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>'); 37 43 } 38 44 /** … … 49 55 function admin() { 50 56 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 } 51 82 } 52 83 /** … … 76 107 * @param type $stage Whether it's currently activating or deactivating a plugin. 77 108 */ 78 function dependencies($stage) { 109 // function dependencies($stage) { 110 function dependencies() { 79 111 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); 82 115 } 83 116 } … … 86 119 */ 87 120 function check_dependencies() { 88 $this->dependencies('activate'); 121 // $this->dependencies('activate'); 122 $this->dependencies(); 89 123 90 124 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 }109 125 } 110 126 /** … … 145 161 else { 146 162 $new_length = $length - 3; 163 if($new_length < 0) $new_length = 0; 147 164 $new_title = substr($title, 0, $new_length) . '...'; 148 165 } … … 195 212 else { 196 213 $new_length = $length - 3; 214 if($new_length < 0) $new_length = 0; 197 215 $new_desc = substr($desc, 0, $new_length) . '...'; 198 216 }
Note: See TracChangeset
for help on using the changeset viewer.