WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #22316, comment 205


Ignore:
Timestamp:
09/19/2021 11:09:45 PM (5 weeks ago)
Author:
afragen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22316, comment 205

    initial v1  
    22922550637
    33}}}
    4 [https://github.com/afragen afragen] commented on [https://github.com/WordPress/wordpress-develop/pull/1674#issuecomment-922550637 PR #1674]:
     4[https://github.com/afragen afragen] commented on [https://github.com/WordPress/wordpress-develop/pull/1674 PR1674]:
    55
    66State of the [https://github.com/WordPress/wordpress-develop/pull/1674 PR1674]
     
    1616Uses a configuration array and command to initialize. `slug` is used to target the plugin row to deactivate the ability to delete or deactivate installed activated dependencies and to designate the dot org download link. This PR uses a class instance so that multiple configuration sources may be properly used.
    1717
    18 <img width="699" alt="screenshot_101" src="https://user-images.githubusercontent.com/1296790/133944455-ae17c09e-cef2-4d41-82eb-71b7783fa0de.png">
     18[[Image(https://i0.wp.com/user-images.githubusercontent.com/1296790/133944455-ae17c09e-cef2-4d41-82eb-71b7783fa0de.png)]]
     19
    1920
    2021This PR does not try to control plugin activation. Every plugin developer should be responsible and ensure that their plugin degrades gracefully if a required dependency is not present and active. This is the current state of core and I believe it is out of scope to address this particular aspect. This PR does not force anything. If the user does not wish to install or activate a dependency all they must do is dismiss the admin notice and it will not reappear for a specified period of time.
     
    2425Dependent plugins may be in either other plugins, themes, or both. In this example `Hello Dolly` is a required plugin for both **Plugin Dependency Feature** and **TwentyNineteen**.
    2526
    26 <img width="982" alt="screenshot_100" src="https://user-images.githubusercontent.com/1296790/133944560-4c6072cb-a4d8-455f-a78b-3eafba1add4b.png">
     27[[Image(https://i0.wp.com/user-images.githubusercontent.com/1296790/133944560-4c6072cb-a4d8-455f-a78b-3eafba1add4b.png)]]
    2728
    2829Admin Notices designate what is requiring the dependency and a link to install or activate the dependency. If the same dependency is in a theme, that is listed as themes load first.
     
    3031After the dependency is installed an admin notice to activate it will display. The dependent plugin will show itself as a **Required Plugin** and list what plugins or themes it is **Required by**
    3132
    32 <img width="979" alt="screenshot_102" src="https://user-images.githubusercontent.com/1296790/133945075-cd6806e2-1996-4fcd-9bff-fd9541a4ef54.png">
     33[[Image(https://i0.wp.com/user-images.githubusercontent.com/1296790/133945075-cd6806e2-1996-4fcd-9bff-fd9541a4ef54.png)]]
    3334
    3435If a dependency is not in dot org, though it can have an install link, it will result in a failure.
    3536
    36 <img width="975" alt="screenshot_103" src="https://user-images.githubusercontent.com/1296790/133944682-de91bbc1-4137-4b07-80a9-4b6d2c8c310f.png">
     37[[Image(https://i0.wp.com/user-images.githubusercontent.com/1296790/133944682-de91bbc1-4137-4b07-80a9-4b6d2c8c310f.png)]]
    3738
    3839All admin notices are dismissible. The default is for 14 days, but this can be modified by a filter for anywhere from 1 day to forever. All that must be done is click the dismiss button. Notice the WooCommerce notice is no longer present.
     
    4041Once activated a dependent plugin cannot be deactivated or deleted until the dependent plugin or theme is deactivated.
    4142
    42 <img width="982" alt="screenshot_104" src="https://user-images.githubusercontent.com/1296790/133944982-362fe800-9d0d-48fc-87a8-40586e415a51.png">
     43[[Image(https://i0.wp.com/user-images.githubusercontent.com/1296790/133944982-362fe800-9d0d-48fc-87a8-40586e415a51.png)]]
    4344
    4445In this case the theme was changed and  the plugin deactivated.
    4546
    46 <img width="975" alt="screenshot_105" src="https://user-images.githubusercontent.com/1296790/133945028-d3360341-e106-4ca1-a24b-e68d48129cd9.png">
     47[[Image(https://i0.wp.com/user-images.githubusercontent.com/1296790/133945028-d3360341-e106-4ca1-a24b-e68d48129cd9.png)]]
    4748
    48 <img width="975" alt="screenshot_105" src="https://user-images.githubusercontent.com/1296790/133945020-522c7c4f-b4d6-42d8-bac3-49b4d83350dc.png">
    4949
    5050The additional benefit of this PR is that it includes code for time dismissible admin notices that may be used for admin notices outside of this scope.