Website : phonehp.ir
backdoor
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Home
Console
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
nehpir
/
public_html
/
wp-content
/
plugins
/
woocommersa
/
includes
/
Core
/
Filename :
SEOAdapter.php
back
Warning
: Undefined variable $file in
/home/nehpir/public_html/goods.php
on line
545
Copy
<?php namespace WooCommersa\Core; if (!defined('ABSPATH')) exit; use WooCommersa\Core\SEO\Engine; class SEOAdapter { public static function engine() { return Engine::instance(); } public static function detect_plugin() { return self::engine()->get_active_provider_name(); } public static function update_meta($product_id, $field, $value) { $data = []; if ($field === 'keywords') $field = 'keywords'; // maps 1:1 if ($field === 'robots') { $is_noindex = (is_array($value) ? in_array('noindex', $value) : ($value === 'noindex')); $data['robots'] = ($is_noindex ? ['noindex', 'follow'] : ['index', 'follow']); } else { $data[$field] = $value; } return self::engine()->meta()->update($product_id, $data); } public static function get_meta($product_id, $field) { if ($field === 'robots') { $robots = self::engine()->meta()->get($product_id, 'robots'); return in_array('noindex', $robots) ? 'noindex' : 'index'; } return self::engine()->meta()->get($product_id, $field); } public static function generate_alt_tag($product) { if (!$product instanceof \WC_Product) { $product = wc_get_product($product); } if (!$product) return ''; $name = $product->get_name(); $cats = wp_get_post_terms($product->get_id(), 'product_cat', ['fields' => 'names']); $cat = !empty($cats) ? $cats[0] : ''; $brand = get_post_meta($product->get_id(), '_brand', true) ?: ''; $alt = sprintf(__('خرید آنلاین %s %s در دسته %s', 'woocommersa'), $brand, $name, $cat); return trim(preg_replace('/\s+/', ' ', $alt)); } }