Skip to content

Commit

Permalink
Merge branch 'develop' into feat/add-default-options
Browse files Browse the repository at this point in the history
  • Loading branch information
Vedant-Gandhi authored Oct 10, 2024
2 parents 51a85f4 + f253ae8 commit 9392d75
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 2 deletions.
52 changes: 52 additions & 0 deletions Development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Development
[ For internal contributors only ]

## Getting Started

To set up the repo locally, choose one of the following methods:

### Method 1 (For FastCGI or Srcache)

1. Create a WordPress website.
2. Clone the [nginx](https://github.com/nginx/nginx) source code in a separate directory.
3. Set up nginx using either FastCGI cache or Srcache module.
4. Manually compile the binary for Nginx.
5. Add a configuration block to redirect incoming requests to the WordPress website.
6. Clone this repository inside the `wp-content/plugins` directory.

### Method 2 (For Redis Cache)

1. Install EasyEngine by following the [instructions](https://easyengine.io/docs/install/).
2. Create a site with caching enabled using the command: `ee site create <site_name> --cache`

3. Clone this repository inside the `wp-content/plugins` directory of the newly created site.

## Testing

To verify if a page is cached:

1. Enable the timestamp option in Nginx Helper from the WordPress Admin Page:
- This adds a comment with cache time and query count.
- Cached pages should show only 1 query.

2. Manually check the Redis database:
- Search for keys beginning with the prefix specified in your Redis config, followed by a URL.

## Contributing

### Raising a Pull Request (PR)

1. Create a new branch from `master` for your changes.
2. Make your changes and commit them to your branch.
3. Raise a PR targeting the `develop` branch.
4. Assign the PR to a reviewer.
5. Address any feedback and make necessary changes.
6. Once approved, merge the PR into the `develop` branch.

### Merging to Master

1. After thorough testing on the `develop` branch, create a new PR.
2. Set the source branch as the original feature branch that was merged into `develop`.
3. Set the target branch as `master`.
4. Assign reviewers and await final approval.
5. Once approved, merge the PR into the `master` branch.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Nginx Helper #
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)

**Contributors:** rtcamp, rahul286, saurabhshukla, manishsongirkar36, faishal, desaiuditd, darren-slatten, jk3us, daankortenbach, telofy, pjv, llonchj, jinnko, weskoop, bcole808, gungeekatx, rohanveer, chandrapatel, gagan0123, ravanh, michaelbeil, samedwards, niwreg, entr, nuvoPoint, iam404, rittesh.patel, vishalkakadiya, BhargavBhandari90, vincent-lu, murrayjbrown, bryant1410, 1gor, matt-h, pySilver, johan-chassaing, dotsam, sanketio, petenelson, nathanielks, rigagoogoo, dslatten, jinschoi, kelin1003, vaishuagola27, rahulsprajapati, Joel-James, utkarshpatel, gsayed786, shashwatmittal, sudhiryadav, thrijith, stayallive, jaredwsmith, abhijitrakas, umeshnevase, sid177, souptik, arafatkn, subscriptiongroup, akrocks
**Contributors:** rtcamp, rahul286, saurabhshukla, manishsongirkar36, faishal, desaiuditd, darren-slatten, jk3us, daankortenbach, telofy, pjv, llonchj, jinnko, weskoop, bcole808, gungeekatx, rohanveer, chandrapatel, gagan0123, ravanh, michaelbeil, samedwards, niwreg, entr, nuvoPoint, iam404, rittesh.patel, vishalkakadiya, BhargavBhandari90, vincent-lu, murrayjbrown, bryant1410, 1gor, matt-h, pySilver, johan-chassaing, dotsam, sanketio, petenelson, nathanielks, rigagoogoo, dslatten, jinschoi, kelin1003, vaishuagola27, rahulsprajapati, Joel-James, utkarshpatel, gsayed786, shashwatmittal, sudhiryadav, thrijith, stayallive, jaredwsmith, abhijitrakas, umeshnevase, sid177, souptik, arafatkn, subscriptiongroup, akrocks, Vedant-Gandhi

**Tags:** nginx, cache, purge, nginx map, nginx cache, maps, fastcgi, proxy, redis, redis-cache, rewrite, permalinks

Expand Down
2 changes: 1 addition & 1 deletion admin/class-nginx-helper-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public function nginx_helper_settings() {
$data['cache_method'] = 'enable_redis';
$data['redis_hostname'] = RT_WP_NGINX_HELPER_REDIS_HOSTNAME;
$data['redis_port'] = RT_WP_NGINX_HELPER_REDIS_PORT;
$data['redis_prefix'] = RT_WP_NGINX_HELPER_REDIS_PREFIX;
$data['redis_prefix'] = RT_WP_NGINX_HELPER_REDIS_PREFIX;

return $data;

Expand Down
7 changes: 7 additions & 0 deletions admin/partials/nginx-helper-general-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
'purge_page_on_deleted_comment',
'purge_feeds',
'smart_http_expire_form_nonce',
'preload_cache',
);

$all_inputs = array();
Expand Down Expand Up @@ -126,6 +127,12 @@
<label for="enable_purge"><?php esc_html_e( 'Enable Purge', 'nginx-helper' ); ?></label>
</td>
</tr>
<tr valign="top">
<td>
<input type="checkbox" value="1" id="preload_cache" name="preload_cache" <?php checked( $nginx_helper_settings['preload_cache'], 1 ); ?> />
<label for="preload_cache"><?php esc_html_e( 'Preload Cache', 'nginx-helper' ); ?></label>
</td>
</tr>
</table>
</div> <!-- End of .inside -->
</div>
Expand Down
3 changes: 3 additions & 0 deletions includes/class-nginx-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ private function define_admin_hooks() {

// expose action to allow other plugins to purge the cache.
$this->loader->add_action( 'rt_nginx_helper_purge_all', $nginx_purger, 'purge_all' );

// add action to preload the cache
$this->loader->add_action( 'admin_init', $nginx_helper_admin, 'preload_cache' );
}

/**
Expand Down

0 comments on commit 9392d75

Please sign in to comment.