Plugin Directory

Changeset 3363221


Ignore:
Timestamp:
09/17/2025 01:03:04 PM (5 months ago)
Author:
arstudios
Message:

Constellation Client Portal release 2.4.0.

Location:
constellation-client-portal
Files:
134 added
1 deleted
8 edited

Legend:

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

    r3352742 r3363221  
    55Requires at least: 6.0.0
    66Tested up to: 6.8
    7 Stable tag: 2.3.0
     7Stable tag: 2.4.0
    88Requires PHP: 7.4
    99License: GPLv3 or later
     
    3232* Automatically redirect clients to their private client page at login (optional login redirect setting).
    3333* Integrate your invoices with WooCommerce and add a pay button to your unpaid invoices, and accept payments from your customers and clients (requires WooCommerce).
    34 * Change the Client Page, Client File, and Client Invoice URL base names ("accp-client-page," "accp_clientfile," and "accp_clientinvoice) to names of your choosing.
     34* Change the Client Page, Client File, and Client Invoice URL base names ("accp-client-page," "accp-clientfile," and "accp-clientinvoice) to names of your choosing.
    3535* Automatically send email notifications to clients when a new File or Invoice post is created.
    3636* Automatically send reminder email notifications on a schedule.
     
    210210
    211211== Changelog ==
     212= 2.4.0 (Pro) - 2025-9-17 =
     213* Update: Added link to the company onboard wizard in the WP admin sidebar conditionally displayed Company menu section.
     214
     215= 2.4.0 (Core) - 2025-9-17 =
     216* Update: Added new Launch Company Onboard Wizard button to the company WP list table.
     217* Fix: Fixed broken logo image link in the set up wizard.
     218* Update: Added link to the company onboard wizard in the WP admin sidebar menu.
     219* Update: Added link to the company onboard wizard in the plugin settings help section.
     220* Feature: Add new company onboard wizard.
     221
    212222= 2.3.0 (Pro) - 2025-8-29 =
    213223* Update: All core updates.
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-admin.php

    r3352742 r3363221  
    32083208         */
    32093209        add_submenu_page( 'accp-settings', 'Companies', 'Companies', 'manage_options', 'edit.php?post_type=accp_clientcompany' );
     3210
     3211        /**
     3212         * Company onboard wizard.
     3213         */
     3214        add_submenu_page( 'accp-settings', 'Company Onboard Wizard', 'Company Onboard Wizard', 'manage_options', 'admin.php?page=accp-company-onboard-wizard' );
    32103215    }
    32113216
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-company.php

    r3352742 r3363221  
    17051705        return false;
    17061706    }
     1707
     1708
     1709    /**
     1710     * Add the bulk create section to the Client Client
     1711     * Company WP list table.
     1712     *
     1713     * @param array $views - An array of available list table views.
     1714     *
     1715     * @hooked views_edit-accp_clientcompany
     1716     */
     1717    public function add_company_onboard_wizard_button_to_company_list( $views ) {
     1718
     1719        if ( ! is_admin() || ! current_user_can( 'manage_options' ) || ! is_user_logged_in() ) {
     1720            return;
     1721        }
     1722
     1723        $admin_url  = get_admin_url();
     1724        $wizard_url = $admin_url . 'admin.php?page=accp-company-onboard-wizard';
     1725        ?>
     1726
     1727        <a href="<?php echo esc_url( $wizard_url ); ?>" class="accp-launch-company-onboard-button button right">Launch Company Onboard Wizard</a>
     1728        <?php
     1729
     1730        return $views;
     1731    }
    17071732} //End ARS_Constellation_Client_Portal_Company Class
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-settings.php

    r3352742 r3363221  
    827827    public function get_core_content_for_help_settings_page() {
    828828
    829         $is_pro            = $this->utilities->is_pro_plugin( $this->plugin_name );
    830         $wp_admin_url      = get_admin_url();
    831         $list_settings_url = $wp_admin_url . 'admin.php?page=accp-list-settings&title=Lists';
    832         $setup_wizard_url  = $wp_admin_url . 'admin.php?page=accp-plugin-activation-wizard';
     829        $is_pro             = $this->utilities->is_pro_plugin( $this->plugin_name );
     830        $wp_admin_url       = get_admin_url();
     831        $list_settings_url  = $wp_admin_url . 'admin.php?page=accp-list-settings&title=Lists';
     832        $setup_wizard_url   = $wp_admin_url . 'admin.php?page=accp-plugin-activation-wizard';
     833        $company_wizard_url = $wp_admin_url . 'admin.php?page=accp-company-onboard-wizard';
    833834
    834835        $html = '';
     
    920921
    921922        $html .= '<p>Launch the <a href="' . esc_url( $setup_wizard_url ) . '">setup wizard</a>. This is the wizard that is launched when the plugin is activated, and walks you through the initial basic setup.</p>';
     923
     924        $html .= '</div>';
     925
     926        /**
     927         * Company Onboard Wizard
     928         */
     929        $html .= '<div class="accp-settings-section">';
     930
     931        $html .= '<h2>Company Onboard Wizard</h2>';
     932
     933        $html .= '<p>Launch the <a href="' . esc_url( $company_wizard_url ) . '">company onboard wizard</a>. This is used to add a new company, add and a assign a company home page, and add and assign a primary user to the company.</p>';
    922934
    923935        $html .= '</div>';
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-wizards.php

    r3352742 r3363221  
    7777
    7878        /**
     79         * Add company onboard wizard admin menu pages.
     80         */
     81        add_action( 'admin_menu', array( $this, 'add_company_onboard_wizard_pages_to_wp_admin' ) );
     82
     83        /**
     84         * Update defined wizard pages for the company onboard wizard.
     85         */
     86        add_action( 'admin_init', array( $this, 'update_defined_pages_for_company_onboard_wizard' ) );
     87
     88        /**
    7989         * Add body class to plugin activation wizard pages.
    8090         */
     
    280290
    281291        $defined_wizard_pages = $this->get_plugin_activation_defined_wizard_pages();
     292
     293        if ( ! $defined_wizard_pages || empty( $defined_wizard_pages ) ) {
     294            return;
     295        }
     296
     297        $this->add_accp_wizard_pages_to_wp_admin( $defined_wizard_pages );
     298    }
     299
     300
     301    /**
     302     * Add the company onboard wizard pages to WP Admin.
     303     */
     304    public function add_company_onboard_wizard_pages_to_wp_admin() {
     305
     306        if ( ! is_admin() || ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
     307            return;
     308        }
     309
     310        $page_list = array(
     311            'accp-company-onboard-wizard' => 'Onbard a Company',
     312        );
     313
     314        /**
     315         * Generate an array containing the page URL
     316         * using the simple page_list array.
     317         */
     318        $defined_wizard_pages = array();
     319
     320        foreach ( $page_list as $slug => $label ) {
     321
     322            if ( $slug && $label && ! empty( $slug ) && ! empty( $slug ) ) {
     323
     324                $defined_wizard_pages[ $slug ] = $this->core_settings->genarate_settings_page_item_array( $slug, $label );
     325
     326            }
     327        }
    282328
    283329        if ( ! $defined_wizard_pages || empty( $defined_wizard_pages ) ) {
     
    484530        $admin_url          = get_admin_url();
    485531        $main_settings_page = $admin_url . 'admin.php?page=accp-settings';
     532        $logo_url           = ACCP_PLUGIN_DIR_URL . 'assets/img/accp-full-logo.png';
     533        $wizard_type        = '&wizard_type=plugin-install';
    486534
    487535        if ( ! $next_step_url || empty( $next_step_url ) ) {
    488536
    489             $next_step_url = $admin_url . 'admin.php?page=accp-wizard-add-company';
     537            $next_step_url = $admin_url . 'admin.php?page=accp-wizard-add-company' . $wizard_type;
    490538
    491539        } else {
    492540
    493             $next_step_url = sanitize_url( $next_step_url );
     541            $next_step_url = sanitize_url( $next_step_url . $wizard_type );
    494542
    495543        }
     
    507555        $html .= '<div class="accp-wizard-logo-container">';
    508556
    509         $html .= '<img src="https://localhost:8443/wp-content/plugins/ars-constellation-client-portal-dev/assets/img/accp-full-logo.png">';
     557        $html .= '<img src="' . esc_url( $logo_url ) . '">';
    510558
    511559        $html .= '</div>';
     
    534582
    535583    /**
    536      * Get the wizard add company page html.
     584     * Get the wizard initial page html.
    537585     *
    538586     * @param string $next_step_url - The url of the next page in the wizard. Default = null.
    539587     */
    540     public function get_wizard_add_company_page_content( $next_step_url = '' ) {
     588    public function get_company_onboard_wizard_page_content( $next_step_url = '' ) {
    541589
    542590        if ( ! is_admin() || ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
     
    548596        $admin_url          = get_admin_url();
    549597        $main_settings_page = $admin_url . 'admin.php?page=accp-settings';
     598        $logo_url           = ACCP_PLUGIN_DIR_URL . 'assets/img/accp-full-logo.png';
     599        $wizard_type        = '&wizard_type=company-onboard';
    550600
    551601        if ( ! $next_step_url || empty( $next_step_url ) ) {
    552602
    553             $next_step_url = $admin_url . 'admin.php?page=accp-wizard-add-company-home-page';
     603            $next_step_url = $admin_url . 'admin.php?page=accp-wizard-add-company' . $wizard_type;
    554604
    555605        } else {
    556606
    557             $next_step_url = sanitize_url( $next_step_url );
     607            $next_step_url = sanitize_url( $next_step_url . $wizard_type );
     608
     609        }
     610
     611        if ( true === $this->utilities->is_pro_plugin( $this->plugin_name ) ) {
     612            $title .= ' Pro';
     613        }
     614
     615        $html = '';
     616
     617        $html .= '<div class="accp-wizard-content-container">';
     618
     619        $html .= '<h1>Onboard a Company</h1>';
     620
     621        $html .= '<div class="accp-wizard-logo-container">';
     622
     623        $html .= '<img src="' . esc_url( $logo_url ) . '">';
     624
     625        $html .= '</div>';
     626
     627        $html .= '<h2>Company onboard wizard.</h2>';
     628
     629        $html .= '<p>This wizard will walk you through setting up a company, adding a company home page, and adding a primary user to the company.</p>';
     630
     631        $html .= '<div class="accp-wizard-button-container accp-wizard-next-setup-button-container">';
     632
     633        $html .= '<span class="accp-wizard-continue-button"><a href="' . esc_url( $next_step_url ) . '">Continue Set Up</a></span>';
     634
     635        $html .= '</div>';
     636
     637        $html .= '<div class="accp-wizard-button-container accp-wizard-skip-setup-button-container">';
     638
     639        $html .= '<span class="accp-wizard-close-wizard-button"><a href="' . esc_url_raw( $main_settings_page ) . '">Skip Set Up</a></span>';
     640
     641        $html .= '</div>';
     642
     643        $html .= '</div>';
     644
     645        echo wp_kses( $this->generate_wizard_page_html( $html, true, false ), $allowed_html );
     646    }
     647
     648
     649    /**
     650     * Get the wizard type url param.
     651     *
     652     * @return string  $url_string - The url string or empty;
     653     */
     654    public function get_wizard_type_url_string() {
     655
     656        if ( ! is_admin() || ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
     657            return;
     658        }
     659
     660        $wizard_type = filter_input( INPUT_GET, 'wizard_type' );
     661
     662        if ( ! isset( $wizard_type ) || empty( $wizard_type ) ) {
     663            return '';
     664        }
     665
     666        $url_string = '&wizard_type=' . $wizard_type;
     667
     668        return sanitize_text_field( $url_string );
     669    }
     670
     671
     672    /**
     673     * Update the defined plugin activation wizard pages
     674     * for the company onboarding wizard.
     675     */
     676    public function update_defined_pages_for_company_onboard_wizard() {
     677
     678        if ( ! is_admin() || ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
     679            return;
     680        }
     681
     682        $page_slug = filter_input( INPUT_GET, 'page' );
     683
     684        if ( ! isset( $page_slug ) ) {
     685            return;
     686        }
     687
     688        if ( ! $page_slug || empty( $page_slug ) || 'accp-company-onboard-wizard' !== $page_slug ) {
     689            return;
     690        }
     691
     692        add_filter(
     693            'accp_update_defined_plugin_install_wizard_pages',
     694            function ( $page_list ) {
     695
     696                /**
     697                 * Remove the plugin activation wizard first page.
     698                 */
     699                unset( $page_list['accp-plugin-activation-wizard'] );
     700
     701                /**
     702                 * Add the company onboard wizard first page as
     703                 * the new first item in the defined page array.
     704                 */
     705                $first_item = array( 'accp-company-onboard-wizard' => 'Onboard a Company' );
     706                $page_list  = $first_item + $page_list;
     707
     708                return $page_list;
     709            }
     710        );
     711    }
     712
     713
     714    /**
     715     * Get the wizard add company page html.
     716     *
     717     * @param string $next_step_url - The url of the next page in the wizard. Default = null.
     718     */
     719    public function get_wizard_add_company_page_content( $next_step_url = '' ) {
     720
     721        if ( ! is_admin() || ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
     722            return;
     723        }
     724
     725        $allowed_html       = $this->core_settings->get_customized_allowed_html_for_wp_kses();
     726        $title              = 'Constellation Client Portal';
     727        $admin_url          = get_admin_url();
     728        $main_settings_page = $admin_url . 'admin.php?page=accp-settings';
     729        $wizard_type        = $this->get_wizard_type_url_string();
     730
     731        if ( ! $next_step_url || empty( $next_step_url ) ) {
     732
     733            $next_step_url = $admin_url . 'admin.php?page=accp-wizard-add-company-home-page' . $wizard_type;
     734
     735        } else {
     736
     737            $next_step_url = sanitize_url( $next_step_url . $wizard_type );
    558738
    559739        }
     
    621801        $main_settings_page = $admin_url . 'admin.php?page=accp-settings';
    622802        $company_id         = filter_input( INPUT_GET, 'company_id', FILTER_SANITIZE_NUMBER_INT );
     803        $wizard_type        = $this->get_wizard_type_url_string();
    623804
    624805        if ( ! $next_step_url || empty( $next_step_url ) ) {
    625806
    626             $next_step_url = $admin_url . 'admin.php?page=accp-wizard-add-company-primary-user';
     807            $next_step_url = $admin_url . 'admin.php?page=accp-wizard-add-company-primary-user' . $wizard_type;
    627808
    628809        } else {
    629810
    630             $next_step_url = sanitize_url( $next_step_url );
     811            $next_step_url = sanitize_url( $next_step_url . $wizard_type );
    631812
    632813        }
     
    791972        $page_id            = filter_input( INPUT_GET, 'page_id', FILTER_SANITIZE_NUMBER_INT ) ? filter_input( INPUT_GET, 'page_id', FILTER_SANITIZE_NUMBER_INT ) : '';
    792973        $page_id_attribute  = $page_id && ! empty( $page_id ) ? 'data-page-id=' . $page_id : '';
     974        $wizard_type        = $this->get_wizard_type_url_string();
    793975
    794976        if ( ! $next_step_url || empty( $next_step_url ) ) {
    795977
    796             $next_step_url = $admin_url . 'admin.php?page=accp-wizard-complete-page';
     978            $next_step_url = $admin_url . 'admin.php?page=accp-wizard-complete-page' . $wizard_type;
    797979
    798980        } else {
    799981
    800             $next_step_url = sanitize_url( $next_step_url );
     982            $next_step_url = sanitize_url( $next_step_url . $wizard_type );
    801983
    802984        }
     
    10251207        $company_id         = filter_input( INPUT_GET, 'company_id', FILTER_SANITIZE_NUMBER_INT ) ? filter_input( INPUT_GET, 'company_id', FILTER_SANITIZE_NUMBER_INT ) : '';
    10261208        $page_id            = filter_input( INPUT_GET, 'page_id', FILTER_SANITIZE_NUMBER_INT ) ? filter_input( INPUT_GET, 'page_id', FILTER_SANITIZE_NUMBER_INT ) : '';
     1209        $wizard_type        = filter_input( INPUT_GET, 'wizard_type' );
     1210
     1211        if ( 'company-onboard' === $wizard_type ) {
     1212
     1213            $intro = '<p>Congratulations! Your new company has been created.</p>';
     1214
     1215        } else {
     1216
     1217            $intro = '<p>Congratulations! You\'ve created your first company to help you get started.  You can add more companies later (as many as you need), and the "next steps" below will help you complete the initial set up of your portal.</p>';
     1218
     1219        }
    10271220
    10281221        $next_step_args = array(
    1029             'company_id' => $company_id,
    1030             'page_id'    => $page_id,
    1031             'item_tag'   => 'div',
     1222            'company_id'  => $company_id,
     1223            'page_id'     => $page_id,
     1224            'item_tag'    => 'div',
     1225            'wizard_type' => $wizard_type,
    10321226        );
    10331227
     
    10541248        $html .= '<h1>Complete</h1>';
    10551249
    1056         $html .= '<p>Congratulations! You\'ve created your first company to help you get started.  You can add more companies later (as many as you need), and the "next steps" below will help you complete the initial set up of your portal.</p>';
     1250        $html .= $intro;
    10571251
    10581252        $html .= '<h2>Next Steps</h2>';
     
    14701664     *
    14711665     * $args = array(
    1472      * 'company_id' = $company_id,
    1473      * 'page_id'    = $page_id,
    1474      * 'item_tag'   = '', // Ex. li, p, div.
     1666     * 'company_id'  = $company_id,
     1667     * 'page_id'     = $page_id,
     1668     * 'item_tag'    = '', // Ex. li, p, div.
     1669     * 'wizard_type' = $wizard_type, // plugin-install or company-onboard.
    14751670     * ).
    14761671     *
     
    14861681        $page_id           = array_key_exists( 'page_id', $args ) && ! empty( $args['page_id'] ) ? (int) $args['page_id'] : '';
    14871682        $item_tag          = array_key_exists( 'item_tag', $args ) && ! empty( $args['item_tag'] ) ? sanitize_text_field( $args['item_tag'] ) : '';
     1683        $wizard_type       = array_key_exists( 'wizard_type', $args ) && ! empty( $args['wizard_type'] ) ? sanitize_text_field( $args['wizard_type'] ) : '';
    14881684        $tag_open          = '';
    14891685        $tag_close         = '';
     
    15901786         * Add a menu to client page.
    15911787         */
    1592         $next_steps['add_my_home_link'] = $tag_open . '<h3 class="accp-wizard-next-step-heading">Add My Home Link</h3>Add a My Home shortcode link throughout your site that will link to user\'s client page.' . $my_home_menu_description . $tag_close;
     1788        if ( 'company-onboard' !== $wizard_type ) {
     1789
     1790            $next_steps['add_my_home_link'] = $tag_open . '<h3 class="accp-wizard-next-step-heading">Add My Home Link</h3>Add a My Home shortcode link throughout your site that will link to user\'s client page.' . $my_home_menu_description . $tag_close;
     1791
     1792        }
    15931793
    15941794        /**
     
    15971797        if ( true !== $is_pro ) {
    15981798
    1599             $next_steps['upgrade'] = $tag_open . '<h3 class="accp-wizard-next-step-heading">Upgrade to Pro</h3>Upgrade to the <a href="https://constellationclientportal.com/" target="_blank">Pro version</a> and automatically redirect users to their client page at login, enable automated client email notifications, customize the URL (page slug) for client pages, file and invoice posts - as well as many other powerful features.' . $tag_close;
    1600 
     1799            if ( 'company-onboard' !== $wizard_type ) {
     1800
     1801                $next_steps['upgrade'] = $tag_open . '<h3 class="accp-wizard-next-step-heading">Upgrade to Pro</h3>Upgrade to the <a href="https://constellationclientportal.com/" target="_blank">Pro version</a> and automatically redirect users to their client page at login, enable automated client email notifications, customize the URL (page slug) for client pages, file and invoice posts - as well as many other powerful features.' . $tag_close;
     1802
     1803            }
    16011804        }
    16021805
  • constellation-client-portal/trunk/admin/css/ars-constellation-client-portal-admin.css

    r3352742 r3363221  
    12341234}
    12351235
     1236.accp-launch-company-onboard-button.button.right {
     1237    margin-left: 7px;
     1238}
     1239
    12361240@media screen and (min-width: 980px){
    12371241
  • constellation-client-portal/trunk/ars-constellation-client-portal.php

    r3352742 r3363221  
    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:           2.3.0
     9 * Version:           2.4.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', '2.3.0'); // Change the version in the header as well.
     59    define('ACCP_PLUGIN_VERSION', '2.4.0'); // Change the version in the header as well.
    6060    define( ACCP_PLUGIN_NAME, ACCP_PLUGIN_VERSION );
    6161    define( 'ACCP_PLUGIN_FILE_NAME', __FILE__ );
  • constellation-client-portal/trunk/includes/class-ars-constellation-client-portal.php

    r3352742 r3363221  
    428428
    429429        /**
     430         * Add company onboard wizard button to the Client company WP list tables.
     431         */
     432        $this->loader->add_filter( 'views_edit-accp_clientcompany', $plugin_company, 'add_company_onboard_wizard_button_to_company_list', 10, 1 );
     433
     434        /**
    430435         * Client Company - Add custom fields.
    431436         */
Note: See TracChangeset for help on using the changeset viewer.