Сайт находится в разработке

WooCommerce $order Object

// Get Order ID and Key
$order->get_id();
$order->get_order_key();
 
// Get Order Totals $0.00
$order->get_formatted_order_total();
$order->get_cart_tax();
$order->get_currency();
$order->get_discount_tax();
$order->get_discount_to_display();
$order->get_discount_total();
$order->get_fees();
$order->get_formatted_line_subtotal();
$order->get_shipping_tax();
$order->get_shipping_total();
$order->get_subtotal();
$order->get_subtotal_to_display();
$order->get_tax_location();
$order->get_tax_totals();
$order->get_taxes();
$order->get_total();
$order->get_total_discount();
$order->get_total_tax();
$order->get_total_refunded();
$order->get_total_tax_refunded();
$order->get_total_shipping_refunded();
$order->get_item_count_refunded();
$order->get_total_qty_refunded();
$order->get_qty_refunded_for_item();
$order->get_total_refunded_for_item();
$order->get_tax_refunded_for_item();
$order->get_total_tax_refunded_by_rate_id();
$order->get_remaining_refund_amount();
  
// Get and Loop Over Order Items
foreach ( $order->get_items() as $item_id => $item ) {
   $product_id = $item->get_product_id();
   $variation_id = $item->get_variation_id();
   $product = $item->get_product();
   $name = $item->get_name();
   $quantity = $item->get_quantity();
   $subtotal = $item->get_subtotal();
   $total = $item->get_total();
   $tax = $item->get_subtotal_tax();
   $taxclass = $item->get_tax_class();
   $taxstat = $item->get_tax_status();
   $allmeta = $item->get_meta_data();
   $somemeta = $item->get_meta( '_whatever', true );
   $type = $item->get_type();
}
 
// Other Secondary Items Stuff
$order->get_items_key();
$order->get_items_tax_classes();
$order->get_item_count();
$order->get_item_total();
$order->get_downloadable_items();
  
// Get Order Lines
$order->get_line_subtotal();
$order->get_line_tax();
$order->get_line_total();
  
// Get Order Shipping
$order->get_shipping_method();
$order->get_shipping_methods();
$order->get_shipping_to_display();
  
// Get Order Dates
$order->get_date_created();
$order->get_date_modified();
$order->get_date_completed();
$order->get_date_paid();
  
// Get Order User, Billing & Shipping Addresses
$order->get_customer_id();
$order->get_user_id();
$order->get_user();
$order->get_customer_ip_address();
$order->get_customer_user_agent();
$order->get_created_via();
$order->get_customer_note();
$order->get_address_prop();
$order->get_billing_first_name();
$order->get_billing_last_name();
$order->get_billing_company();
$order->get_billing_address_1();
$order->get_billing_address_2();
$order->get_billing_city();
$order->get_billing_state();
$order->get_billing_postcode();
$order->get_billing_country();
$order->get_billing_email();
$order->get_billing_phone();
$order->get_shipping_first_name();
$order->get_shipping_last_name();
$order->get_shipping_company();
$order->get_shipping_address_1();
$order->get_shipping_address_2();
$order->get_shipping_city();
$order->get_shipping_state();
$order->get_shipping_postcode();
$order->get_shipping_country();
$order->get_address();
$order->get_shipping_address_map_url();
$order->get_formatted_billing_full_name();
$order->get_formatted_shipping_full_name();
$order->get_formatted_billing_address();
$order->get_formatted_shipping_address();
  
// Get Order Payment Details
$order->get_payment_method();
$order->get_payment_method_title();
$order->get_transaction_id();
  
// Get Order URLs
$order->get_checkout_payment_url();
$order->get_checkout_order_received_url();
$order->get_cancel_order_url();
$order->get_cancel_order_url_raw();
$order->get_cancel_endpoint();
$order->get_view_order_url();
$order->get_edit_order_url();
  
// Get Order Status
$order->get_status();

WooCommerce $product Object

У вас есть доступ к $product

Получить всю информацию о товаре имея доступ к переменной $product, так же вы можете вызвать global $product внутри вашей функции

// Получить ID товара
 
$product->get_id(); //id товара
 
// Получить информацию товара
 
$product->get_type(); //тип товара
$product->get_name(); //наименование товара
$product->get_slug(); //slug товара
$product->get_date_created();
$product->get_date_modified();
$product->get_status();
$product->get_featured();
$product->get_catalog_visibility();
$product->get_description(); // Описание товара
$product->get_short_description(); // Короткое описание товара
$product->get_sku(); // артикул
$product->get_menu_order();
$product->get_virtual();
get_permalink( $product->get_id() );
 
// Получить цену товара 
 
$product->get_price(); // Цена покупки
$product->get_regular_price(); // Цена 
$product->get_sale_price(); // Цена распродажи
$product->get_date_on_sale_from(); // Старая цена
$product->get_date_on_sale_to();
$product->get_total_sales();
 
// Получить остатки, статус товара
 
$product->get_tax_status();
$product->get_tax_class();
$product->get_manage_stock(); // доступен к покупке, значения 0 и 1
$product->get_stock_quantity();
$product->get_stock_status(); // статус доступности текстом
$product->get_backorders();
$product->get_sold_individually();
$product->get_purchase_note();
$product->get_shipping_class_id();
 
// Получить размеры товара
 
$product->get_weight();
$product->get_length();
$product->get_width();
$product->get_height();
$product->get_dimensions();
 
// Получить связанные товары
 
$product->get_upsell_ids();
$product->get_cross_sell_ids();
$product->get_parent_id();
 
// Получить вариации товара
 
$product->get_attributes();
$product->get_default_attributes();
 
// Получить таксаномию товара
 
$product->get_categories();
$product->get_category_ids();
$product->get_tag_ids();
 
// Получить загрузки товара
 
$product->get_downloads();
$product->get_download_expiry();
$product->get_downloadable();
$product->get_download_limit();
 
// Получить изображения товара
 
$product->get_image_id();
$product->get_image();
$product->get_gallery_image_ids();
 
// Получить обзоры товара
 
$product->get_reviews_allowed();
$product->get_rating_counts();
$product->get_average_rating(); // Рейтинг товара
$product->get_review_count();

Убираем «мусор» из WordPress

Из-за отключения тех или иных элементов WordPress может перестать работать нужный вам функционал или вообще работоспособность плагинов. Отключение всех элементов производите если вам это действительно не нужно и вы понимаете для чего это делаете.

После каждого отключения проводите проверку на работоспособность необходимых вам элементов сайта.

Добавляете данные коды в файл function.php и все. Функционал будет отключен.

Отключаем ленты RSS

Отключение всех лент rss

// Отключение rss-ленты
function fb_disable_feed() {
wp_redirect(get_option('siteurl'));
}

add_action('do_feed', 'fb_disable_feed', 1);
add_action('do_feed_rdf', 'fb_disable_feed', 1);
add_action('do_feed_rss', 'fb_disable_feed', 1);
add_action('do_feed_rss2', 'fb_disable_feed', 1);
add_action('do_feed_atom', 'fb_disable_feed', 1);

remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'rsd_link' );

Выборочное отключение rss

// Удаляет ссылки RSS-лент записи и комментариев
remove_action( 'wp_head', 'feed_links', 2 ); 
// Удаляет ссылки RSS-лент категорий и архивов
remove_action( 'wp_head', 'feed_links_extra', 3 ); 

Удалить RSD ссылку (xmlrpc.php)

remove_action( 'wp_head', 'rsd_link' ); 

Удалить ссылку Windows для Live Writer (wlwmanifest)

remove_action( 'wp_head', 'wlwmanifest_link' ); 

Отключить Rest API

К отключению данного функционала подходите с особой осторожностью, на данном функционале может быть завязана работа используемых вами плагинов.

/*
 * Отключаем REST API
 */
// Отключаем сам REST API
add_filter('rest_enabled', '__return_false');

// Отключаем фильтры REST API
remove_action( 'xmlrpc_rsd_apis',            'rest_output_rsd' );
remove_action( 'wp_head',                    'rest_output_link_wp_head', 10, 0 );
remove_action( 'template_redirect',          'rest_output_link_header', 11, 0 );
remove_action( 'auth_cookie_malformed',      'rest_cookie_collect_status' );
remove_action( 'auth_cookie_expired',        'rest_cookie_collect_status' );
remove_action( 'auth_cookie_bad_username',   'rest_cookie_collect_status' );
remove_action( 'auth_cookie_bad_hash',       'rest_cookie_collect_status' );
remove_action( 'auth_cookie_valid',          'rest_cookie_collect_status' );
remove_filter( 'rest_authentication_errors', 'rest_cookie_check_errors', 100 );

// Отключаем события REST API
remove_action( 'init','rest_api_init' );
remove_action( 'rest_api_init', 'rest_api_default_filters', 10, 1 );
remove_action( 'parse_request', 'rest_api_loaded' );

// Отключаем Embeds связанные с REST API
remove_action( 'rest_api_init','wp_oembed_register_route');
remove_filter( 'rest_pre_serve_request', '_oembed_rest_pre_serve_request', 10, 4 );

remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
remove_action( 'template_redirect', 'rest_output_link_header', 11, 0 );
remove_action( 'wp_head', 'rest_output_link_wp_head' );
// если собираетесь выводить вставки из других сайтов на своем, то закомментируйте след. строку.
remove_action( 'wp_head','wp_oembed_add_host_js');

Удалить короткую ссылку

remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0); 

Удалить информацию о версии WordPress

remove_action( 'wp_head', 'wp_generator' );

Удалить ссылки на предыдущую и следующую статьи

remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );

Отключить поддержку Emoji

/*
 * Отключаем Emojii
 */
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' ); 
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); 
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
add_filter( 'tiny_mce_plugins', 'disable_wp_emojis_in_tinymce' );
function disable_wp_emojis_in_tinymce( $plugins ) {
    if ( is_array( $plugins ) ) {
        return array_diff( $plugins, array( 'wpemoji' ) );
    } else {
        return array();
    }
}

Отключить dns-prefetch

remove_action( 'wp_head', 'wp_resource_hints', 2 );

Отключить .recentcomments

function wpplugins_remove_recentcomments() {
    global $wp_widget_factory;
    remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
}
add_action('widgets_init', 'wpplugins_remove_recentcomments');

Yoast

При формировании xml карты сайта, плагин yoast создаёт теги картинок image:image. Данный тег не понимает yandex и вывод данного тега нужно отключить

/**
 * Удаление картинок из xml-карты Yoast
*/
add_filter( 'wpseo_xml_sitemap_img', '__return_false' );

Отключить / удалить схему JSON + LD

В случае если вам не нужно формируемое плагином json shema.org то её можно отключить

add_filter( 'wpseo_json_ld_output', '__return_empty_array' );

При необходимости отключить OpenGraph через хуки

add_action('wp_head', 'remove_all_wpseo_og', 1);
function remove_all_wpseo_og() {
   remove_action( 'wpseo_head', array( $GLOBALS['wpseo_og'], 'opengraph' ), 30 );
}

По элементное отключение OpenGraph

add_filter('wpseo_opengraph_url' , '__return_false' );
add_filter('wpseo_opengraph_desc', '__return_false' );
add_filter('wpseo_opengraph_title', '__return_false' );
add_filter('wpseo_opengraph_type', '__return_false' );
add_filter('wpseo_opengraph_site_name', '__return_false' );

Если вы не хотите или не умеете работать с кодом

Существует большое количество плагинов которые отключают разные элементы по отдельности и все разом, если вы все таки решили воспользоваться плагином, то все действия описанные выше можно выполнить с помощью плагина Clearfy