Plugin Directory

Changeset 1156496


Ignore:
Timestamp:
05/08/2015 08:43:01 PM (11 years ago)
Author:
mainehost
Message:

Updating to 1.2.3

Location:
seo-enforcer/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • seo-enforcer/trunk/admin.js

    r1141029 r1156496  
    11jQuery(document).ready(function($) {
    22    function seoe_title_check(field) {
    3         var max = 59;
     3        var max = seoe_ajax.title_length;
    44        var len = $('#'+field).val().length;
    55        var char = max - len;
    66
    7         if(len >= max) {
    8             return false;
     7        if(len > max) {
     8            return len - max;
    99        }
    1010        else {
     
    1818    }
    1919    function seoe_desc_check(field) {
    20         var max = 156;
     20        var max = seoe_ajax.desc_length;
    2121        var len = $('#'+field).val().length;
    2222        var char = max - len;
    2323
    24         if(len >= max) {
    25             return false;
     24        if(len > max) {
     25            return len - max;
    2626        }
    2727        else {
     
    5050            $('#seoe_title_error').show();
    5151        }
    52         if(title_check === false) {
     52        else if(title_check !== true) {
     53            $('#title_length_set_notice').html(seoe_ajax.title_length);
     54            $('#title_length_char_notice').html(title_check);           
    5355            $('#seoe_title_length').show();
    5456        }
     
    7072            $('#seoe_desc_error').show();
    7173        }
    72         if(desc_check === false) {
     74        else if(desc_check !== true) {
     75            $('#desc_length_set_notice').html(seoe_ajax.desc_length);
     76            $('#desc_length_char_notice').html(desc_check);                     
    7377            $('#seoe_desc_length').show();
    7478        }
  • seo-enforcer/trunk/readme.txt

    r1156413 r1156496  
    44Requires at least: 3.9
    55Tested up to: 4.2.2
    6 Stable tag: 1.2.2
     6Stable tag: 1.2.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3838== Changelog ==
    3939
     40= 1.2.3 =
     41
     42Released: May 8th, 2015
     43
     44* **Updates**
     45
     46    * If using SEO notices then the length checks will now properly use the lengths you've defined in settings. It will also respect any exceptions you've given.
     47    * The SEO notices will now show the recommended lengths and how many characters in excess when it's too long.
     48
     49* **Bug Fixes**
     50   
     51    * Fixed an issue where lengths would be shorter than defined if using the ... truncation method.
     52    * You can now turn off the SEO notices in settings. It was getting stuck on and wouldn't allow you to disable it.
     53    * The SEO notice check will not give an error if length is at the recommended length, only when longer than it.
     54
    4055= 1.2.2 =
    4156
    4257Released: May 4th, 2015
    4358
    44 * **Added**
     59* **New Features**
     60
    4561    * Link for rate & review, as well as SEO Enforcer settings, appears on the plugins page.
    4662
    47 * **Bug Fix**
     63* **Bug Fixes**
     64
    4865    * Cleaned up some PHP notices about undefined variables.
    4966
     
    5269Released: April 30th, 2015
    5370
    54 * **Bug Fix**
     71* **Bug Fixes**
    5572
    5673    * The title and description length checks will now properly truncate after whole words instead of in the middle of a word.
     
    6481    * Added an option in settings to display SEO notices on admin screens where WordPress SEO or [Shopp SEO](https://wordpress.org/plugins/shopp-seo/) are used. This will give a reminder to manually enter in the SEO fields and will also give errors when content is saved and exceeds the recommended length.
    6582
    66 * **Updated**
     83* **Updates**
    6784
    6885    * Changed the default title length to 59 characters and description length to 156 to match with WordPress SEO's recommendations.
     
    7693Released: March 31st, 2015
    7794
    78 * **Updated**
     95* **Updates**
    7996
    8097    * 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.
    8198
    82 * **Bug Fix**
     99* **Bug Fixes**
    83100
    84101    * 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.
  • seo-enforcer/trunk/seoe.php

    r1153070 r1156496  
    77    Author: Maine Hosting Solutions
    88    Author URI: http://mainehost.com/
    9     Version: 1.2.2
     9    Version: 1.2.3
    1010*/
    1111
     
    3434            add_action('admin_menu', array($this,'menu'));
    3535            add_action('current_screen', array($this,'check_screen'));
     36            add_action('plugins_loaded', array($this,'upgrade_check'));
    3637
    3738            add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this,'add_action_link'));
    3839
     40            define('SEOE_SETTINGS_VER', 1);
    3941            define('SEOE_NAME','SEO Enforcer');
    4042            define('SEOE_MENU_NAME','SEO Enforcer');
     
    6163
    6264            return array_merge($mylinks, $links);
    63         }       
     65        }   
     66        function upgrade_check() {
     67            $version = get_option('seoe_settings_version');
     68
     69            if(!$version) {
     70                update_option('seoe_settings_version', SEOE_SETTINGS_VER);
     71            }
     72            elseif($version && $version != SEOE_SETTINGS_VER) {
     73                update_option('seoe_settings_version', SEOE_SETTINGS_VER);
     74            }
     75        }   
    6476        /**
    6577         * Creates the menu in WP admin for the plugin.
     
    7991
    8092            if(is_admin() && in_array($screen->base, $notice_types) && get_option('seoe_post_notices')) {
     93                $title_check = get_option('seoe_title');
     94                $desc_check = get_option('seoe_desc');
     95
     96                if($title_check) {
     97                    $title_trunc_type = get_option('seoe_title_trunc_type');
     98                    $title_length = get_option('seoe_title_length');
     99                    $title_exceptions = get_option('seoe_title_trunc_ex');
     100               
     101                    if($title_exceptions) {
     102                        $ex = array_map('trim', explode(',', $title_exceptions));
     103                        $post_id = $_GET['post'];
     104
     105                        if($screen->base == 'post' && in_array($post_id, $ex)) $title_length = 9999;
     106                    }
     107                }
     108                else {
     109                    $title_length = SEOE_TITLE_LENGTH;
     110                }
     111                if($desc_check) {
     112                    $desc_trunc_type = get_option('seoe_desc_trunc_type');
     113                    $desc_length = get_option('seoe_desc_length');
     114                    $desc_exceptions = get_option('seoe_desc_trunc_ex');
     115
     116                    if($desc_exceptions) {
     117                        $ex = array_map('trim', explode(',', $desc_exceptions));
     118                        $post_id = $_GET['post'];
     119
     120                        if($screen->base == 'post' && in_array($post_id, $ex)) $desc_length = 9999;
     121                    }                   
     122                }
     123                else {
     124                    $desc_length = SEOE_DESC_LENGTH;
     125                }
     126
    81127                wp_enqueue_script('mhs_seoe_admin', plugin_dir_url( __FILE__ ) . 'admin.js', array( 'jquery'), false, true);
    82                 wp_localize_script('mhs_seoe_admin', 'seoe_ajax', array('ajaxurl' => admin_url('admin-ajax.php')));
     128                wp_localize_script('mhs_seoe_admin', 'seoe_ajax', array('ajaxurl' => admin_url('admin-ajax.php'),'title_length'=>$title_length,'desc_length'=>$desc_length));
    83129
    84130                add_action('admin_notices', array($this,'post_notice'));
     
    91137            echo '<div class="update-nag" style="display: none;" id="seoe_title_error">The SEO Title field should be manually filled in.</div>';
    92138            echo '<div class="update-nag" style="display: none;" id="seoe_desc_error">The Meta Description field should be manually filled in.</div>';
    93             echo '<div class="error" style="display: none;" id="seoe_title_length"><p>The SEO Title field is longer than the recommended length.</p></div>';
    94             echo '<div class="error" style="display: none;" id="seoe_desc_length"><p>The Meta Description is longer than the recommended length.</p></div>';               
     139            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>';
     140            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>';             
    95141        }
    96142        /**
     
    176222
    177223                if($type == 2) {
    178                     $length = $length - 3;
     224                    $length -= 3;
    179225
    180226                    if($length < 0) $length = SEOE_TITLE_LENGTH; # If it would be 0 characters or less then give it the default length
     
    237283
    238284                if($type == 2) {
    239                     $length = $length - 3;
     285                    $length -= 3;
    240286
    241287                    if($length < 0) $length = SEOE_DESC_LENGTH; # If it would be 0 characters or less then give it the default length
  • seo-enforcer/trunk/seoe_admin.php

    r1153070 r1156496  
    3434                    <div style="' . $left_style . '">
    3535                        <p>
    36                         <input type="checkbox" name="seoe_post_notices" value="1"' . ((get_option('seoe_post_notices')) ? ' checked' : '') . '> Enable SEO notices on the admin screens where WordPress SEO or Shopp SEO are used.
     36                        Enable SEO notices on the admin screens where WordPress SEO or Shopp SEO are used.<br />
     37                        <input type="radio" name="seoe_post_notices" value="1"' . ((get_option('seoe_post_notices')) ? ' checked' : '') . '> Yes <input type="radio" name="seoe_post_notices" value="0"' . ((!get_option('seoe_post_notices')) ? ' checked' : '') . '> No
    3738                        </p>
    3839                        <h2>Frontend</h2>
Note: See TracChangeset for help on using the changeset viewer.