Plugin Directory

Changeset 2027920


Ignore:
Timestamp:
02/09/2019 10:26:15 PM (7 years ago)
Author:
ryanshoover
Message:

Tagging 0.2.0

Location:
safe-staging
Files:
18 added
6 edited

Legend:

Unmodified
Added
Removed
  • safe-staging/trunk/README.md

    r2027890 r2027920  
    44* Tags: staging, woocommerce, email
    55* Requires at least: 4.7
    6 * Tested up to: 5
     6* Tested up to: 5.0
    77* Requires PHP: 7.0
    88* License: GPL3
     
    1313## Description
    1414
    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.
     15Simply 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.
    1616
    1717### Why should I use the plugin
     
    2222
    2323### Features on Staging
     24
     25A "noindex" tag is added to all pages. Your staging site won't show up in Google.
    2426
    2527WordPress 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.
     
    3335## Installation
    3436
    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
     371. Upload the plugin to `/wp-content/plugins/`
     382. Activate the plugin at `/wp-admin/plugins.php`
     393. 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 */
     50apply_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 */
     60apply_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 */
     70apply_filters( 'safe_staging_checkout_notice', $notice );
     71```
  • safe-staging/trunk/inc/class-fake-phpmailer.php

    r2027890 r2027920  
    3939        }
    4040
     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         */
    4147        return apply_filters( 'safe_staging_is_whitelist_email', $whitelisted, $this );
    4248    }
  • safe-staging/trunk/inc/class-notices.php

    r2027890 r2027920  
    6767        );
    6868
    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' );
    7076    }
    7177}
  • safe-staging/trunk/inc/class-protection.php

    r2027890 r2027920  
    2525        // Stop all emails.
    2626        $self->replace_mailer();
     27
     28        // Add a noindex tag to the header to stop indexing bots.
     29        add_action( 'wp_head', 'wp_no_robots' );
    2730
    2831        // Remove all but most basic payment gateways.
     
    5558        }
    5659
     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         */
    5766        return apply_filters( 'safe_staging_is_production', $is_prod );
    5867    }
  • safe-staging/trunk/readme.txt

    r2027890 r2027920  
    33Tags: staging, woocommerce, email
    44Requires at least: 4.7
    5 Tested up to: 5
     5Tested up to: 5.0
    66Requires PHP: 7.0
    77License: GPL3
     
    1919
    2020= 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.
     211. A "noindex" tag is added to all pages. Your staging site won't show up in Google.
     222. 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.
     233. The WooCommerce checkout page has a warning message notifying the visitor they are viewing the staging site.
     244. WooCommerce payment gateways are suspended. Bank account transfer, Cash on Delivery and Check are left enabled. Stripe is automatically put into test mode.
     255. WooCommerce Subscriptions is put into staging mode.
    2826
    2927== 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
     281. Upload the plugin to `/wp-content/plugins/`
     292. Activate the plugin at `/wp-admin/plugins.php`
     303. 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 */
     41apply_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 */
     51apply_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 */
     61apply_filters( 'safe_staging_checkout_notice', $notice );
     62```
  • safe-staging/trunk/safe-staging.php

    r2027890 r2027920  
    1111 * Plugin URI:  https://github.com/ryanshoover/safe-staging
    1212 * Description: Disables user activities on a staging site
    13  * Version:     0.1.0
     13 * Version:     0.2.0
    1414 * Author:      ryanshoover
    1515 * Author URI:  https://ryan.hoover.ws
Note: See TracChangeset for help on using the changeset viewer.