Plugin Directory

Changeset 3067167

Timestamp:
04/08/2024 08:39:46 PM (7 months ago)
Author:
butterflymedia
Message:

Implement logging for malicious requests and implement log pruning

Location:
wp-guardian/trunk
Files:
3 added
3 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • wp-guardian/trunk/assets/css/style.css

    r1747467 r3067167  
    1919}
    2020
    21 .dtjwpg .dtjwpg-main {
    22     width: 70%;
    23     padding: 0 20px 0 0;
    24     float: left;
    25 }
    26 
    27 .dtjwpg .dtjwpg-aside {
    28     width: 30%;
    29     padding: 0;
    30     float: right;
    31 }
    32 
    33 .dtjwpg .dtjwpg-box,
    3421.dtjwpg .dtjwpg-table {
    3522    background-color: #ffffff;
     
    3724    margin: 20px auto;
    3825    padding: 0;
    39     -webkit-border-radius: 3px;
    40     -moz-border-radius: 3px;
    4126    border-radius: 3px;
    42     -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    43     -moz-box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    4427    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    4528    overflow: hidden;
     
    5033    border: none;
    5134    margin: 20px auto;
    52     -webkit-border-radius: 0px;
    53     -moz-border-radius: 0px;
    5435    border-radius: 0px;
    55     -webkit-box-shadow: none;
    56     -moz-box-shadow: none;
    5736    box-shadow: none;
    5837}
     
    7453    margin: 0;
    7554    padding: 12px 16px;
    76     float: left;
    7755    display: block;
    78 }
    79 
    80 .dtjwpg .dtjwpg-title span {
    81     vertical-align: middle;
    82 }
    83 
    84 .dtjwpg .dtjwpg-title.blue {
    85     background-color: #51aaec;
    86     background-image: -webkit-linear-gradient(to left, #51aaec, #1277c3);
    87     background-image: -webkit-gradient(to left, #51aaec, #1277c3);
    88     background-image: -moz-linear-gradient(to left, #51aaec, #1277c3);
    89     background-image: -o-linear-gradient(to left, #51aaec, #1277c3);
    90     background-image: linear-gradient(to left, #51aaec, #1277c3);
    91     color: #ffffff;
    92 }
    93 
    94 .dtjwpg .dtjwpg-title a.button {
    95     margin: 0 0 0 10px;
    96     float: right;
    97     display: inline-block;
    98     vertical-align: top;
    99     position: relative;
    10056}
    10157
     
    10460    margin: 0;
    10561    padding: 0 16px 6px;
    106     float: left;
    10762}
    10863
     
    14398}
    14499
    145 .dtjwpg form input[type="text"],
    146 .dtjwpg form input[type="email"],
    147 .dtjwpg form input[type="tel"],
    148 .dtjwpg form input[type="number"],
    149 .dtjwpg form input[type="date"],
    150 .dtjwpg form input[type="time"],
    151 .dtjwpg form select,
    152 .dtjwpg form textarea {
    153     width: 100%;
    154     min-height: 28px;
    155 }
    156 
    157 .dtjwpg form input[type="text"].dtjwpg-small,
    158 .dtjwpg form input[type="email"].dtjwpg-small,
    159 .dtjwpg form input[type="tel"].dtjwpg-small,
    160 .dtjwpg form input[type="number"].dtjwpg-small,
    161 .dtjwpg form input[type="date"].dtjwpg-small,
    162 .dtjwpg form input[type="time"].dtjwpg-small,
    163 .dtjwpg form select.dtjwpg-small,
    164 .dtjwpg form textarea.dtjwpg-small {
    165     width: auto;
    166 }
    167 
    168100.dtjwpg form .tablenav .tablenav-pages-navspan {
    169101    box-sizing: content-box;
     
    173105.dtjwpg form .tablenav select {
    174106    width: auto;
    175 }
    176 
    177 .dtjwpg form textarea {
    178     min-height: 100px;
    179 }
    180 
    181 .dtjwpg form textarea.dtjwpg-large {
    182     min-height: 240px;
    183107}
    184108
     
    188112    margin: 20px auto;
    189113    padding: 0;
    190     -webkit-border-radius: 3px;
    191     -moz-border-radius: 3px;
    192114    border-radius: 3px;
    193     -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    194     -moz-box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    195115    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    196116    overflow: hidden;
     
    202122    width: 100%;
    203123    margin: 0;
    204     float: left;
    205124    display: block;
    206125    transition: ease-in border-left 0.5s;
     
    246165}
    247166
    248 .dtjwpg .dtjwpg-options-form {
    249     border-top: 1px solid #eeeeee;
    250     width: 100%;
    251     margin: 10px 0 0;
    252     float: left;
    253     display: block;
    254 }
    255 
    256 #wpadminbar #wp-admin-bar-dtjwpg_guardian_link > .ab-item::before {
    257     font: 400 20px/1 dashicons;
    258     content: "\f332";
    259     top: 2px;
    260 }
    261 
    262 @media screen and (max-width: 1024px) {
    263    
    264     .dtjwpg .dtjwpg-title span {
    265 
    266         width: 100%;
    267         margin: 0 0 10px;
    268         float: left;
    269         display: block;
    270 
    271     }
    272 
    273     .dtjwpg .dtjwpg-title a.button {
    274         margin: 0 10px 10px 0;
    275         float: left;
    276         top: 0;
    277     }
    278 
    279 }
    280 
    281 @media screen and (max-width: 782px) {
    282 
    283     #wpadminbar #wp-admin-bar-dtjwpg_guardian_link {
    284         display: block;
    285     }
    286 
    287     #wpadminbar #wp-admin-bar-dtjwpg_guardian_link > .ab-item {
    288         width: 52px;
    289         display: block;
    290         overflow: hidden;
    291         font-size: 0px;
    292     }
    293 
    294     #wpadminbar #wp-admin-bar-dtjwpg_guardian_link > .ab-item::before {
    295         width: 52px;
    296         top: 8px;
    297         font: 400 32px/1 dashicons;
    298         text-align: center;
    299     }
    300 
    301 }
    302 
    303 @media screen and (max-width: 767px) {
    304 
    305     .dtjwpg .dtjwpg-main,
    306     .dtjwpg .dtjwpg-aside {
    307         width: 100%;
    308         padding: 0;
    309         float: left;
    310     }
    311 
    312 }
    313 
    314 @media screen and (max-width: 600px) {
    315 
    316     #wpadminbar ul li.dtjwpg_guardian_link {
    317         position: static;
    318     }
    319 
    320 }
     167
     168
     169/**
     170 * Grid
     171 */
     172.lhf--grid {
     173    display: grid;
     174    grid-gap: 1em;
     175    margin: 1em 0;
     176}
     177.lhf--grid-1 {
     178    grid-template-columns: repeat(1, 1fr);
     179}
     180.lhf--grid-2 {
     181    grid-template-columns: repeat(2, 1fr);
     182}
     183.lhf--grid-4 {
     184    grid-template-columns: repeat(4, 1fr);
     185}
     186.lhf--grid-5 {
     187    grid-template-columns: repeat(5, 1fr);
     188}
     189
     190.lhf--grid-item {
     191    background-color: #ffffff;
     192    padding: 2em 1em;
     193    box-shadow: 0px 25px 15px -25px rgb(151 163 184 / 50%); /* #97a3b8 */
     194    border-radius: 4px;
     195}
     196.lhf--grid-item hr {
     197    margin: 1em 0;
     198    border: 0;
     199    border-top: 1px solid #e2e8f0;
     200}
     201.lhf--grid-item h3 {
     202    text-transform: uppercase;
     203    font-size: 16px;
     204    display: flex;
     205    align-items: center;
     206    gap: 1em;
     207}
  • wp-guardian/trunk/assets/includes/config.php

    r3061202 r3067167  
    1515    delete_option( 'dtjwpg_donate_upsell' );
    1616    add_option( 'dtjwpg_core_uninstall_remember', 'on' );
     17
    1718    // Hide Admin Backend
    1819    add_option( 'dtjwpg_backend_token_option', '' );
     
    2728    add_option( 'dtjwpg_lockout_logins_time_option', '30' );
    2829    // WordPress Options
    29     add_option( 'dtjwpg_wp_unfilter_option', 'off' );
    3030    add_option( 'dtjwpg_wp_fileedit_option', 'off' );
    3131    add_option( 'dtjwpg_wp_xmlrpc_option', '1' );
     
    3434    add_option( 'dtjwpg_wp_emojis_option', 'off' );
    3535    add_option( 'dtjwpg_wp_debug_option', 'off' );
    36     add_option( 'dtjwpg_wp_wpssl_option', 'off' );
    37     // Server Configuration
    38     add_option( 'dtjwpg_server_config_option', '' );
    3936    // Two Step Verification
    4037    add_option( 'dtjwpg_verify_option', 'off' );
     
    4643    delete_option( 'dtjwpg_update_themes_option' );
    4744    delete_option( 'dtjwpg_update_l10n_option' );
     45
     46
     47
    4848
    4949    // Check if the database version is up to date
     
    150150        delete_option('dtjwpg_wp_debug_option');
    151151        delete_option('dtjwpg_wp_wpssl_option');
    152         // Server Configuration
    153         delete_option('dtjwpg_server_config_option');
     152
    154153        // Two Step Verification
    155154        delete_option('dtjwpg_verify_option');
     
    161160        delete_option( 'dtjwpg_update_themes_option' );
    162161        delete_option( 'dtjwpg_update_l10n_option' );
     162
    163163
    164164        // Finally delete the plugin database version.
  • wp-guardian/trunk/assets/includes/core.php

    r3062713 r3067167  
    11<?php
    2 if ( ! defined('ABSPATH') ) {
     2if ( ! defined() ) {
    33    die;
    44}
    5 
    6 function dtjwpg_load_text_domain() {
    7     load_plugin_textdomain( 'wp-guardian', false, DTJWPG_LANGUAGE );
    8 }
    9 add_action( 'plugins_loaded', 'dtjwpg_load_text_domain', 10 );
    105
    116function dtjwpg_plugin_assets() {
     
    138    wp_register_script( 'dtjwpg_admin_ajax', plugins_url( 'wp-guardian', 'wp-guardian' ) . '/assets/js/ajax.js', [ 'jquery' ], DTJWPG_VERSION, true );
    149    wp_register_script( 'dtjwpg_admin_scripts', plugins_url( 'wp-guardian', 'wp-guardian' ) . '/assets/js/scripts.js', [ 'jquery' ], DTJWPG_VERSION, true );
     10
     11
     12
     13
    1514
    1615    if ( is_user_logged_in() ) {
  • wp-guardian/trunk/assets/includes/guardian.php

    r3062713 r3067167  
    9898
    9999/**
    100  * Disables users from posting unfiltered HTML.
    101  *
    102  * @since 1.0
    103  * @return void
    104  */
    105 function dtjwpg_disable_unfiltered_html() {
    106 
    107     // Check if unfiltered HTML should be disabled
    108     if ( 'on' == get_option('dtjwpg_wp_unfilter_option') ) {
    109 
    110         // Check it's not already defined and then define it
    111         if ( ! defined('DISALLOW_UNFILTERED_HTML') ) {
    112             define('DISALLOW_UNFILTERED_HTML', true);
    113         }
    114 
    115     }
    116 
    117 }
    118 add_action('plugins_loaded', 'dtjwpg_disable_unfiltered_html', 1);
    119 
    120 /**
    121100 * Disables file editing within wp-admin.
    122101 *
     
    323302}
    324303add_action('plugins_loaded', 'dtjwpg_wp_debug_mode', 1);
    325 
    326 /**
    327  * Forces the website to default to HTTPS.
    328  *
    329  * @since 1.0
    330  * @return void
    331  */
    332 function dtjwpg_force_site_ssl() {
    333 
    334     // Check if the site should be served over HTTPS
    335     if ( 'on' == get_option('dtjwpg_wp_wpssl_option') ) {
    336 
    337         // Check if the constants are already defined and if not, define them
    338 
    339         if ( ! defined('FORCE_SSL_LOGIN') ) {
    340             define('FORCE_SSL_LOGIN', true);
    341         }
    342 
    343         if ( ! defined('FORCE_SSL_ADMIN') ) {
    344             define('FORCE_SSL_ADMIN', true);
    345         }
    346 
    347     }
    348 
    349 }
    350 add_action('plugins_loaded', 'dtjwpg_force_site_ssl', 1);
    351304
    352305// Check if the backend is hidden to prevent brute force attacks
  • wp-guardian/trunk/assets/js/ajax.js

    r3061202 r3067167  
    1 /**
    2  * ajax.js
    3  */
    4 
    51jQuery(document).ready(function($) {
    6 
    72    // On click of the database upgrade link
    83    $('body').on('click', '.dtjwpg-upgrade-db-link', function(e) {
     
    1914        // On confirmation of the upgrade dialog box
    2015        if ( confirm( DTJWPG_AJAX.confirm_upgrade_db ) ) {
    21 
    2216            // Make an Ajax request
    2317            $.ajax({
     
    2923                url: DTJWPG_AJAX.admin_ajax,
    3024                success: function(response) {
    31 
    3225                    // Hide the spinner now we're done
    3326                    $('.dtjwpg-db-upgrade-spinner').css('visibility', 'hidden');
     
    3528                    // If the response is successful, show a notice
    3629                    if ( response == "1" ) {
    37 
    3830                        // Show the success message and hide the warning
    3931                        $('.dtjwpg-notice-upgrade-success').show();
    4032                        $('.dtjwpg-notice-upgrade-warning').remove();
    41 
    4233                    }
    43                
    4434                }
    4535            });
    46 
    4736        } else {
    48 
    4937            // Upgrade cancelled so hide the spinner for
    5038            $('.dtjwpg-db-upgrade-spinner').css('visibility', 'hidden');
    51 
    5239        }
    53    
    5440    });
    5541
    5642    // On click of one of the save settings buttons
    5743    $('body').on('click', '.dtjwpg-save-settings-button', function(e) {
    58 
    5944        // Get this button and add to a variable
    6045        var currentButton = $(this);
     
    6954        // Check which button was clicked to decide what data to pass to the Ajax request
    7055        if ( $(this).hasClass('dtjwpg-wordpress-button') ) {
    71 
    7256            var ajax_nonce = 'dtjwpg_save_option_nonce';
    7357            var ajax_safety = $('.dtjwpg_save_option_nonce').val();
    7458            var ajax_options = {
    75                 dtjwpg_wp_unfilter_option: $('.dtjwpg_wp_unfilter_option').is(':checked') ? 'on' : 'off',
    7659                dtjwpg_wp_fileedit_option: $('.dtjwpg_wp_fileedit_option').is(':checked') ? 'on' : 'off',
    7760                dtjwpg_wp_xmlrpc_option: $('.dtjwpg_wp_xmlrpc_option').val(),
     
    8063                dtjwpg_wp_emojis_option: $('.dtjwpg_wp_emojis_option').is(':checked') ? 'on' : 'off',
    8164                dtjwpg_wp_debug_option: $('.dtjwpg_wp_debug_option').is(':checked') ? 'on' : 'off',
    82                 dtjwpg_wp_wpssl_option: $('.dtjwpg_wp_wpssl_option').is(':checked') ? 'on' : 'off',
    8365            };
    84 
    8566        } else if ( $(this).hasClass('dtjwpg-backend-button') ) {
    86 
    8767            var ajax_nonce = 'dtjwpg_save_backend_nonce';
    8868            var ajax_safety = $('.dtjwpg_save_backend_nonce').val();
     
    9171                dtjwpg_backend_redirect_option: $('.dtjwpg_backend_redirect_option').val(),
    9272            };
    93 
    9473        } else if ( $(this).hasClass('dtjwpg-lockouts-button') ) {
    95 
    9674            var ajax_nonce = 'dtjwpg_save_lockout_nonce';
    9775            var ajax_safety = $('.dtjwpg_save_lockout_nonce').val();
     
    10280                dtjwpg_lockout_logins_time_option: $('.dtjwpg_lockout_logins_time_option').val(),
    10381            };
    104 
    105         } else if ( $(this).hasClass('dtjwpg-server-button') ) {
    106 
    107             return false;
    108 
    10982        } else if ( $(this).hasClass('dtjwpg-verify-button') ) {
    110 
    11183            var ajax_nonce = 'dtjwpg_save_verify_nonce';
    11284            var ajax_safety = $('.dtjwpg_save_verify_nonce').val();
     
    11486                dtjwpg_verify_option: $('.dtjwpg_verify_option').is(':checked') ? 'on' : 'off',
    11587            };
    116 
    11788        } else {
    118 
    11989            // Invalid button clicked, stop here
    12090            return false;
    121 
    12291        }
    12392
     
    12796        // Setup a new Ajax request
    12897        $.ajax({
    129 
    13098            // Set the data and run
    13199            data: {
     
    138106            url: DTJWPG_AJAX.admin_ajax,
    139107            success: function(response) {
    140 
    141108                // Hide the progress spinner from the interface
    142109                $('.dtjwpg-save-spinner').css('visibility', 'hidden');
     
    144111                // Check the response, if 1 success and anything else is a failure
    145112                if ( response == "1" ) {
    146 
    147113                    // Add the success class to the section element
    148114                    $(currentButton).closest('.dtjwpg-options-item').addClass('dtjwpg-options-success');
    149 
    150115                } else {
    151 
    152116                    // Add the failure class to the section element
    153117                    $(currentButton).closest('.dtjwpg-options-item').addClass('dtjwpg-options-failure');
    154 
    155118                }
    156            
    157119            }
    158        
    159120        });
    160    
    161121    });
    162 
    163122});
    164 
  • wp-guardian/trunk/assets/js/scripts.js

    r1745008 r3067167  
    1 /**
    2  * scripts.js
    3  */
    4 
    51jQuery(document).ready(function($) {
    6 
    72    // Hide all option content blocks
    83    $('.dtjwpg-options-content').hide();
     
    105    // Function to toggle each setting section
    116    $('.dtjwpg-options-toggle').on('click', function(e) {
    12 
    137        e.preventDefault();
    148
     
    1711        $(this).parent('.dtjwpg-options-item').toggleClass('dtjwpg-options-active');
    1812        $(this).next('.dtjwpg-options-content').slideToggle('slow');
    19 
    2013    });
    2114
    2215    // Function to close the current section
    2316    $('.dtjwpg-close-button').on('click', function(e) {
    24 
    2517        e.preventDefault();
    2618
     
    2921        $(this).closest('.dtjwpg-options-item').removeClass('dtjwpg-options-active');
    3022        $(this).closest('.dtjwpg-options-content').slideUp('slow');
    31 
    3223    });
    33 
    3424});
    35 
  • wp-guardian/trunk/assets/templates/aside.php

    r3061202 r3067167  
    44}
    55?>
    6 <div class="dtjwpg-box">
    7     <h3 class="dtjwpg-title blue"><?php _e( 'Buy me a coffee', 'wp-guardian' ); ?></h3>
    86
    9     <div class="dtjwpg-content">
    10         <p><?php _e( 'Are you enjoying using this plugin? Please consider donating to the author, it would help to continue the development of the plugin and make it even better. Even a small amount is appreciated!', 'wp-guardian' ); ?></p>
    11         <p><a href="https://getbutterfly.com/" target="_blank"><?php _e( 'Check out my other plugins.', 'wp-guardian' ); ?></a></p>
    12         <p><a href="https://www.buymeacoffee.com/wolffe" class="button button-primary" target="_blank"><?php _e( 'Donate Now', 'wp-guardian' ); ?></a></p>
    13     </div>
    14 </div>
     7<h3><?php _e( 'Buy me a coffee', 'wp-guardian' ); ?></h3>
    158
    16 <div class="dtjwpg-box">
    17     <h3 class="dtjwpg-title"><?php _e( 'Information', 'wp-guardian' ); ?></h3>
     9<p><?php _e( 'Are you enjoying using this plugin? Please consider donating to the author, it would help to continue the development of the plugin and make it even better. Even a small amount is appreciated!', 'wp-guardian' ); ?></p>
     10<p>
     11    <a href="https://getbutterfly.com/" class="button button-secondary" target="_blank"><?php _e( 'Check out my other plugins.', 'wp-guardian' ); ?></a>
     12    <a href="https://www.buymeacoffee.com/wolffe" class="button button-primary" target="_blank"><?php _e( 'Donate Now', 'wp-guardian' ); ?></a>
     13</p>
    1814
    19     <div class="dtjwpg-content">
    20         <p><strong><?php _e( 'Need help with something?', 'wp-guardian' ); ?></strong> <?php _e( 'You can ask a question today in the WordPress forums or read the plugin information on the plugin details page.', 'wp-guardian' ); ?></p>
    21         <p><?php printf( __( 'You&#39;re currently using <strong>Version %s</strong> of the plugin.', 'wp-guardian' ), DTJWPG_VERSION ); ?></p>
    22         <p><em><?php _e( 'Thanks for using WP Guardian!', 'wp-guardian' ); ?></em></p>
    23     </div>
    24 </div>
     15<hr>
     16
     17<h3><?php _e( 'Information', 'wp-guardian' ); ?></h3>
     18
     19<p><strong><?php _e( 'Need help with something?', 'wp-guardian' ); ?></strong> <?php _e( 'You can ask a question today in the WordPress forums or read the plugin information on the plugin details page.', 'wp-guardian' ); ?></p>
     20<p><?php printf( __( 'You&#39;re currently using <strong>Version %s</strong> of the plugin.', 'wp-guardian' ), DTJWPG_VERSION ); ?></p>
     21<p><em><?php _e( 'Thanks for using WP Guardian!', 'wp-guardian' ); ?></em></p>
  • wp-guardian/trunk/assets/templates/guardian-backend.php

    r1747467 r3067167  
     1
    12
    2     <a href="#" class="dtjwpg-options-toggle dtjwpg-title"><?php _e('Hide Admin Dashboard', 'wp-guardian'); ?></a>
    3     <div class="dtjwpg-options-content dtjwpg-content" style="display: none;">
     3>
     4>
    45
    5         <p><?php _e('By default the WordPress dashboard is easily accessible to anyone via <code>/wp-admin/</code> or <code>/wp-login.php</code>. Now you can add a token to those requests which will prevent people from reaching the login page.', 'wp-guardian'); ?></p>
    6 
    7         <div class="dtjwpg-options-form dtjwpg-backend-form">
    8 
    9             <form method="post">
    10 
    11                 <table class="dtjwpg-form form-table">
    12 
    13                     <tbody>
    14 
    15                         <tr>
    16                             <th><label for="dtjwpg_backend_token_option"><?php _e('Secret Login Token', 'wp-guardian'); ?></label></th>
    17                             <td>
    18                                 <p><input type="text" id="dtjwpg_backend_token_option" class="dtjwpg_backend_token_option small-text dtjwpg-small" name="dtjwpg_backend_token_option" value="<?php echo get_option('dtjwpg_backend_token_option'); ?>" aria-describedby="description-dtjwpg_backend_token_option" /></p>
    19                                 <p class="description" id="description-dtjwpg_backend_token_option"><?php _e('Enter a string of letters &amp; numbers that will act as a token to verify the request made to the login page. For example, if the path was set to <code>a1b2c3</code>, the login URL becomes <code>/wp-login.php?dtjwpg-token=a1b2c3</code>. <strong>Leave this field blank to disable this setting.</strong>', 'wp-guardian'); ?></p>
    20                             </td>
    21                         </tr>
    22 
    23                         <tr>
    24                             <th><label for="dtjwpg_backend_redirect_option"><?php _e('Incorrect Token Redirect', 'wp-guardian'); ?></label></th>
    25                             <td>
    26                                 <p><input type="text" id="dtjwpg_backend_redirect_option" class="dtjwpg_backend_redirect_option small-text dtjwpg-small" name="dtjwpg_backend_redirect_option" value="<?php echo get_option('dtjwpg_backend_redirect_option'); ?>" aria-describedby="description-dtjwpg_backend_redirect_option" /></p>
    27                                 <p class="description" id="description-dtjwpg_backend_redirect_option"><?php _e('When an incorrect token is provided for the login page, the user will be redirected to the homepage by default. You can enter a slug for a different page if you&#39;d like to redirect them elsewhere.', 'wp-guardian'); ?></p>
    28                             </td>
    29                         </tr>
    30 
    31                         <tr>
    32                             <th></th>
    33                             <td>
    34                                 <?php $dtjwpg_save_backend_nonce = wp_create_nonce('dtjwpg_save_backend_nonce'); ?>
    35                                 <input type="hidden" name="dtjwpg_save_backend_nonce" class="dtjwpg_save_backend_nonce" value="<?php echo $dtjwpg_save_backend_nonce; ?>" />
    36                                 <button type="button" class="dtjwpg-save-settings-button dtjwpg-backend-button button button-primary"><?php _e('Save Settings', 'wp-guardian'); ?></button>
    37                                 <button type="button" class="dtjwpg-close-button button button-secondary"><?php _e('Close', 'wp-guardian'); ?></button>
    38                                 <span class="spinner dtjwpg-save-spinner"></span>
    39                             </td>
    40                         </tr>
    41 
    42                     </tbody>
    43 
    44                 </table>
    45 
    46             </form>
    47 
    48         </div>
    49 
    50     </div>
     6    <form method="post">
     7        <table class="dtjwpg-form form-table">
     8            <tbody>
     9                <tr>
     10                    <th><label for="dtjwpg_backend_token_option"><?php _e( 'Secret Login Token', 'wp-guardian' ); ?></label></th>
     11                    <td>
     12                        <p><input type="text" id="dtjwpg_backend_token_option" class="dtjwpg_backend_token_option regular-text" name="dtjwpg_backend_token_option" value="<?php echo get_option( 'dtjwpg_backend_token_option' ); ?>"></p>
     13                        <p class="description" id="description-dtjwpg_backend_token_option"><?php _e( 'Enter a string of letters &amp; numbers that will act as a token to verify the request made to the login page. For example, if the path was set to <code>a1b2c3</code>, the login URL becomes <code>/wp-login.php?dtjwpg-token=a1b2c3</code>. <strong>Leave this field blank to disable this setting.</strong>', 'wp-guardian' ); ?></p>
     14                    </td>
     15                </tr>
     16                <tr>
     17                    <th><label for="dtjwpg_backend_redirect_option"><?php _e( 'Incorrect Token Redirect', 'wp-guardian' ); ?></label></th>
     18                    <td>
     19                        <p><input type="text" id="dtjwpg_backend_redirect_option" class="dtjwpg_backend_redirect_option regular-text" name="dtjwpg_backend_redirect_option" value="<?php echo get_option( 'dtjwpg_backend_redirect_option' ); ?>"></p>
     20                        <p class="description" id="description-dtjwpg_backend_redirect_option"><?php _e( 'When an incorrect token is provided for the login page, the user will be redirected to the homepage by default. You can enter a slug for a different page if you&#39;d like to redirect them elsewhere.', 'wp-guardian' ); ?></p>
     21                    </td>
     22                </tr>
     23                <tr>
     24                    <th></th>
     25                    <td>
     26                        <?php $dtjwpg_save_backend_nonce = wp_create_nonce( 'dtjwpg_save_backend_nonce' ); ?>
     27                        <input type="hidden" name="dtjwpg_save_backend_nonce" class="dtjwpg_save_backend_nonce" value="<?php echo $dtjwpg_save_backend_nonce; ?>" />
     28                        <button type="button" class="dtjwpg-save-settings-button dtjwpg-backend-button button button-primary"><?php _e( 'Save Settings', 'wp-guardian' ); ?></button>
     29                        <button type="button" class="dtjwpg-close-button button button-secondary"><?php _e( 'Close', 'wp-guardian' ); ?></button>
     30                        <span class="spinner dtjwpg-save-spinner"></span>
     31                    </td>
     32                </tr>
     33            </tbody>
     34        </table>
     35    </form>
     36</div>
  • wp-guardian/trunk/assets/templates/guardian-firewall.php

    r3062713 r3067167  
    99    update_option( 'wp_guardian_firewall_log', (int) sanitize_text_field( $_POST['wp_guardian_firewall_log'] ) );
    1010
     11
    1112    update_option( 'wp_guardian_firewall_long_requests_length', (int) sanitize_text_field( $_POST['wp_guardian_firewall_long_requests_length'] ) );
    1213
     
    4647                    </p>
    4748                    <p>
    48                         <input type="number" value="<?php echo get_option( 'wp_guardian_firewall_long_requests_length' ); ?>" name="wp_guardian_firewall_long_requests_length" placeholder="2000" min="0" style="width: 200px;"> characters
     49                        <input type="number" value="<?php echo get_option( 'wp_guardian_firewall_long_requests_length' ); ?>" name="wp_guardian_firewall_long_requests_length" placeholder="2000" min="0" style="width: 200px;"> characters in URL to check for
     50                    </p>
     51                    <p>
     52                        <input type="number" value="<?php echo get_option( 'wp_guardian_firewall_log_size' ); ?>" name="wp_guardian_firewall_log_size" placeholder="10000" min="0" style="width: 200px;"> records to keep in the log
    4953                    </p>
    5054                </td>
  • wp-guardian/trunk/assets/templates/guardian-lockouts.php

    r1747467 r3067167  
     1
    12
    2     <a href="#" class="dtjwpg-options-toggle dtjwpg-title"><?php _e('Lockout Management', 'wp-guardian'); ?></a>
    3     <div class="dtjwpg-options-content dtjwpg-content" style="display: none;">
     3>
     4>
    45
    5         <p><?php _e('You can manage site lockouts from this section by configuring when people are blocked from accessing the site after they perform particular forbidden actions on the site.', 'wp-guardian'); ?></p>
    6 
    7         <div class="dtjwpg-options-form dtjwpg-lockouts-form">
    8 
    9             <form method="post">
    10 
    11                 <table class="dtjwpg-form form-table">
    12 
    13                     <tbody>
    14 
    15                         <tr>
    16                             <th><label for="dtjwpg_lockout_logins_option"><?php _e('Track Failed Logins', 'wp-guardian'); ?></label></th>
    17                             <td>
    18                                 <p><input type="checkbox" id="dtjwpg_lockout_logins_option" class="dtjwpg_lockout_logins_option" name="dtjwpg_lockout_logins_option"<?php if ( 'on' == get_option('dtjwpg_lockout_logins_option') ) : ?> checked="checked"<?php endif; ?> aria-describedby="description-dtjwpg_lockout_logins_option" /></p>
    19                                 <p class="description" id="description-dtjwpg_lockout_logins_option"><?php _e('Turning this setting on will track incorrect login attempts by users and lockout them out after a specified amount of attempts.', 'wp-guardian'); ?></p>
    20                             </td>
    21                         </tr>
    22 
    23                         <tr>
    24                             <th><label for="dtjwpg_lockout_email_option"><?php _e('Send Email On Lockout', 'wp-guardian'); ?></label></th>
    25                             <td>
    26                                 <p><input type="checkbox" id="dtjwpg_lockout_email_option" class="dtjwpg_lockout_email_option" name="dtjwpg_lockout_email_option"<?php if ( 'on' == get_option('dtjwpg_lockout_email_option') ) : ?> checked="checked"<?php endif; ?> aria-describedby="description-dtjwpg_lockout_email_option" /></p>
    27                                 <p class="description" id="description-dtjwpg_lockout_email_option"><?php _e('Choose whether you would like to be notified by email when someone has failed too many login attempts and is locked out.', 'wp-guardian'); ?></p>
    28                             </td>
    29                         </tr>
    30 
    31                         <tr>
    32                             <th><label for="dtjwpg_lockout_logins_threshold_option"><?php _e('Incorrect Login Threshold', 'wp-guardian'); ?></label></th>
    33                             <td>
    34                                 <p><input type="number" id="dtjwpg_lockout_logins_threshold_option" class="dtjwpg_lockout_logins_threshold_option small-text dtjwpg-small" name="dtjwpg_lockout_logins_threshold_option" value="<?php echo get_option('dtjwpg_lockout_logins_threshold_option'); ?>" aria-describedby="description-dtjwpg_lockout_logins_threshold_option" /></p>
    35                                 <p class="description" id="description-dtjwpg_lockout_logins_threshold_option"><?php _e('The number of incorrect login attempts that should be made before the user is locked out from accessing the site.', 'wp-guardian'); ?></p>
    36                             </td>
    37                         </tr>
    38 
    39                         <tr>
    40                             <th><label for="dtjwpg_lockout_logins_time_option"><?php _e('Incorrect Login Lockout', 'wp-guardian'); ?></label></th>
    41                             <td>
    42                                 <p><input type="number" id="dtjwpg_lockout_logins_time_option" class="dtjwpg_lockout_logins_time_option small-text dtjwpg-small" name="dtjwpg_lockout_logins_time_option" value="<?php echo get_option('dtjwpg_lockout_logins_time_option'); ?>" aria-describedby="description-dtjwpg_lockout_logins_time_option" /> minutes</p>
    43                                 <p class="description" id="description-dtjwpg_lockout_logins_time_option"><?php _e('Enter the number of minutes that a user should be locked out from the site after the specified amount of incorrect logins.', 'wp-guardian'); ?></p>
    44                             </td>
    45                         </tr>
    46 
    47                         <tr>
    48                             <th></th>
    49                             <td>
    50                                 <?php $dtjwpg_save_lockout_nonce = wp_create_nonce('dtjwpg_save_lockout_nonce'); ?>
    51                                 <input type="hidden" name="dtjwpg_save_lockout_nonce" class="dtjwpg_save_lockout_nonce" value="<?php echo $dtjwpg_save_lockout_nonce; ?>" />
    52                                 <button type="button" class="dtjwpg-save-settings-button dtjwpg-lockouts-button button button-primary"><?php _e('Save Settings', 'wp-guardian'); ?></button>
    53                                 <button type="button" class="dtjwpg-close-button button button-secondary"><?php _e('Close', 'wp-guardian'); ?></button>
    54                                 <span class="spinner dtjwpg-save-spinner"></span>
    55                             </td>
    56                         </tr>
    57 
    58                     </tbody>
    59 
    60                 </table>
    61 
    62             </form>
    63 
    64         </div>
    65 
    66     </div>
     6    <form method="post">
     7        <table class="dtjwpg-form form-table">
     8            <tbody>
     9                <tr>
     10                    <th><label for="dtjwpg_lockout_logins_option"><?php _e( 'Track Failed Logins', 'wp-guardian' ); ?></label></th>
     11                    <td>
     12                        <p><input type="checkbox" id="dtjwpg_lockout_logins_option" class="dtjwpg_lockout_logins_option" name="dtjwpg_lockout_logins_option"<?php checked( 'on', (string) get_option( 'dtjwpg_lockout_logins_option' ) ); ?>></p>
     13                        <p class="description" id="description-dtjwpg_lockout_logins_option"><?php _e( 'Turning this setting on will track incorrect login attempts by users and lockout them out after a specified amount of attempts.', 'wp-guardian' ); ?></p>
     14                    </td>
     15                </tr>
     16                <tr>
     17                    <th><label for="dtjwpg_lockout_email_option"><?php _e( 'Send Email On Lockout', 'wp-guardian' ); ?></label></th>
     18                    <td>
     19                        <p><input type="checkbox" id="dtjwpg_lockout_email_option" class="dtjwpg_lockout_email_option" name="dtjwpg_lockout_email_option"<?php checked( 'on', (string) get_option( 'dtjwpg_lockout_email_option' ) ); ?>></p>
     20                        <p class="description" id="description-dtjwpg_lockout_email_option"><?php _e( 'Choose whether you would like to be notified by email when someone has failed too many login attempts and is locked out.', 'wp-guardian' ); ?></p>
     21                    </td>
     22                </tr>
     23                <tr>
     24                    <th><label for="dtjwpg_lockout_logins_threshold_option"><?php _e( 'Incorrect Login Threshold', 'wp-guardian ' ); ?></label></th>
     25                    <td>
     26                        <p><input type="number" id="dtjwpg_lockout_logins_threshold_option" class="dtjwpg_lockout_logins_threshold_option" name="dtjwpg_lockout_logins_threshold_option" value="<?php echo get_option( 'dtjwpg_lockout_logins_threshold_option' ); ?>"></p>
     27                        <p class="description" id="description-dtjwpg_lockout_logins_threshold_option"><?php _e( 'The number of incorrect login attempts that should be made before the user is locked out from accessing the site.', 'wp-guardian' ); ?></p>
     28                    </td>
     29                </tr>
     30                <tr>
     31                    <th><label for="dtjwpg_lockout_logins_time_option"><?php _e( 'Incorrect Login Lockout', 'wp-guardian' ); ?></label></th>
     32                    <td>
     33                        <p><input type="number" id="dtjwpg_lockout_logins_time_option" class="dtjwpg_lockout_logins_time_option" name="dtjwpg_lockout_logins_time_option" value="<?php echo get_option( 'dtjwpg_lockout_logins_time_option' ); ?>"> minutes</p>
     34                        <p class="description" id="description-dtjwpg_lockout_logins_time_option"><?php _e( 'Enter the number of minutes that a user should be locked out from the site after the specified amount of incorrect logins.', 'wp-guardian' ); ?></p>
     35                    </td>
     36                </tr>
     37                <tr>
     38                    <th></th>
     39                    <td>
     40                        <?php $dtjwpg_save_lockout_nonce = wp_create_nonce( 'dtjwpg_save_lockout_nonce' ); ?>
     41                        <input type="hidden" name="dtjwpg_save_lockout_nonce" class="dtjwpg_save_lockout_nonce" value="<?php echo $dtjwpg_save_lockout_nonce; ?>">
     42                        <button type="button" class="dtjwpg-save-settings-button dtjwpg-lockouts-button button button-primary"><?php _e( 'Save Settings', 'wp-guardian' ); ?></button>
     43                        <button type="button" class="dtjwpg-close-button button button-secondary"><?php _e( 'Close', 'wp-guardian' ); ?></button>
     44                        <span class="spinner dtjwpg-save-spinner"></span>
     45                    </td>
     46                </tr>
     47            </tbody>
     48        </table>
     49    </form>
     50</div>
  • wp-guardian/trunk/assets/templates/guardian-options.php

    r1765383 r3067167  
     1
    12
    2     <a href="#" class="dtjwpg-options-toggle dtjwpg-title"><?php _e('WordPress Options', 'wp-guardian'); ?></a>
    3     <div class="dtjwpg-options-content dtjwpg-content" style="display: none;">
     3>
     4>
    45
    5         <p><?php _e('WordPress is highly configurable, but there are some settings that cannot be changed without going into the code. Now you can manage these settings easily.', 'wp-guardian'); ?></p>
    6 
    7         <div class="dtjwpg-options-form dtjwpg-options-form">
    8 
    9             <form method="post">
    10 
    11                 <table class="dtjwpg-form form-table">
    12 
    13                     <tbody>
    14 
    15                         <tr>
    16                             <th><label for="dtjwpg_wp_unfilter_option"><?php _e('Disable Unfiltered HTML', 'wp-guardian'); ?></label></th>
    17                             <td>
    18                                 <p><input type="checkbox" id="dtjwpg_wp_unfilter_option" class="dtjwpg_wp_unfilter_option" name="dtjwpg_wp_unfilter_option" <?php if ( 'on' == get_option('dtjwpg_wp_unfilter_option') ) : ?> checked="checked"<?php endif; ?> aria-describedby="description-dtjwpg_wp_unfilter_option" /></p>
    19                                 <p class="description" id="description-dtjwpg_wp_unfilter_option"><?php _e('Removes the ability for super admins (multi-sites only), admins and editors (single sites) to post unfiltered HTML in posts and other content areas which could harm your website.', 'wp-guardian'); ?></p>
    20                             </td>
    21                         </tr>
    22 
    23                         <tr>
    24                             <th><label for="dtjwpg_wp_fileedit_option"><?php _e('Disable File Editor', 'wp-guardian'); ?></label></th>
    25                             <td>
    26                                 <p><input type="checkbox" id="dtjwpg_wp_fileedit_option" class="dtjwpg_wp_fileedit_option" name="dtjwpg_wp_fileedit_option" <?php if ( 'on' == get_option('dtjwpg_wp_fileedit_option') ) : ?> checked="checked"<?php endif; ?> aria-describedby="description-dtjwpg_wp_fileedit_option" /></p>
    27                                 <p class="description" id="description-dtjwpg_wp_fileedit_option"><?php _e('Editing Core, plugin and theme files via the WordPress admin area is unnecessary and can be a security risk if your account is hacked. Turning this off ensures files aren&#39;t editable by site users.', 'wp-guardian'); ?></p>
    28                             </td>
    29                         </tr>
    30 
    31                         <tr>
    32                             <th><label for="dtjwpg_wp_xmlrpc_option"><?php _e('XML-RPC Safety', 'wp-guardian'); ?></label></th>
    33                             <td>
    34                                 <p>
    35                                     <select class="dtjwpg_wp_xmlrpc_option dtjwpg-small" id="dtjwpg_wp_xmlrpc_option" name="dtjwpg_wp_xmlrpc_option" aria-describedby="description-dtjwpg_wp_xmlrpc_option">
    36                                         <option value="1"<?php if ( '1' == get_option('dtjwpg_wp_xmlrpc_option') ) : ?> selected="selected"<?php endif; ?>><?php _e('Allow all XML-RPC requests', 'wp-guardian'); ?></option>
    37                                         <option value="2"<?php if ( '2' == get_option('dtjwpg_wp_xmlrpc_option') ) : ?> selected="selected"<?php endif; ?>><?php _e('Limit XML-RPC requests to logged in users', 'wp-guardian'); ?></option>
    38                                         <option value="3"<?php if ( '3' == get_option('dtjwpg_wp_xmlrpc_option') ) : ?> selected="selected"<?php endif; ?>><?php _e('Disallow XML-RPC requests for everyone', 'wp-guardian'); ?></option>
    39                                     </select>
    40                                 </p>
    41                                 <p class="description" id="description-dtjwpg_wp_xmlrpc_option"><?php _e('XML-RPC is an API that allows services such as WordPress.com to communicate with your website. This option will let you choose whether you want to publicly expose the XML-RPC API to requests.', 'wp-guardian'); ?></p>
    42                             </td>
    43                         </tr>
    44 
    45                         <tr>
    46                             <th><label for="dtjwpg_wp_restapi_option"><?php _e('REST API Safety', 'wp-guardian'); ?></label></th>
    47                             <td>
    48                                 <p>
    49                                     <select class="dtjwpg_wp_restapi_option dtjwpg-small" id="dtjwpg_wp_restapi_option" name="dtjwpg_wp_restapi_option" aria-describedby="description-dtjwpg_wp_restapi_option">
    50                                         <option value="1"<?php if ( '1' == get_option('dtjwpg_wp_restapi_option') ) : ?> selected="selected"<?php endif; ?>><?php _e('Allow all RESTful API requests', 'wp-guardian'); ?></option>
    51                                         <option value="2"<?php if ( '2' == get_option('dtjwpg_wp_restapi_option') ) : ?> selected="selected"<?php endif; ?>><?php _e('Limit RESTful API requests to logged in users', 'wp-guardian'); ?></option>
    52                                         <option value="3"<?php if ( '3' == get_option('dtjwpg_wp_restapi_option') ) : ?> selected="selected"<?php endif; ?>><?php _e('Limit RESTful API requests to administrators', 'wp-guardian'); ?></option>
    53                                         <option value="4"<?php if ( '4' == get_option('dtjwpg_wp_restapi_option') ) : ?> selected="selected"<?php endif; ?>><?php _e('Disable the REST API completely', 'wp-guardian'); ?></option>
    54                                     </select>
    55                                 </p>
    56                                 <p class="description" id="description-dtjwpg_wp_restapi_option"><?php _e('The WordPress REST API is a great tool that allows you to extend the capabilities of your website, however by default it&#39;s accessible to everyone including guests. This setting will let you restrict who can use it.', 'wp-guardian'); ?></p>
    57                             </td>
    58                         </tr>
    59 
    60                         <tr>
    61                             <th><label for="dtjwpg_wp_headers_option"><?php _e('Header Safe Mode', 'wp-guardian'); ?></label></th>
    62                             <td>
    63                                 <p><input type="checkbox" id="dtjwpg_wp_headers_option" class="dtjwpg_wp_headers_option" name="dtjwpg_wp_headers_option" <?php if ( 'on' == get_option('dtjwpg_wp_headers_option') ) : ?> checked="checked"<?php endif; ?> aria-describedby="description-dtjwpg_wp_headers_option" /></p>
    64                                 <p class="description" id="description-dtjwpg_wp_headers_option"><?php _e('By default WordPress adds additional header meta information that is unnecessary. Enabling safe mode will remove this pointless headers.', 'wp-guardian'); ?></p>
    65                             </td>
    66                         </tr>
    67 
    68                         <tr>
    69                             <th><label for="dtjwpg_wp_emojis_option"><?php _e('Filter Emoji Support', 'wp-guardian'); ?></label></th>
    70                             <td>
    71                                 <p><input type="checkbox" id="dtjwpg_wp_emojis_option" class="dtjwpg_wp_emojis_option" name="dtjwpg_wp_emojis_option" <?php if ( 'on' == get_option('dtjwpg_wp_emojis_option') ) : ?> checked="checked"<?php endif; ?> aria-describedby="description-dtjwpg_wp_emojis_option" /></p>
    72                                 <p class="description" id="description-dtjwpg_wp_emojis_option"><?php _e('By turning this option on, support for Emojis will be turned off. This removes unnecessary scripts and stylesheets from being loaded.', 'wp-guardian'); ?></p>
    73                             </td>
    74                         </tr>
    75 
    76                         <tr>
    77                             <th><label for="dtjwpg_wp_debug_option"><?php _e('Enable Debug Mode', 'wp-guardian'); ?></label></th>
    78                             <td>
    79                                 <p><input type="checkbox" id="dtjwpg_wp_debug_option" class="dtjwpg_wp_debug_option" name="dtjwpg_wp_debug_option" <?php if ( 'on' == get_option('dtjwpg_wp_debug_option') ) : ?> checked="checked"<?php endif; ?> aria-describedby="description-dtjwpg_wp_debug_option" /></p>
    80                                 <p class="description" id="description-dtjwpg_wp_debug_option"><?php _e('You can enable <code>WP_DEBUG</code> mode by turning this setting on. <strong>Do not enable this on a production website unless you know what you&#39;re doing.</strong>', 'wp-guardian'); ?></p>
    81                             </td>
    82                         </tr>
    83 
    84                         <tr>
    85                             <th><label for="dtjwpg_wp_wpssl_option"><?php _e('Enable Site HTTPS', 'wp-guardian'); ?></label></th>
    86                             <td>
    87                                 <p><input type="checkbox" id="dtjwpg_wp_wpssl_option" class="dtjwpg_wp_wpssl_option" name="dtjwpg_wp_wpssl_option" <?php if ( 'on' == get_option('dtjwpg_wp_wpssl_option') ) : ?> checked="checked"<?php endif; ?> aria-describedby="description-dtjwpg_wp_wpssl_option" /></p>
    88                                 <p class="description" id="description-dtjwpg_wp_wpssl_option"><?php _e('Enabling this setting will force your site to be served over HTTPS which will secure connections to your site for your visitors. <strong>You must have a valid SSL certificate before enabling this setting. Without one, your site will not work and cause an endless redirect loop.</strong>', 'wp-guardian'); ?></p>
    89                             </td>
    90                         </tr>
    91 
    92                         <tr>
    93                             <th></th>
    94                             <td>
    95                                 <?php $dtjwpg_save_option_nonce = wp_create_nonce('dtjwpg_save_option_nonce'); ?>
    96                                 <input type="hidden" name="dtjwpg_save_option_nonce" class="dtjwpg_save_option_nonce" value="<?php echo $dtjwpg_save_option_nonce; ?>" />
    97                                 <button type="button" class="dtjwpg-save-settings-button dtjwpg-wordpress-button button button-primary"><?php _e('Save Settings', 'wp-guardian'); ?></button>
    98                                 <button type="button" class="dtjwpg-close-button button button-secondary"><?php _e('Close', 'wp-guardian'); ?></button>
    99                                 <span class="spinner dtjwpg-save-spinner"></span>
    100                             </td>
    101                         </tr>
    102 
    103                     </tbody>
    104 
    105                 </table>
    106 
    107             </form>
    108 
    109         </div>
    110 
    111     </div>
     6    <form method="post">
     7        <table class="dtjwpg-form form-table">
     8            <tbody>
     9                <tr>
     10                    <th><label for="dtjwpg_wp_fileedit_option"><?php _e( 'Disable File Editor', 'wp-guardian' ); ?></label></th>
     11                    <td>
     12                        <p><input type="checkbox" id="dtjwpg_wp_fileedit_option" class="dtjwpg_wp_fileedit_option" name="dtjwpg_wp_fileedit_option" <?php checked( 'on', (string) get_option( 'dtjwpg_wp_fileedit_option' ) ); ?>></p>
     13                        <p class="description" id="description-dtjwpg_wp_fileedit_option"><?php _e( 'Editing Core, plugin and theme files via the WordPress admin area is unnecessary and can be a security risk if your account is hacked. Turning this off ensures files aren&#39;t editable by site users.', 'wp-guardian' ); ?></p>
     14                    </td>
     15                </tr>
     16                <tr>
     17                    <th><label for="dtjwpg_wp_xmlrpc_option"><?php _e( 'XML-RPC', 'wp-guardian' ); ?></label></th>
     18                    <td>
     19                        <p>
     20                            <select class="dtjwpg_wp_xmlrpc_option" id="dtjwpg_wp_xmlrpc_option" name="dtjwpg_wp_xmlrpc_option" aria-describedby="description-dtjwpg_wp_xmlrpc_option">
     21                                <option value="1"<?php selected( 1, (int) get_option( 'dtjwpg_wp_xmlrpc_option' ) ); ?>><?php _e( 'Allow all XML-RPC requests', 'wp-guardian' ); ?></option>
     22                                <option value="2"<?php selected( 2, (int) get_option( 'dtjwpg_wp_xmlrpc_option' ) ); ?>><?php _e( 'Limit XML-RPC requests to logged in users', 'wp-guardian' ); ?></option>
     23                                <option value="3"<?php selected( 3, (int) get_option( 'dtjwpg_wp_xmlrpc_option' ) ); ?>><?php _e( 'Disallow XML-RPC requests for everyone', 'wp-guardian' ); ?></option>
     24                            </select>
     25                        </p>
     26                        <p class="description" id="description-dtjwpg_wp_xmlrpc_option"><?php _e( 'XML-RPC is an API that allows services such as WordPress.com to communicate with your website. This option will let you choose whether you want to publicly expose the XML-RPC API to requests.', 'wp-guardian' ); ?></p>
     27                    </td>
     28                </tr>
     29                <tr>
     30                    <th><label for="dtjwpg_wp_restapi_option"><?php _e( 'REST API', 'wp-guardian' ); ?></label></th>
     31                    <td>
     32                        <p>
     33                            <select class="dtjwpg_wp_restapi_option" id="dtjwpg_wp_restapi_option" name="dtjwpg_wp_restapi_option">
     34                                <option value="1"<?php selected( 1, (int) get_option( 'dtjwpg_wp_restapi_option' ) ); ?>><?php _e( 'Allow all RESTful API requests', 'wp-guardian' ); ?></option>
     35                                <option value="2"<?php selected( 2, (int) get_option( 'dtjwpg_wp_restapi_option' ) ); ?>><?php _e( 'Limit RESTful API requests to logged in users', 'wp-guardian' ); ?></option>
     36                                <option value="3"<?php selected( 3, (int) get_option( 'dtjwpg_wp_restapi_option' ) ); ?>><?php _e( 'Limit RESTful API requests to administrators', 'wp-guardian' ); ?></option>
     37                                <option value="4"<?php selected( 4, (int) get_option( 'dtjwpg_wp_restapi_option' ) ); ?>><?php _e( 'Disable the REST API completely', 'wp-guardian' ); ?></option>
     38                            </select>
     39                        </p>
     40                        <p class="description" id="description-dtjwpg_wp_restapi_option"><?php _e( 'The WordPress REST API is a great tool that allows you to extend the capabilities of your website, however by default it&#39;s accessible to everyone including guests. This setting will let you restrict who can use it.', 'wp-guardian' ); ?></p>
     41                    </td>
     42                </tr>
     43                <tr>
     44                    <th><label for="dtjwpg_wp_headers_option"><?php _e( 'Header Safe Mode', 'wp-guardian' ); ?></label></th>
     45                    <td>
     46                        <p><input type="checkbox" id="dtjwpg_wp_headers_option" class="dtjwpg_wp_headers_option" name="dtjwpg_wp_headers_option" <?php checked( 'on', (string) get_option( 'dtjwpg_wp_headers_option' ) ); ?>></p>
     47                        <p class="description" id="description-dtjwpg_wp_headers_option"><?php _e( 'By default WordPress adds additional header meta information that is unnecessary. Enabling safe mode will remove this pointless headers.', 'wp-guardian' ); ?></p>
     48                    </td>
     49                </tr>
     50                <tr>
     51                    <th><label for="dtjwpg_wp_emojis_option"><?php _e( 'Filter Emoji Support', 'wp-guardian' ); ?></label></th>
     52                    <td>
     53                        <p><input type="checkbox" id="dtjwpg_wp_emojis_option" class="dtjwpg_wp_emojis_option" name="dtjwpg_wp_emojis_option" <?php checked( 'on', (string) get_option( 'dtjwpg_wp_emojis_option' ) ); ?>></p>
     54                        <p class="description" id="description-dtjwpg_wp_emojis_option"><?php _e( 'By turning this option on, support for Emojis will be turned off. This removes unnecessary scripts and stylesheets from being loaded.', 'wp-guardian' ); ?></p>
     55                    </td>
     56                </tr>
     57                <tr>
     58                    <th><label for="dtjwpg_wp_debug_option"><?php _e( 'Enable Debug Mode', 'wp-guardian' ); ?></label></th>
     59                    <td>
     60                        <p><input type="checkbox" id="dtjwpg_wp_debug_option" class="dtjwpg_wp_debug_option" name="dtjwpg_wp_debug_option" <?php checked( 'on', (string) get_option( 'dtjwpg_wp_debug_option' ) ); ?>></p>
     61                        <p class="description" id="description-dtjwpg_wp_debug_option"><?php _e( 'You can enable <code>WP_DEBUG</code> mode by turning this setting on. <strong>Do not enable this on a production website unless you know what you&#39;re doing.</strong>', 'wp-guardian' ); ?></p>
     62                    </td>
     63                </tr>
     64                <tr>
     65                    <th></th>
     66                    <td>
     67                        <?php $dtjwpg_save_option_nonce = wp_create_nonce( 'dtjwpg_save_option_nonce' ); ?>
     68                        <input type="hidden" name="dtjwpg_save_option_nonce" class="dtjwpg_save_option_nonce" value="<?php echo $dtjwpg_save_option_nonce; ?>">
     69                        <button type="button" class="dtjwpg-save-settings-button dtjwpg-wordpress-button button button-primary"><?php _e( 'Save Settings', 'wp-guardian' ); ?></button>
     70                        <button type="button" class="dtjwpg-close-button button button-secondary"><?php _e( 'Close', 'wp-guardian' ); ?></button>
     71                        <span class="spinner dtjwpg-save-spinner"></span>
     72                    </td>
     73                </tr>
     74            </tbody>
     75        </table>
     76    </form>
     77</div>
  • wp-guardian/trunk/assets/templates/guardian-verify.php

    r1747467 r3067167  
     1
    12
    2     <a href="#" class="dtjwpg-options-toggle dtjwpg-title"><?php _e('Two Step Verification', 'wp-guardian'); ?></a>
    3     <div class="dtjwpg-options-content dtjwpg-content" style="display: none;">
     3>
     4>
    45
    5         <p><?php _e('Two Step Verification gives you the option to add another step to the login process by requiring a code to be entered when a user wants to login.', 'wp-guardian'); ?></p>
    6 
    7         <div class="dtjwpg-options-form dtjwpg-verify-form">
    8 
    9             <form method="post">
    10 
    11                 <table class="dtjwpg-form form-table">
    12 
    13                     <tbody>
    14 
    15                         <tr>
    16                             <th><label for="dtjwpg_verify_option"><?php _e('Enable Two Step Verification', 'wp-guardian'); ?></label></th>
    17                             <td>
    18                                 <p><input type="checkbox" id="dtjwpg_verify_option" class="dtjwpg_verify_option" name="dtjwpg_verify_option" <?php if ( 'on' == get_option('dtjwpg_verify_option') ) : ?> checked="checked"<?php endif; ?> aria-describedby="description-dtjwpg_verify_option" /></p>
    19                                 <p class="description" id="description-dtjwpg_verify_option"><?php _e('Turning this setting on allows people to use Two Step Verification to secure their accounts requiring them to verify who they are with their password and a code that is sent to them. Users will need to choose a verification method first before this is activated but turning this option off will disable it for everyone.', 'wp-guardian'); ?></p>
    20                             </td>
    21                         </tr>
    22 
    23                         <tr>
    24                             <th></th>
    25                             <td>
    26                                 <?php $dtjwpg_save_verify_nonce = wp_create_nonce('dtjwpg_save_verify_nonce'); ?>
    27                                 <input type="hidden" name="dtjwpg_save_verify_nonce" class="dtjwpg_save_verify_nonce" value="<?php echo $dtjwpg_save_verify_nonce; ?>" />
    28                                 <button type="button" class="dtjwpg-save-settings-button dtjwpg-verify-button button button-primary"><?php _e('Save Settings', 'wp-guardian'); ?></button>
    29                                 <button type="button" class="dtjwpg-close-button button button-secondary"><?php _e('Close', 'wp-guardian'); ?></button>
    30                                 <span class="spinner dtjwpg-save-spinner"></span>
    31                             </td>
    32                         </tr>
    33 
    34                     </tbody>
    35 
    36                 </table>
    37 
    38             </form>
    39 
    40         </div>
    41 
    42     </div>
     6    <form method="post">
     7        <table class="dtjwpg-form form-table">
     8            <tbody>
     9                <tr>
     10                    <th><label for="dtjwpg_verify_option"><?php _e( 'Enable Two Step Verification', 'wp-guardian' ); ?></label></th>
     11                    <td>
     12                        <p><input type="checkbox" id="dtjwpg_verify_option" class="dtjwpg_verify_option" name="dtjwpg_verify_option" <?php checked( 'on', (string) get_option( 'dtjwpg_verify_option' ) ); ?>></p>
     13                        <p class="description" id="description-dtjwpg_verify_option"><?php _e( 'Turning this setting on allows people to use Two Step Verification to secure their accounts requiring them to verify who they are with their password and a code that is sent to them. Users will need to choose a verification method first before this is activated but turning this option off will disable it for everyone.', 'wp-guardian' ); ?></p>
     14                    </td>
     15                </tr>
     16                <tr>
     17                    <th></th>
     18                    <td>
     19                        <?php $dtjwpg_save_verify_nonce = wp_create_nonce( 'dtjwpg_save_verify_nonce' ); ?>
     20                        <input type="hidden" name="dtjwpg_save_verify_nonce" class="dtjwpg_save_verify_nonce" value="<?php echo $dtjwpg_save_verify_nonce; ?>">
     21                        <button type="button" class="dtjwpg-save-settings-button dtjwpg-verify-button button button-primary"><?php _e( 'Save Settings', 'wp-guardian' ); ?></button>
     22                        <button type="button" class="dtjwpg-close-button button button-secondary"><?php _e( 'Close', 'wp-guardian' ); ?></button>
     23                        <span class="spinner dtjwpg-save-spinner"></span>
     24                    </td>
     25                </tr>
     26            </tbody>
     27        </table>
     28    </form>
     29</div>
  • wp-guardian/trunk/assets/templates/guardian.php

    r3062713 r3067167  
    1818            <a href="<?php echo $section; ?>dashboard" class="nav-tab <?php echo $tab === 'dashboard' ? 'nav-tab-active' : ''; ?>">Dashboard</a>
    1919            <a href="<?php echo $section; ?>firewall" class="nav-tab <?php echo $tab === 'firewall' ? 'nav-tab-active' : ''; ?>">Firewall</a>
     20
    2021            <a href="<?php echo $section; ?>settings" class="nav-tab <?php echo $tab === 'settings' ? 'nav-tab-active' : ''; ?>">Settings</a>
    2122        </h2>
     
    2324        <?php
    2425        if ( $tab === 'dashboard' ) {
    25             settings_errors();
     26            wp_enqueue_style( 'dtjwpg-datatables' );
     27            wp_enqueue_script( 'dtjwpg-datatables' );
    2628            ?>
    27             <div class="dtjwpg-main">
    28                 <ul class="dtjwpg-options-list">
    29                     <li class="dtjwpg-options-item dtjwpg-wordpress">
    30                         <?php require_once DTJWPG_TEMPLATES . 'guardian-options.php'; ?>
    31                     </li>
    32                     <li class="dtjwpg-options-item dtjwpg-backend">
    33                         <?php require_once DTJWPG_TEMPLATES . 'guardian-backend.php'; ?>
    34                     </li>
    35                     <li class="dtjwpg-options-item dtjwpg-lockouts">
    36                         <?php require_once DTJWPG_TEMPLATES . 'guardian-lockouts.php'; ?>
    37                     </li>
    38                     <li class="dtjwpg-options-item dtjwpg-server">
    39                         <?php require_once DTJWPG_TEMPLATES . 'guardian-server.php'; ?>
    40                     </li>
    41                     <li class="dtjwpg-options-item dtjwpg-verify">
    42                         <?php require_once DTJWPG_TEMPLATES . 'guardian-verify.php'; ?>
    43                     </li>
    44                 </ul>
     29            <div class="lhf--grid lhf--grid-2">
     30                <div class="lhf--grid-item">
     31                    <h3><?php _e( 'Latest Potential Threats', 'wp-guardian' ); ?></h3>
     32
     33                    <?php
     34                    // Database file path in the wp-content directory
     35                    $db_path = get_option( 'wp_guardian_gatekeeper_db_path' );
     36
     37                    try {
     38                        // Create (connect to) SQLite database in file
     39                        $pdo = new PDO( 'sqlite:' . $db_path );
     40                        // Set errormode to exceptions
     41                        $pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
     42
     43                        // Prepare SELECT statement to fetch all records from the logs table
     44                        $stmt = $pdo->prepare( "SELECT date, request_uri, query_string, user_agent, referrer FROM logs ORDER BY date DESC" );
     45                        $stmt->execute();
     46
     47                        // Fetch all the records
     48                        $logs = $stmt->fetchAll( PDO::FETCH_ASSOC );
     49
     50                        echo '<table class="display" id="gatekeeper-logs" style="width:100%">
     51                            <thead>
     52                                <tr>
     53                                    <th>Date</th>
     54                                    <th>Request URI</th>
     55                                </tr>
     56                            </thead>
     57                            <tbody>';
     58
     59                            // Iterate over each log entry and display it in the table
     60                            foreach ( $logs as $log ) {
     61                                echo '<tr>
     62                                    <td style="white-space:nowrap">' . $log['date'] . '</td>
     63                                    <td>
     64                                        <code>' . $log['request_uri'] . '</code>
     65                                        <br><b>UA</b>: ' . htmlspecialchars( $log['user_agent'] );
     66
     67                                        if ( (string) $log['referrer'] !== '' ) {
     68                                            echo '<br>→ ' . htmlspecialchars( $log['referrer'] );
     69                                        }
     70                                    echo '</td>
     71                                </tr>';
     72                            }
     73
     74                            echo '</tbody>
     75                        </table>';
     76
     77                    } catch ( PDOException $e ) {
     78                        // Handle SQLite exception
     79                        echo "SQLite error: " . $e->getMessage();
     80                    }
     81                    ?>
     82                </div>
     83
     84                <div class="lhf--grid-item">
     85                    <?php require_once DTJWPG_TEMPLATES . 'aside.php'; ?>
     86                </div>
    4587            </div>
    4688
    47             <div class="dtjwpg-aside">
    48                 <?php require_once DTJWPG_TEMPLATES . 'aside.php'; ?>
    49             </div>
     89            <script>
     90            document.addEventListener("DOMContentLoaded", (event) => {
     91                let table = new DataTable('#gatekeeper-logs', {
     92                    order: [[0, 'desc']],
     93                    pageLength: 10,
     94                    lengthMenu: [10, 25, 50, 100, 250, 500]
     95                });
     96            });
     97            </script>
     98            <style>
     99            #gatekeeper-logs code {
     100                padding: 2px 4px;
     101                margin: 1px;
     102                background: #74b9ff;
     103                font-size: 12px;
     104                border-radius: 3px;
     105                display: inline-block;
     106            }
     107            </style>
     108
    50109            <?php
    51110        } elseif ( $tab === 'firewall' ) {
    52111            include DTJWPG_TEMPLATES . 'guardian-firewall.php';
     112
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
    53130        } elseif ( $tab === 'settings' ) {
    54131            include DTJWPG_TEMPLATES . 'guardian-settings.php';
    55132        }
    56133        ?>
    57 
    58134    </div>
    59135</div>
  • wp-guardian/trunk/assets/templates/lockouts.php

    r1770915 r3067167  
    11<?php
     2
     3
     4
    25
    3 /**
    4  * lockouts.php
    5  */
     6require_once DTJWPG_INCLUDES . 'lockouts.php';
    67
    7 // No thank you
    8 if ( ! defined('ABSPATH') ) die;
    9 
    10 // Include the list table class for lockouts
    11 require_once(DTJWPG_INCLUDES . "lockouts.php");
    12 
    13 // Create a new instance of the list table
    148$dtjwpg_lockouts_table = new DTJWPG_Lockouts_Table();
    15 
    169?>
    1710
    1811<div class="dtjwpg">
     12
     13
     14
    1915
    20     <div class="dtjwpg-wrap wrap">
     16            <a href="https://wordpress.org/plugins/wp-guardian/" class="page-title-action" target="_blank"><?php _e( 'Support', 'wp-guardian' ); ?></a>
     17        </h1>
    2118
    22         <h1>
    23 
    24             <?php _e('WP Guardian', 'wp-guardian'); ?>
    25 
    26             <a href="https://wordpress.org/plugins/wp-guardian/" class="page-title-action" target="_blank"><?php _e('Support', 'wp-guardian'); ?></a>
    27 
    28         </h1>
    29 
    30         <div class="dtjwpg-main">
    31 
    32             <div class="dtjwpg-table">
    33 
    34                 <div class="dtjwpg-content-table dtjwpg-lockouts">
    35 
    36                     <form method="post">
    37 
    38                         <?php $dtjwpg_lockouts_table->display(); ?>
    39                    
    40                     </form>
    41 
    42                 </div>
    43 
    44             </div>
    45 
    46         </div>
    47 
    48         <div class="dtjwpg-aside">
    49 
    50             <?php require_once(DTJWPG_TEMPLATES . 'aside.php'); ?>
    51 
    52         </div>
    53 
    54     </div>
    55 
     19        <div class="dtjwpg-table">
     20            <div class="dtjwpg-content-table dtjwpg-lockouts">
     21                <form method="post">
     22                    <?php $dtjwpg_lockouts_table->display(); ?>
     23                </form>
     24            </div>
     25        </div>
     26    </div>
    5627</div>
    57 
  • wp-guardian/trunk/modules/firewall.php

    r3062713 r3067167  
    2121}
    2222add_action( 'wp_guardian_gatekeeper_long_req_length', 'wp_guardian_gatekeeper_long_req_length' );
    23 
    24 function wp_guardian_gatekeeper_match_logging( $enable ) {
    25     if ( (int) get_option( 'wp_guardian_firewall_log' ) === 1 ) {
    26         return true;
    27     }
    28 
    29     return false;
    30 }
    31 add_filter( 'wp_guardian_gatekeeper_match_logging', 'wp_guardian_gatekeeper_match_logging' );
    3223
    3324function wp_guardian_gatekeeper_post_scanning( $enable ) {
     
    137128    $matches = isset( $matches[0] ) ? $matches[0] : null;
    138129
    139     if ( $matches && apply_filters( 'wp_guardian_gatekeeper_match_logging', false ) ) {
    140         error_log( 'WP Guardian: ' . $matches );
    141     }
    142 
    143     wp_guardian_gatekeeper_log( $matches, $request_uri_string, $query_string_string, $user_agent_string, $referrer_string );
     130    if ( (int) get_option( 'wp_guardian_firewall_log' ) === 1 ) {
     131        wp_guardian_gatekeeper_log( $matches, $request_uri_string, $query_string_string, $user_agent_string, $referrer_string );
     132    }
    144133
    145134    $header_1 = apply_filters( 'wp_guardian_gatekeeper_header_1', 'HTTP/1.1 403 Forbidden' );
     
    209198
    210199function wp_guardian_gatekeeper_log( $data, $request_uri_string, $query_string_string, $user_agent_string, $referrer_string ) {
    211     $path = sprintf( '%s/wp-guardian-gatekeeper-%s.log', WP_CONTENT_DIR, hash( 'adler32', sprintf( '%s|%s|%s', AUTH_KEY, AUTH_COOKIE, AUTH_SALT ) ) );
    212 
    213     if ( $fp = fopen( $path, 'a' ) ) {
    214         if ( is_array( $data ) || is_object( $data ) ) {
    215             $data = print_r( $data, true );
    216         }
    217 
    218         $json_string = json_encode(
     200    $db_path = sprintf( '%s/wp-guardian-gatekeeper-%s.sqlite', WP_CONTENT_DIR, hash( 'adler32', sprintf( '%s|%s|%s', AUTH_KEY, AUTH_COOKIE, AUTH_SALT ) ) );
     201    update_option( 'wp_guardian_gatekeeper_db_path', $db_path );
     202
     203    try {
     204        // Create (connect to) SQLite database in file
     205        $pdo = new PDO( 'sqlite:' . $db_path );
     206        // Set errormode to exceptions
     207        $pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
     208
     209        // Enable Write-Ahead Logging for better concurrency
     210        $pdo->exec( 'PRAGMA journal_mode=WAL;' );
     211        // Adjust synchronous mode to NORMAL for faster writes at slight risk of data loss
     212        $pdo->exec( 'PRAGMA synchronous=NORMAL;' );
     213        // Increase cache size for better performance
     214        $pdo->exec( 'PRAGMA cache_size=-32000;' ); // Example: 32 MB cache
     215
     216        // Create table if it does not exist
     217        $pdo->exec(
     218            "CREATE TABLE IF NOT EXISTS logs (
     219                id INTEGER PRIMARY KEY,
     220                date TEXT,
     221                request_uri TEXT,
     222                query_string TEXT,
     223                user_agent TEXT,
     224                referrer TEXT
     225            )"
     226        );
     227
     228        // Prepare the insert statement
     229        $stmt = $pdo->prepare( "INSERT INTO logs (date, request_uri, query_string, user_agent, referrer) VALUES (?, ?, ?, ?, ?)" );
     230
     231        // Bind and insert the data
     232        $stmt->execute(
    219233            [
    220                 'date'         => date_i18n( 'Y-m-d H:i:s', time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ),
    221                 'data'         => $data,
    222                 'request_uri'  => $request_uri_string,
    223                 'query_string' => $query_string_string,
    224                 'user_agent'   => $user_agent_string,
    225                 'referrer'     => $referrer_string,
     234                date_i18n( 'Y-m-d H:i:s', time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ),
     235                $request_uri_string,
     236                $query_string_string,
     237                $user_agent_string,
     238                $referrer_string,
    226239            ]
    227240        );
    228241
    229         fwrite( $fp, $json_string );
    230         fclose( $fp );
    231     }
    232 }
     242        // echo "Log entry added.";
     243
     244    } catch ( PDOException $e ) {
     245        // Handle SQLite exception
     246        // echo "SQLite error: " . $e->getMessage();
     247    }
     248}
     249
     250
     251
     252/**
     253 * Clean up the database and keep only the most recent 10,000 records.
     254 *
     255 * This function connects to the SQLite database, checks the total number of records,
     256 * and deletes the excess records if the total exceeds 10,000, keeping only the
     257 * most recent 10,000 records.
     258 *
     259 */
     260function wp_guardian_cleanup_database_job() {
     261    // Your SQLite database connection code and cleanup logic here
     262    $db_path    = get_option( 'wp_guardian_gatekeeper_db_path' );
     263    $db_records = get_option( 'wp_guardian_firewall_log_size', 10000 );
     264
     265    if ( ! file_exists( $db_path ) ) {
     266        return;
     267    }
     268
     269    $pdo = new PDO( 'sqlite:' . $db_path );
     270    $pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
     271
     272    // Retrieve total number of records
     273    $total_records = $pdo->query( "SELECT COUNT(*) FROM logs" )->fetchColumn();
     274
     275    // If total records exceed 10,000, delete excess records
     276    if ( $total_records > 10000 ) {
     277        $excess_count = $total_records - 10000;
     278        $pdo->exec( "DELETE FROM logs WHERE id IN (SELECT id FROM logs ORDER BY id LIMIT $excess_count)" );
     279    }
     280}
     281
     282// Hook the cleanup function to run daily using WordPress CRON
     283add_action( 'wp_guardian_cleanup_database_daily', 'wp_guardian_cleanup_database_job' );
     284
     285// Schedule the CRON job to run daily at midnight
     286if ( ! wp_next_scheduled( 'wp_guardian_cleanup_database_daily' ) ) {
     287    wp_schedule_event( strtotime( 'midnight' ), 'daily', 'wp_guardian_cleanup_database_daily' );
     288}
  • wp-guardian/trunk/readme.txt

    r3061202 r3067167  
    66Tested up to: 6.5
    77Requires PHP: 7.0
    8 Stable tag: 1.4.3
     8Stable tag: 1.4.
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    5050== Changelog ==
    5151
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
    5267= 1.4.3 =
    53 
    5468* Fix issues with the firewall (for good)
    5569* Remove obsolete features, such as database backups and version control
    5670
    5771= 1.4.2 =
    58 
    5972* Fix issues with pattern matching in the firewall
    6073
    6174= 1.4.1 =
    62 
    6375* Add new firewall feature
    6476* Add new security settings
     
    6678
    6779= 1.4.0 =
    68 
    6980* Fix the plugin header information (stable tag, tested up to, etc.)
    7081* Implement WordPress Coding Standards (WPCS)
     
    7485
    7586= 1.3.4 =
    76 
    77 * More updaes to author information
     87* More updates to author information
    7888
    7989= 1.3.3 =
    80 
    8190* Updated author information - Removed Daniel James danieltj
    8291* To see the full revision history, please read the `CHANGELOG.md` file which explains any changes that have been made.
    8392
    8493= 1.3.2 =
    85 
    8694* Released: 19th November 2017
    8795* Fixed a mistake listed in the change log file.
     
    8997
    9098= 1.3.1 =
    91 
    9299* Released: 19th November 2017
    93100* Fixed a bug where database backups weren't attached to emails.
     
    95102
    96103= 1.3.0 =
    97 
    98104* Released: 13th November 2017
    99105* Added the ability to remove support for Emoji scripts.
     
    102108
    103109= 1.2.2 =
    104 
    105110* Released: 8th November 2017
    106111* Fixed a bug which caused some meta data to not be removed properly.
     
    108113
    109114= 1.2.1 =
    110 
    111115* Released: 26th October 2017
    112116* Added a new directory within the uploads folder for database backups.
     
    117121
    118122= 1.2.0 =
    119 
    120123* Released: 16th October 2017
    121124* Added new field to send backup emails to different email address.
     
    127130
    128131= 1.1.0 =
    129 
    130132* Released: 12th October 2017
    131133* Fixed the implementation of Two Step Verification code expiry.
     
    136138
    137139= 1.0.0 =
    138 
    139140* Released: 11th October 2017
    140141* Initial version
  • wp-guardian/trunk/wp-guardian.php

    r3062713 r3067167  
    44 * Plugin URI: https://getbutterfly.com/wordpress-plugins/wp-guardian/
    55 * Description: An easy way to harden your website's security effectively.
    6  * Version: 1.4.4
     6 * Version: 1.4.
    77 * Author: Ciprian Popescu
    88 * Author URI: https://getbutterfly.com/
     
    3333}
    3434
    35 define( 'DTJWPG_VERSION', '1.4.4' );
     35define( 'DTJWPG_VERSION', '1.4.' );
    3636define( 'DTJWPG_DB_VERSION', '1.0' );
    3737define( 'DTJWPG_URL', __FILE__ );
     
    4040define( 'DTJWPG_DB_LOGINS', 'dtjwpg_logins' );
    4141define( 'DTJWPG_DB_LOCKOUTS', 'dtjwpg_lockouts' );
    42 define( 'DTJWPG_LANGUAGE', DTJWPG_DIR . '/assets/languages' );
     42define( 'DTJWPG_s' );
    4343define( 'DTJWPG_INCLUDES', DTJWPG_DIR . '/assets/includes/' );
    4444define( 'DTJWPG_MODULES', DTJWPG_DIR . '/modules/' );
Note: See TracChangeset for help on using the changeset viewer.