The Release Candidate for the WordPress Parse.ly plugin 3.0 is now available. It can be downloaded here.
This RC version is already available for users to test in the VIP platform. To enable this version, the following code is required:
add_filter(
'wpvip_parsely_version',
function() {
return '3.0';
}
);
add_filter( 'wpvip_parsely_load_mu', '__return_true' );
The final version will be released in the coming weeks and will be made available to VIP sites at the same time. However, 3.0 will not be the default version on the VIP platform until Q1 2022 (the 2.6 branch will remain the default until then).
What is being added or changed?
From the plugin’s changelog:
Important information about this release
wp-parsely 3.0.0 is a major release of the Parse.ly WordPress plugin. The major version bump is because we are introducing a number of breaking changes that have allowed us to modernize the codebase and make future features easier to implement.
The biggest breaking change is the new minimum requirements for running the plugin. You now need PHP 7.1 or newer and WordPress 5.0 or newer. If you are running one of those old versions, you shouldn’t get the update option on your WordPress admin.
If you are using the plugin without any code-level customizations (for instance, calling the plugin’s functions or methods or hooking in the plugin’s WordPress hooks), this update should be seamless and everything should keep operating normally. The plugin’s way of working is still fundamentally the same. If you are using those customizations, we recommend you going through the detailed changelog to see if they affect you. In most of the cases, only trivial changes will be required to make your code work.
Added
- Namespaces to files. #430 #475 #477
- Now all functions and classes are under the
Parselynamespace, or a child namespace of that e.g.Parsely\ParselyorParsely\UI\Recommended_Widget. If your code is calling a wp-parsely function (directly, or as a hook callback) without the namespace, then you’ll need to update that call. - Strict typing (
strict_types=1) to all files in the codebase #420. - Passing a value to a function in wp-parsely with an incorrect type will now raise an error.
- Type declarations have been added to function returns #429 and arguments #455.
wp_parsely_should_insert_metadatafilter. #440- The filter controls whether the Parse.ly metadata should be inserted in the page’s HTML. By default, the meta tags are rendered (the filter returns
true). wp_parsely_enable_cfasync_tagfilter. #473.- The Cloudflare
cfasyncattributes are now not rendered by default, but they can be enabled by returningtrueto this filter. - WordPress plugin uninstall script. #444
- When the plugin is uninstalled, the options will be removed from the database. Deactivating the plugin will not cause the options to be deleted.
npm run dev:startandnpm run dev:stopcommands to run the plugin locally for development purposes. #493- E2E test for recommended widget. #434
- JavaScript code-scanning #453
Changed
- Minimum PHP and WP versions required to run the plugin are now 7.1 (from 5.6) and 5.0 from (4.0), respectively. #416
- The development Node JS version has been bumped from 14 to 16.
- Extract logic from
class-parsely.phpfile: - Extract admin warning to
Parsely\UI\Admin_Warning. #468 - Extract tracker logic to
Parsely\Scripts#478 - Extract settings page to
Parsely\UI\Settings_Page. #467 - Rename
Parsely_Recommended_Widgetclass toParsely\UI\Recommended_Widget. - Rename methods in
Parsely\Scriptsclass #481: register_js()toregister_scripts().load_js_api()toenqueue_js_api().load_js_tracker()toenqueue_js_tracker().- Move Parse.ly settings file to
views/parsely-settings.php. #459 - Open on Parse.ly links are displayed by default. #433
- To disable the feature, the
wp_parsely_enable_row_action_linksfilter must returnfalse. Parsely::get_current_url()default value for argumentstring $parsely_typechanged fromnonposttonon-post. #447- This change has been done to better align with Parse.ly’s backend.
- Enqueue scripts with theme independent hook. #458
- The JavaScript scripts are now enqueued at the
wp_enqueue_scriptshook instead ofwp_footer. - Replace multi-select fields with checkboxes on the settings page. #482
- Existing selections will be retained.
- Made class members private #486:
Parsely\Integrations\Facebook_Instant_Articles:REGISTRY_IDENTIFIER,REGISTRY_DISPLAY_NAME,get_embed_code().Parsely\UI\Recommended_Widget:get_api_url().- Tests: Specify
coverage: nonewhere it is not needed. #419 - Bump @wordpress/e2e-test-utils from 5.4.3 to 5.4.8. #492
- Bump @wordpress/scripts from 18.0.1 to 19.1.0. #480
- Bump @wordpress/eslint-plugin from 9.2.0 to 9.3.0. #490
Fixed
- Fix missing translation support for Yes and No labels in the settings page. #463
- Avoid making duplicate calls to Parse.ly API on the Recommended Widget’s front-end. #460
- Fix JS string translation in settings page. #462
- Consistent return types on
update_metadata_endpoint. #446 - The function used to return different return types, now it always returns
void. - Consistent return type on
insert_parsely_page. #443 - The function used to return
string|null|array, now it returnsvoid. - Tests: Stop using deprecated
setMethods()method. #427 - e2e tests: fix watch command. #476
- Fix non-working README code example. #439
Removed
- Previously deprecated filter
after_set_parsely_page. #436 - Use
wp_parsely_metadatainstead. - Previously deprecated filter
parsely_filter_insert_javascript. #437 - Use
wp_parsely_load_js_trackerinstead. post_has_viewable_typefunction. #417- Use
is_post_viewableinstead. Thepost_has_viewable_typefunction was only added to support older versions of WordPress. - Custom Parse.ly load text domain. #457
- Since the plugin now supports versions of WordPress that load custom text domains automatically, the plugins doesn’t have to explicitly load the text domain itself.
- Empty functions for admin settings. #456
- The callbacks were never utilised.
- Redundant code coverage annotations. #469
- Old init Python script. #441
- “Add admin warning for minimum requirements in 3.0” notice. #424
- This was only added in the previous version of the plugin.
- Upgrade README notice. #470