Classic Editor Addon - Version 2.6.2

Version Description

  • August 1, 2020
  • remove WooCommerce block-ui scripts
  • update WP Dependency Installer
  • tested up to WP 5.5.0
Download this release

Release Info

Developer senlin
Plugin Icon wp plugin Classic Editor Addon
Version 2.6.2
Comparing to
See all releases

Code changes from version 2.6.1 to 2.6.2

classic-editor-addon.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
  /**
3
  * Plugin Name: Classic Editor Addon
4
- * Description: This free "Classic Editor Addon" plugin makes sure that the new block editor cannot be accidentally activated and blocks the calls to additional styles from the `&lt;head&gt;` (frontend). See README for details.
5
 
6
  * Author: <a href="https://so-wp.com">Pieter Bos</a>, <a href="https://gschoppe.com">Greg Schoppe</a>
7
- * Version: 2.6.1
8
 
9
  * Requires at least: 4.9
10
- * Tested up to: 5.3.2
11
 
12
  * License: GPL-3.0+
13
  * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
@@ -57,6 +57,9 @@ function classic_editor_addon_remove_block_styles() {
57
  if ( class_exists( 'woocommerce' ) ) {
58
  wp_dequeue_style( 'wc-block-style' );
59
  wp_deregister_style( 'wc-block-style' );
 
 
 
60
  }
61
 
62
  }
1
  <?php
2
  /**
3
  * Plugin Name: Classic Editor Addon
4
+ * Description: This free "Classic Editor Addon" plugin makes sure that the new block editor cannot be accidentally activated and blocks the calls to additional styles from the <code>&lt;head&gt;</code> (frontend). See README for details.
5
 
6
  * Author: <a href="https://so-wp.com">Pieter Bos</a>, <a href="https://gschoppe.com">Greg Schoppe</a>
7
+ * Version: 2.6.2
8
 
9
  * Requires at least: 4.9
10
+ * Tested up to: 5.5.0
11
 
12
  * License: GPL-3.0+
13
  * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
57
  if ( class_exists( 'woocommerce' ) ) {
58
  wp_dequeue_style( 'wc-block-style' );
59
  wp_deregister_style( 'wc-block-style' );
60
+ // @2.6.2 remove WooCommerce block scripts
61
+ wp_dequeue_script( 'jquery-blockui' );
62
+ wp_deregister_script( 'jquery-blockui' );
63
  }
64
 
65
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: senlin, gschoppe
3
  Tags: gutenberg, block editor, classic editor, addon, wordpress 5.0, woocommerce
4
  Requires at least: 4.9
5
  Requires PHP: 5.6
6
- Tested up to: 5.4
7
- Stable tag: 2.6.1
8
  License: GPL-3.0+
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
10
 
@@ -17,7 +17,7 @@ This free "Classic Editor Addon" plugin makes sure that the new block editor can
17
  The free Classic Editor Addon plugin is targeted at everyone who is not yet ready for the new editing experience that has been introduced in WordPress 5.0. Install it now on sites and the UX remains the same as you are used to!
18
 
19
  <strong>What's New:</strong>
20
- Update WP Dependency Installer
21
 
22
  Please pay attention that the minimum PHP version to use our plugin is <strong>5.6</strong>.
23
 
@@ -63,6 +63,13 @@ Please open an issue on [Github](https://github.com/senlin/classic-editor-addon/
63
 
64
  == Changelog ==
65
 
 
 
 
 
 
 
 
66
  = 2.6.1 =
67
 
68
  * March 5, 2020
3
  Tags: gutenberg, block editor, classic editor, addon, wordpress 5.0, woocommerce
4
  Requires at least: 4.9
5
  Requires PHP: 5.6
6
+ Tested up to: 5.5
7
+ Stable tag: 2.6.2
8
  License: GPL-3.0+
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
10
 
17
  The free Classic Editor Addon plugin is targeted at everyone who is not yet ready for the new editing experience that has been introduced in WordPress 5.0. Install it now on sites and the UX remains the same as you are used to!
18
 
19
  <strong>What's New:</strong>
20
+ Remove WooCommerce block-ui scripts (if plugin is active)
21
 
22
  Please pay attention that the minimum PHP version to use our plugin is <strong>5.6</strong>.
23
 
63
 
64
  == Changelog ==
65
 
66
+ = 2.6.2 =
67
+
68
+ * August 1, 2020
69
+ * remove WooCommerce block-ui scripts
70
+ * update WP Dependency Installer
71
+ * tested up to WP 5.5.0
72
+
73
  = 2.6.1 =
74
 
75
  * March 5, 2020
vendor/afragen/wp-dependency-installer/README.md CHANGED
@@ -1,5 +1,5 @@
1
  # WP Dependency Installer
2
- * Contributors: [Andy Fragen](https://github.com/afragen), [Matt Gibbs](https://github.com/mgibbs189), [contributors](https://github.com/afragen/wp-dependency-installer/graphs/contributors)
3
  * Tags: plugin, dependency, install
4
  * Requires at least: 5.1
5
  * Requires PHP: 5.6
@@ -7,107 +7,101 @@
7
  * Donate link: <https://thefragens.com/wp-dependency-installer-donate>
8
  * License: MIT
9
 
10
- A lightweight class to add to WordPress plugins or themes to automatically install required plugin dependencies. Uses a JSON config file to declare plugin dependencies.
11
 
12
- ## Description
13
-
14
- This is a drop in class for developers to optionally or automatically install plugin dependencies for their own plugins or themes. It can install a plugin from w.org, GitHub, Bitbucket, GitLab, Gitea, or a direct URL. You must include a JSON config file in the root directory of the plugin/theme file.
15
-
16
- This contains an example plugin and an example JSON configuration file. Only required dependencies are installed automatically, optional dependencies are not. Required dependencies are always kept active.
17
-
18
- ## Installation
19
-
20
- WP Dependency Installer v2.0.0 or greater now requires PHP 5.6 or greater and WordPress 5.1 or greater.
21
 
22
- Install the package via composer.
23
 
24
- Run the composer command: ```composer require afragen/wp-dependency-installer```
25
-
26
- Then create a new `wp-dependencies.json` file.
27
-
28
- ```cp ./vendor/afragen/wp-dependency-installer/wp-dependencies-example.json wp-dependencies.json```
29
 
30
- You will then need to update `wp-dependencies.json` to suit your requirements.
31
 
32
- Add the following lines to your plugin or to your theme's `functions.php` file.
33
 
34
- ```php
35
- include_once( __DIR__ . '/vendor/autoload.php' );
36
- WP_Dependency_Installer::instance()->run( __DIR__ );
37
  ```
38
 
39
- ## JSON config file format
40
-
41
- This file must be named `wp-dependencies.json` and it must be in the root directory of your plugin or theme.
42
 
43
- ```json
44
  [
45
- {
46
- "name": "Query Monitor",
47
- "host": "wordpress",
48
- "slug": "query-monitor/query-monitor.php",
49
- "uri": "https://wordpress.org/plugins/query-monitor/",
50
- "optional": false
51
- },
52
  {
53
  "name": "GitHub Updater",
54
  "host": "github",
55
  "slug": "github-updater/github-updater.php",
56
  "uri": "afragen/github-updater",
57
- "branch": "master",
58
- "optional": false,
59
  "token": null
60
  },
61
  {
62
- "name": "Test Plugin Notags",
63
- "host": "bitbucket",
64
- "slug": "test-plugin-notags/test-plugin-notags.php",
65
- "uri": "https://bitbucket.org/afragen/test-plugin-notags",
66
- "branch": "master",
67
  "optional": true
68
  },
69
  {
70
- "name": "Test Gitlab Plugin2",
71
- "host": "gitlab",
72
- "slug": "test-gitlab-plugin2/test-gitlab-plugin2.php",
73
- "uri": "https://gitlab.com/afragen/test-gitlab-plugin2",
74
- "branch": "develop",
75
- "optional": true,
76
- "token": null
77
- },
78
- {
79
- "name": "Test Direct Plugin Download",
80
- "host": "direct",
81
- "slug": "test-direct-plugin/test-plugin.php",
82
- "uri": "https://direct-download.com/path/to.zip",
83
- "optional": true
84
  }
85
  ]
86
  ```
87
 
88
- An example file is included, `wp-dependencies-example.json`. You may use a shorthand uri such as `<owner>/<repo>` in the JSON.
89
 
90
- If you want to programmatically add dependencies you can send an associative array directly to
91
 
92
  ```php
93
- WP_Dependency_Installer::instance()->register( $config )
94
- ```
95
 
96
- where `$config` is an associative array as in identical format as `json_decode( wp-dependencies.json content )`
 
 
97
 
98
- The default timeout for dismissal of a notification is 7 days. There is a filter `wp_dependency_timeout` to adjust this on a per project basis.
99
 
100
  ```php
 
 
 
101
  add_filter(
102
- 'wp_dependency_timeout', function( $timeout, $source ) {
103
- $timeout = $source !== basename( __DIR__ ) ? $timeout : 14;
104
- return $timeout;
 
105
  }, 10, 2
106
  );
107
  ```
108
 
109
- The download link can be filtered using the filter hook `wp_dependency_download_link`. The `$download_link` and the `$dependency` are passed as parameters.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
 
111
  ## Development
112
 
113
- PRs are welcome against the `develop` branch.
1
  # WP Dependency Installer
2
+ * Contributors: [Andy Fragen](https://github.com/afragen), [Matt Gibbs](https://github.com/mgibbs189), [Raruto](https://github.com/Raruto), [contributors](https://github.com/afragen/wp-dependency-installer/graphs/contributors)
3
  * Tags: plugin, dependency, install
4
  * Requires at least: 5.1
5
  * Requires PHP: 5.6
7
  * Donate link: <https://thefragens.com/wp-dependency-installer-donate>
8
  * License: MIT
9
 
10
+ This is a drop in class for developers to optionally or automatically install plugin dependencies for their own plugins or themes. It can install a plugin from wp.org, GitHub, Bitbucket, GitLab, Gitea, or a direct URL.
11
 
12
+ [Comprehensive information regarding WP Dependency Installer is available on the wiki.](https://github.com/afragen/wp-dependency-installer/wiki)
 
 
 
 
 
 
 
 
13
 
14
+ See also: [example plugin](https://github.com/afragen/wp-dependency-installer-examples).
15
 
16
+ ## Description
 
 
 
 
17
 
18
+ You can use **composer** to install this package within your WordPress plugin / theme.
19
 
20
+ 1. Within your plugin or theme root folder, run the following command:
21
 
22
+ ```shell
23
+ composer require afragen/wp-dependency-installer
 
24
  ```
25
 
26
+ 2. Then create a sample [**`wp-dependencies.json`**](https://github.com/afragen/wp-dependency-installer/wiki/Configuration#json-config-file-format) file
 
 
27
 
28
+ ```js
29
  [
 
 
 
 
 
 
 
30
  {
31
  "name": "GitHub Updater",
32
  "host": "github",
33
  "slug": "github-updater/github-updater.php",
34
  "uri": "afragen/github-updater",
35
+ "branch": "develop",
36
+ "required": true,
37
  "token": null
38
  },
39
  {
40
+ "name": "Query Monitor",
41
+ "host": "wordpress",
42
+ "slug": "query-monitor/query-monitor.php",
43
+ "uri": "https://wordpress.org/plugins/query-monitor/",
 
44
  "optional": true
45
  },
46
  {
47
+ "name": "Local Development",
48
+ "host": "WordPress",
49
+ "slug": "local-development/local-development.php",
50
+ "uri": "https://wordpress.org/plugins/local-development/",
51
+ "required": true
 
 
 
 
 
 
 
 
 
52
  }
53
  ]
54
  ```
55
 
56
+ You will then need to update `wp-dependencies.json` to suit your requirements.
57
 
58
+ 3. Finally add the following lines to your plugin or theme's `functions.php` file:
59
 
60
  ```php
61
+ require_once __DIR__ . '/vendor/autoload.php';
62
+ WP_Dependency_Installer::instance( __DIR__ )->run();
63
 
64
+ // Needed in theme's functions.php file.
65
+ add_filter( 'pand_theme_loader', '__return_true' );
66
+ ```
67
 
68
+ 4. (optional) Take a look at some of built in [Hooks](https://github.com/afragen/wp-dependency-installer/wiki/Actions-and-Hooks) and [Functions](https://github.com/afragen/wp-dependency-installer/wiki/Helper-Functions) to further customize your plugin look and behaviour:
69
 
70
  ```php
71
+ /**
72
+ * Display your plugin or theme name in dismissable notices.
73
+ */
74
  add_filter(
75
+ 'wp_dependency_dismiss_label',
76
+ function( $label, $source ) {
77
+ $label = basename( __DIR__ ) !== $source ? $label : __( 'Group Plugin Installer', 'group-plugin-installer' );
78
+ return $label;
79
  }, 10, 2
80
  );
81
  ```
82
 
83
+ 5. Sanity Check
84
+
85
+ ```php
86
+ // Sanity check for WPDI v3.0.0.
87
+ if ( ! method_exists( 'WP_Dependency_Installer', 'json_file_decode' ) ) {
88
+ add_action(
89
+ 'admin_notices',
90
+ function() {
91
+ $class = 'notice notice-error is-dismissible';
92
+ $label = __( 'Your Plugin Name', 'your-plugin' );
93
+ $file = ( new ReflectionClass( 'WP_Dependency_Installer' ) )->getFilename();
94
+ $message = __( 'Another theme or plugin is using a previous version of the WP Dependency Installer library, please update this file and try again:', 'group-plugin-installer' );
95
+ printf( '<div class="%1$s"><p><strong>[%2$s]</strong> %3$s</p><pre>%4$s</pre></div>', esc_attr( $class ), esc_html( $label ), esc_html( $message ), esc_html( $file ) );
96
+ },
97
+ 1
98
+ );
99
+ return false; // Exit early.
100
+ }
101
+ ```
102
+
103
+ That's it, happy blogging!
104
 
105
  ## Development
106
 
107
+ PRs are welcome against the `develop` branch.
vendor/afragen/wp-dependency-installer/composer.json CHANGED
@@ -1,7 +1,8 @@
1
  {
2
  "name": "afragen/wp-dependency-installer",
3
  "description": "Library that helps WordPress plugin dependency management.",
4
- "version": "2.0.0",
 
5
  "license": "MIT",
6
  "authors": [
7
  {
@@ -12,6 +13,12 @@
12
  },
13
  {
14
  "name": "Matt Gibbs",
 
 
 
 
 
 
15
  "role": "Developer"
16
  }
17
  ],
@@ -29,4 +36,4 @@
29
  "wp-dependency-installer.php"
30
  ]
31
  }
32
- }
1
  {
2
  "name": "afragen/wp-dependency-installer",
3
  "description": "Library that helps WordPress plugin dependency management.",
4
+ "version": "3.0.0",
5
+ "type": "library",
6
  "license": "MIT",
7
  "authors": [
8
  {
13
  },
14
  {
15
  "name": "Matt Gibbs",
16
+ "homepage": "https://facetwp.com",
17
+ "role": "Developer"
18
+ },
19
+ {
20
+ "name": "Raruto",
21
+ "homepage": "https://raruto.github.io",
22
  "role": "Developer"
23
  }
24
  ],
36
  "wp-dependency-installer.php"
37
  ]
38
  }
39
+ }
vendor/afragen/wp-dependency-installer/wp-dependency-installer.php CHANGED
@@ -179,7 +179,7 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
179
  $uri_args = parse_url( $uri ); // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url
180
  $port = isset( $uri_args['port'] ) ? $uri_args['port'] : null;
181
  $api = isset( $uri_args['host'] ) ? $uri_args['host'] : null;
182
- $api = ! $port ? $api : "$api:$port";
183
  $scheme = isset( $uri_args['scheme'] ) ? $uri_args['scheme'] : null;
184
  $scheme = null !== $scheme ? $scheme . '://' : 'https://';
185
  $path = isset( $uri_args['path'] ) ? $uri_args['path'] : null;
@@ -580,12 +580,12 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
580
  $source = untrailingslashit( $source );
581
  // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition
582
  while ( false !== ( $file = readdir( $dir ) ) ) {
583
- if ( ( '.' !== $file ) && ( '..' !== $file ) && "$source/$file" !== $destination ) {
584
- if ( is_dir( "$source/$file" ) ) {
585
- $this->move( "$source/$file", "$destination/$file" );
586
  } else {
587
- copy( "$source/$file", "$destination/$file" );
588
- unlink( "$source/$file" );
589
  }
590
  }
591
  }
@@ -838,4 +838,4 @@ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
838
  public function feedback( $string, ...$args ) {
839
  }
840
  }
841
- }
179
  $uri_args = parse_url( $uri ); // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url
180
  $port = isset( $uri_args['port'] ) ? $uri_args['port'] : null;
181
  $api = isset( $uri_args['host'] ) ? $uri_args['host'] : null;
182
+ $api = ! $port ? $api : "{$api}:{$port}";
183
  $scheme = isset( $uri_args['scheme'] ) ? $uri_args['scheme'] : null;
184
  $scheme = null !== $scheme ? $scheme . '://' : 'https://';
185
  $path = isset( $uri_args['path'] ) ? $uri_args['path'] : null;
580
  $source = untrailingslashit( $source );
581
  // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition
582
  while ( false !== ( $file = readdir( $dir ) ) ) {
583
+ if ( ( '.' !== $file ) && ( '..' !== $file ) && "{$source}/{$file}" !== $destination ) {
584
+ if ( is_dir( "{$source}/{$file}" ) ) {
585
+ $this->move( "{$source}/{$file}", "{$destination}/{$file}" );
586
  } else {
587
+ copy( "{$source}/{$file}", "{$destination}/{$file}" );
588
+ unlink( "{$source}/{$file}" );
589
  }
590
  }
591
  }
838
  public function feedback( $string, ...$args ) {
839
  }
840
  }
841
+ }