Could Be A Constant

Those literals are assigned then compared somewhere else in the code. When those literals are carrying a state, it is recommended to assign them to a constant, to ensure that both parts of the application use the same values..

LiteralAssignationsComparisons
3
  • $rows = 3
  • $times = 3
  • $times < 3
200
  • $words_per_minute = 200
  • $limits->status !== 200
  • $response_code === 200
1000
  • $limit = 1000
  • $value < 1000
on
  • $val = 'on'
  • $_SERVER['HTTPS'] === 'on'
  • $is_overridden === 'on'
  • $meta_data['wpseo_noindex_author'] === 'on'
  • $multiple_locations !== 'on'
  • $multiple_locations === 'on'
  • $same_organization !== 'on'
  • $same_organization === 'on'
  • $shared_info !== 'on'
  • $shared_info === 'on'
  • $source_options['use_multiple_locations'] === 'on'
  • $value === 'on'
utf-8
  • $this->output_charset = 'UTF-8'
  • $this->charset !== 'UTF-8'
noindex
  • $new_robot_value = 'noindex'
  • $option_value[$taxonomy][$term_id][$key] = 'noindex'
  • $robots['index'] = 'noindex'
  • $meta_value === 'noindex'
  • $robots['index'] === 'noindex'
  • $tax_noindex === 'noindex'
  • $value === 'noindex'
publish
  • $posts['post_status'] = 'publish'
  • $new_status !== 'publish'
  • $post->post_status !== 'publish'
text
  • $type = 'text'
  • $field_def['type'] === 'text'
url
  • $type = 'url'
  • $attr['type'] === 'url'
  • $field_def['type'] === 'url'
  • $what === 'url'
full
  • $image['size'] = 'full'
  • $image_size = 'full'
  • $size === 'full'
1
  • $clean = '1'
  • $site->$state_slug === '1'
  • $type === '1'
  • $value === '1'
category
  • $category_base = 'category'
  • $setting['subtype'] === 'category'
  • $subtype === 'category'
  • $taxonomy !== 'category'
  • $taxonomy === 'category'
index
  • $new_robot_value = 'index'
  • $meta_value === 'index'
  • $no_index === 'index'
description
  • $this->meta_key = 'description'
  • $column_name === 'description'
yes
  • $yoast_seo_dashicon = 'yes'
  • $_GET['allow_tracking'] === 'yes'
error
  • $yoast_seo_status = 'error'
  • $a_type === 'error'
  • $b_type === 'error'
updated
  • $yoast_seo_status = 'updated'
  • $settings_errors[0]['type'] === 'updated'
collectionpage
  • $type = 'CollectionPage'
  • $data['@type'] === 'CollectionPage'
post
  • $indexable->object_type = 'post'
  • $post_robot_mapping['subtype'] = 'post'
  • $_SERVER['REQUEST_METHOD'] === 'POST'
  • $context->indexable->object_sub_type !== 'post'
  • $context->indexable->object_type === 'post'
  • $indexable->object_type !== 'post'
  • $indexable->object_type === 'post'
  • $page_type === 'post'
  • $params['slug'] === 'post'
  • $parent !== 'post'
  • $parent === 'post'
  • $post_type === 'post'
  • $pt->name === 'post'
  • $request_method === 'POST'
  • $target->object_type === 'post'
  • $this->context->indexable->object_sub_type === 'post'
  • $this->context->indexable->object_type !== 'post'
  • $this->context->indexable->object_type === 'post'
  • $this->model->object_sub_type !== 'post'
  • $this->presentation->model->object_sub_type !== 'post'
  • $this->presentation->model->object_sub_type === 'post'
off
  • $val = 'off'
  • $source_options['multiple_locations_shared_business_info'] === 'off'
trash
  • $states['trash'] = 'trash'
  • $post_status === 'trash'
  • $rec->post_status !== 'trash'
  • $requested_state !== 'trash'
-1
  • $current_filter = '-1'
  • $_GET['cat'] === '-1'
wpseo_manage_options
  • $submenu_pages[$index][3] = 'wpseo_manage_options'
  • $capability === 'wpseo_manage_options'
hidden
  • WPSEO_Meta::$meta_fields['advanced']['wordproof_timestamp']['type'] = 'hidden'
  • $field_def['type'] === 'hidden'
  • $meta_field_def['type'] === 'hidden'
/
  • $permalink_parts['path'] = '/'
  • $home_path === '/'
  • $image['url'][0] === '/'
  • $img[0] !== '/'
  • $path !== '/'
  • $src[0] !== '/'
set-by-user
  • $indexable->open_graph_image_source = 'set-by-user'
  • $indexable->twitter_image_source = 'set-by-user'
  • $source === 'set-by-user'
  • $this->context->indexable->twitter_image_source === 'set-by-user'
0
  • $site_logo_id = '0'
  • $ancestors[0]['ancestor_id'] === '0'
  • $count !== '0'
  • $exists->deleted === '0'
  • $main_taxonomy === '0'
  • $noindex === '0'
  • $result === '0'
  • $value === '0'
post_tag
  • $subtype = 'post_tag'
  • $taxonomy === 'post_tag'
none
  • $robots['max-image-preview'] = 'none'
  • $additional_type === 'None'
  • $this->context->schema_article_type !== 'None'
  • $type === 'None'
tracking
  • $option_name = 'tracking'
  • $feature_setting === 'tracking'
user
  • $indexable->object_type = 'user'
  • $indexable->object_type === 'user'
  • $this->context->indexable->object_type === 'user'
post-type-archive
  • $indexable->object_type = 'post-type-archive'
  • $indexable->object_type === 'post-type-archive'
term
  • $indexable->object_type = 'term'
  • $child->object_type === 'term'
  • $context->indexable->object_type === 'term'
  • $indexable->object_type === 'term'
unindexed
  • $indexable->post_status = 'unindexed'
  • $ancestor->post_status === 'unindexed'
  • $static_ancestor->post_status !== 'unindexed'
  • $this->permalink === 'unindexed'
system-page
  • $indexable->object_type = 'system-page'
  • $indexable->object_type === 'system-page'
  • $this->context->indexable->object_type === 'system-page'
home-page
  • $indexable->object_type = 'home-page'
  • $indexable->object_type === 'home-page'
default
  • $researcher_language = 'default'
  • $image_type === 'default'
  • $no_index !== 'default'
tag
  • $taxonomy = 'tag'
  • $subtype === 'tag'
imported
  • $indexable->$image_source_key = 'imported'
  • $source === 'imported'