From 790b61c1bd7617d0b37c280660ef93c5881feda6 Mon Sep 17 00:00:00 2001 From: Tony Volpe Date: Wed, 21 Feb 2024 14:17:19 +0000 Subject: [PATCH] * MAW-863: environment cleanup * MAW-863: plugin install(vwo) * MAW-869: Disable Auto-Update --- README.md | 45 --- wp/google2804da411db9e9fe.html | 1 - wp/readme.md | 39 -- wp/wp-config.php | 2 +- wp/wp-config.php_local | 71 ---- .../mu-plugins/disable-plugin-updates.php | 8 + .../plugins/visual-web-optimizer/readme.txt | 132 ++++++ .../visual-website-optimizer.php | 378 ++++++++++++++++++ 8 files changed, 519 insertions(+), 157 deletions(-) delete mode 100644 README.md delete mode 100644 wp/google2804da411db9e9fe.html delete mode 100644 wp/readme.md delete mode 100644 wp/wp-config.php_local create mode 100644 wp/wp-content/mu-plugins/disable-plugin-updates.php create mode 100644 wp/wp-content/plugins/visual-web-optimizer/readme.txt create mode 100644 wp/wp-content/plugins/visual-web-optimizer/visual-website-optimizer.php diff --git a/README.md b/README.md deleted file mode 100644 index 16eff969..00000000 --- a/README.md +++ /dev/null @@ -1,45 +0,0 @@ -**Edit a file, create a new file, and clone from Bitbucket in under 2 minutes** - -When you're done, you can delete the content in this README and update the file with details for others getting started with your repository. - -*We recommend that you open this README in another tab as you perform the tasks below. You can [watch our video](https://youtu.be/0ocf7u76WSo) for a full demo of all the steps in this tutorial. Open the video in a new tab to avoid leaving Bitbucket.* - ---- - -## Edit a file - -You’ll start by editing this README file to learn how to edit a file in Bitbucket. - -1. Click **Source** on the left side. -2. Click the README.md link from the list of files. -3. Click the **Edit** button. -4. Delete the following text: *Delete this line to make a change to the README from Bitbucket.* -5. After making your change, click **Commit** and then **Commit** again in the dialog. The commit page will open and you’ll see the change you just made. -6. Go back to the **Source** page. - ---- - -## Create a file - -Next, you’ll add a new file to this repository. - -1. Click the **New file** button at the top of the **Source** page. -2. Give the file a filename of **contributors.txt**. -3. Enter your name in the empty file space. -4. Click **Commit** and then **Commit** again in the dialog. -5. Go back to the **Source** page. - -Before you move on, go ahead and explore the repository. You've already seen the **Source** page, but check out the **Commits**, **Branches**, and **Settings** pages. - ---- - -## Clone a repository - -Use these steps to clone from SourceTree, our client for using the repository command-line free. Cloning allows you to work on your files locally. If you don't yet have SourceTree, [download and install first](https://www.sourcetreeapp.com/). If you prefer to clone from the command line, see [Clone a repository](https://confluence.atlassian.com/x/4whODQ). - -1. You’ll see the clone button under the **Source** heading. Click that button. -2. Now click **Check out in SourceTree**. You may need to create a SourceTree account or log in. -3. When you see the **Clone New** dialog in SourceTree, update the destination path and name if you’d like to and then click **Clone**. -4. Open the directory you just created to see your repository’s files. - -Now that you're more familiar with your Bitbucket repository, go ahead and add a new file locally. You can [push your change back to Bitbucket with SourceTree](https://confluence.atlassian.com/x/iqyBMg), or you can [add, commit,](https://confluence.atlassian.com/x/8QhODQ) and [push from the command line](https://confluence.atlassian.com/x/NQ0zDQ). \ No newline at end of file diff --git a/wp/google2804da411db9e9fe.html b/wp/google2804da411db9e9fe.html deleted file mode 100644 index 901ca53a..00000000 --- a/wp/google2804da411db9e9fe.html +++ /dev/null @@ -1 +0,0 @@ -google-site-verification: google2804da411db9e9fe.html \ No newline at end of file diff --git a/wp/readme.md b/wp/readme.md deleted file mode 100644 index be76eaf3..00000000 --- a/wp/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# WordPress - -This is a WordPress repository configured to run on the [Pantheon platform](https://pantheon.io). - -Pantheon is website platform optimized and configured to run high performance sites with an amazing developer workflow. There is built-in support for features such as Varnish, Redis, Apache Solr, New Relic, Nginx, PHP-FPM, MySQL, PhantomJS and more.  - -## Getting Started - -### 1. Spin-up a site - -If you do not yet have a Pantheon account, you can create one for free. Once you've verified your email address, you will be able to add sites from your dashboard. Choose "WordPress" to use this distribution. - -### 2. Load up the site - -When the spin-up process is complete, you will be redirected to the site's dashboard. Click on the link under the site's name to access the Dev environment. - -![alt](http://i.imgur.com/2wjCj9j.png?1, '') - -### 3. Run the WordPress installer - -How about the WordPress database config screen? No need to worry about database connection information as that is taken care of in the background. The only step that you need to complete is the site information and the installation process will be complete. - -We will post more information about how this works but we recommend developers take a look at `wp-config.php` to get an understanding. - -![alt](http://i.imgur.com/4EOcqYN.png, '') - -If you would like to keep a separate set of configuration for local development, you can use a file called `wp-config-local.php`, which is already in our .gitignore file. - -### 4. Enjoy! - -![alt](http://i.imgur.com/fzIeQBP.png, '') - -## Branches - -The `default` branch of this repository is where PRs are merged, and has [CI](https://github.com/pantheon-systems/WordPress/tree/default/.circleci) that copies `default` to `master` after removing the CI directories. This allows customers to clone from `master` and implement their own CI without needing to worry about potential merge conflicts. - -## Custom Upstreams - -If you are using this repository as a starting point for a custom upstream, be sure to review the [documentation](https://pantheon.io/docs/create-custom-upstream#pull-in-core-from-pantheons-upstream) and pull the core files from the `master` branch. diff --git a/wp/wp-config.php b/wp/wp-config.php index 46f9a51d..b171bfe0 100644 --- a/wp/wp-config.php +++ b/wp/wp-config.php @@ -1,5 +1,4 @@ ` and before the `` + += If I use this plugin, do I need to enter any other code on my website? = +No, this plugin is sufficient by itself + +== Screenshots == +1. Settings page (Asynchronous Code) +2. Settings page (Synchronous Code) + +== ChangeLog == += 4.1 = +* Tested with latest version +* PHPCS Errors resolved +* WP Rocket support added + += 4.0 = +* Tested with latest version +* VWO SmartCode updated + += 3.9 = +* Tested with latest version +* Code improvement and add Rocket loader handling + += 3.8 = +* Tested with latest version +* Fix WP Rocket Issue + += 3.7 = +* Tested with latest version +* Fix Divi Frontend Editor Issue + += 3.6 = +* Tested with latest version + += 3.5 = +* Tested with latest version +* Rename label "Handle Rocket Loader Issue" to "Skip Deferred Execution" +* Set field default value of "Skip Deferred Execution" to "yes" + += 3.4 = +* Tested with latest version +* Code improvement and add Rocket loader handling + += 3.3 = +* Tested with latest version +* Add new options in settings + += 3.2 = +* Tested with latest version + += 3.1 = +* Add Setting link in plugin listing page + += 3.0 = +* Update Logo and links + += 2.9 = +* Tested with latest version + += 2.8 = +* Tested with latest version + += 2.7 = +* Update Plugin Name, Author and Description + += 2.6 = +* Remove Conflict Errors + += 2.5 = +* Update tested upto version + += 2.4 = +* Update links + += 2.3 = +* Minor bug fix + += 2.2 = +* Bug fix to have default tolerance values when plugin is updated + += 2.1 = +* Better documentation + += 2.0 = +* Option to choose between asynchronous or synchronous code +* Updated code snippet +* Faster website loading + += 1.3 = +* code snippet updated + += 1.0.1 = +* use Website instead of Web in name of functions and readme (branding) + += 1.0 = +* First Version + +== Upgrade Notice == +Option to choose the new asynchronous code. This will make the website load faster + +== Configuration == + +Enter your ID in the field marked 'YOUR VWO ACCOUNT ID' + +== Adding to your template == + +header code : +`` + +footer code : +`` \ No newline at end of file diff --git a/wp/wp-content/plugins/visual-web-optimizer/visual-website-optimizer.php b/wp/wp-content/plugins/visual-web-optimizer/visual-website-optimizer.php new file mode 100644 index 00000000..d7bbee13 --- /dev/null +++ b/wp/wp-content/plugins/visual-web-optimizer/visual-website-optimizer.php @@ -0,0 +1,378 @@ +VWO for more details. + * Author: VWO + * Version: 4.1 + * visual-website-optimizer.php + * Author URI: https://vwo.com/ + * + * @package VWO + * @author VWO + * @version 4.1 + **/ + +/** + * Generate Common Code + * + * @param integer $vwo_clicks integer. Defaults to 10. + */ +function get_vwo_clhf_script_common_code( $vwo_clicks = 10 ) { + ob_start(); + // @codingStandardsIgnoreStart + ?> + + + + + + + + + + + + + '; + ?> +

VWO

+

You need to have a VWO account in order to use this plugin. This plugin inserts the neccessary code into your WordPress site automatically without you having to touch anything. In order to use the plugin, you need to enter your VWO Account ID:

+
+ + + + + + + + + + + + + + + + > + + + + + > + + + + + > + + + + + + + +
Your VWO Account ID
No. of Heatmap Clicks
Code (default: Asynchronous) + + /> Asynchronous    + + /> Synchronous +  [Help] +
Settings Timeoutms (default: 2000)
Library Timeoutms (default: 2500)
Use Existing jQuery + />Yes
Skip Deferred Execution + />Yes
+ + +

+

Your Account ID (a number) can be found in Settings area (top-right) after you login into your VWO account.

+ '; +} + +/** + * Displays a warning message if VWO settings are not configured. + * This function checks if the user is an admin and if the VWO ID option is set. If the user is not an admin or + * the VWO ID option is not set, it displays a warning message. + * + * @throws Exception Description of exception. + * @return void + */ +function vwo_clhf_warn_nosettings() { + if ( ! is_admin() ) { + return; + } + + $clhf_option = get_option( 'vwo_id' ); + if ( ! $clhf_option || $clhf_option < 1 ) { + echo "

VWO is almost ready. You must enter your Account ID for it to work.

"; + } +} + + +add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'vwo_clhf_add_plugin_page_settings_link' ); + +/** + * Function to add Settings Links on Plugin page + * + * @param array $links Array of links. + * @return array + */ +function vwo_clhf_add_plugin_page_settings_link( $links ) { + $links[] = '' . __( 'Settings' ) . ''; + return $links; +} + +/** + * Disables VWO in Divi Builder. + * + * @throws Exception Description of exception. + * @return void + */ +function disable_vwo_in_divi_builder() { + if ( has_action( 'wp_head', 'vwo_clhf_headercode' ) && function_exists( 'et_core_is_fb_enabled' ) && et_core_is_fb_enabled() ) { + remove_action( 'wp_head', 'vwo_clhf_headercode', 1 ); + } +} + +add_action( 'wp_head', 'disable_vwo_in_divi_builder', 0 ); + +?> \ No newline at end of file