Plugin Directory

Changeset 3179950


Ignore:
Timestamp:
11/01/2024 12:51:50 PM (16 months ago)
Author:
arstudios
Message:

Release 1.10.0

Location:
constellation-client-portal
Files:
131 added
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • constellation-client-portal/trunk/README.txt

    r3160933 r3179950  
    55Requires at least: 6.0.0
    66Tested up to: 6.6
    7 Stable tag: 1.9.0
     7Stable tag: 1.10.0
    88Requires PHP: 7.4
    99License: GPLv3 or later
     
    4343* Add internal notes to File and Invoice posts.
    4444* Export file and invoice lists to CSV.
    45 * Create [global client pages](https://adrianrodriguezstudios.com/2023/05/16/how-to-utilize-global-pages/ "Client Portal Global Pages").
     45* Create [global client pages](https://adrianrodriguezstudios.com/2023/05/16/how-to-utilize-global-pages/ "Client Portal Global Pages") that can be accessed by multiple companies.
    4646* Create global client files that can be accessed by more than one company.
    4747
     
    210210
    211211== Changelog ==
     212= 1.10.0 (Pro) - 2024-11-1 =
     213* Fix: Fixed nonce issue preventing new post notifications from being sent when posts are created via the Quick Create UI.
     214* Update: Updated the automated email functionality to not send a notification if the company has a status with a prevent-file-access action assigned to it.
     215* Update: Updated the automated email functionality to not send a notification if the primary WP user assigned to a company is not active.
     216* Update: Removed reference to accp_new_file_email_notification that was hooked to the deprecated accp_after_file_upload action.
     217* Fix: Updated the new post email notification function to work with both a new post nonce and a CSV import nonce to fix issue in which new post notification emails were not sent during CSV import.
     218* Fix: Fixed issue with the accp_save_post function that caused errors in automated email post notes, generated via cron, which in turn prevented automated emails from being sent reliably.
     219* Feature: Added new accp_edit_automated_email_cron_event_schedule filter that allows the automated email WP cron event schedule to be edited.
     220* Improvement: Improved the company primary user assignment to prevent cases where an unassigned primary company user could still trigger an automated email notification.
     221* Improvement: Improved the automated email notification digest functionality to ensure that digest emails are grouped properly by company.
     222* Improvement: Improved the automated email date comparisons to ensure that emails are sent for missed cron jobs, and that duplicate emails are not sent when the current date equals the last sent date.
     223* Fix: Fixed issue with undefined item_list variable in automated digest emails.
     224* Update: Removed unneeded instances of wp_doing_cron within automated email functions.
     225* Update: Updated the recurring email date calculation to fix issues in which no post ID's were returned in a set.
     226* Update: Updated the automated email date-before and date-after query arg functions to include a type => date key/value in meta query args that contain a date comparison.
     227
     228= 1.10.0 (Core) - 2024-11-1 =
     229* Update: Updated the accp_save_post function to guard against conflicts with other post types, and resolve conflicts with automated email cron note creation.
     230* Fix: Fixed typo in the note that is posted to file and invoice posts when the company is reassigned.
     231* Update: Removed unneeded comment.
     232* Update: Removed extraneous dev file.
     233
    212234= 1.9.0 (Pro) - 2024-10-1 =
    213235* Update: Updated the syntax to check if wp_cron is disabled in the automated email settings.
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-admin.php

    r3145386 r3179950  
    566566     *
    567567     * @hooked plugin_action_links_{$plugin_file}.
    568      *
    569      * Dev Note: Phpcs flagged the use of unused params.  These are related to a WP hook,
    570      * and the presence of these params is acceptable.
    571568     */
    572569    public function accp_add_links_to_plugin_row_actions_menu( $actions ) {
     
    14941491             * Append to notes.
    14951492             */
    1496             $note .= 'A new directory (' . $new_company_path . ') was created.\n';
     1493            $note .= '<p>A new directory (' . $new_company_path . ') was created.</p>';
    14971494
    14981495        }
     
    22372234    public function accp_save_post( $post_id, $post = null ) {
    22382235
    2239         if ( ! is_user_logged_in() ) {
    2240             return wp_die( 'Invalid command.' );
    2241         }
    2242 
    2243         if ( ! current_user_can( 'upload_files' ) ) {
     2236        $post      = get_post( $post_id );
     2237        $post_type = $post->post_type;
     2238
     2239        /**
     2240         * Exit early if this is not a client file,
     2241         * client invoice, or global file post type.
     2242         */
     2243        if ( 'accp_clientfile' !== $post_type && 'accp_clientinvoice' !== $post_type && 'accp_global_file' !== $post_type ) {
    22442244            return $post_id;
     2245        }
     2246
     2247        if ( ! wp_doing_cron() ) {
     2248
     2249            if ( ! is_user_logged_in() ) {
     2250                return;
     2251            }
     2252
     2253            if ( ! current_user_can( 'upload_files' ) ) {
     2254                return $post_id;
     2255            }
    22452256        }
    22462257
     
    22602271            return $post_id;
    22612272
    2262         }
    2263 
    2264         $post      = get_post( $post_id );
    2265         $post_type = $post->post_type;
    2266 
    2267         if ( 'accp_clientfile' !== $post_type && 'accp_clientinvoice' !== $post_type && 'accp_global_file' !== $post_type ) {
    2268             return $post_id;
    22692273        }
    22702274
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-company.php

    r3145386 r3179950  
    15651565        wp_mail( filter_var( $email, FILTER_SANITIZE_EMAIL ), esc_html( $subject ), wp_kses_post( $message ), $headers );
    15661566    }
     1567
     1568
     1569    /**
     1570     * Check if a company has a "prevent_file_access" status saved.
     1571     *
     1572     * @param int $company_id - The post ID of the company to check.
     1573     *
     1574     * @return bool $prevent_file_access_enabled - True if the company has a
     1575     * status with a "prevent_file_access" action assigned to it.
     1576     */
     1577    public function is_prevent_file_access_enabled_for_company( $company_id ) {
     1578
     1579        if ( ! $company_id || empty( $company_id ) ) {
     1580            return false;
     1581        }
     1582
     1583        $company = get_post( $company_id );
     1584
     1585        if ( ! $company || empty( $company ) || ! is_object( $company ) ) {
     1586            return false;
     1587        }
     1588
     1589        /**
     1590         * Get the defined company statuses.
     1591         */
     1592        $company_status_settings = get_option( 'accp_company_status_repeater' ) ? get_option( 'accp_company_status_repeater' ) : array();
     1593
     1594        if ( ! $company_status_settings || empty( $company_status_settings ) ) {
     1595            return false;
     1596        }
     1597
     1598        /**
     1599         * Return false if no company status is saved.
     1600         */
     1601        $company_status = get_post_meta( $company_id, 'accp_company_status', true ) ? get_post_meta( $company_id, 'accp_company_status', true ) : false;
     1602
     1603        if ( ! $company_status ) {
     1604
     1605            return false;
     1606
     1607        }
     1608
     1609        /**
     1610         * Check the defined statuses to see if the current
     1611         * company status has a status action set to prevent_file_access.
     1612         */
     1613        foreach ( $company_status_settings as $status_setting ) {
     1614
     1615            if ( $status_setting['value'] === $company_status ) {
     1616
     1617                /**
     1618                 * If the current company status has a defined action of
     1619                 * "prevent_file_access" in the plugin settings, return
     1620                 * true here to indicate that "prevent file access" is enabled.
     1621                 */
     1622                if ( 'prevent_file_access' === $status_setting['status_action'] ) {
     1623
     1624                    $authorized = true;
     1625
     1626                    return $authorized;
     1627
     1628                }
     1629            }
     1630        }
     1631
     1632        /**
     1633         * Fallback to false if we have
     1634         * made it this far.
     1635         */
     1636        return false;
     1637    }
    15671638} //End ARS_Constellation_Client_Portal_Company Class
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-users.php

    r3160933 r3179950  
    781781        return $users;
    782782    }
     783
     784
     785    /**
     786     * Check if WP user is active (i.e.
     787     * a Constellation client status of "active"
     788     * has been saved to the WP user profile).
     789     *
     790     * @param int $user_id - The user ID of the user to check.
     791     *
     792     * @return bool $is_user_active - True if the user has a client status of "active"
     793     * saved to their WP user profile. False if no status is saved, or if any
     794     * status other than "active" is saved.
     795     */
     796    public function is_user_active( $user_id ) {
     797
     798        if ( ! $user_id || empty( $user_id ) ) {
     799            return false;
     800        }
     801
     802        $user = get_user_by( 'id', $user_id );
     803
     804        if ( ! $user || empty( $user ) || ! is_object( $user ) ) {
     805            return false;
     806        }
     807
     808        $user_status = get_user_meta( $user_id, 'client_status', true );
     809
     810        if ( 'active' === $user_status ) {
     811
     812            return true;
     813        }
     814
     815        return false;
     816    }
    783817} // END ARS_Constellation_Client_Portal_Users
  • constellation-client-portal/trunk/ars-constellation-client-portal.php

    r3160933 r3179950  
    77 * Plugin URI:        https://adrianrodriguezstudios.com/constellation-client-portal/
    88 * Description:       Create private pages for each of your clients, post private files, and protect your client files from unauthorized users and search engines.  <strong>Important:</strong> All Site-level File Protection features will cease to function if the plugin is disabled or uninstalled.
    9  * Version:           1.9.0
     9 * Version:           1.10.0
    1010 * Author:            ARS
    1111 * Author URI:        https://adrianrodriguezstudios.com
     
    5757     */
    5858    define('ACCP_PLUGIN_NAME', 'ARS_CONSTELLATION_CLIENT_PORTAL');
    59     define('ACCP_PLUGIN_VERSION', '1.9.0'); // Change the version in the header as well.
     59    define('ACCP_PLUGIN_VERSION', '1.10.0'); // Change the version in the header as well.
    6060    define( ACCP_PLUGIN_NAME, ACCP_PLUGIN_VERSION );
    6161    define( 'ACCP_PLUGIN_FILE_NAME', __FILE__ );
Note: See TracChangeset for help on using the changeset viewer.