prefix."bruteforce_logger' LIMIT 1;"; $result = $wpdb->query($sql); // Table doesn't exist. Create it! if (!$result) { $sql = " CREATE TABLE IF NOT EXISTS `".$wpdb->prefix."bruteforce_logger` ( `id` int(11) NOT NULL, `ip` char(15) NOT NULL, `username` varchar(30) NOT NULL, `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;"; $wpdb->query($sql); $sql = " ALTER TABLE `".$wpdb->prefix."bruteforce_logger` ADD PRIMARY KEY (`id`);"; $wpdb->query($sql); $sql = " ALTER TABLE `".$wpdb->prefix."bruteforce_logger` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;"; $wpdb->query($sql); } // Add failed attempt to logs $sql = " INSERT INTO `".$wpdb->prefix."bruteforce_logger` ( `ip`, `username`, `date` ) VALUES ( '".esc_sql($_SERVER['REMOTE_ADDR'])."', '".esc_sql($username)."', NOW() )"; $wpdb->query($sql); } add_action( 'wp_login_failed', 'catch_failed_logins' ); function protect_wordpress_login() { global $wpdb; // Get number of failed attempts from last 5 minutes $sql = "SELECT COUNT(*) AS `amount` FROM `".$wpdb->prefix."bruteforce_logger` WHERE `ip` = '".esc_sql($_SERVER['REMOTE_ADDR'])."' AND `date` > DATE_SUB(NOW(),INTERVAL 5 MINUTE)"; $result = $wpdb->get_results($sql); // There is a result! if ($result) { // Result exceeds 5. Block the user. if ($result[0]->amount > 5) { // Show message echo 'You are blocked for 5 minutes due to too many failed login attempts.'; exit; } } } add_action('login_init','protect_wordpress_login'); __('slider'), 'labels' => array( 'name' => __('Slider'), 'singular_name' => __('slider'), 'add_new' => __('Slide toevoegen'), 'add_new_item' => __('Nieuw slide'), 'edit_item' => __('Wijzig slide'), 'new_item' => __('Nieuw slide'), 'all_items' => __('Alle sliders'), 'view_item' => __('Bekijk sliders'), 'search_items' => __('Zoek sliders'), 'not_found' => __('Er zijn geen sliders gevonden'), 'not_found_in_trash' => __('Geen sliders gevonden in de prullenbak') ), 'public' => true, 'can_export' => true, 'show_ui' => true, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'menu_icon' => 'dashicons-images-alt2', 'hierarchical' => true, 'has_archive' => true, 'rewrite' => array( "slug" => "slider" ), // Permalinks 'supports' => array( 'title', 'editor', // 'excerpt', 'thumbnail', // 'author', // 'comments', // 'trackbacks', // 'custom-fields', 'revisions' ), 'show_in_menu' => true, 'taxonomies' => array( 'slidercat', 'slidertag' ) ) ); //=============== Register custom taxonomy - CATEGORY ================ register_taxonomy( "slidercat", array( $post_type ), // Change this to the postype array( "hierarchical" => true, "label" => "Categorieën", 'labels' => array( 'name' => __('Categorieën'), 'singular_name' => __('Categorie'), 'search_items' => __('Categorieën zoeken'), 'popular_items' => __('Populaire categorieën'), 'all_items' => __('Alle categorieën'), 'parent_item' => __('Huidige categorie'), 'parent_item_colon' => __('Huidige categorie:'), 'edit_item' => __('Wijzig categorie'), 'update_item' => __('Wijzig categorie'), 'add_new_item' => __('Nieuwe categorie toevoegen'), 'new_item_name' => __('Nieuwe categorie') ), 'public' => true, 'show_ui' => false, 'with_front' => false, "rewrite" => true ) ); } // End custom taxonomy config //=============== Register custom metaboxes ================ add_filter( 'cmb2_meta_boxes', 'slider_meta_boxes' ); function slider_meta_boxes( array $meta_boxes ) { $prefix = ''; $meta_boxes['slider_excerpt'] = array( 'id' => 'slider_excerpt', 'title' => __( 'Samenvatting', 'cmb2' ), 'object_types' => array( 'slider_posts', ), // Post type 'context' => 'normal', 'priority' => 'high', 'show_names' => false, // Show field names on the left // 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend 'fields' => array( array( 'name' => __( '', 'cmb2' ), 'id' => $prefix . 'excerpt', 'type' => 'wysiwyg', ), ), ); $meta_boxes['slider_thumbnail'] = array( 'id' => 'slider_thumbnail', 'title' => __( 'Uitgelichte afbeelding', 'cmb2' ), 'object_types' => array( 'slider_posts', ), // Post type 'context' => 'normal', 'priority' => 'high', 'show_names' => false, // Show field names on the left // 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend 'fields' => array( array( 'name' => __( '', 'cmb2' ), 'id' => $prefix . 'highlighted_image', 'type' => 'file', ), ), ); $meta_boxes['slider_metabox'] = array( 'id' => 'slider_metabox', 'title' => __( 'Slider instellingen', 'cmb2' ), 'object_types' => array( 'slider_posts', ), // Post type 'context' => 'normal', 'priority' => 'low', 'show_names' => true, // Show field names on the left // 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend 'fields' => array( array( 'name' => __( 'Button Text 1', 'cmb2' ), 'desc' => __( 'Tekst van de 1e button. Laat leeg voor geen button.', 'cmb2' ), 'id' => $prefix . 'button_text_1', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value // 'sanitization_cb' => 'my_custom_sanitization', // custom sanitization callback parameter // 'escape_cb' => 'my_custom_escaping', // custom escaping callback parameter // 'on_front' => false, // Optionally designate a field to wp-admin only // 'repeatable' => true, ), array( 'name' => __( 'Button URL 1', 'cmb2' ), 'desc' => __( 'Voor de url van de pagina in waar u naartoe wilt linken.', 'cmb2' ), 'id' => $prefix . 'button_url_1', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value // 'sanitization_cb' => 'my_custom_sanitization', // custom sanitization callback parameter // 'escape_cb' => 'my_custom_escaping', // custom escaping callback parameter // 'on_front' => false, // Optionally designate a field to wp-admin only // 'repeatable' => true, ), array( 'name' => __( 'Button Target 1', 'cmb2' ), 'desc' => __( 'Kies om een ander tabblad te openen, of om op het zelfde tabblad te blijven', 'cmb2' ), 'id' => $prefix . 'button_target_1', 'type' => 'select', 'show_option_none' => false, 'options' => array( '_self' => __( 'Hetzelfde tabblad', 'cmb2' ), '_blank' => __( 'Nieuw tabblad', 'cmb2' ),) ), array( 'name' => __( 'Button Text 2', 'cmb2' ), 'desc' => __( 'Tekst van de 2e button. Laat leeg voor geen button.', 'cmb2' ), 'id' => $prefix . 'button_text_2', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value // 'sanitization_cb' => 'my_custom_sanitization', // custom sanitization callback parameter // 'escape_cb' => 'my_custom_escaping', // custom escaping callback parameter // 'on_front' => false, // Optionally designate a field to wp-admin only // 'repeatable' => true, ), array( 'name' => __( 'Button URL 2', 'cmb2' ), 'desc' => __( 'Voor de url van de pagina in waar u naartoe wilt linken.', 'cmb2' ), 'id' => $prefix . 'button_url_2', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value // 'sanitization_cb' => 'my_custom_sanitization', // custom sanitization callback parameter // 'escape_cb' => 'my_custom_escaping', // custom escaping callback parameter // 'on_front' => false, // Optionally designate a field to wp-admin only // 'repeatable' => true, ), array( 'name' => __( 'Button Target 2', 'cmb2' ), 'desc' => __( 'Kies om een ander tabblad te openen, of om op het zelfde tabblad te blijven', 'cmb2' ), 'id' => $prefix . 'button_target_2', 'type' => 'select', 'show_option_none' => false, 'options' => array( '_self' => __( 'Hetzelfde tabblad', 'cmb2' ), '_blank' => __( 'Nieuw tabblad', 'cmb2' ),) ), array( 'name' => __( 'Achtergrond kleur', 'cmb2' ), 'desc' => __( 'Indien u geen achtergrond afbeelding kiest, kunt u een kleur kiezen in hexadecimal. Laat leeg voor thema kleur.', 'cmb2' ), 'id' => $prefix . 'background_color', 'type' => 'colorpicker', 'default' => '#c80065', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value // 'sanitization_cb' => 'my_custom_sanitization', // custom sanitization callback parameter // 'escape_cb' => 'my_custom_escaping', // custom escaping callback parameter // 'on_front' => false, // Optionally designate a field to wp-admin only // 'repeatable' => true, ), )); return $meta_boxes; } ?> __('testimonial'), 'labels' => array( 'name' => __('Testimonial'), 'singular_name' => __('testimonial'), 'add_new' => __('Testimonial toevoegen'), 'add_new_item' => __('Nieuwe testimonial'), 'edit_item' => __('Wijzig testimonial'), 'new_item' => __('Nieuwe testimonial'), 'all_items' => __('Alle testimonials'), 'view_item' => __('Bekijk testimonials'), 'search_items' => __('Zoek testimonials'), 'not_found' => __('Er zijn geen testimonials gevonden'), 'not_found_in_trash' => __('Geen testimonials gevonden in de prullenbak') ), 'public' => true, 'can_export' => true, 'show_ui' => true, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'menu_icon' => 'dashicons-id', 'hierarchical' => true, 'has_archive' => true, 'rewrite' => array( "slug" => "testimonial" ), // Permalinks 'supports' => array( 'title', //'editor', // 'excerpt', // 'thumbnail', // 'author', // 'comments', // 'trackbacks', // 'custom-fields', 'revisions' ), 'show_in_menu' => true, 'taxonomies' => array( 'testimonialcat', 'testimonialtag' ) ) ); //=============== Register custom taxonomy - CATEGORY ================ register_taxonomy( "testimonialcat", array( $post_type ), // Change this to the postype array( "hierarchical" => true, "label" => "Categorieën", 'labels' => array( 'name' => __('Categorieën'), 'singular_name' => __('Categorie'), 'search_items' => __('Categorieën zoeken'), 'popular_items' => __('Populaire categorieën'), 'all_items' => __('Alle categorieën'), 'parent_item' => __('Huidige categorie'), 'parent_item_colon' => __('Huidige categorie:'), 'edit_item' => __('Wijzig categorie'), 'update_item' => __('Wijzig categorie'), 'add_new_item' => __('Nieuwe categorie toevoegen'), 'new_item_name' => __('Nieuwe categorie') ), 'public' => true, 'show_ui' => false, 'with_front' => false, "rewrite" => true ) ); } // End custom taxonomy config //=============== Register custom metaboxes ================ add_filter( 'cmb2_meta_boxes', 'testimonial_meta_boxes' ); function testimonial_meta_boxes( array $meta_boxes ) { $prefix = ''; $meta_boxes['testimonial_excerpt'] = array( 'id' => 'testimonial_excerpt', 'title' => __( 'Samenvatting', 'cmb2' ), 'object_types' => array( 'testimonial_posts', ), // Post type 'context' => 'normal', 'priority' => 'high', 'show_names' => false, // Show field names on the left // 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend 'fields' => array( array( 'name' => __( '', 'cmb2' ), 'id' => $prefix . 'excerpt', 'type' => 'wysiwyg', ), ), ); $meta_boxes['testimonial_thumbnail'] = array( 'id' => 'testimonial_thumbnail', 'title' => __( 'Uitgelichte afbeelding', 'cmb2' ), 'object_types' => array( 'testimonial_posts', ), // Post type 'context' => 'normal', 'priority' => 'high', 'show_names' => false, // Show field names on the left // 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend 'fields' => array( array( 'name' => __( '', 'cmb2' ), 'id' => $prefix . 'highlighted_image', 'type' => 'file', ), ), ); $meta_boxes['testimonial_metabox'] = array( 'id' => 'testimonial_metabox', 'title' => __( 'Extra instellingen', 'cmb2' ), 'object_types' => array( 'testimonial_posts', ), // Post type 'context' => 'normal', 'priority' => 'low', 'show_names' => true, // Show field names on the left // 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend 'fields' => array( array( 'name' => __( 'Testimonial Naam', 'cmb2' ), 'desc' => __( 'Voer de naam van de testimonial in', 'cmb2' ), 'id' => $prefix . 'testimonial_name', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value // 'sanitization_cb' => 'my_custom_sanitization', // custom sanitization callback parameter // 'escape_cb' => 'my_custom_escaping', // custom escaping callback parameter // 'on_front' => false, // Optionally designate a field to wp-admin only // 'repeatable' => true, ), array( 'name' => __( 'Testimonial Tekst', 'cmb2' ), 'desc' => __( 'Voer de text van de testimonial in', 'cmb2' ), 'id' => $prefix . 'testimonial_text', 'type' => 'textarea', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value // 'sanitization_cb' => 'my_custom_sanitization', // custom sanitization callback parameter // 'escape_cb' => 'my_custom_escaping', // custom escaping callback parameter // 'on_front' => false, // Optionally designate a field to wp-admin only // 'repeatable' => true, ), array( 'name' => __( 'Testimonial Functie', 'cmb2' ), 'desc' => __( 'Voer de functie van de testimonial in', 'cmb2' ), 'id' => $prefix . 'testimonial_function', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value // 'sanitization_cb' => 'my_custom_sanitization', // custom sanitization callback parameter // 'escape_cb' => 'my_custom_escaping', // custom escaping callback parameter // 'on_front' => false, // Optionally designate a field to wp-admin only // 'repeatable' => true, ), ), ); return $meta_boxes; } ?> __('Posttype'), 'labels' => array( 'name' => __('Features'), 'singular_name' => __('Features'), 'add_new' => __('Feature toevoegen'), 'add_new_item' => __('Nieuwe feature'), 'edit_item' => __('Wijzig feature'), 'new_item' => __('Nieuwe feature'), 'all_items' => __('Alle features'), 'view_item' => __('Bekijk features'), 'search_items' => __('Zoek features'), 'not_found' => __('Er zijn geen features gevonden'), 'not_found_in_trash' => __('Geen features gevonden in de prullenbak') ), 'public' => true, 'can_export' => true, 'show_ui' => true, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'menu_icon' => 'dashicons-list-view', 'hierarchical' => true, 'has_archive' => true, 'rewrite' => array( "slug" => "feature" ), // Permalinks 'supports' => array( 'title', 'editor', // 'excerpt', // 'thumbnail', // 'author', // 'comments', // 'trackbacks', // 'custom-fields', 'revisions' ), 'show_in_menu' => true, 'taxonomies' => array( 'featurescat', 'featurestag' ) ) ); //=============== Register custom taxonomy - CATEGORY ================ register_taxonomy( "featurescat", array( $post_type ), // Change this to the postype array( "hierarchical" => true, "label" => "Categorieën", 'labels' => array( 'name' => __('Categorieën'), 'singular_name' => __('Categorie'), 'search_items' => __('Categorieën zoeken'), 'popular_items' => __('Populaire categorieën'), 'all_items' => __('Alle categorieën'), 'parent_item' => __('Huidige categorie'), 'parent_item_colon' => __('Huidige categorie:'), 'edit_item' => __('Wijzig categorie'), 'update_item' => __('Wijzig categorie'), 'add_new_item' => __('Nieuwe categorie toevoegen'), 'new_item_name' => __('Nieuwe categorie') ), 'public' => true, 'show_ui' => false, 'with_front' => false, "rewrite" => true ) ); } // End custom taxonomy //=============== Register custom metaboxes ================ add_filter( 'cmb2_meta_boxes', 'features_meta_boxes' ); function features_meta_boxes( array $meta_boxes ) { $prefix = ''; $meta_boxes['features_excerpt'] = array( 'id' => 'features_excerpt', 'title' => __( 'Samenvatting', 'cmb2' ), 'object_types' => array( 'features_posts', ), // Post type 'context' => 'normal', 'priority' => 'high', 'show_names' => false, // Show field names on the left // 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend 'fields' => array( array( 'name' => __( '', 'cmb2' ), 'id' => $prefix . 'excerpt', 'type' => 'wysiwyg', ), ), ); $meta_boxes['features_thumbnail'] = array( 'id' => 'features_thumbnail', 'title' => __( 'Uitgelichte afbeelding', 'cmb2' ), 'object_types' => array( 'features_posts', ), // Post type 'context' => 'normal', 'priority' => 'high', 'show_names' => false, // Show field names on the left // 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend 'fields' => array( array( 'name' => __( '', 'cmb2' ), 'id' => $prefix . 'highlighted_image', 'type' => 'file', ), ), ); return $meta_boxes; } ?> __('Prijzen'), 'labels' => array( 'name' => __('Prijzen'), 'singular_name' => __('Prijzen'), 'add_new' => __('Prijs toevoegen'), 'add_new_item' => __('Nieuwe prijs'), 'edit_item' => __('Wijzig prijs'), 'new_item' => __('Nieuwe prijs'), 'all_items' => __('Alle prijzen'), 'view_item' => __('Bekijk prijzen'), 'search_items' => __('Zoek prijzen'), 'not_found' => __('Er zijn geen prijzen gevonden'), 'not_found_in_trash' => __('Geen prijzen gevonden in de prullenbak') ), 'public' => true, 'can_export' => true, 'show_ui' => true, '_builtin' => false, //'_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'menu_icon' => 'dashicons-tag', 'hierarchical' => true, 'capabilities' => array('create_posts' => 'do_not_allow',),'map_meta_cap' => true, 'has_archive' => true, 'rewrite' => array( "slug" => "prijzen-info" ), // Permalinks 'supports' => array( //'title', //'editor', // 'excerpt', // 'thumbnail', // 'author', // 'comments', // 'trackbacks', // 'custom-fields', 'revisions' ), 'show_in_menu' => false, //'taxonomies' => array( 'prijzencat', //'prijzentag' //) ) ); } // End custom taxonomy config //=============== Register custom metaboxes ================ add_filter( 'cmb2_meta_boxes', 'prijzen_meta_boxes' ); function prijzen_meta_boxes( array $meta_boxes ) { $prefix = ''; $meta_boxes['prijzen_metabox'] = array( 'id' => 'prijzen_metabox', 'title' => __( 'Prijzen', 'cmb2' ), 'object_types' => array( 'prijzen_posts', ), 'context' => 'normal', 'priority' => 'low', 'show_names' => true, 'fields' => array( array( 'name' => __( 'Premium', 'cmb2' ), 'desc' => __( 'standaard 155', 'cmb2' ), 'id' => $prefix . 'premium_price', 'type' => 'text_small', 'before_field' => '€', ), array( 'name' => __( 'Base', 'cmb2' ), 'desc' => __( 'standaard 115', 'cmb2' ), 'id' => $prefix . 'base_price', 'type' => 'text_small', 'before_field' => '€', ), array( 'name' => __( 'Evenementen', 'cmb2' ), 'desc' => __( 'standaard 25', 'cmb2' ), 'id' => $prefix . 'evenementen_price', 'type' => 'text_small', 'before_field' => '€', ), array( 'name' => __( 'Facturatie', 'cmb2' ), 'desc' => __( 'standaard 15', 'cmb2' ), 'id' => $prefix . 'facturatie_price', 'type' => 'text_small', 'before_field' => '€', ), array( 'name' => __( 'Ledenservice', 'cmb2' ), 'desc' => __( 'standaard 10', 'cmb2' ), 'id' => $prefix . 'ledenservice_price', 'type' => 'text_small', 'before_field' => '€', ), array( 'name' => __( 'E-mailing', 'cmb2' ), 'desc' => __( 'standaard 350', 'cmb2' ), 'id' => $prefix . 'emailing_price', 'type' => 'text_small', 'before_field' => '€', ), array( 'name' => __( 'Ledenportaal', 'cmb2' ), 'desc' => __( 'standaard 995', 'cmb2' ), 'id' => $prefix . 'ledenportaal_price', 'type' => 'text_small', 'before_field' => '€', ), array( 'name' => __( 'Datamigratie 1', 'cmb2' ), 'desc' => __( '1 dag, standaard 995', 'cmb2' ), 'id' => $prefix . 'datamigratie_1_price', 'type' => 'text_small', 'before_field' => '€', ), array( 'name' => __( 'Datamigratie 2', 'cmb2' ), 'desc' => __( '2 dagen, standaard 1995', 'cmb2' ), 'id' => $prefix . 'datamigratie_2_price', 'type' => 'text_small', 'before_field' => '€', ), array( 'name' => __( 'Training op locatie 1', 'cmb2' ), 'desc' => __( '1/2 dag, standaard 495', 'cmb2' ), 'id' => $prefix . 'training_1_price', 'type' => 'text_small', 'before_field' => '€', ), array( 'name' => __( 'Training op locatie 2', 'cmb2' ), 'desc' => __( '1 dag, standaard 995', 'cmb2' ), 'id' => $prefix . 'training_2_price', 'type' => 'text_small', 'before_field' => '€', ), array( 'name' => __( 'Standaard aantal gebruikers', 'cmb2' ), 'desc' => __( 'Bijvoorbeeld 5, standaard 5', 'cmb2' ), 'id' => $prefix . 'aantal_gebruikers', 'type' => 'text_small', 'before_field' => ' ', ), ), ); return $meta_boxes; } ?>