Media not actually deleted on disk when click “Permanent Delete”

So, after several attempts… it is a problem (or a feature) of the WPML multilanguage plugin. To start with, I have set up correctly the user permissions, as @WebElaine mentioned. Just in case something was not configures properly. More information on the following articles: Permissions to wp-content folder in Windows Server 2012 https://www.chillies.co.za/news/4421/The-Correct-Permissions-for-WordPress-on-IIS/ https://www.customfitonline.com/news/2013/6/20/solve-wordpress-on-windows-server-problems/ In … Read more

Can’t install new plugins because of the error “Could not create directory”

@pwnguin, I had the same problems running mod_php with WordPress and I finally figured it out. # chown www-data:www-data /home/CIM140/public_html/wordpress/ -R As long as YOU control the box this won’t cause any security issues. EDIT: You might also need to change your umask to 022 so new directories created by WordPress will have 755 permissions … Read more

Create custom permissions for user type

Plugins that would do this are: WPFront User Role Editor — free & paid both do what you’re asking User Role User Role and Capabilities Or you can write it into your theme’s functions.php consult Roles & Capabilities in the WP Codex for the details and read this easy-to-understand guide on how to add those … Read more

Disable Media Uploads to non Admin Users

Here are 2 methods: Method 1: Remove the upload_files capability from the respective roles. e.g. removing it from author: $role = get_role( ‘author’ ); $role->remove_cap( ‘upload_files’ ); This is saved to the database so it should only happen once, not on every page load. Removing it from the editor role should be the same albeit … Read more

when FS_METHOD = ‘direct’ is chosen?

Here’s the code from wp-admin/includes/file.php: if ( ! $method && function_exists(‘getmyuid’) && function_exists(‘fileowner’) ){ if ( !$context ) $context = WP_CONTENT_DIR; // If the directory doesn’t exist (wp-content/languages) then use the parent directory // as we’ll create it. if ( WP_LANG_DIR == $context && ! is_dir( $context ) ) $context = dirname( $context ); $context … Read more

Export data as CSV in back end with proper HTTP headers

Do not point the URL to admin.php, use admin-post.php instead: ‘<a href=”‘ . admin_url( ‘admin-post.php?action=print.csv’ ) . ‘”>’ In your plugin register a callback for that action: add_action( ‘admin_post_print.csv’, ‘print_csv’ ); function print_csv() { if ( ! current_user_can( ‘manage_options’ ) ) return; header(‘Content-Type: application/csv’); header(‘Content-Disposition: attachment; filename=example.csv’); header(‘Pragma: no-cache’); // output the CSV data } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)