Notices about PHP errors and warnings

PHP errors can be indicative of problems with theme functionality, security or performance and should be fixed to ensure everything on the site is working as expected. By reducing PHP errors on your site, you are:

  1. Making it easier to spot bugs on your site
  2. Creating a more defensive codebase
  3. Ensuring it’s easier for us to debug your site if there’s a problem
  4. Reducing the risk of your site breaking unintentionally

If you are not sure what to do about the errors on your site, please check with your development team as they should be able to assist in resolving them.

If you have SVN write access to a WordPress.com VIP repository, you may receive an email indicating there are PHP errors or warnings that need to be fixed:

 

This email is sent out when our system detects that your site has produced more than 100 errors in the last 24 hours.

If you are an Administrator on a WordPress.com VIP site, you may see a notice indicating there are PHP errors or warnings that need to be fixed:

Screen Shot 2016-03-25 at 16.37.35

This notice appears when our system detects that the site in question has generated over 100 errors and/or warnings in the PHP error logs associated with the site.

Administrators can view more information about the PHP errors by visiting the VIP Dashboard and scrolling down to view the widget titled “PHP Errors and Warnings from the last 24h.” It might look something like this:

Screen Shot 2016-03-25 at 16.42.13

This widget was made available in January 2016.

If you still have any questions, please open a support ticket.

Custom Fields

The custom fields UI isn’t included on WordPress.com — it’s clunky, dependent on theme customizations, and poses some security risks. You’ll want to explicitly add any individual custom fields that your themes or plugins use using a plugin like Fieldmanager

Customizing Invites

On WordPress.com, new users need to be invited to your site. The default behavior for invitations is to allow any WordPress.com user accept an invitation regardless of whether their email address matches what the invitation was sent to. Here’s a helper function you can use to force the invitation email to match the WordPress.com user’s email address:

wpcom_invite_force_matching_email_address();

Faux Single Sign-On (SSO)

Single Sign-On allows your visitors to have a consistent and personalized experience.

The current approach is to encrypt and store non-sensitive information in a browser cookie that is accessed directly from the theme. This cookie data is used to do things like pre-populate comment forms based on previous user input, or otherwise personalize the viewer’s experience.

We also update our batcache configuration to bypass various caches when these cookies exist, mimicking the experience of traditional logged-in WP.com users.

The most common use-cases for this are leveraging external registration systems (such as our partners at Janrain, or your own custom system) to seamlessly interact with WordPress.com (without the need to create WP.com accounts for those users) and commenting systems like Livefyre or IntenseDebate.

For an example implementation, take a look at the FrontEnd Cookie SSO plugin.

Please contact us to explore this further, or to work out the specific technical details.

Custom User Roles

Sometimes the default roles and capabilities aren’t exactly what you need for your site. If you need to create new roles or modify existing ones, we have a bunch of helper functions to assist you in doing this. Please use these functions rather than the traditional methods as this will ensure that your code works on WordPress.com and in your development environments.

As an example, here’s how you can register a “Reviewer” role:

add_action( 'init', function() {
    wpcom_vip_add_role( 'reviewer', 'Reviewer', array(
        'read' => true,
        'edit_posts' => true,
        'edit_others_posts' => true,
        'edit_private_posts' => true,
        'edit_published_posts' => true,
        'read_private_posts' => true,
        'edit_pages' => true,
        'edit_others_pages' => true,
        'edit_private_pages' => true,
        'edit_published_pages' => true,
        'read_private_pages' => true,
    ) );
} );

Note: you’ll want to use these helper functions on the ‘init’ hook.

You can find all available capabilities in WordPress Codex.

Here are some more examples:

add_action( 'init', function() {
	// Add new role
	wpcom_vip_add_role( 'super-editor', 'Super Editor', array( 'level_0' => true ) );

	// Remove publish_posts cap from authors
	wpcom_vip_merge_role_caps( 'author', array( 'publish_posts' => false ) );

	// Remove all caps from contributors
	wpcom_vip_override_role_caps( 'contributor', array( 'level_0' => false ) );

	// Duplicate an existing role and modify some caps
	wpcom_vip_duplicate_role( 'administrator', 'station-administrator', 'Station Administrator', array( 'manage_categories' => false ) );

	// Add custom cap to a role
	wpcom_vip_add_role_caps( 'administrator', array( 'my-custom-cap' ) );

	// Remove cap from a role
	wpcom_vip_remove_role_caps( 'author', array( 'publish_posts' ) );
} );

Ready to get started?

Tell us about your needs

Let us lead the way. We’ll help you select a top tier development partner. We’ll train your developers, operations, infrastructure, and editorial teams. We’ll coarchitect your deployment processes. We will provide live support for peak events. We’ll help your people avoid dark alleys and blind corners, and reduce wasted cycles.