Changeset 3090586
- Timestamp:
- 05/22/2024 06:39:45 AM (19 months ago)
- Location:
- ga-code-management/trunk
- Files:
-
- 15 edited
-
README.txt (modified) (1 diff)
-
admin/class-analytics-code-management-admin.php (modified) (9 diffs)
-
admin/index.php (modified) (1 diff)
-
admin/partials/analytics-code-management-admin-display.php (modified) (1 diff)
-
analytics-code-management.php (modified) (3 diffs)
-
includes/class-analytics-code-management-activator.php (modified) (3 diffs)
-
includes/class-analytics-code-management-deactivator.php (modified) (3 diffs)
-
includes/class-analytics-code-management-i18n.php (modified) (4 diffs)
-
includes/class-analytics-code-management-loader.php (modified) (12 diffs)
-
includes/class-analytics-code-management.php (modified) (22 diffs)
-
includes/constant.php (modified) (1 diff)
-
includes/index.php (modified) (1 diff)
-
public/class-analytics-code-management-public.php (modified) (7 diffs)
-
public/partials/analytics-code-management-public-display.php (modified) (1 diff)
-
uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ga-code-management/trunk/README.txt
r3026152 r3090586 3 3 Tags: Analytics Code, Google Analytics Code, Google Analytics 4 4 Requires at least: 3.8 5 Tested up to: 6. 4.25 Tested up to: 6.5.3 6 6 Stable tag: trunk 7 7 License: GPL-2.0+ -
ga-code-management/trunk/admin/class-analytics-code-management-admin.php
r1720321 r3090586 5 5 * 6 6 * @link https://viitorcloud.com/ 7 * @since 1.0.07 * @since 3.0.0 8 8 * 9 9 * @package Analytics_Code_Management … … 19 19 * @package Analytics_Code_Management 20 20 * @subpackage Analytics_Code_Management/admin 21 * @author kinjal dalwadi <[email protected]>22 21 */ 23 22 class Analytics_Code_Management_Admin { … … 26 25 * The ID of this plugin. 27 26 * 28 * @since 1.0.027 * @since 3.0.0 29 28 * @access private 30 29 * @var string $plugin_name The ID of this plugin. … … 35 34 * The version of this plugin. 36 35 * 37 * @since 1.0.036 * @since 3.0.0 38 37 * @access private 39 38 * @var string $version The current version of this plugin. … … 44 43 * Initialize the class and set its properties. 45 44 * 46 * @since 1.0.047 * @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. 49 48 */ 50 49 public function __construct( $plugin_name, $version ) { 51 50 52 51 $this->plugin_name = $plugin_name; 53 $this->version = $version; 54 52 $this->version = $version; 55 53 } 56 54 … … 58 56 * Register the stylesheets for the admin area. 59 57 * 60 * @since 1.0.058 * @since 3.0.0 61 59 */ 62 60 public function enqueue_styles() { … … 75 73 76 74 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/analytics-code-management-admin.css', array(), $this->version, 'all' ); 77 78 75 } 79 76 … … 81 78 * Register the JavaScript for the admin area. 82 79 * 83 * @since 1.0.080 * @since 3.0.0 84 81 */ 85 82 public function enqueue_scripts() { … … 98 95 99 96 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> 151 146 </div> 152 <?php147 <?php 153 148 } 154 149 } 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 } 191 183 /* 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 } 198 190 199 191 // Delete the redirect transient 200 delete_transient( '_welcome_screen_tab_activation_redirect_data');201 202 // if activating from network, or bulk203 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'] ) ) { 204 196 return; 205 197 } 206 198 // 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() { 212 204 $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 ?> 222 218 <div class="wrap about-wrap"> 223 219 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 240 230 <?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 } 243 240 ?> 244 241 </h2> 245 242 246 243 <?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 ) { 249 246 case $current_tab_wc: 250 do_action( 'analytics_code_' . $current_tab_wc);247 do_action( 'analytics_code_' . $current_tab_wc ); 251 248 break; 252 249 } 253 250 } 254 251 ?> 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> 280 278 <li>Get your analytics tracking ID following below steps:<br> 281 279 1) Sign up or Login for Google Analytics<br> 282 280 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> 284 282 </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 303 302 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 } 307 305 } -
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 7 7 * 8 8 * @link https://viitorcloud.com/ 9 * @since 1.0.09 * @since 3.0.0 10 10 * 11 11 * @package Analytics_Code_Management -
ga-code-management/trunk/analytics-code-management.php
r3026152 r3090586 9 9 * 10 10 * @link http://viitorcloud.com/ 11 * @since 1.0.011 * @since 3.0.0 12 12 * @package Analytics_Code_Management 13 13 * … … 16 16 * Plugin URI: https://wordpress.org/plugins/ga-code-management/ 17 17 * Description: This plugin provides a functionality to add Google Analytics Tracking code from WordPress admin area. 18 * Version: 2.0.018 * Version: 3.0.0 19 19 * Author: ViitorCloud 20 20 * Author URI: https://viitorcloud.com/ … … 65 65 * not affect the page life cycle. 66 66 * 67 * @since 1.0.067 * @since 3.0.0 68 68 */ 69 69 function run_analytics_code_management() { -
ga-code-management/trunk/includes/class-analytics-code-management-activator.php
r1720321 r3090586 5 5 * 6 6 * @link https://viitorcloud.com/ 7 * @since 1.0.07 * @since 3.0.0 8 8 * 9 9 * @package Analytics_Code_Management … … 16 16 * This class defines all code necessary to run during the plugin's activation. 17 17 * 18 * @since 1.0.018 * @since 3.0.0 19 19 * @package Analytics_Code_Management 20 20 * @subpackage Analytics_Code_Management/includes 21 * @author kinjal dalwadi <[email protected]>22 21 */ 23 22 class Analytics_Code_Management_Activator { … … 28 27 * Long Description. 29 28 * 30 * @since 1.0.029 * @since 3.0.0 31 30 */ 32 31 public static function activate() { 33 // Set Transist once pluign activated32 // Set Transist once plugin activated. 34 33 set_transient( '_welcome_screen_tab_activation_redirect_data', true, 30 ); 35 34 } 36 37 35 } -
ga-code-management/trunk/includes/class-analytics-code-management-deactivator.php
r1720321 r3090586 5 5 * 6 6 * @link https://viitorcloud.com/ 7 * @since 1.0.07 * @since 3.0.0 8 8 * 9 9 * @package Analytics_Code_Management … … 16 16 * This class defines all code necessary to run during the plugin's deactivation. 17 17 * 18 * @since 1.0.018 * @since 3.0.0 19 19 * @package Analytics_Code_Management 20 20 * @subpackage Analytics_Code_Management/includes 21 * @author kinjal dalwadi <[email protected]>22 21 */ 23 22 class Analytics_Code_Management_Deactivator { … … 28 27 * Long Description. 29 28 * 30 * @since 1.0.029 * @since 3.0.0 31 30 */ 32 31 public static function deactivate() { 33 34 32 } 35 36 33 } -
ga-code-management/trunk/includes/class-analytics-code-management-i18n.php
r1720321 r3090586 8 8 * 9 9 * @link https://viitorcloud.com/ 10 * @since 1.0.010 * @since 3.0.0 11 11 * 12 12 * @package Analytics_Code_Management … … 20 20 * so that it is ready for translation. 21 21 * 22 * @since 1.0.022 * @since 3.0.0 23 23 * @package Analytics_Code_Management 24 24 * @subpackage Analytics_Code_Management/includes 25 * @author kinjal dalwadi <[email protected]>26 25 */ 27 26 class Analytics_Code_Management_i18n { … … 31 30 * Load the plugin text domain for translation. 32 31 * 33 * @since 1.0.032 * @since 3.0.0 34 33 */ 35 34 public function load_plugin_textdomain() { … … 40 39 dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' 41 40 ); 42 43 41 } 44 45 46 47 42 } -
ga-code-management/trunk/includes/class-analytics-code-management-loader.php
r1720321 r3090586 5 5 * 6 6 * @link https://viitorcloud.com/ 7 * @since 1.0.07 * @since 3.0.0 8 8 * 9 9 * @package Analytics_Code_Management … … 20 20 * @package Analytics_Code_Management 21 21 * @subpackage Analytics_Code_Management/includes 22 * @author kinjal dalwadi <[email protected]>23 22 */ 24 23 class Analytics_Code_Management_Loader { … … 27 26 * The array of actions registered with WordPress. 28 27 * 29 * @since 1.0.028 * @since 3.0.0 30 29 * @access protected 31 30 * @var array $actions The actions registered with WordPress to fire when the plugin loads. … … 36 35 * The array of filters registered with WordPress. 37 36 * 38 * @since 1.0.037 * @since 3.0.0 39 38 * @access protected 40 39 * @var array $filters The filters registered with WordPress to fire when the plugin loads. … … 45 44 * Initialize the collections used to maintain the actions and filters. 46 45 * 47 * @since 1.0.046 * @since 3.0.0 48 47 */ 49 48 public function __construct() { … … 51 50 $this->actions = array(); 52 51 $this->filters = array(); 53 54 52 } 55 53 … … 57 55 * Add a new action to the collection to be registered with WordPress. 58 56 * 59 * @since 1.0.060 * @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. 65 63 */ 66 64 public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { … … 71 69 * Add a new filter to the collection to be registered with WordPress. 72 70 * 73 * @since 1.0.074 * @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 171 * @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 79 77 */ 80 78 public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { … … 86 84 * collection. 87 85 * 88 * @since 1.0.086 * @since 3.0.0 89 87 * @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. 96 94 * @return array The collection of actions and filters registered with WordPress. 97 95 */ … … 103 101 'callback' => $callback, 104 102 'priority' => $priority, 105 'accepted_args' => $accepted_args 103 'accepted_args' => $accepted_args, 106 104 ); 107 105 108 106 return $hooks; 109 110 107 } 111 108 … … 113 110 * Register the filters and actions with WordPress. 114 111 * 115 * @since 1.0.0112 * @since 3.0.0 116 113 */ 117 114 public function run() { … … 124 121 add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); 125 122 } 126 127 123 } 128 129 124 } -
ga-code-management/trunk/includes/class-analytics-code-management.php
r1720321 r3090586 8 8 * 9 9 * @link https://viitorcloud.com/ 10 * @since 1.0.010 * @since 3.0.0 11 11 * 12 12 * @package Analytics_Code_Management … … 23 23 * version of the plugin. 24 24 * 25 * @since 1.0.025 * @since 3.0.0 26 26 * @package Analytics_Code_Management 27 27 * @subpackage Analytics_Code_Management/includes 28 * @author kinjal dalwadi <[email protected]>29 28 */ 30 29 class Analytics_Code_Management { … … 34 33 * the plugin. 35 34 * 36 * @since 1.0.035 * @since 3.0.0 37 36 * @access protected 38 37 * @var Analytics_Code_Management_Loader $loader Maintains and registers all hooks for the plugin. … … 43 42 * The unique identifier of this plugin. 44 43 * 45 * @since 1.0.044 * @since 3.0.0 46 45 * @access protected 47 46 * @var string $plugin_name The string used to uniquely identify this plugin. … … 52 51 * The current version of the plugin. 53 52 * 54 * @since 1.0.053 * @since 3.0.0 55 54 * @access protected 56 55 * @var string $version The current version of the plugin. … … 65 64 * the public-facing side of the site. 66 65 * 67 * @since 1.0.066 * @since 3.0.0 68 67 */ 69 68 public function __construct() { 70 69 71 70 $this->plugin_name = 'analytics-code-management'; 72 $this->version = '1.0.0';71 $this->version = '3.0.0'; 73 72 74 73 $this->load_dependencies(); … … 76 75 $this->define_admin_hooks(); 77 76 $this->define_public_hooks(); 78 79 77 } 80 78 … … 92 90 * with WordPress. 93 91 * 94 * @since 1.0.092 * @since 3.0.0 95 93 * @access private 96 94 */ … … 101 99 * core plugin. 102 100 */ 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'; 104 102 105 103 /** … … 107 105 * of the plugin. 108 106 */ 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'; 110 108 111 109 /** 112 110 * The class responsible for defining all actions that occur in the admin area. 113 111 */ 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'; 115 113 116 114 /** … … 118 116 * side of the site. 119 117 */ 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'; 121 119 122 120 $this->loader = new Analytics_Code_Management_Loader(); 123 124 121 } 125 122 … … 130 127 * with WordPress. 131 128 * 132 * @since 1.0.0129 * @since 3.0.0 133 130 * @access private 134 131 */ … … 138 135 139 136 $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); 140 141 137 } 142 138 … … 145 141 * of the plugin. 146 142 * 147 * @since 1.0.0143 * @since 3.0.0 148 144 * @access private 149 145 */ … … 154 150 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); 155 151 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); 156 152 157 153 /* Add actions hook for welcome screen */ 158 154 $this->loader->add_action( 'admin_init', $plugin_admin, 'welcome_page_activation_redirect_tab' ); 159 155 160 156 $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' ); 163 159 $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' ); 171 165 } 172 166 … … 175 169 * of the plugin. 176 170 * 177 * @since 1.0.0171 * @since 3.0.0 178 172 * @access private 179 173 */ … … 184 178 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); 185 179 $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 189 183 $get_analytic_settings = get_option( ACM_PLUGIN_GLOBAL_SETTING_KEY ); 190 184 $get_analytic_settings = maybe_unserialize( $get_analytic_settings ); 191 192 185 } 193 186 … … 195 188 * Run the loader to execute all of the hooks with WordPress. 196 189 * 197 * @since 1.0.0190 * @since 3.0.0 198 191 */ 199 192 public function run() { … … 205 198 * WordPress and to define internationalization functionality. 206 199 * 207 * @since 1.0.0200 * @since 3.0.0 208 201 * @return string The name of the plugin. 209 202 */ … … 215 208 * The reference to the class that orchestrates the hooks with the plugin. 216 209 * 217 * @since 1.0.0210 * @since 3.0.0 218 211 * @return Analytics_Code_Management_Loader Orchestrates the hooks of the plugin. 219 212 */ … … 225 218 * Retrieve the version number of the plugin. 226 219 * 227 * @since 1.0.0220 * @since 3.0.0 228 221 * @return string The version number of the plugin. 229 222 */ … … 231 224 return $this->version; 232 225 } 233 234 226 } -
ga-code-management/trunk/includes/constant.php
r1720321 r3090586 3 3 * define constant variabes 4 4 * define admin side constant 5 * 5 6 * @package Phase 1 6 7 * @since Phase 1 7 * @version 1.0.08 * @version 3.0.0 8 9 * @author Viitorcloud 9 10 * @param null 10 11 */ 11 // constant define for table name 12 // constant define for table name. 12 13 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 ?> 14 define( 'ACM_PLUGIN_SLUG', 'analytics-code-management' ); 15 define( 'ACM_PLUGIN_NAME', 'Add Analytics Code' ); 16 define( 'ACM_PLUGIN_PAGE_MENU_TITLE', 'add-analytics-codes' ); 17 define( 'ACM_PLUGIN_PAGE_MENU_SLUG', 'add_analytics_codes' ); 18 define( 'ACM_PLUGIN_HEADER_NAME', 'Add Google Anaytics Code Settings' ); 19 define( 'ACM_PLUGIN_ADDITIONAL_STYLE_TITLE', 'Google Analytics Tracking ID:' ); 20 define( 'ACM_PLUGIN_OPTION_SAVE_BTN', 'Submit' ); 21 define( '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 5 5 * 6 6 * @link https://viitorcloud.com/ 7 * @since 1.0.07 * @since 3.0.0 8 8 * 9 9 * @package Analytics_Code_Management … … 19 19 * @package Analytics_Code_Management 20 20 * @subpackage Analytics_Code_Management/public 21 * @author kinjal dalwadi <[email protected]>22 21 */ 23 22 class Analytics_Code_Management_Public { … … 26 25 * The ID of this plugin. 27 26 * 28 * @since 1.0.027 * @since 3.0.0 29 28 * @access private 30 29 * @var string $plugin_name The ID of this plugin. … … 35 34 * The version of this plugin. 36 35 * 37 * @since 1.0.036 * @since 3.0.0 38 37 * @access private 39 38 * @var string $version The current version of this plugin. … … 44 43 * Initialize the class and set its properties. 45 44 * 46 * @since 1.0.045 * @since 3.0.0 47 46 * @param string $plugin_name The name of the plugin. 48 47 * @param string $version The version of this plugin. … … 57 56 * Register the stylesheets for the public-facing side of the site. 58 57 * 59 * @since 1.0.058 * @since 3.0.0 60 59 */ 61 60 public function enqueue_styles() { … … 79 78 * Register the JavaScript for the public-facing side of the site. 80 79 * 81 * @since 1.0.080 * @since 3.0.0 82 81 */ 83 82 public function enqueue_scripts() { -
ga-code-management/trunk/public/partials/analytics-code-management-public-display.php
r3026152 r3090586 7 7 * 8 8 * @link https://viitorcloud.com/ 9 * @since 1.0.09 * @since 3.0.0 10 10 * 11 11 * @package Analytics_Code_Management 12 12 * @subpackage Analytics_Code_Management/public/partials 13 13 */ 14 14 15 15 ?> 16 16 -
ga-code-management/trunk/uninstall.php
r1720321 r3090586 21 21 * 22 22 * @link https://viitorcloud.com/ 23 * @since 1.0.023 * @since 3.0.0 24 24 * 25 25 * @package Analytics_Code_Management
Note: See TracChangeset
for help on using the changeset viewer.