[wp-trac] [WordPress Trac] #53076: Press This: Add filters to allow custom Press This plugins

WordPress Trac noreply at wordpress.org
Fri Mar 7 01:18:05 UTC 2025


#53076: Press This: Add filters to allow custom Press This plugins
----------------------------------------+-----------------------------
 Reporter:  kraftbj                     |       Owner:  kraftbj
     Type:  enhancement                 |      Status:  accepted
 Priority:  normal                      |   Milestone:  Future Release
Component:  Editor                      |     Version:  4.9
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch has-testing-info  |     Focuses:
----------------------------------------+-----------------------------
Changes (by SirLouen):

 * keywords:  has-patch needs-testing needs-testing-info => has-patch has-
     testing-info


Comment:

 == Combined Test Report and Patch Testing
 === Description
 ๐ŸŸ  This report validates that the patch is working with a minor error

 I have simply replicated the original "Press This" plugin and added a very
 trivial modification. We have to remember that the idea here is simply
 adding the capacity to a user to modifying the "Press This" plugin without
 risking an update, hence simply changing the basic namespace elements of
 the plugin. This patch adds the possibility of modifying all the static
 strings for this purpose.

 Patch tested: https://patch-diff.githubusercontent.com/raw/WordPress
 /wordpress-develop/pull/1207.diff

 === Environment
 - WordPress: 6.8-beta1-59933-src
 - PHP: 8.2.25
 - Server: nginx/1.27.2
 - Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.25)
 - Browser: Chrome 133.0.0.0
 - OS: Windows 10/11
 - Theme: Twenty Twenty 2.8
 - MU Plugins: None activated
 - Plugins:
 ย ย * Test Reports 1.2.0

 === Steps to Reproduce the Patch
 1. First install a slightly modified version of Press This. In this case
 I'm using this one I've uploaded to my repo for the testing purpose:
 https://github.com/SirLouen/press-this-testing/archive/refs/tags/1.0.0.zip
 2. Install the Bookmarklet and use the plugin
 3. ๐Ÿž Bug occurs as expected https://i.imgur.com/lRvokvf.png

 === Actual Results After adding the patch

 ==== First filter: press_this_plugin_slug ====
 1. For the first filter we install the first modified version of this
 Press This plugin: https://github.com/SirLouen/press-this-
 testing/archive/refs/tags/1.0.1.zip
 2.ย  โŒ The test fails with an error.

 The problem is that the code forces the use of not only the first filter,
 but also the second filter. I have added a new patch to sort this out, so
 the user can simply use the first filter to set a new slug (which is, in
 fact, the main purpose of this feature, adding the possibility of having
 an alt-version of Press This without having to edit the versioning over
 the official Press This plugin)

 ==== Second filter: press_this_plugin_slug ====
 1. We install the modified version of this Press This plugin with this
 test: https://github.com/SirLouen/press-this-
 testing/archive/refs/tags/1.0.2.zip
 2. โœ… The test passes correctly

 ==== Third filter: press_this_execution_func ====
 1. We install the modified version of this Press This plugin with this
 test: https://github.com/SirLouen/press-this-
 testing/archive/refs/tags/1.0.3.zip
 2. โœ…First we do a function for the filter without returning a callable
 and returns the appropriate error as expected:
 https://i.imgur.com/ksOUYii.png
 3. โœ… Second we do a function returning a new callable with a slight class
 naming mod and the test passes correctly

 === Supplemental Artifacts
 All the required artifacts have been linked in the corresponding tests.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53076#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list