Changeset 1445844
- Timestamp:
- 06/29/2016 03:53:45 PM (10 years ago)
- Location:
- seo-enforcer/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
seo-enforcer/trunk/admin.js
r1156496 r1445844 52 52 else if(title_check !== true) { 53 53 $('#title_length_set_notice').html(seoe_ajax.title_length); 54 $('#title_length_char_notice').html(title_check); 54 $('#title_length_char_notice').html(title_check); 55 55 $('#seoe_title_length').show(); 56 56 } … … 61 61 } 62 62 else if($('#wpseo_desc').length) { 63 var seoe_desc_field = 'wpseo_desc'; 63 var seoe_desc_field = 'wpseo_desc'; 64 64 } 65 65 else { … … 74 74 else if(desc_check !== true) { 75 75 $('#desc_length_set_notice').html(seoe_ajax.desc_length); 76 $('#desc_length_char_notice').html(desc_check); 76 $('#desc_length_char_notice').html(desc_check); 77 77 $('#seoe_desc_length').show(); 78 78 } -
seo-enforcer/trunk/readme.txt
r1309158 r1445844 1 === SEO Enforcer for Yoast SEO===1 === SEO Enforcer === 2 2 Contributors: mainehost, godthor 3 3 Tags: SEO, WordPress SEO 4 4 Requires at least: 3.9 5 Tested up to: 4. 46 Stable tag: 1.3. 45 Tested up to: 4.5.3 6 Stable tag: 1.3.5 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.3.5 = 41 42 * **Updates** 43 44 * Compatability check with the latest version of Yoast SEO and WordPress. 45 40 46 = 1.3.4 = 41 47 … … 83 89 84 90 * **New Features** 85 91 86 92 * Image alt and title attribute checks. More info on the settings page. 87 93 … … 105 111 106 112 * **Bug Fixes** 107 113 108 114 * Fixed an issue where lengths would be shorter than defined if using the ... truncation method. 109 115 * You can now turn off the SEO notices in settings. It was getting stuck on and wouldn't allow you to disable it. … … 169 175 * **Known Issues** 170 176 171 * Upgrading WordPress SEO will deactivate SEO Enforcer so you have to activate it after the upgrade. I'm hoping to fix this very soon. 177 * Upgrading WordPress SEO will deactivate SEO Enforcer so you have to activate it after the upgrade. I'm hoping to fix this very soon. 172 178 173 179 = 1.0.2 = … … 193 199 == Upgrade Notice == 194 200 201 = 1.3.5 = 202 203 Compatibility testing. 204 195 205 = 1.3.4 = 196 206 -
seo-enforcer/trunk/seoe.php
r1245332 r1445844 3 3 /* 4 4 Plugin Name: SEO Enforcer 5 Plugin URI: https://mainehost.com/wordpress-plugins/ 6 Description: Enforces SEO restrictions. Requires WordPress SEO by Yoast.5 Plugin URI: https://mainehost.com/wordpress-plugins/ 6 Description: Enforces SEO restrictions. Requires Yoast SEO. 7 7 Author: Maine Hosting Solutions 8 8 Author URI: http://mainehost.com/ 9 Version: 1.3. 49 Version: 1.3.5 10 10 */ 11 11 … … 41 41 define('SEOE_NAME','SEO Enforcer'); 42 42 define('SEOE_MENU_NAME','SEO Enforcer'); 43 define('SEOE_WP_SEO_NAME',' WordPress SEO by Yoast');43 define('SEOE_WP_SEO_NAME','Yoast SEO'); 44 44 define('SEOE_WPSEO_PATH','wordpress-seo/wp-seo.php'); 45 45 define('SEOE_WPSEOP_PATH','wordpress-seo-premium/wp-seo-premium.php'); … … 63 63 64 64 return array_merge($mylinks, $links); 65 } 65 } 66 66 function upgrade_check() { 67 67 $version = get_option('seoe_settings_version'); … … 87 87 88 88 delete_option('seoe_post_notices'); 89 delete_option('seoe_title'); 90 delete_option('seoe_title_length'); 91 delete_option('seoe_title_trunc_type'); 92 delete_option('seoe_title_trunc_ex'); 93 delete_option('seoe_desc_trunc_type'); 94 delete_option('seoe_desc_trunc_ex'); 95 delete_option('seoe_h1'); 89 delete_option('seoe_title'); 90 delete_option('seoe_title_length'); 91 delete_option('seoe_title_trunc_type'); 92 delete_option('seoe_title_trunc_ex'); 93 delete_option('seoe_desc_trunc_type'); 94 delete_option('seoe_desc_trunc_ex'); 95 delete_option('seoe_h1'); 96 96 delete_option('seoe_h1_ex'); 97 97 } … … 99 99 update_option('seoe_settings_version', SEOE_SETTINGS_VER); 100 100 } 101 } 101 } 102 102 /** 103 103 * Creates the menu in WP admin for the plugin. … … 127 127 $title_length = $settings['seoe_title_length']; 128 128 $title_exceptions = $settings['seoe_title_trunc_ex']; 129 129 130 130 if($title_exceptions) { 131 131 $ex = array_map('trim', explode(',', $title_exceptions)); … … 147 147 148 148 if($screen->base == 'post' && in_array($post_id, $ex)) $desc_length = 9999; 149 } 149 } 150 150 } 151 151 else { … … 164 164 function post_notice() { 165 165 echo '<div class="update-nag" style="display: none;" id="seoe_title_error">The SEO Title field should be manually filled in.</div>'; 166 echo '<div class="update-nag" style="display: none;" id="seoe_desc_error">The Meta Description field should be manually filled in.</div>'; 166 echo '<div class="update-nag" style="display: none;" id="seoe_desc_error">The Meta Description field should be manually filled in.</div>'; 167 167 echo '<div class="error" style="display: none;" id="seoe_title_length"><p>The SEO Title field is longer than the recommended length of <span id="title_length_set_notice"></span> by <span id="title_length_char_notice"></span> characters</p></div>'; 168 echo '<div class="error" style="display: none;" id="seoe_desc_length"><p>The Meta Description is longer than the recommended length of <span id="desc_length_set_notice"></span> by <span id="desc_length_char_notice"></span> characters</p></div>'; 168 echo '<div class="error" style="display: none;" id="seoe_desc_length"><p>The Meta Description is longer than the recommended length of <span id="desc_length_set_notice"></span> by <span id="desc_length_char_notice"></span> characters</p></div>'; 169 169 } 170 170 /** … … 173 173 function admin() { 174 174 require 'seoe_admin.php'; 175 } 175 } 176 176 /** 177 177 * Run when this plugin is activated. … … 179 179 function activate() { 180 180 $this->check_dependencies(); 181 } 181 } 182 182 /** 183 183 * Used to check if dependencies are active when a plugin is deactivated. 184 184 */ 185 function notice_check() { 185 function notice_check() { 186 186 $this->dependencies(); 187 187 … … 197 197 if($settings['seoe_h1'] || $settings['seoe_img']) add_filter('the_content', array($this,'content_check'), 9999); 198 198 } 199 } 199 } 200 200 /** 201 201 * Gives an error if trying to activate the plugin without dependencies. … … 224 224 * @param type $stage Whether it's currently activating or deactivating a plugin. 225 225 */ 226 function dependencies() { 226 function dependencies() { 227 227 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')))))) { 228 $this->dep_error .= sprintf(SEOE_DEP_ERROR, SEOE_WP_SEO_NAME, SEOE_WP_SEO_NAME); 228 $this->dep_error .= sprintf(SEOE_DEP_ERROR, SEOE_WP_SEO_NAME, SEOE_WP_SEO_NAME); 229 229 } 230 230 } … … 265 265 266 266 if($new_meta) return $new_meta; 267 else return $meta; 267 else return $meta; 268 268 } 269 269 function title_check($title) { … … 279 279 280 280 if(!$length) $length = SEOE_TITLE_LENGTH; 281 281 282 282 if($ex) { 283 $ex = array_map('trim', explode(',', $ex)); 283 $ex = array_map('trim', explode(',', $ex)); 284 284 285 285 if(is_home()) { … … 308 308 */ 309 309 function desc_check($desc) { 310 global $post; 310 global $post; 311 311 $settings = get_option('seoe_settings'); 312 312 … … 321 321 322 322 if($ex) { 323 $ex = array_map('trim', explode(',', $ex)); 323 $ex = array_map('trim', explode(',', $ex)); 324 324 325 325 if(is_home()) { … … 373 373 } 374 374 if($proceed) { 375 $content = $this->content_clean($content); 375 $content = $this->content_clean($content); 376 376 } 377 377 } … … 421 421 * @param mixed $content The content passed it from the filter function. 422 422 * @return mixed 423 */ 423 */ 424 424 function content_clean($content) { 425 425 $content = str_replace('<h1','<h2', $content);
Note: See TracChangeset
for help on using the changeset viewer.