profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/GaryJones/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Gary Jones GaryJones Automattic (@Automattic ) Basingstoke, UK https://garyjones.io/ WordPress VIP Premier Engineering Lead at @Automattic, formerly running @gamajo. WordPress core contributor.

cedaro/satispress 382

Expose installed WordPress plugins and themes as Composer packages.

bradyvercher/gistpress 148

WordPress plugin to add Gist oEmbed and shortcode support with caching.

gamajo/dashboard-glancer 46

Class to help add items to the WordPress 3.8+ At a Glance dashboard widget (and 3.7- Right Now widget too)

GaryJones/accessible-menu 19

Making WordPress navigation menus a little more accessible.

cftp/sync-post-types-to-taxonomies 16

A WordPress plugin providing an API for plugin developers to sync specified a post type with a specified taxonomy, multiple pairs of post types and taxonomies can be synced.

cdils/utility-pro 14

Utility Pro Theme

gamajo/codeception-redirects 10

Test URL redirects in Codeception

GaryJones/allow-duplicate-slugs 7

WordPress plugin to allow duplicate slugs across different post types

gamajo/quadratic 3

PHP classes for working with, and solving, quadratic equations.

GaryJones/better-admin-post-types 2

A plugin for WordPress that places all post types underneath an admin menu named content.

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentParsely/wp-parsely

Fix rendering errors when rendering multiple recommendation widgets

 public function widget( $args, $instance ) {  		$reco_widget_script_asset = require PARSELY_PLUGIN_DIR . 'build/admin-page.asset.php'; +		?>++		<div class="parsely-recommended-widget"+			data-parsely-widget-display-author="<?php echo esc_attr( isset( $instance['display_author'] ) ? wp_json_encode( boolval( $instance['display_author'] ) ) : false ); ?>"+			data-parsely-widget-display-direction="<?php echo esc_attr( isset( $instance['display_direction'] ) ? $instance['display_direction'] : null ); ?>"

Instead of adding null string to the attribute, could an empty string be used instead? Just seems cleaner.

pauarge

comment created time in 44 minutes

PullRequestReviewEvent

pull request commentParsely/wp-parsely

Improving reliability of get_current_url tests

The focus of these tests is on the parsing issues related to the domain, port, and potential path, and this is represented in the data provider.

However, it's good to be able to confirm that going to the homepage, random URL and a post via its ID, also work well for each of the combinations in the first parts of the URL.

Since the setup is the same for each of the tests, we can just merge these three tests into one, and have it test the homepage, a specific post, and a random URL, and add the message attribute to the assertions to make it clear which part might have failed.

If you're happy with my changes @pauarge, then I can rebase into a single commit or it can be merged with a squash, to keep the history cleaner.

pauarge

comment created time in an hour

push eventParsely/wp-parsely

Gary Jones

commit sha 6e02e3471a59a9db0ec331585cb778d4ae3437fc

Tests: Improve get current URL tests The focus of these tests is on the parsing issues related to the domain, port, and potential path, and this is represented in the data provider. However, it's good to be able to confirm that going to the homepage, random URL and a post via it's ID, also work well for each of the combinations in the first parts of the URL.

view details

push time in an hour

push eventParsely/wp-parsely

Gary Jones

commit sha 835a8a8476424915ac50a5da14936385e7707e98

Tests: Improve get current URL tests The focus of these tests is on the parsing issues related to the domain, port, and potential path, and this is represented in the data provider. However, it's good to be able to confirm that going to the homepage, random URL and a post via it's ID, also work well for each of the combinations in the first parts of the URL.

view details

push time in an hour

PullRequestReviewEvent

Pull request review commentParsely/wp-parsely

Fix rendering errors when rendering multiple recommendation widgets

 .parsely-recommended-widget-entry img { 	float: left; 	margin-right: 15px;-	max-width: 50%;

How does this change fit in?

pauarge

comment created time in 21 hours

PullRequestReviewEvent

issue openedParsely/wp-parsely

Add remaining namespaces

Is your feature request related to a problem?

Most src/ and tests/ files have got a PHP namespace, but a couple of old ones don't.

Describe the solution you'd like

Add namespaces, and rename the classes as necessary.

Describe alternatives you've considered

Not changing, but then consistency of namespaces is better.

Additional context

<!-- Add any other context or screenshots about the feature request here. -->

created time in a day

push eventParsely/wp-parsely

Gary Jones

commit sha 982568d8d1185749e7ab49297220642db22f552d

Tests: Run on PHP 8.1 with allowed failures

view details

push time in a day

push eventParsely/wp-parsely

Gary Jones

commit sha eecc17dc7c36e878be726cd9cb783aacff08356c

Tests: Run on PHP 8.1 with allowed failures

view details

push time in a day

push eventParsely/wp-parsely

Gary Jones

commit sha b866847a736ab3d2fb6bae24ed6dbeb616172d85

Tests: Run on PHP 8.1 with allowed failures

view details

push time in a day

create barnchParsely/wp-parsely

branch : fix/test-8.1

created branch time in a day

Pull request review commentParsely/wp-parsely

Hide admin warning on network admin

 public function display_admin_warning() { 		<?php 	} +	/**+	 * Decide wheter the admin display warning should be displayed+	 *+	 * @category Function+	 * @package Parsely+	 *+	 * @return bool True if the admin warning should be displayed+	 */+	private function should_display_admin_warning() {+		if ( is_network_admin() ) {+			return false;+		}++		$options = $this->get_options();+		if ( isset( $options['apikey'] ) && ! empty( $options['apikey'] ) ) {

Opened https://github.com/Parsely/wp-parsely/issues/395 as checking for a saved API key is indeed a bigger issue.

pauarge

comment created time in 2 days

PullRequestReviewEvent

issue openedParsely/wp-parsely

Create utility method for checking for saved API key

Is your feature request related to a problem?

There are multiple occurrences in the codebase where the behaviour changes depending on whether the API key setting has been populated or not. Each of these are directly coupled to retrieving options and checking if a value is empty or not falsy (and a string, etc.). It's inconsistent.

Describe the solution you'd like

The logic would be cleaner if we had utility methods like $this->api_key_is_empty() and $this->api_key_is_set() that returned a boolean, so these are then more descriptive and abstracted away from the idea that options are from an array pulled from the database.

Describe alternatives you've considered

The alternative it to leave it like so (these are all examples in the current codebase):

$options = get_option( \Parsely::OPTIONS_KEY );

if ( empty( $options['apikey'] ) ) { 
// or
if ( ! ( $options['apikey'] ) ) {
// or
if ( ! array_key_exists( 'apikey', $options ) || '' === $options['apikey'] ) {
// or
if ( ! (
	isset( $options['apikey'] ) &&
	is_string( $options['apikey'] ) &&
	strlen( $options['apikey'] ) > 0
) ) {

Additional context

Unit tests can still use the set_options() test method to set the value of the saved option as needed, without having to mock the new methods (though that is also possible if needed).

created time in 2 days

push eventParsely/wp-parsely

Pau Argelaguet

commit sha 9243d4131063ac5ea758a89a7e3c119127de2b5b

Hide admin warning on network admin

view details

Pau Argelaguet

commit sha d0e7bd0bce81c554e3334877415c8b3e8eb58a0a

Fix typo

view details

Pau Argelaguet

commit sha 51274e009b7885a11dc9e6ca8956494d40f8b3b6

Adding unit tests

view details

Pau Argelaguet

commit sha 0aa14f96900409ea301a900286e2e8704819b714

Fix linting issues

view details

Pau Argelaguet

commit sha 5f6118d2723f5cda973e25e7ae493bffe468250c

Simplifying set_options on test

view details

Pau Argelaguet

commit sha f01baa57220c760f7f3583bde36ca93594a51ff2

Merge branch 'develop' into fix/network-admin-notice

view details

Pau Argelaguet

commit sha cbbd6376eacbd865dd76d7a242676a8a7696648a

Separating function for testing

view details

Pau Argelaguet

commit sha 4ed732c781368681c38d1cbaaed4089a7d329063

Merge branch 'fix/network-admin-notice' of github.com:Parsely/wp-parsely into fix/network-admin-notice

view details

Pau Argelaguet

commit sha ddce11d8cd4d7d70ad2b3fa24936102a78a8ecd7

Update @covers annotation

view details

Pau Argelaguet

commit sha 1c1f57b1ae4aa4c3d3dec8a594dbe735d80f6ad0

Simplifying logic

view details

Gary Jones

commit sha fb68cffafe01b27edb2c198408e610ff7b437fa3

Merge pull request #392 from Parsely/fix/network-admin-notice

view details

push time in 2 days

delete branch Parsely/wp-parsely

delete branch : fix/network-admin-notice

delete time in 2 days

PR merged Parsely/wp-parsely

Hide admin warning on network admin [Status] Needs Review

Description

The plugin displays a warning message on wp-admin if it's activated but it's not active (no Parse.ly API key has been provided). This message would appear in the network admin of a multisite WordPress installation. If a user follows the provided link, they would go to the network's root site and only activate the plugin for that site, not the whole network.

To avoid confusion, we are now not displaying the warning in the network admin (i.e. /wp-admin/network/) and only doing so in root wp-admin.

Motivation and Context

https://github.com/Parsely/wp-parsely/issues/326

How Has This Been Tested?

Tested that it hides the message in a multisite installation and it does nothing on a non-multisite installation.

Screenshots (if appropriate):

Before

Screen Shot 2021-09-21 at 4 09 49 PM

After

Screen Shot 2021-09-21 at 4 10 17 PM

Types of changes

Bug fix (non-breaking change which fixes an issue)

+75 -4

0 comment

3 changed files

pauarge

pr closed time in 2 days

PullRequestReviewEvent

issue openedParsely/wp-parsely

Add uninstall.php to clean up settings on uninstall

Is your feature request related to a problem?

When the plugin is uninstalled via the UI or CLI, it can leave its settings in the wp_options table. While not a huge issue, it would be nicer to clean that up.

Describe the solution you'd like

As per https://developer.wordpress.org/plugins/plugin-basics/uninstall-methods/ then we can include a uninstall.php that can delete the saved option.

Describe alternatives you've considered

Could use the uninstall hook, but it's clearer to put the uninstall code into its own file anyway.

created time in 2 days

Pull request review commentParsely/wp-parsely

Hide admin warning on network admin

 public function display_admin_warning() { 		<?php 	} +	/**+	 * Decide wheter the admin display warning should be displayed+	 *+	 * @category Function+	 * @package Parsely+	 *+	 * @return bool True if the admin warning should be displayed+	 */+	private function should_display_admin_warning() {+		if ( is_network_admin() ) {+			return false;+		}++		$options = $this->get_options();+		if ( isset( $options['apikey'] ) && ! empty( $options['apikey'] ) ) {

I think the isset() here can be dropped, as empty() already checks for that.

Then we're left with a negative condition that could be reversed and return true; instead, or simplify the whole condition down to return empty( $options['apikey'] );

I think the "get options and check if apikey is not empty populated" could be extracted to its own helper method, so return ! $this->has_saved_api_key(); or return $this->api_key_not_set(); or similar.

pauarge

comment created time in 2 days

PullRequestReviewEvent

push eventParsely/wp-parsely

Jeff Bowen

commit sha 5fd97a6b501eb10dccfd2963df304db9fdbd586d

Add step to node test to confirm the build is up-to-date

view details

Jeff Bowen

commit sha e04add85052241d18f78eb05b689ec48b84c6413

demonstrate failure case when untracked file is present

view details

Jeff Bowen

commit sha 9079569fb225074c2ec4d5d2fe9ff3d1bdebc346

demonstrate failure case when change to src is not present in build

view details

Jeff Bowen

commit sha 3859df8a393ba705b1bea64ea9b2effc2b230e50

remove failure -- this should pass

view details

Pau Argelaguet

commit sha 7928967ac15bc257e9d62cf96412f8fb9b6e264a

Merge branch 'develop' into add-js-build-test

view details

Jeff Bowen

commit sha 63de51ffeced84d321b582ff14ab0e97246c7f9d

Merge branch 'develop' into add-js-build-test

view details

Pau Argelaguet

commit sha 7a4c4179f4ae14c29c0de68186c7b6f86af6e2d6

Merge branch 'develop' into add-js-build-test

view details

Pau Argelaguet

commit sha 47509df1c7096e736e194031f825dc86a034bbe3

Clarifying success message

view details

Pau Argelaguet

commit sha 4b7bbec4235099bcffd0a048aa870eb657ad0dc7

Updating built files

view details

Pau Argelaguet

commit sha 3657ff689feb7ce74172b4e18d8dffa50c0cfcd7

Fixing syntax error

view details

Pau Argelaguet

commit sha f3d1a354fbdfa84d9169a5ed7df639eece6448fc

Merge branch 'develop' into add-js-build-test

view details

Gary Jones

commit sha d3dfbed97a51dd787b329514585084fed2ab7fac

Merge branch 'develop' into add-js-build-test

view details

Gary Jones

commit sha bd8cdd1373d0cae2ffee79928733da690218119a

Merge pull request #374 from Parsely/add-js-build-test

view details

push time in 3 days

delete branch Parsely/wp-parsely

delete branch : add-js-build-test

delete time in 3 days

PR merged Parsely/wp-parsely

Reviewers
Add a step to the node CI test to confirm built scripts are included in the change [Status] Needs Review

<!--- Provide a general summary of your changes in the Title above -->

Description

<!--- Describe your changes in detail -->

After CI runs npm run build, flag the branch a failure if any uncommitted changes are detected.

Motivation and Context

<!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. -->

Currently, there's no enforcement that built JS files are included when the source changes (or if build tooling alters the build). This seeks to provide some protection that build files are kept up to date with those changes.

How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. -->

See the commit history & screen shots below.

Screenshots (if appropriate):

Screen Shot 2021-09-12 at 2 13 04 PM
Fail when files are missing in the build dir after build
Screen Shot 2021-09-12 at 2 16 40 PM
Fail when changes to src are not present in build
Screen Shot 2021-09-12 at 2 18 50 PM
Success when no uncommitted changes are present

Types of changes

<!--- What types of changes does your code introduce? Put an x in all the boxes that apply: --> Dev Tooling

+11 -0

1 comment

1 changed file

jblz

pr closed time in 3 days

push eventParsely/wp-parsely

Gary Jones

commit sha 6d38b71ff2062d840415ae3a8abaa3c80d81321e

Integrations: Extract into separate classes - Move AMP and Facebook Instant Article integrations into separate files. - Improve and add tests that better check for the intended behaviour.

view details

Pau Argelaguet

commit sha 7d07cebac6fcf70f191371e3dbad24b052d69e6f

Merge branch 'develop' into experimental/refactor-integrations

view details

Pau Argelaguet

commit sha c182be2264da13d4b036bdb2e73c8eb3723fd6db

Merge branch 'develop' into experimental/refactor-integrations

view details

Gary Jones

commit sha 8384aceed0d56e2c6172add00e1fd18ff0006fed

Integrations: Extract into separate classes - Move AMP and Facebook Instant Article integrations into separate files. - Improve and add tests that better check for the intended behaviour.

view details

Gary Jones

commit sha 887e3c56c9857a10ae0263bd3896800842ebb603

Merge branch 'experimental/refactor-integrations' of github.com:Parsely/wp-parsely into experimental/refactor-integrations

view details

Gary Jones

commit sha 41281969c5220d1a182a51e7fc0e9b8be091c6ff

Merge pull request #345 from Parsely/experimental/refactor-integrations

view details

Gary Jones

commit sha d3dfbed97a51dd787b329514585084fed2ab7fac

Merge branch 'develop' into add-js-build-test

view details

push time in 3 days

push eventParsely/wp-parsely

Gary Jones

commit sha 6d38b71ff2062d840415ae3a8abaa3c80d81321e

Integrations: Extract into separate classes - Move AMP and Facebook Instant Article integrations into separate files. - Improve and add tests that better check for the intended behaviour.

view details

Pau Argelaguet

commit sha 7d07cebac6fcf70f191371e3dbad24b052d69e6f

Merge branch 'develop' into experimental/refactor-integrations

view details

Pau Argelaguet

commit sha c182be2264da13d4b036bdb2e73c8eb3723fd6db

Merge branch 'develop' into experimental/refactor-integrations

view details

Gary Jones

commit sha 8384aceed0d56e2c6172add00e1fd18ff0006fed

Integrations: Extract into separate classes - Move AMP and Facebook Instant Article integrations into separate files. - Improve and add tests that better check for the intended behaviour.

view details

Gary Jones

commit sha 887e3c56c9857a10ae0263bd3896800842ebb603

Merge branch 'experimental/refactor-integrations' of github.com:Parsely/wp-parsely into experimental/refactor-integrations

view details

Gary Jones

commit sha 41281969c5220d1a182a51e7fc0e9b8be091c6ff

Merge pull request #345 from Parsely/experimental/refactor-integrations

view details

push time in 3 days