Plugin Directory

Changeset 1402118


Ignore:
Timestamp:
04/22/2016 01:24:32 PM (10 years ago)
Author:
4ley
Message:

Notice class, cover and screenshots added

Location:
querywall
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • querywall/trunk/core/class-qwall-admin.php

    r1400471 r1402118  
    2121     *
    2222     * @since 1.0.1
    23      * @return array
     23     * @return void
    2424     */
    2525    public static function build_admin() {
     
    4141     *
    4242     * @since 1.0.1
    43      * @return array
     43     * @return void
    4444     */
    4545    public static function render_page() {
     
    127127     *
    128128     * @since 1.0.5
    129      * @return array
     129     * @return void
    130130     */
    131     public static function render_admin_notice() {
     131    public static function render_admin_notice( $message, $css_classes = 'notice-success is-dismissible' ) {
    132132        ?>
    133         <div class="notice notice-success is-dismissible">
    134             <p><?php _e( 'Success!', 'querywall' ); ?></p>
     133        <div class="notice <?php echo $css_classes; ?>">
     134            <p><?php echo $message; ?></p>
    135135        </div>
    136136        <?php
     
    141141     *
    142142     * @since 1.0.5
    143      * @return array
     143     * @return int|boolen
    144144     */
    145145    public static function purge_logs( $older_than_hours = 0 ) {
     
    148148
    149149        if ( $older_than_hours == 0 ) {
    150             $wpdb->query( "DELETE FROM `" . $wpdb->base_prefix . "qwall_monitor`;" );
     150            return $wpdb->query( "DELETE FROM `" . $wpdb->base_prefix . "qwall_monitor`;" );
    151151        } else if( in_array( $older_than_hours, array( 24, 72, 120, 168, 336, 672 ) ) ) {
    152             $wpdb->query( "DELETE FROM `" . $wpdb->base_prefix . "qwall_monitor` WHERE `date_time_gmt` < '" . current_time( 'mysql', 1 ) . "' - INTERVAL " . esc_sql( ( int ) $older_than_hours ) . " HOUR;" );
     152            return $wpdb->query( "DELETE FROM `" . $wpdb->base_prefix . "qwall_monitor` WHERE `date_time_gmt` < '" . current_time( 'mysql', 1 ) . "' - INTERVAL " . esc_sql( ( int ) $older_than_hours ) . " HOUR;" );
    153153        }
     154
     155        return false;
    154156    }
    155157
     
    163165        if ( strpos( $file, 'querywall.php' ) !== false ) {
    164166            $wp_url = 'https://wordpress.org/support/view/plugin-reviews/querywall?rate=5#postform';
    165             $fb_url = 'https://www.facebook.com/QueryWall-Plugn-Play-Firewall-474820996034299/';
     167            $fb_url = 'https://www.facebook.com/querywall';
    166168            $links[] = '<a target="_blank" href="' . $wp_url . '" title="Rate and review QueryWall on WordPress.org">Rate this plugin</a>';
    167169            $links[] = '<a target="_blank" href="' . $fb_url . '" title="Visit QueryWall on Facebook" style="padding:0 5px;color:#fff;vertical-align:middle;border-radius:2px;background:#f5c140;">Visit on Facebook</a>';
  • querywall/trunk/core/class-qwall-core.php

    r1400300 r1402118  
    5757        require_once( $dirname . '/core/class-qwall-util.php' );
    5858        require_once( $dirname . '/core/class-qwall-setup.php' );
     59        require_once( $dirname . '/core/class-qwall-notice.php' );
    5960        require_once( $dirname . '/core/class-qwall-admin.php' );
    6061        register_activation_hook( self::$settings['plugin_file'], array( 'QWall_Setup', 'on_activate' ) );
     
    7273            if ( wp_verify_nonce( $_POST['qwall_purge_logs_nonce'], 'qwall_purge_logs' ) ) {
    7374               
    74                 do_action( 'qwall_purge_logs', ( int ) $_POST['qwall_purge_logs_older_than'] );
    75                 add_action( 'admin_notices', array( 'QWall_Admin', 'render_admin_notice' ) );
     75                $affected_rows = QWall_Admin::purge_logs( ( int ) $_POST['qwall_purge_logs_older_than'] );
     76               
     77                if ( false === $affected_rows ) {
     78
     79                    new QWall_Notice(
     80                        __( 'Oh noes! An error occurred while attempting to purge the logs. You may open a support ticket here <a href="https://wordpress.org/support/plugin/querywall">QueryWall Support Forum</a> or here <a href="https://github.com/4ley/querywall/issues">Github QueryWall Issues</a>.', 'querywall' ),
     81                        array( 'notice-error', 'is-dismissible' )
     82                    );
     83                } else {
     84
     85                    new QWall_Notice(
     86                        sprintf( _n( 'Success! %s entry purged.', 'Success! %s entries purged.', $affected_rows, 'querywall' ), $affected_rows ),
     87                        array( 'notice-success', 'is-dismissible' )
     88                    );
     89                }
    7690            }
    7791        }
     
    87101                if( isset( $_POST['qwall_purge_logs_daily'] ) ) {
    88102                    wp_schedule_event( current_time( 'timestamp' ), 'daily', 'qwall_purge_logs', ( int ) $_POST['qwall_purge_logs_older_than'] );
     103                    $message = __( 'Success! You have scheduled to purge logs periodically.', 'querywall' );
     104                } else {
     105                    $message = __( 'Success! You have unscheduled periodical cleaning.', 'querywall' );
    89106                }
    90107
    91                 add_action( 'admin_notices', array( 'QWall_Admin', 'render_admin_notice' ) );
     108                new QWall_Notice( $message, array( 'notice-success', 'is-dismissible' ) );
    92109            }
    93110        }
  • querywall/trunk/querywall.php

    r1400300 r1402118  
    44 * Plugin URI: https://wordpress.org/plugins/querywall/
    55 * Description: Autopilot protection for your WordPress against malicious URL requests. QueryWall analyzes queries automically to protect your site against malicious URL requests.
    6  * Tags: Tags: firewall, security, protect, block, antivirus, defender, malicious, request, query, blacklist, url, eval, base64, hack, attack, brute force, infection, injection, malware, prevention, protection, trojan, virus, xss, waf
     6 * Tags: firewall, security, protect, block, antivirus, defender, malicious, request, query, blacklist, url, eval, base64, hack, attack, brute force, infection, injection, malware, botnet, backdoor, web application firewall, xss, website security, wordpress security, secure, prevention, protection, trojan, virus, xss, waf, security audit, querywall, bbq, block bad queries, ninjafirewall, wordfence, bulletproof security, ithemes security, better wp security, sucuri, vaultpress, simple firewall
    77 * Usage: No configuration needed, just activate it.
    8  * Version: 1.0.5
     8 * Version: 1.0.6
    99 * Author: 4ley
    1010 * Author URI: https://github.com/4ley/querywall
  • querywall/trunk/readme.txt

    r1400471 r1402118  
    22
    33Contributors: 4ley
    4 Tags: firewall, security, protect, block, antivirus, defender, malicious, request, query, blacklist, url, eval, base64, hack, attack, brute force, infection, injection, malware, prevention, protection, trojan, virus, xss, waf
     4Tags: firewall, security, protect, block, antivirus, defender, malicious, request, query, blacklist, url, eval, base64, hack, attack, brute force, infection, injection, malware, botnet, backdoor, web application firewall, xss, website security, wordpress security, secure, prevention, protection, trojan, virus, xss, waf, security audit, querywall, bbq, block bad queries, ninjafirewall, wordfence, bulletproof security, ithemes security, better wp security, sucuri, vaultpress, simple firewall
    55Requires at least: 3.1
    66Tested up to: 4.5
     
    2929**Contribution / Social**
    3030
    31 Contribute to [QueryWall at GitHub](https://github.com/4ley/querywall) or follow [QueryWall at Facebook](https://www.facebook.com/QueryWall-Plugn-Play-Firewall-474820996034299/)
     31Contribute to [QueryWall at GitHub](https://github.com/4ley/querywall) or follow [QueryWall at Facebook](https://www.facebook.com/querywall)
    3232
    3333== Installation ==
Note: See TracChangeset for help on using the changeset viewer.