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 | |
/** | |
* Make CloudFlare Client API calls via wp_remote_post | |
* A fork from CloudFlare-API by VEXXHOST, Inc. | |
* | |
* @package CloudFlare_API_Helper | |
* @link https://github.com/vexxhost/CloudFlare-API | |
* @link https://www.cloudflare.com/docs/client-api.html | |
*/ |
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
// sunny-demo/sunny-demo.php | |
<?php | |
/** | |
* Sunny Demo | |
* | |
* A demo to show how to write a plugin interacting with CloudFlare | |
* Client API base on WordPress Plugin Boilerplate. | |
* | |
* @package Sunny_Demo |
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 | |
// inside private function register_settings() | |
// below add_settings_section() | |
// Next, we will introduce the fields for CloudFlare Account info. | |
add_settings_field( | |
// ID used to identify the field throughout the theme | |
'sunny_demo_cloudflare_email', | |
// The label to the left of the option interface element |
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: Settings API Tabs Demo | |
* Plugin URI: http://theme.fm/?p= | |
* Description: This is a demo showing off usage of tabs with the WordPress Settings API | |
* Version: 1.0 | |
* Author: kovshenin | |
* Author URI: http://theme.fm | |
* License: GPL2 | |
*/ |
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 | |
// sunny-demo/admin/class-sunny-demo-admin.php | |
class Sunny_Demo_Admin { | |
// Some code is skipped!!!!!!! | |
/** | |
* Initialize the plugin by loading admin scripts & styles and adding a | |
* settings page and menu. |
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
<div id="sunny_demo_url_purger" class="wrap"> | |
<form id="sunny_demo_url_purger_form" method="POST"> | |
<?php wp_nonce_field( 'sunny_demo_url_purger', 'sunny_demo_url_purger_nonce'); ?> | |
<?php do_settings_sections( 'sunny_demo_url_purger_section' ); ?> | |
<?php submit_button( __('Purge', $plugin_slug ), 'primary', 'sunny_demo_url_purger_button' ); ?> | |
</form> | |
<br class="clear"> | |
<div id="sunny_demo_url_purger_result" style="display: none"> | |
<h3 id="sunny_demo_url_purger_result_heading">URL Purger Result</h3> | |
<img id="sunny_demo_url_purger_form_spinner" style="display: none" src="<?php echo admin_url(); ?>images/spinner-2x.gif"> |
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
# Install dependencies | |
# | |
# * checkinstall: package the .deb | |
# * libpcre3, libpcre3-dev: required for HTTP rewrite module | |
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module | |
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \ | |
mkdir -p ~/sources/ && \ | |
# Compile against OpenSSL to enable NPN |
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
$ adduser deployer | |
$ gpasswd -a deployer sudo | |
$ gpasswd -a deployer www-data | |
$ sudo usermod -g www-data deployer |
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
$ curl --data "author=YourName&[email protected]&url=http://www.your-domain.com&comment=Testing-Zero-Spam&comment_post_ID=123456789" http://your-domain.com/wp-comments-post.php |
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 | |
// Skipping lots of array elements above..... | |
$settings['your_tab_slug']['user_email'] = array( | |
'name' => __( 'Your Email', $this->plugin_name ), | |
'type' => 'email' | |
); | |
$settings['your_tab_slug']['user_plan'] = array( | |
'name' => __( 'Select a plan', $this->plugin_name ), |
OlderNewer