Changeset 2657343
- Timestamp:
- 01/13/2022 05:50:21 PM (4 years ago)
- Location:
- wp-discussion-board/trunk
- Files:
-
- 6 added
- 6 edited
-
CONTRIBUTING.md (modified) (3 diffs)
-
assets/css/lib (added)
-
assets/css/lib/select2.min.css (added)
-
assets/js (added)
-
assets/js/lib (added)
-
assets/js/lib/select2.min.js (added)
-
assets/js/settings.js (added)
-
includes/classes/admin/class-admin.php (modified) (3 diffs)
-
includes/classes/class-ct-db-registration.php (modified) (1 diff)
-
includes/config/config.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
wp-discussion-board.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-discussion-board/trunk/CONTRIBUTING.md
r2531334 r2657343 3 3 Thank you for contributing to the WP Discussion Board plugin! This short guide details the procedures and workflows for development and ongoing support of our plugin. 4 4 5 ## Ways to Contribute5 ## Ways to contribute 6 6 7 7 There are many ways in which you can help us make WP Discussion Board the best forum plugin for WordPress. Here are some of the ways: 8 8 9 ### Report Bugs9 ### Report bugs 10 10 11 11 Lets us know if you run into a bug when using the plugin. You can report a bug by submitting a [new Github Issue](https://github.com/wpdiscussionboard/wp-discussion-board/issues/new) on the project. Be sure to check the existing issues to make sure your bug is not already accounted for. Also, add as much detail as possible to the issue such as WordPress version, hosting environment, steps to reproduce and screenshots. … … 19 19 We're more than happy to accept bug fixes and even feature enhancements to the plugin. Code submissions are handled via Github pull requests. You can [submit a PR](https://github.com/wpdiscussionboard/wp-discussion-board/compare) via the repository. 20 20 21 ## Development workflow21 ## Contributing code 22 22 23 Our workflow is very basic. 23 WP Discussion Board has a legacy codebase which we're constantly trying to improve but also maintain backwards compatibility. We look to always keep the following in mind when adding code to the plugin: 24 24 25 - Always branch off of the `master` branch 26 - Name your branch after the Github issue i.e. `feature/1` or `fix/1` where 1 is the ID of the Github issue. We use the `feature` prefix for enhancements and `fix` for bugs 27 - Submit a PR to the repository against the `develop` branch when your feature or fix is ready to be reviewed 28 - Your PR will then be reviewed and changes requested where applicable 29 - Once everything checks out, the feature/fix will be pushed with the next weekly release 25 - Always look to improve code that your PR touches. If you're adding a feature or fixing a bug, make sure that you clean up any code that your feature/fix touches. Specifically, look to: 26 - Refactor code to remove code that is not [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) 27 - Break up large methods and functions in to smaller, reusable methods/functions 28 - Apply WordPress Code Standards (WordPress-Extra ruleset) to the code that does not strictly follow the standards 29 - Look for performance and security optimizations 30 - Apply OOP patterns to your code 31 - Make sure your changes are backwards compatible with prior versions (deprecations can be added where applicable) 32 - Add unit tests when introducing new functionality and when refactoring 30 33 31 ## Release workflow34 ### Refactoring 32 35 33 T o prepare and deploy a release, follow these steps.36 There are some important notes to keep in mind when it comes to refactoring. 34 37 35 - Create a new branch off of master with the following naming convention `release/x.x.x` where `x.x.x` is the next version number 36 - Merge all branches to be deployed to this branch 37 - Increment the version number in [readme.txt](readme.txt), [config.php](includes/config/config.php) and [wp-discussion-board.php](wp-discussion-board.php) 38 - Make sure all code docblocs reference the new version in their `@since` parameters 39 - Merge the final release branch in to the `master` branch 40 - Sync the changes to the SVN repo, tag and commit. This is a manual step for now 38 - The plugin currently uses the `ctdb` prefix in a number of places. Overtime, this should be changed to `wpdbd` for consistency, but it should be backwards compatible so that nothing breaks 39 40 ### Structure 41 42 The plugin currently does not strictly follow any design patterns or structured architecture. You will see spaghetti code, mixed with some semblances of structure. We're improving this and have recently introduced a structured framework for the plugin which should be adopted fully over time. The basics of this framework include: 43 44 - Auto-loading of objects 45 - Light-weight object factory/container 46 - Component based architecture and configuration 47 - Better naming conventions and folder structure 48 49 ### Code standards 50 51 We strictly follow the [WPCS](https://github.com/WordPress/WordPress-Coding-Standards) guidelines for our coding standards. 52 53 To lint your code, make sure Composer is up to date by running `composer update`. And then run `composer lint` to run WPCS. 41 54 42 55 ## Development environment … … 54 67 If you prefer to use your own custom local development environment, we recommend [LocalWP](https://localwp.com/) or a docker/vagrant based virtual environment like [Lando](https://lando.dev/) or [VVV2](https://varyingvagrantvagrants.org/). 55 68 56 ## Code standards57 69 58 We strictly follow the [WPCS](https://github.com/WordPress/WordPress-Coding-Standards) guidelines for our coding standards. 70 ## Development workflow 59 71 60 To lint your code, make sure Composer is up to date by running `composer update`. And then run `composer lint` to run WPCS. 72 Our workflow is very basic. 73 74 - Always branch off of the `master` branch 75 - Name your branch after the Github issue i.e. `feature/1` or `fix/1` where 1 is the ID of the Github issue. We use the `feature` prefix for enhancements and `fix` for bugs 76 - Submit a PR to the repository against the `release/x.x.x` (the next release of the plugin) branch when your feature or fix is ready to be reviewed 77 - Your PR will then be code reviewed and changes will be requested where applicable 78 - Once everything checks out, the feature/fix will be merged to the release branch 79 - Testing should now be done 80 - Once testing is passed and the release is ready, the branch will be merged to the `master` branch and deployed 81 82 ## Release workflow 83 84 To prepare and deploy a release, follow these steps. 85 86 - Create a new branch off of master with the following naming convention `release/x.x.x` where `x.x.x` is the next version number 87 - Merge all branches to be deployed to this branch 88 - Increment the version number in [readme.txt](readme.txt), [config.php](includes/config/config.php) and [wp-discussion-board.php](wp-discussion-board.php) 89 - Make sure all code docblocs reference the new version in their `@since` parameters 90 - Merge the final release branch in to the `master` branch 91 - Sync the changes to the SVN repo, tag and commit. This is a manual step for now but will be changed to use a tag and Github action shortly -
wp-discussion-board/trunk/includes/classes/admin/class-admin.php
r2531338 r2657343 31 31 add_action( 'admin_init', array( $this, 'prevent_wp_admin_access' ), 100 ); 32 32 add_action( 'admin_init', array( $this, 'save_tracker_settings' ), 20 ); 33 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );33 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 10, 1 ); 34 34 add_action( 'admin_notices', array( $this, 'ctdb_admin_notices' ) ); 35 35 add_action( 'admin_footer', array( $this, 'user_registration_notice_script' ) ); … … 38 38 add_action( 'edit_user_profile', array( $this, 'ctdb_display_activation_key' ), 10, 1 ); 39 39 add_filter( 'plugin_action_links_wp-discussion-board/wp-discussion-board.php', array( $this, 'filter_action_links' ), 10, 1 ); 40 41 add_action( 'wpdbd_load_assets', array( $this, 'load_assets_for_screen' ), 10, 1 ); 42 43 } 44 45 /** 46 * Loads assets for a particular screen. 47 * 48 * @since 2.4.3 49 */ 50 public function load_assets_for_screen( $type ) { 51 switch ( $type ) { 52 case 'settings': 53 wp_enqueue_style( 'wpdbd-select2', WPDBD_PLUGIN_URL . 'assets/css/lib/select2.min.css', array(), WPDBD_PLUGIN_VERSION ); 54 wp_enqueue_script( 'wpdbd-select2', WPDBD_PLUGIN_URL . 'assets/js/lib/select2.min.js', array(), WPDBD_PLUGIN_VERSION ); 55 wp_enqueue_script( 'wpdbd-settings', WPDBD_PLUGIN_URL . 'assets/js/settings.js', array( 'wpdbd-select2' ), WPDBD_PLUGIN_VERSION ); 56 wp_localize_script( 'wpdbd-settings', 'config', array() ); 57 break; 58 } 40 59 } 41 60 … … 43 62 * Enqueue scripts. 44 63 */ 45 public function enqueue_scripts() { 64 public function enqueue_scripts( $hook ) { 65 switch ( $hook ) { 66 case 'discussion-topics_page_discussion_board': 67 $this->load_assets_for_screen( 'settings' ); 68 break; 69 } 70 46 71 wp_enqueue_style( 'ctdb-admin-style', WPDBD_PLUGIN_URL . 'assets/css/admin-style.css', array(), WPDBD_PLUGIN_VERSION ); 47 72 } -
wp-discussion-board/trunk/includes/classes/class-ct-db-registration.php
r2553218 r2657343 1015 1015 1016 1016 // If we're heading towards wp-login.php and our settings are right 1017 if( 'wp-login.php' == $pagenow && isset( $options['hide_wp_login'] ) && isset( $options['frontend_login_page'] ) ) { 1018 $redirect_url = esc_url_raw( add_query_arg( 'login', 'bounced', get_permalink( $options['frontend_login_page'] ) ) ); 1017 if ( 'wp-login.php' === $pagenow && ! empty( $options['hide_wp_login'] ) && ! empty( $options['frontend_login_page'] ) ) { 1018 $frontend_login_page = $options['frontend_login_page']; 1019 1020 if ( 'publish' !== get_post_status( $frontend_login_page ) ) { 1021 return; 1022 } 1023 1024 $redirect_url = get_permalink( $frontend_login_page ); 1025 1026 // Check that the redirect URL is a valid page. 1027 if ( empty( $redirect_url ) ) { 1028 return; 1029 } 1030 1031 $redirect_url = esc_url_raw( add_query_arg( 'login', 'bounced', $redirect_url ) ); 1019 1032 wp_redirect( $redirect_url ); 1020 1033 exit; -
wp-discussion-board/trunk/includes/config/config.php
r2581527 r2657343 19 19 20 20 if ( ! defined( 'WPDBD_PLUGIN_VERSION' ) ) { 21 define( 'WPDBD_PLUGIN_VERSION', '2.4. 2' );21 define( 'WPDBD_PLUGIN_VERSION', '2.4.3' ); 22 22 } -
wp-discussion-board/trunk/readme.txt
r2581527 r2657343 6 6 Tested up to: 5.7 7 7 Requires PHP: 5.2.4 8 Stable tag: 2.4. 28 Stable tag: 2.4.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 178 178 == Changelog == 179 179 180 = 2.4.2, August 11 2021 = 180 = 2.4.3, January 13, 2022 = 181 * Updated: Use select2 for multi select on the roles and permissions input field 182 * Fixed: Don't redirect to the login page if it does not exist 183 * Fixed: Load settings when a cron is running 184 185 = 2.4.2, August 11, 2021 = 181 186 * Added: oEmbeds for replies 182 187 183 = 2.4.1, June 24 2021 =188 = 2.4.1, June 24, 2021 = 184 189 * Fixed: Always enqueue customizer color picker as some themes don't include it 185 190 * Fixed: Allow user to reset password when forcing the plugin login form 186 191 187 = 2.4, May 13 2021 =192 = 2.4, May 13, 2021 = 188 193 * Major update, please test before upgrading 189 194 * Updated: Refactor admin code to be cleaner and easier to extend … … 201 206 * Fixed: After a user registers, don't show the registration form again 202 207 203 = 2.3.15, May 11 2020 =208 = 2.3.15, May 11, 2020 = 204 209 * Added: ctdb_admin_email filter 205 210 * Fixed: added second parameter to wp_login -
wp-discussion-board/trunk/wp-discussion-board.php
r2581527 r2657343 4 4 Plugin URI: https://wpdiscussionboard.com 5 5 Description: Provide a simple discussion board for your site 6 Version: 2.4. 26 Version: 2.4.3 7 7 Author: WP Discussion Board 8 8 Author URI: https://wpdiscussionboard.com … … 26 26 require_once 'includes/config/config.php'; 27 27 28 if ( is_admin() ) {28 if ( is_admin() || wp_doing_cron() ) { 29 29 require_once 'includes/config/settings.php'; 30 30 }
Note: See TracChangeset
for help on using the changeset viewer.