diff --git a/.htaccess b/.htaccess index e2bbc23..fffb651 100644 --- a/.htaccess +++ b/.htaccess @@ -1,18 +1,11 @@ -DirectoryIndex index.php index.html -Options -Indexes -Options -MultiViews - +# BEGIN WordPress + RewriteEngine On - -# 0) Serve existing files/directories as-is -RewriteCond %{REQUEST_FILENAME} -f [OR] -RewriteCond %{REQUEST_FILENAME} -d -RewriteRule ^ - [L] - -# 1) Internal map: /page or /page/ -> /page.php (if such PHP file exists) -RewriteCond %{REQUEST_FILENAME}.php -f -RewriteRule ^(.+?)/?$ $1.php [L] - -# 2) Optional: strip trailing slash for non-directories (keeps .php links working) +RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] +RewriteBase / +RewriteRule ^index\.php$ - [L] +RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^(.+)/$ $1 [R=301,L] +RewriteRule . /index.php [L] + +# END WordPress diff --git a/admin_credentials.txt b/admin_credentials.txt index d888f1b..0b3db66 100644 --- a/admin_credentials.txt +++ b/admin_credentials.txt @@ -1,4 +1,4 @@ WordPress Admin Credentials: URL: http://localhost/wp-admin Username: admin -Password: c59u3v2geHuIQMRP +Password: fhOe6ID2XZCSv90hpS3c diff --git a/assets/pasted-20260807-151301-6b0583e6.jpg b/assets/pasted-20260807-151301-6b0583e6.jpg new file mode 100644 index 0000000..c8738ca Binary files /dev/null and b/assets/pasted-20260807-151301-6b0583e6.jpg differ diff --git a/assets/pasted-20260811-133449-0f742b1e.png b/assets/pasted-20260811-133449-0f742b1e.png new file mode 100644 index 0000000..a92afe6 Binary files /dev/null and b/assets/pasted-20260811-133449-0f742b1e.png differ diff --git a/assets/vm-shot-2026-08-07T15-12-51-552Z.jpg b/assets/vm-shot-2026-08-07T15-12-51-552Z.jpg new file mode 100644 index 0000000..c8738ca Binary files /dev/null and b/assets/vm-shot-2026-08-07T15-12-51-552Z.jpg differ diff --git a/wp-content/plugins/abc-leads/abc-leads.css b/wp-content/plugins/abc-leads/abc-leads.css new file mode 100644 index 0000000..1d0a164 --- /dev/null +++ b/wp-content/plugins/abc-leads/abc-leads.css @@ -0,0 +1,2 @@ +.abc-form-wrap{background:#fff;border:1px solid rgba(28,42,74,.12);box-shadow:0 24px 70px rgba(7,16,45,.12);border-radius:24px;padding:clamp(22px,4vw,38px);} +.abc-form{display:grid;gap:18px}.abc-grid-two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.abc-form label{font-weight:700;color:#102247;font-size:14px;display:grid;gap:8px}.abc-form input,.abc-form select,.abc-form textarea{width:100%;border:1px solid #d8deea;border-radius:12px;padding:13px 14px;font:inherit;background:#f8fafc;color:#102247}.abc-form textarea{resize:vertical}.abc-form button{border:0;border-radius:999px;background:#1646a0;color:#fff;font-weight:800;padding:15px 24px;cursor:pointer;box-shadow:0 14px 32px rgba(22,70,160,.25)}.abc-form button:hover{background:#0b2f78}.abc-checkbox{display:flex!important;grid-template-columns:auto 1fr;align-items:center;gap:10px!important}.abc-checkbox input{width:auto}.abc-form fieldset{border:1px solid #d8deea;border-radius:18px;padding:16px;display:grid;gap:10px}.abc-form legend{font-weight:800;color:#102247;padding:0 8px}.abc-form fieldset label{display:flex;gap:10px;align-items:center;font-weight:600}.abc-form fieldset input{width:auto}.abc-form-notice{border-radius:16px;padding:14px 16px;margin-bottom:18px;font-weight:700}.abc-success{background:#e9f8ef;color:#0d6533;border:1px solid #b8e6c8}.abc-error{background:#fff0f0;color:#8a1f1f;border:1px solid #ffc9c9}.abc-form-small{color:#5c6982;font-size:13px;margin:0}@media(max-width:720px){.abc-grid-two{grid-template-columns:1fr}.abc-form-wrap{padding:20px}} diff --git a/wp-content/plugins/abc-leads/abc-leads.php b/wp-content/plugins/abc-leads/abc-leads.php new file mode 100644 index 0000000..a63a821 --- /dev/null +++ b/wp-content/plugins/abc-leads/abc-leads.php @@ -0,0 +1,287 @@ + [ + 'name' => 'ABC Leads', + 'singular_name' => 'ABC Lead', + 'menu_name' => 'ABC Leads', + 'add_new_item' => 'Add Lead', + 'edit_item' => 'View Lead', + ], + 'public' => false, + 'show_ui' => true, + 'show_in_menu' => true, + 'menu_icon' => 'dashicons-chart-line', + 'supports' => ['title', 'editor', 'custom-fields'], + 'capability_type' => 'post', + ]); + } + + public static function assets() { + wp_enqueue_style('abc-leads', plugin_dir_url(__FILE__) . 'abc-leads.css', [], '1.0.0'); + } + + + private static function redirect_back($status) { + $url = wp_get_referer() ?: home_url('/contact/'); + $url = remove_query_arg(['abc_status'], $url); + wp_safe_redirect(add_query_arg('abc_status', $status, $url)); + exit; + } + + public static function handle_contact() { + if (!isset($_POST['abc_nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['abc_nonce'])), 'abc_contact')) { + self::redirect_back('invalid'); + } + $message = sanitize_textarea_field(wp_unslash($_POST['message'] ?? '')); + $fields = [ + 'name' => self::clean('name'), + 'company' => self::clean('company'), + 'email' => sanitize_email(wp_unslash($_POST['email'] ?? '')), + 'phone' => self::clean('phone'), + 'interest' => self::clean('interest'), + 'newsletter' => isset($_POST['newsletter']) ? 'Da' : 'Nu', + ]; + if (!$fields['name'] || !$fields['email']) { self::redirect_back('missing'); } + $saved = self::save_submission('Solicitare consultanță', $fields, $message); + self::redirect_back(is_wp_error($saved) ? 'error' : 'contact_success'); + } + + public static function handle_assessment() { + if (!isset($_POST['abc_nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['abc_nonce'])), 'abc_assessment')) { + self::redirect_back('invalid'); + } + $message = sanitize_textarea_field(wp_unslash($_POST['notes'] ?? '')); + $fields = [ + 'name' => self::clean('name'), + 'company' => self::clean('company'), + 'email' => sanitize_email(wp_unslash($_POST['email'] ?? '')), + 'company_size' => self::clean('company_size'), + 'request_source' => self::clean('request_source'), + 'topics' => self::clean('topics'), + 'timeline' => self::clean('timeline'), + ]; + if (!$fields['company'] || !$fields['email']) { self::redirect_back('missing'); } + $saved = self::save_submission('Evaluare ESG preliminară', $fields, $message); + self::redirect_back(is_wp_error($saved) ? 'error' : 'assessment_success'); + } + + private static function status_notice($context) { + $status = isset($_GET['abc_status']) ? sanitize_key(wp_unslash($_GET['abc_status'])) : ''; + if (!$status) { return ''; } + $messages = [ + 'invalid' => ['Nu am putut valida formularul. Vă rugăm să încercați din nou.', 'error'], + 'missing' => ['Completați câmpurile obligatorii marcate cu *.', 'error'], + 'error' => ['A apărut o eroare la trimitere. Vă rugăm să încercați din nou.', 'error'], + 'contact_success' => ['Mulțumim. Solicitarea a fost înregistrată — vă vom contacta pentru discuția inițială.', 'success'], + 'assessment_success' => ['Evaluarea preliminară a fost trimisă. Vom reveni cu pașii recomandați pentru organizarea ESG.', 'success'], + ]; + if (!isset($messages[$status])) { return ''; } + [$msg, $type] = $messages[$status]; + return self::notice($msg, $type); + } + + private static function clean($key) { + if (!isset($_POST[$key])) { return ''; } + if (is_array($_POST[$key])) { + return array_map('sanitize_text_field', wp_unslash($_POST[$key])); + } + return sanitize_text_field(wp_unslash($_POST[$key])); + } + + private static function save_submission($type, $fields, $message = '') { + $name = $fields['name'] ?? ''; + $company = $fields['company'] ?? ''; + $email = $fields['email'] ?? ''; + $title = trim($type . ' — ' . ($company ?: $name ?: $email ?: current_time('mysql'))); + $content = $message ? wp_kses_post($message) : ''; + $post_id = wp_insert_post([ + 'post_type' => self::CPT, + 'post_status' => 'private', + 'post_title' => $title, + 'post_content' => $content, + ], true); + if (is_wp_error($post_id)) { return $post_id; } + update_post_meta($post_id, '_abc_type', $type); + foreach ($fields as $key => $value) { + update_post_meta($post_id, '_abc_' . sanitize_key($key), is_array($value) ? implode(', ', $value) : $value); + } + update_post_meta($post_id, '_abc_submitted_at', current_time('mysql')); + return $post_id; + } + + private static function notice($text, $type = 'success') { + return '
' . esc_html($text) . '
'; + } + + public static function contact_form() { + $notice = self::status_notice('contact'); + if (false && $_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['abc_form_type']) && $_POST['abc_form_type'] === 'contact') { + if (!isset($_POST['abc_nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['abc_nonce'])), 'abc_contact')) { + $notice = self::notice('Nu am putut valida formularul. Vă rugăm să încercați din nou.', 'error'); + } else { + $message = sanitize_textarea_field(wp_unslash($_POST['message'] ?? '')); + $fields = [ + 'name' => self::clean('name'), + 'company' => self::clean('company'), + 'email' => sanitize_email(wp_unslash($_POST['email'] ?? '')), + 'phone' => self::clean('phone'), + 'interest' => self::clean('interest'), + 'newsletter' => isset($_POST['newsletter']) ? 'Da' : 'Nu', + ]; + if (!$fields['name'] || !$fields['email']) { + $notice = self::notice('Completați cel puțin numele și adresa de email.', 'error'); + } else { + $saved = self::save_submission('Solicitare consultanță', $fields, $message); + $notice = is_wp_error($saved) + ? self::notice('A apărut o eroare la trimitere. Vă rugăm să încercați din nou.', 'error') + : self::notice('Mulțumim. Solicitarea a fost înregistrată — vă vom contacta pentru discuția inițială.'); + } + } + } + ob_start(); ?> +
+ +
+ + + +
+ + + + +
+ + + + +

Răspunsurile sunt salvate securizat în zona de administrare WordPress pentru follow-up.

+
+
+ self::clean('name'), + 'company' => self::clean('company'), + 'email' => sanitize_email(wp_unslash($_POST['email'] ?? '')), + 'company_size' => self::clean('company_size'), + 'request_source' => self::clean('request_source'), + 'topics' => self::clean('topics'), + 'timeline' => self::clean('timeline'), + ]; + if (!$fields['company'] || !$fields['email']) { + $notice = self::notice('Completați cel puțin compania și adresa de email.', 'error'); + } else { + $saved = self::save_submission('Evaluare ESG preliminară', $fields, $message); + $notice = is_wp_error($saved) + ? self::notice('A apărut o eroare la trimitere. Vă rugăm să încercați din nou.', 'error') + : self::notice('Evaluarea preliminară a fost trimisă. Vom reveni cu pașii recomandați pentru organizarea ESG.'); + } + } + } + ob_start(); ?> +
+ +
+ + + +
+ + + + +
+ +
Ce informații trebuie organizate? + + + + + +
+ + + +
+
+ $columns['cb'], + 'title' => 'Lead', + 'abc_type' => 'Tip', + 'abc_company' => 'Companie', + 'abc_email' => 'Email', + 'date' => 'Data', + ]; + } + + public static function column_content($column, $post_id) { + $map = [ + 'abc_type' => '_abc_type', + 'abc_company' => '_abc_company', + 'abc_email' => '_abc_email', + ]; + if (isset($map[$column])) { + echo esc_html(get_post_meta($post_id, $map[$column], true)); + } + } + + public static function sortable_columns($columns) { + $columns['abc_type'] = 'abc_type'; + return $columns; + } +} +ABC_Leads_Plugin::init(); diff --git a/wp-content/themes/twentytwentyfour/parts/footer.html b/wp-content/themes/twentytwentyfour/parts/footer.html index c21388e..5b5e41f 100644 --- a/wp-content/themes/twentytwentyfour/parts/footer.html +++ b/wp-content/themes/twentytwentyfour/parts/footer.html @@ -1 +1,16 @@ - + + + diff --git a/wp-content/themes/twentytwentyfour/parts/header.html b/wp-content/themes/twentytwentyfour/parts/header.html index 2fa483b..325eb94 100644 --- a/wp-content/themes/twentytwentyfour/parts/header.html +++ b/wp-content/themes/twentytwentyfour/parts/header.html @@ -1,26 +1,16 @@ - -
- -
- -
- - - -
- -
- -
- - - -
- -
- -
- -
- \ No newline at end of file + +
+
+
+ + + + + + + + + +
+
+