Plugin Directory

Changeset 3030228


Ignore:
Timestamp:
02/01/2024 05:16:38 PM (2 years ago)
Author:
arstudios
Message:

Release 1.7.6.

Location:
constellation-client-portal
Files:
131 added
1 deleted
4 edited

Legend:

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

    r3018869 r3030228  
    55Requires at least: 5.0.0
    66Tested up to: 6.4
    7 Stable tag: 1.7.5
     7Stable tag: 1.7.6
    88Requires PHP: 7.4
    99License: GPLv3 or later
     
    127127= Company Menu (Pro) =
    128128
    129 **[accp_company_menu]**
     129`[accp_company_menu]`
    130130
    131131= Company Menu Shortcode Parameters =
     
    200200
    201201== Changelog ==
     202= 1.7.6 (Pro) - 2024-2-1 =
     203* Update: Minor code formatting updates.
     204
     205= 1.7.6 (Core) - 2024-2-1 =
     206* Update: Minor code formatting updates.
     207* Update: Wrapped all unwrapped shortcode examples in the readme file with backticks to prevent smart quotes from causing errors when cutting/pasting into WP.
     208
    202209= 1.7.5 (Pro) - 2024-1-8 =
    203210* Feature: Added functionality that allows a pay-all total to be displayed in invoice lists on the front-end.
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-admin.php

    r3004306 r3030228  
    339339        }
    340340
    341         // Set mime type header.
     341        /**
     342         * Set mime type header.
     343         */
    342344        header( 'Content-Type: ' . $mimetype );
    343345
    344         // Set file check header.
     346        /**
     347         * Set file check header.
     348         */
    345349        header( 'File-Check: validated' );
    346350
    347         // Actually serve the file.
     351        /**
     352         * Actually serve the file.
     353         */
    348354        readfile( $file );
    349355
    350     }
    351 
    352     /* End File Check Redirects */ 
     356    }   
    353357
    354358
     
    402406    }
    403407
     408
    404409    /** 
    405410     * Flush rewrite rules on plugin upgrade.
     
    445450
    446451    /**
    447      * Add additional menu items to the
    448      * plugin action menu.
     452     * Add additional menu items to the plugin action menu.
    449453     */
    450454    function accp_add_links_to_plugin_row_actions_menu( $actions, $plugin_file, $plugin_data, $context ){       
    451455           
    452         // Add a Settings menu item
     456        /**
     457         * Add a Settings menu item.
     458         */
    453459        $new_actions['accp_settings'] = sprintf( __( '<a href="%s">Settings</a>', 'accp' ), esc_url( admin_url( 'admin.php?page=accp-settings' ) ) );
    454460
    455         // Add a Settings menu item
     461        /**
     462         * Add a Quick Start menu item.
     463         */
    456464        $new_actions['accp_quick_start'] = sprintf( __( '<a href="%s" target="_blank">Quick Start</a>', 'accp' ), esc_url( 'https://adrianrodriguezstudios.com/documentation-constellation-client-portal/#quick-start' ) );
    457465
     
    466474    function accp_add_upgrade_link_to_plugin_row_actions_menu( $actions, $plugin_file, $plugin_data, $context ){       
    467475           
    468         // Add a Settings menu item
     476        /**
     477         * Add a Upgrade menu item.
     478         */
    469479        $new_actions['accp_upgrade'] = sprintf( __( '<a href="%s" target="_blank" style="font-weight: bold;">Upgrade to Pro</a>', 'accp' ), esc_url( 'https://adrianrodriguezstudios.com/constellation-client-portal/?utm_source=accp-upgrade-link' ) );
    470480
     
    483493    function accp_delete_file_on_post_delete(){
    484494
    485         // Verify the nonce
     495        /**
     496         * Verify the nonce.
     497         */
    486498        $nonce = filter_var($_POST['file_del_nonce'], FILTER_SANITIZE_STRING);
    487499
     
    496508        if($post_type != 'accp_clientcompany'){
    497509
    498             // Check if the post has a file
     510            /**
     511             * Check if the post has a file.
     512             */
    499513            if ( !empty($accp_file) ) {
    500514
     
    504518                if( file_exists($accp_file_full_path) ){
    505519                   
    506                     // If there is a file, delete it
     520                    /**
     521                     * If there is a file, delete it.
     522                     */
    507523                    unlink( $accp_file_full_path );         
    508524
    509                     // Also delete the associated post
     525                    /**
     526                     * Also delete the associated post.
     527                     */
    510528                    wp_delete_post($post_id, true);
    511529
     
    514532                }else{
    515533
    516                     // If the file no longer exists,
    517                     // just delete the post
     534                    /**
     535                     * If the file no longer exists,
     536                     * just delete the post.
     537                     */
    518538                    wp_delete_post($post_id, true);
    519539
     
    524544            }else{
    525545
    526                 // If the post doesn't have file just delete the post
     546                /**
     547                 * If the post doesn't have file just delete the post.
     548                 */
    527549                wp_delete_post($post_id, true);
    528550
     
    532554       
    533555        }
     556
    534557       
    535558        /**
     
    540563
    541564        wp_die();
    542     }
     565
     566    }
     567
    543568
    544569    /**
     
    553578            return;
    554579       
    555         // Query for related post notes.
     580        /**
     581         * Query for related post notes.
     582         */
    556583        $args = array(
    557584            'post_type' => 'accp_post_note',
     
    598625        global $post;
    599626
    600         // Verify the nonce
     627        /**
     628         * Verify the nonce.
     629         */
    601630        $nonce = filter_var($_POST['bulk_delete_nonce'], FILTER_SANITIZE_STRING);
    602631
     
    617646                if($post_type !== 'accp_clientcompany'){
    618647
    619                     // Check if the post has file   
     648                    /**
     649                     * Check if the post has file.
     650                     */
    620651                    if (!empty($accp_file)  ) {
    621652
     
    625656                        if( file_exists($accp_file_full_path) ){
    626657                           
    627                             // If there is a file, delete it
     658                            /**
     659                             * If there is a file, delete it.
     660                             */
    628661                            unlink( $accp_file_full_path );         
    629662
    630                             // Also delete the associated post
     663                            /**
     664                             * Also delete the associated post.
     665                             */
    631666                            wp_delete_post($post_id, true);
    632667
     
    635670                        }else{
    636671
    637                             // If the file no longer exists,
    638                             // just delete the post
     672                            /**
     673                             * If the file no longer exists,
     674                             * just delete the post.
     675                             */
    639676                            wp_delete_post($post_id, true);
    640677
     
    645682                    }else{
    646683
    647                         // If the post doesn't have file just delete the post
     684                        /**
     685                         * If the post doesn't have a file just delete the post.
     686                         */
    648687                        wp_delete_post($post_id, true);
    649688
     
    660699
    661700            }
     701
    662702        }
    663703       
    664704        die();
     705
    665706    }
    666707
     
    675716    function accp_bulk_delete_file_on_empty_trash(){   
    676717
    677         // Verify the nonce
     718        /**
     719         * Verify the nonce.
     720         */
    678721        $nonce = filter_var($_POST['empty_trash_nonce'], FILTER_SANITIZE_STRING);
    679722
     
    719762                        if( file_exists($accp_file_full_path) ){
    720763                           
    721                             // If there is a file, delete it.
     764                            /**
     765                             * If there is a file, delete it.
     766                             */
    722767                            unlink( $accp_file_full_path );         
    723768
    724                             // Also delete the associated post.
     769                            /**
     770                             * Also delete the associated post.
     771                             */
    725772                            wp_delete_post($post_id, true);
    726773
     
    729776                        }else{
    730777
    731                             // If the file no longer exists,
    732                             // just delete the post.
     778                            /**
     779                             * If the file no longer exists,
     780                             * just delete the post.
     781                             */
    733782                            wp_delete_post($post_id, true);
    734783
     
    739788                    }else{
    740789
    741                         // If the post doesn't have a file just delete the post.
     790                        /**
     791                         * If the post doesn't have a file just delete the post.
     792                         */
    742793                        wp_delete_post($post_id, true);
    743794
     
    886937        $user_id_array = array();
    887938       
    888         // Set up an array of assigned user ID's
     939        /**
     940         * Set up an array of assigned user ID's.
     941         */
    889942        foreach ($users as $user) {
    890943            $user_id_array[] = $user->ID;
     
    894947        if( $post_type == 'accp_clientcompany' ){
    895948
    896             // Check if the current user is logged in or if their user id
    897             // is in the list of users assigned to the company - Admins are exempt
     949            /**
     950             * Check if the current user is logged in or if their user id
     951             * is in the list of users assigned to the company - Admins are exempt.
     952             */
    898953            if (!current_user_can('manage_options') && $current_user_id === 0 || !current_user_can('manage_options') && !in_array($current_user_id, $user_id_array) ){
    899954
    900                 // If the current user id is 0 redirect to the home page
     955                /**
     956                 * If the current user id is 0 redirect to the home page.
     957                 */
    901958                wp_redirect('/');
    902                 exit;       
     959                exit;
     960
    903961            }
    904962        }
     
    9541012       
    9551013        foreach ( $screens as $screen ) {
     1014
    9561015            add_meta_box('clientfile', __('Client File', 'ars-constellation-client-portal'), array($this, 'accp_client_file_meta_fields'), $screen, 'normal', 'high');     
     1016
    9571017        }
    9581018
     
    9831043            $accp_file_full_path = $accp_clientfiles_full_dir_path . '/' . $company_dir . '/' . basename($accp_file_path);
    9841044           
    985             // Verify that the actual file (not post) still exists.     
     1045            /**
     1046             * Verify that the actual file (not post) still exists.
     1047             */
    9861048            clearstatcache();           
    9871049           
     
    10541116            echo '<p>' . esc_html(get_the_title($post_company)) . '</p>';
    10551117
    1056             // Only display the Reassign button if the file exists.
     1118            /**
     1119             * Only display the Reassign button if the file exists.
     1120             */
    10571121            if ( !empty($accp_file) ){
    10581122
     
    11131177        <?php
    11141178       
    1115     }
    1116    
     1179    }   
    11171180
    11181181
     
    11401203        $new_company_dir = get_post_meta($selected_company, 'accp_dir', true);     
    11411204
    1142         // Create the new company dir if it does not exist.
     1205        /**
     1206         * Create the new company dir if it does not exist.
     1207         */
    11431208        if (empty($new_company_dir)){
    11441209
     
    11571222        $new_file_url = $accp_clientfiles_dir_url . '/' . $new_company_dir . '/' . basename($new_full_path);
    11581223       
    1159         // Copy the file to the new company directory.
     1224        /**
     1225         * Verify that the actual file (not post) still exists.
     1226         */
    11601227        clearstatcache();       
    11611228
    1162         // Check if the file name already exists in the new dir.
     1229        /**
     1230         * Check if the file name already exists in the new dir.
     1231         */
    11631232        if(!file_exists($new_full_path)){
    11641233           
    1165             // If the file does not already exist copy it to the new dir.
     1234            /**
     1235             * If the file does not already exist copy it to the new dir.
     1236             */
    11661237            copy($accp_file_full_path, $new_full_path);
    11671238
    1168             // Prep file meta data to store in the file post.
     1239            /**
     1240             * Prep file meta data to store in the file post.
     1241             */
    11691242            $file_array = array(
    11701243                'file' => $new_file_name,
     
    11751248        }else{
    11761249
    1177             // Otherwise loop through and add a number to the file name as needed,
    1178             // to ensure that the filename is unique.
     1250            /**
     1251             * Otherwise loop through and add a number to the file name as needed,
     1252             * to ensure that the filename is unique.
     1253             */
    11791254            $i = 2;
    11801255
     
    11831258                $parts = explode('.', $new_full_path);
    11841259               
    1185                 // Remove any numbers in brackets in the file name
     1260                /**
     1261                 * Remove any numbers in brackets in the file name.
     1262                 */
    11861263                $parts[0] = preg_replace('/\(([0-9]*)\)$/', '', $parts[0]);
    11871264                $parts[0] .= '-' . $i;
     
    11981275            }
    11991276
    1200             // Copy the file with the incremented file name to the new company dir.
     1277            /**
     1278             * Copy the file with the incremented file name to the new company dir.
     1279             */
    12011280            copy($accp_file_full_path, $new_full_path);
    12021281
    1203             // Update the $new_file_url var and meta info so that the correct
    1204             // file name and url are stored in the post meta.   
     1282            /**
     1283             * Update the $new_file_url var and meta info so that the correct
     1284             * file name and url are stored in the post meta.   
     1285             */
    12051286            $new_file_url = $accp_clientfiles_dir_url . '/' . $new_company_dir . '/' . basename($new_full_path);
    12061287            $new_file_name = 's/' . $new_company_dir . '/' . basename($new_full_path);         
     
    12151296
    12161297       
    1217         // Delete the old file if the 'leave copy' option is unchecked.
     1298        /**
     1299         * Delete the old file if the 'leave copy' option is unchecked.
     1300         */
    12181301        if ($leave_copy == 0){ 
    12191302            clearstatcache();
     
    12211304        }
    12221305
    1223         // Update the file meta info (assigned company and file data).
     1306        /**
     1307         * Update the file meta info (assigned company and file data).
     1308         */
    12241309        update_post_meta($post_id, 'accp_file', $file_array); // File info
    12251310        update_post_meta($post_id, 'accp_user', $selected_company); // Newly assigned company   
     
    12681353        $accp_clientfiles_full_dir_path = $this->accp_utility_functions->accp_get_clientfiles_path();
    12691354       
    1270         // Create the new company dir if it does not exist.
     1355        /**
     1356         * Create the new company dir if it does not exist.
     1357         */
    12711358        if ( empty($new_company_dir) ) {       
    12721359           
     
    13271414
    13281415            $this->accp_add_directory_update_note($company_id, $note_content);
    1329 
    13301416
    13311417
     
    13881474
    13891475            echo esc_html($new_truncated_path);
    1390 
    13911476
    13921477        }
     
    15121597
    15131598        /**
    1514          * Return false if not posts were returned.
     1599         * Return false if no posts were returned.
    15151600         */
    15161601        if( $post_count < 1 )
     
    16351720
    16361721        $this->accp_add_directory_update_note($company_id, $note_content);
    1637 
    16381722
    16391723
     
    20412125        if( !is_readable($file) ) return;       
    20422126
    2043         // Define mime type
    2044         //TODO: Add a filter to allow developers to filter the output mime_types list       
     2127        /**
     2128         * Define mime type.
     2129         * TODO: Add a filter to allow developers to filter the output mime_types list.
     2130         */
    20452131        $defined_mime_types = $this->accp_defined_file_mime_types();
    20462132        $file_extension = strtolower(substr(strrchr($file,"."), 1));
    20472133       
    2048         // Set jpeg extension to jpg
     2134        /**
     2135         * Set jpeg extension to jpg.
     2136         */
    20492137        if($file_extension == 'jpeg'){
    20502138            $file_extension = 'jpg';
     
    20682156        if( $mime_type == '' || $mime_type == NULL || $mime_type == 'undefined'){
    20692157            $mime_type = 'application/force-download';
    2070         }
    2071 
    2072         //TODO: Add a filter to allow developers to filter the output $mime_type
     2158        }       
    20732159       
    20742160        $name = rawurldecode($name);
     
    21112197        }
    21122198
    2113         // Output the file
     2199        /**
     2200         * Output the file.
     2201         */
    21142202        $chunk_size = 1 * (1024 * 1024);
    21152203        $bytes_send = 0;
     
    21672255     * Disable zlib.output_compression.
    21682256     */
    2169 
    21702257     private function maybe_disable_zlib_output_compression(){
    21712258       
     
    26252712        }
    26262713
    2627         // Assigned Company
     2714        /**
     2715         * Assigned Company
     2716         */
    26282717        if(isset($_POST['client_company'])){
    26292718
     
    26332722        }
    26342723
    2635         // User Client Status
     2724        /**
     2725         * User Client Status
     2726         */
    26362727        if(isset($_POST['client_status'])){
    26372728           
     
    26412732        }       
    26422733
    2643         // Additional Companies
     2734        /**
     2735         * Additional Companies
     2736         */
    26442737        if (!empty($_POST['client_additional_company'])){
    26452738
     
    26752768        ){     
    26762769
    2677                 // Add content to the clientfile trash page
     2770                /**
     2771                 * Add content to the clientfile trash page.
     2772                 */
    26782773                if (strpos($_SERVER['REQUEST_URI'],'post_status=trash') !== false) {                   
    26792774                   
    2680                     // Add a nonce to the accp_clientfile trash header that can be used for ajax calls
     2775                    /**
     2776                     * Add a nonce to the accp_clientfile trash header that can be used for ajax calls.
     2777                     */
    26812778                    $clientfile_admin_nonce = wp_create_nonce('clientfile_admin_nonce');
    26822779
    26832780                    echo '<span id="clientfile-admin-nonce" data-nonce="' . esc_attr($clientfile_admin_nonce) . '" class="hidden"> </span>';
    26842781                   
    2685                     // Add an admin notice on the trash page
     2782                    /**
     2783                     * Add an admin notice on the trash page.
     2784                     */
    26862785                    if($screen->parent_file !== 'admin.php?page=accp-settings.php'){
    26872786                        echo '<span class="delete-screen-notice">Deleting posts on this screen will also delete any file attached to the post.</span>';
     
    26962795
    26972796    /**
    2698      * Define TCP MIME Types
     2797     * Define MIME Types.
    26992798     *
    27002799     * @return array Returns list of defined mime types (enabled and disabled).
     
    28752974    public function add_menu_accp_add_sub_menu_items_to_main_menu_item(){
    28762975       
    2877         // Company menu page.
     2976        /**
     2977         * Company menu page.
     2978         */
    28782979        //add_submenu_page('admin.php?page=accp-settings.php', 'Companies', 'Companies', 'manage_options', 'edit.php?post_type=accp_clientcompany' );   
    28792980        add_submenu_page('accp-settings', 'Companies', 'Companies', 'manage_options', 'edit.php?post_type=accp_clientcompany' );       
     
    28872988    function accp_generate_user_password(){
    28882989
    2889         // Verify the nonce
     2990        /**
     2991         * Verify the nonce.
     2992         */
    28902993        $nonce = filter_var($_POST['nonce'], FILTER_SANITIZE_STRING);
    28912994
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-company.php

    r2995913 r3030228  
    568568            }
    569569
    570 
    571570            /**
    572571             * Assign the home page to the Company.
  • constellation-client-portal/trunk/ars-constellation-client-portal.php

    r3018869 r3030228  
    55 * Plugin URI:        https://adrianrodriguezstudios.com/constellation-client-portal/
    66 * 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.
    7  * Version:           1.7.5
     7 * Version:           1.7.6
    88 * Author:            ARS
    99 * Author URI:        https://adrianrodriguezstudios.com
     
    5555     */
    5656    define('ACCP_PLUGIN_NAME', 'ARS_CONSTELLATION_CLIENT_PORTAL');
    57     define('ACCP_PLUGIN_VERSION', '1.7.5'); // Change the version in the header as well.
     57    define('ACCP_PLUGIN_VERSION', '1.7.6'); // Change the version in the header as well.
    5858    define( ACCP_PLUGIN_NAME, ACCP_PLUGIN_VERSION );
    5959    define('ACCP_PLUGIN_FILE_NAME', __FILE__);
Note: See TracChangeset for help on using the changeset viewer.