Tag Info

Hot answers tagged

4

First of all, the prefix is only a configuration option and not a security feature. The reason is that once an attacker has access to your database, he can find out any exisiting table prefix within seconds. There's no way this obscurity protects you from any attack. For the prefix itself, WordPress asks you to use only digits, letters (here only basic ...


2

You're inserting raw POST data straight into an SQL query - sanitize, sanitize, sanitize! The code below should get you started, but I would advise you add some additional checks (is the email valid? are the strings too long? etc.): <?php $errors = $values = array(); if ( isset( $_POST['Submit'] ) ) { $fields = array( 'firstNametxt', ...


1

Quite a few options you have here but the simplest I suppose would be to change your SQL query like so: SELECT 0 AS id, user_login AS name, display_name AS tag, user_status AS status FROM wp_users; You can see that now we have the needed order and when you will do the $row['id'] = $i; assignment we will use that position instead of creating a ...


1

In many cases, you may use the following filter to disable local ssl verification. This is useful for self-signed certificates errors. add_filter('https_local_ssl_verify', '__return_false'); The current version v4.3.0 determins if a request is "local" with the following, in wp-includes/class-http.php // Determine if this request is to OUR install of ...


1

Fatal error: Cannot redeclare append() is very simple to fix: Your plugin seems to have a function called append(), right? On the wordpress install with this error there is another plugin which has a function append() too. You can fix this using PHP Namespaces or just give your function a more unique name like pluginname_append().


1

You need to pass author__in as an array but that isn't what you doing with this: ( array( 'author__in' => array( $followed ) ) ). You are creating an odd set of nested arrays. WP_Query isn't going to know what to do with it. A much simplified version should work: $followed = $wpdb->get_col(" SELECT user_id1 FROM wp_um_followers WHERE user_id2 ...


1

It looks like you are trying to insert the data before the form is submitted. Your code above had two forms, one for input and one with PHP. You need to check whether the form has been submitted then action the PHP code or if not display the form. $submitted_form = $_POST['submit']; if(isset($submitted_form)) { //process and validate, then insert } ...



Only top voted, non community-wiki answers of a minimum length are eligible