Changeset 1167880
- Timestamp:
- 05/26/2015 06:11:18 PM (11 years ago)
- Location:
- seo-enforcer
- Files:
-
- 3 edited
- 4 copied
-
tags/1.3.1 (copied) (copied from seo-enforcer/trunk)
-
tags/1.3.1/readme.txt (copied) (copied from seo-enforcer/trunk/readme.txt) (2 diffs)
-
tags/1.3.1/seoe.php (copied) (copied from seo-enforcer/trunk/seoe.php) (6 diffs)
-
tags/1.3.1/seoe_admin.php (copied) (copied from seo-enforcer/trunk/seoe_admin.php) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/seoe.php (modified) (6 diffs)
-
trunk/seoe_admin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
seo-enforcer/tags/1.3.1/readme.txt
r1167792 r1167880 4 4 Requires at least: 3.9 5 5 Tested up to: 4.2.2 6 Stable tag: 1.3. 06 Stable tag: 1.3.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 37 37 38 38 == Changelog == 39 40 = 1.3.1 = 41 42 Released: May 26th, 2015 43 44 * **Bug Fixes** 45 46 * Fixed a potential bug with new installs of SEO Enforcer throwing an unserialization error. 39 47 40 48 = 1.3.0 = -
seo-enforcer/tags/1.3.1/seoe.php
r1167792 r1167880 7 7 Author: Maine Hosting Solutions 8 8 Author URI: http://mainehost.com/ 9 Version: 1.3. 09 Version: 1.3.1 10 10 */ 11 11 … … 113 113 */ 114 114 function check_screen() { 115 $settings = unserialize(get_option('seoe_settings')); 115 $settings = get_option('seoe_settings'); 116 117 if($settings) $settings = unserialize($settings); 118 116 119 $notice_types = array('post','edit-tags','toplevel_page_shopp-products','catalog_page_shopp-categories'); 117 120 $screen = get_current_screen(); … … 187 190 } 188 191 else { 189 $settings = unserialize(get_option('seoe_settings')); 190 192 $settings = get_option('seoe_settings'); 193 194 if($settings) $settings = unserialize($settings); 191 195 if($settings['seoe_title']) add_filter('wpseo_title', array($this,'title_check'), 99); 192 196 if($settings['seoe_desc']) add_filter('wpseo_metadesc', array($this,'desc_check'), 99); … … 265 269 function title_check($title) { 266 270 global $post; 267 $settings = unserialize(get_option('seoe_settings')); 271 $settings = get_option('seoe_settings'); 272 273 if($settings) $settings = unserialize($settings); 268 274 269 275 if($settings['seoe_title']) { … … 303 309 function desc_check($desc) { 304 310 global $post; 305 $settings = unserialize(get_option('seoe_settings')); 311 $settings = get_option('seoe_settings'); 312 313 if($settings) $settings = unserialize($settings); 306 314 307 315 if($settings['seoe_desc']) { … … 343 351 global $post; 344 352 345 $settings = unserialize(get_option('seoe_settings')); 346 347 if($ex = $settings['seoe_h1_ex']) { 348 $ex = array_map('trim', explode(',', $ex)); 349 350 if(is_home()) { 351 if(!in_array('blog', $ex)) $proceed = 1; 352 else $procedd = 0; 353 } 354 else { 355 if(!in_array($post->ID, $ex)) $proceed = 1; 356 else $proceed = 0; 357 } 358 } 359 else { 360 $proceed = 1; 361 } 362 if($proceed) { 363 $content = $this->content_clean($content); 364 } 365 if($settings['seoe_img']) { 366 $doc = new DOMDocument('1.0','UTF-8'); 367 @$doc->loadHTML(utf8_decode($content)); 368 369 foreach($doc->getElementsByTagName('img') as $img) { 370 if($img->getAttribute('alt') && !$img->getAttribute('title')) { 371 $title = $doc->createAttribute('title'); 372 $title->value = htmlentities($img->getAttribute('alt')); 373 $img->appendChild($title); 374 } 375 elseif(!$img->getAttribute('alt') && $img->getAttribute('title')) { 376 $alt = $doc->createAttribute('alt'); 377 $alt->value = htmlentities($img->getAttribute('title')); 378 $img->appendChild($alt); 379 } 380 else { # No alt or title 381 $src = $img->getAttribute('src'); 382 $info = pathinfo($src); 383 $img_name = $info['filename']; 384 $use_value = preg_replace('/[^A-Za-z0-9 ]/',' ', $img_name); 385 $use_value = htmlentities($use_value); 386 387 $alt = $doc->createAttribute('alt'); 388 $alt->value = $use_value; 389 $img->appendChild($alt); 390 391 $title = $doc->createAttribute('title'); 392 $title->value = $use_value; 393 $img->appendChild($title); 394 } 395 } 396 397 $html = preg_replace('/^<!DOCTYPE.+?>/','', $doc->saveHTML()); 398 $html = str_replace(array('<html>','</html>','<body>','</body>'), array('','','',''), $html); 399 return $html; 353 $settings = get_option('seoe_settings'); 354 355 if($settings) { 356 $settings = unserialize($settings); 357 358 if($ex = $settings['seoe_h1_ex']) { 359 $ex = array_map('trim', explode(',', $ex)); 360 361 if(is_home()) { 362 if(!in_array('blog', $ex)) $proceed = 1; 363 else $procedd = 0; 364 } 365 else { 366 if(!in_array($post->ID, $ex)) $proceed = 1; 367 else $proceed = 0; 368 } 369 } 370 else { 371 $proceed = 1; 372 } 373 if($proceed) { 374 $content = $this->content_clean($content); 375 } 376 if($settings['seoe_img']) { 377 $doc = new DOMDocument('1.0','UTF-8'); 378 @$doc->loadHTML(utf8_decode($content)); 379 380 foreach($doc->getElementsByTagName('img') as $img) { 381 if($img->getAttribute('alt') && !$img->getAttribute('title')) { 382 $title = $doc->createAttribute('title'); 383 $title->value = htmlentities($img->getAttribute('alt')); 384 $img->appendChild($title); 385 } 386 elseif(!$img->getAttribute('alt') && $img->getAttribute('title')) { 387 $alt = $doc->createAttribute('alt'); 388 $alt->value = htmlentities($img->getAttribute('title')); 389 $img->appendChild($alt); 390 } 391 else { # No alt or title 392 $src = $img->getAttribute('src'); 393 $info = pathinfo($src); 394 $img_name = $info['filename']; 395 $use_value = preg_replace('/[^A-Za-z0-9 ]/',' ', $img_name); 396 $use_value = htmlentities($use_value); 397 398 $alt = $doc->createAttribute('alt'); 399 $alt->value = $use_value; 400 $img->appendChild($alt); 401 402 $title = $doc->createAttribute('title'); 403 $title->value = $use_value; 404 $img->appendChild($title); 405 } 406 } 407 408 $html = preg_replace('/^<!DOCTYPE.+?>/','', $doc->saveHTML()); 409 $html = str_replace(array('<html>','</html>','<body>','</body>'), array('','','',''), $html); 410 return $html; 411 } 400 412 } 401 413 else { -
seo-enforcer/tags/1.3.1/seoe_admin.php
r1167792 r1167880 8 8 function options() { 9 9 $image_path = plugins_url('images/', __FILE__); 10 $settings = unserialize(get_option('seoe_settings')); 10 $settings = get_option('seoe_settings'); 11 12 if($settings) $settings = unserialize($settings); 11 13 extract($settings); 12 14 -
seo-enforcer/trunk/readme.txt
r1167792 r1167880 4 4 Requires at least: 3.9 5 5 Tested up to: 4.2.2 6 Stable tag: 1.3. 06 Stable tag: 1.3.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 37 37 38 38 == Changelog == 39 40 = 1.3.1 = 41 42 Released: May 26th, 2015 43 44 * **Bug Fixes** 45 46 * Fixed a potential bug with new installs of SEO Enforcer throwing an unserialization error. 39 47 40 48 = 1.3.0 = -
seo-enforcer/trunk/seoe.php
r1167792 r1167880 7 7 Author: Maine Hosting Solutions 8 8 Author URI: http://mainehost.com/ 9 Version: 1.3. 09 Version: 1.3.1 10 10 */ 11 11 … … 113 113 */ 114 114 function check_screen() { 115 $settings = unserialize(get_option('seoe_settings')); 115 $settings = get_option('seoe_settings'); 116 117 if($settings) $settings = unserialize($settings); 118 116 119 $notice_types = array('post','edit-tags','toplevel_page_shopp-products','catalog_page_shopp-categories'); 117 120 $screen = get_current_screen(); … … 187 190 } 188 191 else { 189 $settings = unserialize(get_option('seoe_settings')); 190 192 $settings = get_option('seoe_settings'); 193 194 if($settings) $settings = unserialize($settings); 191 195 if($settings['seoe_title']) add_filter('wpseo_title', array($this,'title_check'), 99); 192 196 if($settings['seoe_desc']) add_filter('wpseo_metadesc', array($this,'desc_check'), 99); … … 265 269 function title_check($title) { 266 270 global $post; 267 $settings = unserialize(get_option('seoe_settings')); 271 $settings = get_option('seoe_settings'); 272 273 if($settings) $settings = unserialize($settings); 268 274 269 275 if($settings['seoe_title']) { … … 303 309 function desc_check($desc) { 304 310 global $post; 305 $settings = unserialize(get_option('seoe_settings')); 311 $settings = get_option('seoe_settings'); 312 313 if($settings) $settings = unserialize($settings); 306 314 307 315 if($settings['seoe_desc']) { … … 343 351 global $post; 344 352 345 $settings = unserialize(get_option('seoe_settings')); 346 347 if($ex = $settings['seoe_h1_ex']) { 348 $ex = array_map('trim', explode(',', $ex)); 349 350 if(is_home()) { 351 if(!in_array('blog', $ex)) $proceed = 1; 352 else $procedd = 0; 353 } 354 else { 355 if(!in_array($post->ID, $ex)) $proceed = 1; 356 else $proceed = 0; 357 } 358 } 359 else { 360 $proceed = 1; 361 } 362 if($proceed) { 363 $content = $this->content_clean($content); 364 } 365 if($settings['seoe_img']) { 366 $doc = new DOMDocument('1.0','UTF-8'); 367 @$doc->loadHTML(utf8_decode($content)); 368 369 foreach($doc->getElementsByTagName('img') as $img) { 370 if($img->getAttribute('alt') && !$img->getAttribute('title')) { 371 $title = $doc->createAttribute('title'); 372 $title->value = htmlentities($img->getAttribute('alt')); 373 $img->appendChild($title); 374 } 375 elseif(!$img->getAttribute('alt') && $img->getAttribute('title')) { 376 $alt = $doc->createAttribute('alt'); 377 $alt->value = htmlentities($img->getAttribute('title')); 378 $img->appendChild($alt); 379 } 380 else { # No alt or title 381 $src = $img->getAttribute('src'); 382 $info = pathinfo($src); 383 $img_name = $info['filename']; 384 $use_value = preg_replace('/[^A-Za-z0-9 ]/',' ', $img_name); 385 $use_value = htmlentities($use_value); 386 387 $alt = $doc->createAttribute('alt'); 388 $alt->value = $use_value; 389 $img->appendChild($alt); 390 391 $title = $doc->createAttribute('title'); 392 $title->value = $use_value; 393 $img->appendChild($title); 394 } 395 } 396 397 $html = preg_replace('/^<!DOCTYPE.+?>/','', $doc->saveHTML()); 398 $html = str_replace(array('<html>','</html>','<body>','</body>'), array('','','',''), $html); 399 return $html; 353 $settings = get_option('seoe_settings'); 354 355 if($settings) { 356 $settings = unserialize($settings); 357 358 if($ex = $settings['seoe_h1_ex']) { 359 $ex = array_map('trim', explode(',', $ex)); 360 361 if(is_home()) { 362 if(!in_array('blog', $ex)) $proceed = 1; 363 else $procedd = 0; 364 } 365 else { 366 if(!in_array($post->ID, $ex)) $proceed = 1; 367 else $proceed = 0; 368 } 369 } 370 else { 371 $proceed = 1; 372 } 373 if($proceed) { 374 $content = $this->content_clean($content); 375 } 376 if($settings['seoe_img']) { 377 $doc = new DOMDocument('1.0','UTF-8'); 378 @$doc->loadHTML(utf8_decode($content)); 379 380 foreach($doc->getElementsByTagName('img') as $img) { 381 if($img->getAttribute('alt') && !$img->getAttribute('title')) { 382 $title = $doc->createAttribute('title'); 383 $title->value = htmlentities($img->getAttribute('alt')); 384 $img->appendChild($title); 385 } 386 elseif(!$img->getAttribute('alt') && $img->getAttribute('title')) { 387 $alt = $doc->createAttribute('alt'); 388 $alt->value = htmlentities($img->getAttribute('title')); 389 $img->appendChild($alt); 390 } 391 else { # No alt or title 392 $src = $img->getAttribute('src'); 393 $info = pathinfo($src); 394 $img_name = $info['filename']; 395 $use_value = preg_replace('/[^A-Za-z0-9 ]/',' ', $img_name); 396 $use_value = htmlentities($use_value); 397 398 $alt = $doc->createAttribute('alt'); 399 $alt->value = $use_value; 400 $img->appendChild($alt); 401 402 $title = $doc->createAttribute('title'); 403 $title->value = $use_value; 404 $img->appendChild($title); 405 } 406 } 407 408 $html = preg_replace('/^<!DOCTYPE.+?>/','', $doc->saveHTML()); 409 $html = str_replace(array('<html>','</html>','<body>','</body>'), array('','','',''), $html); 410 return $html; 411 } 400 412 } 401 413 else { -
seo-enforcer/trunk/seoe_admin.php
r1167792 r1167880 8 8 function options() { 9 9 $image_path = plugins_url('images/', __FILE__); 10 $settings = unserialize(get_option('seoe_settings')); 10 $settings = get_option('seoe_settings'); 11 12 if($settings) $settings = unserialize($settings); 11 13 extract($settings); 12 14
Note: See TracChangeset
for help on using the changeset viewer.