diff --git a/assets/wordpress-bdp.css b/assets/wordpress-bdp.css
index a903f3a..8f5d93a 100644
--- a/assets/wordpress-bdp.css
+++ b/assets/wordpress-bdp.css
@@ -55,15 +55,15 @@ body {
}
#adminmenu > li a {
- color: #1d4899;
+ color: #020918;
}
#adminmenu > li div.wp-menu-image:before {
- color: #1d4899;
+ color: #020918;
}
#adminmenu > li a:hover, #adminmenu > li.menu-top:hover, #adminmenu > li.opensub > a.menu-top, #adminmenu > li > a.menu-top:focus {
- color: #1d4899;
+ color: #020918;
}
#adminmenu > li.menu-top:hover, #adminmenu > li.opensub > a.menu-top, #adminmenu > li > a.menu-top:focus {
@@ -111,7 +111,6 @@ body {
#adminmenu > li .wp-submenu .wp-submenu-head {
color: #1d4899;
- font-weight: bold !important;
}
.wp-has-current-submenu:hover {
@@ -122,13 +121,35 @@ body {
padding: 10px 0px 10px 10px;
padding-top: 10px !important;
padding-bottom: 10px !important;
- font-weight: bold;
}
#collapse-button {
display: none;
}
+.bdp_setting_box {
+ margin-right: 10px;
+ background-color: #ffffff;
+ padding: 15px;
+ border-style: solid;
+ border-width: 1px;
+ border-top-width: 0 !important;
+ border-color: #1d94cf;
+}
+
+.bdp_setting_box:first-of-type {
+ border-top-width: 1px !important;
+}
+
+.bdp_setting_box label {
+ cursor: pointer;
+}
+
+.bdp_setting_box label span {
+ cursor: pointer;
+ width: 10pt;
+ color: #a0a0a0;
+}
@media screen and (min-width: 783px) {
.wp-has-current-submenu li a {
@@ -216,13 +237,13 @@ ul#adminmenu a.wp-has-current-submenu::after, ul#adminmenu > li.current > a.curr
}
#adminmenu div.wp-menu-name {
- font-weight: bolder;
+
}
#adminmenu > li .wp-submenu a, #adminmenu > li.wp-has-current-submenu .wp-submenu a, #adminmenu > li a.wp-has-current-submenu:focus + .wp-submenu a, .folded #adminmenu > li.wp-has-current-submenu .wp-submenu a, #adminmenu > li.wp-has-current-submenu.opensub .wp-submenu a {
- color: #1d4899;
+ color: #020918;
padding-left: 25px;
- font-weight: bold;
+
}
@@ -232,7 +253,7 @@ ul#adminmenu a.wp-has-current-submenu::after, ul#adminmenu > li.current > a.curr
}
#adminmenu > li .wp-submenu li.current a, #adminmenu > li a.wp-has-current-submenu:focus + .wp-submenu li.current a, #adminmenu > li.wp-has-current-submenu.opensub .wp-submenu li.current a {
- color: #1d4899;
+ color: #010a1a;
}
#adminmenu > li .wp-submenu li.current a:hover, #adminmenu > li .wp-submenu li.current a:focus, #adminmenu > li a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover, #adminmenu > li a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus, #adminmenu > li.wp-has-current-submenu.opensub .wp-submenu li.current a:hover, #adminmenu > li.wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
diff --git a/bdp-kompass.php b/bdp-kompass.php
index e477bfb..b126413 100644
--- a/bdp-kompass.php
+++ b/bdp-kompass.php
@@ -2,7 +2,7 @@
/**
* Plugin Name: BdP Kompass
* Description: Wordpress-Plugin zur Unterstützung von Stämmen im Bund der Pfadfinderinnen und Pfadfinder e.V. zur optimalen Verwaltung eurer Webseite
- * Version: 4.3.6
+ * Version: 4.3.7
* Tags: bdp, utility, helper
* Requires at least: 6.0
* Requires PHP: 8.2
@@ -12,6 +12,7 @@
* Text Domain: bdp-kompass
*/
+use Bdp\Modules\KompassSettings\Controllers\SettingsPage as KomnpassSettings;
use Bdp\Modules\LimitLoginAttempts\Controllers\OptionsPage as OptionsPageAlias;
use Bdp\Modules\Security\Security;
use Bdp\Modules\Seo\Seo;
@@ -35,12 +36,14 @@ function bdp_plugin_init() {
update_option('kompass_already_installed', true);
wp_redirect( 'site-health.php?tab=bdp_enhanced_security');
}
+ Seo::importVerificationKeys();
}
add_action('admin_menu', function () {
bdp_kompass_load_plugin_textdomain();
new OptionsPageAlias();
+ new KomnpassSettings();
});
diff --git a/changelog b/changelog
index e76a2ef..9a9bbb2 100644
--- a/changelog
+++ b/changelog
@@ -1,8 +1,19 @@
-
Version 4.3.6
+Version 4.3.8
+
+ - Google- und Bing-Verifizierung nun auch im Plugin möglich
+
+
+
+Version 4.3.7
+Version 4.3.6
+
+
Version 4.3.5
- Translation fixes
diff --git a/modules/LimitLoginAttempts/Views/checkbox-option.php b/components/partials/checkbox-option.php
similarity index 100%
rename from modules/LimitLoginAttempts/Views/checkbox-option.php
rename to components/partials/checkbox-option.php
diff --git a/modules/LimitLoginAttempts/Views/radio-option.php b/components/partials/radio-option.php
similarity index 100%
rename from modules/LimitLoginAttempts/Views/radio-option.php
rename to components/partials/radio-option.php
diff --git a/components/partials/text-element.php b/components/partials/text-element.php
new file mode 100644
index 0000000..e26907b
--- /dev/null
+++ b/components/partials/text-element.php
@@ -0,0 +1,19 @@
+';
+ if (defined('WP_DEBUG') && WP_DEBUG == true) {
+ echo '
' . $settingName;
+ }
+}
+
+function _kompass_limit_logins_settings_callback(array $args) {
+ $setting = get_option($args['setting'], null);
+ $style = isset($args['style']) ? $args['style'] : '';
+
+ $value = esc_attr($setting);
+ if (isset($args['unit_division'])) {
+ $value = (int)$value / (int)$args['unit_division'];
+ }
+
+ kompass_print_textbox($args['setting'], $value, $style);
+}
diff --git a/includes/action_caller.php b/includes/action_caller.php
index 9913ef1..95ce679 100644
--- a/includes/action_caller.php
+++ b/includes/action_caller.php
@@ -8,7 +8,7 @@ add_action('wp_login_failed', [$loginHandler, 'onFailedLogin']);
add_filter('wp_authenticate_user', [$loginHandler, 'onSuccessFullLogin'], 99999, 2);
add_filter( 'admin_enqueue_scripts', 'enqueue_custom_password_js',10 );
-add_action('admin_init', 'admin_init');
+add_action('admin_init', 'kompass_admin_init');
if (get_option('kompass_cookies', false)) {
$loginHandler->handleCookies();
@@ -21,3 +21,5 @@ if (isset($_POST['save_kompass_balist_list_type'])) {
}
+
+add_action('wp_head', 'kompass_seo_add_verfications');
\ No newline at end of file
diff --git a/includes/frontend-functions.php b/includes/frontend-functions.php
index 3d10c91..0d53ac9 100644
--- a/includes/frontend-functions.php
+++ b/includes/frontend-functions.php
@@ -16,47 +16,40 @@ function bdp_update_dashboard_style() {
function bdp_add_menu_security() {
-
$moduleLoad = get_admin_url() . 'admin.php?page=' . BDP_LV_PLUGIN_SLUG . '/modules/index.php&loadmodule=';
-
-
-
-
-
}
function bdp_add_menu_contents() {
- add_menu_page(
- 'Beiträge',
- 'Inhalte',
- 'edit_posts',
- 'edit.php',
- '',
- 'dashicons-format-aside',
- 4
- );
+ add_menu_page('Seiten',
+ 'Inhalte',
+ 'edit_posts',
+ 'edit.php?post_type=page',
+ '',
+ 'dashicons-format-aside',
+ 4
+ );
- add_submenu_page('edit.php',
+ add_submenu_page('edit.php?post_type=page',
'media',
'Medienverwaltung',
'edit_posts',
'upload.php'
);
- add_submenu_page('edit.php',
- 'media',
- 'Statische Seiten',
- 'edit_posts',
- 'edit.php?post_type=page'
- );
-
- add_submenu_page('edit.php',
+ add_submenu_page('edit.php?post_type=page',
'comments',
'Kommentare',
'edit_posts',
'edit-comments.php'
);
+ add_submenu_page('edit.php?post_type=page',
+ 'Beiträge',
+ 'Beiträge',
+ 'edit_posts',
+ 'edit.php'
+ );
+
}
function bdp_add_menu_mein_lv() {
@@ -162,15 +155,13 @@ function bdp_cleanup_menu()
bdp_add_menu_security();
-
+ remove_submenu_page('edit.php?post_type=page','post-new.php?post_type=page');
remove_submenu_page('users.php','user-new.php');
remove_submenu_page('users.php','profile.php');
remove_submenu_page('edit.php','post-new.php');
remove_submenu_page('edit.php','edit-tags.php?taxonomy=category');
remove_submenu_page('edit.php','edit-tags.php?taxonomy=post_tag');
-
-
}
function bdp_create_menu_structure()
diff --git a/includes/setup.php b/includes/setup.php
index dd90c19..8e420bb 100644
--- a/includes/setup.php
+++ b/includes/setup.php
@@ -17,13 +17,14 @@ require_once BDP_LV_PLUGIN_DIR . 'includes/WpConfigEditor.class.php';
require_once (BDP_LV_PLUGIN_DIR . '/includes/filters.php');
require_once (BDP_LV_PLUGIN_DIR . '/lib/ics-parser/Event.php');
require_once (BDP_LV_PLUGIN_DIR . '/lib/ics-parser/ICal.php');
+
require_once (BDP_LV_PLUGIN_DIR . '/modules/seo/seo.php');
require_once (BDP_LV_PLUGIN_DIR . '/modules/calendar/calendar.php');
require_once (BDP_LV_PLUGIN_DIR . '/includes/frontend-functions.php');
require_once (BDP_LV_PLUGIN_DIR . '/modules/security/security.php');
-function admin_init()
+function kompass_admin_init()
{
kompass_settings_validators();
}
diff --git a/includes/spl.php b/includes/spl.php
index 5f3b398..935c455 100644
--- a/includes/spl.php
+++ b/includes/spl.php
@@ -19,7 +19,15 @@ spl_autoload_register(function ($className) {
require_once $fileName;
});
-$modules = ['LimitLoginAttempts', 'PasswordStrength'];
+
+$directoryPath = BDP_LV_PLUGIN_DIR . 'components/partials/';
+foreach (glob($directoryPath . '*.php') as $file) {
+ require_once $file;
+}
+
+
+
+$modules = ['KompassSettings', 'LimitLoginAttempts', 'PasswordStrength', 'seo'];
$subdirs = ['includes', 'Controllers', 'Views'];
foreach ($modules as $curModule) {
diff --git a/lang/bdp-kompass-de_DE.mo b/lang/bdp-kompass-de_DE.mo
index 829dbec..3aa3c7a 100644
Binary files a/lang/bdp-kompass-de_DE.mo and b/lang/bdp-kompass-de_DE.mo differ
diff --git a/lang/bdp-kompass_de_DE.mo b/lang/bdp-kompass_de_DE.mo
deleted file mode 100644
index 829dbec..0000000
Binary files a/lang/bdp-kompass_de_DE.mo and /dev/null differ
diff --git a/lang/bdp-kompass_de_DE.po b/lang/bdp-kompass_de_DE.po
index 3475c67..82c1ec4 100644
--- a/lang/bdp-kompass_de_DE.po
+++ b/lang/bdp-kompass_de_DE.po
@@ -1,3 +1,18 @@
+msgid "kompass"
+msgstr "kompass"
+
+msgid "SEO-Options"
+msgstr "Suchmaschinen-Einstellungen"
+
+msgid "Google Site verification"
+msgstr "Google Seiten-Verifikation"
+
+msgid "Bing Site verification"
+msgstr "Bing Seiten-Verifikation"
+
+msgid "Calendar Settings"
+msgstr "Kalender-Einstellungen"
+
msgid "Extended Security"
msgstr "Erweiterte Sicherheit"
diff --git a/modules/KompassSettings/Controllers/SettingsPage.php b/modules/KompassSettings/Controllers/SettingsPage.php
new file mode 100644
index 0000000..3566b5e
--- /dev/null
+++ b/modules/KompassSettings/Controllers/SettingsPage.php
@@ -0,0 +1,74 @@
+';
+ echo $showMessage;
+ echo '';
+ }
+ }
+
+ bdp_kompass_load_plugin_textdomain();
+
+ ?>
+
+
+
+ = __('kompass', BDP_LV_PLUGIN_SLUG); ?> - = __('Settings', BDP_LV_PLUGIN_SLUG); ?>
+
+ = kompass_settings_print_tab_header($tab); ?>
+
+
+ ';
+ do_settings_sections(BDP_LV_PLUGIN_SLUG . '-seo-settings');
+ submit_button();
+ echo '';
+ echo '';
+ break;
+ case 'tab2':
+ echo '';
+ break;
+ }
+ ?>
+
+
+ '.
+ '' .
+ __('Calendar Settings', BDP_LV_PLUGIN_SLUG) .
+ ''.
+ '' .
+ __('SEO', BDP_LV_PLUGIN_SLUG) .
+ ''.
+ '';
+ }
\ No newline at end of file
diff --git a/modules/LimitLoginAttempts/Views/text-element.php b/modules/LimitLoginAttempts/Views/text-element.php
deleted file mode 100644
index 2702e0c..0000000
--- a/modules/LimitLoginAttempts/Views/text-element.php
+++ /dev/null
@@ -1,7 +0,0 @@
-';
- if (defined('WP_DEBUG') && WP_DEBUG == true) {
- echo '
' . $settingName;
- }
-}
diff --git a/modules/LimitLoginAttempts/includes/gui_elements.php b/modules/LimitLoginAttempts/includes/gui_elements.php
index 39ccedd..e281d75 100644
--- a/modules/LimitLoginAttempts/includes/gui_elements.php
+++ b/modules/LimitLoginAttempts/includes/gui_elements.php
@@ -4,19 +4,7 @@ function custom_settings_section_callback() {
echo '';
}
-function _kompass_limit_logins_settings_callback(array $args) {
- $setting = get_option($args['setting'], null);
- if (null === $setting) {
- return;
- }
- $value = esc_attr($setting);
- if (isset($args['unit_division'])) {
- $value = (int)$value / (int)$args['unit_division'];
- }
-
- kompass_print_textbox($args['setting'], $value);
-}
function _kompass_limit_logins_settings_radio_callback(array $args)
{
@@ -35,6 +23,10 @@ add_settings_section(
BDP_LV_PLUGIN_SLUG . '-limit-login-attempts'
);
+
+
+
+
$settings_page = BDP_LV_PLUGIN_SLUG . '-limit-login-attempts';
@@ -45,7 +37,7 @@ add_settings_field(
'_kompass_limit_logins_settings_callback',
$settings_page,
'custom_settings_section',
- ['setting' => 'kompass_limit_login_allowed_retries']);
+ ['setting' => 'kompass_seo_google_verification']);
add_settings_field(
'kompass_lla_2',
@@ -110,3 +102,4 @@ add_settings_field(
$settings_page,
'custom_settings_section',
['setting' => 'kompass_limit_login_notify_email_after']);
+
diff --git a/modules/seo/Views/seo-form.php b/modules/seo/Views/seo-form.php
new file mode 100644
index 0000000..c9f5054
--- /dev/null
+++ b/modules/seo/Views/seo-form.php
@@ -0,0 +1,28 @@
+ 'kompass_seo_google_verification', 'style' => 'width: 500px']);
+
+
+add_settings_field(
+ 'kompass_seo_2',
+ __('Bing Site verification', BDP_LV_PLUGIN_SLUG),
+ '_kompass_limit_logins_settings_callback',
+ $seo_settings_page,
+ 'custom_settings_section',
+ ['setting' => 'kompass_seo_bing_verification', 'style' => 'width: 500px']);
\ No newline at end of file
diff --git a/modules/seo/classes/Seo.class.php b/modules/seo/classes/Seo.class.php
index 0997754..e83b48c 100644
--- a/modules/seo/classes/Seo.class.php
+++ b/modules/seo/classes/Seo.class.php
@@ -3,8 +3,34 @@
namespace Bdp\Modules\Seo;
class Seo
{
+ public static function importVerificationKeys() {
+ $aioseoSetting = get_option('aioseo_options', null);
+ if (null === $aioseoSetting) {
+ return;
+ }
+
+ if ('' !== $aioseoSetting && !is_object($aioseoSetting) && !is_array($aioseoSetting)){
+ $aioseoSetting = json_decode( $aioseoSetting );
+ }
+
+ if (!is_object($aioseoSetting) ||!isset($aioseoSetting->webmasterTools) ||!is_object($aioseoSetting->webmasterTools)) {
+ return;
+ }
+
+
+ $webmasterTools = $aioseoSetting->webmasterTools;
+ if ('' !== get_option('kompass_seo_google_verification', '')) {
+ update_option('kompass_seo_google_verification', $webmasterTools->google);
+ }
+
+ if ('' !== get_option('kompass_seo_bing_verification', '')) {
+ update_option('kompass_seo_bing_verification', $webmasterTools->bing);
+ }
+ }
+
public static function setup()
{
+
if (get_option('permalink_structure') === '') {
update_option('permalink_structure', '/%postname%/');
flush_rewrite_rules();
diff --git a/modules/seo/includes/meta.php b/modules/seo/includes/meta.php
new file mode 100644
index 0000000..0307483
--- /dev/null
+++ b/modules/seo/includes/meta.php
@@ -0,0 +1,12 @@
+' . "\n";
+ }
+
+ $bingVerification = get_option('kompass_seo_bing_verification', '');
+ if ('' !== $bingVerification) {
+ echo '' . "\n";
+ }
+}
\ No newline at end of file