Changeset 2027920
- Timestamp:
- 02/09/2019 10:26:15 PM (7 years ago)
- Location:
- safe-staging
- Files:
-
- 18 added
- 6 edited
-
assets/banner-772x250.png (added)
-
assets/icon-128x128.png (added)
-
tags/0.2.0 (added)
-
tags/0.2.0/LICENSE (added)
-
tags/0.2.0/README.md (added)
-
tags/0.2.0/changelog.txt (added)
-
tags/0.2.0/inc (added)
-
tags/0.2.0/inc/class-admin-page.php (added)
-
tags/0.2.0/inc/class-fake-phpmailer.php (added)
-
tags/0.2.0/inc/class-notices.php (added)
-
tags/0.2.0/inc/class-protection.php (added)
-
tags/0.2.0/readme.txt (added)
-
tags/0.2.0/safe-staging.php (added)
-
tags/0.2.0/templates (added)
-
tags/0.2.0/templates/admin-page.php (added)
-
tags/0.2.0/templates/setup-notice.php (added)
-
tags/0.2.0/templates/staging-notice.php (added)
-
trunk/README.md (modified) (4 diffs)
-
trunk/changelog.txt (added)
-
trunk/inc/class-fake-phpmailer.php (modified) (1 diff)
-
trunk/inc/class-notices.php (modified) (1 diff)
-
trunk/inc/class-protection.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/safe-staging.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
safe-staging/trunk/README.md
r2027890 r2027920 4 4 * Tags: staging, woocommerce, email 5 5 * Requires at least: 4.7 6 * Tested up to: 5 6 * Tested up to: 5.0 7 7 * Requires PHP: 7.0 8 8 * License: GPL3 … … 13 13 ## Description 14 14 15 Simply define your production url in settings and copy your site to your staging instance without fear. The staging site won \'t send any emails and won\'t process any payments.15 Simply define your production url in settings and copy your site to your staging instance without fear. The staging site won't send any emails and won't process any payments. 16 16 17 17 ### Why should I use the plugin … … 22 22 23 23 ### Features on Staging 24 25 A "noindex" tag is added to all pages. Your staging site won't show up in Google. 24 26 25 27 WordPress emails are stopped. The site won't send any emails except for the password reset email. Please note, this feature may not be compatible with plugins that offload email to a 3rd party service. … … 33 35 ## Installation 34 36 35 1. Upload the plugin to wp-content/plugins/ 36 2. Activate the plugin at wp-admin/plugins.php 37 3. Set the URL for your production site at /wp-admin/options-general.php?page=safe-staging 37 1. Upload the plugin to `/wp-content/plugins/` 38 2. Activate the plugin at `/wp-admin/plugins.php` 39 3. Set the URL for your production site at `/wp-admin/options-general.php?page=safe-staging` 40 41 ## Hooks and Filters 42 43 ```php 44 /** 45 * Change whether Safe Staging thinks the current site 46 * is the production site. 47 * 48 * @param bool $is_prod Is this the production site. 49 */ 50 apply_filters( 'safe_staging_is_production', $is_prod ); 51 ``` 52 53 ```php 54 /** 55 * Determine whether a particular email should be sent. 56 * 57 * @param bool $whitelisted Should the email actually send. 58 * @param object $this Instance of the Fake PHPMailer class. 59 */ 60 apply_filters( 'safe_staging_is_whitelist_email', $whitelisted, $this ); 61 ``` 62 63 ```php 64 /** 65 * Change the warning message that gets displayed on the checkout page 66 * of staging sites. 67 * 68 * @param string $notice HTML of the message to be shown. 69 */ 70 apply_filters( 'safe_staging_checkout_notice', $notice ); 71 ``` -
safe-staging/trunk/inc/class-fake-phpmailer.php
r2027890 r2027920 39 39 } 40 40 41 /** 42 * Determine whether the email should be sent. 43 * 44 * @param bool $whitelisted Should the email actually send. 45 * @param object $this Instance of the Fake PHPMailer class. 46 */ 41 47 return apply_filters( 'safe_staging_is_whitelist_email', $whitelisted, $this ); 42 48 } -
safe-staging/trunk/inc/class-notices.php
r2027890 r2027920 67 67 ); 68 68 69 wc_add_notice( $notice, 'error' ); 69 /** 70 * Change the warning message that gets displayed on the checkout page 71 * of staging sites. 72 * 73 * @param string $notice HTML of the message to be shown. 74 */ 75 wc_add_notice( apply_filters( 'safe_staging_checkout_notice', $notice ), 'error' ); 70 76 } 71 77 } -
safe-staging/trunk/inc/class-protection.php
r2027890 r2027920 25 25 // Stop all emails. 26 26 $self->replace_mailer(); 27 28 // Add a noindex tag to the header to stop indexing bots. 29 add_action( 'wp_head', 'wp_no_robots' ); 27 30 28 31 // Remove all but most basic payment gateways. … … 55 58 } 56 59 60 /** 61 * Change whether Safe Staging thinks the current site 62 * is the production site. 63 * 64 * @param bool $is_prod Is this the production site. 65 */ 57 66 return apply_filters( 'safe_staging_is_production', $is_prod ); 58 67 } -
safe-staging/trunk/readme.txt
r2027890 r2027920 3 3 Tags: staging, woocommerce, email 4 4 Requires at least: 4.7 5 Tested up to: 5 5 Tested up to: 5.0 6 6 Requires PHP: 7.0 7 7 License: GPL3 … … 19 19 20 20 = Features on Staging = 21 WordPress emails are stopped. The site won't send any emails except for the password reset email. Please note, this feature may not be compatible with plugins that offload email to a 3rd party service. 22 23 The WooCommerce checkout page has a warning message notifying the visitor they are viewing the staging site. 24 25 WooCommerce payment gateways are suspended. Bank account transfer, Cash on Delivery and Check are left enabled. Stripe is automatically put into test mode. 26 27 WooCommerce Subscriptions is put into staging mode. 21 1. A "noindex" tag is added to all pages. Your staging site won't show up in Google. 22 2. WordPress emails are stopped. The site won't send any emails except for the password reset email. Please note, this feature may not be compatible with plugins that offload email to a 3rd party service. 23 3. The WooCommerce checkout page has a warning message notifying the visitor they are viewing the staging site. 24 4. WooCommerce payment gateways are suspended. Bank account transfer, Cash on Delivery and Check are left enabled. Stripe is automatically put into test mode. 25 5. WooCommerce Subscriptions is put into staging mode. 28 26 29 27 == Installation == 30 1. Upload the plugin to wp-content/plugins/ 31 2. Activate the plugin at wp-admin/plugins.php 32 3. Set the URL for your production site at /wp-admin/options-general.php?page=safe-staging 28 1. Upload the plugin to `/wp-content/plugins/` 29 2. Activate the plugin at `/wp-admin/plugins.php` 30 3. Set the URL for your production site at `/wp-admin/options-general.php?page=safe-staging` 31 32 == Hooks and Filters == 33 34 ```php 35 /** 36 * Change whether Safe Staging thinks the current site 37 * is the production site. 38 * 39 * @param bool $is_prod Is this the production site. 40 */ 41 apply_filters( 'safe_staging_is_production', $is_prod ); 42 ``` 43 44 ```php 45 /** 46 * Determine whether a particular email should be sent. 47 * 48 * @param bool $whitelisted Should the email actually send. 49 * @param object $this Instance of the Fake PHPMailer class. 50 */ 51 apply_filters( 'safe_staging_is_whitelist_email', $whitelisted, $this ); 52 ``` 53 54 ```php 55 /** 56 * Change the warning message that gets displayed on the checkout page 57 * of staging sites. 58 * 59 * @param string $notice HTML of the message to be shown. 60 */ 61 apply_filters( 'safe_staging_checkout_notice', $notice ); 62 ``` -
safe-staging/trunk/safe-staging.php
r2027890 r2027920 11 11 * Plugin URI: https://github.com/ryanshoover/safe-staging 12 12 * Description: Disables user activities on a staging site 13 * Version: 0. 1.013 * Version: 0.2.0 14 14 * Author: ryanshoover 15 15 * Author URI: https://ryan.hoover.ws
Note: See TracChangeset
for help on using the changeset viewer.