WordPress.org

Plugin Directory

Changeset 1701593


Ignore:
Timestamp:
07/24/17 11:47:28 (5 months ago)
Author:
petersplugins
Message:

v 3.1 - bugfix Polylang, bugfix CLI, ui styling

Location:
404page
Files:
17 added
11 edited

Legend:

Unmodified
Added
Removed
  • 404page/trunk/404page.php

    r1695254 r1701593  
    1010 * Plugin URI: http://petersplugins.com/free-wordpress-plugins/404page/ 
    1111 * Description: Custom 404 the easy way! Set any page as custom 404 error page. No coding needed. Works with (almost) every Theme. 
    12  * Version: 3.1 DEV 
     12 * Version: 3.1 
    1313 * Author: Peter Raschendorfer 
    1414 * Author URI: http://petersplugins.com 
  • 404page/trunk/assets/css/404page-ui.css

    r1691184 r1701593  
     1#pp-404page-settings h1 { 
     2  margin-bottom: 40px; 
     3} 
     4 
    15#pp-404page-settings .form-table th, .form-table td { 
    26  display: block; 
     
    59 
    610#pp-404page-settings .form-table th { 
    7   padding: 20px 10px 0 0; 
     11  padding: 0; 
     12  font-weight: normal; 
    813} 
    914 
    1015#pp-404page-settings .form-table td { 
    11   padding: 6px 10px 0 0; 
     16  padding: 0; 
     17  margin-bottom: 20px; 
     18} 
     19 
     20#pp-404page-settings .form-table td p { 
     21  padding: 0; 
     22  line-height: 1.2; 
     23  margin-bottom: 20px; 
    1224} 
    1325 
    1426#pp-seetings-advanced .form-table th { 
    1527  display: none; 
    16 } 
    17  
    18 #pp-seetings-advanced .form-table td p:first-child { 
    19   font-weight: 600; 
    20 } 
    21  
    22 #pp-seetings-advanced .form-table td p:last-child { 
    23   padding: 0 0 20px 40px; 
    2428} 
    2529 
     
    3943} 
    4044 
    41 .ui-accordion-content { 
    42   padding-left: 30px; 
    43 } 
    44  
    4545#pp-404page-settings input[type="checkbox"] { 
    46     display: none; 
     46    display: none; 
    4747} 
    4848 
    4949#pp-404page-settings input[type="checkbox"] + label.check { 
    50   display: inline-block;   
    51   border: 2px solid #DDD; 
    52   box-shadow: 0px 0px 5px 0px rgba(42,42,42,.75);  
    53   border-style:solid;  
    54   border-radius:5px;  
    55   width: 30px; 
    56   height: 30px; 
    57   line-height: 30px; 
    58   text-align: center; 
    59   font-family: dashicons; 
    60   font-size: 2em; 
    61   margin-right: 10px; 
     50    cursor: pointer; 
     51    text-indent: -9999px; 
     52    width: 80px; 
     53    height: 40px; 
     54    background: grey; 
     55    display: block; 
     56    border-radius: 40px; 
     57    position: relative; 
     58  float: left; 
     59  margin-right: 40px; 
    6260} 
    6361 
    6462#pp-404page-settings input[type="checkbox"]:disabled + label.check { 
    6563  background-color: #DDD; 
    66   cursor: not-allowed; 
    6764} 
    6865 
    69 #pp-404page-settings input[type="checkbox"] + label.check:before { 
    70   content: "";   
     66#pp-404page-settings input[type="checkbox"] + label.check:after { 
     67    content: ''; 
     68    position: absolute; 
     69    top: 5px; 
     70    left: 5px; 
     71    width: 30px; 
     72    height: 30px; 
     73    background: #fff; 
     74    border-radius: 30px; 
     75    transition: 0.3s; 
    7176} 
    7277 
    73 #pp-404page-settings input[type="checkbox"]:enabled:checked + label.check:before { 
    74   content: "\f147"; 
     78#pp-404page-settings input[type="checkbox"]:enabled:checked + label.check { 
     79  background: #104060; 
    7580} 
    7681 
     82#pp-404page-settings input[type="checkbox"]:enabled:checked + label.check:after { 
     83  left: calc(100% - 5px); 
     84    transform: translateX(-100%); 
     85} 
    7786 
    7887 
     
    8291 
    8392#pp-404page-settings select { 
    84   border: 2px solid #DDD; 
    85   box-shadow: 0px 0px 5px 0px rgba(42,42,42,.75);  
    86   border-style:solid;  
     93  border: 1px solid #104060; 
    8794  border-radius:5px; 
    8895  height: 40px; 
    8996  line-height: 40px; 
     97  margin: 5px 0; 
    9098} 
    9199 
  • 404page/trunk/assets/js/404page.js

    r1691184 r1701593  
    11jQuery(document).ready(function($) { 
    2   $( '#pp-404page-admin-notice-1' ).on( 'click', '.notice-dismiss', function ( event ) { 
     2   
     3  $( '.pp-404page-admin-notice' ).on( 'click', '.notice-dismiss', function ( event ) { 
    34    event.preventDefault(); 
    45        data = { 
    56            action: 'pp_404page_dismiss_admin_notice', 
    6             pp_404page_dismiss_admin_notice: pp_404page_remove.pp_404page_dismiss_admin_notice_number 
     7            pp_404page_dismiss_admin_notice: $( this ).parent().attr( 'id' ) 
    78        }; 
    89        $.post( ajaxurl, data ); 
    910        return false; 
    1011    }); 
     12  
    1113}); 
  • 404page/trunk/inc/class-404page.php

    r1697383 r1701593  
    4545      $this->plugin_name = '404page'; 
    4646      $this->plugin_slug = '404page'; 
    47       $this->version = '3.1 DEV'; 
     47      $this->version = '3.1'; 
    4848      $this->get_settings(); 
    4949      $this->load(); 
     
    147147        // Customizr Compatibility Mode  
    148148        
     149        // @since 3.1 
     150        add_filter( 'body_class', array( $this, 'add_404_body_class_customizr_mode' ) ); 
    149151        add_filter( 'tc_404_header_content', array( $this, 'show404title_customizr_mode' ), 999 ); 
    150152        add_filter( 'tc_404_content', array( $this, 'show404_customizr_mode' ), 999 ); 
     
    324326     
    325327    /** 
    326      * add class error404 to the body classes 
     328     * add body classes 
    327329     */ 
    328330    function add_404_body_class( $classes ) { 
    329       $classes[] = 'error404'; 
     331       
     332      // as of v 3.1 we first check if the class error404 already exists 
     333      if ( ! in_array( 'error404', $classes ) ) { 
     334       
     335        $classes[] = 'error404'; 
     336       
     337      } 
     338       
     339      // debug class 
     340      // @since 3.1 
     341      $debug_class = 'pp404-'; 
     342      if ( $this->settings['404page_native'] ) { 
     343        $debug_class .= 'native'; 
     344      } elseif ( defined( 'CUSTOMIZR_VER' ) ) { 
     345        $debug_class .= 'customizr'; 
     346      } elseif ( defined( 'ICL_SITEPRESS_VERSION' ) ) { 
     347        $debug_class .= 'wpml'; 
     348      } elseif ( $this->settings['404page_method'] != 'STD' ) { 
     349        $debug_class .= 'wpml'; 
     350      } else { 
     351        $debug_class .= 'std'; 
     352      } 
     353      $classes[] = $debug_class; 
     354       
     355      return $classes; 
     356    } 
     357     
     358     
     359    /** 
     360     * add body classes customizr mode 
     361     * @since 3.1 
     362     */ 
     363    function add_404_body_class_customizr_mode( $classes ) { 
     364       
     365      if ( is_404() ) { 
     366         
     367        $classes = $this->add_404_body_class( $classes ); 
     368       
     369      } 
     370       
    330371      return $classes; 
    331372    } 
     
    487528       
    488529      echo '<p><input type="checkbox" id="404page_hide" name="404page_hide" value="1"' . checked( true, $this->settings['404page_hide'], false ) . '/>'; 
    489       echo '<label for="404page_hide" class="check"></label>' . __( 'Hide the selected page from the Pages list', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . $this->dc_url . '/#settings_hide_page"></a></p>'; 
    490       echo '<p><span class="dashicons dashicons-info"></span>&nbsp;' . __( 'For Administrators the page is always visible.', '404page' ) . '</p>'; 
     530      echo '<label for="404page_hide" class="check"></label>' . __( 'Hide the selected page from the Pages list', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . $this->dc_url . '/#settings_hide_page"></a><br />'; 
     531      echo '<span class="dashicons dashicons-info"></span>&nbsp;' . __( 'For Administrators the page is always visible.', '404page' ) . '</p><div class="clear"></div>'; 
    491532       
    492533    } 
     
    499540       
    500541      echo '<p><input type="checkbox" id="404page_fire_error" name="404page_fire_error" value="1"' . checked( true, $this->settings['404page_fire_error'], false ) . '/>'; 
    501       echo '<label for="404page_fire_error" class="check"></label>' . __( 'Send an 404 error if the page is accessed directly by its URL', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . $this->dc_url . '/#settings_fire_404"></a></p>'; 
    502       echo '<p><span class="dashicons dashicons-info"></span>&nbsp;' . __( 'Uncheck this if you want the selected page to be accessible.', '404page' ) . '</p>'; 
     542      echo '<label for="404page_fire_error" class="check"></label>' . __( 'Send an 404 error if the page is accessed directly by its URL', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . $this->dc_url . '/#settings_fire_404"></a><br />'; 
     543      echo '<span class="dashicons dashicons-info"></span>&nbsp;' . __( 'Uncheck this if you want the selected page to be accessible.', '404page' ); 
    503544       
    504545      if ( function_exists( 'wpsupercache_activate' ) ) { 
    505546         
    506         echo '<p><span class="dashicons dashicons-warning"></span>&nbsp;<strong>' . __( 'WP Super Cache Plugin detected', '404page' ) . '</strong>. ' . __ ( 'If the page you selected as 404 error page is in cache, always a HTTP code 200 is sent. To avoid this and send a HTTP code 404 you have to exlcude this page from caching', '404page' ) . ' (<a href="' . admin_url( 'options-general.php?page=wpsupercache&tab=settings#rejecturi' ) . '">' . __( 'Click here', '404page' ) . '</a>).<br />(<a href="' . $this->dc_url . '/#wp_super_cache">' . __( 'Read more', '404page' ) . '</a>)</p>'; 
    507          
    508       } 
     547        echo '<br /><span class="dashicons dashicons-warning"></span>&nbsp;<strong>' . __( 'WP Super Cache Plugin detected', '404page' ) . '</strong>. ' . __ ( 'If the page you selected as 404 error page is in cache, always a HTTP code 200 is sent. To avoid this and send a HTTP code 404 you have to exlcude this page from caching', '404page' ) . ' (<a href="' . admin_url( 'options-general.php?page=wpsupercache&tab=settings#rejecturi' ) . '">' . __( 'Click here', '404page' ) . '</a>).<br />(<a href="' . $this->dc_url . '/#wp_super_cache">' . __( 'Read more', '404page' ) . '</a>)'; 
     548         
     549      } 
     550       
     551      echo '</p><div class="clear"></div>'; 
    509552       
    510553    } 
     
    517560       
    518561      echo '<p><input type="checkbox" id="404page_force_error" name="404page_force_error" value="1"' . checked( true, $this->settings['404page_force_error'], false ) . '/>'; 
    519       echo '<label for="404page_force_error" class="check warning"></label>' . __( 'Force 404 error after loading page', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . $this->dc_url . '/#settings_force_404"></a></p>'; 
    520       echo '<p><span class="dashicons dashicons-warning"></span>&nbsp;' . __( 'Generally this is not needed. It is not recommended to activate this option, unless it is necessary. Please note that this may cause problems with your theme.', '404page' ) . '</p>'; 
     562      echo '<label for="404page_force_error" class="check warning"></label>' . __( 'Force 404 error after loading page', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . $this->dc_url . '/#settings_force_404"></a><br />'; 
     563      echo '<span class="dashicons dashicons-warning"></span>&nbsp;' . __( 'Generally this is not needed. It is not recommended to activate this option, unless it is necessary. Please note that this may cause problems with your theme.', '404page' ) . '</p><div class="clear"></div>'; 
    521564       
    522565    } 
     
    529572       
    530573      echo '<p><input type="checkbox" id="404page_no_url_guessing" name="404page_no_url_guessing" value="1"' . checked( true, $this->settings['404page_no_url_guessing'], false ) . '/>'; 
    531       echo '<label for="404page_no_url_guessing" class="check warning"></label>' . __( 'Disable URL autocorrection guessing', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . $this->dc_url . '/#settings_stop_guessing"></a></p>'; 
    532       echo '<p><span class="dashicons dashicons-warning"></span>&nbsp;' . __( 'This stops WordPress from URL autocorrection guessing. Only activate, if you are sure about the consequences.', '404page' ) . '</p>'; 
     574      echo '<label for="404page_no_url_guessing" class="check warning"></label>' . __( 'Disable URL autocorrection guessing', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . $this->dc_url . '/#settings_stop_guessing"></a><br />'; 
     575      echo '<span class="dashicons dashicons-warning"></span>&nbsp;' . __( 'This stops WordPress from URL autocorrection guessing. Only activate, if you are sure about the consequences.', '404page' ) . '</p><div class="clear"></div>'; 
    533576     
    534577    } 
     
    550593       
    551594      echo '<p><input type="checkbox" id="404page_method" name="404page_method" value="CMP"' . checked( 'CMP', $this->settings['404page_method'], false ) . $dis . '/>'; 
    552       echo '<label for="404page_method" class="check"></label>' . __( 'Activate Compatibility Mode', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . $this->dc_url . '/#settings_operating_method"></a></p>'; 
    553       echo '<p><span class="dashicons dashicons-info"></span>&nbsp;'; 
     595      echo '<label for="404page_method" class="check"></label>' . __( 'Activate Compatibility Mode', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . $this->dc_url . '/#settings_operating_method"></a><br />'; 
     596      echo '<span class="dashicons dashicons-info"></span>&nbsp;'; 
    554597       
    555598      if ( $this->settings['404page_native'] ) { 
     
    574617      } 
    575618       
    576       echo '</p>'; 
     619      echo '</p><div class="clear"></div>'; 
    577620 
    578621    } 
     
    691734     
    692735      wp_enqueue_script( '404pagejs', plugins_url( 'assets/js/404page.js', $this->_file ), 'jquery', $this->version, true ); 
    693      
    694       wp_localize_script( '404pagejs', 'pp_404page_remove', array( 'pp_404page_dismiss_admin_notice_number' => 'pp-404page-admin-notice-1' ) ); 
    695736       
    696737      if ( get_current_screen()->id == $this->admin_handle ) { 
     
    743784      if ( current_user_can( 'manage_options' ) && get_user_meta( get_current_user_id(), 'pp-404page-admin-notice-1', true ) != 'dismissed' ) { 
    744785        ?> 
    745         <div class="notice is-dismissible" id="pp-404page-admin-notice-1"> 
     786        <div class="notice is-dismissible pp-404page-admin-notice" id="pp-404page-admin-notice-1"> 
    746787          <p><img src="<?php echo plugins_url( 'assets/pluginicon.png', $this->_file ); ?>" style="width: 48px; height: 48px; float: left; margin-right: 20px" /><strong><?php _e( 'Do you like the 404page plugin?', '404page' ); ?></strong><br /><?php _e( 'Follow me:', '404page' ); ?> <a class="dashicons dashicons-googleplus" href="http://g.petersplugins.com/" title="<?php _e( 'Authors Google+ Page', '404page' ); ?>"></a> <a class="dashicons dashicons-facebook-alt" href="http://f.petersplugins.com/" title="<?php _e( 'Authors facebook Page', '404page' ); ?>"></a><div class="clear"></div></p> 
    747788        </div> 
     
    749790      } 
    750791       
     792      // ask for rating 
     793      // in 30 days at the earliest 
     794      if ( ! get_option( 'pp-404page-admin-notice-2-start' ) ) { 
     795        update_option( 'pp-404page-admin-notice-2-start', time() + 30 * 24 * 60 * 60 ); 
     796      } 
     797      if ( get_option( 'pp-404page-admin-notice-2-start' ) <= time() ) { 
     798        if ( current_user_can( 'manage_options' ) && get_user_meta( get_current_user_id(), 'pp-404page-admin-notice-2', true ) != 'dismissed' ) { 
     799          ?> 
     800          <div class="notice is-dismissible pp-404page-admin-notice" id="pp-404page-admin-notice-2"> 
     801            <p><img src="<?php echo plugins_url( 'assets/pluginicon.png', $this->_file ); ?>" style="width: 48px; height: 48px; float: left; margin-right: 20px" /><?php _e( 'If you like the 404page plugin please support my work with giving it a good rating so that other users know it is helpful for you. Thanks.', '404page' ); ?><br /><a href="https://wordpress.org/support/plugin/<?php echo $this->plugin_slug; ?>/reviews/#new-post" title="<?php _e( 'Please rate plugin', '404page' ); ?>"><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span></a><div class="clear"></div></p> 
     802          </div> 
     803          <?php 
     804        } 
     805      } 
     806             
    751807    } 
    752808     
  • 404page/trunk/readme.txt

    r1691184 r1701593  
    55Requires at least: 3.0 
    66Tested up to: 4.8 
    7 Stable tag: 3.0 
     7Stable tag: 3.1 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    118118== Changelog == 
    119119 
    120 = 3.0 (2017-07-05) 
     120= 3.1 (2017-07-24) = 
     121* bugfix for Polylang ([See Topic](https://wordpress.org/support/topic/3-0-breaks-polylang-support/)) 
     122* bugfix for CLI ([See Topic](https://wordpress.org/support/topic/uninstall-php-from-cli-failed/)) 
     123* add debug class to body tag 
     124* also add body classes for Customizr theme 
     125* do not add error404 class if already exists 
     126* further redesign admin interface 
     127 
     128= 3.0 (2017-07-05) = 
    121129* new feature to force 404 error after loading page 
    122130* new feature to disable URL autocorrection guessing  
     
    191199== Upgrade Notice == 
    192200 
     201= 3.1 = 
     202fixed two bugs, plus further enhancements 
     203 
    193204= 3.0 = 
    194205new features added to force 404 error after loading page and to disable URL autocorrection guessing, plus further enhancements 
Note: See TracChangeset for help on using the changeset viewer.