Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wp-smush.../core/external/free-das...
File: README.md
# WDEV Free Notices Module #
[0] Fix | Delete
[1] Fix | Delete
WPMU DEV Free Notices module (short wpmu-free-notices) is used in our free plugins hosted on wordpress.org
[2] Fix | Delete
It will display,
[3] Fix | Delete
[4] Fix | Delete
* A welcome message upon plugin activation that offers the user a 5-day introduction email course for the plugin.
[5] Fix | Delete
[6] Fix | Delete
* After 7 days a message asking the user to rate the plugin on wordpress.org.
[7] Fix | Delete
[8] Fix | Delete
* After 2 days a giveaway notice asking for email subscription.
[9] Fix | Delete
[10] Fix | Delete
# How to use it #
[11] Fix | Delete
[12] Fix | Delete
1. Insert this repository as **sub-module** into the existing project
[13] Fix | Delete
[14] Fix | Delete
2. Include the file `module.php` in your main plugin file.
[15] Fix | Delete
[16] Fix | Delete
3. Call the action `wpmudev_register_notices` with the params mentioned below.
[17] Fix | Delete
[18] Fix | Delete
4. Done!
[19] Fix | Delete
[20] Fix | Delete
[21] Fix | Delete
# Upgrading to v2.0
[22] Fix | Delete
[23] Fix | Delete
The 2.0 release is backward incompatible with the 1.x versions. To accommodate new functionality and fix WordPress coding standards violations, a lot of the hooks/filters have been refactored.
[24] Fix | Delete
Make sure to change the following:
[25] Fix | Delete
[26] Fix | Delete
1. Update the `do_action` hook name from `wdev-register-plugin` to `wpmudev_register_notices`.
[27] Fix | Delete
2. Update the params to new format (See example below).
[28] Fix | Delete
3. Both `wdev-email-message-` and `wdev-rating-message-` filters have been changed to `wdev_email_title_`/`wdev_email_message_` and `wdev_rating_title_`/`wdev_rating_message_`
[29] Fix | Delete
[30] Fix | Delete
## IMPORTANT:
[31] Fix | Delete
[32] Fix | Delete
DO NOT include this submodule in Pro plugins. These notices are only for wp.org versions.
[33] Fix | Delete
[34] Fix | Delete
[35] Fix | Delete
## Code Example : Registering a plugin (from Smush) ##
[36] Fix | Delete
[37] Fix | Delete
```
[38] Fix | Delete
#!php
[39] Fix | Delete
[40] Fix | Delete
<?php
[41] Fix | Delete
add_action( 'admin_init', 'mycustom_free_notices_init' );
[42] Fix | Delete
[43] Fix | Delete
function mycustom_free_notices_init() {
[44] Fix | Delete
// Load the notices module.
[45] Fix | Delete
include_once 'external/free-notices/module.php';
[46] Fix | Delete
[47] Fix | Delete
// Register the current plugin for notices.
[48] Fix | Delete
do_action(
[49] Fix | Delete
'wpmudev_register_notices',
[50] Fix | Delete
'smush', // Required: plugin id. Get from the below list.
[51] Fix | Delete
array(
[52] Fix | Delete
'basename' => WP_SMUSH_BASENAME, // Required: Plugin basename (for backward compat).
[53] Fix | Delete
'title' => 'Smush', // Plugin title.
[54] Fix | Delete
'wp_slug' => 'wp-smushit', // Plugin slug on wp.org
[55] Fix | Delete
'cta_email' => __( 'Get Fast!', 'ga_trans' ), // Email button CTA.
[56] Fix | Delete
'installed_on' => time(), // Plugin installed time (timestamp). Default to current time.
[57] Fix | Delete
'screens' => array( // Screen IDs of plugin pages.
[58] Fix | Delete
'toplevel_page_smush',
[59] Fix | Delete
'smush_page_smush-bulk',
[60] Fix | Delete
'smush_page_smush-directory',
[61] Fix | Delete
),
[62] Fix | Delete
)
[63] Fix | Delete
);
[64] Fix | Delete
}
[65] Fix | Delete
```
[66] Fix | Delete
[67] Fix | Delete
> IMPORTANT: Make sure to initialize this on a hook which is executed in admin-ajax requests too. The recommended hook is `admin_init`
[68] Fix | Delete
[69] Fix | Delete
## Plugins and IDs
[70] Fix | Delete
Only wp.org plugins are listed below.
[71] Fix | Delete
[72] Fix | Delete
| Plugin | ID |
[73] Fix | Delete
|-------------|-------------|
[74] Fix | Delete
| Smush | smush |
[75] Fix | Delete
| Hummingbird | hummingbird |
[76] Fix | Delete
| Defender | defender |
[77] Fix | Delete
| SmartCrawl | smartcrawl |
[78] Fix | Delete
| Forminator | forminator |
[79] Fix | Delete
| Hustle | hustle |
[80] Fix | Delete
| Snapshot | snapshot |
[81] Fix | Delete
| Branda | branda |
[82] Fix | Delete
| Beehive | beehive |
[83] Fix | Delete
[84] Fix | Delete
[85] Fix | Delete
## Testing Notices
[86] Fix | Delete
[87] Fix | Delete
To see the notices before the due time, you can fake the current time by appending `&wpmudev_notice_time=CUSTOMTIMESTAMP` to the url on a page where the notice should be visible. Please make sure you are using a timestamp after the due time.
[88] Fix | Delete
[89] Fix | Delete
## Optional: Customize the notices via filters ##
[90] Fix | Delete
[91] Fix | Delete
```
[92] Fix | Delete
<?php
[93] Fix | Delete
// The email message contains 1 variable: plugin-name
[94] Fix | Delete
add_filter(
[95] Fix | Delete
'wdev_email_message_smush', // change plugin id.
[96] Fix | Delete
'custom_email_message'
[97] Fix | Delete
);
[98] Fix | Delete
function custom_email_message( $message ) {
[99] Fix | Delete
$message = 'You installed %s! This is a custom <u>email message</u>';
[100] Fix | Delete
return $message;
[101] Fix | Delete
}
[102] Fix | Delete
```
[103] Fix | Delete
[104] Fix | Delete
```
[105] Fix | Delete
<?php
[106] Fix | Delete
// The rating message contains 2 variables: user-name, plugin-name
[107] Fix | Delete
add_filter(
[108] Fix | Delete
'wdev_rating_message_smush', // Change plugin id.
[109] Fix | Delete
'custom_rating_message'
[110] Fix | Delete
);
[111] Fix | Delete
function custom_rating_message( $message ) {
[112] Fix | Delete
$message = 'Hi %s, you used %s for a while now! This is a custom <u>rating message</u>';
[113] Fix | Delete
return $message;
[114] Fix | Delete
}
[115] Fix | Delete
```
[116] Fix | Delete
[117] Fix | Delete
```
[118] Fix | Delete
<?php
[119] Fix | Delete
// To disable or enable a notice type.
[120] Fix | Delete
add_filter(
[121] Fix | Delete
'wpmudev_notices_is_disabled',
[122] Fix | Delete
'custom_rating_message',
[123] Fix | Delete
10,
[124] Fix | Delete
2
[125] Fix | Delete
);
[126] Fix | Delete
function disable_rating_message( $disabled, $type, $plugin ) {
[127] Fix | Delete
if ( 'rate' === $type && 'beehive' === $plugin ) {
[128] Fix | Delete
return true;
[129] Fix | Delete
}
[130] Fix | Delete
[131] Fix | Delete
return $disabled;
[132] Fix | Delete
}
[133] Fix | Delete
```
[134] Fix | Delete
[135] Fix | Delete
# Development
[136] Fix | Delete
[137] Fix | Delete
Do not commit anything directly to `master` branch. The `master` branch should always be production ready. All plugins will be using it as a submodule.
[138] Fix | Delete
[139] Fix | Delete
## Build Tasks (npm)
[140] Fix | Delete
[141] Fix | Delete
Everything should be handled by npm. Note that you don't need to interact with Gulp in a direct way.
[142] Fix | Delete
[143] Fix | Delete
| Command | Action |
[144] Fix | Delete
|----------------------|--------------------------------------------------------|
[145] Fix | Delete
| `npm run watch` | Compiles and watch for changes. |
[146] Fix | Delete
| `npm run compile` | Compile production ready assets. |
[147] Fix | Delete
| `npm run build` | Build production ready submodule inside `/build/` folder |
[148] Fix | Delete
[149] Fix | Delete
## Git Workflow
[150] Fix | Delete
[151] Fix | Delete
- Create a new branch from `dev` branch: `git checkout -b branch-name`. Try to give it a descriptive name. For example:
[152] Fix | Delete
- `release/X.X.X` for next releases
[153] Fix | Delete
- `new/some-feature` for new features
[154] Fix | Delete
- `enhance/some-enhancement` for enhancements
[155] Fix | Delete
- `fix/some-bug` for bug fixing
[156] Fix | Delete
- Make your commits and push the new branch: `git push -u origin branch-name`
[157] Fix | Delete
- File the new Pull Request against `dev` branch
[158] Fix | Delete
- Assign somebody to review your code.
[159] Fix | Delete
- Once the PR is approved and finished, merge it in `dev` branch.
[160] Fix | Delete
- Checkout `dev` branch.
[161] Fix | Delete
- Run `npm run build` and copy all files and folders from the `build` folder.
[162] Fix | Delete
- Checkout `master` branch and replace all files and folders with copied content from the build folder.
[163] Fix | Delete
- Commit and push the `master` branch changes.
[164] Fix | Delete
- Inform all devs to update the submodule.
[165] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function