View wp-spoofing-hostport.php
This file contains 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 | |
/** | |
* Spoofing host and port for WordPress environment. | |
* To use this, include from your "wp-config.php" file. | |
* Note that this functions is not intended to be used in production. | |
* | |
* @see \is_ssl() | |
* @link https://ngrok.com/docs/using-ngrok-with/wordpress/ | |
*/ |
View wp-elfinder-googledrive.php
This file contains 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 GdriveFolderViewer | |
* | |
* @see https://github.com/nao-pon/flysystem-google-drive#usage-to-with-elfinder | |
* composer require nao-pon/elfinder-flysystem-driver-ext nao-pon/flysystem-google-drive:~1.1 | |
* | |
*/ | |
class GdriveFolderViewer { |
View wc-builtin-shortcode-stock-filter.php
This file contains 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 | |
/** | |
* Description: WooCommerce: Add stock filter function to builtin shortcodes. | |
* Author: chrono-meter@gmx.net | |
* Version: v20200727 | |
* | |
* @link https://docs.woocommerce.com/document/woocommerce-shortcodes/ | |
* | |
* Example: | |
* [products stock="instock"] |
View cmb2_initial_value.php
This file contains 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 | |
/** | |
* CMB2 delete value instead of saving empty value. So fields with default value cannot hold empty value. | |
* This example works around this issue by adding new field parameter `initial value'. | |
* | |
* Example: | |
* $cmb->add_field( array( | |
* 'name' => 'Title for publish', | |
* 'initial_value' => '%d product(s) published', |
View cmb2-option-example.php
This file contains 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: CMB2 option test | |
* Author: chrono-meter@gmx.net | |
* Version: 20211223 | |
* | |
* @link https://github.com/CMB2/CMB2-Snippet-Library/search?q=object_types&unscoped_q=object_types | |
* @see add_menu_page() | |
* | |
* to get variables: cmb2_get_option('myprefix_network_options', 'key', 'default') |
View wp-meta-thumbnail.php
This file contains 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 | |
/** | |
* Thumbnail images in search results | |
* | |
* @see https://support.google.com/customsearch/answer/1626955 | |
*/ | |
add_action( 'wp_head', function() { | |
if ( is_single() && '' !== ($thumbnail_id = get_post_thumbnail_id()) && false !== ($image = wp_get_attachment_image_src( $thumbnail_id ))) { | |
echo "<meta name=\"thumbnail\" content=\"{$image[0]}\">"; |
View wc-fix-pa-creation.php
This file contains 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 | |
/** | |
* @wordpress-plugin | |
* Plugin Name: FIX: WooCommerce doesn't support attribute taxonomy creation on non startup. | |
* Depends: WooCommerce | |
* Plugin URI: | |
* Description: | |
* Version: 1.0.0 | |
* Author: chrono-meter@gmx.net | |
* Author URI: mailto:chrono-meter@gmx.net |
View wc-fix-pa-rewrite-slug.php
This file contains 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 | |
/** | |
* @wordpress-plugin | |
* Plugin Name: FIX: WooCommerce generates non appropriate rewrite slug for product attributes with CJK language slug. | |
* Depends: WooCommerce | |
* Plugin URI: | |
* Description: | |
* Version: 1.0.0 | |
* Author: chrono-meter@gmx.net | |
* Author URI: mailto:chrono-meter@gmx.net |
View wxr.py
This file contains 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
#!/usr/bin/env python3 | |
from xml.etree import ElementTree | |
from pathlib import Path | |
import io | |
import datetime | |
import email.utils | |
__author__ = 'chrono-meter@gmx.net' | |
__version__ = '1.0.0' | |
__license__ = 'Python Software Foundation License' |
View touch-wp-crom.py
This file contains 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
#!/usr/bin/env python3 | |
import requests | |
from urlpath import URL # https://pypi.org/project/urlpath/ | |
import argparse | |
import logging | |
logger = logging.getLogger(__name__) | |
# https://www.peterbe.com/plog/best-practice-with-retries-with-requests | |
def Session(*args, **kwargs): |
NewerOlder