This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Lazy Load Exclude by Filename | |
| Description: حذف loading="lazy" از تصاویر Visual Composer و تصاویر وردپرس بر اساس نام فایل. | |
| Version: 1.1 | |
| Author: Your Name | |
| */ | |
| if (!defined('ABSPATH')) exit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| MAX(CASE WHEN pm1.meta_key = 'Code' THEN pm1.meta_value END) AS 'Code', | |
| MAX(CASE WHEN pm1.meta_key = 'Name' THEN pm1.meta_value END) AS 'Name', | |
| MAX(CASE WHEN pm1.meta_key = 'Barcode' THEN pm1.meta_value END) AS 'Barcode', | |
| MAX(CASE WHEN pm1.meta_key = 'Few' THEN pm1.meta_value END) AS 'Few', | |
| MAX(CASE WHEN pm1.meta_key = 'RegularPrice' THEN pm1.meta_value END) AS 'RegularPrice', | |
| MAX(CASE WHEN pm1.meta_key = 'SalePrice' THEN pm1.meta_value END) AS 'SalePrice', | |
| MAX(CASE WHEN pm1.meta_key = 'WholeSalePrice' THEN pm1.meta_value END) AS 'WholeSalePrice', | |
| MAX(CASE WHEN pm1.meta_key = 'UnitName' THEN pm1.meta_value END) AS 'UnitName', | |
| MAX(CASE WHEN pm1.meta_key = 'IsActive' THEN pm1.meta_value END) AS 'IsActive', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter('wc_multisite_prepare_variation_product_item_data', function($data, $variation) { | |
| $meta = get_post_meta($variation->get_id(), 'mahak_product_detail_id', true); | |
| if(empty($meta)) { | |
| return $data; | |
| } | |
| $sku = $variation->get_sku(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // افزودن هدر برای مانیتورینگ مصرف رم | |
| function add_memory_usage_header() { | |
| if (!is_admin()) { | |
| $memory_usage = round(memory_get_peak_usage() / 1024 / 1024, 2); | |
| header('X-Memory-Usage: ' . $memory_usage . ' MB'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'woocommerce_dropdown_variation_attribute_options_args', 'set_default_available_option_for_all_attributes', 20 ); | |
| function set_default_available_option_for_all_attributes( $args ) { | |
| // این بخش فقط در بارگذاری اولیه صفحه (مانند صفحه محصول) اجرا میشود | |
| if ( ! wp_doing_ajax() ) { | |
| if ( ! empty( $args['selected'] ) ) { | |
| return $args; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| START TRANSACTION; | |
| -- حذف کامنتها و متادیتای کامنتها | |
| DELETE c, cm | |
| FROM wp_comments c | |
| LEFT JOIN wp_commentmeta cm ON c.comment_ID = cm.comment_id | |
| WHERE c.comment_type = 'order_note'; | |
| -- حذف آیتمهای سفارش و متادیتای آنها | |
| DELETE oi, oim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function generate_secure_unique_number($order_id, $digits = 24) { | |
| $salts = array(); | |
| $salt_constants = array( | |
| 'AUTH_KEY', | |
| 'SECURE_AUTH_KEY', | |
| 'LOGGED_IN_KEY', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * افزودن هدرهای عدم کش برای صفحات حاوی 'rahkaran' در URL | |
| */ | |
| add_filter('nocache_headers_args', 'rahkaran_no_cache_headers_with_cloudflare'); | |
| function rahkaran_no_cache_headers_with_cloudflare($headers) { | |
| // بررسی وجود 'rahkaran' در URL بدون توجه به بزرگی/کوچکی حروف | |
| if (isset($_SERVER['REQUEST_URI']) { | |
| $request_uri = strtolower($_SERVER['REQUEST_URI']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Advanced_WC_Report { | |
| public function __construct() { | |
| add_action('admin_menu', array($this, 'add_admin_menu')); | |
| add_action('admin_head', array($this, 'add_admin_styles')); | |
| } |
NewerOlder