Plugin Directory

Changeset 2657343


Ignore:
Timestamp:
01/13/2022 05:50:21 PM (4 years ago)
Author:
MattGeri
Message:

Release - 2.4.3

Location:
wp-discussion-board/trunk
Files:
6 added
6 edited

Legend:

Unmodified
Added
Removed
  • wp-discussion-board/trunk/CONTRIBUTING.md

    r2531334 r2657343  
    33Thank 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.
    44
    5 ## Ways to Contribute
     5## Ways to contribute
    66
    77There 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:
    88
    9 ### Report Bugs
     9### Report bugs
    1010
    1111Lets 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.
     
    1919We'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.
    2020
    21 ## Development workflow
     21## Contributing code
    2222
    23 Our workflow is very basic.
     23WP 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:
    2424
    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
    3033
    31 ## Release workflow
     34### Refactoring
    3235
    33 To prepare and deploy a release, follow these steps.
     36There are some important notes to keep in mind when it comes to refactoring.
    3437
    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
     42The 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
     51We strictly follow the [WPCS](https://github.com/WordPress/WordPress-Coding-Standards) guidelines for our coding standards.
     52
     53To lint your code, make sure Composer is up to date by running `composer update`. And then run `composer lint` to run WPCS.
    4154
    4255## Development environment
     
    5467If 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/).
    5568
    56 ## Code standards
    5769
    58 We strictly follow the [WPCS](https://github.com/WordPress/WordPress-Coding-Standards) guidelines for our coding standards.
     70## Development workflow
    5971
    60 To lint your code, make sure Composer is up to date by running `composer update`. And then run `composer lint` to run WPCS.
     72Our 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
     84To 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  
    3131            add_action( 'admin_init', array( $this, 'prevent_wp_admin_access' ), 100 );
    3232            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 );
    3434            add_action( 'admin_notices', array( $this, 'ctdb_admin_notices' ) );
    3535            add_action( 'admin_footer', array( $this, 'user_registration_notice_script' ) );
     
    3838            add_action( 'edit_user_profile', array( $this, 'ctdb_display_activation_key' ), 10, 1 );
    3939            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            }
    4059        }
    4160
     
    4362         * Enqueue scripts.
    4463         */
    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
    4671            wp_enqueue_style( 'ctdb-admin-style', WPDBD_PLUGIN_URL . 'assets/css/admin-style.css', array(), WPDBD_PLUGIN_VERSION );
    4772        }
  • wp-discussion-board/trunk/includes/classes/class-ct-db-registration.php

    r2553218 r2657343  
    10151015
    10161016            // 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 ) );
    10191032                wp_redirect( $redirect_url );
    10201033                exit;
  • wp-discussion-board/trunk/includes/config/config.php

    r2581527 r2657343  
    1919
    2020if ( ! defined( 'WPDBD_PLUGIN_VERSION' ) ) {
    21     define( 'WPDBD_PLUGIN_VERSION', '2.4.2' );
     21    define( 'WPDBD_PLUGIN_VERSION', '2.4.3' );
    2222}
  • wp-discussion-board/trunk/readme.txt

    r2581527 r2657343  
    66Tested up to: 5.7
    77Requires PHP: 5.2.4
    8 Stable tag: 2.4.2
     8Stable tag: 2.4.3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    178178== Changelog ==
    179179
    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 =
    181186* Added: oEmbeds for replies
    182187
    183 = 2.4.1, June 24 2021 =
     188= 2.4.1, June 24, 2021 =
    184189* Fixed: Always enqueue customizer color picker as some themes don't include it
    185190* Fixed: Allow user to reset password when forcing the plugin login form
    186191
    187 = 2.4, May 13 2021 =
     192= 2.4, May 13, 2021 =
    188193* Major update, please test before upgrading
    189194* Updated: Refactor admin code to be cleaner and easier to extend
     
    201206* Fixed: After a user registers, don't show the registration form again
    202207
    203 = 2.3.15, May 11 2020 =
     208= 2.3.15, May 11, 2020 =
    204209* Added: ctdb_admin_email filter
    205210* Fixed: added second parameter to wp_login
  • wp-discussion-board/trunk/wp-discussion-board.php

    r2581527 r2657343  
    44Plugin URI: https://wpdiscussionboard.com
    55Description: Provide a simple discussion board for your site
    6 Version: 2.4.2
     6Version: 2.4.3
    77Author: WP Discussion Board
    88Author URI: https://wpdiscussionboard.com
     
    2626require_once 'includes/config/config.php';
    2727
    28 if ( is_admin() ) {
     28if ( is_admin() || wp_doing_cron() ) {
    2929    require_once 'includes/config/settings.php';
    3030}
Note: See TracChangeset for help on using the changeset viewer.