Changeset 1402118
- Timestamp:
- 04/22/2016 01:24:32 PM (10 years ago)
- Location:
- querywall
- Files:
-
- 3 added
- 5 edited
-
assets/banner-1544x500.png (added)
-
assets/banner-772x250.png (added)
-
assets/screenshot-1.png (modified) (previous)
-
trunk/core/class-qwall-admin.php (modified) (6 diffs)
-
trunk/core/class-qwall-core.php (modified) (3 diffs)
-
trunk/core/class-qwall-notice.php (added)
-
trunk/querywall.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
querywall/trunk/core/class-qwall-admin.php
r1400471 r1402118 21 21 * 22 22 * @since 1.0.1 23 * @return array23 * @return void 24 24 */ 25 25 public static function build_admin() { … … 41 41 * 42 42 * @since 1.0.1 43 * @return array43 * @return void 44 44 */ 45 45 public static function render_page() { … … 127 127 * 128 128 * @since 1.0.5 129 * @return array129 * @return void 130 130 */ 131 public static function render_admin_notice( ) {131 public static function render_admin_notice( $message, $css_classes = 'notice-success is-dismissible' ) { 132 132 ?> 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> 135 135 </div> 136 136 <?php … … 141 141 * 142 142 * @since 1.0.5 143 * @return array143 * @return int|boolen 144 144 */ 145 145 public static function purge_logs( $older_than_hours = 0 ) { … … 148 148 149 149 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`;" ); 151 151 } 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;" ); 153 153 } 154 155 return false; 154 156 } 155 157 … … 163 165 if ( strpos( $file, 'querywall.php' ) !== false ) { 164 166 $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'; 166 168 $links[] = '<a target="_blank" href="' . $wp_url . '" title="Rate and review QueryWall on WordPress.org">Rate this plugin</a>'; 167 169 $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 57 57 require_once( $dirname . '/core/class-qwall-util.php' ); 58 58 require_once( $dirname . '/core/class-qwall-setup.php' ); 59 require_once( $dirname . '/core/class-qwall-notice.php' ); 59 60 require_once( $dirname . '/core/class-qwall-admin.php' ); 60 61 register_activation_hook( self::$settings['plugin_file'], array( 'QWall_Setup', 'on_activate' ) ); … … 72 73 if ( wp_verify_nonce( $_POST['qwall_purge_logs_nonce'], 'qwall_purge_logs' ) ) { 73 74 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 } 76 90 } 77 91 } … … 87 101 if( isset( $_POST['qwall_purge_logs_daily'] ) ) { 88 102 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' ); 89 106 } 90 107 91 add_action( 'admin_notices', array( 'QWall_Admin', 'render_admin_notice' ) );108 new QWall_Notice( $message, array( 'notice-success', 'is-dismissible' ) ); 92 109 } 93 110 } -
querywall/trunk/querywall.php
r1400300 r1402118 4 4 * Plugin URI: https://wordpress.org/plugins/querywall/ 5 5 * 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, waf6 * 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 7 7 * Usage: No configuration needed, just activate it. 8 * Version: 1.0. 58 * Version: 1.0.6 9 9 * Author: 4ley 10 10 * Author URI: https://github.com/4ley/querywall -
querywall/trunk/readme.txt
r1400471 r1402118 2 2 3 3 Contributors: 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, waf4 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 5 5 Requires at least: 3.1 6 6 Tested up to: 4.5 … … 29 29 **Contribution / Social** 30 30 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/)31 Contribute to [QueryWall at GitHub](https://github.com/4ley/querywall) or follow [QueryWall at Facebook](https://www.facebook.com/querywall) 32 32 33 33 == Installation ==
Note: See TracChangeset
for help on using the changeset viewer.