Changeset 1236313
- Timestamp:
- 09/02/2015 12:30:06 PM (11 years ago)
- Location:
- octavius-rocks/trunk
- Files:
-
- 7 edited
-
admin/class-octavius-client-admin.php (modified) (2 diffs)
-
admin/class-octavius-client-settings.php (modified) (2 diffs)
-
admin/partials/octavius-settings-ab.php (modified) (2 diffs)
-
includes/class-octavius-client.php (modified) (2 diffs)
-
includes/class-octavius-rocks-ab-variants-store.php (modified) (1 diff)
-
octavius-client.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
octavius-rocks/trunk/admin/class-octavius-client-admin.php
r1220938 r1236313 92 92 array($this, 'control_top_clicks') // Controll Function 93 93 ); 94 95 wp_add_dashboard_widget( 96 'octavius_ab_results', 97 'A/B Results', 98 array($this, 'render_ab_results'), 99 array($this, 'control_ab_results') 100 ); 94 if($this->variants->enabled()){ 95 wp_add_dashboard_widget( 96 'octavius_ab_results', 97 'A/B Results', 98 array($this, 'render_ab_results'), 99 array($this, 'control_ab_results') 100 ); 101 } 101 102 } 102 103 private function dashboardOptions($options = null){ … … 151 152 wp_enqueue_script( 'octavius-admin-dashboard', plugin_dir_url( __FILE__ ) . 'js/octavius-dashboard.js', array(), '1.0', true ); 152 153 153 // require_once dirname(__FILE__)."/../classes/Octavius_Top_Links_Table.php";154 // $wp_list_table = new Octavius_Top_Links_Table();155 // $wp_list_table->prepare_items($options["number"]);156 // $wp_list_table->display();157 158 // TODO: enqueue js159 154 include dirname(__FILE__)."/partials/octavius-dashboard-top-clicks.php"; 160 155 -
octavius-rocks/trunk/admin/class-octavius-client-settings.php
r1183285 r1236313 83 83 * save if needed 84 84 */ 85 if(isset($_POST['submit'])){ 86 /** 87 * update ab settings 88 */ 89 $enabled = 0; 90 if(isset($_POST["octavius_rocks_ab_enabled"])){ 91 $enabled = intval($_POST["octavius_rocks_ab_enabled"]); 92 } 93 if($enabled < 1){ 94 $enabled = 0; 95 } else { 96 $enabled = 1; 97 } 98 $this->variants->enabled($enabled); 99 } 85 100 if(isset($_POST) && isset($_POST["octavius_rocks"]) && is_array($_POST["octavius_rocks"])){ 86 101 $oc = $_POST["octavius_rocks"]; … … 109 124 } 110 125 $this->variants->save($values); 111 /**112 * update ab settings113 */114 update_option('octavius_rocks_ab_min_hits', intval($_POST["octavius_rocks_ab_min_hits"]));115 126 } 116 127 /** 117 128 * render settings page 118 129 */ 119 $ min_hits = get_option('octavius_rocks_ab_min_hits', 10);130 $ab_enabled = $this->variants->enabled(); 120 131 $all = $this->variants->get(); 121 132 require dirname(__FILE__)."/partials/octavius-settings-ab.php"; -
octavius-rocks/trunk/admin/partials/octavius-settings-ab.php
r1183285 r1236313 1 1 <form method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>?page=octavius-rocks&tab=ab"> 2 2 3 <h2>Settings</h2> 4 <table class="form-table"> 5 <tbody> 6 <tr> 7 <tr> 8 <th scope="row"><?php echo __("Turn on A/B tests for posts"); ?></th> 9 <td><input type="checkbox" id="octavius_rocks_ab_enabled" value="1" 10 <?php if($ab_enabled) echo "checked='checked'"; ?> 11 name="octavius_rocks_ab_enabled"> <?php 12 if($ab_enabled) { 13 echo __("Enabled"); 14 } else { 15 echo __("Disabled"); 16 } 17 ?></td> 18 </tr> 19 </tr> 20 </tbody> 21 </table> 22 3 23 <h2>Variants</h2> 24 <?php 25 if($ab_enabled): 26 ?> 4 27 <table> 5 28 <tbody> … … 31 54 </tbody> 32 55 </table> 33 34 35 <h2>Settings</h2> 36 <table class="form-table"> 37 <tbody> 38 <tr> 39 <th scope="row"><label for="octavius_rocks_ab_min_hits">Show on Dashboard after minimun of x Hits</label></th> 40 <td><input type="text" id="octavius_rocks_ab_min_hits" name="octavius_rocks_ab_min_hits" value="<?php echo $min_hits; ?>" 41 class="regular-text" placeholder="Number of Hits"></td> 42 </tr> 43 </tbody> 44 </table> 56 <?php 57 else: 58 ?> 59 <p><?php echo __("Enable A/B Tests to see more options"); ?></p> 60 <?php 61 endif; 62 ?> 63 45 64 46 65 <?php submit_button("Save"); ?> -
octavius-rocks/trunk/includes/class-octavius-client.php
r1230199 r1236313 38 38 39 39 $this->plugin_name = 'octavius-client'; 40 $this->version = '1.3. 3';40 $this->version = '1.3.4'; 41 41 42 42 $this->load_dependencies(); … … 162 162 * if there is an alternate teaser variante render meta box 163 163 */ 164 if( count($this->variants->get()) > 0){164 if( $this->variants->enabled() && count($this->variants->get()) > 0){ 165 165 $this->loader->add_action('add_meta_boxes', $plugin_admin, 'add_meta_box_ab'); 166 166 $this->loader->add_action('save_post', $plugin_admin, 'save_meta_box_ab'); -
octavius-rocks/trunk/includes/class-octavius-rocks-ab-variants-store.php
r1220938 r1236313 47 47 return get_post_meta($post_id,"_octavius_rocks_variant",true); 48 48 } 49 /** 50 * is octavius enabled? 51 */ 52 public function enabled( $enabled = null ){ 53 if($enabled !== null){ 54 update_option("_octavius_rocks_ab_enabled", $enabled); 55 } 56 return get_option('_octavius_rocks_ab_enabled', false); 57 } 49 58 } -
octavius-rocks/trunk/octavius-client.php
r1230199 r1236313 8 8 * Plugin URI: http://www.palasthotel.de 9 9 * Description: Tacking click paths 10 * Version: 1.3. 310 * Version: 1.3.4 11 11 * Author: PALASTHOTEL by Edward 12 12 * Author URI: http://www.palasthotel.de -
octavius-rocks/trunk/readme.txt
r1230199 r1236313 5 5 Requires at least: 4.0 6 6 Tested up to: 4.3 7 Stable tag: 1.3. 37 Stable tag: 1.3.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 33 33 34 34 == Changelog == 35 36 = 1.3.4 = 37 * Enable or disable A/B Tests for post option 35 38 36 39 = 1.3.3 =
Note: See TracChangeset
for help on using the changeset viewer.