Plugin Directory

Changeset 1275328 for querywall


Ignore:
Timestamp:
10/29/2015 11:53:12 AM (10 years ago)
Author:
4ley
Message:

Filter and load_plugin_first added

Location:
querywall/trunk
Files:
5 edited

Legend:

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

    r1262571 r1275328  
    4646            register_deactivation_hook( $plugin_file, array( 'QWall_Setup', 'on_deactivate' ) );
    4747            register_uninstall_hook( $plugin_file, array( 'QWall_Setup', 'on_uninstall' ) );
     48            add_action( 'activated_plugin', array( 'QWall_Setup', 'on_activated_plugin' ) );
    4849            add_action( 'admin_menu', array( 'QWall_Admin', 'build_admin' ) );
    4950            add_filter( 'plugin_row_meta', array( 'QWall_Admin', 'rate' ), 10, 2 );
  • querywall/trunk/core/class-qwall-firewall.php

    r1263584 r1275328  
    2222     */
    2323    private static $filters = array(
    24         'REQUEST_URI'     => array( 'eval\(', 'UNION.*SELECT', 'GROUP_CONCAT', 'CONCAT\s*\(', '\(null\)', 'base64_', '\/localhost', '\%2Flocalhost', '\/pingserver', '\/config\.', '\/wwwroot', '\/makefile', 'crossdomain\.', 'proc\/self\/environ', 'etc\/passwd', '\/https\:', '\/http\:', '\/ftp\:', '\/cgi\/', '\.cgi', '\.exe', '\.sql', '\.ini', '\.dll', '\.asp', '\.jsp', '\/\.bash', '\/\.git', '\/\.svn', '\/\.tar', ' ', '\<', '\>', '\/\=', '\.\.\.', '\+\+\+', '\:\/\/', '\/&&', '\/Nt\.', '\;Nt\.', '\=Nt\.', '\,Nt\.', '\.exec\(', '\)\.html\(', '\{x\.html\(', '\(function\(' ),
     24        'REQUEST_URI'     => array( 'eval\(', 'UNION.*SELECT', 'GROUP_CONCAT', 'CONCAT\s*\(', '\(null\)', 'base64_', '\/localhost', '\%2Flocalhost', '\/pingserver', '\/config\.', '\/wwwroot', '\/makefile', 'crossdomain\.', 'proc\/self\/environ', 'etc\/passwd', '\/https\:', '\/http\:', '\/ftp\:', '\/cgi\/', '\.cgi', '\.exe', '\.sql', '\.ini', '\.dll', '\.asp', '\.jsp', '\/\.bash', '\/\.git', '\/\.svn', '\/\.tar', ' ', '\<', '\>', '\/\=', '\.\.\.', '\+\+\+', '\:\/\/', '\/&&', '\/Nt\.', '\;Nt\.', '\=Nt\.', '\,Nt\.', '\.exec\(', '\)\.html\(', '\{x\.html\(', '\(function\(', 'wp_', 'user_login', 'user_pass' ),
    2525        'QUERY_STRING'    => array( '\.\.\/', '127\.0\.0\.1', 'localhost', 'loopback', '\%0A', '\%0D', '\%00', '\%2e\%2e', 'input_file', 'execute', 'mosconfig', 'path\=\.', 'mod\=\.', 'wp-config\.php' ),
    2626        'HTTP_USER_AGENT' => array( 'binlar', 'casper', 'cmswor', 'diavol', 'dotbot', 'finder', 'flicky', 'nutch', 'planet', 'purebot', 'pycurl', 'skygrid', 'sucker', 'turnit', 'vikspi', 'zmeu' ),
  • querywall/trunk/core/class-qwall-setup.php

    r1262571 r1275328  
    4242    public static function on_uninstall() {
    4343        self::remove_database_tables();
     44    }
     45
     46    /**
     47     * Foreign plugin activated
     48     *
     49     * @since 1.0.1
     50     * @return void
     51     */
     52    public static function on_activated_plugin() {
     53        self::load_plugin_first();
    4454    }
    4555
     
    95105        $wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->base_prefix . "qwall_monitor;" );
    96106    }
     107
     108    /**
     109     * Make sure plugin loads first
     110     *
     111     * @since 1.0.3
     112     * @return void
     113     */
     114    private static function load_plugin_first() {
     115
     116        if ( $plugins = get_option( 'active_plugins' ) ) {
     117            $basename = plugin_basename( QWall_Core::$settings['plugin_file'] );
     118            if ( $key = array_search( $basename, $plugins ) ) {
     119                array_splice( $plugins, $key, 1 );
     120                array_unshift( $plugins, $basename );
     121                update_option( 'active_plugins', $plugins );
     122            }
     123        }
     124    }
    97125}
    98126
  • querywall/trunk/querywall.php

    r1264251 r1275328  
    66 * 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
    77 * Usage: No configuration needed, just activate it.
    8  * Version: 1.0.2
     8 * Version: 1.0.3
    99 * Author: 4ley
    1010 * Author URI: https://github.com/4ley/querywall
  • querywall/trunk/readme.txt

    r1264251 r1275328  
    4747== Changelog ==
    4848
     49= 1.0.3 =
     50
     51* Filter and load_plugin_first added
     52
    4953= 1.0.2 =
    5054
Note: See TracChangeset for help on using the changeset viewer.