| Server IP : 85.112.90.236 / Your IP : 192.168.1.26 Web Server : Apache System : Linux 85-112-90-236.cprapid.com 6.12.0-211.7.3.el10_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 12:46:58 EDT 2026 x86_64 User : ftechme ( 1002) PHP Version : 8.2.32 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/ftechme/public_html/wp-content/mu-plugins/ |
Upload File : |
<?php
/**
* Plugin Name: Faisal Technology — Schema enrichment
* Description: Extends Yoast's schema @graph with LocalBusiness, Person, and Service nodes.
* Author: Roy (OpenClaw)
* Version: 1.0.0
*/
if (!defined('ABSPATH')) {
exit;
}
/**
* Promote the Yoast Organization node to also be a LocalBusiness and add
* contact + service-area details so search engines treat it as a local IT/
* photography business in Lebanon.
*/
add_filter('wpseo_schema_organization', function ($data) {
$types = (array) ($data['@type'] ?? 'Organization');
if (!in_array('LocalBusiness', $types, true)) {
$types[] = 'LocalBusiness';
}
$data['@type'] = array_values(array_unique($types));
$data['telephone'] = '+96171965269';
$data['email'] = 'faisalmalaeb@gmail.com';
$data['priceRange'] = '$$';
$data['areaServed'] = [
'@type' => 'Country',
'name' => 'Lebanon',
];
$data['address'] = [
'@type' => 'PostalAddress',
'addressCountry' => 'LB',
'addressLocality'=> 'Lebanon',
];
$data['knowsAbout'] = [
'IT Services',
'Networking',
'System Administration',
'Photography',
];
return $data;
});
/**
* Add a Person node for Faisal Malaeb (founder) and Service nodes on the
* IT-services and photography pages, connected into the same graph.
*/
add_filter('wpseo_schema_graph', function ($graph, $context) {
if (!is_array($graph)) {
return $graph;
}
$site = trailingslashit(home_url());
$org_id = $site . '#organization';
$person_id = $site . '#/schema/person/faisal-malaeb';
// Person (founder).
$graph[] = [
'@type' => 'Person',
'@id' => $person_id,
'name' => 'Faisal Malaeb',
'jobTitle' => 'IT Specialist & Photographer',
'worksFor' => ['@id' => $org_id],
'knowsAbout' => ['Networking', 'IT Support', 'Photography'],
'url' => $site,
];
// Service nodes by current page slug.
$slug = '';
if (is_page()) {
$post = get_queried_object();
$slug = $post && isset($post->post_name) ? $post->post_name : '';
}
$services = [
'it-services' => [
'name' => 'IT Services & Networking',
'description' => 'Networking, system setup, technical support, and IT infrastructure solutions for businesses and homes in Lebanon.',
'type' => 'IT Services',
],
'it-services-2' => [
'name' => 'خدمات تقنية المعلومات والشبكات',
'description' => 'تركيب وإدارة الشبكات، إعداد الأنظمة، الدعم الفني، وحلول البنية التحتية للشركات والمنازل في لبنان.',
'type' => 'IT Services',
],
'photography' => [
'name' => 'Photography Services',
'description' => 'Professional nature, wildlife, and event photography by Faisal Malaeb.',
'type' => 'Photography',
],
'photography-2' => [
'name' => 'خدمات التصوير الاحترافي',
'description' => 'تصوير احترافي للطبيعة والحياة البرية والمناسبات بعدسة فيصل ملاعب.',
'type' => 'Photography',
],
];
if ($slug && isset($services[$slug])) {
$s = $services[$slug];
$graph[] = [
'@type' => 'Service',
'@id' => $site . '#/schema/service/' . $slug,
'name' => $s['name'],
'description' => $s['description'],
'serviceType' => $s['type'],
'provider' => ['@id' => $org_id],
'areaServed' => ['@type' => 'Country', 'name' => 'Lebanon'],
];
}
return $graph;
}, 10, 2);