├── LICENSE ├── README.txt ├── admin.php ├── config.js ├── config.php ├── edit.js ├── edit.php ├── font-awesome.min.css ├── fonts ├── FontAwesome.otf ├── fontawesome-webfont.eot ├── fontawesome-webfont.svg ├── fontawesome-webfont.ttf └── fontawesome-webfont.woff ├── images ├── ajax-loader.gif ├── optimizely-icon.png ├── ui-bg_diagonals-thick_18_b81900_40x40.png ├── ui-bg_diagonals-thick_20_666666_40x40.png ├── ui-bg_flat_10_000000_40x100.png ├── ui-bg_glass_100_f6f6f6_1x400.png ├── ui-bg_glass_100_fdf5ce_1x400.png ├── ui-bg_glass_65_ffffff_1x400.png ├── ui-bg_gloss-wave_35_f6a828_500x100.png ├── ui-bg_highlight-soft_100_eeeeee_1x100.png ├── ui-bg_highlight-soft_75_ffe45c_1x100.png ├── ui-icons_222222_256x240.png ├── ui-icons_228ef1_256x240.png ├── ui-icons_ef8c08_256x240.png ├── ui-icons_ffd27a_256x240.png └── ui-icons_ffffff_256x240.png ├── jquery-ui.css ├── optimizely.js ├── optimizely.php ├── results.js ├── screenshot-1.png ├── screenshot-2.png └── style.css /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Optimizely, Inc. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | 13 | 14 | The software may incorporate code that is subject to the following additional open source license terms: 15 | 16 | -------------------------------------------------------------- 17 | 1. jQuery Copyright JS Foundation and other contributors, https://js.foundation/ 18 | 19 | This software consists of voluntary contributions made by many 20 | individuals. For exact contribution history, see the revision history 21 | available at https://github.com/jquery/jquery 22 | 23 | The following license applies to all parts of this software except as 24 | documented below: 25 | 26 | ==== 27 | 28 | Permission is hereby granted, free of charge, to any person obtaining 29 | a copy of this software and associated documentation files (the 30 | "Software"), to deal in the Software without restriction, including 31 | without limitation the rights to use, copy, modify, merge, publish, 32 | distribute, sublicense, and/or sell copies of the Software, and to 33 | permit persons to whom the Software is furnished to do so, subject to 34 | the following conditions: 35 | 36 | The above copyright notice and this permission notice shall be 37 | included in all copies or substantial portions of the Software. 38 | 39 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 40 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 41 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 42 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 43 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 44 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 45 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 46 | 47 | ==== 48 | 49 | All files located in the node_modules and external directories are 50 | externally maintained libraries used by this software which have their 51 | own licenses; we recommend you read them, as their terms may differ from 52 | the terms above. 53 | 54 | -------------------------------------------------------------- 55 | 56 | 2. Font Awesome Font by Dave Gandy - http://fontawesome.io 57 | 58 | SIL OFL Version 1.1 - 26 February 2007 59 | 60 | PREAMBLE 61 | The goals of the Open Font License (OFL) are to stimulate worldwide 62 | development of collaborative font projects, to support the font creation 63 | efforts of academic and linguistic communities, and to provide a free and 64 | open framework in which fonts may be shared and improved in partnership 65 | with others. 66 | 67 | The OFL allows the licensed fonts to be used, studied, modified and 68 | redistributed freely as long as they are not sold by themselves. The 69 | fonts, including any derivative works, can be bundled, embedded, 70 | redistributed and/or sold with any software provided that any reserved 71 | names are not used by derivative works. The fonts and derivatives, 72 | however, cannot be released under any other type of license. The 73 | requirement for fonts to remain under this license does not apply 74 | to any document created using the fonts or their derivatives. 75 | 76 | DEFINITIONS 77 | "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. 78 | 79 | "Reserved Font Name" refers to any names specified as such after the copyright statement(s). 80 | 81 | "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). 82 | 83 | "Modified Version" refers to any derivative made by adding to, deleting, or substituting — in part or in whole — any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. 84 | 85 | "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. 86 | 87 | PERMISSION & CONDITIONS 88 | 89 | Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 90 | 91 | 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. 92 | 93 | 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 94 | 95 | 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. 96 | 97 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. 98 | 99 | 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. 100 | 101 | TERMINATION 102 | This license becomes null and void if any of the above conditions are not met. 103 | 104 | DISCLAIMER 105 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. 106 | 107 | -------------------------------------------------------------- 108 | 109 | 3. Font Awesome CSS by Dave Gandy - http://fontawesome.io 110 | 111 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 112 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 113 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 114 | 115 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | === Optimizely Classic === 2 | Contributors: arthuracs, jonslaught, bradtaylorsf, lswartsenburg 3 | Donate link: N/A 4 | Tags: optimizely, ab testing, split testing, website optimization 5 | Requires at least: 3.0 6 | Tested up to: 4.4 7 | Stable tag: 3.7.8 8 | License: BSD 3-Clause 9 | License URI: https://opensource.org/licenses/BSD-3-Clause 10 | 11 | This plugin helps you configure your WordPress website to use Optimizely Classic, a dramatically easier way to improve your website through A/B testing. 12 | 13 | == Description == 14 | This plugin helps you configure your WordPress website to use Optimizely Classic. If you are new to Optimizely or have started using Optimizely X (not Classic), then please use the [Optimizely X plugin](https://wordpress.org/plugins/optimizely-x/). 15 | 16 | Optimizely is a dramatically easier way for you to improve your website through A/B testing. Create an experiment in minutes with our easy-to-use visual interface with absolutely no coding or engineering required. Convert your website visitors into customers and earn more revenue today! 17 | 18 | If you have an Optimizely Classic project, you simply enter your Optimizely project code in the plugin's configuration page and you're ready to start improving your website using Optimizely. Built for testing headlines, this plugin allows you to, create new experiments, see your experiment results, launch winners and much more all without leaving WordPress. 19 | 20 | == Installation == 21 | Sign up at [Optimizely.com](http://www.optimizely.com). 22 | 23 | 1. Make sure you are using Optimizely Classic, not Optimizely X. If you are using Optimizely X, please use the Optimizely X plugin. 24 | 2. Upload the Optimizely Classic WordPress plugin to your blog 25 | 3. Activate the plugin through the Optimizely Classic menu in WordPress 26 | 4. Enter your [Optimizely API token](https://app.optimizely.com/tokens) in the plugin's settings page, choose a project to use, then save. 27 | 28 | You're ready to start using Optimizely! 29 | 30 | == Screenshots == 31 | 1. Create multiple headlines for each post 32 | 2. View your results and launch winners directly from the dashboard 33 | 34 | == Changelog == 35 | 36 | = 3.7.8 = 37 | * FIXED readme issues 38 | 39 | = 3.7.7 = 40 | * FIXED duplicate readme.txt file 41 | 42 | = 3.7.6 = 43 | * UPDATED instructions to use the Optimizely X plugin for Optimizely projects that are using Optimizely X (not Classic) 44 | 45 | = 3.7.5 = 46 | * FIXED bug on edit post page that displayed unwanted tooltip 47 | * UPDATED default conditional activation code to exclude users coming from other sites 48 | 49 | = 3.7.1 = 50 | * FIXED bug on config.js around the conditional activation input 51 | 52 | = 3.7.0 = 53 | * NEW - Conditional activation mode. Now you can only run an experiment if the user actually see's the headline 54 | * NEW - Default URL targeting. Now you can have a default URL to run experiments on or across the entire site. 55 | * Updated the links to go to app.optimizely.com 56 | 57 | = 3.6.1 = 58 | * fixed bug in edit.php that only happened on servers running lower than PHP 5.4 59 | 60 | = 3.6.0 = 61 | * prevented the creation of an experiment until the post is published. This is to prevent goals and URL targeting to be incorrect when a post title changes and URL truncating 62 | * updated the results page to use the new Optimizely statistics engine 63 | 64 | = 3.5.2 = 65 | * Fixed issue where the powered testing number will only accept 2 digits 66 | * Fixed issue where pagenow can be undefined. Check to see if its undefined before displaying the page 67 | 68 | = 3.5.1 = 69 | * Fixed bug in optimizely.php that was preventing large snippet ids to render correctly 70 | 71 | = 3.5.0 = 72 | * Major changes to get the plugin ready for WordPress VIP 73 | * Fixed bug that caused some snippets not to get loaded correctly after performing an upgrade 74 | 75 | = 3.2.1 = 76 | * Fixed bug that caused some variations to not get updated or created after experiment creation 77 | 78 | = 3.2.0 = 79 | * Fixed bug where the progress bar was still loading when no results are ready 80 | 81 | 82 | = 3.1.0 = 83 | * Added ability to add custom post types 84 | 85 | = 3.0.0 = 86 | * Making repository Open Source 87 | * Added Results Page 88 | * Added Ability to launch winners directly from results page by changing the headline for the post 89 | * Added powered testing 90 | * Added ability to add configure how many variations to test per post 91 | 92 | = 2.0.0 = 93 | * Added headline testing 94 | 95 | = 1.0.1 = 96 | * Prioritizing the Optimizely code snippet so that it appears above other scripts. 97 | 98 | = 1.0.0 = 99 | * Introducing the Optimizely WordPress plugin. Now it's even easier to start improving your website. 100 | 101 | == Upgrade Notice == 102 | There are no upgrade notices 103 | -------------------------------------------------------------------------------- /admin.php: -------------------------------------------------------------------------------- 1 | 12 |
13 |

%s %s %s.', 15 | esc_html__( 'Optimizely is almost ready. You must first add your', 'optimizely' ), 16 | esc_html__( 'API Token', 'optimizely' ), 17 | esc_html__( 'in the', 'optimizely' ), 18 | esc_html__( 'configuration tab', 'optimizely' ) 19 | );?>

20 |
21 | 25 |
26 |

. 27 |

28 |
29 | ' . esc_html__( 'Settings', 'optimizely' ) . ''; 51 | } 52 | 53 | return $links; 54 | } 55 | add_filter( 'plugin_action_links', 'optimizely_plugin_action_links', 10, 2 ); 56 | 57 | /** 58 | * Update the Optimizely configuration. 59 | */ 60 | function optimizely_conf() { 61 | if ( isset( $_POST['submit'] ) ) { 62 | if ( ! current_user_can( apply_filters( 'optimizely_admin_capability', 'manage_options' ) ) ) { 63 | die( __( 'Cheatin’ uh?', 'optimizely' ) ); 64 | } 65 | 66 | // Check the nonce 67 | check_admin_referer( OPTIMIZELY_NONCE ); 68 | 69 | // Sanitize values 70 | $token = sanitize_text_field( $_POST['token'] ); 71 | $project_id = sanitize_text_field( $_POST['project_id'] ); 72 | $num_variations = sanitize_text_field( $_POST['optimizely_num_variations'] ); 73 | $optimizely_post_types = array_map( 'sanitize_text_field', $_POST['optimizely_post_types'] ); 74 | $optimizely_visitor_count = str_replace( ',', '', sanitize_text_field( $_POST['optimizely_visitor_count'] ) ); 75 | $project_name = sanitize_text_field( stripcslashes( $_POST['project_name'] ) ); 76 | $variation_template = sanitize_text_field( stripcslashes( $_POST['variation_template' ] ) ); 77 | $activation_mode = sanitize_text_field( $_POST['optimizely_activation_mode' ] ); 78 | $conditional_activation_code = sanitize_text_field( stripcslashes( $_POST['conditional_activation_code' ] ) ); 79 | $optimizely_url_targeting_type = sanitize_text_field( $_POST['optimizely_url_targeting_type'] ); 80 | $optimizely_url_targeting = sanitize_text_field( $_POST['optimizely_url_targeting'] ); 81 | 82 | // Either save or delete/set a default if empty for each value 83 | if ( empty( $token ) ) { 84 | delete_option( 'optimizely_token' ); 85 | } else { 86 | update_option( 'optimizely_token', $token ); 87 | } 88 | 89 | if ( empty( $project_id ) ) { 90 | delete_option( 'optimizely_project_id' ); 91 | } else { 92 | update_option( 'optimizely_project_id', $project_id ); 93 | } 94 | 95 | if ( empty( $num_variations ) ) { 96 | delete_option( 'optimizely_num_variations' ); 97 | } else { 98 | update_option( 'optimizely_num_variations', $num_variations ); 99 | } 100 | 101 | if ( empty( $optimizely_post_types ) ) { 102 | update_option( 'optimizely_post_types', '' ); 103 | } else { 104 | $post_type_string = ''; 105 | foreach ( $optimizely_post_types as $post_type ) { 106 | $post_type_string = $post_type_string . $post_type . ','; 107 | } 108 | update_option( 'optimizely_post_types', trim( $post_type_string, ',' ) ); 109 | } 110 | 111 | if ( empty( $project_name ) ) { 112 | delete_option( 'optimizely_project_name' ); 113 | } else { 114 | update_option( 'optimizely_project_name', $project_name ); 115 | } 116 | 117 | if ( empty( $variation_template ) ) { 118 | update_option( 'optimizely_variation_template', OPTIMIZELY_DEFAULT_VARIATION_TEMPLATE ); 119 | } else { 120 | update_option( 'optimizely_variation_template', $variation_template ); 121 | } 122 | 123 | if ( empty( $conditional_activation_code ) ) { 124 | update_option( 'optimizely_conditional_activation_code', OPTIMIZELY_DEFAULT_CONDITIONAL_TEMPLATE ); 125 | } else { 126 | update_option( 'optimizely_conditional_activation_code', $conditional_activation_code ); 127 | } 128 | 129 | if ( empty( $activation_mode ) ) { 130 | delete_option( 'optimizely_activation_mode', 'immediate' ); 131 | } else { 132 | update_option( 'optimizely_activation_mode', $activation_mode ); 133 | } 134 | 135 | if ( empty( $optimizely_url_targeting ) ) { 136 | delete_option( 'optimizely_url_targeting', get_site_url() ); 137 | } else { 138 | update_option( 'optimizely_url_targeting', $optimizely_url_targeting ); 139 | } 140 | 141 | if ( empty( $optimizely_url_targeting_type ) ) { 142 | delete_option( 'optimizely_url_targeting_type', 'substring' ); 143 | } else { 144 | update_option( 'optimizely_url_targeting_type', $optimizely_url_targeting_type ); 145 | } 146 | 147 | ?> 148 |

.

149 | ' ).text( 'Loading projects...' ); 15 | $( '#project_id' ).html( '' ); 16 | $( '#project_id' ).append( $loading ); 17 | 18 | optly = new OptimizelyAPI( $( '#token' ).val() ); 19 | 20 | optly.get( 'projects', function( response ) { 21 | $( '#project_id' ).empty(); 22 | $.each( response, function( key, val ) { 23 | $option = $( '