Changeset 2820618
- Timestamp:
- 11/18/2022 04:28:54 PM (3 years ago)
- Location:
- ybug-feedback-widget
- Files:
-
- 8 edited
- 1 copied
-
tags/1.1.0 (copied) (copied from ybug-feedback-widget/trunk)
-
tags/1.1.0/includes/class-ybug-admin.php (modified) (2 diffs)
-
tags/1.1.0/includes/class-ybug-public.php (modified) (1 diff)
-
tags/1.1.0/readme.txt (modified) (2 diffs)
-
tags/1.1.0/ybug.php (modified) (2 diffs)
-
trunk/includes/class-ybug-admin.php (modified) (2 diffs)
-
trunk/includes/class-ybug-public.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/ybug.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ybug-feedback-widget/tags/1.1.0/includes/class-ybug-admin.php
r2274425 r2820618 61 61 <input type='text' name='ybug[project]' value='<?php echo $options['project'] ?>' size="64" class="regular-text code" placeholder="Copy & paste your project ID here..." /> 62 62 <p class="description">The ID of the project in Ybug that you have created for this site. Leave empty to disable Feedback Widget.</p> 63 <?php 64 65 } 66 67 /** 68 * Render JS snippet 69 * 70 * @since 1.1.0 71 */ 72 public function render_restrict_access_field( ) { 73 74 $options = get_option( 'ybug' ); 75 $options['restrict_access'] = @$options['restrict_access'] ?: 'no'; 76 $options['roles'] = @$options['roles'] ?: []; 77 ?> 78 <p> 79 <label> 80 <input name="ybug[restrict_access]" type="radio" value="no" class="tog" <?php checked( 'no' === $options['restrict_access'] ); ?> /> 81 <?php echo __( 'Show to everyone', 'ybug' ); ?> 82 </label> 83 </p> 84 <p> 85 <label> 86 <input name="ybug[restrict_access]" type="radio" value="all" class="tog" <?php checked( 'all' === $options['restrict_access'] ); ?> /> 87 <?php echo __( 'Show to all logged in users', 'ybug' ); ?> 88 </label> 89 </p> 90 <p> 91 <label> 92 <input name="ybug[restrict_access]" type="radio" value="roles" class="tog" <?php checked( 'roles' === $options['restrict_access'] ); ?> /> 93 <?php echo __( 'Show only to some users by role:', 'ybug' ); ?> 94 </label> 95 </p> 96 <div class="ybug-roles-wrapper <?php if ($options['restrict_access'] !== 'roles') : ?>is-disabled<?php endif; ?>"> 97 <?php 98 $editable_roles = get_editable_roles(); 99 foreach ( $editable_roles as $role => $details ) { 100 $name = translate_user_role( $details['name'] ); 101 echo "<label for='ybug_role_{$details['name']}'> 102 <input type='checkbox' 103 id='ybug_role_{$details['name']}' 104 name='ybug[roles][]' 105 value='" . esc_attr( $role ) . "' 106 " . disabled($options['restrict_access'] !== 'roles', true, false). " 107 " . checked( in_array($role, $options['roles']), true, false ) . " 108 /> 109 <span class='ybug-role-name'>$name</span> 110 </label>"; 111 } 112 ?> 113 </div> 63 114 <?php 64 115 … … 162 213 'Ybug_settings_section' 163 214 ); 215 216 add_settings_field( 217 'restrict_access', 218 __( 'Restrict Access:', 'ybug' ), 219 array( $this, 'render_restrict_access_field' ), 220 'ybugSettings', 221 'Ybug_settings_section' 222 ); 223 224 225 wp_enqueue_style('options_css', plugins_url( 'styles/admin.css', __FILE__ ), array(), $this->version); 226 wp_enqueue_script( 'validation_js', plugins_url( 'javascript/validation.js', __FILE__ ), array(), $this->version, true ); 164 227 } 165 228 -
ybug-feedback-widget/tags/1.1.0/includes/class-ybug-public.php
r2274425 r2820618 40 40 $options = get_option( 'ybug' ); 41 41 42 // Show to all logged in users 43 if (@$options['restrict_access'] === 'all' && !is_user_logged_in()) { 44 return; 45 } 46 47 // Show only to some users by role 48 if (@$options['restrict_access'] === 'roles') { 49 if (!array_filter($options['roles'], 'current_user_can')) { 50 return; 51 } 52 } 53 42 54 if (@$options['project']) { 43 55 -
ybug-feedback-widget/tags/1.1.0/readme.txt
r2751171 r2820618 3 3 Tags: feedback, bug-tracking, user feedback, visual feedback, feedback widget, feedback button, screenshot 4 4 Requires at least: 3.0.1 5 Tested up to: 6. 05 Tested up to: 6.1 6 6 Stable tag: trunk 7 7 Requires PHP: 5.3 … … 59 59 * Plugin release. 60 60 61 = 1.1.0 = 62 * Added new setting - access restriction 63 61 64 == Upgrade Notice == -
ybug-feedback-widget/tags/1.1.0/ybug.php
r2274425 r2820618 11 11 * Plugin Name: Ybug Feedback Widget 12 12 * Description: Collect visual feedback and bug reports with screenshots from your users. This plugin allows you to easily add Ybug Feedback Widget on your website. 13 * Version: 1. 0.013 * Version: 1.1.0 14 14 * Requires at least: 3.1 15 15 * Requires PHP: 5.3 … … 26 26 } 27 27 28 define( 'YBUG_VERSION', '1. 0.0' );28 define( 'YBUG_VERSION', '1.1.0' ); 29 29 30 30 function activate_ybug() { -
ybug-feedback-widget/trunk/includes/class-ybug-admin.php
r2274425 r2820618 61 61 <input type='text' name='ybug[project]' value='<?php echo $options['project'] ?>' size="64" class="regular-text code" placeholder="Copy & paste your project ID here..." /> 62 62 <p class="description">The ID of the project in Ybug that you have created for this site. Leave empty to disable Feedback Widget.</p> 63 <?php 64 65 } 66 67 /** 68 * Render JS snippet 69 * 70 * @since 1.1.0 71 */ 72 public function render_restrict_access_field( ) { 73 74 $options = get_option( 'ybug' ); 75 $options['restrict_access'] = @$options['restrict_access'] ?: 'no'; 76 $options['roles'] = @$options['roles'] ?: []; 77 ?> 78 <p> 79 <label> 80 <input name="ybug[restrict_access]" type="radio" value="no" class="tog" <?php checked( 'no' === $options['restrict_access'] ); ?> /> 81 <?php echo __( 'Show to everyone', 'ybug' ); ?> 82 </label> 83 </p> 84 <p> 85 <label> 86 <input name="ybug[restrict_access]" type="radio" value="all" class="tog" <?php checked( 'all' === $options['restrict_access'] ); ?> /> 87 <?php echo __( 'Show to all logged in users', 'ybug' ); ?> 88 </label> 89 </p> 90 <p> 91 <label> 92 <input name="ybug[restrict_access]" type="radio" value="roles" class="tog" <?php checked( 'roles' === $options['restrict_access'] ); ?> /> 93 <?php echo __( 'Show only to some users by role:', 'ybug' ); ?> 94 </label> 95 </p> 96 <div class="ybug-roles-wrapper <?php if ($options['restrict_access'] !== 'roles') : ?>is-disabled<?php endif; ?>"> 97 <?php 98 $editable_roles = get_editable_roles(); 99 foreach ( $editable_roles as $role => $details ) { 100 $name = translate_user_role( $details['name'] ); 101 echo "<label for='ybug_role_{$details['name']}'> 102 <input type='checkbox' 103 id='ybug_role_{$details['name']}' 104 name='ybug[roles][]' 105 value='" . esc_attr( $role ) . "' 106 " . disabled($options['restrict_access'] !== 'roles', true, false). " 107 " . checked( in_array($role, $options['roles']), true, false ) . " 108 /> 109 <span class='ybug-role-name'>$name</span> 110 </label>"; 111 } 112 ?> 113 </div> 63 114 <?php 64 115 … … 162 213 'Ybug_settings_section' 163 214 ); 215 216 add_settings_field( 217 'restrict_access', 218 __( 'Restrict Access:', 'ybug' ), 219 array( $this, 'render_restrict_access_field' ), 220 'ybugSettings', 221 'Ybug_settings_section' 222 ); 223 224 225 wp_enqueue_style('options_css', plugins_url( 'styles/admin.css', __FILE__ ), array(), $this->version); 226 wp_enqueue_script( 'validation_js', plugins_url( 'javascript/validation.js', __FILE__ ), array(), $this->version, true ); 164 227 } 165 228 -
ybug-feedback-widget/trunk/includes/class-ybug-public.php
r2274425 r2820618 40 40 $options = get_option( 'ybug' ); 41 41 42 // Show to all logged in users 43 if (@$options['restrict_access'] === 'all' && !is_user_logged_in()) { 44 return; 45 } 46 47 // Show only to some users by role 48 if (@$options['restrict_access'] === 'roles') { 49 if (!array_filter($options['roles'], 'current_user_can')) { 50 return; 51 } 52 } 53 42 54 if (@$options['project']) { 43 55 -
ybug-feedback-widget/trunk/readme.txt
r2751171 r2820618 3 3 Tags: feedback, bug-tracking, user feedback, visual feedback, feedback widget, feedback button, screenshot 4 4 Requires at least: 3.0.1 5 Tested up to: 6. 05 Tested up to: 6.1 6 6 Stable tag: trunk 7 7 Requires PHP: 5.3 … … 59 59 * Plugin release. 60 60 61 = 1.1.0 = 62 * Added new setting - access restriction 63 61 64 == Upgrade Notice == -
ybug-feedback-widget/trunk/ybug.php
r2274425 r2820618 11 11 * Plugin Name: Ybug Feedback Widget 12 12 * Description: Collect visual feedback and bug reports with screenshots from your users. This plugin allows you to easily add Ybug Feedback Widget on your website. 13 * Version: 1. 0.013 * Version: 1.1.0 14 14 * Requires at least: 3.1 15 15 * Requires PHP: 5.3 … … 26 26 } 27 27 28 define( 'YBUG_VERSION', '1. 0.0' );28 define( 'YBUG_VERSION', '1.1.0' ); 29 29 30 30 function activate_ybug() {
Note: See TracChangeset
for help on using the changeset viewer.