Plugin Directory

Changeset 3090586


Ignore:
Timestamp:
05/22/2024 06:39:45 AM (19 months ago)
Author:
viitorcloudvc
Message:

Update plugin files and tested with latest WordPress version

Location:
ga-code-management/trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • ga-code-management/trunk/README.txt

    r3026152 r3090586  
    33Tags: Analytics Code, Google Analytics Code, Google Analytics 
    44Requires at least: 3.8
    5 Tested up to: 6.4.2
     5Tested up to: 6.5.3
    66Stable tag: trunk
    77License:  GPL-2.0+
  • ga-code-management/trunk/admin/class-analytics-code-management-admin.php

    r1720321 r3090586  
    55 *
    66 * @link       https://viitorcloud.com/
    7  * @since      1.0.0
     7 * @since      3.0.0
    88 *
    99 * @package    Analytics_Code_Management
     
    1919 * @package    Analytics_Code_Management
    2020 * @subpackage Analytics_Code_Management/admin
    21  * @author     kinjal dalwadi <[email protected]>
    2221 */
    2322class Analytics_Code_Management_Admin {
     
    2625     * The ID of this plugin.
    2726     *
    28      * @since    1.0.0
     27     * @since    3.0.0
    2928     * @access   private
    3029     * @var      string    $plugin_name    The ID of this plugin.
     
    3534     * The version of this plugin.
    3635     *
    37      * @since    1.0.0
     36     * @since    3.0.0
    3837     * @access   private
    3938     * @var      string    $version    The current version of this plugin.
     
    4443     * Initialize the class and set its properties.
    4544     *
    46      * @since    1.0.0
    47      * @param      string    $plugin_name       The name of this plugin.
    48      * @param      string    $version    The version of this plugin.
     45     * @since    3.0.0
     46     * @param      string $plugin_name       The name of this plugin.
     47     * @param      string $version    The version of this plugin.
    4948     */
    5049    public function __construct( $plugin_name, $version ) {
    5150
    5251        $this->plugin_name = $plugin_name;
    53         $this->version = $version;
    54 
     52        $this->version     = $version;
    5553    }
    5654
     
    5856     * Register the stylesheets for the admin area.
    5957     *
    60      * @since    1.0.0
     58     * @since    3.0.0
    6159     */
    6260    public function enqueue_styles() {
     
    7573
    7674        wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/analytics-code-management-admin.css', array(), $this->version, 'all' );
    77 
    7875    }
    7976
     
    8178     * Register the JavaScript for the admin area.
    8279     *
    83      * @since    1.0.0
     80     * @since    3.0.0
    8481     */
    8582    public function enqueue_scripts() {
     
    9895
    9996        wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/analytics-code-management-admin.js', array( 'jquery' ), $this->version, false );
    100 
    101     }
    102    
    103     /**
    104      * add plugin main menu in admin menu
    105      *
    106      */
    107     public function analytics_code_custom_menu() {
    108        
    109          //add admin main plugins menu
    110         $current_user = wp_get_current_user();
    111         if ( current_user_can( 'administrator' ) ){ 
    112             add_submenu_page('options-general.php', ACM_PLUGIN_PAGE_MENU_TITLE, __(ACM_PLUGIN_NAME, ACM_PLUGIN_SLUG), 'manage_options', ACM_PLUGIN_PAGE_MENU_SLUG, 'custom_analytics_code_setting_html');
    113         }
    114    
    115      /**
    116          * function for plugin admin menu callback html function
    117          */
    118         function custom_analytics_code_setting_html() {
    119             global $wpdb;
    120             $current_user = wp_get_current_user();
    121             if ( current_user_can( 'administrator' ) ){       
    122             //get settings option
    123             $get_analytic_settings = get_option(ACM_PLUGIN_GLOBAL_SETTING_KEY);
    124             $get_analytic_settings = maybe_unserialize($get_analytic_settings);
    125             ?>
    126 
    127             <!--create analytics_codes settings html-->
    128             <div class="analytics_codes-containar">
    129                     <fieldset class="fs_global">
    130                     <legend><div class="analytics_codes-header"><h2><?php echo __(ACM_PLUGIN_HEADER_NAME, ACM_PLUGIN_SLUG); ?></h2></div></legend>
    131                     <div class="analytics_codes-contain">
    132 
    133                         <form id="analytics_codes_plugin_form_id" method="post" action="<?php echo get_admin_url(); ?>admin-post.php">
    134                             <input type='hidden' name='action' value='submit-form' />
    135                             <input type='hidden' name='action-which' value='add' />
    136 
    137                             <table class="form-table">
    138                                 <tbody>
    139                                     <tr>
    140                                         <th scope="row"><label  for="pluginname"><?php echo __(ACM_PLUGIN_ADDITIONAL_STYLE_TITLE, ACM_PLUGIN_SLUG); ?></label></th>
    141                                        <td><input type="text" name="add_custom_service_style" id="add_custom_service_style" class="code" style="width: 30%; font-size: 17px;" maxlength="15" value="<?php echo esc_html(!empty($get_analytic_settings['include_analytics_codes'])) ? ($get_analytic_settings['include_analytics_codes']) : '' ; ?>" /></td>
    142                                     </tr>                           
    143                                 </tbody>
    144                             </table>
    145 
    146                             <p class="submit"><input type="submit" value="<?php echo __(ACM_PLUGIN_OPTION_SAVE_BTN, ACM_PLUGIN_SLUG); ?>" class="button button-primary" id="submit_plugin" name="submit_plugin"></p>
    147                         </form>
    148                     </div>
    149 
    150                 </fieldset>
     97    }
     98
     99    /**
     100     * add plugin main menu in admin menu
     101     */
     102    public function analytics_code_custom_menu() {
     103
     104        // add admin main plugins menu
     105        $current_user = wp_get_current_user();
     106        if ( current_user_can( 'administrator' ) ) {
     107            add_submenu_page( 'options-general.php', ACM_PLUGIN_PAGE_MENU_TITLE, __( ACM_PLUGIN_NAME, ACM_PLUGIN_SLUG ), 'manage_options', ACM_PLUGIN_PAGE_MENU_SLUG, 'custom_analytics_code_setting_html' );
     108        }
     109
     110        /**
     111         * function for plugin admin menu callback html function
     112         */
     113        function custom_analytics_code_setting_html() {
     114            global $wpdb;
     115            $current_user = wp_get_current_user();
     116            if ( current_user_can( 'administrator' ) ) {
     117                // get settings option
     118                $get_analytic_settings = get_option( ACM_PLUGIN_GLOBAL_SETTING_KEY );
     119                $get_analytic_settings = maybe_unserialize( $get_analytic_settings );
     120                ?>
     121
     122            <!--create analytics_codes settings html-->
     123            <div class="analytics_codes-containar">
     124                    <fieldset class="fs_global">
     125                    <legend><div class="analytics_codes-header"><h2><?php echo __( ACM_PLUGIN_HEADER_NAME, ACM_PLUGIN_SLUG ); ?></h2></div></legend>
     126                    <div class="analytics_codes-contain">
     127
     128                        <form id="analytics_codes_plugin_form_id" method="post" action="<?php echo get_admin_url(); ?>admin-post.php">
     129                            <input type='hidden' name='action' value='submit-form' />
     130                            <input type='hidden' name='action-which' value='add' />
     131
     132                            <table class="form-table">
     133                                <tbody>
     134                                    <tr>
     135                                        <th scope="row"><label  for="pluginname"><?php echo __( ACM_PLUGIN_ADDITIONAL_STYLE_TITLE, ACM_PLUGIN_SLUG ); ?></label></th>
     136                                        <td><input type="text" name="add_custom_service_style" id="add_custom_service_style" class="code" style="width: 30%; font-size: 17px;" maxlength="15" value="<?php echo esc_html( ! empty( $get_analytic_settings['include_analytics_codes'] ) ) ? ( $get_analytic_settings['include_analytics_codes'] ) : ''; ?>" /></td>
     137                                    </tr>
     138                                </tbody>
     139                            </table>
     140
     141                            <p class="submit"><input type="submit" value="<?php echo __( ACM_PLUGIN_OPTION_SAVE_BTN, ACM_PLUGIN_SLUG ); ?>" class="button button-primary" id="submit_plugin" name="submit_plugin"></p>
     142                        </form>
     143                    </div>
     144
     145                </fieldset>
    151146            </div>
    152             <?php
     147                <?php
    153148            }
    154149        }
    155         }
    156        
    157          /**
    158          * function for add or update analytics codes admin settings
    159          *
    160          */
    161         public function analytics_code_setting_add_update() {
    162            global $wpdb, $wp, $post;
    163              
    164                
    165             //get action
    166             $submitAction = !empty( $_POST['action'] ) ? $_POST['action']:'';
    167             $submitFormAction = !empty( $_POST['action-which'] ) ? $_POST['action-which']:'';
    168                        
    169             $addCustomServiceStyle = sanitize_text_field(!empty($_POST['add_custom_service_style']) ? $_POST['add_custom_service_style'] : null);
    170            
    171             $analytics_codesSettingArray = array();
    172                
    173                
    174             //check action
    175             if ($submitFormAction == 'add' && !empty($submitFormAction) && $submitFormAction != '' && $submitAction == 'submit-form') {
    176            
    177                 //create analytics_codes settings array
    178                 $analytics_codesSettingArray['include_analytics_codes'] = $addCustomServiceStyle;
    179 
    180                 //serialize analytics_codes settings array
    181                 $analytics_codesSettingArray = maybe_serialize($analytics_codesSettingArray);
    182    
    183                 //update analytics_codes setting array
    184                 update_option(ACM_PLUGIN_GLOBAL_SETTING_KEY, $analytics_codesSettingArray);
    185             }
    186            
    187             //redirect whatsapp analytics_codes page
    188             wp_safe_redirect(site_url("/wp-admin/admin.php?page=" . ACM_PLUGIN_PAGE_MENU_SLUG));
    189             exit();
    190         }
     150    }
     151
     152        /**
     153         * function for add or update analytics codes admin settings
     154         */
     155    public function analytics_code_setting_add_update() {
     156        global $wpdb, $wp, $post;
     157
     158        // get action
     159        $submitAction     = ! empty( $_POST['action'] ) ? $_POST['action'] : '';
     160        $submitFormAction = ! empty( $_POST['action-which'] ) ? $_POST['action-which'] : '';
     161
     162        $addCustomServiceStyle = sanitize_text_field( ! empty( $_POST['add_custom_service_style'] ) ? $_POST['add_custom_service_style'] : null );
     163
     164        $analytics_codesSettingArray = array();
     165
     166        // check action
     167        if ( $submitFormAction == 'add' && ! empty( $submitFormAction ) && $submitFormAction != '' && $submitAction == 'submit-form' ) {
     168
     169            // create analytics_codes settings array
     170            $analytics_codesSettingArray['include_analytics_codes'] = $addCustomServiceStyle;
     171
     172            // serialize analytics_codes settings array
     173            $analytics_codesSettingArray = maybe_serialize( $analytics_codesSettingArray );
     174
     175            // update analytics_codes setting array
     176            update_option( ACM_PLUGIN_GLOBAL_SETTING_KEY, $analytics_codesSettingArray );
     177        }
     178
     179        // redirect whatsapp analytics_codes page
     180        wp_safe_redirect( site_url( '/wp-admin/admin.php?page=' . ACM_PLUGIN_PAGE_MENU_SLUG ) );
     181        exit();
     182    }
    191183    /* Welcome page redirect function */
    192    
    193     public function welcome_page_activation_redirect_tab(){
    194        
    195          if (!get_transient('_welcome_screen_tab_activation_redirect_data')) {
    196                 return;
    197             }
     184
     185    public function welcome_page_activation_redirect_tab() {
     186
     187        if ( ! get_transient( '_welcome_screen_tab_activation_redirect_data' ) ) {
     188                return;
     189        }
    198190
    199191        // Delete the redirect transient
    200         delete_transient('_welcome_screen_tab_activation_redirect_data');
    201        
    202          // if activating from network, or bulk
    203         if (is_network_admin() || isset($_GET['activate-multi'])) {
     192        delete_transient( '_welcome_screen_tab_activation_redirect_data' );
     193
     194        // if activating from network, or bulk
     195        if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
    204196            return;
    205197        }
    206198        // Redirect to analytics code welcome  page
    207         wp_safe_redirect(add_query_arg(array('page' => 'add-analytics-code-abouts'), admin_url('index.php')));
    208     }
    209    
    210    
    211      public function welcome_pages_screen_tab() {
     199        wp_safe_redirect( add_query_arg( array( 'page' => 'add-analytics-code-abouts' ), admin_url( 'index.php' ) ) );
     200    }
     201
     202
     203    public function welcome_pages_screen_tab() {
    212204            $current_user = wp_get_current_user();
    213             if ( current_user_can( 'administrator' ) ){
    214                 add_dashboard_page(
    215                 'Add Analytics Code Plugin Dashboard', 'Add Analytics Code Plugin Dashboard', 'read', 'add-analytics-code-abouts', array(&$this, 'welcome_screen_content_tab')
    216                 );
    217             }
    218        
    219         }
    220        
    221     public function welcome_screen_content_tab(){ ?>
     205        if ( current_user_can( 'administrator' ) ) {
     206            add_dashboard_page(
     207                'Add Analytics Code Plugin Dashboard',
     208                'Add Analytics Code Plugin Dashboard',
     209                'read',
     210                'add-analytics-code-abouts',
     211                array( &$this, 'welcome_screen_content_tab' )
     212            );
     213        }
     214    }
     215
     216    public function welcome_screen_content_tab() {
     217        ?>
    222218        <div class="wrap about-wrap">
    223219       
    224                 <h1 style="font-size: 2.1em;"><?php printf(__('Welcome to Google Analytics Code Management', 'add-analytics-code')); ?></h1>
    225 
    226                 <div class="about-text">
    227                     <?php
    228                     $message = '';
    229                     printf(__('%s An easy way to Add Google Analytics Code from backend.', 'add-google-analytics-code'), $message, $this->version);
    230                     ?>
    231                     <img class="version_logo_img" src="<?php echo plugin_dir_url(__FILE__) . 'images/analytics.png'; ?>">
    232                 </div>
    233 
    234                 <?php
    235                 $setting_tabs_wc = apply_filters('acm_setting_tab', array("about" => "Overview"));
    236                 $current_tab_wc = (isset($_GET['tab'])) ? $_GET['tab'] : 'about';
    237                 $aboutpage = isset($_GET['page'])
    238                 ?>
    239                 <h2 id="analytics-tab-wrapper" class="nav-tab-wrapper">
     220                <h1 style="font-size: 2.1em;"><?php printf( __( 'Welcome to Google Analytics Code Management', 'add-analytics-code' ) ); ?></h1>
     221
     222                <div class="about-text">
     223                    <?php
     224                    $message = '';
     225                    printf( __( '%s An easy way to Add Google Analytics Code from backend.', 'add-google-analytics-code' ), $message, $this->version );
     226                    ?>
     227                    <img class="version_logo_img" src="<?php echo plugin_dir_url( __FILE__ ) . 'images/analytics.png'; ?>">
     228                </div>
     229
    240230                <?php
    241                 foreach ($setting_tabs_wc as $name => $label)
    242                     echo '<a  href="' . home_url('wp-admin/index.php?page=add-analytics-code-abouts&tab=' . $name) . '" class="nav-tab ' . ( $current_tab_wc == $name ? 'nav-tab-active' : '' ) . '">' . $label . '</a>';
     231                $setting_tabs_wc = apply_filters( 'acm_setting_tab', array( 'about' => 'Overview' ) );
     232                $current_tab_wc  = ( isset( $_GET['tab'] ) ) ? $_GET['tab'] : 'about';
     233                $aboutpage       = isset( $_GET['page'] )
     234                ?>
     235                <h2 id="analytics-tab-wrapper" class="nav-tab-wrapper">
     236                <?php
     237                foreach ( $setting_tabs_wc as $name => $label ) {
     238                    echo '<a  href="' . home_url( 'wp-admin/index.php?page=add-analytics-code-abouts&tab=' . $name ) . '" class="nav-tab ' . ( $current_tab_wc == $name ? 'nav-tab-active' : '' ) . '">' . $label . '</a>';
     239                }
    243240                ?>
    244241                </h2>
    245242
    246243                <?php
    247                 foreach ($setting_tabs_wc as $setting_tabkey_wc => $setting_tabvalue) {
    248                     switch ($setting_tabkey_wc) {
     244                foreach ( $setting_tabs_wc as $setting_tabkey_wc => $setting_tabvalue ) {
     245                    switch ( $setting_tabkey_wc ) {
    249246                        case $current_tab_wc:
    250                             do_action('analytics_code_' . $current_tab_wc);
     247                            do_action( 'analytics_code_' . $current_tab_wc );
    251248                            break;
    252249                    }
    253250                }
    254251                ?>
    255                 <hr/>
    256                 <div class="return-to-dashboard">
    257                     <a href="<?php echo home_url('/wp-admin/options-general.php?page=add_analytics_codes'); ?>"><?php _e('Go to Add Google Analytics Code Settings', 'add-analytics-codes'); ?></a>
    258                 </div>
    259             </div>
    260     <?php
    261     }   
    262    
    263     public function analytics_code_about(){ ?>
    264          <div class="changelog">
    265                 </br>
    266                 <style type="text/css">
    267                     p.gamc_overview {max-width: 100% !important;margin-left: auto;margin-right: auto;font-size: 15px;line-height: 1.5;}
    268                     .gamc_ul ul li {margin-left: 3%;list-style: initial;line-height: 23px;}
    269                 </style> 
    270                 <div class="changelog about-integrations">
    271                     <div class="wc-feature feature-section col three-col">
    272                         <div>
    273                             <p class="gamc_overview"><?php _e('A simple and straightforward solution for viewing Google Analytics for your site, using Google Analytics Code Management plugin.', 'add-social-analytics_codes-buttons'); ?></p>
    274                             <p class="gamc_overview"><?php _e('Once you’ve done this, you’ll be able to track visitors to your site.', 'add-social-analytics_codes-buttons'); ?></p>
    275                             <p class="gamc_overview"><strong>Plugin Functionality: </strong></p>
    276                             <div class="gamc_ul">
    277                                 <ul>
    278                                     <li>Easy setup from backend</li>
    279                                     <li>User-friendly Settings Interface</li>
     252                <hr/>
     253                <div class="return-to-dashboard">
     254                    <a href="<?php echo home_url( '/wp-admin/options-general.php?page=add_analytics_codes' ); ?>"><?php _e( 'Go to Add Google Analytics Code Settings', 'add-analytics-codes' ); ?></a>
     255                </div>
     256            </div>
     257        <?php
     258    }
     259
     260    public function analytics_code_about() {
     261        ?>
     262        <div class="changelog">
     263                </br>
     264                <style type="text/css">
     265                    p.gamc_overview {max-width: 100% !important;margin-left: auto;margin-right: auto;font-size: 15px;line-height: 1.5;}
     266                    .gamc_ul ul li {margin-left: 3%;list-style: initial;line-height: 23px;}
     267                </style>
     268                <div class="changelog about-integrations">
     269                    <div class="wc-feature feature-section col three-col">
     270                        <div>
     271                            <p class="gamc_overview"><?php _e( 'A simple and straightforward solution for viewing Google Analytics for your site, using Google Analytics Code Management plugin.', 'add-social-analytics_codes-buttons' ); ?></p>
     272                            <p class="gamc_overview"><?php _e( 'Once you’ve done this, you’ll be able to track visitors to your site.', 'add-social-analytics_codes-buttons' ); ?></p>
     273                            <p class="gamc_overview"><strong>Plugin Functionality: </strong></p>
     274                            <div class="gamc_ul">
     275                                <ul>
     276                                    <li>Easy setup from backend</li>
     277                                    <li>User-friendly Settings Interface</li>
    280278                                    <li>Get your analytics tracking ID following below steps:<br>
    281279                                    1) Sign up or Login for Google Analytics<br>
    282280                                    2) Copy your tracking ID<br>
    283                                     3) Paste your tracking ID in  <a href="<?php echo site_url();?>/wp-admin/options-general.php?page=add_analytics_codes">Google Analytics Code Settings</a>
     281                                    3) Paste your tracking ID in  <a href="<?php echo site_url(); ?>/wp-admin/options-general.php?page=add_analytics_codes">Google Analytics Code Settings</a>
    284282                                    </li>
    285                                 </ul>
    286                             </div>
    287 
    288                             <p class="gamc_overview"><strong>Plugin Supports: </strong></p>
    289                             <div class="gamc_ul">
    290                                 <ul>
    291                                     <li>This plugin includes a function to add the Google Analytics tracking code from backend</li>
    292                                     <li>No need to edit PHP files</li>
    293                                 </ul>
    294                             </div>
    295 
    296                         </div>
    297 
    298                     </div>
    299                 </div>
    300             </div>
    301     <?php }
    302    
     283                                </ul>
     284                            </div>
     285
     286                            <p class="gamc_overview"><strong>Plugin Supports: </strong></p>
     287                            <div class="gamc_ul">
     288                                <ul>
     289                                    <li>This plugin includes a function to add the Google Analytics tracking code from backend</li>
     290                                    <li>No need to edit PHP files</li>
     291                                </ul>
     292                            </div>
     293
     294                        </div>
     295
     296                    </div>
     297                </div>
     298            </div>
     299        <?php
     300    }
     301
    303302    public function adjust_the_wp_menu_gamc() {
    304             remove_submenu_page('index.php', 'add-analytics-code-about');
    305     }
    306        
     303            remove_submenu_page( 'index.php', 'add-analytics-code-about' );
     304    }
    307305}
  • ga-code-management/trunk/admin/index.php

    r1720321 r3090586  
    1 <?php // Silence is golden
     1<?php
     2// Silence is golden.
  • ga-code-management/trunk/admin/partials/analytics-code-management-admin-display.php

    r1720321 r3090586  
    77 *
    88 * @link       https://viitorcloud.com/
    9  * @since      1.0.0
     9 * @since      3.0.0
    1010 *
    1111 * @package    Analytics_Code_Management
  • ga-code-management/trunk/analytics-code-management.php

    r3026152 r3090586  
    99 *
    1010 * @link              http://viitorcloud.com/
    11  * @since             1.0.0
     11 * @since             3.0.0
    1212 * @package           Analytics_Code_Management
    1313 *
     
    1616 * Plugin URI:     https://wordpress.org/plugins/ga-code-management/
    1717 * Description:    This plugin provides a functionality to add Google Analytics Tracking code from WordPress admin area.
    18  * Version:        2.0.0
     18 * Version:        3.0.0
    1919 * Author:         ViitorCloud
    2020 * Author URI:     https://viitorcloud.com/
     
    6565 * not affect the page life cycle.
    6666 *
    67  * @since    1.0.0
     67 * @since    3.0.0
    6868 */
    6969function run_analytics_code_management() {
  • ga-code-management/trunk/includes/class-analytics-code-management-activator.php

    r1720321 r3090586  
    55 *
    66 * @link       https://viitorcloud.com/
    7  * @since      1.0.0
     7 * @since      3.0.0
    88 *
    99 * @package    Analytics_Code_Management
     
    1616 * This class defines all code necessary to run during the plugin's activation.
    1717 *
    18  * @since      1.0.0
     18 * @since      3.0.0
    1919 * @package    Analytics_Code_Management
    2020 * @subpackage Analytics_Code_Management/includes
    21  * @author     kinjal dalwadi <[email protected]>
    2221 */
    2322class Analytics_Code_Management_Activator {
     
    2827     * Long Description.
    2928     *
    30      * @since    1.0.0
     29     * @since    3.0.0
    3130     */
    3231    public static function activate() {
    33         //Set Transist once pluign activated
     32        // Set Transist once plugin activated.
    3433        set_transient( '_welcome_screen_tab_activation_redirect_data', true, 30 );
    3534    }
    36 
    3735}
  • ga-code-management/trunk/includes/class-analytics-code-management-deactivator.php

    r1720321 r3090586  
    55 *
    66 * @link       https://viitorcloud.com/
    7  * @since      1.0.0
     7 * @since      3.0.0
    88 *
    99 * @package    Analytics_Code_Management
     
    1616 * This class defines all code necessary to run during the plugin's deactivation.
    1717 *
    18  * @since      1.0.0
     18 * @since      3.0.0
    1919 * @package    Analytics_Code_Management
    2020 * @subpackage Analytics_Code_Management/includes
    21  * @author     kinjal dalwadi <[email protected]>
    2221 */
    2322class Analytics_Code_Management_Deactivator {
     
    2827     * Long Description.
    2928     *
    30      * @since    1.0.0
     29     * @since    3.0.0
    3130     */
    3231    public static function deactivate() {
    33 
    3432    }
    35 
    3633}
  • ga-code-management/trunk/includes/class-analytics-code-management-i18n.php

    r1720321 r3090586  
    88 *
    99 * @link       https://viitorcloud.com/
    10  * @since      1.0.0
     10 * @since      3.0.0
    1111 *
    1212 * @package    Analytics_Code_Management
     
    2020 * so that it is ready for translation.
    2121 *
    22  * @since      1.0.0
     22 * @since      3.0.0
    2323 * @package    Analytics_Code_Management
    2424 * @subpackage Analytics_Code_Management/includes
    25  * @author     kinjal dalwadi <[email protected]>
    2625 */
    2726class Analytics_Code_Management_i18n {
     
    3130     * Load the plugin text domain for translation.
    3231     *
    33      * @since    1.0.0
     32     * @since    3.0.0
    3433     */
    3534    public function load_plugin_textdomain() {
     
    4039            dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
    4140        );
    42 
    4341    }
    44 
    45 
    46 
    4742}
  • ga-code-management/trunk/includes/class-analytics-code-management-loader.php

    r1720321 r3090586  
    55 *
    66 * @link       https://viitorcloud.com/
    7  * @since      1.0.0
     7 * @since      3.0.0
    88 *
    99 * @package    Analytics_Code_Management
     
    2020 * @package    Analytics_Code_Management
    2121 * @subpackage Analytics_Code_Management/includes
    22  * @author     kinjal dalwadi <[email protected]>
    2322 */
    2423class Analytics_Code_Management_Loader {
     
    2726     * The array of actions registered with WordPress.
    2827     *
    29      * @since    1.0.0
     28     * @since    3.0.0
    3029     * @access   protected
    3130     * @var      array    $actions    The actions registered with WordPress to fire when the plugin loads.
     
    3635     * The array of filters registered with WordPress.
    3736     *
    38      * @since    1.0.0
     37     * @since    3.0.0
    3938     * @access   protected
    4039     * @var      array    $filters    The filters registered with WordPress to fire when the plugin loads.
     
    4544     * Initialize the collections used to maintain the actions and filters.
    4645     *
    47      * @since    1.0.0
     46     * @since    3.0.0
    4847     */
    4948    public function __construct() {
     
    5150        $this->actions = array();
    5251        $this->filters = array();
    53 
    5452    }
    5553
     
    5755     * Add a new action to the collection to be registered with WordPress.
    5856     *
    59      * @since    1.0.0
    60      * @param    string               $hook             The name of the WordPress action that is being registered.
    61      * @param    object               $component        A reference to the instance of the object on which the action is defined.
    62      * @param    string               $callback         The name of the function definition on the $component.
    63      * @param    int                  $priority         Optional. he priority at which the function should be fired. Default is 10.
    64      * @param    int                  $accepted_args    Optional. The number of arguments that should be passed to the $callback. Default is 1.
     57     * @since    3.0.0
     58     * @param    string $hook             The name of the WordPress action that is being registered.
     59     * @param    object $component        A reference to the instance of the object on which the action is defined.
     60     * @param    string $callback         The name of the function definition on the $component.
     61     * @param    int    $priority         Optional. he priority at which the function should be fired. Default is 10.
     62     * @param    int    $accepted_args    Optional. The number of arguments that should be passed to the $callback. Default is 1.
    6563     */
    6664    public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
     
    7169     * Add a new filter to the collection to be registered with WordPress.
    7270     *
    73      * @since    1.0.0
    74      * @param    string               $hook             The name of the WordPress filter that is being registered.
    75      * @param    object               $component        A reference to the instance of the object on which the filter is defined.
    76      * @param    string               $callback         The name of the function definition on the $component.
    77      * @param    int                  $priority         Optional. he priority at which the function should be fired. Default is 10.
    78      * @param    int                  $accepted_args    Optional. The number of arguments that should be passed to the $callback. Default is 1
     71     * @since    3.0.0
     72     * @param    string $hook             The name of the WordPress filter that is being registered.
     73     * @param    object $component        A reference to the instance of the object on which the filter is defined.
     74     * @param    string $callback         The name of the function definition on the $component.
     75     * @param    int    $priority         Optional. he priority at which the function should be fired. Default is 10.
     76     * @param    int    $accepted_args    Optional. The number of arguments that should be passed to the $callback. Default is 1
    7977     */
    8078    public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
     
    8684     * collection.
    8785     *
    88      * @since    1.0.0
     86     * @since    3.0.0
    8987     * @access   private
    90      * @param    array                $hooks            The collection of hooks that is being registered (that is, actions or filters).
    91      * @param    string               $hook             The name of the WordPress filter that is being registered.
    92      * @param    object               $component        A reference to the instance of the object on which the filter is defined.
    93      * @param    string               $callback         The name of the function definition on the $component.
    94      * @param    int                  $priority         The priority at which the function should be fired.
    95      * @param    int                  $accepted_args    The number of arguments that should be passed to the $callback.
     88     * @param    array  $hooks            The collection of hooks that is being registered (that is, actions or filters).
     89     * @param    string $hook             The name of the WordPress filter that is being registered.
     90     * @param    object $component        A reference to the instance of the object on which the filter is defined.
     91     * @param    string $callback         The name of the function definition on the $component.
     92     * @param    int    $priority         The priority at which the function should be fired.
     93     * @param    int    $accepted_args    The number of arguments that should be passed to the $callback.
    9694     * @return   array                                  The collection of actions and filters registered with WordPress.
    9795     */
     
    103101            'callback'      => $callback,
    104102            'priority'      => $priority,
    105             'accepted_args' => $accepted_args
     103            'accepted_args' => $accepted_args,
    106104        );
    107105
    108106        return $hooks;
    109 
    110107    }
    111108
     
    113110     * Register the filters and actions with WordPress.
    114111     *
    115      * @since    1.0.0
     112     * @since    3.0.0
    116113     */
    117114    public function run() {
     
    124121            add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
    125122        }
    126 
    127123    }
    128 
    129124}
  • ga-code-management/trunk/includes/class-analytics-code-management.php

    r1720321 r3090586  
    88 *
    99 * @link       https://viitorcloud.com/
    10  * @since      1.0.0
     10 * @since      3.0.0
    1111 *
    1212 * @package    Analytics_Code_Management
     
    2323 * version of the plugin.
    2424 *
    25  * @since      1.0.0
     25 * @since      3.0.0
    2626 * @package    Analytics_Code_Management
    2727 * @subpackage Analytics_Code_Management/includes
    28  * @author     kinjal dalwadi <[email protected]>
    2928 */
    3029class Analytics_Code_Management {
     
    3433     * the plugin.
    3534     *
    36      * @since    1.0.0
     35     * @since    3.0.0
    3736     * @access   protected
    3837     * @var      Analytics_Code_Management_Loader    $loader    Maintains and registers all hooks for the plugin.
     
    4342     * The unique identifier of this plugin.
    4443     *
    45      * @since    1.0.0
     44     * @since    3.0.0
    4645     * @access   protected
    4746     * @var      string    $plugin_name    The string used to uniquely identify this plugin.
     
    5251     * The current version of the plugin.
    5352     *
    54      * @since    1.0.0
     53     * @since    3.0.0
    5554     * @access   protected
    5655     * @var      string    $version    The current version of the plugin.
     
    6564     * the public-facing side of the site.
    6665     *
    67      * @since    1.0.0
     66     * @since    3.0.0
    6867     */
    6968    public function __construct() {
    7069
    7170        $this->plugin_name = 'analytics-code-management';
    72         $this->version = '1.0.0';
     71        $this->version     = '3.0.0';
    7372
    7473        $this->load_dependencies();
     
    7675        $this->define_admin_hooks();
    7776        $this->define_public_hooks();
    78 
    7977    }
    8078
     
    9290     * with WordPress.
    9391     *
    94      * @since    1.0.0
     92     * @since    3.0.0
    9593     * @access   private
    9694     */
     
    10199         * core plugin.
    102100         */
    103         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-analytics-code-management-loader.php';
     101        require_once plugin_dir_path( __DIR__ ) . 'includes/class-analytics-code-management-loader.php';
    104102
    105103        /**
     
    107105         * of the plugin.
    108106         */
    109         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-analytics-code-management-i18n.php';
     107        require_once plugin_dir_path( __DIR__ ) . 'includes/class-analytics-code-management-i18n.php';
    110108
    111109        /**
    112110         * The class responsible for defining all actions that occur in the admin area.
    113111         */
    114         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-analytics-code-management-admin.php';
     112        require_once plugin_dir_path( __DIR__ ) . 'admin/class-analytics-code-management-admin.php';
    115113
    116114        /**
     
    118116         * side of the site.
    119117         */
    120         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-analytics-code-management-public.php';
     118        require_once plugin_dir_path( __DIR__ ) . 'public/class-analytics-code-management-public.php';
    121119
    122120        $this->loader = new Analytics_Code_Management_Loader();
    123 
    124121    }
    125122
     
    130127     * with WordPress.
    131128     *
    132      * @since    1.0.0
     129     * @since    3.0.0
    133130     * @access   private
    134131     */
     
    138135
    139136        $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
    140 
    141137    }
    142138
     
    145141     * of the plugin.
    146142     *
    147      * @since    1.0.0
     143     * @since    3.0.0
    148144     * @access   private
    149145     */
     
    154150        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
    155151        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
    156        
     152
    157153        /* Add actions hook for welcome screen */
    158154        $this->loader->add_action( 'admin_init', $plugin_admin, 'welcome_page_activation_redirect_tab' );
    159        
     155
    160156        $this->loader->add_action( 'admin_menu', $plugin_admin, 'welcome_pages_screen_tab' );
    161        
    162         $this->loader->add_action( 'admin_menu',$plugin_admin, 'analytics_code_custom_menu' );
     157
     158        $this->loader->add_action( 'admin_menu', $plugin_admin, 'analytics_code_custom_menu' );
    163159        $this->loader->add_action( 'admin_menu', $plugin_admin, 'adjust_the_wp_menu_gamc', 999 );
    164        
    165        
    166         $this->loader->add_action('analytics_code_about', $plugin_admin, 'analytics_code_about');
    167        
    168         $this->loader->add_action('admin_post_submit-form',$plugin_admin,  'analytics_code_setting_add_update');
    169         $this->loader->add_action('admin_post_nopriv_submit-form',$plugin_admin, 'analytics_code_setting_add_update');
    170        
     160
     161        $this->loader->add_action( 'analytics_code_about', $plugin_admin, 'analytics_code_about' );
     162
     163        $this->loader->add_action( 'admin_post_submit-form', $plugin_admin, 'analytics_code_setting_add_update' );
     164        $this->loader->add_action( 'admin_post_nopriv_submit-form', $plugin_admin, 'analytics_code_setting_add_update' );
    171165    }
    172166
     
    175169     * of the plugin.
    176170     *
    177      * @since    1.0.0
     171     * @since    3.0.0
    178172     * @access   private
    179173     */
     
    184178        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
    185179        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
    186        
    187         $this->loader->add_action( 'wp_footer',$plugin_public,'add_custom_analytics_code', 100 );
    188        
     180
     181        $this->loader->add_action( 'wp_footer', $plugin_public, 'add_custom_analytics_code', 100 );
     182
    189183        $get_analytic_settings = get_option( ACM_PLUGIN_GLOBAL_SETTING_KEY );
    190184        $get_analytic_settings = maybe_unserialize( $get_analytic_settings );
    191 
    192185    }
    193186
     
    195188     * Run the loader to execute all of the hooks with WordPress.
    196189     *
    197      * @since    1.0.0
     190     * @since    3.0.0
    198191     */
    199192    public function run() {
     
    205198     * WordPress and to define internationalization functionality.
    206199     *
    207      * @since     1.0.0
     200     * @since     3.0.0
    208201     * @return    string    The name of the plugin.
    209202     */
     
    215208     * The reference to the class that orchestrates the hooks with the plugin.
    216209     *
    217      * @since     1.0.0
     210     * @since     3.0.0
    218211     * @return    Analytics_Code_Management_Loader    Orchestrates the hooks of the plugin.
    219212     */
     
    225218     * Retrieve the version number of the plugin.
    226219     *
    227      * @since     1.0.0
     220     * @since     3.0.0
    228221     * @return    string    The version number of the plugin.
    229222     */
     
    231224        return $this->version;
    232225    }
    233 
    234226}
  • ga-code-management/trunk/includes/constant.php

    r1720321 r3090586  
    33 * define constant variabes
    44 * define admin side constant
     5 *
    56 * @package Phase 1
    67 * @since Phase 1
    7  * @version 1.0.0
     8 * @version 3.0.0
    89 * @author Viitorcloud
    910 * @param null
    1011 */
    11 // constant define for table name
     12// constant define for table name.
    1213
    13 define('ACM_PLUGIN_SLUG','analytics-code-management');
    14 define('ACM_PLUGIN_NAME','Add Analytics Code');
    15 define('ACM_PLUGIN_PAGE_MENU_TITLE','add-analytics-codes');
    16 define('ACM_PLUGIN_PAGE_MENU_SLUG','add_analytics_codes');
    17 define('ACM_PLUGIN_HEADER_NAME','Add Google Anaytics Code Settings');
    18 define('ACM_PLUGIN_ADDITIONAL_STYLE_TITLE','Google Analytics Tracking ID:');
    19 define('ACM_PLUGIN_OPTION_SAVE_BTN','Submit');
    20 define('ACM_PLUGIN_GLOBAL_SETTING_KEY','acm_global_settings');
    21 
    22 ?>
     14define( 'ACM_PLUGIN_SLUG', 'analytics-code-management' );
     15define( 'ACM_PLUGIN_NAME', 'Add Analytics Code' );
     16define( 'ACM_PLUGIN_PAGE_MENU_TITLE', 'add-analytics-codes' );
     17define( 'ACM_PLUGIN_PAGE_MENU_SLUG', 'add_analytics_codes' );
     18define( 'ACM_PLUGIN_HEADER_NAME', 'Add Google Anaytics Code Settings' );
     19define( 'ACM_PLUGIN_ADDITIONAL_STYLE_TITLE', 'Google Analytics Tracking ID:' );
     20define( 'ACM_PLUGIN_OPTION_SAVE_BTN', 'Submit' );
     21define( 'ACM_PLUGIN_GLOBAL_SETTING_KEY', 'acm_global_settings' );
  • ga-code-management/trunk/includes/index.php

    r1720321 r3090586  
    1 <?php // Silence is golden
     1<?php
     2// Silence is golden.
  • ga-code-management/trunk/public/class-analytics-code-management-public.php

    r3026152 r3090586  
    55 *
    66 * @link       https://viitorcloud.com/
    7  * @since      1.0.0
     7 * @since      3.0.0
    88 *
    99 * @package    Analytics_Code_Management
     
    1919 * @package    Analytics_Code_Management
    2020 * @subpackage Analytics_Code_Management/public
    21  * @author     kinjal dalwadi <[email protected]>
    2221 */
    2322class Analytics_Code_Management_Public {
     
    2625     * The ID of this plugin.
    2726     *
    28      * @since    1.0.0
     27     * @since    3.0.0
    2928     * @access   private
    3029     * @var      string    $plugin_name    The ID of this plugin.
     
    3534     * The version of this plugin.
    3635     *
    37      * @since    1.0.0
     36     * @since    3.0.0
    3837     * @access   private
    3938     * @var      string    $version    The current version of this plugin.
     
    4443     * Initialize the class and set its properties.
    4544     *
    46      * @since    1.0.0
     45     * @since    3.0.0
    4746     * @param      string $plugin_name       The name of the plugin.
    4847     * @param      string $version    The version of this plugin.
     
    5756     * Register the stylesheets for the public-facing side of the site.
    5857     *
    59      * @since    1.0.0
     58     * @since    3.0.0
    6059     */
    6160    public function enqueue_styles() {
     
    7978     * Register the JavaScript for the public-facing side of the site.
    8079     *
    81      * @since    1.0.0
     80     * @since    3.0.0
    8281     */
    8382    public function enqueue_scripts() {
  • ga-code-management/trunk/public/partials/analytics-code-management-public-display.php

    r3026152 r3090586  
    77 *
    88 * @link       https://viitorcloud.com/
    9  * @since      1.0.0
     9 * @since      3.0.0
    1010 *
    1111 * @package    Analytics_Code_Management
    1212 * @subpackage Analytics_Code_Management/public/partials
    1313 */
    14  
     14
    1515?>
    1616
  • ga-code-management/trunk/uninstall.php

    r1720321 r3090586  
    2121 *
    2222 * @link       https://viitorcloud.com/
    23  * @since      1.0.0
     23 * @since      3.0.0
    2424 *
    2525 * @package    Analytics_Code_Management
Note: See TracChangeset for help on using the changeset viewer.