<?php /** * Plugin Name: OpenRyd Runtime Fixes 20260530 * Description: Runtime fixes for OpenRyd mobile layout, RFQ link routing, and public REST hardening. * Version: 1.1.6 * Author: OpenRyd Ops */ if (!defined('ABSPATH')) { exit; } add_filter('pre_get_document_title', function ($title) { if (is_front_page() || is_home()) { return 'E-Bike Accessories Sourcing for Retail Buyers | OpenRyd'; } return $title; }, 99); add_filter('document_title_parts', function ($parts) { if (is_front_page() || is_home()) { $parts['title'] = 'E-Bike Accessories Sourcing for Retail Buyers'; $parts['site'] = 'OpenRyd'; } return $parts; }, 99); add_action('wp_head', function () { if (!(is_front_page() || is_home()) || is_admin()) { return; } echo "\n" . '<meta name="openryd-weekly-optimization" content="2026-06-01-phase-1" />' . "\n"; }, 1); // OpenRyd single-language cleanup 2026-06-05. add_action('template_redirect', function () { if (is_admin() || wp_doing_ajax() || wp_is_json_request()) { return; } $path = parse_url($_SERVER['REQUEST_URI'] ?? '', PHP_URL_PATH); if ($path === '/zh' || $path === '/zh/' || strpos($path, '/zh/') === 0) { $target = preg_replace('#^/zh/?#', '/', $path); $target = $target ?: '/'; header_remove('Pragma'); header_remove('Expires'); header_remove('Cache-Control'); header_remove('Set-Cookie'); header('Cache-Control: public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400'); wp_redirect(home_url($target), 301); exit; } }, 0); add_action('template_redirect', function () { if (is_admin() || wp_doing_ajax() || wp_is_json_request()) { return; } ob_start(function ($html) { $html = preg_replace('/<link[^>]+hreflang=(["\'])zh\1[^>]*>\s*/i', '', $html); $html = preg_replace('/<link[^>]+href=(["\'])https?:\/\/openryd\.com\/zh\/[^"\']*\1[^>]*>\s*/i', '', $html); return $html; }); }, 0); // OpenRyd public cache header fix 2026-06-05. add_action('send_headers', function () { if (is_admin() || is_user_logged_in() || wp_doing_ajax() || wp_is_json_request()) { return; } $method = $_SERVER['REQUEST_METHOD'] ?? 'GET'; if (!in_array($method, array('GET', 'HEAD'), true)) { return; } if (is_search() || is_preview() || is_404()) { return; } $path = parse_url($_SERVER['REQUEST_URI'] ?? '', PHP_URL_PATH); if (preg_match('#^/(wp-admin|wp-login\.php|wp-json|cart|checkout|my-account)(/|$)#', $path)) { return; } if (function_exists('is_cart') && (is_cart() || is_checkout() || is_account_page())) { return; } header_remove('Pragma'); header_remove('Expires'); header_remove('Cache-Control'); header_remove('Set-Cookie'); header('Cache-Control: public, max-age=600, s-maxage=3600, stale-while-revalidate=86400'); }, PHP_INT_MAX); // OpenRyd P0 resource SEO fixes 2026-06-05. function openryd_resource_seo_data_20260605() { return array( 'e-bike-accessory-wholesale-checklist' => array('title' => 'E-Bike Accessory Wholesale Checklist for Retailers', 'description' => 'Use this e-bike accessory wholesale checklist to prepare product categories, samples, OEM packaging, quantities and RFQ details before contacting OpenRyd.', 'url' => 'https://openryd.com/e-bike-accessory-wholesale-checklist/'), 'mixed-e-bike-accessory-order-retail-stores' => array('title' => 'How to Build a Mixed E-Bike Accessory Order for Retail Stores', 'description' => 'Learn how retail stores and e-bike shops can plan a mixed e-bike accessory order with lights, mounts, bags, locks, tools, sample checks, packaging needs and RFQ details.', 'url' => 'https://openryd.com/mixed-e-bike-accessory-order-retail-stores/'), ); } add_action('template_redirect', function () { if (is_admin() || wp_doing_ajax() || wp_is_json_request()) { return; } $path = parse_url($_SERVER['REQUEST_URI'] ?? '', PHP_URL_PATH); if (rtrim($path, '/') === '/repair-tools-pumps') { wp_redirect(home_url('/protection-tools/'), 301); exit; } }, 1); add_action('wp_head', function () { if (is_admin() || !is_single()) { return; } $post = get_post(); if (!$post) { return; } $data = openryd_resource_seo_data_20260605(); if (empty($data[$post->post_name])) { return; } $item = $data[$post->post_name]; echo "\n" . '<meta name="description" content="' . esc_attr($item['description']) . '" />' . "\n"; echo '<meta property="og:title" content="' . esc_attr($item['title']) . '" />' . "\n"; echo '<meta property="og:description" content="' . esc_attr($item['description']) . '" />' . "\n"; echo '<meta property="og:url" content="' . esc_url($item['url']) . '" />' . "\n"; echo '<meta name="twitter:card" content="summary_large_image" />' . "\n"; echo '<meta name="twitter:title" content="' . esc_attr($item['title']) . '" />' . "\n"; echo '<meta name="twitter:description" content="' . esc_attr($item['description']) . '" />' . "\n"; }, 2); add_action('template_redirect', function () { if (is_admin() || wp_doing_ajax() || wp_is_json_request()) { return; } ob_start(function ($html) { $data = openryd_resource_seo_data_20260605(); foreach ($data as $slug => $item) { if (strpos($html, 'single-post') === false || strpos($html, $slug) === false) { continue; } $title = preg_quote($item['title'], '/'); $html = preg_replace('/<h2([^>]*)>\s*' . $title . '\s*<\/h2>/i', '<h1$1>' . esc_html($item['title']) . '</h1>', $html, 1); $html = str_replace('/repair-tools-pumps/', '/protection-tools/', $html); } return $html; }); }, 2); // OpenRyd product schema offer fix 2026-06-06. function openryd_find_product_id_from_page_woocommerce_markers_20260606($page_id) { if (!$page_id || !function_exists('get_post')) { return 0; } $post = get_post((int) $page_id); if (!$post || $post->post_type !== 'page') { return 0; } $content = get_post_field('post_content', $post->ID, 'raw'); if (!is_string($content)) { return 0; } $patterns = array( '/add-to-cart=([1-9]\\d*)/i', '/product_id=([1-9]\\d*)/i', '/id=([1-9]\\d*).*data-product_id/i', ); foreach ($patterns as $pattern) { if (preg_match($pattern, $content, $matches) && !empty($matches[1])) { return (int) $matches[1]; } } return 0; } function openryd_product_offer_for_structured_data_20260606($product) { $candidate_url = ''; if (is_string($product)) { $candidate_url = preg_replace('/#.*/', '', trim($product)); } elseif ($product && is_object($product) && method_exists($product, 'get_permalink')) { $candidate_url = (string) $product->get_permalink(); } if (!is_string($candidate_url) || $candidate_url === '') { $candidate_url = home_url($_SERVER['REQUEST_URI'] ?? '/'); } if (is_string($product)) { if (is_numeric($product)) { if (function_exists('wc_get_product')) { $product = wc_get_product((int) $product); } } else { $candidate = 0; if (function_exists('url_to_postid')) { $candidate = (int) url_to_postid($product); } if ($candidate <= 0 && function_exists('wp_parse_url')) { $path = wp_parse_url($product, PHP_URL_PATH); if (is_string($path) && $path !== '') { $segments = array_filter(explode('/', trim($path, '/'))); if (!empty($segments)) { $slug = end($segments); $candidate_post = get_page_by_path($slug, OBJECT, array('product', 'product_variation')); if (!$candidate_post) { $candidate_post = get_page_by_path($slug, OBJECT, 'product'); } if ($candidate_post) { $candidate = (int) $candidate_post->ID; } } } } if ($candidate > 0) { $candidate_post = get_post($candidate); if ($candidate_post && in_array($candidate_post->post_type, array('product', 'product_variation'), true)) { if (function_exists('wc_get_product')) { $product = wc_get_product($candidate); } } else { $product_id = openryd_find_product_id_from_page_woocommerce_markers_20260606($candidate); if ($product_id > 0) { if (function_exists('wc_get_product')) { $product = wc_get_product($product_id); } } } } } } elseif (!$product && function_exists('get_the_ID') && function_exists('wc_get_product')) { $product = wc_get_product((int) get_the_ID()); } if (!$product || !is_object($product)) { if (!function_exists('esc_url_raw')) { return array(); } return array( '@type' => 'Offer', 'url' => esc_url_raw($candidate_url), 'priceCurrency' => 'USD', 'price' => '0.00', 'availability' => 'https://schema.org/InStock', ); } if (!function_exists('wc_get_price_to_display')) { $price = '0.00'; } else { $price = wc_get_price_to_display($product); } if (!is_numeric($price) || (float) $price <= 0) { $price = '0.00'; } else { $price = number_format((float) $price, 2, '.', ''); } $currency = 'USD'; if (function_exists('get_woocommerce_currency')) { $currency = get_woocommerce_currency() ?: 'USD'; } $stock = ''; if (method_exists($product, 'get_stock_status')) { $stock = strtolower((string) $product->get_stock_status()); } if ($stock === 'outofstock') { $availability = 'https://schema.org/OutOfStock'; } elseif ($stock === 'onbackorder') { $availability = 'https://schema.org/PreOrder'; } else { $availability = 'https://schema.org/InStock'; } return array( '@type' => 'Offer', 'url' => esc_url_raw($product->get_permalink()), 'priceCurrency' => $currency, 'price' => (string) $price, 'availability' => $availability, ); } function openryd_20260606_product_type_is_product($type) { if ($type === 'Product') { return true; } if (is_array($type) && in_array('Product', $type, true)) { return true; } return false; } function openryd_product_graph_node_has_offer_or_review($node) { return !empty($node['offers']) || !empty($node['review']) || !empty($node['aggregateRating']); } function openryd_patch_product_graph_node_20260606(&$node, $candidate_url) { if (!is_array($node) || !openryd_20260606_product_type_is_product($node['@type'] ?? '')) { return false; } if (openryd_product_graph_node_has_offer_or_review($node)) { return false; } $candidate = $candidate_url; if (!empty($node['url']) && is_string($node['url'])) { $candidate = $node['url']; } elseif (!empty($node['@id']) && is_string($node['@id'])) { $candidate = $node['@id']; } $offer = openryd_product_offer_for_structured_data_20260606($candidate); if (!$offer) { return false; } $node['offers'] = $offer; return true; } function openryd_mutate_graph_product_nodes_20260606(&$graph, $candidate_url) { $changed = false; if (!is_array($graph)) { return false; } if (isset($graph['@graph']) && is_array($graph['@graph'])) { foreach ($graph['@graph'] as &$graph_node) { if (openryd_patch_product_graph_node_20260606($graph_node, $candidate_url)) { $changed = true; } } return $changed; } if (openryd_patch_product_graph_node_20260606($graph, $candidate_url)) { return true; } return false; } // openryd debug probe 20260606 add_action('wp_head', function () { echo "<meta name=\"openryd-probe-20260606\" content=\"product-page-hook\" />"; }, 5); add_filter('woocommerce_structured_data_product', function ($markup, $product) { if (!is_array($markup) || empty($markup)) { return $markup; } if (!openryd_20260606_product_type_is_product($markup['@type'] ?? '')) { return $markup; } if (openryd_product_graph_node_has_offer_or_review($markup)) { return $markup; } $offer = openryd_product_offer_for_structured_data_20260606($product); if (!$offer) { return $markup; } $markup['offers'] = $offer; return $markup; }, 20, 2); add_action('template_redirect', function () { if (is_admin() || wp_doing_ajax() || wp_is_json_request()) { return; } ob_start(function ($html) { if (strpos($html, 'application/ld+json') === false) { return $html; } $page_url = home_url($_SERVER['REQUEST_URI'] ?? ''); return preg_replace_callback( '/<script[^>]+type=["\']application\/ld\+json["\'][^>]*>(.*?)<\/script>/is', function ($matches) use ($page_url) { $body = trim($matches[1]); if (!$body) { return $matches[0]; } $graph = json_decode($body, true); if (!is_array($graph) || empty($graph)) { return $matches[0]; } $open = stripos($matches[0], '<script'); $close = strripos($matches[0], '>'); if ($open === false || $close === false) { return $matches[0]; } $tag_head = substr($matches[0], 0, $close + 1); $changed = openryd_mutate_graph_product_nodes_20260606($graph, $page_url); if (!$changed) { return $matches[0]; } return $tag_head . wp_json_encode($graph, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . '</script>'; }, $html ); }); }, 3); function openryd_is_product_like_page_20260606() { if (is_admin() || !is_singular()) { return false; } $post = get_post(); if (!$post || !$post->ID) { return false; } $post_content = get_post_field('post_content', $post->ID, 'raw'); if (!is_string($post_content)) { return false; } if (strpos($post_content, 'openryd-pdp-reset-') !== false) { return true; } if (preg_match('/\/products\//', parse_url($_SERVER['REQUEST_URI'] ?? '', PHP_URL_PATH))) { return true; } $title = strtolower((string) get_the_title($post->ID)); if (!$title) { return false; } return (bool) preg_match('/(light|lamp|kit|bike|bike light|mount|lock|bag|pump|tool|charger|battery|handlebar|accessory|cycle|e-bike)/i', $title); } add_action('wp_head', function () { if (is_admin() || wp_doing_ajax() || is_feed() || is_404()) { return; } if (!openryd_is_product_like_page_20260606()) { return; } if (!is_single() && !is_page()) { return; } $post = get_post(); if (!$post || !is_string($post->post_title)) { return; } $page_url = home_url($_SERVER['REQUEST_URI'] ?? '/'); $offer = openryd_product_offer_for_structured_data_20260606($page_url); echo '<meta name="openryd-offer-avail" content="' . ($offer ? '1' : '0') . '" />'; if (!$offer) { return; } $title = wp_strip_all_tags($post->post_title); $description = ''; if (!empty($post->post_excerpt)) { $description = wp_strip_all_tags($post->post_excerpt); } else { $description = wp_strip_all_tags($post->post_content); } if (strlen($description) > 260) { $description = mb_substr($description, 0, 260); } if ($description === '') { $description = 'OpenRyd product page.'; } $product_schema = array( '@context' => 'https://schema.org', '@graph' => array( array( '@type' => 'Product', '@id' => rtrim($page_url, '/') . '#product', 'name' => $title, 'url' => $page_url, 'description' => $description, 'brand' => array( '@type' => 'Brand', 'name' => 'OpenRyd', ), 'image' => wp_get_attachment_url(get_post_thumbnail_id($post->ID)), 'offers' => $offer, ), ), ); if (!empty($offer['price']) && !empty($offer['priceCurrency'])) { $product_schema['@graph'][0]['offers']['price'] = (string) $offer['price']; $product_schema['@graph'][0]['offers']['priceCurrency'] = (string) $offer['priceCurrency']; } echo '<script type="application/ld+json" id="openryd-product-offer-fix-20260606">' . wp_json_encode($product_schema, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . '</script>' . PHP_EOL; }, 20); add_filter('rest_endpoints', function ($endpoints) { if (!is_user_logged_in()) { unset($endpoints['/wp/v2/users']); unset($endpoints['/wp/v2/users/(?P<id>[\\d]+)']); } return $endpoints; }, 20); add_action('wp_head', function () { if (is_admin()) { return; } ?> <style id="openryd-runtime-fixes-20260530-css"> @media (max-width: 640px) { html, body { width: 100% !important; max-width: 100% !important; overflow-x: hidden !important; } body.home header.nav .nav-inner { width: calc(100% - 28px) !important; max-width: calc(100% - 28px) !important; overflow: hidden !important; } body.home header.nav .brand img { max-width: 178px !important; } body.home header.nav .menu { display: flex !important; width: 100% !important; max-width: 100% !important; gap: 14px !important; overflow-x: auto !important; overflow-y: hidden !important; padding: 8px 0 0 !important; height: auto !important; white-space: nowrap !important; -webkit-overflow-scrolling: touch !important; } body.home header.nav .menu > a, body.home header.nav .or-nav-link, body.home header.nav .or-mega-item { height: 34px !important; min-height: 34px !important; display: inline-flex !important; align-items: center !important; font-size: 13px !important; flex: 0 0 auto !important; } body.home header.nav .mega-menu { display: none !important; } body.home header.nav .or-nav-search { width: 100% !important; max-width: 100% !important; } body.home .or-hero { min-height: 0 !important; overflow: hidden !important; } body.home .or-hero .or-wrap { width: 100% !important; max-width: 100% !important; min-height: 0 !important; padding-left: 14px !important; padding-right: 14px !important; display: block !important; } body.home .or-hero-copy { width: 100% !important; max-width: calc(100vw - 28px) !important; padding: 44px 0 34px !important; } body.home .or-hero-copy * { max-width: 100% !important; } body.home .or-hero h1 { width: 100% !important; max-width: calc(100vw - 28px) !important; font-size: 28px !important; line-height: 1.14 !important; white-space: normal !important; overflow-wrap: normal !important; word-break: normal !important; hyphens: none !important; } body.home .or-hero p { max-width: calc(100vw - 28px) !important; font-size: 15px !important; line-height: 1.55 !important; } body.home .or-btns { display: grid !important; grid-template-columns: 1fr !important; width: 100% !important; gap: 10px !important; } body.home .or-btn { width: 100% !important; min-width: 0 !important; padding-left: 12px !important; padding-right: 12px !important; } body.home .or-chip-row { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px 12px !important; margin-top: 24px !important; } body.home .or-chip { min-width: 0 !important; font-size: 12px !important; } body.home .or-side-title h2 { font-size: 26px !important; line-height: 1.14 !important; white-space: normal !important; overflow-wrap: anywhere !important; } body.home { overflow-x: hidden !important; } body.home .or-hero, body.home .or-hero .or-wrap, body.home .or-hero-copy { box-sizing: border-box !important; max-width: 100vw !important; } body.home .or-hero-copy { max-width: 310px !important; width: 310px !important; } body.home .or-hero h1 { display: block !important; max-width: 310px !important; width: 310px !important; font-size: 24px !important; line-height: 1.18 !important; letter-spacing: 0 !important; white-space: normal !important; overflow-wrap: anywhere !important; word-break: normal !important; } body.home .or-hero p { max-width: 310px !important; width: 310px !important; font-size: 14px !important; } body.home .or-btns { max-width: 310px !important; width: 310px !important; grid-template-columns: 1fr !important; } body.home .or-btns .or-btn { width: 310px !important; max-width: 310px !important; } body.home .or-side-title h2 { max-width: 330px !important; width: 330px !important; } } .openryd-map-replacement{min-height:420px;background:#0a241d;color:#fff;border-radius:8px;padding:34px;display:flex;flex-direction:column;justify-content:center;gap:14px;border:1px solid rgba(255,255,255,.08)} .openryd-map-replacement h3{margin:0;color:#fff;font-size:28px;line-height:1.12} .openryd-map-replacement p{margin:0;color:#cfe1db;line-height:1.6} .openryd-map-replacement ul{margin:8px 0 0;padding:0;list-style:none;display:grid;gap:10px} .openryd-map-replacement li{padding-left:20px;position:relative;color:#e7f2ee;font-weight:700} .openryd-map-replacement li:before{content:"";width:8px;height:8px;border-radius:50%;background:#14a873;position:absolute;left:0;top:.55em} @media (max-width:640px){.openryd-map-replacement{min-height:0;padding:24px}.openryd-map-replacement h3{font-size:24px}} /* OpenRyd weekly optimization 2026-06-01 */ body.home .or-hero h1{max-width:680px!important;letter-spacing:0!important} body.home .or-btns .or-btn{white-space:normal!important;text-align:center!important} body.home .or-chip-row{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))!important;align-items:stretch!important} body.home .or-chip{justify-content:flex-start!important;min-height:36px!important} @media (max-width:640px){ body.home .or-hero h1{max-width:320px!important;width:320px!important;font-size:24px!important;line-height:1.16!important;overflow-wrap:anywhere!important} body.home .or-hero p{max-width:320px!important;width:320px!important} body.home .or-btns{max-width:320px!important;width:320px!important;grid-template-columns:1fr!important} body.home .or-btns .or-btn{max-width:320px!important;width:320px!important} body.home .or-chip-row{max-width:320px!important;width:320px!important;grid-template-columns:1fr!important;gap:8px!important} } /* OpenRyd resource article mobile polish 2026-06-01 */ /* OpenRyd resource article mobile polish 2026-06-05: applies to current resource posts. */ body.single-post:is(.postid-1135,.postid-1145), body.single-post:is(.postid-1135,.postid-1145) #page, body.single-post:is(.postid-1135,.postid-1145) #content{overflow-x:hidden!important} body.single-post:is(.postid-1135,.postid-1145) .wf_pagetitle .wf-container, body.single-post:is(.postid-1135,.postid-1145) #wf_posts .wf-container, body.single-post:is(.postid-1135,.postid-1145) #wf_posts .wf-row, body.single-post:is(.postid-1135,.postid-1145) article.single-post, body.single-post:is(.postid-1135,.postid-1145) article.single-post .inner, body.single-post:is(.postid-1135,.postid-1145) article.single-post .content{box-sizing:border-box!important;max-width:100%!important;min-width:0!important} body.single-post:is(.postid-1135,.postid-1145) article.single-post .content{font-size:16px;line-height:1.72} body.single-post:is(.postid-1135,.postid-1145) article.single-post .content p{margin-bottom:18px} body.single-post:is(.postid-1135,.postid-1145) article.single-post .content h2{line-height:1.2;margin-top:34px;margin-bottom:14px} body.single-post:is(.postid-1135,.postid-1145) article.single-post .content ul{padding-left:22px} body.single-post:is(.postid-1135,.postid-1145) article.single-post .wp-block-table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch} body.single-post:is(.postid-1135,.postid-1145) article.single-post .wp-block-table table{min-width:720px} body.single-post:is(.postid-1135,.postid-1145) article.single-post .wp-block-group{box-sizing:border-box;max-width:100%} @media (max-width:980px){ body.single-post:is(.postid-1135,.postid-1145) .wf_pagetitle .wf-container, body.single-post:is(.postid-1135,.postid-1145) #wf_posts .wf-container{width:280px!important;max-width:280px!important;margin-left:auto!important;margin-right:auto!important;padding-left:0!important;padding-right:0!important} body.single-post:is(.postid-1135,.postid-1145) #wf_posts .wf-row, body.single-post:is(.postid-1135,.postid-1145) #wf_posts [class*="wf-col"], body.single-post:is(.postid-1135,.postid-1145) #comments{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;flex:0 0 100%!important;margin-left:0!important;margin-right:0!important;padding-left:0!important;padding-right:0!important;box-sizing:border-box!important} body.single-post:is(.postid-1135,.postid-1145) article.single-post, body.single-post:is(.postid-1135,.postid-1145) article.single-post .inner, body.single-post:is(.postid-1135,.postid-1145) article.single-post .content{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;margin-left:0!important;margin-right:0!important;padding-left:0!important;padding-right:0!important;box-sizing:border-box!important} body.single-post:is(.postid-1135,.postid-1145) .wf_pagetitle_content .title h2, body.single-post:is(.postid-1135,.postid-1145) article.single-post .title{white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;letter-spacing:0!important} body.single-post:is(.postid-1135,.postid-1145) .wf_pagetitle_content .title h2{display:block!important;width:100%!important;max-width:280px!important;margin-left:auto!important;margin-right:auto!important;font-size:25px!important;line-height:1.18!important;text-align:center!important} body.single-post:is(.postid-1135,.postid-1145) article.single-post .title{display:block!important;width:100%!important;max-width:100%!important;font-size:27px!important;line-height:1.18!important;text-align:left!important} body.single-post:is(.postid-1135,.postid-1145) article.single-post .meta ul{display:flex!important;flex-wrap:wrap!important;gap:10px 16px!important;padding-left:0!important} body.single-post:is(.postid-1135,.postid-1145) article.single-post .meta li{max-width:100%!important;white-space:normal!important} body.single-post:is(.postid-1135,.postid-1145) article.single-post .content, body.single-post:is(.postid-1135,.postid-1145) article.single-post .content *{max-width:100%!important;overflow-wrap:anywhere!important;word-break:normal!important} body.single-post:is(.postid-1135,.postid-1145) article.single-post .content > *{width:100%!important;box-sizing:border-box!important} body.single-post:is(.postid-1135,.postid-1145) article.single-post .content p, body.single-post:is(.postid-1135,.postid-1145) article.single-post .content li{white-space:normal!important} body.single-post:is(.postid-1135,.postid-1145) article.single-post .content h2{font-size:26px!important;line-height:1.22!important} body.single-post:is(.postid-1135,.postid-1145) article.single-post .wp-block-button__link{white-space:normal!important;text-align:center!important} body.single-post:is(.postid-1135,.postid-1145) .wf_pagetitle_breadcrumb{display:flex!important;justify-content:center!important;flex-wrap:wrap!important;gap:6px!important;padding-left:0!important} body.single-post:is(.postid-1135,.postid-1145) .wf_pagetitle_breadcrumb .breadcrumb-item.active{max-width:220px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important} } @media (max-width:420px){ body.single-post:is(.postid-1135,.postid-1145) .wf_pagetitle_content .title h2{font-size:26px!important} body.single-post:is(.postid-1135,.postid-1145) article.single-post .title{font-size:25px!important} body.single-post:is(.postid-1135,.postid-1145) article.single-post .content h2{font-size:24px!important} } /* OpenRyd resource mobile grid reset 2026-06-05 */ @media (max-width:980px){ body.single-post:is(.postid-1135,.postid-1145) #wf_posts, body.single-post:is(.postid-1135,.postid-1145) #wf_posts .wf-container, body.single-post:is(.postid-1135,.postid-1145) #wf_posts .wf-row, body.single-post:is(.postid-1135,.postid-1145) #wf_posts [class*="wf-col"], body.single-post:is(.postid-1135,.postid-1145) article.single-post, body.single-post:is(.postid-1135,.postid-1145) article.single-post .inner, body.single-post:is(.postid-1135,.postid-1145) article.single-post .content{ float:none!important; left:auto!important; right:auto!important; transform:none!important; margin-left:auto!important; margin-right:auto!important; padding-left:0!important; padding-right:0!important; max-width:294px!important; width:294px!important; min-width:0!important; box-sizing:border-box!important; } body.single-post:is(.postid-1135,.postid-1145) #wf_posts, body.single-post:is(.postid-1135,.postid-1145) #content{ max-width:100vw!important; width:100vw!important; overflow-x:hidden!important; } body.single-post:is(.postid-1135,.postid-1145) article.single-post .content > *, body.single-post:is(.postid-1135,.postid-1145) article.single-post .title, body.single-post:is(.postid-1135,.postid-1145) article.single-post .meta{ max-width:294px!important; width:100%!important; min-width:0!important; box-sizing:border-box!important; } body.single-post:is(.postid-1135,.postid-1145) article.single-post .content p, body.single-post:is(.postid-1135,.postid-1145) article.single-post .content li{ overflow-wrap:break-word!important; word-break:normal!important; } } </style> <script id="openryd-resource-mobile-polish-20260601-js"> (function(){ function applyOpenRydResourceFix(){ if (!document.body || !(!document.body.classList.contains('postid-1135') && !document.body.classList.contains('postid-1145')) || window.innerWidth > 980) { return; } /* OpenRyd resource mobile JS reset 2026-06-05 */ var safe = Math.min(294, Math.max(260, window.innerWidth - 96)) + 'px'; document.documentElement.style.overflowX = 'hidden'; document.body.style.overflowX = 'hidden'; [ '#content', '#wf_posts', '#wf_posts .wf-container', '#wf_posts .wf-row', '#wf_posts [class*="wf-col"]', 'article.single-post', 'article.single-post .inner', 'article.single-post .content' ].forEach(function(selector){ document.querySelectorAll(selector).forEach(function(el){ el.style.boxSizing = 'border-box'; el.style.maxWidth = selector === '#content' || selector === '#wf_posts' ? '100vw' : safe; el.style.width = selector === '#content' || selector === '#wf_posts' ? '100vw' : safe; el.style.minWidth = '0'; el.style.marginLeft = selector === '#content' || selector === '#wf_posts' ? '0' : 'auto'; el.style.marginRight = selector === '#content' || selector === '#wf_posts' ? '0' : 'auto'; el.style.paddingLeft = '0'; el.style.paddingRight = '0'; el.style.overflowX = 'hidden'; el.style.float = 'none'; el.style.left = 'auto'; el.style.right = 'auto'; el.style.transform = 'none'; }); }); document.querySelectorAll('article.single-post .content > *, article.single-post .title, article.single-post .meta').forEach(function(el){ el.style.boxSizing = 'border-box'; el.style.width = '100%'; el.style.maxWidth = safe; el.style.minWidth = '0'; el.style.whiteSpace = 'normal'; el.style.overflowWrap = 'anywhere'; }); document.querySelectorAll('article.single-post .wp-block-table').forEach(function(el){ el.style.display = 'block'; el.style.overflowX = 'auto'; el.style.maxWidth = safe; el.style.width = safe; }); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', applyOpenRydResourceFix); } else { applyOpenRydResourceFix(); } window.addEventListener('load', applyOpenRydResourceFix); window.addEventListener('resize', applyOpenRydResourceFix); })(); </script> <script id="openryd-resource-mobile-final-align-20260605-js"> (function(){ function finalAlignOpenRydResource(){ if (!document.body || window.innerWidth > 980) { return; } if (!document.body.classList.contains('postid-1135') && !document.body.classList.contains('postid-1145')) { return; } var frame = Math.min(window.innerWidth, 390); var textWidth = Math.min(294, Math.max(260, frame - 96)) + 'px'; var left = Math.max(24, Math.floor((frame - parseInt(textWidth, 10)) / 2)) + 'px'; document.documentElement.style.width = frame + 'px'; document.documentElement.style.maxWidth = frame + 'px'; document.body.style.width = frame + 'px'; document.body.style.maxWidth = frame + 'px'; var page = document.querySelector('#page'); if (page) { page.style.width = frame + 'px'; page.style.maxWidth = frame + 'px'; page.style.overflowX = 'hidden'; } document.documentElement.style.overflowX = 'hidden'; document.body.style.overflowX = 'hidden'; [ '#content', '#wf_posts', '#wf_posts .wf-container', '#wf_posts .wf-row', '#wf_posts [class*="wf-col"]', 'article.single-post', 'article.single-post .inner', 'article.single-post .content' ].forEach(function(selector){ document.querySelectorAll(selector).forEach(function(el){ el.style.setProperty('box-sizing', 'border-box', 'important'); el.style.setProperty('float', 'none', 'important'); el.style.setProperty('left', 'auto', 'important'); el.style.setProperty('right', 'auto', 'important'); el.style.setProperty('transform', 'none', 'important'); el.style.setProperty('width', frame + 'px', 'important'); el.style.setProperty('max-width', frame + 'px', 'important'); el.style.setProperty('min-width', '0', 'important'); el.style.setProperty('margin-left', '0', 'important'); el.style.setProperty('margin-right', '0', 'important'); el.style.setProperty('padding-left', '0', 'important'); el.style.setProperty('padding-right', '0', 'important'); el.style.setProperty('overflow-x', 'hidden', 'important'); }); }); document.querySelectorAll('article.single-post .title, article.single-post .meta, article.single-post .content > *').forEach(function(el){ el.style.setProperty('box-sizing', 'border-box', 'important'); el.style.setProperty('width', textWidth, 'important'); el.style.setProperty('max-width', textWidth, 'important'); el.style.setProperty('min-width', '0', 'important'); el.style.setProperty('margin-left', left, 'important'); el.style.setProperty('margin-right', '0', 'important'); el.style.setProperty('white-space', 'normal', 'important'); el.style.setProperty('overflow-wrap', 'anywhere', 'important'); el.style.setProperty('word-break', 'normal', 'important'); }); document.querySelectorAll('article.single-post .wp-block-table').forEach(function(el){ el.style.display = 'block'; el.style.overflowX = 'auto'; el.style.webkitOverflowScrolling = 'touch'; }); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', finalAlignOpenRydResource); } else { finalAlignOpenRydResource(); } window.addEventListener('load', finalAlignOpenRydResource); window.addEventListener('resize', finalAlignOpenRydResource); })(); </script> <?php }, 99); add_action('template_redirect', function () { if (is_admin() || wp_doing_ajax() || wp_is_json_request()) { return; } ob_start(function ($html) { $html = preg_replace('/<script[^>]+src=["\']\/cdn-cgi\/scripts\/5c5dd728\/cloudflare-static\/email-decode\.min\.js["\'][^>]*><\/script>/i', '', $html); $html = preg_replace('/Email:\s*info(?:&#64;|@)openryd\.com/i', 'Open RFQ Form', $html); $html = str_replace('Send Inquiry Email', 'Send RFQ', $html); $html = preg_replace_callback('/<a\b([^>]*)href=(["\'])(?:\/cdn-cgi\/l\/email-protection#[^"\']*|mailto:[^"\']*)\2([^>]*)>/i', function ($m) { $attrs = $m[1] . ' ' . $m[3]; $attrs = preg_replace('/\s+onclick=(["\']).*?\1/i', '', $attrs); return '<a' . $attrs . ' href="/contact-us/#openryd-rfq">'; }, $html); $html = preg_replace_callback('/<a\b([^>]*)onclick=(["\'])(?:(?!\2).)*mail(?:(?!\2).)*to(?:(?!\2).)*\2([^>]*)>/is', function ($m) { $attrs = $m[1] . ' ' . $m[3]; $attrs = preg_replace('/\s+href=(["\']).*?\1/i', '', $attrs); return '<a' . $attrs . ' href="/contact-us/#openryd-rfq">'; }, $html); $html = str_replace('href="#map">View Map Location</a>', 'href="#rfq-details">RFQ Checklist</a>', $html); $html = preg_replace('~<iframe[^>]+maps\.google\.com/maps\?[^>]*></iframe>~i', '<div class="openryd-map-replacement" id="rfq-details"><h3>Remote sourcing coordination</h3><p>OpenRyd supports global buyers through online RFQ review, sample confirmation, packaging checks and shipment coordination. Share product links, target quantity and destination country, and the team can prepare a practical quotation path.</p><ul><li>RFQ and sample discussion</li><li>OEM packaging confirmation</li><li>Shipping and delivery support</li></ul></div>', $html); // Weekly optimization 2026-06-01: align homepage with buyer-result positioning. if (is_front_page() || is_home()) { $html = str_replace('E-Bike Accessories Wholesale Supplier | OpenRyd', 'E-Bike Accessories Sourcing for Retail Buyers | OpenRyd', $html); $html = str_replace('OpenRyd is a China e-bike accessories manufacturer and wholesale supplier for LED lights, phone mounts, bags, locks and repair tools. Low MOQ, OEM/ODM packaging and B2B sourcing support.', 'OpenRyd helps retailers, distributors and online sellers source mixed-category e-bike accessories with sample support, OEM packaging options and flexible bulk order coordination.', $html); $html = str_replace('OpenRyd - E-bike Accessories Wholesale Supplier', 'OpenRyd - E-bike Accessories Sourcing for Retail Buyers', $html); $html = str_replace('OpenRyd is a B2B e-bike accessories supplier for lights, mounts, bags, locks, tools, OEM packaging and wholesale cycling gear programs.', 'OpenRyd helps retail buyers source e-bike lights, mounts, bags, locks, tools and cycling accessories with sample support, OEM packaging and mixed-order coordination.', $html); $html = str_replace('E-Bike Accessories Wholesale Supplier</h1>', 'E-Bike Accessories Sourcing Made Easier for Retail Buyers</h1>', $html); $html = str_replace('OpenRyd is a China e-bike accessories manufacturer and B2B e-bike supplier for retailers, distributors and online sellers. Source OEM e-bike accessories with low MOQ, mixed category orders, custom packaging and fast sample support.', 'OpenRyd helps retailers, distributors and online sellers source mixed-category e-bike accessories with sample support, OEM packaging options and flexible bulk order coordination.', $html); $html = str_replace('>Request Quote</a>', '>Request Wholesale Quote</a>', $html); $html = str_replace('>Request a Quote</a>', '>Request Wholesale Quote</a>', $html); $html = str_replace('>View Products</a>', '>Browse Products</a>', $html); $html = str_replace('>View All Products</a>', '>Browse All Products</a>', $html); $html = str_replace('>Insights</a>', '>Resources</a>', $html); $html = str_replace('>News &amp; Insights</a>', '>Resources</a>', $html); $html = str_replace('OpenRyd Insights', 'OpenRyd Resources', $html); $html = str_replace('View all insights', 'View Resources', $html); $html = str_replace('>Service Support</a>', '>Sample Support</a>', $html); $html = str_replace('<div class="or-chip-row"><span class="or-chip">Low MOQ</span><span class="or-chip">OEM Packaging</span><span class="or-chip">Mixed Orders</span><span class="or-chip">Fast Sample</span></div>', '<div class="or-chip-row"><span class="or-chip">Mixed Orders</span><span class="or-chip">Sample Support</span><span class="or-chip">OEM Packaging</span><span class="or-chip">Retail Bundles</span><span class="or-chip">Shipping Coordination</span></div>', $html); } return $html; }); }, 0); // OpenRyd hard product JSON-LD offer override 20260606. function openryd_offer_patch_candidate_url_20260606($product_node, $page_url) { if (!empty($product_node['url']) && is_string($product_node['url'])) { return $product_node['url']; } if (!empty($product_node['@id']) && is_string($product_node['@id'])) { return $product_node['@id']; } return $page_url; } function openryd_patch_product_node_recursive_20260606(&$node, $candidate_url) { if (!is_array($node)) { return false; } if (openryd_20260606_product_type_is_product($node['@type'] ?? '')) { if (openryd_product_graph_node_has_offer_or_review($node)) { return false; } $offer_url = openryd_offer_patch_candidate_url_20260606($node, $candidate_url); $offer = openryd_product_offer_for_structured_data_20260606($offer_url); if (!$offer) { return false; } $node['offers'] = $offer; if (!empty($offer['price']) && !empty($offer['priceCurrency'])) { $node['offers']['price'] = (string) $offer['price']; $node['offers']['priceCurrency'] = (string) $offer['priceCurrency']; } return true; } $changed = false; if (isset($node['@graph']) && is_array($node['@graph'])) { foreach ($node['@graph'] as &$graph_node) { if (openryd_patch_product_node_recursive_20260606($graph_node, $candidate_url)) { $changed = true; } } } foreach ($node as &$value) { if (is_array($value) && openryd_patch_product_node_recursive_20260606($value, $candidate_url)) { $changed = true; } } return $changed; } add_action('template_redirect', function () { if (is_admin() || wp_doing_ajax() || wp_is_json_request() || !is_singular()) { return; } ob_start(function ($html) { if (strpos($html, 'application/ld+json') === false) { return $html; } $page_url = home_url($_SERVER['REQUEST_URI'] ?? ''); return preg_replace_callback( '/]+type=["']application\/ld\+json["'][^>]*>(.*?)<\/script>/is', function ($matches) use ($page_url) { $body = trim($matches[1]); if ($body === '') { return $matches[0]; } $graph = json_decode($body, true); if (!is_array($graph) || empty($graph)) { return $matches[0]; } $changed = openryd_patch_product_node_recursive_20260606($graph, $page_url); if (!$changed) { return $matches[0]; } $close = strripos($matches[0], '>'); if ($close === false) { return $matches[0]; } $tag_head = substr($matches[0], 0, $close + 1); return $tag_head . wp_json_encode($graph, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ''; }, $html ); }); }, 0); // OPENRYD_TEMP_20260606_TEST // openryd probe function branch 20260606 add_action('wp_head', function () { if (openryd_is_product_like_page_20260606()) { echo '<meta name="openryd-product-like" content="1" />'; } else { echo '<meta name="openryd-product-like" content="0" />'; } }, 6);
Warning: session_start(): Session cannot be started after headers have already been sent in /www/wwwroot/openryd_com/wp-content/plugins/fable-extra/inc/woo-features/includes/compare/compare.php on line 16

Warning: Cannot modify header information - headers already sent by (output started at /www/wwwroot/openryd_com/wp-content/plugins/openryd-runtime-fixes-20260530/openryd-runtime-fixes-20260530.php:1) in /www/wwwroot/openryd_com/wp-content/plugins/openryd-crawl-fixes-v3-20260521/openryd-crawl-fixes-v3-20260521.php on line 27
https://openryd.com/wp-sitemap-posts-page-1.xml https://openryd.com/wp-sitemap-posts-product-1.xml